Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 1126 build status design #1154

Merged
merged 40 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b65e7da
inital configuration
ehtabrizi Feb 5, 2025
61170b7
updates to use phase tag
ehtabrizi Feb 5, 2025
a638e5b
updates to macro
ehtabrizi Feb 5, 2025
2d8e8b3
sticky variation for demo
ehtabrizi Feb 6, 2025
d49a703
fix font style app over rides
ehtabrizi Feb 6, 2025
07cef73
work to use included vars
ehtabrizi Feb 6, 2025
a4cd461
remove args not used
ehtabrizi Feb 7, 2025
36a2171
removed fullstop from link and added to span
ehtabrizi Feb 10, 2025
82f4ece
format file
ehtabrizi Feb 10, 2025
7fdb4de
temp update
ehtabrizi Feb 10, 2025
48130db
updated file
ehtabrizi Feb 10, 2025
a210ded
updates following comments
ehtabrizi Feb 10, 2025
38aaae1
scroll padding applied for tier banner
ehtabrizi Feb 11, 2025
0bfcc2a
updated to support overide values
ehtabrizi Feb 11, 2025
bf88890
updates
ehtabrizi Feb 11, 2025
8e00b56
add condition to allow for null property to render no link
ehtabrizi Feb 11, 2025
4f84a7c
updated zindex to follow system
ehtabrizi Feb 11, 2025
865b2b0
docs: adding placeholder content
murrlipp Feb 18, 2025
c51f5dc
docs: update nav order
murrlipp Feb 18, 2025
8bde440
docs: Updating content
murrlipp Feb 18, 2025
d964dc1
new status banner applied
ehtabrizi Feb 19, 2025
c3acb35
updates to structure
ehtabrizi Feb 19, 2025
2bd009f
updated messaging
ehtabrizi Feb 19, 2025
ad306ac
removed style
ehtabrizi Feb 19, 2025
739e567
applied updates for link and styles
ehtabrizi Feb 19, 2025
5238953
added margin on details
ehtabrizi Feb 20, 2025
8708684
docs: update status props
murrlipp Feb 20, 2025
7a2f52e
docs: add status options to other templates
murrlipp Feb 20, 2025
2972bc4
docs: apply statuses to building blocks
murrlipp Feb 20, 2025
3634215
docs: add aria-hidden to decorative tags
murrlipp Feb 20, 2025
474e6c9
updated logic for display of status and type
ehtabrizi Feb 20, 2025
6902399
updates to logic
ehtabrizi Feb 21, 2025
1d1a05e
updates
ehtabrizi Feb 21, 2025
4a3bb28
updated data feed
ehtabrizi Feb 21, 2025
52d3716
further logic updates
ehtabrizi Feb 21, 2025
b039d4b
updates to text
ehtabrizi Feb 21, 2025
b7d95c0
updates following comments
ehtabrizi Feb 21, 2025
32656b3
update css class
ehtabrizi Feb 21, 2025
242f6cb
updates following comments
ehtabrizi Feb 21, 2025
c6dea49
removed space
ehtabrizi Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/_data/statusInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Official": {
"link": "How ‘official’ components work",
"linkContent": "Components with an ‘official’ status have had a full, multi-disciplinary team review.",
"statusMessage": "Updated "
},
"To be reviewed": {
"link": "How ‘to be reviewed’ components work",
"linkContent": "Components with a ‘to be reviewed’ status have been added for use by everyone, but have not been checked or improved recently.",
"statusMessage": "Created "
},
"Experimental": {
"link": "How ‘experimental’ components work",
"linkContent": "Anyone can add an ‘experimental’ status component to the MoJ Design System. They’re early in development and can be used as a starting point.",
"statusMessage": "Created "
},
"Archived": {
"link": "How ‘archived’ components work",
"linkContent": "This component is no longer being supported and should not be used.",
"statusMessage": "Archived "
}
}
7 changes: 5 additions & 2 deletions docs/_includes/layouts/archive.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% extends "./base.njk" %}

{% import "./macros/status.njk" as macros %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Archive</span>{% endif %}
{% if not isIndex %}<span class="govuk-caption-xl">Archive</span>{% endif %}
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}">
{{ title }}
</h1>
{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }}
{{ content | safe }}
</div>

Expand Down
10 changes: 6 additions & 4 deletions docs/_includes/layouts/component.njk
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{% extends "./base.njk" %}

{% block content %}
{% import "./macros/status.njk" as macros %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there's only one macro in the file, would this be better as:

{% from "./macros/status.njk" import statusLabel %}


{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %}
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %}
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}">
{{ title }}
</h1>

{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for release, but could this be a pageTitle partial/macro? As its repeated several times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Chris, noted for later iteration.

{{ content | safe }}

{% include "./partials/get-help-and-contribute.njk" %}
Expand Down
60 changes: 60 additions & 0 deletions docs/_includes/layouts/macros/status.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% from "govuk/components/details/macro.njk" import govukDetails %}


