Sha256: ea7fa15ef5024890f186c37d0c5651e930b08fda25ad27eb293d03f2af181b31

Contents?: true

Size: 705 Bytes

Versions: 48

Compression:

Stored size: 705 Bytes

Contents

module Coco
  module App
    module Elements
      class Toast < Coco::Component
        include Concerns::WrapsComponent
        include Concerns::ActsAsNotification

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

        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

48 entries across 48 versions & 1 rubygems

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