Module: Primer::UnderlineNavHelper
- Extended by:
- ActiveSupport::Concern
- Included in:
- Alpha::UnderlineNav, Alpha::UnderlinePanels
- Defined in:
- app/lib/primer/underline_nav_helper.rb
Overview
Helper to share tab validation logic between components. The component will raise an error if there are 0 or 2+ selected tabs.
Constant Summary collapse
- ALIGN_DEFAULT =
:left
- ALIGN_OPTIONS =
[ALIGN_DEFAULT, :right].freeze
- ACTIONS_TAG_DEFAULT =
:div
- ACTIONS_TAG_OPTIONS =
[ACTIONS_TAG_DEFAULT, :span].freeze
Instance Method Summary collapse
- #underline_nav_action_classes(classes) ⇒ Object
- #underline_nav_body_classes(classes) ⇒ Object
- #underline_nav_classes(classes, align) ⇒ Object
- #underline_nav_tab_classes(classes) ⇒ Object
Instance Method Details
#underline_nav_action_classes(classes) ⇒ Object
33 34 35 |
# File 'app/lib/primer/underline_nav_helper.rb', line 33 def underline_nav_action_classes(classes) class_names("UnderlineNav-actions", classes) end |
#underline_nav_body_classes(classes) ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/lib/primer/underline_nav_helper.rb', line 25 def underline_nav_body_classes(classes) class_names( "UnderlineNav-body", classes, "list-style-none" ) end |
#underline_nav_classes(classes, align) ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/lib/primer/underline_nav_helper.rb', line 17 def underline_nav_classes(classes, align) class_names( classes, "UnderlineNav", "UnderlineNav--right" => align == :right ) end |
#underline_nav_tab_classes(classes) ⇒ Object
37 38 39 40 41 42 |
# File 'app/lib/primer/underline_nav_helper.rb', line 37 def underline_nav_tab_classes(classes) class_names( "UnderlineNav-item", classes ) end |