{% macro statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth a little bit of inline documentation of these args?

{% if status %}



{% set statusData = (statusInfo[status] if statusInfo and status in statusInfo else {}) %}

{% set statusClass = {
"Official": "govuk-tag--green",
"To be reviewed": "govuk-tag--orange",
"Experimental": "govuk-tag",
"Archived": "govuk-tag--grey"
}[status] or "" %}


<span class="govuk-tag status-tag {{ statusClass }}">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to trim the empty spaces off when statusClass isn't set?

Or follow the coding standards and use .app-status or .moj-status for our extended styles?

Suggested change
<span class="govuk-tag status-tag {{ statusClass }}">
<span class="govuk-tag app-tag--status{%- if statusClass %} {{ statusClass }}{% endif %}">

<span class="govuk-visually-hidden">Status:</span> {{ status }}
</span>

{% if status == 'Experimental' or statusDate %}
<p class="status-message govuk-!-margin-bottom-2">
{{ statusData.statusMessage }}{% if status == 'Experimental' %} by{%- if creatorName and creatorTeam %}
{{ creatorName }} in {{ creatorTeam }}
{%- elif creatorName %}
{{ creatorName }}
{%- elif creatorTeam %}
someone in {{ creatorTeam }}
{%- else %}
someone in the community
{%- endif %}{% if statusDate %} in {{ statusDate }}{% endif %}.{% else %} in {{ statusDate }}.{% endif %}
</p>
{% endif %}

<details class="govuk-details govuk-!-margin-bottom-8">
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
{{ statusInfo[status].link
| replace('Components', type | capitalize + 's')
| replace('components', type | lower + 's')
| replace('Component', type | capitalize)
| replace('component', type | lower)
}}
</span>
</summary>
<div class="govuk-details__text">
{{ statusInfo[status].linkContent
| replace('Components', type | capitalize + 's')
| replace('components', type | lower + 's')
| replace('Component', type | capitalize)
| replace('component', type | lower)
}}
<a href="/design-system-statuses">Read about all the Design System statuses</a>.
</div>
</details>

{% endif %}
{% endmacro %}
7 changes: 5 additions & 2 deletions docs/_includes/layouts/pages.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% extends "./base.njk" %}

{% import "./macros/status.njk" as macros %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Pages</span>{% endif %}
{% if not isIndex %}<span class="govuk-caption-xl">Pages</span>{% endif %}
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}">
{{ title }}
</h1>
{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }}
{{ content | safe }}

{% if isIndex or isArchive %}
Expand Down
7 changes: 5 additions & 2 deletions docs/_includes/layouts/patterns.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% extends "./base.njk" %}

{% import "./macros/status.njk" as macros %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Patterns</span>{% endif %}
{% if not isIndex %}<span class="govuk-caption-xl">Patterns</span>{% endif %}
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}">
{{ title }}
</h1>
{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }}
{{ content | safe }}

{% if isIndex or isArchive %}
Expand Down
2 changes: 2 additions & 0 deletions docs/archive/currency-input.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/archive.njk
title: Currency input
status: Archived
statusDate: June 2021
type: component
redirect_from: /components/currency-input
eleventyNavigation:
Expand Down
3 changes: 3 additions & 0 deletions docs/archive/form-validator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: layouts/archive.njk
title: Form validator
status: Archived
type: component
statusDate: April 2022
redirect_from: /components/form-validator
eleventyNavigation:
key: Form validator
Expand Down
2 changes: 2 additions & 0 deletions docs/archive/password-reveal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/archive.njk
title: Password reveal
status: Archived
statusDate: November 2024
type: component
redirect_from: /components/password-reveal
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/709
Expand Down
3 changes: 3 additions & 0 deletions docs/archive/question-pages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: layouts/archive.njk
title: Question pages
status: Archived
type: page
statusDate: December 2023
redirect_from: [docs/patterns/question-pages.md, /pages/question-pages]
eleventyNavigation:
key: Question page
Expand Down
3 changes: 3 additions & 0 deletions docs/archive/rich-text-editor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: layouts/archive.njk
title: Rich text editor
status: Archived
type: component
statusDate: April 2022
redirect_from: /components/rich-text-editor
eleventyNavigation:
key: Rich text editor
Expand Down
3 changes: 3 additions & 0 deletions docs/archive/tag.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: layouts/archive.njk
title: Tag
status: Archived
type: component
statusDate: June 2021
redirect_from: /components/tag
eleventyNavigation:
key: Tag
Expand Down
3 changes: 3 additions & 0 deletions docs/archive/task-list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: layouts/archive.njk
title: Task list pages
type: page
status: Archived
statusDate: December 2023
redirect_from: [docs/patterns/task-list.md, /pages/task-list]
eleventyNavigation:
key: Task list page
Expand Down
1 change: 1 addition & 0 deletions docs/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $govuk-assets-path: "../" !default;
@import "./components/page";
@import "./components/menu-toggle";
@import "./components/app-card";
@import "./components/status";
@import "./components/documentation_tabs";

@view-transition {
Expand Down
9 changes: 9 additions & 0 deletions docs/assets/stylesheets/components/_status.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.status-tag {
display: inline-block;
vertical-align: super;
margin-left: govuk-spacing(2);
}

p.status-message {
color: $govuk-secondary-text-colour;
}
2 changes: 2 additions & 0 deletions docs/components/add-another.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Add another
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/686
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: layouts/component.njk
title: Badge
type: component
status: To be reviewed
statusDate: June 2021
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/687
eleventyNavigation:
parent: Components
Expand Down
2 changes: 2 additions & 0 deletions docs/components/banner.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Banner
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/835
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/button-menu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Button menu
status: Official
statusDate: October 2024
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/685
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/date-picker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Date picker
status: Official
statusDate: July 2024
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/703
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/filter.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Filter
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/197
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/header.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Header
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/246
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/identity-bar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Identity bar
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/704
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/interruption-card.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Interruption card
status: Official
statusDate: December 2024
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/421
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/messages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Messages
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/705
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/multi-file-upload.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Multi file upload
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/264
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/multi-select.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Multi select
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/206
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/notification-badge.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Notification badge
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/706
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/organisation-switcher.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Organisation switcher
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/239
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/page-header-actions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Page header actions
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/707
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/pagination.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Pagination
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/708
eleventyNavigation:
Expand Down
2 changes: 2 additions & 0 deletions docs/components/primary-navigation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: layouts/component.njk
title: Primary navigation
status: To be reviewed
statusDate: June 2021
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/710
eleventyNavigation:
Expand Down
Loading