Sha256: 2a3c9c8fe6f5af67bc72b27f711d5f641b50e27e2ebc542380a7775c783d82ec

Contents?: true

Size: 434 Bytes

Versions: 3

Compression:

Stored size: 434 Bytes

Contents

module Lookbook
  class CopyButton::Component < Lookbook::Component
    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 : @target.to_json
    end

    def alpine_component
      "copyButtonComponent"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.2 app/components/lookbook/copy_button/component.rb
lookbook-1.0.0.beta.1 app/components/lookbook/copy_button/component.rb
lookbook-1.0.0.beta.0 app/components/lookbook/copy_button/component.rb