@scottish-government/designsystem-react 0.12.0 → 0.12.1

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 (272) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/common/AbstractNotificationBanner/AbstractNotificationBanner.d.ts +9 -0
  3. package/dist/common/AbstractNotificationBanner/AbstractNotificationBanner.jsx +62 -0
  4. package/dist/common/AbstractNotificationBanner/index.d.ts +1 -0
  5. package/dist/common/AbstractNotificationBanner/index.js +8 -0
  6. package/dist/common/ActionLink/ActionLink.d.ts +5 -0
  7. package/dist/common/ActionLink/ActionLink.jsx +19 -0
  8. package/dist/common/ActionLink/index.d.ts +1 -0
  9. package/dist/common/ActionLink/index.js +8 -0
  10. package/dist/common/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
  11. package/dist/common/ConditionalWrapper/ConditionalWrapper.jsx +8 -0
  12. package/dist/common/ConditionalWrapper/index.d.ts +1 -0
  13. package/dist/common/ConditionalWrapper/index.js +8 -0
  14. package/dist/common/FileIcon/FileIcon.d.ts +6 -0
  15. package/dist/common/FileIcon/FileIcon.jsx +46 -0
  16. package/dist/common/FileIcon/index.d.ts +1 -0
  17. package/dist/common/FileIcon/index.js +8 -0
  18. package/dist/common/HintText/HintText.d.ts +5 -0
  19. package/dist/common/HintText/HintText.jsx +9 -0
  20. package/dist/common/HintText/index.d.ts +1 -0
  21. package/dist/common/HintText/index.js +8 -0
  22. package/dist/common/Icon/Icon.d.ts +6 -0
  23. package/dist/common/Icon/Icon.jsx +51 -0
  24. package/dist/common/Icon/index.d.ts +1 -0
  25. package/dist/common/Icon/index.js +8 -0
  26. package/dist/common/ScreenReaderText/ScreenReaderText.d.ts +5 -0
  27. package/dist/common/ScreenReaderText/ScreenReaderText.jsx +9 -0
  28. package/dist/common/ScreenReaderText/index.d.ts +1 -0
  29. package/dist/common/ScreenReaderText/index.js +8 -0
  30. package/dist/common/WrapperTag/WrapperTag.d.ts +8 -0
  31. package/dist/common/WrapperTag/WrapperTag.jsx +11 -0
  32. package/dist/common/WrapperTag/index.d.ts +1 -0
  33. package/dist/common/WrapperTag/index.js +8 -0
  34. package/dist/common/index.d.ts +8 -0
  35. package/dist/common/index.js +22 -0
  36. package/dist/components/Accordion/index.d.ts +1 -0
  37. package/dist/components/Accordion/index.js +8 -0
  38. package/dist/components/AspectBox/index.d.ts +1 -0
  39. package/dist/components/AspectBox/index.js +8 -0
  40. package/dist/components/BackToTop/index.d.ts +1 -0
  41. package/dist/components/BackToTop/index.js +8 -0
  42. package/dist/components/Breadcrumbs/index.d.ts +1 -0
  43. package/dist/components/Breadcrumbs/index.js +8 -0
  44. package/dist/components/Button/ButtonGroup.d.ts +5 -0
  45. package/dist/components/Button/ButtonGroup.jsx +13 -0
  46. package/dist/components/Button/index.d.ts +2 -0
  47. package/dist/components/Button/index.js +10 -0
  48. package/dist/components/CategoryItem/index.d.ts +1 -0
  49. package/dist/components/CategoryItem/index.js +8 -0
  50. package/dist/components/CategoryList/index.d.ts +1 -0
  51. package/dist/components/CategoryList/index.js +8 -0
  52. package/dist/components/Checkbox/index.d.ts +2 -0
  53. package/dist/components/Checkbox/index.js +10 -0
  54. package/dist/components/ConfirmationMessage/index.d.ts +1 -0
  55. package/dist/components/ConfirmationMessage/index.js +8 -0
  56. package/dist/components/ContentsNav/index.d.ts +1 -0
  57. package/dist/components/ContentsNav/index.js +8 -0
  58. package/dist/components/CookieBanner/index.d.ts +1 -0
  59. package/dist/components/CookieBanner/index.js +8 -0
  60. package/dist/components/DatePicker/DatePicker.jsx +2 -2
  61. package/dist/components/DatePicker/index.d.ts +1 -0
  62. package/dist/components/DatePicker/index.js +8 -0
  63. package/dist/components/Details/index.d.ts +1 -0
  64. package/dist/components/Details/index.js +8 -0
  65. package/dist/components/ErrorMessage/index.d.ts +1 -0
  66. package/dist/components/ErrorMessage/index.js +8 -0
  67. package/dist/components/ErrorSummary/index.d.ts +1 -0
  68. package/dist/components/ErrorSummary/index.js +8 -0
  69. package/dist/components/FeatureHeader/FeatureHeader.d.ts +13 -0
  70. package/dist/components/FeatureHeader/FeatureHeader.jsx +70 -0
  71. package/dist/components/FeatureHeader/index.d.ts +1 -0
  72. package/dist/components/FeatureHeader/index.js +8 -0
  73. package/dist/components/FileDownload/index.d.ts +1 -0
  74. package/dist/components/FileDownload/index.js +8 -0
  75. package/dist/components/HideThisPage/index.d.ts +1 -0
  76. package/dist/components/HideThisPage/index.js +8 -0
  77. package/dist/components/InsetText/index.d.ts +1 -0
  78. package/dist/components/InsetText/index.js +8 -0
  79. package/dist/components/NotificationBanner/index.d.ts +1 -0
  80. package/dist/components/NotificationBanner/index.js +8 -0
  81. package/dist/components/NotificationPanel/index.d.ts +1 -0
  82. package/dist/components/NotificationPanel/index.js +8 -0
  83. package/dist/components/PageHeader/index.d.ts +1 -0
  84. package/dist/components/PageHeader/index.js +8 -0
  85. package/dist/components/PageMetadata/index.d.ts +1 -0
  86. package/dist/components/PageMetadata/index.js +8 -0
  87. package/dist/components/Pagination/index.d.ts +1 -0
  88. package/dist/components/Pagination/index.js +8 -0
  89. package/dist/components/PhaseBanner/index.d.ts +1 -0
  90. package/dist/components/PhaseBanner/index.js +8 -0
  91. package/dist/components/Question/Question.jsx +1 -1
  92. package/dist/components/Question/index.d.ts +1 -0
  93. package/dist/components/Question/index.js +8 -0
  94. package/dist/components/RadioButton/index.d.ts +2 -0
  95. package/dist/components/RadioButton/index.js +10 -0
  96. package/dist/components/SearchFacets/index.d.ts +1 -0
  97. package/dist/components/SearchFacets/index.js +8 -0
  98. package/dist/components/SearchFilters/SearchFilters.jsx +6 -6
  99. package/dist/components/SearchFilters/index.d.ts +1 -0
  100. package/dist/components/SearchFilters/index.js +8 -0
  101. package/dist/components/SearchResult/SearchResult.jsx +2 -2
  102. package/dist/components/SearchResult/index.d.ts +1 -0
  103. package/dist/components/SearchResult/index.js +8 -0
  104. package/dist/components/SearchSort/SearchSort.jsx +2 -2
  105. package/dist/components/SearchSort/index.d.ts +1 -0
  106. package/dist/components/SearchSort/index.js +8 -0
  107. package/dist/components/Select/Select.jsx +1 -1
  108. package/dist/components/Select/index.d.ts +1 -0
  109. package/dist/components/Select/index.js +8 -0
  110. package/dist/components/SequentialNavigation/index.d.ts +1 -0
  111. package/dist/components/SequentialNavigation/index.js +8 -0
  112. package/dist/components/SideNavigation/index.d.ts +1 -0
  113. package/dist/components/SideNavigation/index.js +8 -0
  114. package/dist/components/SiteFooter/index.d.ts +1 -0
  115. package/dist/components/SiteFooter/index.js +8 -0
  116. package/dist/components/SiteHeader/SiteHeader.jsx +1 -1
  117. package/dist/components/SiteHeader/index.d.ts +1 -0
  118. package/dist/components/SiteHeader/index.js +8 -0
  119. package/dist/components/SiteNavigation/index.d.ts +1 -0
  120. package/dist/components/SiteNavigation/index.js +8 -0
  121. package/dist/components/SiteSearch/SiteSearch.jsx +1 -1
  122. package/dist/components/SiteSearch/index.d.ts +1 -0
  123. package/dist/components/SiteSearch/index.js +8 -0
  124. package/dist/components/SkipLinks/index.d.ts +1 -0
  125. package/dist/components/SkipLinks/index.js +8 -0
  126. package/dist/components/SummaryCard/index.d.ts +1 -0
  127. package/dist/components/SummaryCard/index.js +8 -0
  128. package/dist/components/SummaryList/index.d.ts +1 -0
  129. package/dist/components/SummaryList/index.js +8 -0
  130. package/dist/components/Table/index.d.ts +1 -0
  131. package/dist/components/Table/index.js +8 -0
  132. package/dist/components/Tabs/index.d.ts +1 -0
  133. package/dist/components/Tabs/index.js +8 -0
  134. package/dist/components/Tag/index.d.ts +1 -0
  135. package/dist/components/Tag/index.js +8 -0
  136. package/dist/components/TaskList/TaskList.jsx +1 -1
  137. package/dist/components/TaskList/index.d.ts +1 -0
  138. package/dist/components/TaskList/index.js +8 -0
  139. package/dist/components/TextInput/TextInput.jsx +2 -2
  140. package/dist/components/TextInput/index.d.ts +1 -0
  141. package/dist/components/TextInput/index.js +8 -0
  142. package/dist/components/Textarea/Textarea.jsx +1 -1
  143. package/dist/components/Textarea/index.d.ts +1 -0
  144. package/dist/components/Textarea/index.js +8 -0
  145. package/dist/components/WarningText/index.d.ts +1 -0
  146. package/dist/components/WarningText/index.js +8 -0
  147. package/dist/components/index.d.ts +46 -0
  148. package/dist/components/index.js +101 -0
  149. package/dist/hooks/index.d.ts +1 -0
  150. package/dist/hooks/index.js +8 -0
  151. package/dist/hooks/useTracking/index.d.ts +1 -0
  152. package/dist/hooks/useTracking/index.js +8 -0
  153. package/dist/hooks/useTracking/useTracking.d.ts +1 -0
  154. package/dist/hooks/useTracking/useTracking.js +21 -0
  155. package/dist/images/index.d.ts +2 -0
  156. package/dist/images/index.js +38 -0
  157. package/dist/index.d.ts +4 -0
  158. package/dist/index.js +40 -0
  159. package/dist/tsconfig.tsbuildinfo +1 -1
  160. package/package.json +23 -21
  161. package/src/common/{AbstractNotificationBanner.test.tsx → AbstractNotificationBanner/AbstractNotificationBanner.test.tsx} +1 -1
  162. package/src/common/{AbstractNotificationBanner.tsx → AbstractNotificationBanner/AbstractNotificationBanner.tsx} +2 -2
  163. package/src/common/AbstractNotificationBanner/index.ts +1 -0
  164. package/src/common/ActionLink/index.ts +1 -0
  165. package/src/common/ConditionalWrapper/index.ts +1 -0
  166. package/src/common/{FileIcon.tsx → FileIcon/FileIcon.tsx} +1 -1
  167. package/src/common/FileIcon/index.ts +1 -0
  168. package/src/common/HintText/index.ts +1 -0
  169. package/src/common/{Icon.tsx → Icon/Icon.tsx} +1 -1
  170. package/src/common/Icon/index.ts +1 -0
  171. package/src/common/ScreenReaderText/index.ts +1 -0
  172. package/src/common/WrapperTag/index.ts +1 -0
  173. package/src/common/index.ts +8 -0
  174. package/src/components/Accordion/index.ts +1 -0
  175. package/src/components/AspectBox/index.ts +1 -0
  176. package/src/components/BackToTop/index.ts +1 -0
  177. package/src/components/Breadcrumbs/index.ts +1 -0
  178. package/src/components/{ButtonGroup → Button}/ButtonGroup.stories.tsx +1 -1
  179. package/src/components/Button/index.ts +2 -0
  180. package/src/components/CategoryItem/index.ts +1 -0
  181. package/src/components/CategoryList/CategoryList.stories.tsx +1 -1
  182. package/src/components/CategoryList/CategoryList.test.tsx +1 -1
  183. package/src/components/CategoryList/index.ts +1 -0
  184. package/src/components/Checkbox/index.ts +2 -0
  185. package/src/components/ConfirmationMessage/index.ts +1 -0
  186. package/src/components/ContentsNav/index.ts +1 -0
  187. package/src/components/CookieBanner/CookieBanner.Buttons.stories.tsx +1 -1
  188. package/src/components/CookieBanner/CookieBanner.stories.tsx +1 -1
  189. package/src/components/CookieBanner/index.ts +1 -0
  190. package/src/components/DatePicker/DatePicker.tsx +2 -2
  191. package/src/components/DatePicker/index.ts +1 -0
  192. package/src/components/Details/index.ts +1 -0
  193. package/src/components/ErrorMessage/index.ts +1 -0
  194. package/src/components/ErrorSummary/index.ts +1 -0
  195. package/src/components/FeatureHeader/FeatureHeader.stories.tsx +60 -0
  196. package/src/components/FeatureHeader/FeatureHeader.tsx +94 -0
  197. package/src/components/FeatureHeader/index.ts +1 -0
  198. package/src/components/FileDownload/index.ts +1 -0
  199. package/src/components/HideThisPage/index.ts +1 -0
  200. package/src/components/InsetText/index.ts +1 -0
  201. package/src/components/NotificationBanner/index.ts +1 -0
  202. package/src/components/NotificationPanel/index.ts +1 -0
  203. package/src/components/PageHeader/PageHeader.stories.tsx +1 -1
  204. package/src/components/PageHeader/index.ts +1 -0
  205. package/src/components/PageMetadata/index.ts +1 -0
  206. package/src/components/Pagination/index.ts +1 -0
  207. package/src/components/PhaseBanner/index.ts +1 -0
  208. package/src/components/Question/Question.stories.tsx +2 -3
  209. package/src/components/Question/Question.tsx +2 -2
  210. package/src/components/Question/index.ts +1 -0
  211. package/src/components/RadioButton/RadioGroup.stories.tsx +1 -2
  212. package/src/components/RadioButton/RadioGroup.test.tsx +1 -2
  213. package/src/components/RadioButton/index.ts +2 -0
  214. package/src/components/SearchFacets/index.ts +1 -0
  215. package/src/components/SearchFilters/SearchFilters.Panel.stories.tsx +2 -2
  216. package/src/components/SearchFilters/SearchFilters.stories.tsx +2 -2
  217. package/src/components/SearchFilters/SearchFilters.test.tsx +1 -1
  218. package/src/components/SearchFilters/SearchFilters.tsx +4 -4
  219. package/src/components/SearchFilters/index.ts +1 -0
  220. package/src/components/SearchResult/SearchResult.tsx +2 -2
  221. package/src/components/SearchResult/index.ts +1 -0
  222. package/src/components/SearchSort/SearchSort.tsx +2 -2
  223. package/src/components/SearchSort/index.ts +1 -0
  224. package/src/components/Select/Select.tsx +1 -1
  225. package/src/components/Select/index.ts +1 -0
  226. package/src/components/SequentialNavigation/index.ts +1 -0
  227. package/src/components/SideNavigation/index.ts +1 -0
  228. package/src/components/SiteFooter/index.ts +1 -0
  229. package/src/components/SiteHeader/SiteHeader.stories.tsx +3 -3
  230. package/src/components/SiteHeader/SiteHeader.test.tsx +3 -3
  231. package/src/components/SiteHeader/SiteHeader.tsx +1 -1
  232. package/src/components/SiteHeader/index.ts +1 -0
  233. package/src/components/SiteNavigation/index.ts +1 -0
  234. package/src/components/SiteSearch/SiteSearch.tsx +1 -1
  235. package/src/components/SiteSearch/index.ts +1 -0
  236. package/src/components/SkipLinks/index.ts +1 -0
  237. package/src/components/SummaryCard/SummaryCard.stories.tsx +1 -1
  238. package/src/components/SummaryCard/SummaryCard.test.tsx +2 -2
  239. package/src/components/SummaryCard/index.ts +1 -0
  240. package/src/components/SummaryList/index.ts +1 -0
  241. package/src/components/Table/index.ts +1 -0
  242. package/src/components/Tabs/index.ts +1 -0
  243. package/src/components/Tag/index.ts +1 -0
  244. package/src/components/TaskList/TaskList.tsx +1 -1
  245. package/src/components/TaskList/index.ts +1 -0
  246. package/src/components/TextInput/TextInput.tsx +2 -2
  247. package/src/components/TextInput/index.ts +1 -0
  248. package/src/components/Textarea/Textarea.tsx +1 -1
  249. package/src/components/Textarea/index.ts +1 -0
  250. package/src/components/WarningText/index.ts +1 -0
  251. package/src/components/index.ts +46 -0
  252. package/src/hooks/index.ts +1 -0
  253. package/src/hooks/useTracking/index.ts +1 -0
  254. package/src/images/index.ts +2 -0
  255. package/src/index.ts +4 -0
  256. package/vite.config.ts +2 -1
  257. /package/src/common/{ActionLink.test.tsx → ActionLink/ActionLink.test.tsx} +0 -0
  258. /package/src/common/{ActionLink.tsx → ActionLink/ActionLink.tsx} +0 -0
  259. /package/src/common/{ConditionalWrapper.test.tsx → ConditionalWrapper/ConditionalWrapper.test.tsx} +0 -0
  260. /package/src/common/{ConditionalWrapper.tsx → ConditionalWrapper/ConditionalWrapper.tsx} +0 -0
  261. /package/src/common/{FileIcon.test.tsx → FileIcon/FileIcon.test.tsx} +0 -0
  262. /package/src/common/{HintText.test.tsx → HintText/HintText.test.tsx} +0 -0
  263. /package/src/common/{HintText.tsx → HintText/HintText.tsx} +0 -0
  264. /package/src/common/{Icon.test.tsx → Icon/Icon.test.tsx} +0 -0
  265. /package/src/common/{ScreenReaderText.test.tsx → ScreenReaderText/ScreenReaderText.test.tsx} +0 -0
  266. /package/src/common/{ScreenReaderText.tsx → ScreenReaderText/ScreenReaderText.tsx} +0 -0
  267. /package/src/common/{WrapperTag.test.tsx → WrapperTag/WrapperTag.test.tsx} +0 -0
  268. /package/src/common/{WrapperTag.tsx → WrapperTag/WrapperTag.tsx} +0 -0
  269. /package/src/components/{ButtonGroup → Button}/ButtonGroup.test.tsx +0 -0
  270. /package/src/components/{ButtonGroup → Button}/ButtonGroup.tsx +0 -0
  271. /package/src/hooks/{useTracking.test.tsx → useTracking/useTracking.test.tsx} +0 -0
  272. /package/src/hooks/{useTracking.ts → useTracking/useTracking.ts} +0 -0
