Sha256: 41a0bf68aa3afffbf9efa93fdfd9f5a4379b9d025c34121b64e24f75bfcbe49b

Contents?: true

Size: 395 Bytes

Versions: 29

Compression:

Stored size: 395 Bytes

Contents

module Lookbook
  class Icon::Component < Lookbook::BaseComponent
    def initialize(name:, size: 4, **html_attrs)
      @alpine_data = name.is_a?(Symbol) ? alpine_encode(name.to_s.tr("_", "-")) : name
      @size = size || 4
      super(**html_attrs)
    end

    def size_rems
      "#{@size * 0.25}rem"
    end

    protected

    def alpine_component
      "iconComponent"
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/components/lookbook/icon/component.rb
lookbook-1.5.4 app/components/lookbook/icon/component.rb
lookbook-2.0.0.beta.3 app/components/lookbook/icon/component.rb
lookbook-2.0.0.beta.2 app/components/lookbook/icon/component.rb
lookbook-1.5.3 app/components/lookbook/icon/component.rb
lookbook-2.0.0.beta.1 app/components/lookbook/icon/component.rb
lookbook-1.5.2 app/components/lookbook/icon/component.rb
lookbook-2.0.0.beta.0 app/components/lookbook/icon/component.rb
lookbook-1.5.1 app/components/lookbook/icon/component.rb
lookbook-1.5.0 app/components/lookbook/icon/component.rb
lookbook-1.4.5 app/components/lookbook/icon/component.rb
lookbook-1.4.4 app/components/lookbook/icon/component.rb
lookbook-1.4.3 app/components/lookbook/icon/component.rb
lookbook-1.4.2 app/components/lookbook/icon/component.rb
lookbook-1.4.1 app/components/lookbook/icon/component.rb
lookbook-1.4.0 app/components/lookbook/icon/component.rb
lookbook-1.3.4 app/components/lookbook/icon/component.rb
lookbook-1.3.3 app/components/lookbook/icon/component.rb
lookbook-1.3.1 app/components/lookbook/icon/component.rb
lookbook-1.3.0 app/components/lookbook/icon/component.rb