Sha256: bee0ee183acad4c7a29bd17b6989b6f02e461f803d532f13718e77d6ce178455

Contents?: true

Size: 859 Bytes

Versions: 22

Compression:

Stored size: 859 Bytes

Contents

module Spina
  module UserInterface
    class DropdownComponent < ApplicationComponent      
      renders_one :button, "ButtonComponent"
      
      renders_one :menu, "MenuComponent"
      
      class ButtonComponent < ApplicationComponent
        attr_reader :classes
        
        def initialize(classes:)
          @classes = classes
        end
        
        def call
          content_tag :button, content, {type: 'button', class: classes, data: {action: "reveal#toggle"}}
        end
      end
      
      class MenuComponent < ApplicationComponent
        def call
          content_tag :div, content, {class: "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg border border-gray-200 z-20 rounded-md bg-white shadow-xs py-1", hidden: true, data: {reveal: true, transition: true}}
        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_component.rb
spina-2.11.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.10.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.9.1 app/components/spina/user_interface/dropdown_component.rb
spina-2.9.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.8.1 app/components/spina/user_interface/dropdown_component.rb
spina-2.8.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.7.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.6.2 app/components/spina/user_interface/dropdown_component.rb
spina-2.6.1 app/components/spina/user_interface/dropdown_component.rb
spina-2.6.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.5.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.4.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.5 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.4 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.3 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.2 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.1 app/components/spina/user_interface/dropdown_component.rb
spina-2.3.0 app/components/spina/user_interface/dropdown_component.rb
spina-2.2.0 app/components/spina/user_interface/dropdown_component.rb