You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use `defaultValue` and `defaultChecked` without change handlers
* Update form examples with `isPageHeading`
* Always pass args to storybook examples
* Remove out of date comment
* Remove unnecessary wrappers
* Remove implementation notes duplicated in args or examples
Copy file name to clipboardExpand all lines: src/components/navigation/action-link/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This component can be found in the `nhsuk-frontend` repository [here](https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/nhsuk-frontend/src/nhsuk/components/action-link).
4
4
5
-
## Implementation Notes
5
+
## Implementation notes
6
6
7
7
The ActionLink component does not use the `nhsuk-frontend` "openInNewWindow" property, instead it allows the user to add the `target="_blank"` property (if desired).
Copy file name to clipboardExpand all lines: stories/Content Presentation/Details.stories.tsx
+1-31Lines changed: 1 addition & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -4,43 +4,13 @@ import { Details } from '#components';
4
4
/**
5
5
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/nhsuk-frontend/src/nhsuk/components/contents-list" target="_blank">here</a>.
6
6
*
7
-
* ## Implementation Notes
7
+
* ## Implementation notes
8
8
*
9
9
* The `Details` component has three subcomponents:
10
10
*
11
11
* - `Details.Summary`
12
12
* - `Details.Text`
13
13
* - `Details.ExpanderGroup`
14
-
*
15
-
* ## Usage
16
-
*
17
-
* ### Standard
18
-
*
19
-
* ```jsx
20
-
* import { Details } from "nhsuk-react-components";
21
-
*
22
-
* const Element = () => {
23
-
* return (
24
-
* <Details>
25
-
* <Details.Summary>Where can I find my NHS number?</Details.Summary>
26
-
* <Details.Text>
27
-
* <p>An NHS number is a 10 digit number, like 485 777 3456.</p>
28
-
* <p>
29
-
* You can find your NHS number on any document sent to you by the NHS. This may include:
30
-
* </p>
31
-
* <ul>
32
-
* <li>prescriptions</li>
33
-
* <li>test results</li>
34
-
* <li>hospital referral letters</li>
35
-
* <li>appointment letters</li>
36
-
* <li>your NHS medical card</li>
37
-
* </ul>
38
-
* <p>Ask your GP practice for help if you can't find your NHS number.</p>
Copy file name to clipboardExpand all lines: stories/Content Presentation/DoAndDontList.stories.tsx
+14-28Lines changed: 14 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,15 @@ import { DoAndDontList } from '#components';
4
4
/**
5
5
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/nhsuk-frontend/src/nhsuk/components/do-dont-list" target="_blank" rel="noopener noreferrer">here</a>.
6
6
*
7
-
* ## Implementation Notes
7
+
* ## Implementation notes
8
8
*
9
9
* The `DoAndDontList` component has one subcomponent: `DoAndDontList.Item`.
10
10
*
11
11
* As long as a `listType` is supplied to the `DoAndDontList` component, all subcomponents will render as desired. If you require a `DoAndDontList.Item` to be different, a `listItemType` prop can be supplied to force the type.
12
12
*
13
-
*
14
13
* The `DoAndDontList.Item` component can also accept a `prefixText` prop, which can be used to override the default prefix text.
15
14
*
16
15
* See the <b><a href="#custom-prefix-text" >custom prefix text</a></b> story for an example.
17
-
*
18
-
* ## Usage
19
-
*
20
-
* ### Standard
21
-
*
22
-
* ```jsx
23
-
* import { DoAndDontList } from "nhsuk-react-components";
24
-
*
25
-
* const Element = () => {
26
-
* return (
27
-
* <DoAndDontList listType="do">
28
-
* <DoAndDontList.Item>
29
-
* cover blisters that are likely to burst with a soft plaster or dressing
30
-
* </DoAndDontList.Item>
31
-
* <DoAndDontList.Item>wash your hands before touching a burst blister</DoAndDontList.Item>
32
-
* <DoAndDontList.Item>
33
-
* allow the fluid in a burst blister to drain before covering it with a plaster or dressing
34
-
* </DoAndDontList.Item>
35
-
* </DoAndDontList>
36
-
* );
37
-
* }
38
-
* ```
39
16
*/
40
17
constmeta: Meta<typeofDoAndDontList>={
41
18
title: 'Content Presentation/DoAndDontList',
@@ -45,8 +22,11 @@ export default meta;
45
22
typeStory=StoryObj<typeofDoAndDontList>;
46
23
47
24
exportconstDo: Story={
25
+
args: {
26
+
listType: 'do',
27
+
},
48
28
render: (args)=>(
49
-
<DoAndDontListlistType="do">
29
+
<DoAndDontList{...args}>
50
30
<DoAndDontList.Item>
51
31
cover blisters that are likely to burst with a soft plaster or dressing
52
32
</DoAndDontList.Item>
@@ -59,8 +39,11 @@ export const Do: Story = {
59
39
};
60
40
61
41
exportconstDont: Story={
42
+
args: {
43
+
listType: 'dont',
44
+
},
62
45
render: (args)=>(
63
-
<DoAndDontListlistType="dont">
46
+
<DoAndDontList{...args}>
64
47
<DoAndDontList.Item>burst a blister yourself</DoAndDontList.Item>
65
48
<DoAndDontList.Item>peel the skin off a burst blister</DoAndDontList.Item>
66
49
<DoAndDontList.Item>pick at the edges of the remaining skin</DoAndDontList.Item>
@@ -90,8 +73,11 @@ export const Dont: Story = {
90
73
* | JSX | The JSX will be rendered, such as `<span>` |
91
74
*/
92
75
exportconstCustomPrefixText: Story={
93
-
render: ()=>(
94
-
<DoAndDontListlistType="dont">
76
+
args: {
77
+
listType: 'dont',
78
+
},
79
+
render: (args)=>(
80
+
<DoAndDontList{...args}>
95
81
<DoAndDontList.ItemprefixText="You must not">burst a blister yourself</DoAndDontList.Item>
Copy file name to clipboardExpand all lines: stories/Content Presentation/NotificationBanner.stories.tsx
+18-35Lines changed: 18 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -5,32 +5,13 @@ import { NotificationBannerLink } from '#components/content-presentation/notific
5
5
/**
6
6
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/nhsuk-frontend/src/nhsuk/components/notification-banner" target="_blank">here</a>.
7
7
*
8
-
* ## Implementation Notes
8
+
* ## Implementation notes
9
9
*
10
10
* The `NotificationBanner` component has three subcomponents:
11
11
*
12
12
* - `NotificationBanner.Title`
13
13
* - `NotificationBanner.Heading`
14
14
* - `NotificationBanner.Link`
15
-
*
16
-
* ## Usage
17
-
*
18
-
* ### Standard
19
-
*
20
-
* ```jsx
21
-
* import { NotificationBanner } from "nhsuk-react-components";
22
-
*
23
-
* const Element = () => {
24
-
* return (
25
-
* <NotificationBanner>
26
-
* <NotificationBanner.Heading>Patient record updated</Details.Summary>
27
-
* <p>
28
-
* Contact <NotificationBanner.Link href="#">example@department.nhs.uk</NotificationBanner.Link> if you think there's a problem.
Copy file name to clipboardExpand all lines: stories/Form Elements/Button.stories.tsx
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,37 +4,37 @@ import { Button } from '#components';
4
4
/**
5
5
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/components/button" target="_blank" rel="noopener noreferrer">here</a>.
6
6
*
7
-
* ## Implementation Notes
7
+
* ## Implementation notes
8
8
*
9
9
* The `Button` component from `nhsuk-react-components` will either render a standard `<button>` or `<a>` element depending on whether an `href` prop is supplied.
10
10
*
11
11
* If you want to use a specific component instead of the wrapper, you can supply the `as="a"` or `as="button"` props.
12
12
*
13
13
* ## Usage
14
14
*
15
-
* ### Standard
15
+
* ### As a button
16
16
*
17
17
* ```jsx
18
18
* import { Button } from "nhsuk-react-components";
19
19
*
20
20
* const Element = () => {
21
-
* return (
22
-
* <Button>Button</Button>
23
-
* );
21
+
* return (
22
+
* <Button>Button</Button>
23
+
* );
24
24
* }
25
25
* ```
26
26
*
27
-
* ### As a Link
27
+
* ### As a link
28
28
*
29
29
* ```jsx
30
30
* import { Button } from "nhsuk-react-components";
0 commit comments