@@ -0,0 +1,60 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import argTypes from '../../../.storybook/sgdsArgTypes';
3
+
4
+ import FeatureHeader from './FeatureHeader';
5
+
6
+ //@ts-ignore
7
+ import coo from '../../../static/images/highland-cow.jpg';
8
+
9
+ const meta = {
10
+ title: 'Components/Feature header',
11
+ component: FeatureHeader,
12
+ argTypes: {
13
+ children: argTypes.children()
14
+ },
15
+ args: {
16
+ children: <>
17
+ <FeatureHeader.Content>
18
+ <h1>Design standards</h1>
19
+ <p>The patterns included here have been developed for use by government, public sector and third sector non-commercial organisations in Scotland.</p>
20
+ </FeatureHeader.Content>
21
+ <FeatureHeader.Media>
22
+ <img
23
+ className="ds_feature-header__image"
24
+ alt="A highland cow nuzzling its calf"
25
+ src={coo}
26
+ />
27
+ </FeatureHeader.Media>
28
+ </>
29
+ }
30
+ } satisfies Meta<typeof FeatureHeader>;
31
+
32
+ export default meta;
33
+ type Story = StoryObj<typeof meta>;
34
+
35
+ export const Default: Story = {
36
+ args: {
37
+ backgroundColour: 'TERTIARY'
38
+ }
39
+ };
40
+
41
+ export const FullWidth: Story = {
42
+ args: {
43
+ backgroundColour: 'TERTIARY',
44
+ isFullWidth: true
45
+ }
46
+ };
47
+
48
+ export const TopAlign: Story = {
49
+ args: {
50
+ backgroundColour: 'TERTIARY',
51
+ isTopAligned: true
52
+ }
53
+ };
54
+
55
+ export const WideText: Story = {
56
+ args: {
57
+ backgroundColour: 'TERTIARY',
58
+ isWideText: true
59
+ }
60
+ };
@@ -0,0 +1,94 @@
1
+ import ConditionalWrapper from "../../common/ConditionalWrapper";
2
+
3
+ const Content = ({ children, className, ...props }: any /* SGDS.Component.FeatureHeader.Primary*/) => {
4
+ return (
5
+ <div className={['ds_feature-header__primary', className].join(' ')} {...props}>
6
+ {children}
7
+ </div>
8
+ );
9
+ }
10
+
11
+ const Media = ({ children, className, isCover, noPadding, ...props }: any /* SGDS.Component.FeatureHeader.Secondary*/) => {
12
+ return (
13
+ <div className={[
14
+ 'ds_feature-header__secondary',
15
+ isCover && 'ds_feature-header__secondary--cover',
16
+ noPadding && 'ds_feature-header__secondary--no-padding',
17
+ className
18
+ ].join(' ')} {...props}>
19
+ {children}
20
+ </div>
21
+ );
22
+ }
23
+
24
+ const FeatureHeader = ({
25
+ backgroundColour = 'NONE',
26
+ children,
27
+ className,
28
+ isFullWidth,
29
+ isTopAligned,
30
+ isWideText,
31
+ ...props
32
+ }: any /* SGDS.Component.FeatureHeader*/) => {
33
+ let backgroundColorClass = '';
34
+
35
+ switch (backgroundColour) {
36
+ case 'BRAND':
37
+ backgroundColorClass = 'ds_feature-header--background';
38
+ break;
39
+ case 'SECONDARY':
40
+ backgroundColorClass = 'ds_feature-header--background-secondary';
41
+ break;
42
+ case 'TERTIARY':
43
+ backgroundColorClass = 'ds_feature-header--background-tertiary';
44
+ break;
45
+ case 'NONE':
46
+ break;
47
+ default:
48
+ backgroundColorClass = '';
49
+ break;
50
+ }
51
+
52
+ return (
53
+ <header
54
+ className={[
55
+ 'ds_feature-header',
56
+ isFullWidth && 'ds_feature-header--fullwidth',
57
+ isTopAligned && 'ds_feature-header--top',
58
+ isWideText && 'ds_feature-header--wide',
59
+ backgroundColorClass,
60
+ className
61
+ ].join(' ')}
62
+ {...props}
63
+ >
64
+ <ConditionalWrapper
65
+ condition={isFullWidth}
66
+ wrapper={(children: React.JSX.Element) => <div className="ds_wrapper">{children}</div>}
67
+ >
68
+ {children}
69
+ </ConditionalWrapper>
70
+ </header>
71
+ );
72
+ };
73
+
74
+ FeatureHeader.displayName = 'FeatureHeader';
75
+ Content.displayName = 'FeatureHeader.Content';
76
+ Media.displayName = 'FeatureHeader.Media';
77
+ FeatureHeader.Content = Content;
78
+ FeatureHeader.Media = Media;
79
+
80
+ export default FeatureHeader;
81
+
82
+
83
+ /*
84
+
85
+ <FeatureHeader backgroundColour="NONE/BRAND/SECONDARY/TERTIARY" isFullWidth isWideText isTopAligned>
86
+ <FeatureHeader.Content>
87
+ {children}
88
+ </FeatureHeader.Content>
89
+ <FeatureHeader.Media noPadding isCover>
90
+ {children}
91
+ </FeatureHeader.Media>
92
+ </FeatureHeader>
93
+
94
+ */
@@ -0,0 +1 @@
1
+ export { default } from './FeatureHeader';
@@ -0,0 +1 @@
1
+ export { default } from './FileDownload';
@@ -0,0 +1 @@
1
+ export { default } from './HideThisPage';
@@ -0,0 +1 @@
1
+ export { default } from './InsetText';
@@ -0,0 +1 @@
1
+ export { default } from './NotificationBanner';
@@ -0,0 +1 @@
1
+ export { default } from './NotificationPanel';
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import PageHeader from './PageHeader';
5
- import Metadata from '../PageMetadata/PageMetadata';
5
+ import Metadata from '../PageMetadata';
6
6
 
