Sha256: ab1c06ef7940e9ed6592aa3f74caa5e0df834fdb1ba2ce37ac3ab6debd2d8889

Contents?: true

Size: 930 Bytes

Versions: 109

Compression:

Stored size: 930 Bytes

Contents

# frozen_string_literal: true

# :nocov:

module Primer
  module Alpha
    class ActionBar
      # ActionBar::Item is an internal component that wraps the items in a div with the `ActionBar-item` class.
      class Item < Primer::Component
        # @param item_content [String] The content to render inside the item.
        # @param item_arguments [Hash] <%= link_to_system_arguments_docs %>
        def initialize(item_content, **item_arguments)
          @system_arguments = {
            tag: item_arguments[:tag] || :div,
            data: {
              targets: "action-bar.items"
            }.merge(item_arguments[:data] || {}),
            classes: class_names("ActionBar-item", item_arguments[:classes])
          }

          @item_content = item_content
        end

        def call
          render(Primer::BaseComponent.new(**@system_arguments)) { render(@item_content) }
        end
      end
    end
  end
end

Version data entries

109 entries across 109 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.52.2 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.36.4 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.52.1 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.52.0 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.36.3 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.51.0 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.36.2 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.50.1 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.50.0 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.36.1 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.36.0 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.49.2 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.35.2 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.49.1 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.49.0 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.35.1 app/components/primer/alpha/action_bar/item.rb
primer_view_components-0.35.0 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.48.2 app/components/primer/alpha/action_bar/item.rb
openproject-primer_view_components-0.48.1 app/components/primer/alpha/action_bar/item.rb