@scottish-government/designsystem-react 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.storybook/manager.ts +1 -7
  2. package/.storybook/sgdsArgTypes.ts +19 -0
  3. package/README.md +3 -0
  4. package/dist/common/AbstractNotificationBanner.jsx +2 -5
  5. package/dist/components/SequentialNavigation/SequentialNavigation.jsx +1 -0
  6. package/dist/components/TaskList/TaskList.jsx +1 -0
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/package.json +2 -2
  9. package/src/common/AbstractNotificationBanner.tsx +2 -6
  10. package/src/components/Accordion/Accordion.Item.stories.tsx +62 -0
  11. package/src/components/Accordion/Accordion.stories.tsx +0 -50
  12. package/src/components/AspectBox/AspectBox.stories.tsx +1 -1
  13. package/src/components/BackToTop/BackToTop.stories.tsx +1 -1
  14. package/src/components/Breadcrumbs/Breadcrumbs.Item.stories.tsx +35 -0
  15. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -1
  16. package/src/components/CategoryItem/CategoryItem.stories.tsx +1 -1
  17. package/src/components/CategoryList/CategoryList.stories.tsx +1 -1
  18. package/src/components/Checkbox/Checkbox.stories.tsx +1 -1
  19. package/src/components/Checkbox/CheckboxGroup.stories.tsx +1 -1
  20. package/src/components/ConfirmationMessage/ConfirmationMessage.stories.tsx +1 -1
  21. package/src/components/ContentsNav/ContentsNav.Item.stories.tsx +45 -0
  22. package/src/components/ContentsNav/ContentsNav.stories.tsx +1 -2
  23. package/src/components/CookieBanner/CookieBanner.Buttons.stories.tsx +27 -0
  24. package/src/components/CookieBanner/CookieBanner.stories.tsx +2 -2
  25. package/src/components/DatePicker/DatePicker.stories.tsx +1 -1
  26. package/src/components/ErrorMessage/ErrorMessage.stories.tsx +1 -1
  27. package/src/components/ErrorSummary/ErrorSummary.Item.stories.tsx +28 -0
  28. package/src/components/ErrorSummary/ErrorSummary.stories.tsx +1 -2
  29. package/src/components/FileDownload/FileDownload.stories.tsx +1 -1
  30. package/src/components/HideThisPage/HideThisPage.stories.tsx +1 -1
  31. package/src/components/InsetText/InsetText.stories.tsx +1 -1
  32. package/src/components/NotificationBanner/NotificationBanner.stories.tsx +1 -1
  33. package/src/components/NotificationPanel/NotificationPanel.stories.tsx +1 -1
  34. package/src/components/PageHeader/PageHeader.stories.tsx +1 -1
  35. package/src/components/PageMetadata/PageMetadata.Item.stories.tsx +31 -0
  36. package/src/components/PageMetadata/PageMetadata.stories.tsx +10 -5
  37. package/src/components/PhaseBanner/PhaseBanner.stories.tsx +1 -1
  38. package/src/components/RadioButton/RadioButton.stories.tsx +1 -1
  39. package/src/components/RadioButton/RadioGroup.stories.tsx +1 -1
  40. package/src/components/SequentialNavigation/SequentialNavigation.Next.stories.tsx +35 -0
  41. package/src/components/SequentialNavigation/SequentialNavigation.Previous.stories.tsx +35 -0
  42. package/src/components/SequentialNavigation/SequentialNavigation.stories.tsx +1 -2
  43. package/src/components/SequentialNavigation/SequentialNavigation.test.tsx +15 -0
  44. package/src/components/SequentialNavigation/SequentialNavigation.tsx +1 -0
  45. package/src/components/SideNavigation/SideNavigation.Item.stories.tsx +36 -0
  46. package/src/components/SideNavigation/SideNavigation.List.stories.tsx +46 -0
  47. package/src/components/SideNavigation/SideNavigation.stories.tsx +1 -2
  48. package/src/components/SiteFooter/SiteFooter.License.stories.tsx +39 -0
  49. package/src/components/SiteFooter/SiteFooter.Link.stories.tsx +25 -0
  50. package/src/components/SiteFooter/SiteFooter.Links.stories.tsx +32 -0
  51. package/src/components/SiteFooter/SiteFooter.Org.stories.tsx +38 -0
  52. package/src/components/SiteFooter/SiteFooter.stories.tsx +1 -1
  53. package/src/components/SiteHeader/SiteHeader.Brand.stories.tsx +45 -0
  54. package/src/components/SiteHeader/SiteHeader.stories.tsx +1 -1
  55. package/src/components/SiteNavigation/SiteNavigation.Item.stories.tsx +30 -0
  56. package/src/components/SiteNavigation/SiteNavigation.stories.tsx +1 -2
  57. package/src/components/SkipLinks/SkipLinks.Item.stories.tsx +27 -0
  58. package/src/components/SkipLinks/SkipLinks.stories.tsx +1 -1
  59. package/src/components/SummaryCard/SummaryCard.Action.stories.tsx +32 -0
  60. package/src/components/SummaryCard/SummaryCard.stories.tsx +1 -1
  61. package/src/components/SummaryList/SummaryList.Action.stories.tsx +32 -0
  62. package/src/components/SummaryList/SummaryList.Item.stories.tsx +35 -0
  63. package/src/components/SummaryList/SummaryList.Value.stories.tsx +27 -0
  64. package/src/components/SummaryList/SummaryList.stories.tsx +1 -1
  65. package/src/components/Tabs/Tabs.Item.stories.tsx +34 -0
  66. package/src/components/Tag/Tag.stories.tsx +2 -6
  67. package/src/components/TaskList/TaskList.Group.stories.tsx +101 -0
  68. package/src/components/TaskList/TaskList.Item.stories.tsx +70 -0
  69. package/src/components/TaskList/TaskList.stories.tsx +1 -1
  70. package/src/components/TaskList/TaskList.test.tsx +21 -1
  71. package/src/components/TaskList/TaskList.tsx +1 -0
