Sha256: d59717181e0610e62cc274aaeeb775ee167e5e26a32437bdc79e384e0cbc0a35

Contents?: true

Size: 527 Bytes

Versions: 8

Compression:

Stored size: 527 Bytes

Contents

module Coco
  class Notice < Coco::Component
    include Concerns::AcceptsOptions
    include Concerns::WrapsComponent

    accepts_option :dismissable, from: [true, false], default: true

    wraps_component :alert do |args|
      Coco::Alert.new(**args, dismissable: get_option_value(:dismissable))
    end

    %i[title action secondary_action link].each do |slot_name|
      renders_one slot_name, ->(*args, **kwargs, &block) do
        alert.send(:"with_#{slot_name}", *args, **kwargs, &block)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coveragebook_components-0.17.2 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.17.1 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.17.0 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.16.0 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.15.0 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.14.0 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.13.1 app/components/coco/messaging/notice/notice.rb
coveragebook_components-0.13.0 app/components/coco/messaging/notice/notice.rb