Sha256: 2a2a9b1bb67a9d87f92e1431dae09677ff3c8c35d396e7fdca0368888bcb25c1

Contents?: true

Size: 438 Bytes

Versions: 48

Compression:

Stored size: 438 Bytes

Contents

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

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

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
lookbook-2.0.0.beta.9 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.7 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.6 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.5 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.4 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.3 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.2 app/components/lookbook/button_group/component.rb
lookbook-1.5.3 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.1 app/components/lookbook/button_group/component.rb
lookbook-1.5.2 app/components/lookbook/button_group/component.rb
lookbook-2.0.0.beta.0 app/components/lookbook/button_group/component.rb
lookbook-1.5.1 app/components/lookbook/button_group/component.rb
lookbook-1.5.0 app/components/lookbook/button_group/component.rb
lookbook-1.4.5 app/components/lookbook/button_group/component.rb
lookbook-1.4.4 app/components/lookbook/button_group/component.rb
lookbook-1.4.3 app/components/lookbook/button_group/component.rb
lookbook-1.4.2 app/components/lookbook/button_group/component.rb
lookbook-1.4.1 app/components/lookbook/button_group/component.rb
lookbook-1.4.0 app/components/lookbook/button_group/component.rb