@@ -0,0 +1,38 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SiteFooter from './SiteFooter';
5
+
6
+ const meta = {
7
+ title: 'Components/SiteFooter/SiteFooter.Org',
8
+ component: SiteFooter.Org,
9
+ argTypes: {
10
+ href: argTypes.href(),
11
+ title: {
12
+ description: 'Title for the parent org link',
13
+ type: 'string'
14
+ },
15
+ children: argTypes.children()
16
+ },
17
+ args: {
18
+ children: <>
19
+ <svg xmlns="http://www.w3.org/2000/svg" width="300" height="55" viewBox="0 0 157.4 29.9">
20
+ <defs>
21
+ <path id="a" d="M0 0h157.4v29.9H0z"/>
22
+ </defs>
23
+ <path fill="#333e48" d="M154.6 20.3a4 4 0 0 0 2.8-.9l-.7-2.3c-.2.3-.7.5-1.3.5-.8 0-1.3-.7-1.3-1.6V9h2.8V6.4h-2.8V2.7h-3v3.7h-2.3V9h2.3v7.9c0 2.2 1.2 3.4 3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6 7 1.8 0 3.3-.9 4.4-2.3v1.5c0 2.9-2.1 3.8-4 3.8-1.8 0-3.2-.5-4.3-1.7l-1.4 2.1c1.7 1.5 3.4 2 5.7 2"/>
24
+ <path fill="#fff" d="M1.1 0h48.5v29.9H1.1z"/>
25
+ <path fill="#0065bd" d="m7.9 1.4 17.3 10.2L42.6 1.4zm0 27.1 17.3-10.1 17.4 10.1zm-5.4-24v20.9L19.7 15zm45.7 0v20.9L30.9 15z"/>
26
+ </svg>
27
+ </>,
28
+ href: 'https://www.gov.scot/',
29
+ title: 'The Scottish Government'
30
+ }
31
+ } satisfies Meta<typeof SiteFooter.Org>;
32
+
33
+ export default meta;
34
+ type Story = StoryObj<typeof meta>;
35
+
36
+ export const Default: Story = {
37
+
38
+ };
@@ -4,7 +4,7 @@ import argTypes from '../../../.storybook/sgdsArgTypes';
4
4
  import SiteFooter from './SiteFooter';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Site footer',
