Sha256: 0d0f3119fb8a3e55940013b1e3debd81678c2c7fb680c24f7520cd5acaad78b8

Contents?: true

Size: 633 Bytes

Versions: 24

Compression:

Stored size: 633 Bytes

Contents

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

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

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

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
coveragebook_components-0.7.9 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.8 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.7 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.6 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.5 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.4 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.3 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.2 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.7.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.5 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.4 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.3 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.2 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.6.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.5.7 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.5.6 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.5.5 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.5.4 app/components/coco/app/elements/notice/notice.rb