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.8.0.beta.3 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.8.0.beta.2 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.8.0.beta.1 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.10 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.9 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.8 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.7 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.6 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.5 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.4 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.3 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.2 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.1 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.7.0 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.5 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.4 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.3 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.2 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.1 app/components/coco/app/elements/toast/toast.rb
coveragebook_components-0.6.0 app/components/coco/app/elements/toast/toast.rb