Class: Shadcn::SheetContentComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::SheetContentComponent
- Defined in:
- app/components/shadcn/sheet_content_component.rb
Overview
Sheet Content component
Constant Summary collapse
- OVERLAY_CLASSES =
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"- BASE_CONTENT_CLASSES =
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out"- CLOSE_CLASSES =
"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(side: :right, **options) ⇒ SheetContentComponent
constructor
A new instance of SheetContentComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(side: :right, **options) ⇒ SheetContentComponent
Returns a new instance of SheetContentComponent.
24 25 26 27 |
# File 'app/components/shadcn/sheet_content_component.rb', line 24 def initialize(side: :right, **) super(**) @side = side.to_sym end |
Instance Method Details
#call ⇒ Object
29 30 31 |
# File 'app/components/shadcn/sheet_content_component.rb', line 29 def call content_tag(:template, content_wrapper, { "data-shadcn--sheet-target": "template" }) end |