Sha256: 697114f1ecaa11be3ff9d07bbeb4e2e863cac8edd0f20090b30b06d63d06d497

Contents?: true

Size: 445 Bytes

Versions: 25

Compression:

Stored size: 445 Bytes

Contents

module Lookbook
  class CopyButton::Component < Lookbook::BaseComponent
    def initialize(target: nil, icon: :code, **attrs)
      @icon = icon
      @target = target
      @button_attrs = attrs
    end

    def icon_size
      Lookbook::Button::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

25 entries across 25 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/components/lookbook/copy_button/component.rb
lookbook-1.5.4 app/components/lookbook/copy_button/component.rb
lookbook-1.5.3 app/components/lookbook/copy_button/component.rb
lookbook-1.5.2 app/components/lookbook/copy_button/component.rb
lookbook-1.5.1 app/components/lookbook/copy_button/component.rb
lookbook-1.5.0 app/components/lookbook/copy_button/component.rb
lookbook-1.4.5 app/components/lookbook/copy_button/component.rb
lookbook-1.4.4 app/components/lookbook/copy_button/component.rb
lookbook-1.4.3 app/components/lookbook/copy_button/component.rb
lookbook-1.4.2 app/components/lookbook/copy_button/component.rb
lookbook-1.4.1 app/components/lookbook/copy_button/component.rb
lookbook-1.4.0 app/components/lookbook/copy_button/component.rb
lookbook-1.3.4 app/components/lookbook/copy_button/component.rb
lookbook-1.3.3 app/components/lookbook/copy_button/component.rb
lookbook-1.3.1 app/components/lookbook/copy_button/component.rb
lookbook-1.3.0 app/components/lookbook/copy_button/component.rb
lookbook-1.2.1 app/components/lookbook/copy_button/component.rb
lookbook-1.2.0 app/components/lookbook/copy_button/component.rb
lookbook-1.1.1 app/components/lookbook/copy_button/component.rb
lookbook-1.1.0 app/components/lookbook/copy_button/component.rb