Sha256: aa0cafa61ff93e6f5e2823a912bf5ae5e4bdf59291cc90a4c8bf82c97c0eaa61

Contents?: true

Size: 647 Bytes

Versions: 24

Compression:

Stored size: 647 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, ->(*args, **kwargs, &block) do
            alert.send("with_#{slot_name}".to_sym, *args, **kwargs, &block)
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
coveragebook_components-0.12.2 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.12.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.12.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.11.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.10.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.9.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.9.0 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.9 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.8 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.7 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.6 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.5 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.4 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.3 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.2 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.1 app/components/coco/app/elements/notice/notice.rb
coveragebook_components-0.8.0 app/components/coco/app/elements/notice/notice.rb