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-1.3.4 app/components/lookbook/button_group/component.rb
lookbook-1.3.3 app/components/lookbook/button_group/component.rb
lookbook-1.3.1 app/components/lookbook/button_group/component.rb
lookbook-1.3.0 app/components/lookbook/button_group/component.rb
lookbook-1.2.1 app/components/lookbook/button_group/component.rb
lookbook-1.2.0 app/components/lookbook/button_group/component.rb
lookbook-1.1.1 app/components/lookbook/button_group/component.rb
lookbook-1.1.0 app/components/lookbook/button_group/component.rb