Class: ShadcnPhlexcomponents::DialogTitle

Inherits:
Base
  • Object
show all
Defined in:
lib/shadcn_phlexcomponents/components/dialog.rb

Constant Summary

Constants inherited from Base

Base::SANITIZER_ALLOWED_ATTRIBUTES, Base::SANITIZER_ALLOWED_TAGS, Base::TAILWIND_MERGER

Instance Method Summary collapse

Methods inherited from Base

#before_template, #convert_collection_hash_to_struct, #find_as_child, #icon, #item_disabled?, #merge_default_attributes, #merged_as_child_attributes, #nokogiri_attributes_to_hash, #overlay, #sanitize_as_child

Constructor Details

#initialize(aria_id: nil, **attributes) ⇒ DialogTitle

Returns a new instance of DialogTitle.



176
177
178
179
# File 'lib/shadcn_phlexcomponents/components/dialog.rb', line 176

def initialize(aria_id: nil, **attributes)
  @aria_id = aria_id
  super(**attributes)
end

Instance Method Details

#default_attributes ⇒ Object



181
182
183
184
185
# File 'lib/shadcn_phlexcomponents/components/dialog.rb', line 181

def default_attributes
  {
    id: "#{@aria_id}-title",
  }
end

#view_template ⇒ Object



187
188
189
# File 'lib/shadcn_phlexcomponents/components/dialog.rb', line 187

def view_template(&)
  h2(**@attributes, &)
end