Sha256: d6534bbbac285db45599c87e8c141a5f8000b21109db1b34eb6119234e5f3dce

Contents?: true

Size: 414 Bytes

Versions: 7

Compression:

Stored size: 414 Bytes

Contents

class ModalComponent < ViewComponent::Base
  def initialize(attributes = {})
    @name = attributes[:name]
    @show = attributes[:show] || false
    @max_width = {
      sm: 'sm:max-w-sm',
      md: 'sm:max-w-md',
      lg: 'sm:max-w-lg',
      xl: 'sm:max-w-xl',
      '2xl': 'sm:max-w-2xl'
    }[(attributes[:max_width] || '2xl').to_sym]
    @attributes = attributes.without(:name, :show, :max_width)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.16.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.15.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.14.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.13.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.12.0 stubs/hotwire/app/components/modal_component.rb
kaze-0.11.0 stubs/hotwire/app/components/modal_component.rb