@scottish-government/designsystem-react 0.10.2 → 0.11.0

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 (66) hide show
  1. package/@types/components/Accordion.d.ts +3 -2
  2. package/@types/components/ButtonGroup.d.ts +5 -0
  3. package/@types/components/RadioButton.d.ts +2 -2
  4. package/@types/components/SearchFacets.d.ts +18 -0
  5. package/@types/components/SearchFilters.d.ts +14 -0
  6. package/@types/components/SearchResult.d.ts +30 -0
  7. package/@types/components/SearchSort.d.ts +9 -0
  8. package/@types/components/SideNavigation.d.ts +1 -1
  9. package/CHANGELOG.md +31 -5
  10. package/dist/components/Accordion/Accordion.jsx +8 -3
  11. package/dist/components/ButtonGroup/ButtonGroup.jsx +13 -0
  12. package/dist/components/RadioButton/RadioGroup.jsx +1 -1
  13. package/dist/components/SearchFacets/SearchFacets.jsx +101 -0
  14. package/dist/components/SearchFilters/SearchFilters.jsx +63 -0
  15. package/dist/components/SearchResult/SearchResult.jsx +93 -0
  16. package/dist/components/SearchSort/SearchSort.jsx +28 -0
  17. package/dist/components/SequentialNavigation/SequentialNavigation.jsx +0 -1
  18. package/dist/components/SideNavigation/SideNavigation.jsx +2 -2
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +2 -2
  21. package/src/components/Accordion/Accordion.Item.stories.tsx +10 -9
  22. package/src/components/Accordion/Accordion.stories.tsx +4 -4
  23. package/src/components/Accordion/Accordion.test.tsx +48 -14
  24. package/src/components/Accordion/Accordion.tsx +12 -1
  25. package/src/components/Breadcrumbs/Breadcrumbs.Item.stories.tsx +8 -1
  26. package/src/components/Button/Button.stories.tsx +1 -1
  27. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +41 -0
  28. package/src/components/ButtonGroup/ButtonGroup.test.tsx +45 -0
  29. package/src/components/ButtonGroup/ButtonGroup.tsx +20 -0
  30. package/src/components/ContentsNav/ContentsNav.Item.stories.tsx +8 -0
  31. package/src/components/ErrorSummary/ErrorSummary.Item.stories.tsx +7 -0
  32. package/src/components/PageMetadata/PageMetadata.Item.stories.tsx +9 -0
  33. package/src/components/RadioButton/RadioGroup.tsx +2 -2
  34. package/src/components/SearchFacets/SearchFacets.Group.stories.tsx +56 -0
  35. package/src/components/SearchFacets/SearchFacets.Item.stories.tsx +53 -0
  36. package/src/components/SearchFacets/SearchFacets.stories.tsx +38 -0
  37. package/src/components/SearchFacets/SearchFacets.test.tsx +214 -0
  38. package/src/components/SearchFacets/SearchFacets.tsx +99 -0
  39. package/src/components/SearchFilters/SearchFilters.Panel.stories.tsx +201 -0
  40. package/src/components/SearchFilters/SearchFilters.stories.tsx +137 -0
  41. package/src/components/SearchFilters/SearchFilters.test.tsx +161 -0
  42. package/src/components/SearchFilters/SearchFilters.tsx +89 -0
  43. package/src/components/SearchResult/SearchResult.stories.tsx +111 -0
  44. package/src/components/SearchResult/SearchResult.test.tsx +215 -0
  45. package/src/components/SearchResult/SearchResult.tsx +137 -0
  46. package/src/components/SearchSort/SearchSort.stories.tsx +32 -0
  47. package/src/components/SearchSort/SearchSort.test.tsx +129 -0
  48. package/src/components/SearchSort/SearchSort.tsx +45 -0
  49. package/src/components/SequentialNavigation/SequentialNavigation.Next.stories.tsx +1 -1
  50. package/src/components/SequentialNavigation/SequentialNavigation.Previous.stories.tsx +1 -1
  51. package/src/components/SequentialNavigation/SequentialNavigation.tsx +0 -1
  52. package/src/components/SideNavigation/SideNavigation.Item.stories.tsx +9 -0
  53. package/src/components/SideNavigation/SideNavigation.List.stories.tsx +7 -0
  54. package/src/components/SideNavigation/SideNavigation.tsx +2 -1
  55. package/src/components/SiteFooter/SiteFooter.License.stories.tsx +7 -0
  56. package/src/components/SiteFooter/SiteFooter.Link.stories.tsx +9 -0
  57. package/src/components/SiteFooter/SiteFooter.Org.stories.tsx +7 -0
  58. package/src/components/SiteNavigation/SiteNavigation.Item.stories.tsx +10 -0
  59. package/src/components/SkipLinks/SkipLinks.Item.stories.tsx +11 -1
  60. package/src/components/SummaryCard/SummaryCard.Action.stories.tsx +7 -0
  61. package/src/components/SummaryCard/SummaryCard.stories.tsx +7 -0
  62. package/src/components/SummaryList/SummaryList.Item.stories.tsx +15 -0
  63. package/src/components/SummaryList/SummaryList.Value.stories.tsx +5 -2
  64. package/src/components/Tabs/Tabs.Item.stories.tsx +4 -1
  65. package/src/components/TaskList/TaskList.Group.stories.tsx +9 -0
  66. package/src/components/TaskList/TaskList.Item.stories.tsx +7 -0