7
7
  const meta = {
8
8
  title: 'Components/PageHeader',
@@ -0,0 +1 @@
1
+ export { default } from './PageHeader';
@@ -0,0 +1 @@
1
+ export { default } from './PageMetadata';
@@ -0,0 +1 @@
1
+ export { default } from './Pagination';
@@ -0,0 +1 @@
1
+ export { default } from './PhaseBanner';
@@ -2,9 +2,8 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import Question from './Question';
5
- import TextInput from '../TextInput/TextInput';
6
- import Checkbox from '../Checkbox/Checkbox';
7
- import CheckboxGroup from '../Checkbox/CheckboxGroup';
5
+ import TextInput from '../TextInput';
6
+ import Checkbox, { CheckboxGroup } from '../Checkbox';
8
7
 
9
8
  const meta = {
10
9
  title: 'Components/Question',
@@ -1,5 +1,5 @@
1
- import ErrorMessage from '../ErrorMessage/ErrorMessage';
2
- import HintText from '../../common/HintText';
1
+ import ErrorMessage from '../ErrorMessage';
2
+ import HintText from '../../common/HintText'
3
3
  import WrapperTag from '../../common/WrapperTag';
4
4
 
5
5
  const Question = function ({
@@ -0,0 +1 @@
1
+ export { default } from './Question';
@@ -1,8 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
- import RadioButton from '../RadioButton/RadioButton';
5
- import RadioGroup from './RadioGroup';
4
+ import RadioButton, { RadioGroup } from '../RadioButton';
6
5
 
7
6
  const meta = {
8
7
  title: 'Components/Radio/Radio group',
@@ -1,7 +1,6 @@
1
1
  import { test, expect } from 'vitest';
2
2
  import { render, screen } from '@testing-library/react';
3
- import RadioButton from './RadioButton';
4
- import RadioGroup from './RadioGroup';
3
+ import RadioButton, { RadioGroup } from '../RadioButton';
5
4
 
6
5
  test('radio group renders correctly', () => {
7
6
  render(
@@ -0,0 +1,2 @@
1
+ export { default } from './RadioButton';
2
+ export { default as RadioGroup } from './RadioGroup';
@@ -0,0 +1 @@
1
+ export { default } from './SearchFacets';
@@ -2,8 +2,8 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import Filters from './SearchFilters';
5
- import DatePicker from '../DatePicker/DatePicker';
6
- import Checkbox from '../Checkbox/Checkbox';
5
+ import DatePicker from '../DatePicker';
6
+ import Checkbox from '../Checkbox';
7
7
 
8
8
  const meta = {
9
9
  title: 'Components/Search results/Filters/Filter panel',
@@ -2,8 +2,8 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import Filters from './SearchFilters';
5
- import DatePicker from '../DatePicker/DatePicker';
6
- import Checkbox from '../Checkbox/Checkbox';
5
+ import DatePicker from '../DatePicker';
6
+ import Checkbox from '../Checkbox';
7
7
 
8
8
 
9
9
  const meta = {
@@ -1,7 +1,7 @@
1
1
  import { test, expect } from 'vitest';
2
2
  import { render, screen, within } from '@testing-library/react';
3
3
  import Filters from './SearchFilters';
4
- import Checkbox from '../Checkbox/Checkbox';
4
+ import Checkbox from '../Checkbox';
5
5
 
6
6
  test('search filters boilerplate renders correctly', () => {
7
7
  render(
@@ -1,8 +1,8 @@
1
- import Accordion from "../Accordion/Accordion";
2
- import Button from "../Button/Button";
3
- import SkipLinks from "../SkipLinks/SkipLinks";
1
+ import Accordion from "../Accordion";
2
+ import Button from "../Button";
3
+ import SkipLinks from "../SkipLinks";
4
4
  import ConditionalWrapper from "../../common/ConditionalWrapper";
5
- import CheckboxGroup from "../Checkbox/CheckboxGroup";
5
+ import { CheckboxGroup } from "../Checkbox";
6
6
 
7
7
  export const FilterPanel = ({
8
8
  activeFilterCount = 0,
@@ -0,0 +1 @@
1
+ export { default } from './SearchFilters';
@@ -1,7 +1,7 @@
1
1
  import { Children, createContext, useContext } from 'react';
2
2
  import ConditionalWrapper from '../../common/ConditionalWrapper';
3
- import AspectBox from '../AspectBox/AspectBox';
4
- import Metadata from '../PageMetadata/PageMetadata';
3
+ import AspectBox from '../AspectBox';
4
+ import Metadata from '../PageMetadata';
5
5
 
6
6
  const SearchResultLinkHrefContext = createContext('');
7
7
 
@@ -0,0 +1 @@
1
+ export { default } from './SearchResult';
@@ -1,6 +1,6 @@
1
1
  import { AllHTMLAttributes } from "react";
2
- import Button from "../Button/Button";
3
- import Select from "../Select/Select";
2
+ import Button from "../Button";
3
+ import Select from "../Select";
4
4
 
5
5
  const Option = ({
6
6
  children,
@@ -0,0 +1 @@
1
+ export { default } from './SearchSort';
@@ -1,4 +1,4 @@
1
- import ErrorMessage from '../ErrorMessage/ErrorMessage';
1
+ import ErrorMessage from '../ErrorMessage';
2
2
  import HintText from '../../common/HintText';
3
3
 
4
4
  const Select = function ({
@@ -0,0 +1 @@
1
+ export { default } from './Select';
@@ -0,0 +1 @@
1
+ export { default } from './SequentialNavigation';
@@ -0,0 +1 @@
1
+ export { default } from './SideNavigation';
@@ -0,0 +1 @@
1
+ export { default } from './SiteFooter';
@@ -2,9 +2,9 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import SiteHeader from './SiteHeader';
5
- import SiteSearch from '../SiteSearch/SiteSearch';
6
- import SiteNavigation from '../SiteNavigation/SiteNavigation';
7
- import PhaseBanner from '../PhaseBanner/PhaseBanner';
5
+ import SiteSearch from '../SiteSearch';
6
+ import SiteNavigation from '../SiteNavigation';
7
+ import PhaseBanner from '../PhaseBanner';
8
8
 
9
9
  const meta = {
10
10
  title: 'Components/SiteHeader',
@@ -1,9 +1,9 @@
1
1
  import { test, expect } from 'vitest';
2
2
  import { render, screen, within } from '@testing-library/react';
3
3
  import SiteHeader from './SiteHeader';
4
- import SiteNavigation from '../SiteNavigation/SiteNavigation';
5
- import SiteSearch from '../SiteSearch/SiteSearch';
6
- import PhaseBanner from '../PhaseBanner/PhaseBanner';
4
+ import SiteNavigation from '../SiteNavigation';
5
+ import SiteSearch from '../SiteSearch';
6
+ import PhaseBanner from '../PhaseBanner';
7
7
 
8
8
  test('site header renders correctly (maximal, testing markup structure)', () => {
9
9
  render(
@@ -1,6 +1,6 @@
1
1
  import React, { Children, useEffect, useRef } from 'react';
2
2
  import Icon from '../../common/Icon';
3
- import SiteNavigation from '../SiteNavigation/SiteNavigation';
3
+ import SiteNavigation from '../SiteNavigation';
4
4
 
5
5
  // @ts-ignore
6
6
  import DSMobileMenu from '@scottish-government/design-system/src/components/site-navigation/site-navigation';
@@ -0,0 +1 @@
1
+ export { default } from './SiteHeader';
@@ -0,0 +1 @@
1
+ export { default } from './SiteNavigation';
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
  // @ts-ignore
3
3
  import DSAutocomplete from '@scottish-government/design-system/src/components/autocomplete/autocomplete';
4
- import Button from '../Button/Button';
4
+ import Button from '../Button';
5
5
 
6
6
  const SiteSearch = function ({
7
7
  action = '/search',
@@ -0,0 +1 @@
1
+ export { default } from './SiteSearch';
@@ -0,0 +1 @@
1
+ export { default } from './SkipLinks';
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import argTypes from '../../../.storybook/sgdsArgTypes';
3
3
 
4
4
  import SummaryCard from './SummaryCard';
5
- import SummaryList from '../SummaryList/SummaryList';
5
+ import SummaryList from '../SummaryList';
6
6
 
7
7
  const meta = {
8
8
  title: 'Components/SummaryCard',
@@ -1,7 +1,7 @@
1
1
  import { test, expect, vi } from 'vitest';
2
- import { render, screen, within, fireEvent } from '@testing-library/react';
2
+ import { render, screen, within } from '@testing-library/react';
3
3
  import SummaryCard from './SummaryCard';
4
- import SummaryList from '../SummaryList/SummaryList';
4
+ import SummaryList from '../SummaryList';
5
5
 
6
6
  const ONCLICK_FUNCTION = vi.fn();
7
7
 
@@ -0,0 +1 @@
1
+ export { default } from './SummaryCard';
@@ -0,0 +1 @@
1
+ export { default } from './SummaryList';
@@ -0,0 +1 @@
1
+ export { default } from './Table';
@@ -0,0 +1 @@
1
+ export { default } from './Tabs';
@@ -0,0 +1 @@
1
+ export { default } from './Tag';
@@ -2,7 +2,7 @@ import { Children } from 'react';
2
2
  import ConditionalWrapper from '../../common/ConditionalWrapper';
3
3
  import HintText from '../../common/HintText';
4
4
  import ScreenReaderText from '../../common/ScreenReaderText';
5
- import Tag from '../Tag/Tag';
5
+ import Tag from '../Tag';
6
6
 
7
7
  const TaskItem = ({
8
8
  children,
@@ -0,0 +1 @@
1
+ export { default } from './TaskList';
@@ -1,9 +1,9 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
  // @ts-ignore
3
3
  import DSCharacterCount from '@scottish-government/design-system/src/forms/character-count/character-count';
4
- import Button from '../Button/Button';
4
+ import Button from '../Button';
5
5
  import ConditionalWrapper from '../../common/ConditionalWrapper';
6
- import ErrorMessage from '../ErrorMessage/ErrorMessage';
6
+ import ErrorMessage from '../ErrorMessage';
7
7
  import HintText from '../../common/HintText';
8
8
 
9
9
  const TextInput = ({
@@ -0,0 +1 @@
1
+ export { default } from './TextInput';
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
2
2
  // @ts-ignore
3
3
  import DSCharacterCount from '@scottish-government/design-system/src/forms/character-count/character-count';
4
4
  import ConditionalWrapper from '../../common/ConditionalWrapper';
5
- import ErrorMessage from '../ErrorMessage/ErrorMessage';
5
+ import ErrorMessage from '../ErrorMessage';
6
6
  import HintText from '../../common/HintText';
7
7
 
8
8
  const Textarea = ({
@@ -0,0 +1 @@
1
+ export { default } from './Textarea';
@@ -0,0 +1 @@
1
+ export { default } from './WarningText';
@@ -0,0 +1,46 @@
1
+ export { default as Accordion } from "./Accordion";
2
+ export { default as AspectBox } from "./AspectBox";
3
+ export { default as BackToTop } from "./BackToTop";
4
+ export { default as Breadcrumbs } from "./Breadcrumbs";
5
+ export { default as Button, ButtonGroup } from "./Button";
6
+ export { default as CategoryItem } from "./CategoryItem";
7
+ export { default as CategoryList } from "./CategoryList";
8
+ export { default as Checkbox, CheckboxGroup } from "./Checkbox";
9
+ export { default as ConfirmationMessage } from "./ConfirmationMessage";
10
+ export { default as ContentsNav } from "./ContentsNav";
11
+ export { default as CookieBanner } from "./CookieBanner";
12
+ export { default as DatePicker } from "./DatePicker";
13
+ export { default as Details } from "./Details";
14
+ export { default as ErrorMessage } from "./ErrorMessage";
15
+ export { default as ErrorSummary } from "./ErrorSummary";
16
+ export { default as FileDownload } from "./FileDownload";
17
+ export { default as HideThisPage } from "./HideThisPage";
18
+ export { default as InsetText } from "./InsetText";
19
+ export { default as NotificationBanner } from "./NotificationBanner";
20
+ export { default as NotificationPanel } from "./NotificationPanel";
21
+ export { default as PageHeader } from "./PageHeader";
22
+ export { default as PageMetadata } from "./PageMetadata/";
23
+ export { default as Pagination } from "./Pagination";
24
+ export { default as PhaseBanner } from "./PhaseBanner";
25
+ export { default as Question } from "./Question";
26
+ export { default as RadioButton, RadioGroup } from "./RadioButton";
27
+ export { default as SearchFacets } from "./SearchFacets";
28
+ export { default as SearchFilters } from "./SearchFilters";
29
+ export { default as SearchResult } from "./SearchResult";
30
+ export { default as SearchSort } from "./SearchSort";
31
+ export { default as Select } from "./Select";
32
+ export { default as SequentialNavigation } from "./SequentialNavigation";
33
+ export { default as SideNavigation } from "./SideNavigation";
34
+ export { default as SiteFooter } from "./SiteFooter";
35
+ export { default as SiteHeader } from "./SiteHeader";
36
+ export { default as SiteSearch } from "./SiteSearch";
37
+ export { default as SkipLinks } from "./SkipLinks";
38
+ export { default as SummaryCard } from "./SummaryCard";
39
+ export { default as SummaryList } from "./SummaryList";
40
+ export { default as Table } from "./Table";
41
+ export { default as Tabs } from "./Tabs";
42
+ export { default as Tag } from "./Tag";
43
+ export { default as TaskList } from "./TaskList";
44
+ export { default as Textarea } from "./Textarea";
45
+ export { default as TextInput } from "./TextInput";
46
+ export { default as WarningText } from "./WarningText";
@@ -0,0 +1 @@
1
+ export { default as useTracking } from "./useTracking";
@@ -0,0 +1 @@
1
+ export { default } from './useTracking';
@@ -0,0 +1,2 @@
1
+ export * as documents from './documents';
2
+ export * as icons from './icons';
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * as common from './common';
2
+ export * as components from './components';
3
+ export * as hooks from './hooks';
4
+ export * as images from './images';
package/vite.config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="vitest/config" />
2
2
  import { defineConfig } from 'vitest/config';
3
3
  import react from "@vitejs/plugin-react-swc";
4
+ import { playwright } from '@vitest/browser-playwright';
4
5
  import path from 'node:path';
5
6
  import { fileURLToPath } from 'node:url';
6
7
  import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
@@ -38,7 +39,7 @@ export default defineConfig({
38
39
  browser: {
39
40
  enabled: true,
40
41
  headless: true,
41
- provider: 'playwright',
42
+ provider: playwright(),
42
43
  instances: [{
43
44
  browser: 'chromium'
44
45
  }]