Sha256: 4a543a3f1ccbbc5a033700a8cf84e11a96c8dc054a233cd9b06239bc7844365f

Contents?: true

Size: 1.43 KB

Versions: 38

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    class Dialog
      # A `Dialog::Header` is a compositional component, used to render the
      # Header of a dialog. See <%= link_to_component(Primer::Alpha::Dialog) %>.
      class Header < Primer::Component
        status :alpha
        audited_at "2022-10-10"

        # @param title [String] Describes the content of the dialog.
        # @param subtitle [String] Provides dditional context for the dialog, also setting the `aria-describedby` attribute.
        # @param show_divider [Boolean] Show a divider between the header and body.
        # @param visually_hide_title [Boolean] Visually hide the `title` while maintaining a label for assistive technologies.
        # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
        def initialize(
          id:,
          title:,
          subtitle: nil,
          show_divider: false,
          visually_hide_title: false,
          **system_arguments
        )
          @id = id
          @title = title
          @subtitle = subtitle
          @visually_hide_title = visually_hide_title
          @system_arguments = deny_tag_argument(**system_arguments)
          @system_arguments[:tag] = :div
          @system_arguments[:classes] = class_names(
            "Overlay-header",
            { "Overlay-header--divided": show_divider },
            system_arguments[:classes]
          )
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.11.0 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.10.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.9.0 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.9.1 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.9.0 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.8.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.8.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.7.0 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.7.0 app/components/primer/alpha/dialog/header.rb
openproject-primer_view_components-0.6.3 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.6.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.5.1 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.5.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.4.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.3.1 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.3.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.2.0 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.1.9 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.1.8 app/components/primer/alpha/dialog/header.rb
primer_view_components-0.1.7 app/components/primer/alpha/dialog/header.rb