Class: Shadcn::Popover::Content::Component

Inherits:
ApplicationViewComponent show all
Defined in:
app/components/shadcn/popover/content/component.rb

Overview

PopoverContent

Constant Summary

Constants inherited from ApplicationViewComponent

ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS

Instance Attribute Summary

Attributes inherited from ApplicationViewComponent

#attributes

Instance Method Summary collapse

Methods inherited from ApplicationViewComponent

#css_classes, default_tag, #initialize, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name

Constructor Details

This class inherits a constructor from Shadcn::ApplicationViewComponent

Instance Method Details

#callObject



34
35
36
# File 'app/components/shadcn/popover/content/component.rb', line 34

def call
  render_element(body: safe_join([ header, content ].compact))
end

#element_attributes(**defaults) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'app/components/shadcn/popover/content/component.rb', line 24

def element_attributes(**defaults)
  super(**{
    role: "dialog",
    tabindex: "-1",
    "data-state" => "closed",
    hidden: true,
    "data-shadcn--popover-target" => "content"
  }.merge(defaults))
end