Sha256: aebcc6b5b5adad2e0a26a4bf0169b83681e87372cb6986bbaa498379ed5f8de3

Contents?: true

Size: 655 Bytes

Versions: 22

Compression:

Stored size: 655 Bytes

Contents

module Spina
  module UserInterface
    class DropdownButtonComponent < ApplicationComponent
      attr_reader :disabled
      
      def initialize(disabled: false)
        @disabled = disabled
      end
      
      def call
        content_tag :button, content, {class: classes, type: :submit, disabled: disabled}
      end
      
      def classes
        if disabled
          "block w-full text-left px-3 py-2 text-sm leading-4 text-gray-400 font-medium cursor-default"
        else
          "block w-full text-left px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 font-medium"
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.12.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.11.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.10.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.9.1 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.9.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.8.1 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.8.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.7.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.6.2 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.6.1 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.6.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.5.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.4.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.5 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.4 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.3 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.2 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.1 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.3.0 app/components/spina/user_interface/dropdown_button_component.rb
spina-2.2.0 app/components/spina/user_interface/dropdown_button_component.rb