Class: JetUi::Stat::DescriptionComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- JetUi::Stat::DescriptionComponent
- Defined in:
- app/components/jet_ui/stat/description_component.rb
Constant Summary collapse
- VARIANTS =
%i[default success warning error].freeze
- DEFAULT_VARIANT =
:default- TRENDING_UP_PATH =
'M2.25 17.9999L9 11.2499L13.3064 15.5564C14.5101 13.188 16.5042 ' \ '11.2022 19.1203 10.0375L21.8609 8.81726M21.8609 8.81726L15.9196 ' \ '6.53662M21.8609 8.81726L19.5802 14.7585'
- TRENDING_DOWN_PATH =
'M2.25 6L9 12.75L13.2862 8.46383C15.3217 10.0166 16.8781 12.23 ' \ '17.5919 14.8941L18.3684 17.7919M18.3684 17.7919L21.5504 ' \ '12.2806M18.3684 17.7919L12.857 14.6099'
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(variant: DEFAULT_VARIANT, **options) ⇒ DescriptionComponent
constructor
A new instance of DescriptionComponent.
Constructor Details
#initialize(variant: DEFAULT_VARIANT, **options) ⇒ DescriptionComponent
Returns a new instance of DescriptionComponent.
16 17 18 19 |
# File 'app/components/jet_ui/stat/description_component.rb', line 16 def initialize(variant: DEFAULT_VARIANT, **) @variant = VARIANTS.include?(variant) ? variant : DEFAULT_VARIANT @options = end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'app/components/jet_ui/stat/description_component.rb', line 21 def call content_tag :p, class: classes, **@options do safe_join([trend_icon, content].compact) end end |