Class: Polaris::BleedComponent
- Defined in:
- app/components/polaris/bleed_component.rb
Constant Summary
Constants included from ViewHelper
ViewHelper::POLARIS_HELPERS, ViewHelper::POLARIS_TEXT_STYLES
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(margin_inline: nil, margin_block: nil, margin_block_start: nil, margin_block_end: nil, margin_inline_start: nil, margin_inline_end: nil, **system_arguments) ⇒ BleedComponent
constructor
A new instance of BleedComponent.
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(margin_inline: nil, margin_block: nil, margin_block_start: nil, margin_block_end: nil, margin_inline_start: nil, margin_inline_end: nil, **system_arguments) ⇒ BleedComponent
Returns a new instance of BleedComponent.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/polaris/bleed_component.rb', line 3 def initialize( margin_inline: nil, margin_block: nil, margin_block_start: nil, margin_block_end: nil, margin_inline_start: nil, margin_inline_end: nil, **system_arguments ) @direction_values = { margin_inline: margin_inline, margin_block: margin_block, margin_block_start: margin_block_start, margin_block_end: margin_block_end, margin_inline_start: margin_inline_start, margin_inline_end: margin_inline_end } @system_arguments = system_arguments.tap do |args| args[:tag] = "div" args[:classes] = class_names( args[:classes], "Polaris-Bleed" ) args[:style] = styles_list( args[:style], **margin_value("margin-block-start", negative_margin(:margin_block_start)), **margin_value("margin-block-end", negative_margin(:margin_block_end)), **margin_value("margin-inline-start", negative_margin(:margin_inline_start)), **margin_value("margin-inline-end", negative_margin(:margin_inline_end)) ) end end |
Instance Method Details
#call ⇒ Object
36 37 38 |
# File 'app/components/polaris/bleed_component.rb', line 36 def call render(Polaris::BaseComponent.new(**@system_arguments)) { content } end |