Skip to content

Commit 354a137

Browse files
Upgrade to NHS.UK frontend v10.3, prepare beta release (#323)
* Update to NHS.UK frontend v10.3.1 * Update snapshots with duplicate class now removed * Rename input prefix and suffix HTML class * Update the HTML for header search * Update the HTML for responsive table cell content * Rename checkbox and radio button 'aria-controls' attributes * Update the HTML for tables as a panel * Add support for `size` on headings * Add support for `size` on body text * Add support for `visuallyHiddenText` to render React elements * Add support for `visuallyHiddenText` prop on headings * Add support for `visuallyHiddenText` prop on back link * Only use boolean props for card types (excluding care cards) * Update the HTML for warning callouts * Add interruption panel variant * Add file upload component * Enable NHS.UK frontend i18n support * Formatting * Remove `Table.Panel` component * Simplify summary list component to avoid actions wrapper * Simplify card component to avoid unnecessary content wrapper * Add more card examples * Set up story backgrounds and column widths * Add support for card actions * Add more card examples * Add support for `reverse` prop in link components * Move heading level component into typography * Rename heading level to `<Heading>` with h1 default * Update migration guide * Allow checkbox item `exclusiveGroup` to be set manually * Update checkbox examples * Update migration guide * Formatting * Fix footer meta to omit heading and list without items * Update footer component to support headings and content * Update footer examples * Add support for `visuallyHiddenText` to render React elements (more) * Update FormGroup component to support multiple children * Prevent text input `beforeInput` and `afterInput` from overriding prefix/suffix * Fix "Error: Functions cannot be passed directly to Client Components…" * Remove unnecessary context from card component * Add changelog entry * Fix typo * Update package version to v6.0.0-beta.5
1 parent dc87904 commit 354a137

133 files changed

Lines changed: 6272 additions & 1628 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.storybook/preview.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import './storybook.scss';
2+
import { type Preview } from '@storybook/react-vite';
3+
4+
import { Col, Container, Row } from '#components/layout/index.js';
5+
6+
const preview: Preview = {
7+
decorators: (Story, { parameters }) =>
8+
parameters.width === false ? (
9+
<Story />
10+
) : (
11+
<Container>
12+
<main className="nhsuk-main-wrapper" id="maincontent">
13+
<Row>
14+
<Col width={parameters.width ?? 'two-thirds'}>
15+
<Story />
16+
</Col>
17+
</Row>
18+
</main>
19+
</Container>
20+
),
21+
parameters: {
22+
actions: { argTypesRegex: '^on[A-Z].*' },
23+
backgrounds: {
24+
options: {
25+
dark: { name: 'Dark', value: '#005eb8' },
26+
light: { name: 'Light', value: '#f0f4f5' },
27+
white: { name: 'White', value: '#fff' },
28+
grey: { name: 'Grey', value: '#d8dde0' },
29+
},
30+
},
31+
width: 'two-thirds',
32+
layout: 'fullscreen',
33+
initialGlobals: {
34+
backgrounds: { value: 'light' },
35+
},
36+
options: {
37+
storySort: {
38+
order: [
39+
'Welcome',
40+
'Migration Guides',
41+
'Form Elements',
42+
'Content Presentation',
43+
'Navigation',
44+
'Layout',
45+
'Patterns',
46+
],
47+
},
48+
},
49+
},
50+
tags: ['autodocs'],
51+
};
52+
53+
export default preview;

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# NHS.UK React components
22

3-
## Unreleased
3+
## 6.0.0-beta.5 - 23 January 2026
44

5-
This version provides support for NHS.UK frontend v10.2 and includes:
5+
This version provides support for NHS.UK frontend v10.3 and includes:
6+
7+
- [File upload component](https://service-manual.nhs.uk/design-system/components/file-upload)
8+
- [Interruption panel variant](https://service-manual.nhs.uk/design-system/components/panel#interruption-panel)
9+
- [Summary cards](https://service-manual.nhs.uk/design-system/components/summary-list#summary-cards)
10+
11+
With additional support added for NHS.UK frontend v10.2 including:
612

713
- [Password input component](https://service-manual.nhs.uk/design-system/components/password-input)
814
- [Smaller and inline buttons](https://service-manual.nhs.uk/design-system/components/buttons#smaller-buttons)

docs/upgrade-to-6.0.md

Lines changed: 115 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ The updated [header](https://service-manual.nhs.uk/design-system/components/head
1818
- update NHS logo in the header to have higher contrast when focused
1919
- refactor CSS classes and BEM naming, use hidden attributes instead of modifier classes, use generic search element
2020

21-
#### Use the password input component to help users accessibly enter passwords
21+
#### New file upload component
22+
23+
We've added a new [file upload](https://service-manual.nhs.uk/design-system/components/file-upload) component from NHS.UK frontend v10.3 which:
24+
25+
- makes the file inputs easier to use for drag and drop
26+
- allows the text of the component to be translated
27+
- fixes accessibility issues for users of Dragon, a speech recognition software
28+
29+
#### New password input component to help users accessibly enter passwords
2230

2331
The [password input](https://service-manual.nhs.uk/design-system/components/password-input) component from NHS.UK frontend v10.2 allows users to choose:
2432

@@ -48,7 +56,7 @@ You can now add inline buttons to text inputs and select menus using the `formGr
4856
```jsx
4957
<TextInput
5058
formGroupProps={{
51-
afterInput: () => (
59+
afterInput: (
5260
<Button secondary small>
5361
Search
5462
</Button>
@@ -88,6 +96,18 @@ We've added a new `<Select.Divider />` child component for select menus to suppo
8896
</Select>
8997
```
9098

99+
#### Use cards to visually separate multiple summary lists on a single page
100+
101+
You can now wrap a [card](https://service-manual.nhs.uk/design-system/components/cards) around [summary lists](https://service-manual.nhs.uk/design-system/components/summary-list) to help you:
102+
103+
- design and build pages with multiple summary lists
104+
- show visual dividers between summary lists
105+
- allow users to apply actions to entire lists
106+
107+
### Reverse links
108+
109+
To align with NHS.UK frontend, we've updated the [action link](https://service-manual.nhs.uk/design-system/components/action-link), [back link](https://service-manual.nhs.uk/design-system/components/back-link) and [breadcrumbs](https://service-manual.nhs.uk/design-system/components/breadcrumbs) components to support the `reverse` prop for dark backgrounds.
110+
91111
### Numbered pagination component
92112

93113
The [pagination](https://service-manual.nhs.uk/design-system/components/pagination) component from NHS.UK frontend v10.1 has been updated to support numbered pagination:
@@ -115,7 +135,7 @@ The [notification banner](https://service-manual.nhs.uk/design-system/components
115135

116136
### Panel component
117137

118-
The [panel](https://service-manual.nhs.uk/design-system/components/panel) component from NHS.UK frontend v9.3.0 has been added:
138+
The [panel](https://service-manual.nhs.uk/design-system/components/panel) component from NHS.UK frontend v9.3.0, and the [interruption panel variant](https://service-manual.nhs.uk/design-system/components/panel#interruption-panel) from NHS.UK frontend v10.3.0, have been added:
119139

120140
```jsx
121141
<Panel>
@@ -130,32 +150,32 @@ This replaces the [list panel component](#list-panel) which was removed in NHS.U
130150

131151
The [summary list](https://service-manual.nhs.uk/design-system/components/summary-list) component now includes improvements from NHS.UK frontend v9.6.2:
132152

133-
- new props `noBorder` and `noActions` supported at `<SummaryList.Row>` level
153+
- new prop `noBorder` supported at `<SummaryList.Row>` level
134154
- new child component `<SummaryList.Action>` for row actions
155+
- removed unnecessary child component `<SummaryList.Actions>`
135156

136157
```patch
137158
<SummaryList>
138159
- <SummaryList.Row>
139160
+ <SummaryList.Row noBorder>
140161
<SummaryList.Key>Name</SummaryList.Key>
141162
<SummaryList.Value>Karen Francis</SummaryList.Value>
142-
<SummaryList.Actions>
163+
- <SummaryList.Actions>
143164
- <a href="#">
144165
- Change<span className="nhsuk-u-visually-hidden"> name</span>
145166
- </a>
146-
+ <SummaryList.Action href="#" visuallyHiddenText="name">
147-
+ Change
148-
+ </SummaryList.Action>
149-
</SummaryList.Actions>
150-
</SummaryList.Row>
151-
- <SummaryList.Row>
152-
+ <SummaryList.Row noActions>
153-
<SummaryList.Key>Date of birth</SummaryList.Key>
154-
<SummaryList.Value>15 March 1984</SummaryList.Value>
167+
+ <SummaryList.Action href="#" visuallyHiddenText="name">
168+
+ Change
169+
+ </SummaryList.Action>
170+
- </SummaryList.Actions>
155171
</SummaryList.Row>
156172
</SummaryList>
157173
```
158174

175+
### Support for component language localisation
176+
177+
The [character count](https://service-manual.nhs.uk/design-system/components/character-count), [file upload](https://service-manual.nhs.uk/design-system/components/file-upload) and [password input](https://service-manual.nhs.uk/design-system/components/password-input) components now support the `i18n` prop for [NHS.UK frontend localisation](https://github.com/nhsuk/nhsuk-frontend/blob/main/docs/configuration/localisation.md).
178+
159179
### Support for React Server Components (RSC)
160180

161181
All components have been tested as React Server Components (RSC) but due to [multipart namespace component limitations](https://ivicabatinic.from.hr/posts/multipart-namespace-components-addressing-rsc-and-dot-notation-issues) an alternative syntax (without dot notation) can be used as a workaround:
@@ -243,6 +263,18 @@ If you are using the `headingLevel` prop you will need to update any uppercase v
243263
+ <Card.Heading headingLevel="h3">Example heading</Card.Heading>
244264
```
245265

266+
### Rename the heading level component
267+
268+
If you are using the `HeadingLevel` component you must rename it to `Heading` where the `size` and `visuallyHiddenText` props now supported:
269+
270+
```patch
271+
- <HeadingLevel className="nhsuk-heading-m">
272+
+ <Heading size="m">
273+
Example heading
274+
- </HeadingLevel>
275+
+ </Heading>
276+
```
277+
246278
### Restore visually hidden text for accessibility
247279

248280
For accessibility reasons, it's no longer possible to pass `visuallyHiddenText: false` or override other hidden text for the following:
@@ -255,14 +287,44 @@ For accessibility reasons, it's no longer possible to pass `visuallyHiddenText:
255287

256288
Read about other [changes to meet WCAG 2.2](https://service-manual.nhs.uk/design-system/changes-to-design-system-wcag-2-2) on the design system in the NHS digital service manual.
257289

258-
### Check components that conditionally reveal content still work
290+
### Check radios and checkboxes that conditionally reveal content still work
259291

260292
Previously, conditionally revealing content ([radios](https://service-manual.nhs.uk/design-system/components/radios#conditionally-revealing-content), [checkboxes](https://service-manual.nhs.uk/design-system/components/checkboxes#conditionally-revealing-content)) would not be rendered until their related input was checked.
261293

262294
To align with NHS.UK frontend, conditionally revealing content is now always rendered but remains hidden until revealed. Accessibility issues with missing `aria-controls`, `aria-describedby` or `aria-expanded` are now fixed.
263295

264296
You must check all form components, form validation and error handling that may not expect hidden conditionally revealing content in the HTML.
265297

298+
### Check checkboxes with exclusive behaviour still work
299+
300+
Previously, the [checkboxes component](https://service-manual.nhs.uk/design-system/components/checkboxes) incorrectly set the the `data-checkbox-exclusive-group` attribute on all items, even when no [option for "none"](https://service-manual.nhs.uk/design-system/components/checkboxes#none-option) was included.
301+
302+
To align with NHS.UK frontend, one or more exclusive groups are now supported using the `Checkboxes.Item` prop `exclusiveGroup`.
303+
304+
You must manually add the `exclusiveGroup` prop to all checkboxes in the same exclusive group. You do not need to do anything if your checkboxes share the same `name` attribute in the rendered HTML, as the exclusive group is determined automatically.
305+
306+
```patch
307+
<Checkboxes legend="How do you want to be contacted about this?" name="colour">
308+
- <Checkboxes.Item name="colour-red">
309+
+ <Checkboxes.Item name="colour-red" exclusiveGroup="colour">
310+
Red
311+
</Checkboxes.Item>
312+
- <Checkboxes.Item name="colour-blue">
313+
+ <Checkboxes.Item name="colour-blue" exclusiveGroup="colour">
314+
Blue
315+
</Checkboxes.Item>
316+
- <Checkboxes.Item name="colour-blue">
317+
+ <Checkboxes.Item name="colour-blue" exclusiveGroup="colour">
318+
Green
319+
</Checkboxes.Item>
320+
<Checkboxes.Divider />
321+
- <Checkboxes.Item value="colour-none" exclusive>
322+
+ <Checkboxes.Item value="colour-none" exclusiveGroup="colour" exclusive>
323+
None of the above
324+
</Checkboxes.Item>
325+
</Checkboxes>
326+
```
327+
266328
### Remove unsupported icons
267329

268330
To align with NHS.UK frontend, icons unused by components have been removed:
@@ -291,6 +353,30 @@ You must also make the following changes:
291353
- replace `<LinkButton>` with `<Button href="/example">` to render HTML `<a>` elements
292354
- remove the `debounceTimeout` prop when preventing double clicks
293355

356+
### Cards
357+
358+
To align with NHS.UK frontend, we've updated the [card component](https://service-manual.nhs.uk/design-system/components/card) to use boolean props for all supported card types. The existing `cardType` prop can now only be used to set care card variants.
359+
360+
```patch
361+
- <Card cardType="clickable">
362+
+ <Card clickable>
363+
```
364+
365+
```patch
366+
- <Card cardType="feature">
367+
+ <Card feature>
368+
```
369+
370+
```patch
371+
- <Card cardType="primary">
372+
+ <Card primary>
373+
```
374+
375+
```patch
376+
- <Card cardType="secondary">
377+
+ <Card secondary>
378+
```
379+
294380
### Character count
295381

296382
To align with NHS.UK frontend, the character count component automatically renders its own children (label, hint, error message etc) and associated ARIA attributes. We have removed `enum CharacterCountType` and you must make the following changes:
@@ -460,14 +546,12 @@ Before:
460546
After:
461547

462548
```jsx
463-
<Card cardType="feature">
464-
<Card.Content>
465-
<Card.Heading id="C">C</Card.Heading>
466-
<ul className="nhsuk-list nhsuk-list--border">
467-
<li><a href="/conditions/chest-pain/">Chest pain</a></li>
468-
<li><a href="/conditions/cold-sores/">Cold sore</a></li>
469-
</ul>
470-
</Card.Content>
549+
<Card feature>
550+
<Card.Heading id="C">C</Card.Heading>
551+
<ul className="nhsuk-list nhsuk-list--border">
552+
<li><a href="/conditions/chest-pain/">Chest pain</a></li>
553+
<li><a href="/conditions/cold-sores/">Cold sore</a></li>
554+
</ul>
471555
</Card>
472556

473557
<div className="nhsuk-back-to-top">
@@ -622,6 +706,14 @@ To align with NHS.UK frontend, you must make the following changes:
622706
</Table>
623707
```
624708

709+
If you are using the `Table.Panel` child component, you must migrate to the feature card:
710+
711+
```patch
712+
- <Table.Panel heading="Other conditions like impetigo">
713+
+ <Card feature>
714+
+ <Card.Heading>Other conditions like impetigo</Card.Heading>
715+
```
716+
625717
### Textarea
626718

627719
You must rename the `Textarea` prop `textareaRef` to `ref` for consistency with other components:

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nhsuk-react-components",
3-
"version": "6.0.0-beta.4",
3+
"version": "6.0.0-beta.5",
44
"license": "MIT",
55
"author": {
66
"name": "NHS England"
@@ -97,7 +97,7 @@
9797
"jest": "^30.2.0",
9898
"jest-axe": "^10.0.0",
9999
"jest-environment-jsdom": "^30.2.0",
100-
"nhsuk-frontend": "^10.2.2",
100+
"nhsuk-frontend": "^10.3.1",
101101
"outdent": "^0.8.0",
102102
"prettier": "^3.8.0",
103103
"react": "^19.2.3",
@@ -114,7 +114,7 @@
114114
},
115115
"peerDependencies": {
116116
"classnames": ">=2.5.0",
117-
"nhsuk-frontend": ">=10.2.0 <11.0.0",
117+
"nhsuk-frontend": ">=10.3.0 <11.0.0",
118118
"react": ">=18.2.0",
119119
"react-dom": ">=18.2.0",
120120
"tslib": ">=2.8.0"

0 commit comments

Comments
 (0)