From 3dfb26fe60cf80ea5fbb6b9a5606318f976443b0 Mon Sep 17 00:00:00 2001
From: Colin Rotherham
Date: Wed, 13 May 2026 17:47:26 +0100
Subject: [PATCH 1/8] Directly use pre-built CSS from NHS.UK frontend
---
.storybook/main.ts | 4 +++-
.storybook/preview-head.html | 1 +
.storybook/storybook.scss | 2 --
3 files changed, 4 insertions(+), 3 deletions(-)
create mode 100644 .storybook/preview-head.html
diff --git a/.storybook/main.ts b/.storybook/main.ts
index 5de8735aa..6f8dca60c 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -4,13 +4,15 @@ import { type InlineConfig, mergeConfig } from 'vite';
import tsConfigPaths from 'vite-tsconfig-paths';
const config: StorybookConfig = {
- stories: ['../stories/**/*.stories.@(ts|tsx)', '../stories/**/*.mdx'],
addons: ['@storybook/addon-links', '@storybook/addon-docs'],
framework: {
name: '@storybook/react-vite',
options: {},
},
+ staticDirs: ['../node_modules/nhsuk-frontend/dist/nhsuk'],
+ stories: ['../stories/**/*.stories.@(ts|tsx)', '../stories/**/*.mdx'],
+
typescript: {
reactDocgen: 'react-docgen-typescript',
},
diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html
new file mode 100644
index 000000000..5a85c1381
--- /dev/null
+++ b/.storybook/preview-head.html
@@ -0,0 +1 @@
+
diff --git a/.storybook/storybook.scss b/.storybook/storybook.scss
index ea4b70a2d..1cf1ac123 100644
--- a/.storybook/storybook.scss
+++ b/.storybook/storybook.scss
@@ -1,5 +1,3 @@
-@forward 'nhsuk-frontend/dist/nhsuk';
-
.tag-wrapper {
display: flex;
flex-direction: column;
From 48d75e6250455a4efdf9153be2ee2baf18368d5f Mon Sep 17 00:00:00 2001
From: Colin Rotherham
Date: Wed, 13 May 2026 17:49:03 +0100
Subject: [PATCH 2/8] Update checkbox stories to use `defaultChecked` (i.e. no
`onChange` handler)
---
stories/Form Elements/Checkboxes.stories.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/stories/Form Elements/Checkboxes.stories.tsx b/stories/Form Elements/Checkboxes.stories.tsx
index 9ae0533d8..3e424addf 100644
--- a/stories/Form Elements/Checkboxes.stories.tsx
+++ b/stories/Form Elements/Checkboxes.stories.tsx
@@ -104,7 +104,7 @@ export const WithValues: Story = {
Date: Wed, 13 May 2026 19:30:07 +0100
Subject: [PATCH 3/8] Update component error stories to avoid state
---
stories/Form Elements/Radios.stories.tsx | 26 +++++++---------------
stories/Form Elements/Textarea.stories.tsx | 15 +++----------
2 files changed, 11 insertions(+), 30 deletions(-)
diff --git a/stories/Form Elements/Radios.stories.tsx b/stories/Form Elements/Radios.stories.tsx
index f9f817322..d658380de 100644
--- a/stories/Form Elements/Radios.stories.tsx
+++ b/stories/Form Elements/Radios.stories.tsx
@@ -1,9 +1,7 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { useState } from 'react';
import { Checkboxes } from '#components/form-elements/checkboxes/index.js';
import { Radios } from '#components/form-elements/radios/index.js';
-import { TextInput } from '#components/form-elements/text-input/index.js';
const meta: Meta = {
title: 'Form Elements/Radios',
@@ -205,23 +203,15 @@ export const DisabledRadios: Story = {
};
export const RadiosWithError: Story = {
+ name: 'Radios with error message',
args: {
+ error: 'Select yes if you have changed your name',
idPrefix: 'error',
},
- render: function RadiosWithErrorRender(args) {
- const [error, setError] = useState('Select yes if you have changed your name');
- return (
- <>
-
- Yes
-
- No
-
-
- setError(e.currentTarget.value)} />
- >
- );
- },
-
- name: 'Radios With Error (String)',
+ render: (args) => (
+
+ Yes
+ No
+
+ ),
};
diff --git a/stories/Form Elements/Textarea.stories.tsx b/stories/Form Elements/Textarea.stories.tsx
index d038be2f4..cbe970e36 100644
--- a/stories/Form Elements/Textarea.stories.tsx
+++ b/stories/Form Elements/Textarea.stories.tsx
@@ -1,7 +1,5 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { useState } from 'react';
-import { TextInput } from '#components/form-elements/text-input/index.js';
import { Textarea } from '#components/form-elements/textarea/index.js';
const meta: Meta = {
@@ -28,15 +26,8 @@ export const TextareaWithAutoCompleteAttribute: Story = {
};
export const TextareaWithError: Story = {
- render: function TextareaWithErrorRender(args) {
- const [error, setError] = useState('You must provide an explanation');
- return (
- <>
-
- setError(e.currentTarget.value)} value={error} />
- >
- );
+ name: 'Textarea with error message',
+ args: {
+ error: 'You must provide an explanation',
},
-
- name: 'Textarea With Error (String)',
};
From f0fc50836e37e67740600b975662d25015c4f99b Mon Sep 17 00:00:00 2001
From: Colin Rotherham
Date: Wed, 13 May 2026 18:03:19 +0100
Subject: [PATCH 4/8] Update checkbox stories to use unique `name` attributes
---
stories/Form Elements/Checkboxes.stories.tsx | 25 ++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/stories/Form Elements/Checkboxes.stories.tsx b/stories/Form Elements/Checkboxes.stories.tsx
index 3e424addf..29d4fd097 100644
--- a/stories/Form Elements/Checkboxes.stories.tsx
+++ b/stories/Form Elements/Checkboxes.stories.tsx
@@ -39,6 +39,7 @@ export const Standard: Story = {
name: 'Checkboxes default',
args: {
hint: 'Select all options that are relevant to you',
+ name: 'default',
},
render: (args) => (
@@ -58,6 +59,7 @@ export const WithCaption: Story = {
How do you want to be contacted about this?
>
),
+ name: 'with-caption',
},
render: Standard.render,
};
@@ -67,6 +69,7 @@ export const WithHintText: Story = {
args: {
legend: 'What is your nationality?',
hint: 'If you have dual nationality, select all options that are relevant to you',
+ name: 'with-hint',
},
render: (args) => (
@@ -82,6 +85,7 @@ export const WithHintTextOnItems: Story = {
args: {
legend: 'What is your nationality?',
hint: 'If you have dual nationality, select all options that are relevant to you',
+ name: 'with-hint-on-items',
},
render: (args) => (
@@ -97,8 +101,8 @@ export const WithHintTextOnItems: Story = {
export const WithValues: Story = {
name: 'Checkboxes with pre-checked values',
args: {
- name: 'exampleConditional1',
error: 'Select how you want to be contacted',
+ name: 'with-values',
},
render: (args) => (
@@ -152,6 +156,7 @@ export const Small: Story = {
args: {
...Standard.args,
legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small',
small: true,
},
render: Standard.render,
@@ -162,6 +167,7 @@ export const SmallWithHintText: Story = {
args: {
...WithHintText.args,
legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-hint',
small: true,
},
render: WithHintText.render,
@@ -172,6 +178,7 @@ export const SmallWithHintTextOnItems: Story = {
args: {
...WithHintTextOnItems.args,
legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-hint-on-items',
small: true,
},
render: WithHintTextOnItems.render,
@@ -179,6 +186,9 @@ export const SmallWithHintTextOnItems: Story = {
export const WithDisabledItem: Story = {
name: 'Checkboxes with disabled item',
+ args: {
+ name: 'with-disabled-item',
+ },
render: (args) => (
Red
@@ -194,6 +204,7 @@ export const WithError: Story = {
name: 'Checkboxes with error message',
args: {
error: 'Select how you want to be contacted',
+ name: 'with-error',
},
render: Standard.render,
};
@@ -203,6 +214,7 @@ export const WithHintAndError: Story = {
args: {
hint: 'Select all options that are relevant to you',
error: 'Select how you want to be contacted',
+ name: 'with-hint-and-error',
},
render: Standard.render,
};
@@ -210,8 +222,8 @@ export const WithHintAndError: Story = {
export const WithConditionalContent: Story = {
name: 'Checkboxes with conditional content',
args: {
- name: 'exampleConditional2',
hint: 'Select all options that are relevant to you',
+ name: 'with-conditional-content',
},
render: (args) => (
@@ -263,6 +275,7 @@ export const WithConditionalContentError: Story = {
args: {
hint: 'Select all options that are relevant to you',
error: 'Select how you like to be contacted',
+ name: 'with-conditional-content-error',
},
render: WithConditionalContent.render,
};
@@ -270,8 +283,8 @@ export const WithConditionalContentError: Story = {
export const WithConditionalContentErrorNested: Story = {
name: 'Checkboxes with conditional content, error message (nested)',
args: {
- name: 'exampleConditional3',
hint: 'Select all options that are relevant to you',
+ name: 'with-conditional-content-error-nested',
},
render: (args) => (
@@ -325,6 +338,7 @@ export const WithExclusiveNoneOption: Story = {
args: {
legend: 'How do you want to be contacted about this?',
hint: 'Select all options that are relevant to you',
+ name: 'with-exclusive-none-option',
},
render: (args) => (
@@ -342,9 +356,9 @@ export const WithExclusiveNoneOption: Story = {
export const WithExclusiveNoneOptionConditional: Story = {
name: 'Checkboxes with "none of the above" option, conditional content',
args: {
- name: 'exampleConditional4',
legend: 'How do you want to be contacted about this?',
hint: 'Select all options that are relevant to you',
+ name: 'with-exclusive-none-option-conditional',
},
render: (args) => (
@@ -397,6 +411,9 @@ export const WithExclusiveNoneOptionConditional: Story = {
export const WithExclusiveNoneOptionNamed: Story = {
name: 'Checkboxes with "none of the above" option (named groups)',
+ args: {
+ name: 'with-exclusive-none-option-named',
+ },
render: (args) => (
From a3b3494416831f93d9a6fefeae3f28d7f8b519ee Mon Sep 17 00:00:00 2001
From: Colin Rotherham
Date: Wed, 13 May 2026 18:54:40 +0100
Subject: [PATCH 5/8] Update radio stories to use unique `name` attributes
---
stories/Form Elements/Radios.stories.tsx | 25 +++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/stories/Form Elements/Radios.stories.tsx b/stories/Form Elements/Radios.stories.tsx
index d658380de..07b475fd4 100644
--- a/stories/Form Elements/Radios.stories.tsx
+++ b/stories/Form Elements/Radios.stories.tsx
@@ -10,6 +10,7 @@ const meta: Meta = {
legend: 'Have you changed your name?',
legendProps: { isPageHeading: true, size: 'l' },
hint: 'This includes changing your last name or spelling your name differently',
+ name: 'example',
},
};
export default meta;
@@ -17,7 +18,7 @@ type Story = StoryObj;
export const StandardRadios: Story = {
args: {
- idPrefix: 'standard',
+ name: 'standard',
},
render: (args) => (
@@ -31,7 +32,7 @@ export const StandardRadios: Story = {
export const InlineRadios: Story = {
args: {
- idPrefix: 'inline',
+ name: 'inline',
inline: true,
},
render: (args) => (
@@ -51,6 +52,7 @@ export const RadiosWithCaption: Story = {
About you Have you changed your name?
>
),
+ name: 'with-caption',
},
render: (args) => (
@@ -66,7 +68,7 @@ export const RadiosWithConditionalContent: Story = {
args: {
legend: 'Impairment requirement',
hint: 'Select relevant options',
- idPrefix: 'conditional',
+ name: 'conditional',
},
render: (args) => {
const impairmentsForm = (
@@ -101,7 +103,7 @@ export const RadiosWithADivider: Story = {
args: {
legend: 'How do you want to sign in?',
hint: undefined,
- idPrefix: 'divider',
+ name: 'divider',
},
render: (args) => (
@@ -117,7 +119,7 @@ export const RadiosWithHintsOnItems: Story = {
args: {
legend: 'How do you want to sign in?',
hint: undefined,
- idPrefix: 'hints',
+ name: 'hints',
},
render: (args) => (
@@ -141,7 +143,7 @@ export const SmallRadios: Story = {
args: {
...StandardRadios.args,
legendProps: { isPageHeading: true, size: 'm' },
- idPrefix: 'small',
+ name: 'small',
small: true,
},
render: StandardRadios.render,
@@ -151,6 +153,7 @@ export const SmallInlineRadios: Story = {
args: {
...InlineRadios.args,
legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-inline',
small: true,
},
render: InlineRadios.render,
@@ -160,7 +163,7 @@ export const SmallRadiosWithConditionalContent: Story = {
args: {
...RadiosWithConditionalContent.args,
legendProps: { isPageHeading: true, size: 'm' },
- idPrefix: 'small-conditional',
+ name: 'small-conditional',
small: true,
},
render: RadiosWithConditionalContent.render,
@@ -170,7 +173,7 @@ export const SmallRadiosWithADivider: Story = {
args: {
...RadiosWithADivider.args,
legendProps: { isPageHeading: true, size: 'm' },
- idPrefix: 'small-divider',
+ name: 'small-divider',
small: true,
},
render: RadiosWithADivider.render,
@@ -180,7 +183,7 @@ export const SmallRadiosWithHintsOnItems: Story = {
args: {
...RadiosWithHintsOnItems.args,
legendProps: { isPageHeading: true, size: 'm' },
- idPrefix: 'small-hints',
+ name: 'small-hints',
small: true,
},
render: RadiosWithHintsOnItems.render,
@@ -188,7 +191,7 @@ export const SmallRadiosWithHintsOnItems: Story = {
export const DisabledRadios: Story = {
args: {
- idPrefix: 'disabled',
+ name: 'disabled',
},
render: (args) => (
@@ -206,7 +209,7 @@ export const RadiosWithError: Story = {
name: 'Radios with error message',
args: {
error: 'Select yes if you have changed your name',
- idPrefix: 'error',
+ name: 'error',
},
render: (args) => (
From 3356d99f93a8c34e48bcd60743aa215cdf9473c6 Mon Sep 17 00:00:00 2001
From: Colin Rotherham
Date: Thu, 14 May 2026 10:22:49 +0100
Subject: [PATCH 6/8] Fix README example
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d80ff5f2a..1bb9cac1b 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ yarn add nhsuk-react-components
## Usage
```jsx
-import { DateInput, Form } from 'nhsuk-react-components';
+import { Button, DateInput, Form } from 'nhsuk-react-components';
),
-
- name: 'WarningCallout',
};
-export const WarningCalloutWithCustomHeading: Story = {
+export const WithCustomHeading: Story = {
+ name: 'Warning callout with custom heading',
render: (args) => (
School, nursery or work
@@ -35,7 +36,8 @@ export const WarningCalloutWithCustomHeading: Story = {
),
};
-export const WarningCalloutWithCustomHeadingLevel: Story = {
+export const WithCustomHeadingLevel: Story = {
+ name: 'Warning callout with custom heading level',
render: (args) => (
School, nursery or work
diff --git a/stories/Form Elements/Button.stories.tsx b/stories/Form Elements/Button.stories.tsx
index e8c83082f..e14d95fd1 100644
--- a/stories/Form Elements/Button.stories.tsx
+++ b/stories/Form Elements/Button.stories.tsx
@@ -48,13 +48,15 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Primary: Story = {
+export const Default: Story = {
+ name: 'Button default',
args: {
children: 'Save and continue',
},
};
-export const SmallPrimary: Story = {
+export const SmallDefault: Story = {
+ name: 'Button default, small',
args: {
small: true,
children: 'Save and continue',
@@ -62,6 +64,7 @@ export const SmallPrimary: Story = {
};
export const Secondary: Story = {
+ name: 'Button secondary',
args: {
secondary: true,
children: 'Find my location',
@@ -69,6 +72,7 @@ export const Secondary: Story = {
};
export const SmallSecondary: Story = {
+ name: 'Button secondary, small',
args: {
secondary: true,
small: true,
@@ -77,6 +81,7 @@ export const SmallSecondary: Story = {
};
export const Warning: Story = {
+ name: 'Button warning',
args: {
warning: true,
children: 'Yes, delete this vaccine',
@@ -84,6 +89,7 @@ export const Warning: Story = {
};
export const SmallWarning: Story = {
+ name: 'Button warning, small',
args: {
warning: true,
small: true,
@@ -92,6 +98,7 @@ export const SmallWarning: Story = {
};
export const Login: Story = {
+ name: 'Button login',
args: {
login: true,
children: 'Continue to NHS login',
@@ -99,6 +106,7 @@ export const Login: Story = {
};
export const SmallLogin: Story = {
+ name: 'Button login, small',
args: {
login: true,
small: true,
@@ -107,47 +115,83 @@ export const SmallLogin: Story = {
};
export const Reverse: Story = {
+ name: 'Button reverse',
args: {
reverse: true,
children: 'Log out',
},
+ globals: {
+ backgrounds: { value: 'dark' },
+ },
};
export const SmallReverse: Story = {
+ name: 'Button reverse, small',
args: {
reverse: true,
small: true,
children: 'Log out',
},
+ globals: {
+ backgrounds: { value: 'dark' },
+ },
};
/**
- *
* Disabled buttons have poor contrast and can confuse some users. Only use them if user research shows it makes things easier for users to understand.
- *
*/
+export const Disabled: Story = {
+ name: 'Button disabled',
+ args: {
+ disabled: true,
+ children: 'Disabled button',
+ },
+};
+
+export const SmallDisabled: Story = {
+ name: 'Button disabled, small',
+ args: {
+ small: true,
+ disabled: true,
+ children: 'Disabled button',
+ },
+};
-export const Disabled: Story = { args: { disabled: true, children: 'Disabled' } };
-export const LinkButton: Story = { args: { href: '/', children: 'As a Link' } };
-export const ForceButton: Story = { args: { as: 'button', children: 'As a Button' } };
-export const ForceAnchor: Story = { args: { as: 'a', children: 'As an Anchor' } };
+export const AsALink: Story = {
+ name: 'Button as a link',
+ args: {
+ href: '/',
+ children: 'Link button',
+ },
+};
+
+export const SmallAsALink: Story = {
+ name: 'Button as a link, small',
+ args: {
+ href: '/',
+ small: true,
+ children: 'Link button',
+ },
+};
/**
* You can test this button by opening the browser console. It will log the current dateTime once per debounce.
*/
export const PreventDoubleClickButton: Story = {
+ name: 'Button with double click prevented',
args: {
preventDoubleClick: true,
onClick: () => console.log(new Date()),
- children: 'Debounced Button',
+ children: 'Save and continue',
},
};
export const PreventDoubleClickLinkButton: Story = {
+ name: 'Button as a link with double click prevented',
args: {
- preventDoubleClick: true,
href: '#',
+ preventDoubleClick: true,
onClick: () => console.log(new Date()),
- children: 'Debounced Button as Link',
+ children: 'Save and continue',
},
};
diff --git a/stories/Form Elements/CharacterCount.stories.tsx b/stories/Form Elements/CharacterCount.stories.tsx
index 75ec204ab..9406ec284 100644
--- a/stories/Form Elements/CharacterCount.stories.tsx
+++ b/stories/Form Elements/CharacterCount.stories.tsx
@@ -11,7 +11,7 @@ import { CharacterCount } from '#components/form-elements/character-count/index.
*/
const meta: Meta = {
- title: 'Form Elements/CharacterCount',
+ title: 'Form Elements/Character count',
component: CharacterCount,
args: {
label: 'Can you provide more detail?',
@@ -25,7 +25,8 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Character count default',
args: {
maxLength: 200,
},
@@ -35,6 +36,7 @@ export const Standard: Story = {
* Sometimes, rather than counting the number of characters, it is useful to count the number of words instead.
*/
export const WordCountLimit: Story = {
+ name: 'Character count wth maxwords',
args: {
maxWords: 150,
},
@@ -46,6 +48,7 @@ export const WordCountLimit: Story = {
* Use the `threshold` prop to only show the count message when users have reached that percentage of the limit.
*/
export const MessageThreshold: Story = {
+ name: 'Character count wth threshold',
args: {
maxLength: 112,
threshold: 75,
@@ -53,6 +56,7 @@ export const MessageThreshold: Story = {
};
export const WithTranslations: Story = {
+ name: 'Character count wth translations',
args: {
label: 'Allwch chi roi mwy o fanylion?',
hint: 'Peidiwch â chynnwys gwybodaeth bersonol, fel eich enw, dyddiad geni na rhif y GIG',
diff --git a/stories/Form Elements/Checkboxes.stories.tsx b/stories/Form Elements/Checkboxes.stories.tsx
index 29d4fd097..bd03e0d3c 100644
--- a/stories/Form Elements/Checkboxes.stories.tsx
+++ b/stories/Form Elements/Checkboxes.stories.tsx
@@ -3,10 +3,11 @@ import { type ChangeEvent, type InputEvent, useEffect, useRef, useState } from '
import { Checkboxes } from '#components/form-elements/checkboxes/index.js';
import { Fieldset } from '#components/form-elements/fieldset/Fieldset.js';
-import { TextInput } from '#components/form-elements/text-input/index.js';
import { BodyText } from '#components/typography/BodyText.js';
import { Heading } from '#components/typography/Heading.js';
+import { ExampleEmail, ExampleMobilePhoneNumber, ExamplePhoneNumber } from './TextInput.stories.js';
+
/**
* This component can be found in the `nhsuk-frontend` repository here .
*
@@ -26,6 +27,7 @@ const meta: Meta = {
name: 'example',
},
};
+
export default meta;
type Story = StoryObj;
@@ -35,7 +37,7 @@ interface CheckboxState {
box3: { name?: string; id?: string };
}
-export const Standard: Story = {
+export const Default: Story = {
name: 'Checkboxes default',
args: {
hint: 'Select all options that are relevant to you',
@@ -50,6 +52,17 @@ export const Standard: Story = {
),
};
+export const Small: Story = {
+ name: 'Checkboxes small',
+ args: {
+ ...Default.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small',
+ small: true,
+ },
+ render: Default.render,
+};
+
export const WithCaption: Story = {
name: 'Checkboxes with caption',
args: {
@@ -61,10 +74,27 @@ export const WithCaption: Story = {
),
name: 'with-caption',
},
- render: Standard.render,
+ render: Default.render,
+};
+
+export const SmallWithCaption: Story = {
+ name: 'Checkboxes with caption, small',
+ args: {
+ ...WithCaption.args,
+ legend: (
+ <>
+ About you How do you want to be contacted about
+ this?
+ >
+ ),
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-caption',
+ small: true,
+ },
+ render: WithCaption.render,
};
-export const WithHintText: Story = {
+export const WithHint: Story = {
name: 'Checkboxes with hint',
args: {
legend: 'What is your nationality?',
@@ -80,7 +110,18 @@ export const WithHintText: Story = {
),
};
-export const WithHintTextOnItems: Story = {
+export const SmallWithHint: Story = {
+ name: 'Checkboxes with hint, small',
+ args: {
+ ...WithHint.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-hint',
+ small: true,
+ },
+ render: WithHint.render,
+};
+
+export const WithHintOnItems: Story = {
name: 'Checkboxes with hints on items',
args: {
legend: 'What is your nationality?',
@@ -98,90 +139,56 @@ export const WithHintTextOnItems: Story = {
),
};
-export const WithValues: Story = {
- name: 'Checkboxes with pre-checked values',
+export const SmallWithHintOnItems: Story = {
+ name: 'Checkboxes with hints on items, small',
+ args: {
+ ...WithHintOnItems.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-hint-on-items',
+ small: true,
+ },
+ render: WithHintOnItems.render,
+};
+
+export const WithError: Story = {
+ name: 'Checkboxes with error message',
args: {
error: 'Select how you want to be contacted',
- name: 'with-values',
+ name: 'with-error',
},
- render: (args) => (
-
-
- }
- >
- Email
-
-
- }
- >
- Phone
-
-
- }
- >
- Text message
-
-
- ),
+ render: Default.render,
};
-export const Small: Story = {
- name: 'Checkboxes small',
+export const SmallWithError: Story = {
+ name: 'Checkboxes with error message, small',
args: {
- ...Standard.args,
+ ...WithError.args,
legendProps: { isPageHeading: true, size: 'm' },
- name: 'small',
+ name: 'small-with-error',
small: true,
},
- render: Standard.render,
+ render: WithError.render,
};
-export const SmallWithHintText: Story = {
- name: 'Checkboxes small with hint',
+export const WithHintAndError: Story = {
+ name: 'Checkboxes with error message and hint',
args: {
- ...WithHintText.args,
- legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-with-hint',
- small: true,
+ hint: 'Select all options that are relevant to you',
+ error: 'Select how you want to be contacted',
+ name: 'with-hint-and-error',
},
- render: WithHintText.render,
+ render: Default.render,
};
-export const SmallWithHintTextOnItems: Story = {
- name: 'Checkboxes small with hints on items',
+export const SmallWithHintAndError: Story = {
+ name: 'Checkboxes with error message and hint, small',
args: {
- ...WithHintTextOnItems.args,
+ ...WithHintAndError.args,
legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-with-hint-on-items',
+ name: 'small-with-hint-and-error',
small: true,
},
- render: WithHintTextOnItems.render,
+ render: WithHintAndError.render,
};
export const WithDisabledItem: Story = {
@@ -200,23 +207,33 @@ export const WithDisabledItem: Story = {
),
};
-export const WithError: Story = {
- name: 'Checkboxes with error message',
+export const SmallWithDisabledItem: Story = {
+ name: 'Checkboxes with disabled item, small',
args: {
- error: 'Select how you want to be contacted',
- name: 'with-error',
+ ...WithDisabledItem.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-disabled-item',
+ small: true,
},
- render: Standard.render,
+ render: WithDisabledItem.render,
};
-export const WithHintAndError: Story = {
- name: 'Checkboxes with hint and error',
+export const WithValues: Story = {
+ name: 'Checkboxes with pre-checked values',
args: {
- hint: 'Select all options that are relevant to you',
- error: 'Select how you want to be contacted',
- name: 'with-hint-and-error',
+ name: 'with-values',
},
- render: Standard.render,
+ render: (args) => (
+
+
+ Email
+
+ Phone
+
+ Text message
+
+
+ ),
};
export const WithConditionalContent: Story = {
@@ -227,43 +244,33 @@ export const WithConditionalContent: Story = {
},
render: (args) => (
-
- }
- >
+ }>
Email
-
- }
- >
+ }>
Phone
-
- }
- >
+ }>
+ Text message
+
+
+ ),
+};
+
+export const WithConditionalContentValues: Story = {
+ name: 'Checkboxes with conditional content and pre-checked values',
+ args: {
+ name: 'with-conditional-content-values',
+ },
+ render: (args) => (
+
+ } defaultChecked>
+ Email
+
+ }>
+ Phone
+
+ } defaultChecked>
Text message
@@ -288,45 +295,17 @@ export const WithConditionalContentErrorNested: Story = {
},
render: (args) => (
-
- }
- >
+ }>
Email
}
defaultChecked
- conditional={
-
- }
>
Phone
-
- }
- >
+ }>
Text message
@@ -362,43 +341,13 @@ export const WithExclusiveNoneOptionConditional: Story = {
},
render: (args) => (
-
- }
- >
+ }>
Email
-
- }
- >
+ }>
Phone
-
- }
- >
+ }>
Text message
diff --git a/stories/Form Elements/DateInput.stories.tsx b/stories/Form Elements/DateInput.stories.tsx
index 89b24a86e..d60345c0e 100644
--- a/stories/Form Elements/DateInput.stories.tsx
+++ b/stories/Form Elements/DateInput.stories.tsx
@@ -4,76 +4,97 @@ import { useState } from 'react';
import { DateInput, type DateInputValue } from '#components/form-elements/date-input/index.js';
const meta: Meta = {
- title: 'Form Elements/DateInput',
+ title: 'Form Elements/Date input',
component: DateInput,
args: {
legend: 'What is your date of birth?',
legendProps: { isPageHeading: true, size: 'l' },
- hint: 'For example, 15 3 1984',
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Date input default',
+ args: {
+ hint: 'For example, 15 3 1984',
+ },
+ render: (args) => ,
+};
+
+export const WithError: Story = {
+ name: 'Date input with error message only',
+ args: {
+ error: 'Enter your date of birth',
+ },
+ render: (args) => ,
+};
+
+export const WithErrorDay: Story = {
+ name: 'Date input with error on day input',
+ args: {
+ error: 'Date of birth must include a day',
+ },
render: (args) => (
- <>
- Scenario: onChange and onInput handlers are bound without any other props
- Expected Behaviour
-
- OnChange Handlers are fired using the generated IDs and Names
- The value is passed through
-
- Component
- console.log(e.target.value)} {...args} />
- >
+
+
+
+
+
+ ),
+};
+
+export const WithErrorMonth: Story = {
+ name: 'Date input with error on month input',
+ args: {
+ error: 'Date of birth must include a month',
+ },
+ render: (args) => (
+
+
+
+
+
),
};
-export const StandardWithError: Story = {
+export const WithErrorYear: Story = {
+ name: 'Date input with error on year input',
+ args: {
+ error: 'Date of birth must include a year',
+ },
render: (args) => (
- <>
- Scenario: onChange and onInput handlers are bound without any other props
- Expected Behaviour
-
- OnChange Handlers are fired using the generated IDs and Names
- The value is passed through
-
- Component
- console.log(e.target.value)}
- {...args}
- />
-
- Component with specific field errors
- console.log(e.target.value)}
- {...args}
- >
-
-
-
-
- >
+
+
+
+
+
),
};
-export const PrePopulatedIndividualComponents: Story = {
- render: (args) => {
- const defaultValue = { day: '20', month: '09', year: '1996' };
- return (
-
-
-
-
-
- );
+export const WithErrorAndHint: Story = {
+ name: 'Date input with error message and hint',
+ args: {
+ hint: 'For example, 15 3 1984',
+ error: 'Enter your date of birth',
+ },
+ render: (args) => ,
+};
+
+export const WithValue: Story = {
+ name: 'Date input with value',
+ args: {
+ defaultValue: {
+ day: '20',
+ month: '09',
+ year: '1996',
+ },
},
};
-export const PrePopulatedWrapper: Story = {
+export const WithValues: Story = {
+ name: 'Date input with values',
args: {
defaultValue: {
day: '20',
@@ -81,12 +102,38 @@ export const PrePopulatedWrapper: Story = {
year: '1996',
},
},
- render: (args) => {
- return ;
+ render: ({ defaultValue, ...args }) => (
+
+
+
+
+
+ ),
+};
+
+export const WithValueControlled: Story = {
+ name: 'Date input with value, controlled',
+ parameters: {
+ chromatic: {
+ disableSnapshot: true,
+ },
+ },
+ args: {
+ value: {
+ day: '20',
+ month: '09',
+ year: '1996',
+ },
},
};
-export const ControlledElementIndividualComponents: Story = {
+export const WithValuesControlled: Story = {
+ name: 'Date input with values, controlled',
+ parameters: {
+ chromatic: {
+ disableSnapshot: true,
+ },
+ },
args: {
value: {
day: '20',
@@ -105,21 +152,14 @@ export const ControlledElementIndividualComponents: Story = {
},
};
-export const ControlledElementWrapper: Story = {
- args: {
- value: {
- day: '20',
- month: '09',
- year: '1996',
+export const WithValueStateControlled: Story = {
+ name: 'Date input with value state, controlled',
+ parameters: {
+ chromatic: {
+ disableSnapshot: true,
},
},
- render: (args) => {
- return ;
- },
-};
-
-export const ChangeableControlledElement: Story = {
- render: function ChangeableControlledElementRender(args) {
+ render: function WithValueStateControlledRender(args) {
const [value, setValue] = useState | undefined>({
day: '20',
month: '09',
@@ -129,3 +169,24 @@ export const ChangeableControlledElement: Story = {
return setValue(e.currentTarget.value)} {...args} />;
},
};
+
+export const OnChangeHandler: Story = {
+ name: 'Date input change handler',
+ parameters: {
+ chromatic: {
+ disableSnapshot: true,
+ },
+ },
+ render: (args) => (
+ <>
+
+ Change handler is fired using the generated IDs and names
+ The value is passed through
+
+
+
+
+ console.log(e.target.value)} {...args} />
+ >
+ ),
+};
diff --git a/stories/Form Elements/ErrorMessage.stories.tsx b/stories/Form Elements/ErrorMessage.stories.tsx
index a8247d87f..00d2e30e1 100644
--- a/stories/Form Elements/ErrorMessage.stories.tsx
+++ b/stories/Form Elements/ErrorMessage.stories.tsx
@@ -6,7 +6,7 @@ import { ErrorMessage } from '#components/form-elements/error-message/index.js';
* This component can be found in the `nhsuk-frontend` repository here .
*/
const meta: Meta = {
- title: 'Form Elements/ErrorMessage',
+ title: 'Form Elements/Error message',
component: ErrorMessage,
args: {
children: 'Enter your full name',
@@ -20,17 +20,22 @@ const meta: Meta = {
},
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
+export const Default: Story = {
+ name: 'Error message default',
+};
export const CustomVisuallyHiddenText: Story = {
+ name: 'Error message with custom visually hidden text',
args: { visuallyHiddenText: 'Custom' },
argTypes: { visuallyHiddenText: { control: false } },
};
export const EmptyVisuallyHiddenText: Story = {
+ name: 'Error message with empty visually hidden text',
args: { visuallyHiddenText: '' },
argTypes: { visuallyHiddenText: { control: false } },
};
diff --git a/stories/Form Elements/ErrorSummary.stories.tsx b/stories/Form Elements/ErrorSummary.stories.tsx
index f8032784a..bd1a15496 100644
--- a/stories/Form Elements/ErrorSummary.stories.tsx
+++ b/stories/Form Elements/ErrorSummary.stories.tsx
@@ -14,49 +14,73 @@ import { ErrorSummary } from '#components/form-elements/error-summary/index.js';
* - `ErrorSummary.ListItem`
*/
const meta: Meta = {
- title: 'Form Elements/ErrorSummary',
+ title: 'Form Elements/Error summary',
component: ErrorSummary,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Error summary default',
render: (args) => (
There is a problem
+ Describe the errors and how to correct them
- Enter your full name
+
+ Date of birth must be in the past
+
),
};
-export const WithDescription: Story = {
+export const WithMultipleErrors: Story = {
+ name: 'Error summary with multiple errors',
render: (args) => (
There is a problem
- Describe the errors and how to correct them
-
- Date of birth must be in the past
+
+ Enter your first name
+
+
+ Enter your last name
),
};
-export const WithAutoFocusDisabled: Story = {
- args: {
- disableAutoFocus: true,
- },
+export const WithoutDescription: Story = {
+ name: 'Error summary without description',
render: (args) => (
There is a problem
-
+
Date of birth must be in the past
),
};
+
+export const WithoutErrorList: Story = {
+ name: 'Error summary without error list',
+ render: (args) => (
+
+ There is a problem
+ Describe the errors and how to correct them
+
+ ),
+};
+
+export const WithAutoFocusDisabled: Story = {
+ name: 'Error summary with auto-focus disabled',
+ args: {
+ disableAutoFocus: true,
+ },
+ render: Default.render,
+};
diff --git a/stories/Form Elements/Fieldset.stories.tsx b/stories/Form Elements/Fieldset.stories.tsx
index e6376c8ff..fe6a86450 100644
--- a/stories/Form Elements/Fieldset.stories.tsx
+++ b/stories/Form Elements/Fieldset.stories.tsx
@@ -10,10 +10,12 @@ const meta: Meta = {
title: 'Form Elements/Fieldset',
component: Fieldset,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Fieldset default',
render: (args) => (
@@ -50,7 +52,7 @@ export const Standard: Story = {
};
export const WithCustomLegendSizeS: Story = {
- name: 'With Bold Text (S)',
+ name: 'Fieldset with size S legend',
render: (args) => (
@@ -61,7 +63,7 @@ export const WithCustomLegendSizeS: Story = {
};
export const WithCustomLegendSizeM: Story = {
- name: 'With Custom Size (M)',
+ name: 'Fieldset with size M legend',
render: (args) => (
@@ -72,7 +74,7 @@ export const WithCustomLegendSizeM: Story = {
};
export const WithCustomLegendSizeL: Story = {
- name: 'With Custom Size (L)',
+ name: 'Fieldset with size L legend',
render: (args) => (
@@ -83,7 +85,7 @@ export const WithCustomLegendSizeL: Story = {
};
export const WithCustomLegendSizeXL: Story = {
- name: 'With Custom Size (XL)',
+ name: 'Fieldset with size XL legend',
render: (args) => (
diff --git a/stories/Form Elements/FileUpload.stories.tsx b/stories/Form Elements/FileUpload.stories.tsx
index 6c685017a..1b6090c20 100644
--- a/stories/Form Elements/FileUpload.stories.tsx
+++ b/stories/Form Elements/FileUpload.stories.tsx
@@ -3,7 +3,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { FileUpload } from '#components/form-elements/file-upload/index.js';
const meta: Meta = {
- title: 'Form Elements/FileUpload',
+ title: 'Form Elements/File upload',
component: FileUpload,
args: {
id: 'input-example',
@@ -19,20 +19,26 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
-export const WithHintText: Story = {
+export const Default: Story = {
+ name: 'File upload default',
+};
+
+export const WithHint: Story = {
+ name: 'File upload with hint',
args: {
hint: 'Your photo may be in your Pictures, Photos, Downloads or Desktop folder',
},
};
export const WithError: Story = {
+ name: 'File upload with error message',
args: {
error: 'The selected file must be a JPG, BMP or TIF',
},
};
-export const WithErrorAndHintText: Story = {
+export const WithErrorAndHint: Story = {
+ name: 'File upload with error message and hint',
args: {
error: 'The selected file must be a JPG, BMP or TIF',
hint: 'Your photo may be in your Pictures, Photos, Downloads or Desktop folder',
@@ -40,24 +46,28 @@ export const WithErrorAndHintText: Story = {
};
export const WithSmallPrimaryButton: Story = {
+ name: 'File upload with small primary button',
args: {
chooseFilesButtonClassList: ['nhsuk-button--small'],
},
};
export const WithSecondaryButton: Story = {
+ name: 'File upload with secondary button',
args: {
chooseFilesButtonClassList: ['nhsuk-button--secondary'],
},
};
export const WithSmallSecondaryButton: Story = {
+ name: 'File upload with small secondary button',
args: {
chooseFilesButtonClassList: ['nhsuk-button--small', 'nhsuk-button--secondary'],
},
};
export const WithMultiple: Story = {
+ name: 'File upload with multiple',
args: {
label: 'Upload multiple files',
multiple: true,
@@ -70,6 +80,7 @@ export const WithMultiple: Story = {
};
export const WithTranslations: Story = {
+ name: 'File upload with translations',
args: {
label: 'Upload multiple files',
multiple: true,
@@ -88,6 +99,7 @@ export const WithTranslations: Story = {
};
export const Disabled: Story = {
+ name: 'File upload disabled',
args: {
disabled: true,
},
diff --git a/stories/Form Elements/HintText.stories.tsx b/stories/Form Elements/HintText.stories.tsx
index dc8c5550a..304816014 100644
--- a/stories/Form Elements/HintText.stories.tsx
+++ b/stories/Form Elements/HintText.stories.tsx
@@ -3,13 +3,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { HintText } from '#components/form-elements/hint-text/index.js';
const meta: Meta = {
- title: 'Form Elements/HintText',
+ title: 'Form Elements/Hint text',
component: HintText,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
args: {
children: 'Do not include personal information like your name, date of birth or NHS number',
},
diff --git a/stories/Form Elements/Label.stories.tsx b/stories/Form Elements/Label.stories.tsx
index a15744f4b..e6762d596 100644
--- a/stories/Form Elements/Label.stories.tsx
+++ b/stories/Form Elements/Label.stories.tsx
@@ -14,38 +14,40 @@ const meta: Meta = {
size: { control: 'select', options: [undefined, 's', 'm', 'l', 'xl'] },
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Label default',
args: {
size: 'l',
},
};
export const WithCustomSizeS: Story = {
- name: 'With Bold Text (S)',
+ name: 'Label with size S text',
args: {
size: 's',
},
};
export const WithCustomSizeM: Story = {
- name: 'With Custom Size (M)',
+ name: 'Label with size M text',
args: {
size: 'm',
},
};
export const WithCustomSizeL: Story = {
- name: 'With Custom Size (L)',
+ name: 'Label with size L text',
args: {
size: 'l',
},
};
export const WithCustomSizeXL: Story = {
- name: 'With Custom Size (XL)',
+ name: 'Label with size XL text',
args: {
size: 'xl',
},
diff --git a/stories/Form Elements/PasswordInput.stories.tsx b/stories/Form Elements/PasswordInput.stories.tsx
index a652175a6..88a006603 100644
--- a/stories/Form Elements/PasswordInput.stories.tsx
+++ b/stories/Form Elements/PasswordInput.stories.tsx
@@ -3,7 +3,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { PasswordInput } from '#components/form-elements/password-input/index.js';
const meta: Meta = {
- title: 'Form Elements/PasswordInput',
+ title: 'Form Elements/Password input',
component: PasswordInput,
args: {
id: 'input-example',
@@ -19,20 +19,26 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
-export const WithHintText: Story = {
+export const Default: Story = {
+ name: 'Password input default',
+};
+
+export const WithHint: Story = {
+ name: 'Password input with hint',
args: {
hint: 'It probably has some letters, numbers and maybe even some symbols in it',
},
};
export const WithError: Story = {
+ name: 'Password input with error message',
args: {
error: 'Enter a password',
},
};
-export const WithErrorAndHintText: Story = {
+export const WithErrorAndHint: Story = {
+ name: 'Password input with error message and hint',
args: {
error: 'Enter a password',
hint: 'It probably has some letters, numbers and maybe even some symbols in it',
@@ -40,6 +46,7 @@ export const WithErrorAndHintText: Story = {
};
export const WithTranslations: Story = {
+ name: 'Password input with translations',
args: {
label: 'Cyfrinair',
i18n: {
diff --git a/stories/Form Elements/Radios.stories.tsx b/stories/Form Elements/Radios.stories.tsx
index 07b475fd4..949897640 100644
--- a/stories/Form Elements/Radios.stories.tsx
+++ b/stories/Form Elements/Radios.stories.tsx
@@ -1,55 +1,86 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { Checkboxes } from '#components/form-elements/checkboxes/index.js';
import { Radios } from '#components/form-elements/radios/index.js';
+import { ExampleEmail, ExampleMobilePhoneNumber, ExamplePhoneNumber } from './TextInput.stories.js';
+
const meta: Meta = {
title: 'Form Elements/Radios',
component: Radios,
args: {
- legend: 'Have you changed your name?',
+ legend: 'How do you want to be contacted about this?',
legendProps: { isPageHeading: true, size: 'l' },
- hint: 'This includes changing your last name or spelling your name differently',
name: 'example',
},
};
+
export default meta;
type Story = StoryObj;
-export const StandardRadios: Story = {
+export const Default: Story = {
+ name: 'Radios default',
args: {
- name: 'standard',
+ legend: 'Are you 18 or over?',
+ name: 'default',
},
render: (args) => (
Yes
-
- No
+ No
+
+ ),
+};
+
+export const Small: Story = {
+ name: 'Radios small',
+ args: {
+ ...Default.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small',
+ small: true,
+ },
+ render: (args) => (
+
+
+ Yes
+ No
),
};
-export const InlineRadios: Story = {
+export const Inline: Story = {
+ name: 'Radios inline',
args: {
+ legend: 'Are you 18 or over?',
name: 'inline',
inline: true,
},
render: (args) => (
Yes
-
- No
-
+ No
),
};
-export const RadiosWithCaption: Story = {
+export const SmallInline: Story = {
+ name: 'Radios inline, small',
+ args: {
+ ...Inline.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-inline',
+ small: true,
+ },
+ render: Inline.render,
+};
+
+export const WithCaption: Story = {
+ name: 'Radios with caption',
args: {
legend: (
<>
- About you Have you changed your name?
+ About you Are you 18 or over?
>
),
name: 'with-caption',
@@ -57,141 +88,127 @@ export const RadiosWithCaption: Story = {
render: (args) => (
Yes
-
- No
-
+ No
),
};
-export const RadiosWithConditionalContent: Story = {
+export const SmallWithCaption: Story = {
+ name: 'Radios with caption, small',
args: {
- legend: 'Impairment requirement',
- hint: 'Select relevant options',
- name: 'conditional',
- },
- render: (args) => {
- const impairmentsForm = (
-
- Autism
-
- Developmental conditions (excluding autism)
-
- Dementia
- Learning disability
- Mental Health Condition
- Physical disability
-
- Sensory disability - such as sight, hearing or verbal
-
- Long-term condition
-
- );
-
- return (
-
-
- Patient requires an impairment to be added
-
- Patient would prefer not to say
-
- );
+ ...WithCaption.args,
+ legend: (
+ <>
+ About you Are you 18 or over?
+ >
+ ),
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-caption',
+ small: true,
},
+ render: WithCaption.render,
};
-export const RadiosWithADivider: Story = {
+export const WithHint: Story = {
+ name: 'Radios with hint',
args: {
- legend: 'How do you want to sign in?',
- hint: undefined,
- name: 'divider',
+ hint: 'Select 1 option',
+ name: 'with-hint',
},
render: (args) => (
- Use Government Gateway
- Use NHS.UK login
- or
- Create an account
+ Email
+ Phone
+ Text message
),
};
-export const RadiosWithHintsOnItems: Story = {
+export const SmallWithHint: Story = {
+ name: 'Radios with hint, small',
+ args: {
+ ...WithHint.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-hint',
+ small: true,
+ },
+ render: WithHint.render,
+};
+
+export const WithHintOnItems: Story = {
+ name: 'Radios with hints on items',
args: {
- legend: 'How do you want to sign in?',
- hint: undefined,
- name: 'hints',
+ legend: 'Do you have a mobile phone with signal?',
+ name: 'with-hint-on-items',
},
render: (args) => (
-
- Use Government Gateway
+
+ Yes, I have a mobile phone with signal
-
- Use NHS.UK login
+
+ No, I want to use my landline
),
};
-export const SmallRadios: Story = {
+export const SmallWithHintOnItems: Story = {
+ name: 'Radios with hints on items, small',
args: {
- ...StandardRadios.args,
+ ...WithHintOnItems.args,
legendProps: { isPageHeading: true, size: 'm' },
- name: 'small',
+ name: 'small-with-hint-on-items',
small: true,
},
- render: StandardRadios.render,
+ render: WithHintOnItems.render,
};
-export const SmallInlineRadios: Story = {
+export const WithError: Story = {
+ name: 'Radios with error message',
args: {
- ...InlineRadios.args,
- legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-inline',
- small: true,
+ error: 'Select how you want to be contacted',
+ name: 'with-error',
},
- render: InlineRadios.render,
+ render: WithHint.render,
};
-export const SmallRadiosWithConditionalContent: Story = {
+export const SmallWithError: Story = {
+ name: 'Radios with error message, small',
args: {
- ...RadiosWithConditionalContent.args,
+ ...WithError.args,
legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-conditional',
+ name: 'small-with-error',
small: true,
},
- render: RadiosWithConditionalContent.render,
+ render: WithError.render,
};
-export const SmallRadiosWithADivider: Story = {
+export const WithHintAndError: Story = {
+ name: 'Radios with error message and hint',
args: {
- ...RadiosWithADivider.args,
- legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-divider',
- small: true,
+ hint: 'Select 1 option',
+ error: 'Select how you want to be contacted',
+ name: 'with-hint-and-error',
},
- render: RadiosWithADivider.render,
+ render: WithHint.render,
};
-export const SmallRadiosWithHintsOnItems: Story = {
+export const SmallWithHintAndError: Story = {
+ name: 'Radios with error message and hint, small',
args: {
- ...RadiosWithHintsOnItems.args,
+ ...WithHintAndError.args,
legendProps: { isPageHeading: true, size: 'm' },
- name: 'small-hints',
+ name: 'small-with-hint-and-error',
small: true,
},
- render: RadiosWithHintsOnItems.render,
+ render: WithHintAndError.render,
};
-export const DisabledRadios: Story = {
+export const WithDisabledItems: Story = {
+ name: 'Radios with disabled items',
args: {
- name: 'disabled',
+ name: 'with-disabled-items',
},
render: (args) => (
@@ -205,16 +222,133 @@ export const DisabledRadios: Story = {
),
};
-export const RadiosWithError: Story = {
- name: 'Radios with error message',
+export const SmallWithDisabledItems: Story = {
+ name: 'Radios with disabled items, small',
+ args: {
+ ...WithDisabledItems.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-disabled-items',
+ small: true,
+ },
+ render: WithDisabledItems.render,
+};
+
+export const WithDivider: Story = {
+ name: 'Radios with divider',
args: {
- error: 'Select yes if you have changed your name',
- name: 'error',
+ legend: "Have you had all the vaccinations you're eligible for in the UK?",
+ hint: 'You would have got these vaccinations at school, from your GP surgery or another healthcare provider',
+ name: 'with-divider',
},
render: (args) => (
Yes
No
+ or
+ I do not know
+
+ ),
+};
+
+export const SmallWithDivider: Story = {
+ name: 'Radios divider, small',
+ args: {
+ ...WithDivider.args,
+ legendProps: { isPageHeading: true, size: 'm' },
+ name: 'small-with-divider',
+ small: true,
+ },
+ render: WithDivider.render,
+};
+
+export const WithValues: Story = {
+ name: 'Radios with pre-checked value',
+ args: {
+ name: 'with-values',
+ },
+ render: (args) => (
+
+
+ Email
+
+ Phone
+ Text message
+
+ ),
+};
+
+export const WithConditionalContent: Story = {
+ name: 'Radios with conditional content',
+ args: {
+ hint: 'Select 1 option',
+ name: 'with-conditional-content',
+ },
+ render: (args) => (
+
+ }>
+ Email
+
+ }>
+ Phone
+
+ }>
+ Text message
+
+
+ ),
+};
+
+export const WithConditionalContentValues: Story = {
+ name: 'Radios with conditional content and pre-checked value',
+ args: {
+ name: 'with-conditional-content-values',
+ },
+ render: (args) => (
+
+ } defaultChecked>
+ Email
+
+ }>
+ Phone
+
+ }>
+ Text message
+
+
+ ),
+};
+
+export const WithConditionalContentError: Story = {
+ name: 'Radios with conditional content, error message',
+ args: {
+ hint: 'Select 1 option',
+ error: 'Select how you like to be contacted',
+ name: 'with-conditional-content-error',
+ },
+ render: WithConditionalContent.render,
+};
+
+export const WithConditionalContentErrorNested: Story = {
+ name: 'Radios with conditional content, error message (nested)',
+ args: {
+ hint: 'Select 1 option',
+ name: 'with-conditional-content-error-nested',
+ },
+ render: (args) => (
+
+ }>
+ Email
+
+ }
+ defaultChecked
+ >
+ Phone
+
+ }>
+ Text message
+
),
};
diff --git a/stories/Form Elements/Select.stories.tsx b/stories/Form Elements/Select.stories.tsx
index ae74c37bf..a8c7dbc41 100644
--- a/stories/Form Elements/Select.stories.tsx
+++ b/stories/Form Elements/Select.stories.tsx
@@ -25,10 +25,12 @@ const meta: Meta = {
),
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Select default',
render: (args) => (
Recently published
@@ -39,19 +41,22 @@ export const Standard: Story = {
),
};
-export const SelectWithHintText: Story = {
+export const SelectWithHint: Story = {
+ name: 'Select with hint',
args: {
hint: 'This can be different to where you went before',
},
};
export const SelectWithError: Story = {
+ name: 'Select with error message',
args: {
error: 'Select a location',
},
};
-export const SelectWithErrorAndHintText: Story = {
+export const SelectWithErrorAndHint: Story = {
+ name: 'Select with error message and hint',
args: {
hint: 'This can be different to where you went before',
error: 'Select a location',
@@ -59,6 +64,7 @@ export const SelectWithErrorAndHintText: Story = {
};
export const SelectWithDivider: Story = {
+ name: 'Select with divider',
render: (args) => (
First name (A to Z)
@@ -71,6 +77,7 @@ export const SelectWithDivider: Story = {
};
export const SelectWithButton: Story = {
+ name: 'Select with button',
args: {
formGroupProps: {
afterInput: (
@@ -83,6 +90,7 @@ export const SelectWithButton: Story = {
};
export const SelectWithButtonAndError: Story = {
+ name: 'Select with button and error message',
args: {
error: 'Select a location',
formGroupProps: {
diff --git a/stories/Form Elements/TextInput.stories.tsx b/stories/Form Elements/TextInput.stories.tsx
index 2aa614a58..c7e7cbc2a 100644
--- a/stories/Form Elements/TextInput.stories.tsx
+++ b/stories/Form Elements/TextInput.stories.tsx
@@ -1,11 +1,12 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { Button } from '#components/form-elements/button/Button.js';
-import { TextInput } from '#components/form-elements/text-input/index.js';
+import { TextInput, type TextInputProps } from '#components/form-elements/text-input/index.js';
const meta: Meta = {
- title: 'Form Elements/TextInput',
+ title: 'Form Elements/Text input',
component: TextInput,
+ excludeStories: /^Example/,
args: {
id: 'input-example',
name: 'example',
@@ -20,8 +21,12 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
-export const WithHintText: Story = {
+export const Default: Story = {
+ name: 'Text input default',
+};
+
+export const WithHint: Story = {
+ name: 'Text input with hint',
args: {
label: 'What is your NHS number?',
code: true,
@@ -37,6 +42,7 @@ export const WithHintText: Story = {
};
export const WithError: Story = {
+ name: 'Text input with error message',
args: {
label: 'What is your NHS number?',
error: 'Enter NHS number',
@@ -46,7 +52,8 @@ export const WithError: Story = {
},
};
-export const WithErrorAndHintText: Story = {
+export const WithErrorAndHint: Story = {
+ name: 'Text input with error message and hint',
args: {
label: 'What is your NHS number?',
error: 'Enter NHS number',
@@ -63,6 +70,7 @@ export const WithErrorAndHintText: Story = {
};
export const WithWidthModifier: Story = {
+ name: 'Text input with width modifier',
args: {
label: 'What is your NHS number?',
width: 10,
@@ -79,6 +87,7 @@ export const WithWidthModifier: Story = {
};
export const WithPrefix: Story = {
+ name: 'Text input with prefix',
args: {
label: 'Cost in pounds',
prefix: '£',
@@ -87,6 +96,7 @@ export const WithPrefix: Story = {
};
export const WithSuffix: Story = {
+ name: 'Text input with suffix',
args: {
label: 'Weight in kilograms',
suffix: 'kg',
@@ -95,6 +105,7 @@ export const WithSuffix: Story = {
};
export const WithPrefixAndSuffix: Story = {
+ name: 'Text input with prefix and suffix',
args: {
label: 'Cost per item, in pounds',
prefix: '£',
@@ -104,6 +115,7 @@ export const WithPrefixAndSuffix: Story = {
};
export const WithPrefixAndSuffixAndError: Story = {
+ name: 'Text input with prefix and suffix and error message',
args: {
label: 'Cost per item, in pounds',
error: 'Enter a cost per item, in pounds',
@@ -114,6 +126,7 @@ export const WithPrefixAndSuffixAndError: Story = {
};
export const WithButton: Story = {
+ name: 'Text input with button',
args: {
label: 'What is your NHS number?',
width: 10,
@@ -131,6 +144,7 @@ export const WithButton: Story = {
};
export const WithButtonAndError: Story = {
+ name: 'Text input with button and error message',
args: {
label: 'What is your NHS number?',
error: 'Enter NHS number',
@@ -147,3 +161,33 @@ export const WithButtonAndError: Story = {
},
},
};
+
+export const ExampleEmail = (args: TextInputProps) => (
+
+);
+
+export const ExamplePhoneNumber = (args: TextInputProps) => (
+
+);
+
+export const ExampleMobilePhoneNumber = (args: TextInputProps) => (
+
+);
diff --git a/stories/Form Elements/Textarea.stories.tsx b/stories/Form Elements/Textarea.stories.tsx
index cbe970e36..9135c5791 100644
--- a/stories/Form Elements/Textarea.stories.tsx
+++ b/stories/Form Elements/Textarea.stories.tsx
@@ -8,26 +8,44 @@ const meta: Meta = {
args: {
label: 'Can you provide more detail?',
labelProps: { isPageHeading: true, size: 'l' },
- hint: 'Do not include personal information, like your name, date of birth or NHS number',
id: 'example',
name: 'example',
rows: 5,
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
+export const Default: Story = {
+ name: 'Textarea default',
+};
-export const TextareaWithAutoCompleteAttribute: Story = {
+export const WithHint: Story = {
+ name: 'Textarea with hint',
args: {
- autoComplete: 'street-address',
+ hint: 'Do not include personal information, like your name, date of birth or NHS number',
},
};
-export const TextareaWithError: Story = {
+export const WithError: Story = {
name: 'Textarea with error message',
args: {
error: 'You must provide an explanation',
},
};
+
+export const WithErrorAndHint: Story = {
+ name: 'Textarea with error and hint text',
+ args: {
+ error: 'You must provide an explanation',
+ hint: 'Do not include personal information, like your name, date of birth or NHS number',
+ },
+};
+
+export const WithAutoCompleteAttribute: Story = {
+ name: 'Textarea with autocomplete attribute',
+ args: {
+ autoComplete: 'street-address',
+ },
+};
diff --git a/stories/Layout/Grid.stories.tsx b/stories/Layout/Grid.stories.tsx
index 66780c2e8..132b7f833 100644
--- a/stories/Layout/Grid.stories.tsx
+++ b/stories/Layout/Grid.stories.tsx
@@ -10,6 +10,7 @@ const meta: Meta = {
width: false,
},
};
+
export default meta;
export const Grid: StoryObj = {
diff --git a/stories/Navigation/ActionLink.stories.tsx b/stories/Navigation/ActionLink.stories.tsx
index 27dc91268..108d303fe 100644
--- a/stories/Navigation/ActionLink.stories.tsx
+++ b/stories/Navigation/ActionLink.stories.tsx
@@ -3,7 +3,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { ActionLink } from '#components/navigation/action-link/index.js';
const meta: Meta = {
- title: 'Navigation/ActionLink',
+ title: 'Navigation/Action link',
component: ActionLink,
render: (args) => Find your nearest A&E ,
};
@@ -11,7 +11,7 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
name: 'Action link default',
args: {
href: '#',
diff --git a/stories/Navigation/BackLink.stories.tsx b/stories/Navigation/BackLink.stories.tsx
index 283cb87ca..fd0dd138d 100644
--- a/stories/Navigation/BackLink.stories.tsx
+++ b/stories/Navigation/BackLink.stories.tsx
@@ -3,14 +3,15 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { BackLink } from '#components/navigation/back-link/index.js';
const meta: Meta = {
- title: 'Navigation/BackLink',
+ title: 'Navigation/Back link',
component: BackLink,
render: (args) => ,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
name: 'Back link default',
args: {
href: '#',
diff --git a/stories/Navigation/Breadcrumb.stories.tsx b/stories/Navigation/Breadcrumb.stories.tsx
index 3d6028108..5b1420541 100644
--- a/stories/Navigation/Breadcrumb.stories.tsx
+++ b/stories/Navigation/Breadcrumb.stories.tsx
@@ -24,10 +24,11 @@ const meta: Meta = {
),
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
name: 'Breadcrumb default',
};
diff --git a/stories/Navigation/Card.stories.tsx b/stories/Navigation/Card.stories.tsx
index 659b635ca..c995c856c 100644
--- a/stories/Navigation/Card.stories.tsx
+++ b/stories/Navigation/Card.stories.tsx
@@ -25,11 +25,12 @@ const meta: Meta = {
},
},
};
+
export default meta;
type Story = StoryObj;
type StoryGroup = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
name: 'Basic card default',
render: (args) => (
diff --git a/stories/Navigation/ContentsList.stories.tsx b/stories/Navigation/ContentsList.stories.tsx
index 2aa54a97d..b64fb5eb4 100644
--- a/stories/Navigation/ContentsList.stories.tsx
+++ b/stories/Navigation/ContentsList.stories.tsx
@@ -6,13 +6,14 @@ import { ContentsList } from '#components/navigation/contents-list/index.js';
* This component can be found in the `nhsuk-frontend` repository here .
*/
const meta: Meta = {
- title: 'Navigation/ContentsList',
+ title: 'Navigation/Contents list',
component: ContentsList,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
argTypes: {
'aria-label': {
control: 'text',
diff --git a/stories/Navigation/Footer.stories.tsx b/stories/Navigation/Footer.stories.tsx
index 1f937f854..c694852e7 100644
--- a/stories/Navigation/Footer.stories.tsx
+++ b/stories/Navigation/Footer.stories.tsx
@@ -11,10 +11,11 @@ const meta: Meta = {
width: false,
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
name: 'Footer default',
render: (args) => (
@@ -97,7 +98,7 @@ export const WithMetaAndNavigation: Story = {
export const WithMetaLinksOnly: Story = {
name: 'Footer with meta (links only)',
- render: Standard.render,
+ render: Default.render,
};
export const WithMetaLinksAndHTML: Story = {
diff --git a/stories/Navigation/Header.stories.tsx b/stories/Navigation/Header.stories.tsx
index 97fe6b719..dcb4c2bb2 100644
--- a/stories/Navigation/Header.stories.tsx
+++ b/stories/Navigation/Header.stories.tsx
@@ -11,10 +11,12 @@ const meta: Meta = {
width: false,
},
};
+
export default meta;
type Story = StoryObj;
-export const HeaderDefault: Story = {
+export const Default: Story = {
+ name: 'Header default',
args: {
service: {
text: 'Digital service manual',
@@ -38,7 +40,8 @@ export const HeaderDefault: Story = {
),
};
-export const HeaderBasic: Story = {
+export const Basic: Story = {
+ name: 'Header basic',
args: {
logo: {
href: '/',
@@ -47,7 +50,8 @@ export const HeaderBasic: Story = {
render: (args) => ,
};
-export const HeaderWithServiceName: Story = {
+export const WithServiceName: Story = {
+ name: 'Header with service name',
args: {
service: {
text: 'Manage patients',
@@ -57,7 +61,8 @@ export const HeaderWithServiceName: Story = {
render: (args) => ,
};
-export const HeaderWithSearch: Story = {
+export const WithSearch: Story = {
+ name: 'Header with search',
args: {
logo: {
href: '/',
@@ -70,7 +75,8 @@ export const HeaderWithSearch: Story = {
),
};
-export const HeaderWithNavigation: Story = {
+export const WithNavigation: Story = {
+ name: 'Header with navigation',
args: {
logo: {
href: '/',
@@ -91,7 +97,8 @@ export const HeaderWithNavigation: Story = {
),
};
-export const HeaderWithAccount: Story = {
+export const WithAccount: Story = {
+ name: 'Header with account',
args: {
service: {
text: 'Manage patients',
@@ -112,7 +119,8 @@ export const HeaderWithAccount: Story = {
),
};
-export const HeaderWithAccountComplex: Story = {
+export const WithAccountComplex: Story = {
+ name: 'Header with account (complex)',
args: {
service: {
text: 'Manage patients',
@@ -139,7 +147,8 @@ export const HeaderWithAccountComplex: Story = {
),
};
-export const HeaderOrganisationalBlueWithNavigation: Story = {
+export const BlueWithNavigation: Story = {
+ name: 'Header blue with navigation',
args: {
logo: { href: '/' },
organisation: {
@@ -164,7 +173,8 @@ export const HeaderOrganisationalBlueWithNavigation: Story = {
),
};
-export const HeaderOrganisationalWhiteWithNavigation: Story = {
+export const WhiteWithNavigation: Story = {
+ name: 'Header white with navigation',
args: {
logo: { href: '/' },
organisation: {
@@ -190,7 +200,8 @@ export const HeaderOrganisationalWhiteWithNavigation: Story = {
),
};
-export const HeaderOrganisationalWhiteWithNavigationWhite: Story = {
+export const WhiteWithNavigationWhite: Story = {
+ name: 'Header white with navigation (white)',
args: {
logo: { href: '/' },
organisation: {
@@ -216,7 +227,8 @@ export const HeaderOrganisationalWhiteWithNavigationWhite: Story = {
),
};
-export const HeaderWithCustomNavItemComponent: Story = {
+export const WithCustomNavigationItemComponent: Story = {
+ name: 'Header with custom navigation item component',
args: {
logo: { href: '/' },
organisation: {
diff --git a/stories/Navigation/Pagination.stories.tsx b/stories/Navigation/Pagination.stories.tsx
index b208201b8..286853aa8 100644
--- a/stories/Navigation/Pagination.stories.tsx
+++ b/stories/Navigation/Pagination.stories.tsx
@@ -9,10 +9,12 @@ const meta: Meta = {
width: 'full',
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Pagination default',
render: (args) => (
@@ -22,6 +24,7 @@ export const Standard: Story = {
};
export const WithOnlyNext: Story = {
+ name: 'Pagination with only next',
render: (args) => (
@@ -30,6 +33,7 @@ export const WithOnlyNext: Story = {
};
export const WithOnlyPrevious: Story = {
+ name: 'Pagination with only previous',
render: (args) => (
@@ -38,6 +42,7 @@ export const WithOnlyPrevious: Story = {
};
export const WithTranslations: Story = {
+ name: 'Pagination with translations',
render: (args) => (
@@ -51,6 +56,7 @@ export const WithTranslations: Story = {
};
export const Numbered: Story = {
+ name: 'Pagination numbered',
render: (args) => (
@@ -63,6 +69,7 @@ export const Numbered: Story = {
};
export const NumberedFirstPage: Story = {
+ name: 'Pagination numbered first page',
render: (args) => (
@@ -74,6 +81,7 @@ export const NumberedFirstPage: Story = {
};
export const NumberedLastPage: Story = {
+ name: 'Pagination numbered last page',
render: (args) => (
@@ -85,6 +93,7 @@ export const NumberedLastPage: Story = {
};
export const NumberedWithManyPages: Story = {
+ name: 'Pagination numbered with many pages',
render: (args) => (
@@ -103,6 +112,7 @@ export const NumberedWithManyPages: Story = {
};
export const NumberedWithTranslations: Story = {
+ name: 'Pagination numbered with translations',
render: (args) => (
diff --git a/stories/Navigation/SkipLink.stories.tsx b/stories/Navigation/SkipLink.stories.tsx
index 0a65ae492..a3e83d68f 100644
--- a/stories/Navigation/SkipLink.stories.tsx
+++ b/stories/Navigation/SkipLink.stories.tsx
@@ -22,7 +22,7 @@ const CodeText: FC<{ children: ReactNode }> = ({ children }) => (
);
const meta: Meta = {
- title: 'Navigation/SkipLink',
+ title: 'Navigation/Skip link',
component: SkipLink,
render: (args) => (
<>
@@ -51,4 +51,4 @@ const meta: Meta = {
export default meta;
type Story = StoryObj;
-export const Standard: Story = {};
+export const Default: Story = {};
diff --git a/stories/Patterns/NavAZ.stories.tsx b/stories/Patterns/NavAZ.stories.tsx
index 7a392091f..7c7b6ae7b 100644
--- a/stories/Patterns/NavAZ.stories.tsx
+++ b/stories/Patterns/NavAZ.stories.tsx
@@ -7,7 +7,7 @@ import { NavAZ } from '#patterns/nav-a-z/index.js';
*/
const meta: Meta = {
- title: 'Patterns/NavAZ',
+ title: 'Patterns/A to Z navigation',
component: NavAZ,
args: {
fullAlphabet: false,
@@ -16,12 +16,14 @@ const meta: Meta = {
letters: [],
},
};
+
export default meta;
type Story = StoryObj;
-export const Basic: Story = {
+export const Default: Story = {
+ name: 'A to Z navigation default',
render: (args) => (
-
+
A
B
C
@@ -52,21 +54,38 @@ export const Basic: Story = {
),
};
-export const UsingFullAlphabetProp: Story = { args: { fullAlphabet: true } };
+export const UsingFullAlphabetProp: Story = {
+ name: 'A to Z navigation using full alphabet',
+ args: {
+ fullAlphabet: true,
+ },
+};
export const UsingFullAlphabetPropWithDisabledLetters: Story = {
- args: { disabledLetters: ['A', 'B', 'C'], fullAlphabet: true },
+ name: 'A to Z navigation using full alphabet with disabled letters',
+ args: {
+ disabledLetters: ['A', 'B', 'C'],
+ fullAlphabet: true,
+ },
};
export const UsingFullAlphabetPropWithRemovedLetters: Story = {
- args: { removedLetters: ['A', 'B', 'C'], fullAlphabet: true },
+ name: 'A to Z navigation using full alphabet with removed letters',
+ args: {
+ removedLetters: ['A', 'B', 'C'],
+ fullAlphabet: true,
+ },
};
export const UsingIndividualLetters: Story = {
- args: { letters: ['A', 'B', 'C'] },
+ name: 'A to Z navigation using individual letters',
+ args: {
+ letters: ['A', 'B', 'C'],
+ },
};
export const UsingACombinationOfProps: Story = {
+ name: 'A to Z navigation (complex)',
args: {
letters: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''),
disabledLetters: 'QWERTY'.split(''),
diff --git a/stories/Patterns/PageAZ.stories.tsx b/stories/Patterns/PageAZ.stories.tsx
index e6b897450..b81feb90e 100644
--- a/stories/Patterns/PageAZ.stories.tsx
+++ b/stories/Patterns/PageAZ.stories.tsx
@@ -12,7 +12,7 @@ import { NavAZ } from '#patterns/nav-a-z/index.js';
*/
const meta: Meta = {
- title: 'Patterns/PageAZ',
+ title: 'Patterns/A to Z page',
args: {
fullAlphabet: false,
removedLetters: [],
@@ -24,10 +24,12 @@ const meta: Meta = {
width: false,
},
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'A to Z page default',
render: () => (
diff --git a/stories/Patterns/ReviewDate.stories.tsx b/stories/Patterns/ReviewDate.stories.tsx
index cf31aec90..cded38c58 100644
--- a/stories/Patterns/ReviewDate.stories.tsx
+++ b/stories/Patterns/ReviewDate.stories.tsx
@@ -3,13 +3,15 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { ReviewDate } from '#patterns/review-date/index.js';
const meta: Meta = {
- title: 'Patterns/ReviewDate',
+ title: 'Patterns/Review date',
component: ReviewDate,
};
+
export default meta;
type Story = StoryObj;
-export const Standard: Story = {
+export const Default: Story = {
+ name: 'Review date default',
args: {
lastReviewed: '12 Feburary 2016',
nextReview: '1 Feburary 2019',
@@ -17,12 +19,14 @@ export const Standard: Story = {
};
export const JustLastReview: Story = {
+ name: 'Review date with last review only',
args: {
lastReviewed: '12 Feburary 2016',
},
};
export const JustNextReview: Story = {
+ name: 'Review date with next review only',
args: {
nextReview: '1 Feburary 2019',
},