Sha256: 295854aefd6d145442767d08d5297f06af8db1afa184afeac1184ee6238df74b
Contents?: true
Size: 1012 Bytes
Versions: 196
Compression:
Stored size: 1012 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Primer # Helper to share tab validation logic between components. # The component will raise an error if there are 0 or 2+ selected tabs. module UnderlineNavHelper extend ActiveSupport::Concern ALIGN_DEFAULT = :left ALIGN_OPTIONS = [ALIGN_DEFAULT, :right].freeze ACTIONS_TAG_DEFAULT = :div ACTIONS_TAG_OPTIONS = [ACTIONS_TAG_DEFAULT, :span].freeze def underline_nav_classes(classes, align) class_names( classes, "UnderlineNav", "UnderlineNav--right" => align == :right ) end def underline_nav_body_classes(classes) class_names( "UnderlineNav-body", classes, "list-style-none" ) end def underline_nav_action_classes(classes) class_names("UnderlineNav-actions", classes) end def underline_nav_tab_classes(classes) class_names( "UnderlineNav-item", classes ) end end end
Version data entries
196 entries across 196 versions & 2 rubygems