Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/word-wrap-1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
roshaanbajwa committed Jun 12, 2024
2 parents 486a699 + 1cd3ae5 commit 2b38b2b
Show file tree
Hide file tree
Showing 433 changed files with 6,196 additions and 3,045 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ jobs:

- name: Install dependencies
run: npm install


- name: Sonar analysis
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: .
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Run linting
run: npm run lint

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/*
dist/*
.cache/*
tests/backstop/*
.github/*
coverage/*
Expand Down
139 changes: 132 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,131 @@
# NHS.UK frontend Changelog

## 7.0.1 - TBA
## 8.2.0 - 12 June 2024

:recycle: **Changes**

- Align label bottom margins with fieldset legend bottom margins ([PR 946](https://github.com/nhsuk/nhsuk-frontend/pull/946))

:wrench: **Fixes**

- Change example link to hash ([PR 962](https://github.com/nhsuk/nhsuk-frontend/pull/962))
- Adjust nested list spacing ([PR 961](https://github.com/nhsuk/nhsuk-frontend/pull/961))
- Fix header navigation item alignment ([PR 054](https://github.com/nhsuk/nhsuk-frontend/pull/954))
- Fix bug with inset text component requiring uppercase `html` argument ([Issue 950](https://github.com/nhsuk/nhsuk-frontend/issues/950))
- Remove unused CSS from icon card component ([PR 943](https://github.com/nhsuk/nhsuk-frontend/pull/943))
- Remove unused CSS from breadcrumbs component ([PR 943](https://github.com/nhsuk/nhsuk-frontend/pull/943))
- Add `aria-hidden` to responsive labels in responsive tables, to avoid screen readers repeating them ([PR 942](https://github.com/nhsuk/nhsuk-frontend/pull/942))
- Add `opacity: 1` to header search placeholder, to increase colour contrast on Firefox ([PR 939](https://github.com/nhsuk/nhsuk-frontend/pull/939))

## 8.1.1 - 14 March 2024

:wrench: **Fixes**

- Fix alignment of copyright footer
- Add missing/outdated backstop images
- Don't limit input heights to `40px`, to prevent vertical overflow

## 8.1.0 - 11 January 2024

:wrench: **Fixes**

- Updated header component unit tests ([PR 900](https://github.com/nhsuk/nhsuk-frontend/pull/900)).
- Fixed bug where the header didn't align with the main width container ([PR 902](https://github.com/nhsuk/nhsuk-frontend/pull/902)). This fixes [Issue 901](https://github.com/nhsuk/nhsuk-frontend/issues/901)
- Clicking the chevron image on a 'Primary Card (With Chevron)' card element now focuses the link ([PR 905](https://github.com/nhsuk/nhsuk-frontend/pull/905)).
- Added font licensing guidance to the relevant package READMEs and updated the copyright guidance to include NHS England ([PR 915](https://github.com/nhsuk/nhsuk-frontend/pull/915)).

:new: **New features**

- Add and export new `initAll` method in `nhsuk.js`, and pass document by default, but allowing smaller DOM scopes to be passed. This allows new nhsuk-frontend JS components to be initialised after page load, such as in new pieces of DOM added by JavaScript.
- This fixes [issue 906](https://github.com/nhsuk/nhsuk-frontend/issues/906) where button elements added _after_ the page has loaded would not benefit from the button component's JS behaviours (double click prevention and space bar activation for links). ([PR 907](https://github.com/nhsuk/nhsuk-frontend/pull/907)).

## 8.0.2 - 19 October 2023

:wrench: **Fixes**

- Resolves the bug of the drop down menu covering the main content of the page ([PR 898](https://github.com/nhsuk/nhsuk-frontend/pull/898)).

## 8.0.1 - 02 October 2023

:wrench: **Fixes**

- Updated design examples for suffix and prefix, and added backstop regression images ([PR 826](https://github.com/nhsuk/nhsuk-frontend/pull/826)).
- Fix focus padding for the search input ([PR 896](https://github.com/nhsuk/nhsuk-frontend/pull/896)).
- Remove card component Javascript from documentation ([PR 891](https://github.com/nhsuk/nhsuk-frontend/pull/891)).

## 8.0.0 - 28 September 2023

:boom: **Breaking changes**

- Updated header and footer to use the new styles and functionality to match the live nhs.uk site ([PR 881](https://github.com/nhsuk/nhsuk-frontend/pull/881))

As well as changes to the styles, this added an example of a footer with it's links in columns, and removed the redundant example of "Header transactional". This also fixes the issue ([Issue 805](https://github.com/nhsuk/nhsuk-frontend/issues/805)).

In the header variants, the menu toggle button has been replaced with a dropdown menu, that becomes visible when the screen width is below 768px (tablet width). The search toggle has been removed, and instead the search input automatically adjusts according to the screen width.

Instead of having this:

```
// menu toggle
<button class="nhsuk-header__menu-toggle" id="toggle-menu" aria-controls="header-navigation" aria-expanded="false">Menu</button
// close menu button
<button class="nhsuk-header__navigation-close" id="close-menu">
<svg class="nhsuk-icon nhsuk-icon__close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false" width="27" height="27">
</svg>
<span class="nhsuk-u-visually-hidden">Close menu</span>
</button>
```

You will now only need this:

```
<button class="nhsuk-header__navigation-link nhsuk-header__menu-toggle nhsuk-header__menu-toggle--visible" aria-expanded="false">
<span class="nhsuk-u-visually-hidden">Browse</span>
More
<svg class="nhsuk-icon nhsuk-icon__chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z"></path></svg>
</button>
<ul class="nhsuk-header__drop-down nhsuk-header__drop-down--hidden">
// navigation items in the drop down menu
</ul>
```

:wrench: **Fixes**

- Fix vertical alignment of primary card icon
- Change NHS Digital wording to NHS England
- Remove dead link in "Action link" example

:new: **New features**

- Added suffix and prefix examples to text input component ([PR 884](https://github.com/nhsuk/nhsuk-frontend/pull/884))

We added 4 new text input examples that allow users to add suffixes and prefixed to the input form. This was done by adding "suffix" and "prefix" as macro options.

```
input({
"label": {
"text": "What is the cost per item, in pounds?"
},
"prefix": "£",
"suffix": "per item",
"errorMessage": {
"text": "Enter a cost per item, in pounds"
}
})
```

## 7.1.0 - 21 August 2023

:new: **New features**
🆕 New features

- Added three new card variants, primary card(with chevron), secondary card and top task ([PR 878](https://github.com/nhsuk/nhsuk-frontend/pull/878))

:wrench: **Fixes**

Expand All @@ -12,15 +137,15 @@ We removed the need to add the last breadcrumb outside of the 'Items' list, now
{{ breadcrumb({
items: [
{
href: "/level-one",
href: "#",
text: "Level one"
},
{
href: "/level-one/level-two",
href: "#",
text: "Level two"
}
],
href: "/level-one/level-two/level-three",
href: "#",
text: "Level three"
}) }}
```
Expand All @@ -31,15 +156,15 @@ You will now only need this:
{{ breadcrumb({
items: [
{
href: "/level-one",
href: "#",
text: "Level one",
},
{
href: "/level-one/level-two",
href: "#",
text: "Level two"
},
{
href: "/level-one/level-two/level-three",
href: "#",
text: "Level three"
}
]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Read our [contributing guidelines](CONTRIBUTING.md) to contribute to NHS.UK fron

## Get in touch

NHS.UK frontend is maintained by NHS Digital. [Email us](mailto:[email protected]), open a [GitHub issue](https://github.com/nhsuk/nhsuk-frontend/issues/new) or get in touch on the [NHS digital service manual Slack workspace](https://join.slack.com/t/nhs-service-manual/shared_invite/enQtNTIyOTEyNjU3NDkyLTk4NDQ3YzkwYzk1Njk5YjAxYTI5YTVkZmUxMGQ0ZjA3NjMyM2ZkNjBlMWMxODVjZjYzNzg1ZmU4MWY1NmE2YzE).
NHS.UK frontend is maintained by NHS England. [Email us](mailto:[email protected]), open a [GitHub issue](https://github.com/nhsuk/nhsuk-frontend/issues/new) or get in touch on the [NHS digital service manual Slack workspace](https://join.slack.com/t/nhs-service-manual/shared_invite/enQtNTIyOTEyNjU3NDkyLTk4NDQ3YzkwYzk1Njk5YjAxYTI5YTVkZmUxMGQ0ZjA3NjMyM2ZkNjBlMWMxODVjZjYzNzg1ZmU4MWY1NmE2YzE).

## Licence

The codebase is released under the MIT Licence, unless stated otherwise. This covers both the codebase and any sample code in the documentation. The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.
The codebase is released under the MIT Licence, unless stated otherwise. This covers both the codebase and any sample code in the documentation. The documentation is © NHS England and available under the terms of the Open Government 3.0 licence.
2 changes: 0 additions & 2 deletions app/_templates/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
{% from 'components/card/macro.njk' import card %}
{% from 'components/contents-list/macro.njk' import contentsList %}
{% from 'components/details/macro.njk' import details %}
{% from 'components/header/macro.njk' import header %}
{% from 'components/hero/macro.njk' import hero %}
{% from 'components/footer/macro.njk' import footer %}
{% from 'components/do-dont-list/macro.njk' import list %}
{% from 'components/images/macro.njk' import image %}
{% from 'components/inset-text/macro.njk' import insetText %}
Expand Down
2 changes: 1 addition & 1 deletion app/components/action-link/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="nhsuk-grid-column-two-thirds">
{{ actionLink({
"text": "Find a minor injuries unit",
"href": "https://www.nhs.uk/service-search/minor-injuries-unit/locationsearch/551"
"href": "#"
}) }}
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions app/components/all.njk
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
items: [
{
text: "Home",
href: "https://www.nhs.uk/"
href: "#"
},
{
text: "Health A-Z",
href: "https://www.nhs.uk/conditions"
href: "#"
},
{
text: "Abscess",
href: "https://www.nhs.uk/conditions/abscess/"
href: "#"
}
]
}) }}
Expand All @@ -89,26 +89,26 @@
{{ contentsList({
items: [
{
href: "https://www.nhs.uk/conditions/age-related-macular-degeneration-amd/",
href: "#",
text: "What is AMD?",
current: "true"
},
{
href: "https://www.nhs.uk/conditions/age-related-macular-degeneration-amd/symptoms/",
href: "#",
text: "Symptoms"
},
{
href: "https://www.nhs.uk/conditions/age-related-macular-degeneration-amd/getting-diagnosed/",
href: "#",
text: "Getting diagnosed"
}
,
{
href: "https://www.nhs.uk/conditions/age-related-macular-degeneration-amd/treatment/",
href: "#",
text: "Treatments"
}
,
{
href: "https://www.nhs.uk/conditions/age-related-macular-degeneration-amd/living-with-amd/",
href: "#",
text: "Living with AMD"
}
]
Expand Down Expand Up @@ -917,7 +917,7 @@
"label": "Profile editor login"
}
],
"secondaryLinks": [
"metaLinks": [
{
"URL": "https://www.nhs.uk/about-us/sitemap/",
"label": "Sitemap"
Expand Down
8 changes: 4 additions & 4 deletions app/components/breadcrumb/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
{{ breadcrumb({
items: [
{
href: "/level-one",
href: "#",
text: "Level one",
attributes: {lang: "en"}
},
{
href: "/level-one/level-two",
href: "#",
text: "Level two"
},
{
href: "/level-one/level-two/level-three",
href: "#",
text: "Level three",
attributes: {lang: "en"}
}
],
href: "/level-one/level-two/level-three/level-four",
href: "#",
text: "Level four",
classes: "example-class-one example-class-two",
attributes: {lang: "en"}
Expand Down
2 changes: 1 addition & 1 deletion app/components/button/link.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="nhsuk-grid-column-two-thirds">
{{ button({
"text": "Link button",
"href": "/nhsuk-frontend/"
"href": "/"
}) }}
</div>
</div>
Expand Down
14 changes: 9 additions & 5 deletions app/components/card/card-group.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li class="nhsuk-grid-column-one-half nhsuk-card-group__item">
{{ card({
"href": "#",
"primary": "true",
"clickable": "true",
"heading": "Introduction to care and support",
"headingClasses": "nhsuk-heading-m",
Expand All @@ -26,28 +27,31 @@
<li class="nhsuk-grid-column-one-half nhsuk-card-group__item">
{{ card({
"href": "#",
"primary": "true",
"clickable": "true",
"heading": "Help from social services and charities",
"headingClasses": "nhsuk-heading-m",
"description": "Includes helplines, needs assessments, advocacy and reporting abuse"
"description": "Includes helplines, needs assessments, advocacy and reporting abuse."
}) }}
</li>
<li class="nhsuk-grid-column-one-half nhsuk-card-group__item">
{{ card({
"href": "#",
"primary": "true",
"clickable": "true",
"heading": "Money, work and benefits",
"heading": "Care services, equipment and care homes",
"headingClasses": "nhsuk-heading-m",
"description": "How to pay for care and support, and where you can get help with costs"
"description": "Includes home adaptations, help at home from a carer, social care you can get for free and housing."
}) }}
</li>
<li class="nhsuk-grid-column-one-half nhsuk-card-group__item">
{{ card({
"href": "#",
"primary": "true",
"clickable": "true",
"heading": "Care after a hospital stay",
"heading": "Money, work and benefits",
"headingClasses": "nhsuk-heading-m",
"description": "Includes hospital discharge and care and support afterwards"
"description": "How to pay for care and support, and where you can get help with costs"
}) }}
</li>
</ul>
Expand Down
25 changes: 25 additions & 0 deletions app/components/card/card-primary.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% set html_style = 'background-color: #f0f4f5;' %}
{% set title = 'Card - primary card (with chevron)' %}
{% from 'components/card/macro.njk' import card %}
{% extends 'layout.njk' %}

{% block body %}

<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper" id="maincontent">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ card({
"href": "#",
"primary": "true",
"clickable": "true",
"heading": "Introduction to care and support",
"headingClasses": "nhsuk-heading-m",
"description": "A quick guide for people who have care and support needs and their carers"
}) }}
</div>
</div>
</main>
</div>

{% endblock %}
Loading

0 comments on commit 2b38b2b

Please sign in to comment.