Class: PhlexKit::SheetClose

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/sheet/sheet_close.rb

Overview

Wraps any element (typically a Button) so clicking it closes the enclosing sheet, mirroring shadcn/ui's SheetClose. See sheet.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ SheetClose

Returns a new instance of SheetClose.



5
# File 'app/components/phlex_kit/sheet/sheet_close.rb', line 5

def initialize(**attrs) = (@attrs = attrs)

Instance Method Details

#view_templateObject



6
7
8
# File 'app/components/phlex_kit/sheet/sheet_close.rb', line 6

def view_template(&)
  span(**mix({ style: "display: contents", data: { action: "click->phlex-kit--sheet-content#close" } }, @attrs), &)
end