Sha256: 7ba195e1cb31b16ff41b8af28fe085ecacaa03f580eaf69a8ca5078ab8bfd00d

Contents?: true

Size: 485 Bytes

Versions: 15

Compression:

Stored size: 485 Bytes

Contents

class InputLabelComponent < ViewComponent::Base
  erb_template <<~ERB
    <a <%= sanitize @attributes.join(" ") %>>
      <%= @value ? @value : content %>
    </a>
  ERB

  def initialize(attributes = {})
    @value = attributes[:value] || nil
    attributes[:class] = "block font-medium text-sm text-gray-700 dark:text-gray-300#{" #{attributes[:class]}" if attributes[:class]}"
    @attributes = attributes.without(:value).map { |key, attribute| "#{key}=\"#{attribute}\"" }
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.16.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.15.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.14.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.13.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.12.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.11.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.10.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.9.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.8.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.7.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.6.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.5.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.4.0 stubs/hotwire/app/components/input_label_component.rb
kaze-0.3.0 stubs/hotwire/app/components/input_label_component.rb