Sha256: 451cb99e25453facd71666682144a0c192a8a897a20a5d1c664b3e13b5ecebb9

Contents?: true

Size: 492 Bytes

Versions: 27

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

27 entries across 27 versions & 1 rubygems

Version Path
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
coveragebook_components-0.16.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.15.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.14.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.13.1 app/components/coco/buttons/confirm_panel/confirm_panel.rb
coveragebook_components-0.13.0 app/components/coco/buttons/confirm_panel/confirm_panel.rb