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.0.8 app/components/lookbook/copy_button/component.rb
lookbook-1.0.7 app/components/lookbook/copy_button/component.rb
lookbook-1.0.6 app/components/lookbook/copy_button/component.rb
lookbook-1.0.5 app/components/lookbook/copy_button/component.rb
lookbook-1.0.4 app/components/lookbook/copy_button/component.rb