7
+ title: 'Components/SiteFooter',
8
8
  component: SiteFooter,
9
9
  argTypes: {
10
10
  children: argTypes.children()
@@ -0,0 +1,45 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SiteHeader from './SiteHeader';
5
+
6
+ const meta = {
7
+ title: 'Components/SiteHeader/SiteHeader.Brand',
8
+ component: SiteHeader.Brand,
9
+ argTypes: {
10
+ homeUrl: {
11
+ description: 'URL of the home page, used by the logo link',
12
+ type: 'string'
13
+ },
14
+ siteTitle: {
15
+ description: 'Text to use in the site title',
16
+ type: 'string'
17
+ },
18
+ children: argTypes.children()
19
+ },
20
+ args: {
21
+ children:
22
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 206.7 30.7">
23
+ <title>The Scottish Government</title>
24
+ <path fill="#fff" d="M0 0h46.8v28.9H0z"/>
25
+ <path fill="#0065bd" d="m6.5 1.3 16.8 9.9 16.8-9.9zm0 26.2 16.8-9.8 16.8 9.8z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2.7 0 1.4-.8 2.7-2.3 2.7m0 1.5c2.6 0 4.1-1.9 4.1-4.2 0-2.3-1.6-4.2-4.1-4.2-2.6 0-4.1 1.9-4.1 4.2a4 4 0 0 0 4.1 4.2m-8.1 0c1.6 0 2.5-.7 3.1-1.4L68 10.3c-.5.6-1.1 1-1.9 1-1.5 0-2.4-1.1-2.4-2.7s1-2.7 2.4-2.7c.8 0 1.4.3 1.9.9l1.2-1.1c-.6-.7-1.6-1.3-3.2-1.3a4.1 4.1 0 0 0-4.2 4.2c.1 2.4 1.8 4.2 4.2 4.2m-9.7 0c3 0 4.3-1.6 4.3-3.5 0-4.1-6.5-2.9-6.5-4.9.1-.8.8-1.4 1.9-1.4 1.2 0 2.4.4 3.2 1.3l1.1-1.5c-1-1-2.4-1.6-4.2-1.6-2.5 0-4.1 1.4-4.1 3.3 0 4.1 6.5 2.6 6.5 5 0 .8-.6 1.5-2.2 1.5s-2.8-.7-3.5-1.6l-1.1 1.5a6 6 0 0 0 4.6 1.9"/>
28
+ </svg>
29
+ ,
30
+ homeUrl: '/'
31
+ }
32
+ } satisfies Meta<typeof SiteHeader.Brand>;
33
+
34
+ export default meta;
35
+ type Story = StoryObj<typeof meta>;
36
+
37
+ export const Default: Story = {
38
+
39
+ };
40
+
41
+ export const WithSiteTitle: Story = {
42
+ args: {
43
+ siteTitle: 'Design System React'
44
+ }
45
+ };
@@ -7,7 +7,7 @@ import SiteNavigation from '../SiteNavigation/SiteNavigation';
7
7
  import PhaseBanner from '../PhaseBanner/PhaseBanner';
8
8
 
9
9
  const meta = {
10
- title: 'Components/Site header',
10
+ title: 'Components/SiteHeader',
11
11
  component: SiteHeader,
12
12
  argTypes: {
13
13
  children: argTypes.children()
@@ -0,0 +1,30 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SiteNavigation from './SiteNavigation';
5
+
6
+ const meta = {
7
+ title: 'Components/SiteNavigation/SiteNavigation.Item',
8
+ component: SiteNavigation.Item,
9
+ argTypes: {
10
+ linkComponent: argTypes.linkComponent(),
11
+ children: argTypes.children()
12
+ },
13
+ args: {
14
+ children: 'About',
15
+ href: '#about'
16
+ }
17
+ } satisfies Meta<typeof SiteNavigation.Item>;
18
+
19
+ export default meta;
20
+ type Story = StoryObj<typeof meta>;
21
+
22
+ export const Default: Story = {
23
+
24
+ };
25
+
26
+ export const CurrentItem: Story = {
27
+ args: {
28
+ isCurrent: true
29
+ }
30
+ };
@@ -4,10 +4,9 @@ import argTypes from '../../../.storybook/sgdsArgTypes';
4
4
  import SiteNavigation from './SiteNavigation';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Site navigation',
7
+ title: 'Components/SiteNavigation',
8
8
  component: SiteNavigation,
9
9
  argTypes: {
10
- linkComponent: argTypes.linkComponent(),
11
10
  children: argTypes.children()
12
11
  },
13
12
  args: {
@@ -0,0 +1,27 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SkipLinks from './SkipLinks';
5
+
6
+ const meta = {
7
+ title: 'Components/SkipLinks/SkipLinks.Link',
8
+ component: SkipLinks.Link,
9
+ argTypes: {
10
+ fragmentId: {
11
+ description: 'ID of the destination element',
12
+ type: 'string'
13
+ },
14
+ children: argTypes.children()
15
+ },
16
+ args: {
17
+ children: 'Skip to main content',
18
+ fragmentId: 'my-main-content'
19
+ }
20
+ } satisfies Meta<typeof SkipLinks.Link>;
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Default: Story = {
26
+
27
+ };
@@ -4,7 +4,7 @@ import argTypes from '../../../.storybook/sgdsArgTypes';
4
4
  import SkipLinks from './SkipLinks';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Skip links',
7
+ title: 'Components/SkipLinks',
8
8
  component: SkipLinks,
9
9
  argTypes: {
10
10
  mainContentId: {
@@ -0,0 +1,32 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SummaryCard from './SummaryCard';
5
+
6
+ const meta = {
7
+ title: 'Components/SummaryCard/SummaryCard.Action',
8
+ component: SummaryCard.Action,
9
+ argTypes: {
10
+ href: argTypes.href(),
11
+ onClick: argTypes.onClick(),
12
+ children: argTypes.children()
13
+ },
14
+ args: {
15
+ children: 'Change',
16
+ href: '#foo'
17
+ }
18
+ } satisfies Meta<typeof SummaryCard.Action>;
19
+
20
+ export default meta;
21
+ type Story = StoryObj<typeof meta>;
22
+
23
+ export const Default: Story = {
24
+
25
+ };
26
+
27
+ export const ActionIsHtmlButton: Story = {
28
+ args: {
29
+ children: 'Change',
30
+ href: undefined
31
+ }
32
+ };
@@ -5,7 +5,7 @@ import SummaryCard from './SummaryCard';
5
5
  import SummaryList from '../SummaryList/SummaryList';
6
6
 
7
7
  const meta = {
8
- title: 'Components/Summary card',
8
+ title: 'Components/SummaryCard',
9
9
  component: SummaryCard,
10
10
  argTypes: {
11
11
  headingLevel: argTypes.headingLevel(),
@@ -0,0 +1,32 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SummaryList from './SummaryList';
5
+
6
+ const meta = {
7
+ title: 'Components/SummaryList/SummaryList.Action',
8
+ component: SummaryList.Action,
9
+ argTypes: {
10
+ href: argTypes.href(),
11
+ onClick: argTypes.onClick(),
12
+ children: argTypes.children()
13
+ },
14
+ args: {
15
+ children: 'Change',
16
+ href: '#foo'
17
+ }
18
+ } satisfies Meta<typeof SummaryList.Action>;
19
+
20
+ export default meta;
21
+ type Story = StoryObj<typeof meta>;
22
+
23
+ export const Default: Story = {
24
+
25
+ };
26
+
27
+ export const ActionIsHtmlButton: Story = {
28
+ args: {
29
+ children: 'Change',
30
+ href: undefined
31
+ }
32
+ };
@@ -0,0 +1,35 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SummaryList from './SummaryList';
5
+
6
+ const meta = {
7
+ title: 'Components/SummaryList/SummaryList.Item',
8
+ component: SummaryList.Item,
9
+ argTypes: {
10
+ children: argTypes.children()
11
+ },
12
+ args: {
13
+ children: [
14
+ <SummaryList.Value name="Email">
15
+ email@gov.scot
16
+ </SummaryList.Value>,
17
+ <SummaryList.Value name="Telephone">
18
+ 0123 456 7890
19
+ </SummaryList.Value>,
20
+ <SummaryList.Action href="foo">
21
+ Change
22
+ </SummaryList.Action>,
23
+ <SummaryList.Action onclick={function w(){}}>
24
+ Delete
25
+ </SummaryList.Action>
26
+ ]
27
+ }
28
+ } satisfies Meta<typeof SummaryList.Item>;
29
+
30
+ export default meta;
31
+ type Story = StoryObj<typeof meta>;
32
+
33
+ export const Default: Story = {
34
+
35
+ };
@@ -0,0 +1,27 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import SummaryList from './SummaryList';
5
+
6
+ const meta = {
7
+ title: 'Components/SummaryList/SummaryList.Value',
8
+ component: SummaryList.Value,
9
+ argTypes: {
10
+ name: {
11
+ description: 'Title of the summary list item',
12
+ type: 'string'
13
+ },
14
+ children: argTypes.children()
15
+ },
16
+ args: {
17
+ children: 'Jane Smith',
18
+ name: 'Name'
19
+ }
20
+ } satisfies Meta<typeof SummaryList.Value>;
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Default: Story = {
26
+
27
+ };
@@ -4,7 +4,7 @@ import argTypes from '../../../.storybook/sgdsArgTypes';
4
4
  import SummaryList from './SummaryList';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Summary list',
7
+ title: 'Components/SummaryList',
8
8
  component: SummaryList,
9
9
  argTypes: {
10
10
  isBorderless: argTypes.noBorder(),
@@ -0,0 +1,34 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import Tabs from './Tabs';
5
+
6
+ const meta = {
7
+ title: 'Components/Tabs/Tabs.Item',
8
+ component: Tabs.Item,
9
+ argTypes: {
10
+ tabLabel: {
11
+ description: '',
12
+ type: 'string'
13
+ },
14
+ children: argTypes.children()
15
+ },
16
+ args: {
17
+ baseId: 'my-tabs',
18
+ children: [
19
+ <h3>Search for training courses and funding</h3>,
20
+ <p>A wide range of training courses for your employees are available.</p>,
21
+ <p>Opportunities include distance learning, short courses and vocational training.</p>,
22
+ <p><a href="#">Visit My World of Work to search for training courses</a>.</p>,
23
+ <p>You can also <a href="#">search for training courses, and funding towards training</a>.</p>
24
+ ],
25
+ tabLabel: 'Courses and funding'
26
+ }
27
+ } satisfies Meta<typeof Tabs.Item>;
28
+
29
+ export default meta;
30
+ type Story = StoryObj<typeof meta>;
31
+
32
+ export const Default: Story = {
33
+
34
+ };
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
2
3
 
3
4
  import Tag from './Tag';
4
5
 
@@ -6,12 +7,7 @@ const meta = {
6
7
  title: 'Components/Tag',
7
8
  component: Tag,
8
9
  argTypes: {
9
- colour: {
10
- control: { type: 'select' },
11
- description: 'The tag colour to use',
12
- options: ['', 'blue', 'green', 'grey', 'orange', 'pink', 'purple', 'red', 'teal', 'yellow'],
13
- type: 'string'
14
- },
10
+ colour: argTypes.tagColour(),
15
11
  },
16
12
  } satisfies Meta<typeof Tag>;
17
13
 
@@ -0,0 +1,101 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import TaskList from './TaskList';
5
+
6
+ const meta = {
7
+ title: 'Components/TaskList/TaskList.Group',
8
+ component: TaskList.Group,
9
+ argTypes: {
10
+ headingId: {
11
+ description: 'ID of the task list\'s heading element',
12
+ type: 'string'
13
+ },
14
+ linkComponent: argTypes.linkComponent(),
15
+ title: {
16
+ description: 'The title of the task list',
17
+ type: {
18
+ name: 'string',
19
+ required: true
20
+ }
21
+ },
22
+ children: argTypes.children()
23
+ },
24
+ args: {
25
+ title: 'Tell us about your daily living and mobility circumstances'
26
+ }
27
+ } satisfies Meta<typeof TaskList.Group>;
28
+
29
+ export default meta;
30
+ type Story = StoryObj<typeof meta>;
31
+
32
+ export const Default: Story = {
33
+ render: (args) => (
34
+ <TaskList.Group {...args}>
35
+ <TaskList.Item
36
+ href="#preparing-food"
37
+ id="task-preparing-food"
38
+ statusText="In progress"
39
+ tagColour="grey"
40
+ title="Preparing food"
41
+ >
42
+ Questions about your ability to prepare a simple meal safely and any help you need to do this.
43
+ </TaskList.Item>
44
+ <TaskList.Item
45
+ href="#taking-nutrition"
46
+ id="task-taking-nutrition"
47
+ statusText="Not started"
48
+ tagColour="grey"
49
+ title="Taking nutrition"
50
+ >
51
+ Questions about your ability to eat and drink and any help you need to do this.
52
+ </TaskList.Item>
53
+ <TaskList.Item
54
+ href="#managing-therapy"
55
+ id="task-managing-therapy"
56
+ statusText="Not started"
57
+ tagColour="grey"
58
+ title="Managing therapy or monitoring a health condition"
59
+ >
60
+ Questions about any help you need to monitor changes in your health condition, take medication or do therapy at home.
61
+ </TaskList.Item>
62
+ </TaskList.Group>
63
+ )
64
+ };
65
+
66
+ export const WithIntroduction: Story = {
67
+ args: {
68
+ intro: 'This information will be used to check what additional benefits you may be able to apply for.'
69
+ },
70
+ render: (args) => (
71
+ <TaskList.Group {...args}>
72
+ <TaskList.Item
73
+ href="#preparing-food"
74
+ id="task-preparing-food"
75
+ statusText="In progress"
76
+ tagColour="grey"
77
+ title="Preparing food"
78
+ >
79
+ Questions about your ability to prepare a simple meal safely and any help you need to do this.
80
+ </TaskList.Item>
81
+ <TaskList.Item
82
+ href="#taking-nutrition"
83
+ id="task-taking-nutrition"
84
+ statusText="Not started"
85
+ tagColour="grey"
86
+ title="Taking nutrition"
87
+ >
88
+ Questions about your ability to eat and drink and any help you need to do this.
89
+ </TaskList.Item>
90
+ <TaskList.Item
91
+ href="#managing-therapy"
92
+ id="task-managing-therapy"
93
+ statusText="Not started"
94
+ tagColour="grey"
95
+ title="Managing therapy or monitoring a health condition"
96
+ >
97
+ Questions about any help you need to monitor changes in your health condition, take medication or do therapy at home.
98
+ </TaskList.Item>
99
+ </TaskList.Group>
100
+ )
101
+ };
@@ -0,0 +1,70 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import TaskList from './TaskList';
5
+
6
+ const meta = {
7
+ title: 'Components/TaskList/TaskList.Item',
8
+ component: TaskList.Item,
9
+ argTypes: {
10
+ href: argTypes.href(),
11
+ id: {
12
+ description: 'The value of the task\'s id attribute',
13
+ type: 'string'
14
+ },
15
+ isComplete: {
16
+ control: 'boolean',
17
+ description: 'Whether the task is complete'
18
+ },
19
+ statusText: {
20
+ description: 'The text to use for the task\'s status tag',
21
+ type: 'string'
22
+ },
23
+ tagColour: argTypes.tagColour(),
24
+ title: {
25
+ description: 'The title of the task item',
26
+ type: {
27
+ name: 'string',
28
+ required: true
29
+ }
30
+ },
31
+ children: argTypes.children()
32
+ },
33
+ args: {
34
+ title: 'Medications'
35
+ }
36
+ } satisfies Meta<typeof TaskList.Item>;
37
+
38
+ export default meta;
39
+ type Story = StoryObj<typeof meta>;
40
+
41
+ export const Default: Story = {
42
+
43
+ };
44
+
45
+ export const WithTextDescription: Story = {
46
+ args: {
47
+ children: 'Tell us about any medication you need.'
48
+ }
49
+ };
50
+
51
+ export const WithStatusTag: Story = {
52
+ args: {
53
+ children: 'Tell us about any medication you need.',
54
+ statusText: 'Cannot start yet'
55
+ }
56
+ };
57
+
58
+ export const WithLink: Story = {
59
+ args: {
60
+ children: 'Tell us about any medication you need.',
61
+ href: '#medication'
62
+ }
63
+ };
64
+
65
+ export const Complete: Story = {
66
+ args: {
67
+ children: 'Tell us about any medication you need.',
68
+ isComplete: true
69
+ }
70
+ };
@@ -4,7 +4,7 @@ import argTypes from '../../../.storybook/sgdsArgTypes';
4
4
  import TaskList from './TaskList';
5
5
 
6
6
  const meta = {
7
- title: 'Components/Task list',
7
+ title: 'Components/TaskList',
8
8
  component: TaskList,
9
9
  argTypes: {
10
10
  headingId: {
@@ -219,10 +219,29 @@ test('task with custom link element', () => {
219
219
  });
220
220
 
221
221
  test('completed task has green tag', () => {
222
+ const STATUS_TEXT = 'MY STATUS TEXT';
223
+
224
+ render(
225
+ <TaskList.Item
226
+ id={TASK_ITEM.id}
227
+ statusText={STATUS_TEXT}
228
+ title={TASK_ITEM.title}
229
+ isComplete
230
+ >
231
+ {TASK_SUMMARY_CONTENT}
232
+ </TaskList.Item>
233
+ );
234
+
235
+ const tag = document.querySelector('.ds_tag');
236
+
237
+ expect(tag).toHaveClass('ds_tag--green');
238
+ expect(tag?.textContent).toEqual(STATUS_TEXT);
239
+ });
240
+
241
+ test('completed task has default text if no statusText set', () => {
222
242
  render(
223
243
  <TaskList.Item
224
244
  id={TASK_ITEM.id}
225
- statusText={TASK_ITEM.statusText}
226
245
  title={TASK_ITEM.title}
227
246
  isComplete
228
247
  >
@@ -233,6 +252,7 @@ test('completed task has green tag', () => {
233
252
  const tag = document.querySelector('.ds_tag');
234
253
 
235
254
  expect(tag).toHaveClass('ds_tag--green');
255
+ expect(tag?.textContent).toEqual('Completed');
236
256
  });
237
257
 
238
258
  test('specific tag colour', () => {
@@ -18,6 +18,7 @@ const TaskItem = ({
18
18
  }: SGDS.Component.TaskList.Item) => {
19
19
  if (isComplete) {
20
20
  tagColour = 'green';
21
+ statusText = statusText || 'Completed'
21
22
  }
22
23
 
23
24
  const LINK_CLASS = 'ds_task-list__task-link';