Class: PhlexKit::Marker
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Marker
- Defined in:
- app/components/phlex_kit/marker/marker.rb
Overview
Conversation annotation, ported from shadcn/ui's Marker (an AI-chat-era
addition): an inline status line, bordered system-note row, or labeled
separator. Compose Marker(variant:) > [MarkerIcon +] MarkerContent.
.pk-marker* (marker.css).
Constant Summary collapse
- VARIANTS =
{ default: nil, border: "border", separator: "separator" }.freeze
Instance Method Summary collapse
-
#initialize(variant: :default, **attrs) ⇒ Marker
constructor
A new instance of Marker.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(variant: :default, **attrs) ⇒ Marker
Returns a new instance of Marker.
9 10 11 12 |
# File 'app/components/phlex_kit/marker/marker.rb', line 9 def initialize(variant: :default, **attrs) @variant = variant.to_sym @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
14 15 16 |
# File 'app/components/phlex_kit/marker/marker.rb', line 14 def view_template(&) div(**mix({ class: [ "pk-marker", VARIANTS.fetch(@variant) ].compact.join(" ") }, @attrs), &) end |