Sha256: 2b70a068f705cc620552328e238f8fdcdd686e469a1e16ad98a3e7ef4215c9df

Contents?: true

Size: 519 Bytes

Versions: 13

Compression:

Stored size: 519 Bytes

Contents

class DropdownComponent < ViewComponent::Base
  renders_one :trigger

  def initialize(align: 'right', width: '48', content_classes: 'py-1 bg-white dark:bg-gray-700')
    if align == 'left'
      @alignment_classes = 'ltr:origin-top-left rtl:origin-top-right start-0'
    elsif align == 'top'
      @alignment_classes = 'origin-top'
    else
      @alignment_classes = 'ltr:origin-top-right rtl:origin-top-left end-0'
    end
    @width = width == '48' ? 'w-48' : width
    @content_classes = content_classes
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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