Sha256: 0dbc46ba6eff9938c471dced516b3c85cb755d5c12fcd74c1af4f0e983ebe369

Contents?: true

Size: 414 Bytes

Versions: 12

Compression:

Stored size: 414 Bytes

Contents

module Coco
  class OptionBar < Coco::Component
    include Concerns::AcceptsOptions

    accepts_option :size, from: [:sm, :md], default: :sm

    renders_many :options, ->(*args, selected: false, **kwargs, &block) do
      theme = selected ? :neutral_light : :blank
      size = get_option_value(:size)
      coco_button(*args, **kwargs, theme:, size:, class: ("selected" if selected), &block)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coveragebook_components-0.17.6 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.5 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.4 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.3 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.2 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.1 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.16.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.15.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.14.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.13.1 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.13.0 app/components/coco/buttons/option_bar/option_bar.rb