Sha256: cef8af1733159f594862c22ea26cc2ad11bdbd11a1d8f48c5ff7edabfec6dac5

Contents?: true

Size: 521 Bytes

Versions: 28

Compression:

Stored size: 521 Bytes

Contents

module Lookbook
  class CopyButton::Component < Lookbook::BaseComponent
    attr_reader :icon, :size, :target, :button_attrs

    def initialize(target: nil, icon: :code, size: :md, **attrs)
      @icon = icon
      @size = size
      @target = target
      @button_attrs = attrs
    end

    def icon_size
      IconButton::Component::ICON_SIZES[size]
    end

    protected

    def alpine_data
      content ? nil : alpine_encode(target)
    end

    def alpine_component
      "copyButtonComponent"
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lookbook-2.3.4 app/components/lookbook/copy_button/component.rb
lookbook-2.3.3 app/components/lookbook/copy_button/component.rb
lookbook-2.3.2 app/components/lookbook/copy_button/component.rb
lookbook-2.3.0 app/components/lookbook/copy_button/component.rb
lookbook-2.2.2 app/components/lookbook/copy_button/component.rb
lookbook-2.2.1 app/components/lookbook/copy_button/component.rb
lookbook-2.2.0 app/components/lookbook/copy_button/component.rb
lookbook-2.1.1 app/components/lookbook/copy_button/component.rb
lookbook-2.1.0 app/components/lookbook/copy_button/component.rb
lookbook-2.0.5 app/components/lookbook/copy_button/component.rb
lookbook-2.0.4 app/components/lookbook/copy_button/component.rb
lookbook-2.0.3 app/components/lookbook/copy_button/component.rb
lookbook-2.0.2 app/components/lookbook/copy_button/component.rb
lookbook-2.0.1 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0.beta.9 app/components/lookbook/copy_button/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/copy_button/component.rb