Sha256: dd9652954a25a01c1a2781d5f00046029afb9c768f755bab26dc63780dcdb22a

Contents?: true

Size: 704 Bytes

Versions: 30

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Ariadne
  # Helper to share tab validation logic between components.
  # The component will raise an error if there are 0 or 2+ selected tabs.
  module TabNavHelper
    extend ActiveSupport::Concern

    EXTRA_ALIGN_DEFAULT = :left
    EXTRA_ALIGN_OPTIONS = [EXTRA_ALIGN_DEFAULT, :right].freeze

    def tab_nav_tab_classes(classes)
      class_names(
        "tabnav-tab",
        classes
      )
    end

    def tab_nav_classes(classes)
      class_names(
        "tabnav",
        classes
      )
    end

    def tab_nav_body_classes(classes)
      class_names(
        "tabnav-tabs",
        classes
      )
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.12 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-x86_64-linux app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-x86_64-darwin app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-x64-mingw32 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-x64-mingw-ucrt app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-arm64-darwin app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.12-aarch64-linux app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-x86_64-linux app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-x86_64-darwin app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-x64-mingw32 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-x64-mingw-ucrt app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-arm64-darwin app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.11-aarch64-linux app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10-x86_64-linux app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10-x86_64-darwin app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10-x64-mingw32 app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10-x64-mingw-ucrt app/lib/ariadne/tab_nav_helper.rb
ariadne_view_components-0.0.10-arm64-darwin app/lib/ariadne/tab_nav_helper.rb