Sha256: 5ad8b83c4c46de88a04685a22a9bf8904e19a1943bbee8331f70edaa7ad63501

Contents?: true

Size: 497 Bytes

Versions: 3

Compression:

Stored size: 497 Bytes

Contents

module Coco
  module App
    module Elements
      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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coveragebook_components-0.12.2 app/components/coco/app/elements/option_bar/option_bar.rb
coveragebook_components-0.12.1 app/components/coco/app/elements/option_bar/option_bar.rb
coveragebook_components-0.12.0 app/components/coco/app/elements/option_bar/option_bar.rb