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