Sha256: d94e10906cc345db418fc0abf762eb16d3a6902acc7c3a39feb2a65738c257df
Contents?: true
Size: 775 Bytes
Versions: 17
Compression:
Stored size: 775 Bytes
Contents
module Lookbook class TextButton::Component < Lookbook::BaseComponent renders_many :icons, Icon::Component ICON_SIZES = { xs: 3, sm: 3.5, md: 4, lg: 6 } attr_reader :icon, :tooltip, :disabled, :size, :href def initialize(id: nil, icon: nil, tooltip: nil, disabled: false, size: :md, href: nil, **html_attrs) @id = id @icon = icon @tooltip = tooltip @disabled = disabled @size = size @href = href super(**html_attrs) end def id @id ||= Utils.temp_id(prefix: "button") end def icon_size ICON_SIZES[size] end def tag_name href.present? ? :a : :button end protected def alpine_component "buttonComponent" end end end
Version data entries
17 entries across 17 versions & 1 rubygems