Sha256: daac6257b71f92d26fe52a6c2d39b6893d8fdfd840e23cb04c0ac7b1cb7c02a7

Contents?: true

Size: 831 Bytes

Versions: 13

Compression:

Stored size: 831 Bytes

Contents

class SecondaryButtonComponent < ViewComponent::Base
  erb_template <<~ERB
    <button <%= sanitize @attributes.join(" ") %>>
      <%= content %>
    </button>
  ERB

  def initialize(attributes = {})
    attributes[:type] = attributes[:type] || 'button'
    attributes[:class] = "inline-flex items-center px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150#{" #{attributes[:class]}" if attributes[:class]}"
    @attributes = attributes.map { |key, attribute| "#{key}=\"#{attribute}\"" }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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