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.2.1 app/components/lookbook/icon/component.rb
lookbook-1.2.0 app/components/lookbook/icon/component.rb
lookbook-1.1.1 app/components/lookbook/icon/component.rb
lookbook-1.1.0 app/components/lookbook/icon/component.rb
lookbook-1.0.8 app/components/lookbook/icon/component.rb
lookbook-1.0.7 app/components/lookbook/icon/component.rb
lookbook-1.0.6 app/components/lookbook/icon/component.rb
lookbook-1.0.5 app/components/lookbook/icon/component.rb
lookbook-1.0.4 app/components/lookbook/icon/component.rb