Class: Primer::BorderBoxComponent
- Defined in:
- app/components/primer/border_box_component.rb
Overview
BorderBox is a Box component with a border.
Constant Summary collapse
- DEFAULT_PADDING =
:default- PADDING_MAPPINGS =
{ DEFAULT_PADDING => "", :condensed => "Box--condensed", :spacious => "Box--spacious" }.freeze
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(padding: DEFAULT_PADDING, **system_arguments) ⇒ BorderBoxComponent
constructor
A new instance of BorderBoxComponent.
- #render? ⇒ Boolean
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(padding: DEFAULT_PADDING, **system_arguments) ⇒ BorderBoxComponent
Returns a new instance of BorderBoxComponent.
106 107 108 109 110 111 112 113 114 |
# File 'app/components/primer/border_box_component.rb', line 106 def initialize(padding: DEFAULT_PADDING, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( "Box", PADDING_MAPPINGS[fetch_or_fallback(PADDING_MAPPINGS.keys, padding, DEFAULT_PADDING)], system_arguments[:classes] ) end |
Instance Method Details
#render? ⇒ Boolean
116 117 118 |
# File 'app/components/primer/border_box_component.rb', line 116 def render? rows.any? || header.present? || body.present? || .present? end |