Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e2828fd
Update FormTypes.ts
Peter-Hudson-G Oct 21, 2025
ed2dba7
review update
Peter-Hudson-G Oct 21, 2025
774b231
Update src/components/form-elements/error-message/ErrorMessage.tsx
Peter-Hudson-G Oct 21, 2025
9f583f5
Update stories/Form Elements/Fieldset.stories.tsx
Peter-Hudson-G Oct 21, 2025
31c3e48
review update
Peter-Hudson-G Oct 21, 2025
e7d58ae
Update stories/Form Elements/Fieldset.stories.tsx
Peter-Hudson-G Oct 21, 2025
d1766e6
Update stories/Form Elements/ErrorMessage.stories.tsx
Peter-Hudson-G Oct 21, 2025
205fd30
review update
Peter-Hudson-G Oct 21, 2025
d5e2eac
Lint
Peter-Hudson-G Oct 21, 2025
653089a
review change
Peter-Hudson-G Oct 21, 2025
590ea66
lint
Peter-Hudson-G Oct 21, 2025
c413343
bumping
Peter-Hudson-G Oct 21, 2025
cbb8830
snapshot
Peter-Hudson-G Oct 21, 2025
50c45c6
review updates
Peter-Hudson-G Oct 28, 2025
9a8bb7b
Merge branch 'main' into patch-1
Peter-Hudson-G Oct 29, 2025
9f889c1
failed conflict fix (I do not think I will use GitHub in the future t…
Peter-Hudson-G Oct 30, 2025
9bc670d
Merge branch 'main' into patch-1
colinrotherham Nov 3, 2025
c2abbcf
Remove HTML examples
colinrotherham Nov 4, 2025
5f8d8e7
Prefer `string | ReactElement` to avoid null, boolean etc
colinrotherham Nov 4, 2025
4454d07
Add simple snapshot tests for new types
colinrotherham Nov 4, 2025
71e9f13
Add examples with captions
colinrotherham Nov 4, 2025
787b8f6
Make sure `headingLevel` automatically assumes `isPageHeading`
colinrotherham Nov 5, 2025
74be0d4
Prepare beta release
colinrotherham Nov 5, 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# NHS.UK React components

## 6.0.0-beta.4 - 5 November 2025

This version provides support for NHS.UK frontend v10.1 and includes:

- Support for HTML in legend, label and error props
- Default legend and label to `isPageHeading: true` when `headingLevel` is set

For a full list of changes in this release please refer to the [migration doc](https://github.com/NHSDigital/nhsuk-react-components/blob/main/docs/upgrade-to-6.0.md).

## 6.0.0-beta.3 - 27 October 2025

This version provides support for NHS.UK frontend v10.1 and includes:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nhsuk-react-components",
"version": "6.0.0-beta.3",
"version": "6.0.0-beta.4",
"license": "MIT",
"author": {
"name": "NHS England"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { renderClient, renderServer } from '#util/components';
describe('Checkboxes', () => {
it('matches snapshot', async () => {
const { container } = await renderClient(
<Checkboxes id="example" name="example">
<Checkboxes
legend="What types of waste do you transport regularly?"
legendProps={{ size: 'l' }}
hint="Select all that apply"
id="example"
name="example"
>
<Checkboxes.Item value="animal">Waste from animal carcasses</Checkboxes.Item>
<Checkboxes.Item value="mines">Waste from mines or quarries</Checkboxes.Item>
<Checkboxes.Item value="farm">Farm or agricultural waste</Checkboxes.Item>
Expand All @@ -20,7 +26,59 @@ describe('Checkboxes', () => {

it('matches snapshot with error message', async () => {
const { container } = await renderClient(
<Checkboxes id="example" name="example" error="Example error">
<Checkboxes
legend="What types of waste do you transport regularly?"
legendProps={{ size: 'l' }}
hint="Select all that apply"
error="Example error"
id="example"
name="example"
>
<Checkboxes.Item value="animal">Waste from animal carcasses</Checkboxes.Item>
<Checkboxes.Item value="mines">Waste from mines or quarries</Checkboxes.Item>
<Checkboxes.Item value="farm">Farm or agricultural waste</Checkboxes.Item>
</Checkboxes>,
{ moduleName: 'nhsuk-checkboxes' },
);

expect(container).toMatchSnapshot();
});

it('matches snapshot with HTML in props', async () => {
const { container } = await renderClient(
<Checkboxes
legend={
<>
<span className="nhsuk-caption-l">Example</span> Legend text
</>
}
legendProps={{
isPageHeading: true,
size: 'l',
}}
hint={
<>
Hint text <em>with HTML</em>
</>
}
error={
<>
Error text <em>with HTML</em>
</>
}
id="example"
name="example"
>
<Checkboxes.Item
value="animal"
hint={
<>
Item hint text <em>with HTML</em>
</>
}
>
Waste from animal carcasses
</Checkboxes.Item>
<Checkboxes.Item value="animal">Waste from animal carcasses</Checkboxes.Item>
<Checkboxes.Item value="mines">Waste from mines or quarries</Checkboxes.Item>
<Checkboxes.Item value="farm">Farm or agricultural waste</Checkboxes.Item>
Expand All @@ -33,7 +91,13 @@ describe('Checkboxes', () => {

it('matches snapshot with an exclusive checkbox', async () => {
const { container } = await renderClient(
<Checkboxes id="example" name="example">
<Checkboxes
legend="What types of waste do you transport regularly?"
legendProps={{ size: 'l' }}
hint="Select all that apply"
id="example"
name="example"
>
<Checkboxes.Item value="animal">Waste from animal carcasses</Checkboxes.Item>
<Checkboxes.Item value="mines">Waste from mines or quarries</Checkboxes.Item>
<Checkboxes.Item value="farm">Farm or agricultural waste</Checkboxes.Item>
Expand All @@ -50,7 +114,13 @@ describe('Checkboxes', () => {

it('matches snapshot (via server)', async () => {
const { container, element } = await renderServer(
<Checkboxes id="example" name="example">
<Checkboxes
legend="What types of waste do you transport regularly?"
legendProps={{ size: 'l' }}
hint="Select all that apply"
id="example"
name="example"
>
<Checkboxes.Item value="animal">Waste from animal carcasses</Checkboxes.Item>
<Checkboxes.Item value="mines">Waste from mines or quarries</Checkboxes.Item>
<Checkboxes.Item value="farm">Farm or agricultural waste</Checkboxes.Item>
Expand Down
Loading