diff --git a/.changeset/light-jokes-sleep.md b/.changeset/light-jokes-sleep.md new file mode 100644 index 0000000000..bd5d728b69 --- /dev/null +++ b/.changeset/light-jokes-sleep.md @@ -0,0 +1,5 @@ +--- +'@openproject/primer-view-components': patch +--- + +Make the large header variant the default for OpenProject::PageHeader diff --git a/app/components/primer/open_project/page_header.rb b/app/components/primer/open_project/page_header.rb index 9dbbff1012..51bf6fbebb 100644 --- a/app/components/primer/open_project/page_header.rb +++ b/app/components/primer/open_project/page_header.rb @@ -7,16 +7,16 @@ class PageHeader < Primer::Component HEADING_TAG_OPTIONS = [:h1, :h2, :h3, :h4, :h5, :h6].freeze HEADING_TAG_FALLBACK = :h2 - DEFAULT_HEADER_VARIANT = :medium + DEFAULT_HEADER_VARIANT = :large HEADER_VARIANT_OPTIONS = [ - :large, + :medium, DEFAULT_HEADER_VARIANT ].freeze DEFAULT_BACK_BUTTON_SIZE = :medium BACK_BUTTON_SIZE_OPTIONS = [ :small, - DEFAULT_HEADER_VARIANT, + DEFAULT_BACK_BUTTON_SIZE, :large ].freeze diff --git a/previews/primer/open_project/page_header_preview.rb b/previews/primer/open_project/page_header_preview.rb index 258a17a872..e0ff8f8968 100644 --- a/previews/primer/open_project/page_header_preview.rb +++ b/previews/primer/open_project/page_header_preview.rb @@ -25,7 +25,7 @@ def default # @param with_context_bar_actions [Boolean] # @param with_parent_link [Boolean] def playground( - variant: :medium, + variant: :large, title: "Hello", description: "Last updated 5 minutes ago by XYZ.", with_back_button: false, @@ -49,10 +49,10 @@ def playground( breadcrumb_items: breadcrumb_items }) end - # @label Large - def large_title + # @label Medium title + def medium_title render(Primer::OpenProject::PageHeader.new) do |header| - header.with_title(variant: :large) { "Hello" } + header.with_title(variant: :medium) { "Hello" } header.with_description { "Last updated 5 minutes ago by XYZ." } end end diff --git a/test/components/primer/open_project/page_header_test.rb b/test/components/primer/open_project/page_header_test.rb index 06cab5fb3a..58a906f432 100644 --- a/test/components/primer/open_project/page_header_test.rb +++ b/test/components/primer/open_project/page_header_test.rb @@ -16,14 +16,15 @@ def test_renders_title assert_text("Hello") assert_selector(".PageHeader-title") + assert_selector(".PageHeader-title--large") end - def test_renders_large_title - render_inline(Primer::OpenProject::PageHeader.new) { |header| header.with_title(variant: :large) { "Hello" } } + def test_renders_medium_title + render_inline(Primer::OpenProject::PageHeader.new) { |header| header.with_title(variant: :medium) { "Hello" } } assert_text("Hello") assert_selector(".PageHeader-title") - assert_selector(".PageHeader-title--large") + assert_selector(".PageHeader-title--medium") end def test_renders_description