@@ -6,7 +6,17 @@ import SiteNavigation from './SiteNavigation';
6
6
  const meta = {
7
7
  title: 'Components/SiteNavigation/SiteNavigation.Item',
8
8
  component: SiteNavigation.Item,
9
+ decorators: [
10
+ Story => (
11
+ <nav className="ds_site-navigation">
12
+ <ul className="ds_site-navigation__list">
13
+ <Story />
14
+ </ul>
15
+ </nav>
16
+ )
17
+ ],
9
18
  argTypes: {
19
+ href: argTypes.href({type: {name: 'string', required: true}}),
10
20
  linkComponent: argTypes.linkComponent(),
11
21
  children: argTypes.children()
12
22
  },
@@ -6,10 +6,20 @@ import SkipLinks from './SkipLinks';
6
6
  const meta = {
7
7
  title: 'Components/SkipLinks/SkipLinks.Link',
8
8
  component: SkipLinks.Link,
9
+ decorators: [
10
+ Story => (
11
+ <ul className="ds_skip-links">
12
+ <Story />
13
+ </ul>
14
+ )
15
+ ],
9
16
  argTypes: {
10
17
  fragmentId: {
11
18
  description: 'ID of the destination element',
12
- type: 'string'
19
+ type: {
20
+ name: 'string',
21
+ required: true
22
+ }
13
23
  },
14
24
  children: argTypes.children()
15
25
  },
@@ -6,6 +6,13 @@ import SummaryCard from './SummaryCard';
6
6
  const meta = {
7
7
  title: 'Components/SummaryCard/SummaryCard.Action',
8
8
  component: SummaryCard.Action,
9
+ decorators: [
10
+ Story => (
11
+ <div className="ds_summary-card__header">
12
+ <Story />
13
+ </div>
14
+ )
15
+ ],
9
16
  argTypes: {
10
17
  href: argTypes.href(),
11
18
  onClick: argTypes.onClick(),
@@ -9,6 +9,13 @@ const meta = {
9
9
  component: SummaryCard,
10
10
  argTypes: {
11
11
  headingLevel: argTypes.headingLevel(),
12
+ title: {
13
+ description: 'The title of the summary card',
14
+ type: {
15
+ name: 'string',
16
+ required: true
17
+ }
18
+ },
12
19
  children: argTypes.children()
13
20
  },
14
21
  args: {
@@ -6,10 +6,25 @@ import SummaryList from './SummaryList';
6
6
  const meta = {
7
7
  title: 'Components/SummaryList/SummaryList.Item',
8
8
  component: SummaryList.Item,
9
+ decorators: [
10
+ Story => (
11
+ <ul>
12
+ <Story />
13
+ </ul>
14
+ )
15
+ ],
9
16
  argTypes: {
17
+ Title: {
18
+ description: 'Title of the summary list item.',
19
+ type: {
20
+ name: 'string',
21
+ required: true
22
+ }
23
+ },
10
24
  children: argTypes.children()
11
25
  },
12
26
  args: {
27
+ title: 'Contact details',
13
28
  children: [
14
29
  <SummaryList.Value name="Email">
15
30
  email@gov.scot
@@ -8,8 +8,11 @@ const meta = {
8
8
  component: SummaryList.Value,
9
9
  argTypes: {
10
10
  name: {
11
- description: 'Title of the summary list item',
12
- type: 'string'
11
+ description: 'Name of the summary value',
12
+ type: {
13
+ name: 'string',
14
+ required: true
15
+ }
13
16
  },
14
17
  children: argTypes.children()
15
18
  },
@@ -9,7 +9,10 @@ const meta = {
9
9
  argTypes: {
10
10
  tabLabel: {
11
11
  description: '',
12
- type: 'string'
12
+ type: {
13
+ name: 'string',
14
+ required: true
15
+ }
13
16
  },
14
17
  children: argTypes.children()
15
18
  },
@@ -6,6 +6,15 @@ import TaskList from './TaskList';
6
6
  const meta = {
7
7
  title: 'Components/TaskList/TaskList.Group',
8
8
  component: TaskList.Group,
9
+ decorators: [
10
+ Story => (
11
+ <div className="ds_task-list">
12
+ <ul>
13
+ <Story />
14
+ </ul>
15
+ </div>
16
+ )
17
+ ],
9
18
  argTypes: {
10
19
  headingId: {
11
20
  description: 'ID of the task list\'s heading element',
@@ -6,6 +6,13 @@ import TaskList from './TaskList';
6
6
  const meta = {
7
7
  title: 'Components/TaskList/TaskList.Item',
8
8
  component: TaskList.Item,
9
+ decorators: [
10
+ Story => (
11
+ <ul>
12
+ <Story />
13
+ </ul>
14
+ )
15
+ ],
9
16
  argTypes: {
10
17
  href: argTypes.href(),
11
18
  id: {