Sha256: 451cb99e25453facd71666682144a0c192a8a897a20a5d1c664b3e13b5ecebb9

Contents?: true

Size: 492 Bytes

Versions: 25

Compression:

Stored size: 492 Bytes

Contents

module Coco
  class ConfirmPanel < Coco::Component
    renders_one :button, ->(**kwargs, &block) do
      coco_button(theme: :negative, **kwargs, fit: :full, size: :sm, &block)
    end

    renders_one :cancel, ->(**kwargs, &block) do
      coco_button(theme: :secondary, **kwargs, fit: :full, size: :sm, &block)
    end

    renders_one :text, Coco::Content

    before_render do
      unless button?
        raise ArgumentError, "No confirmation button defined"
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.7 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.6 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.5 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.4 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.3 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.2 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.1 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.19.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.18.8 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.18.7 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.18.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.7 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.6 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.5 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.4 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.3 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.2 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.1 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.17.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb