Sha256: 87dc60f777f13ee6f3f12dd959a9594387e0a9419d0f813aaa958aed6e29e47f

Contents?: true

Size: 544 Bytes

Versions: 10

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

module Primer
  class UnderlineNavComponent < Primer::Component
    ALIGN_DEFAULT = :left
    ALIGN_OPTIONS = [ALIGN_DEFAULT, :right]

    with_content_areas :body, :actions

    def initialize(align: ALIGN_DEFAULT, **kwargs)
      @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT)

      @kwargs = kwargs
      @kwargs[:tag] = :nav
      @kwargs[:classes] = class_names(
        @kwargs[:classes],
        "UnderlineNav",
        "UnderlineNav--right" => @align == :right
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
primer_view_components-0.0.12 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.11 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.10 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.9 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.8 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.7 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.6 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.5 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.4 app/components/primer/underline_nav_component.rb
primer_view_components-0.0.3 app/components/primer/underline_nav_component.rb