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

Banner updates #1148

Merged
merged 116 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
f22f447
docs(banner): set up page and add placeholders
murrlipp Feb 3, 2025
a3b8f6a
feat(alert): initial build of new alert component
chrispymm Feb 5, 2025
5dd3ecd
feat(alert): futher work on alert template
chrispymm Feb 6, 2025
4df03ef
feat(alert): add link styles for info, success and error
chrispymm Feb 6, 2025
3ede457
feat(alert): revert inadvertant removal of node_modules from sass path
chrispymm Feb 6, 2025
e3191ad
feat(alert): update action layout, and add warning link styles
chrispymm Feb 6, 2025
b1661c9
docs(alert): WIP content and examples
murrlipp Feb 7, 2025
5718f5c
docs(alert): adding example image
murrlipp Feb 7, 2025
43a60a1
docs(alert): additional example image
murrlipp Feb 7, 2025
c2ed08c
feat(alert): further styling and dismiss behaviour
chrispymm Feb 10, 2025
fadd478
Update alert.md
helennickols Feb 10, 2025
b8849cc
Update alert.md
helennickols Feb 10, 2025
f126f8f
Update alert.md
helennickols Feb 10, 2025
e25d7e5
Update alert.md
helennickols Feb 10, 2025
0c84a9c
docs(alert): fix tabs
murrlipp Feb 11, 2025
3578c1a
docs(alert): update examples
murrlipp Feb 11, 2025
77c4b7f
docs(alert): update content
helennickols Feb 11, 2025
a727255
feat(alert): update the component api to take into account accessibil…
chrispymm Feb 11, 2025
f1fd14c
docs(alert): add example, code tweaks
murrlipp Feb 11, 2025
1d9618c
docs(alert): remove absolute link
murrlipp Feb 11, 2025
4e9a1e0
docs: remove absolute link
murrlipp Feb 11, 2025
43c8edd
feat(alert): update examples to new API and use govukattributes macro…
chrispymm Feb 12, 2025
4b66821
refactor(alert): extract scss colours and mixins
chrispymm Feb 12, 2025
db9bf95
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
murrlipp Feb 13, 2025
79fc01d
docs(alert): add accessible titles to examples
murrlipp Feb 13, 2025
4d30338
Update alert.md
helennickols Feb 13, 2025
cac7362
docs(alert): add github discussion URL
murrlipp Feb 13, 2025
d5642a3
Update alert.md
helennickols Feb 13, 2025
f871d88
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 13, 2025
c52a75b
Update alert.md
helennickols Feb 13, 2025
3c56e57
feat(alert): handle placing forcus on dismissing the alert
chrispymm Feb 13, 2025
9edad95
docs(alert): 2i changes
helennickols Feb 13, 2025
aa7972b
feat(alert): adjust selection of element to place focus on after dism…
chrispymm Feb 14, 2025
eaadd0c
docs(alert): 2i and accessibility changes
helennickols Feb 14, 2025
b84214a
refactor(alert): updates based on code review
chrispymm Feb 14, 2025
78d7709
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 14, 2025
bc834be
docs(alert): final 2i changes
helennickols Feb 14, 2025
19a7bba
feat(alert): styling fixes following code review
chrispymm Feb 17, 2025
2beb9c2
docs(alert): couple of small tweasks following code review
chrispymm Feb 17, 2025
92e5bb5
test(alert): add tests for alert component
chrispymm Feb 19, 2025
c6822f0
style(alert): indentation fixes
chrispymm Feb 19, 2025
132ebc5
feat(alert): add cursor:pointer to the dismiss button
chrispymm Feb 19, 2025
27c89d9
test(alert): small tweak to alert spec
chrispymm Feb 19, 2025
902239b
style(alert): tidy up
chrispymm Feb 19, 2025
70a4265
feat(alert): fix colour contrast on warning dismiss link
chrispymm Feb 21, 2025
7f86533
docs(alert): add focusOnDismiss Selector to alert args
chrispymm Feb 21, 2025
a8a7f56
docs(alert): remove combined alerts testing pagek
chrispymm Feb 21, 2025
ee621ad
docs(alert): focus state instructions
helennickols Feb 21, 2025
0942609
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 21, 2025
327973e
docs(alert): focus state instructions part 2
helennickols Feb 21, 2025
2e13ede
test(helpers): add tests for new helper functions
chrispymm Feb 21, 2025
f4e8ef7
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 24, 2025
420855c
docs: final change to bullet list
helennickols Feb 24, 2025
5eccd16
docs(banner): set up page and add placeholders
murrlipp Feb 3, 2025
a656db3
feat(alert): initial build of new alert component
chrispymm Feb 5, 2025
489fa35
feat(alert): futher work on alert template
chrispymm Feb 6, 2025
a32ae44
feat(alert): add link styles for info, success and error
chrispymm Feb 6, 2025
0038280
feat(alert): revert inadvertant removal of node_modules from sass path
chrispymm Feb 6, 2025
0a533b9
feat(alert): update action layout, and add warning link styles
chrispymm Feb 6, 2025
1abc21a
docs(alert): WIP content and examples
murrlipp Feb 7, 2025
17fece8
docs(alert): adding example image
murrlipp Feb 7, 2025
96fb70d
docs(alert): additional example image
murrlipp Feb 7, 2025
87bba1e
feat(alert): further styling and dismiss behaviour
chrispymm Feb 10, 2025
2983e76
Update alert.md
helennickols Feb 10, 2025
1854da4
Update alert.md
helennickols Feb 10, 2025
56a0d49
Update alert.md
helennickols Feb 10, 2025
b01cfa5
Update alert.md
helennickols Feb 10, 2025
dbebe96
docs(alert): fix tabs
murrlipp Feb 11, 2025
5087b35
docs(alert): update examples
murrlipp Feb 11, 2025
e1af9f8
docs(alert): update content
helennickols Feb 11, 2025
973541a
feat(alert): update the component api to take into account accessibil…
chrispymm Feb 11, 2025
796a768
docs(alert): add example, code tweaks
murrlipp Feb 11, 2025
dcb674f
feat(alert): update examples to new API and use govukattributes macro…
chrispymm Feb 12, 2025
8b75b66
docs(alert): remove absolute link
murrlipp Feb 11, 2025
64b1a32
refactor(alert): extract scss colours and mixins
chrispymm Feb 12, 2025
24ce4d1
docs: remove absolute link
murrlipp Feb 11, 2025
206e689
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
murrlipp Feb 13, 2025
9f59bfc
docs(alert): add accessible titles to examples
murrlipp Feb 13, 2025
e3c53da
Update alert.md
helennickols Feb 13, 2025
b1f2fcc
docs(alert): add github discussion URL
murrlipp Feb 13, 2025
c36a4d1
Update alert.md
helennickols Feb 13, 2025
209b9fb
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 13, 2025
5b2c1ad
Update alert.md
helennickols Feb 13, 2025
ef29725
feat(alert): handle placing forcus on dismissing the alert
chrispymm Feb 13, 2025
64d3ab6
docs(alert): 2i changes
helennickols Feb 13, 2025
a545940
feat(alert): adjust selection of element to place focus on after dism…
chrispymm Feb 14, 2025
1cf2093
refactor(alert): updates based on code review
chrispymm Feb 14, 2025
aef2cae
docs(alert): 2i and accessibility changes
helennickols Feb 14, 2025
5652bb4
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 14, 2025
cd6e272
docs(alert): final 2i changes
helennickols Feb 14, 2025
f83667c
feat(alert): styling fixes following code review
chrispymm Feb 17, 2025
dc5da93
docs(alert): couple of small tweasks following code review
chrispymm Feb 17, 2025
a1b6967
test(alert): add tests for alert component
chrispymm Feb 19, 2025
37b4c58
style(alert): indentation fixes
chrispymm Feb 19, 2025
d56edac
feat(alert): add cursor:pointer to the dismiss button
chrispymm Feb 19, 2025
89e08c9
test(alert): small tweak to alert spec
chrispymm Feb 19, 2025
f73afe3
style(alert): tidy up
chrispymm Feb 19, 2025
327e5ef
feat(alert): fix colour contrast on warning dismiss link
chrispymm Feb 21, 2025
1946960
docs(alert): add focusOnDismiss Selector to alert args
chrispymm Feb 21, 2025
d7dea0e
docs(alert): remove combined alerts testing pagek
chrispymm Feb 21, 2025
2e59c73
docs(alert): focus state instructions
helennickols Feb 21, 2025
6861170
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 21, 2025
bb8035d
test(helpers): add tests for new helper functions
chrispymm Feb 21, 2025
811edf9
docs(alert): focus state instructions part 2
helennickols Feb 21, 2025
ebf3c85
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 24, 2025
6cf7d4b
docs: final change to bullet list
helennickols Feb 24, 2025
76bb962
Merge branch 'banner-updates' of https://github.com/ministryofjustice…
helennickols Feb 24, 2025
b5eed05
docs: adding what's new content to homepage
helennickols Feb 24, 2025
ac35a29
feat(alert): adjust svg to be display:block to eliminate whitespace u…
chrispymm Feb 24, 2025
76d4f0a
docs: HTML link and content tweak
helennickols Feb 24, 2025
a674e09
docs: link tweak
helennickols Feb 24, 2025
8a07b7c
docs: link tweak 2
helennickols Feb 24, 2025
889daab
docs: link tweak 3
helennickols Feb 24, 2025
6c7b2d5
docs: homepage link change
helennickols Feb 24, 2025
d6c2e1d
feat(alert): add status to alert, add redirect to archived banner
chrispymm Feb 24, 2025
bd82891
feat(alert): update figma link
chrispymm 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
15 changes: 15 additions & 0 deletions docs/_includes/arguments/alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
| Name | Type | Required | Description |
| ---------------------- | ------- | -------- | ----------------------------------------------------------------------------------- |
| text | string | Yes | The text that displays in the alert. Any string can be used. If you set `html`, this option is not required and is ignored. |
| html | string | Yes | The HTML to use in the alert. Any string can be used. If you set `html`, `text` is not required and is ignored.|
| title | string | Yes | A short title for each alert, used as a unique accessible label. Can be displayed as a heading in the alert using `showTitleAsHeading`. |
| showTitleAsHeading | boolean | No | Set to true to display the `title` as a heading. The default is `false`. |
| titleTag | string | No | The HTML tag used for the heading if `showTitleAsHeading` is true. You can only use the values "h2", "h3", or "h4". The default is "h2".|
| variant | string | No | The alert variant being used. It's "information", "success", "warning" or "error". The default is "information". |
| role | string | No | Overrides the value of the role attribute for the alert. Defaults to "region". |
| disableAutoFocus | boolean | No | If `role` is set to "alert", JavaScript moves the keyboard focus to the alert when the page loads. To disable this behaviour, set `disableAutoFocus` to `true`.|
| dismissible | boolean | No | Set to `true` to allow the alert to be dismissed. The default is `false`. |
| dismissText | string | No | The text label for the dismiss button. The default is "Dismiss". |
| focusOnDismissSelector | string | No | A CSS selector for an element to place focus on when the alert is dismissed |
| classes | string | No | The classes that you want to add to the alert. |
| attributes | object | No | The HTML attributes that you want to add to the alert, for example data attributes. |
3 changes: 1 addition & 2 deletions docs/_includes/layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
<div class="app-layout__content">
<div class="app-cards">
{% call card({title: "What's new" })%}
<p class="govuk-body">24 February 2025: The <a href="/components/alert/">alert component</a> is now live. It's based on the <a href="/archive/banner/">banner component</a>, which has been archived.</p>
<p class="govuk-body">18 December 2024: The <a href="/content-standards/style-guide/">MoJ content style guide</a> is now live.</p>
<p class="govuk-body">10 December 2024: The <a href="/components/interruption-card/">interruption card component</a> is now live. Use it to help users understand possible errors and avoid serious mistakes.</p>
<p class="govuk-body">26 November 2024: We’ve archived the <a href="/archive/password-reveal/">password reveal component</a>. We recommend that teams use the <a href="https://design-system.service.gov.uk/components/password-input/">GOV.UK Design System password input</a> instead.</p>
<p class="govuk-body"><a href="https://docs.google.com/forms/d/1i7rinQINSjdQ6w_SChXqxQFTttPMgfcSfPamq8YRnP8/viewform">Sign up to get emails</a> about the MoJ Design System.</p>
{% endcall %}

