Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

OP Heading component in Primer (#17879)

Parimal Satyal19efaf9dfd57
diff --git a/lookbook/docs/patterns/12-page-heading.md.erb b/lookbook/docs/patterns/12-page-heading.md.erb
new file mode 100644
index 00000000000..1be6cce3cc8
--- /dev/null
+++ b/lookbook/docs/patterns/12-page-heading.md.erb
@@ -0,0 +1,29 @@
+The OP Heading component is a custom component which should be used for individual headers on a page below the `Primer::OpenProject::PageHeader`. It allows you to use a standard HTML heading with appropriate styling for use within OpenProject.
+
+## Note
+
+The OP Heading is not meant as a complete replacement of the Primer Heading as that one might can still be used, for example in the `Primer::OpenProject::SidePanel`.
+
+## Overview
+
+<%= embed Patterns::HeadingPreview, :default %>
+
+## Anatomy
+
+The OP Heading consists simply of a regular HTML `h` tag. It takes one input to specify which level of heading (from h1 to h6) should be used.
+
+## Options
+
+Currently, there are no additional options implemented. It is planned to support an optional divider at the bottom.
+
+This is useful in places like Settings pages that might need more visual differentiation between sections.
+
+## Used in
+
+The `Heading` is used:
+
+- Recurring meetings and meeting series index pages
+
+## Technical notes
+
+Internally, the `Primer::OpenProject::Heading` component calls the normal `Primer::Beta::Heading` with an overwritten (lower) font-weight.
diff --git a/lookbook/docs/patterns/12-tables.md.erb b/lookbook/docs/patterns/13-tables.md.erb
similarity index 100%
rename from lookbook/docs/patterns/12-tables.md.erb
rename to lookbook/docs/patterns/13-tables.md.erb
diff --git a/lookbook/docs/patterns/13-feedback-dialog-and-feedback-message.md.erb b/lookbook/docs/patterns/14-feedback-dialog-and-feedback-message.md.erb
similarity index 100%
rename from lookbook/docs/patterns/13-feedback-dialog-and-feedback-message.md.erb
rename to lookbook/docs/patterns/14-feedback-dialog-and-feedback-message.md.erb
diff --git a/lookbook/docs/patterns/14-danger-dialog.md.erb b/lookbook/docs/patterns/15-danger-dialog.md.erb
similarity index 100%
rename from lookbook/docs/patterns/14-danger-dialog.md.erb
rename to lookbook/docs/patterns/15-danger-dialog.md.erb
diff --git a/lookbook/docs/patterns/15-colors.md.erb b/lookbook/docs/patterns/16-colors.md.erb
similarity index 100%
rename from lookbook/docs/patterns/15-colors.md.erb
rename to lookbook/docs/patterns/16-colors.md.erb
diff --git a/lookbook/docs/patterns/16-settings-pages.md.erb b/lookbook/docs/patterns/17-settings-pages.md.erb
similarity index 100%
rename from lookbook/docs/patterns/16-settings-pages.md.erb
rename to lookbook/docs/patterns/17-settings-pages.md.erb
diff --git a/lookbook/previews/patterns/heading_preview.rb b/lookbook/previews/patterns/heading_preview.rb
new file mode 100644
index 00000000000..f468aa1b264
--- /dev/null
+++ b/lookbook/previews/patterns/heading_preview.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module Patterns
+ # @hidden
+ class HeadingPreview < ViewComponent::Preview
+ def default
+ render(Primer::OpenProject::Heading.new(tag: :h2)) { "Hello world" }
+ end
+ end
+end