Sha256: 2de1c92df5655b87db08ac8e56f5095eed27cf29b3feeebf235ef70aa66241a2

Contents?: true

Size: 458 Bytes

Versions: 18

Compression:

Stored size: 458 Bytes

Contents

module Lookbook
  class ButtonGroup::Component < Lookbook::BaseComponent
    renders_many :buttons, ->(copy: nil, **attrs, &block) do
      attrs[:size] = @size
      instance = if copy.present?
        CopyButton::Component.new(target: copy, **attrs)
      else
        Button::Component.new(**attrs)
      end
      render instance, &block
    end

    def initialize(size: :md, **html_attrs)
      @size = size
      super(**html_attrs)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
lookbook-1.0.8 app/components/lookbook/button_group/component.rb
lookbook-1.0.7 app/components/lookbook/button_group/component.rb
lookbook-1.0.6 app/components/lookbook/button_group/component.rb
lookbook-1.0.5 app/components/lookbook/button_group/component.rb
lookbook-1.0.4 app/components/lookbook/button_group/component.rb
lookbook-1.0.3 app/components/lookbook/button_group/component.rb
lookbook-1.0.2 app/components/lookbook/button_group/component.rb
lookbook-1.0.1 app/components/lookbook/button_group/component.rb
lookbook-1.0.0 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.rc.3 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.rc.2 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.rc.1 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.8 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.7 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.6 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.5 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.4 app/components/lookbook/button_group/component.rb
lookbook-1.0.0.beta.3 app/components/lookbook/button_group/component.rb