Sha256: 03fafab5a58ea2c15a6e5d6826e5de72df47f1319c4b38e55fba7a5d274ea17a

Contents?: true

Size: 419 Bytes

Versions: 13

Compression:

Stored size: 419 Bytes

Contents

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

    accepts_option :size, from: [:xs, :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

13 entries across 13 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.7 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.6 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.5 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.4 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.3 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.2 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.1 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.19.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.18.8 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.18.7 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.18.0 app/components/coco/buttons/option_bar/option_bar.rb
coveragebook_components-0.17.7 app/components/coco/buttons/option_bar/option_bar.rb