Class: Primer::PopoverComponent::Body
- Defined in:
- app/components/primer/popover_component.rb
Overview
:nodoc:
Constant Summary collapse
- CARET_DEFAULT =
:top- CARET_MAPPINGS =
{ CARET_DEFAULT => "", :bottom => "Popover-message--bottom", :bottom_right => "Popover-message--bottom-right", :bottom_left => "Popover-message--bottom-left", :left => "Popover-message--left", :left_bottom => "Popover-message--left-bottom", :left_top => "Popover-message--left-top", :right => "Popover-message--right", :right_bottom => "Popover-message--right-bottom", :right_top => "Popover-message--right-top", :top_left => "Popover-message--top-left", :top_right => "Popover-message--top-right" }.freeze
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #component ⇒ Object
-
#initialize(caret: CARET_DEFAULT, large: false, **system_arguments) ⇒ Body
constructor
A new instance of Body.
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(caret: CARET_DEFAULT, large: false, **system_arguments) ⇒ Body
Returns a new instance of Body.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'app/components/primer/popover_component.rb', line 95 def initialize(caret: CARET_DEFAULT, large: false, **system_arguments) @system_arguments = system_arguments @system_arguments[:classes] = class_names( system_arguments[:classes], "Popover-message Box", CARET_MAPPINGS[fetch_or_fallback(CARET_MAPPINGS.keys, caret, CARET_DEFAULT)], "Popover-message--large" => large ) @system_arguments[:p] ||= 4 @system_arguments[:mt] ||= 2 @system_arguments[:mx] ||= :auto @system_arguments[:text_align] ||= :left @system_arguments[:box_shadow] ||= :large end |
Instance Method Details
#component ⇒ Object
110 111 112 |
# File 'app/components/primer/popover_component.rb', line 110 def component Primer::BoxComponent.new(**@system_arguments) end |