in app/components/primer/flex_component.rb [96:122]
def initialize(
justify_content: JUSTIFY_CONTENT_DEFAULT,
inline: INLINE_DEFAULT,
flex_wrap: FLEX_WRAP_DEFAULT,
align_items: ALIGN_ITEMS_DEFAULT,
direction: nil,
**system_arguments
)
deprecated_component_warning(new_class: Primer::BoxComponent, version: "0.0.40")
@align_items = fetch_or_fallback(ALIGN_ITEMS_OPTIONS, align_items, ALIGN_ITEMS_DEFAULT)
@justify_content = fetch_or_fallback(JUSTIFY_CONTENT_OPTIONS, justify_content, JUSTIFY_CONTENT_DEFAULT)
@flex_wrap = fetch_or_fallback(FLEX_WRAP_OPTIONS, flex_wrap, FLEX_WRAP_DEFAULT)
@direction =
if (Array(direction) - ALLOWED_DIRECTIONS).empty?
direction
else
DEFAULT_DIRECTION
end
@system_arguments = system_arguments.merge({ direction: @direction }.compact)
@system_arguments[:classes] = class_names(@system_arguments[:classes], component_class_names)
@system_arguments[:display] = fetch_or_fallback(INLINE_OPTIONS, inline, INLINE_DEFAULT) ? :inline_flex : :flex
end