Expand Down
10 changes: 5 additions & 5 deletions docs/components/banner.md → docs/archive/banner.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
layout: layouts/component.njk
layout: layouts/archive.njk
title: Banner
status: To be reviewed
statusDate: June 2021
type: component
redirect_from: components/banner
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/835
eleventyNavigation:
key: Banner
parent: Components
parent: Archive
excerpt: "Use the banner component to display a prominent message and related actions to take."
---

{% banner "The GOV.UK Design System has a similar component" %}
The [Notification banner component](https://design-system.service.gov.uk/components/notification-banner/) in the GOV.UK Design System has a similar function and visual design to this component.
{% banner "This component is archived" %}

You should consider using the GOV.UK version if it fits your needs.
Use the [alert](/components/alert) to display a notification to users.
{% endbanner %}

{% example "/examples/banner", 225 %}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
242 changes: 242 additions & 0 deletions docs/components/alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
---
layout: layouts/component.njk
title: Alert
status: Official
statusDate: February 2025
type: component
githuburl: https://github.com/ministryofjustice/moj-frontend/discussions/1163
eleventyNavigation:
key: Alert
parent: Components
excerpt: "Use the alert component to display a prominent message and related actions to take."
---

<span class="govuk-caption-xl">The alert component uses visual design to display a notification to users. It has a range of use cases.</span>

{% tabs "Contents" %}

{% tab "Overview" %}

{% example "/examples/alert" %}

## Overview

The alert component presents 1 of 4 types of alerts to a user. It can stay on the page or be dismissed by the user.

As a leaner component, it’s ideal for internal services and complex user interfaces (such as dashboards and case management systems).

There are 4 variants of the alert:

1. [Information alert](#information-alert)
2. [Warning alert](#warning-alert)
3. [Error alert](#error-alert)
4. [Success alert](#success-alert)

### Information alert

{% example "/examples/alert-information" %}

The information alert draws a user's attention to something important about a page or service. It has a blue border, and an information icon made up of a blue circle with a white letter 'i'.

#### When to use
Use the information alert sparingly. This makes users more likely to notice and engage with it. If a lot of information alerts are emerging in a service, it might be a sign that a journey needs redesigning.

The information alert can tell a user about:

- unfinished tasks, linking to where to complete them
- a major change to a service, until it becomes familiar
- service downtime

The information alert can be combined with other alert variants. For linear services, or to display the 'Important' heading, use the <a href="https://design-system.service.gov.uk/components/notification-banner">GOV.UK notification banner component</a>.

#### When not to use

Do not want use this component for a serious issue or to prevent something going wrong. Use the warning alert for this.

### Warning alert

{% example "/examples/alert-warning" %}

The warning alert tells users about something to prevent them from making a mistake. Use it sparingly to avoid alert fatigue. It has an orange border, and a warning icon made up of an orange triangle with a white exclamation mark.

#### When to use

A warning alert can be used when something:

- is missing but the user can access it another way, for example in a legacy system or on paper
- has not been updated recently but may still be of use, for example an assessment
- has become more urgent or important, for example because a deadline is approaching

If you want to add your message to the body copy or do not want a coloured border and icon, use the [GOV.UK inset text component](https://design-system.service.gov.uk/components/inset-text/) or the [GOV.UK warning text component](https://design-system.service.gov.uk/components/warning-text/).

#### When not to use

Do not use this component if the information is about something other than a warning. Select the [information alert](#information-alert) instead.

### Error alert

{% example "/examples/alert-error" %}

The error alert shows the user that something has gone wrong. It pauses the user without interrupting them. It can appear before or after a user input. It has a red border, and an error icon made up of a red octagon with a white 'X'.

<div class="govuk-warning-text">
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
<strong class="govuk-warning-text__text">
<span class="govuk-visually-hidden">Warning</span>
Do not use the error alert for validation errors. Continue to use the <a href="https://design-system.service.gov.uk/components/error-message">GOV.UK error message</a> for this.
</strong>
</div>

#### When to use

The error alert can be displayed when something:

- has changed significantly since the user’s last session, for example, a person has been released from prison or an appointment is now double-booked
- changed between the user opening the page and interacting with it, for example a case was deleted or assigned to someone else
- has to be done before this task, for example removing bookings from a property they're archiving

If the user needs to resolve the error, the alert should help them understand how.

#### When not to use

This alert draws a user’s attention to a message, without preventing them from doing other tasks on the page. Use the [interruption card component](/components/interruption-card/) if the user needs to acknowledge something before they continue on their journey.

### Success alert

{% example "/examples/alert-success" %}

The success alert displays a single message after a user has completed a task. It has a green border, and a success icon made up of a green tick.

This alert can be displayed at the top of the page or on the next page (if their task moves them through the service). Adding the alert to existing pages shortens the user journey. This is useful in non-linear services and services where users complete repetitive tasks.

#### When to use

The success banner can be used to show that something has:

- been uploaded or added, such as a file or record
- changed status, for example allocated to someone or moved to another stage in an application process
- been cancelled, deleted or another type of destructive (negative) action
- been changed or deleted from a table using the [multi select component](/components/multi-select/)

If you need to display more information or want a more prominent component, consider the [success variation of the GOV.UK notification banner](https://design-system.service.gov.uk/components/notification-banner/#reacting-to-something-the-user-has-done).

#### When not to use

Do not show the success alert to a user who has completed something more significant (such as a whole application) or reached the end of a service. Select the [GOV.UK confirmation page](https://design-system.service.gov.uk/patterns/confirmation-pages/) instead.

You may not need to display the alert if something else confirms success, for example the [GOV.UK task list component](https://design-system.service.gov.uk/components/task-list/) or the user progressing to another page.

### Things to consider

This alert pauses the user with a prominent message. This prioritisation should match the alert message and its relevance to the user.

An alert needs a title, which does not need to be displayed as a heading. The title gives each alert a unique label and helps screenreaders to identify the alert. It does not have to be read out.

{% endtab %}

{% tab "How to use" %}

## How to use

The alert works best when it contains a single, succinct message.

Do not use it to display large amounts of content. This reduces the prominence of the component and pushes other content down the page. If you cannot communicate your message in under 3 sentences, use a different component.

### What to add to it

The alert contains an icon and is surrounded by a border. It needs to contain body copy, with a full stop at the end of each sentence.

The alert needs a title, which does not need to be shown on the page. The title gives each alert a unique and accessible label, which can be read out to screenreader users.

You can add one heading (but no more) to the body copy. The heading level should follow its position on the page. For example, an alert heading would be an H2 if placed under a main page heading.

You can also add bullet points and links, if needed.

The alert content needs to make sense on its own. This ensures that the message does not rely on the colour and icon, as they're not accessible to everyone.

### Dismissing the alert

{% example "/examples/alert-dismissible" %}

The alert can stay on the page (be persistent) or be dismissed by the user. Dismissing it helps users to manage tasks and keep their interfaces clear. It's particularly helpful for the success alert, where there's nothing more for the user to do.

<div class="govuk-warning-text">
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
<strong class="govuk-warning-text__text">
<span class="govuk-visually-hidden">Warning</span>
Do not set up the alert to auto-dismiss, for example to disappear after a few seconds or when the user interacts with the page. This is not accessible.
</strong>
</div>

When an alert is dismissed, the focus will go to one of the following:

- the heading above, if there are no more alerts on the page
- the previous or next alert, if there are any more on the page
- the `main` element, if there's no heading above the alert

If you want the focus to go somewhere else, use the `focusOnDismissSelector` Nunjucks macro option. If this does not work, the focus will go to 1 of the 3 options.

### Height and width

The alert has no minimum or maximum height – it resizes to the contents. It should not be used to display a lot of content, though.

The alert will take the width of the container, and will automatically adjust for readability.

### How often to use it

When considering an alert in a specific case, think about the maximum number of alerts or banners a user might view on a page and in a journey.

If a lot of information and warning alerts are emerging in a service (for example, on every page) it might be a sign of a wider problem. This could be fixed through service design.

#### Stacking alerts

It's OK to present more than 1 alert on a page – they'll stack. When developing your alert strategy, consider:

- separating alerts that do not involve anything further for a user do – these can be easily dismissed
- combining instances of the warning, error and information states to reduce the number of alerts
- that the 'alert' read out to screenreader users should only be applied to one alert

### Where to add it

An alert can be displayed globally or in context, depending on the type of message.

A global alert is shown on all pages (or any page) and is about the service as a whole, for example service downtime. It can also be displayed on a homepage to draw the user’s attention to new and unknown issues. A contextual alert is shown in (and is about) a particular section.

Place alerts about a whole service or page at the top of the page above the main heading and below the back link (if there is one). An alert can also be positioned under a relevant heading, but should not be added to body copy.

### Alert colours and icons

The link text colour is the same as the rest of the variant. Each alert has an icon, which must not be removed. Removing the icon makes an alert too reliant on colour, which cannot be accessed by everyone. Do not change the colours.

#### Alert usage on coloured backgrounds

The alert is accessible on a `govuk-colour("white")` or `govuk-colour("light-grey")` background.

An alert should not be placed on a coloured background because:

- the colour contrast between the border and page may not be accessible
- the background may distract from the border colour and change the emphasis of the message

{% endtab %}

{% tab "Examples" %}

## Examples

### Alerts in a case management system

An error and success alert under an H1 shows a user that one of their tasks failed, and another was successful. It can be shown on the dashboard rather than another page.

<p><img src="{{ 'assets/images/alert-example-case-management.png' | rev | url }}" alt="An MoJ webpage showing a success alert positioned below the heading level 1."></p>

### Error alert under a subheading

Alerts positioned inline with other content help people to understand what the message relates to. In this example the heading level of the alert component should be changed to H3 as it appears within an H2 heading.

<p><img src="{{ 'assets/images/alert-example-contextual.png' | rev | url }}" alt="A warning alert with heading level 3 is shown beneath a heading level 2 on an MoJ webpage to highlight the importance of maintaining heading structure.'"></p>

{% endtab %}

{% endtabs %}

<hr />
14 changes: 14 additions & 0 deletions docs/examples/alert-dismissible/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Alert (example)
arguments: alert
figma_link: https://www.figma.com/design/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?node-id=66-5802
---
{%- from "moj/components/alert/macro.njk" import mojAlert -%}

{{ mojAlert({
variant: "success",
title: "File uploaded successfully",
dismissible: true,
html: '<a href="#">Scan1.jpg</a> has been added to this application.'
}) }}
14 changes: 14 additions & 0 deletions docs/examples/alert-error/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Alert (example)
arguments: alert
figma_link: https://www.figma.com/design/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?node-id=66-5802
---
{%- from "moj/components/alert/macro.njk" import mojAlert -%}

{{ mojAlert({
variant: "error",
title: "This case has been assigned to someone else",
dismissible: false,
text: "This case has been assigned to someone else, so you can no longer make changes."
}) }}
14 changes: 14 additions & 0 deletions docs/examples/alert-information/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Alert (example)
arguments: alert
figma_link: https://www.figma.com/design/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?node-id=66-5802
---
{%- from "moj/components/alert/macro.njk" import mojAlert -%}

{{ mojAlert({
variant: "information",
title: "A section has moved",
dismissible: false,
html: 'The finance section has moved to the <a href="#">dashboard</a>.'
}) }}
14 changes: 14 additions & 0 deletions docs/examples/alert-success/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Alert (example)
arguments: alert
figma_link: https://www.figma.com/design/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?node-id=66-5802
---
{%- from "moj/components/alert/macro.njk" import mojAlert -%}

{{ mojAlert({
variant: "success",
title: "Upload successful",
dismissible: false,
html: '<a href="#">Scan1.jpg</a> uploaded successfully.'
}) }}
14 changes: 14 additions & 0 deletions docs/examples/alert-warning/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Alert (example)
arguments: alert
figma_link: https://www.figma.com/design/N2xqOFkyehXwcD9DxU1gEq/MoJ-Figma-Kit?node-id=66-5802
---
{%- from "moj/components/alert/macro.njk" import mojAlert -%}

{{ mojAlert({
variant: "warning",
title: "Some information could not be imported",
dismissible: false,
html: 'Some information could not be imported. Enter <a href="#">client details</a> manually instead.'
}) }}
Loading