Class: Polaris::TextContainerComponent
- Defined in:
- app/components/polaris/text_container_component.rb
Constant Summary collapse
- SPACING_DEFAULT =
:default
- SPACING_MAPPINGS =
{ SPACING_DEFAULT => "", :tight => "Polaris-TextContainer--spacingTight", :loose => "Polaris-TextContainer--spacingLoose" }
- SPACING_OPTIONS =
SPACING_MAPPINGS.keys
Constants included from ViewHelper
ViewHelper::POLARIS_HELPERS, ViewHelper::POLARIS_TEXT_STYLES
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(spacing: SPACING_DEFAULT, **system_arguments) ⇒ TextContainerComponent
constructor
A new instance of TextContainerComponent.
Methods included from ViewHelper
#polaris_body_styles, #polaris_html_classes, #polaris_html_styles, #polaris_icon_source
Methods included from StylesListHelper
Methods included from OptionHelper
#append_option, #prepend_option
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #fetch_or_fallback_nested
Methods included from ClassNameHelper
Constructor Details
#initialize(spacing: SPACING_DEFAULT, **system_arguments) ⇒ TextContainerComponent
Returns a new instance of TextContainerComponent.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/polaris/text_container_component.rb', line 13 def initialize( spacing: SPACING_DEFAULT, **system_arguments ) @system_arguments = system_arguments @system_arguments[:tag] = "div" @system_arguments[:classes] = class_names( @system_arguments[:classes], "Polaris-TextContainer", SPACING_MAPPINGS[fetch_or_fallback(SPACING_OPTIONS, spacing, SPACING_DEFAULT)] ) end |
Instance Method Details
#call ⇒ Object
26 27 28 |
# File 'app/components/polaris/text_container_component.rb', line 26 def call render(Polaris::BaseComponent.new(**@system_arguments)) { content } end |