@scottish-government/designsystem-react 0.13.0 → 1.0.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 (354) hide show
  1. package/.storybook/sgdsArgTypes.ts +23 -0
  2. package/CHANGELOG.md +23 -0
  3. package/LICENSE.txt +21 -0
  4. package/README.md +4 -5
  5. package/dist/common/AbstractNotificationBanner/AbstractNotificationBanner.d.ts +3 -2
  6. package/dist/common/AbstractNotificationBanner/AbstractNotificationBanner.jsx +8 -7
  7. package/dist/common/AbstractNotificationBanner/types.d.ts +13 -0
  8. package/dist/common/AbstractNotificationBanner/types.js +2 -0
  9. package/dist/common/ActionLink/ActionLink.d.ts +2 -1
  10. package/dist/common/ActionLink/types.d.ts +7 -0
  11. package/dist/common/ActionLink/types.js +2 -0
  12. package/dist/common/ConditionalWrapper/ConditionalWrapper.d.ts +2 -1
  13. package/dist/common/ConditionalWrapper/ConditionalWrapper.jsx +4 -2
  14. package/dist/common/ConditionalWrapper/types.d.ts +4 -0
  15. package/dist/common/ConditionalWrapper/types.js +2 -0
  16. package/dist/common/FileIcon/FileIcon.d.ts +2 -1
  17. package/dist/common/FileIcon/types.d.ts +6 -0
  18. package/dist/common/FileIcon/types.js +2 -0
  19. package/dist/common/HintText/HintText.d.ts +2 -1
  20. package/dist/common/HintText/HintText.jsx +3 -3
  21. package/dist/common/HintText/types.d.ts +4 -0
  22. package/dist/common/HintText/types.js +2 -0
  23. package/dist/common/Icon/Icon.d.ts +2 -1
  24. package/dist/common/Icon/Icon.jsx +3 -2
  25. package/dist/common/Icon/types.d.ts +8 -0
  26. package/dist/common/Icon/types.js +2 -0
  27. package/dist/common/ScreenReaderText/ScreenReaderText.d.ts +1 -1
  28. package/dist/common/WrapperTag/WrapperTag.d.ts +385 -1
  29. package/dist/common/WrapperTag/WrapperTag.jsx +5 -2
  30. package/dist/common/WrapperTag/types.d.ts +3 -0
  31. package/dist/common/WrapperTag/types.js +2 -0
  32. package/dist/components/Accordion/Accordion.d.ts +3 -2
  33. package/dist/components/Accordion/Accordion.jsx +12 -11
  34. package/dist/components/Accordion/types.d.ts +11 -0
  35. package/dist/components/Accordion/types.js +2 -0
  36. package/dist/components/AspectBox/AspectBox.d.ts +2 -1
  37. package/dist/components/AspectBox/AspectBox.jsx +3 -9
  38. package/dist/components/AspectBox/types.d.ts +3 -0
  39. package/dist/components/AspectBox/types.js +2 -0
  40. package/dist/components/BackToTop/BackToTop.d.ts +2 -1
  41. package/dist/components/BackToTop/BackToTop.jsx +4 -3
  42. package/dist/components/BackToTop/types.d.ts +3 -0
  43. package/dist/components/BackToTop/types.js +2 -0
  44. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -2
  45. package/dist/components/Breadcrumbs/Breadcrumbs.jsx +6 -2
  46. package/dist/components/Breadcrumbs/types.d.ts +5 -0
  47. package/dist/components/Breadcrumbs/types.js +2 -0
  48. package/dist/components/Button/Button.d.ts +2 -1
  49. package/dist/components/Button/Button.jsx +4 -3
  50. package/dist/components/Button/ButtonGroup.d.ts +2 -1
  51. package/dist/components/Button/ButtonGroup.jsx +9 -4
  52. package/dist/components/Button/types.d.ts +20 -0
  53. package/dist/components/Button/types.js +2 -0
  54. package/dist/components/Card/Card.d.ts +34 -0
  55. package/dist/components/Card/Card.jsx +118 -0
  56. package/dist/components/Card/index.d.ts +1 -0
  57. package/dist/components/Card/index.js +8 -0
  58. package/dist/components/Card/types.d.ts +26 -0
  59. package/dist/components/Card/types.js +2 -0
  60. package/dist/components/CategoryItem/CategoryItem.d.ts +2 -1
  61. package/dist/components/CategoryItem/CategoryItem.jsx +8 -5
  62. package/dist/components/CategoryItem/types.d.ts +9 -0
  63. package/dist/components/CategoryItem/types.js +2 -0
  64. package/dist/components/CategoryList/CategoryList.d.ts +2 -1
  65. package/dist/components/CategoryList/CategoryList.jsx +3 -2
  66. package/dist/components/CategoryList/types.d.ts +5 -0
  67. package/dist/components/CategoryList/types.js +2 -0
  68. package/dist/components/Checkbox/Checkbox.d.ts +2 -1
  69. package/dist/components/Checkbox/Checkbox.jsx +4 -3
  70. package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
  71. package/dist/components/Checkbox/CheckboxGroup.jsx +5 -4
  72. package/dist/components/Checkbox/types.d.ts +7 -0
  73. package/dist/components/Checkbox/types.js +2 -0
  74. package/dist/components/ConfirmationMessage/ConfirmationMessage.d.ts +2 -1
  75. package/dist/components/ConfirmationMessage/ConfirmationMessage.jsx +3 -2
  76. package/dist/components/ConfirmationMessage/types.d.ts +6 -0
  77. package/dist/components/ConfirmationMessage/types.js +2 -0
  78. package/dist/components/ContentsNav/ContentsNav.d.ts +3 -2
  79. package/dist/components/ContentsNav/ContentsNav.jsx +7 -5
  80. package/dist/components/ContentsNav/types.d.ts +9 -0
  81. package/dist/components/ContentsNav/types.js +2 -0
  82. package/dist/components/CookieBanner/CookieBanner.d.ts +3 -2
  83. package/dist/components/CookieBanner/CookieBanner.jsx +13 -3
  84. package/dist/components/DatePicker/DatePicker.d.ts +2 -1
  85. package/dist/components/DatePicker/DatePicker.jsx +7 -7
  86. package/dist/components/DatePicker/types.d.ts +18 -0
  87. package/dist/components/DatePicker/types.js +2 -0
  88. package/dist/components/Details/Details.d.ts +2 -1
  89. package/dist/components/Details/Details.jsx +6 -2
  90. package/dist/components/Details/types.d.ts +4 -0
  91. package/dist/components/Details/types.js +2 -0
  92. package/dist/components/ErrorMessage/ErrorMessage.d.ts +2 -1
  93. package/dist/components/ErrorMessage/ErrorMessage.jsx +6 -2
  94. package/dist/components/ErrorMessage/types.d.ts +3 -0
  95. package/dist/components/ErrorMessage/types.js +2 -0
  96. package/dist/components/ErrorSummary/ErrorSummary.d.ts +3 -2
  97. package/dist/components/ErrorSummary/ErrorSummary.jsx +6 -2
  98. package/dist/components/ErrorSummary/types.d.ts +8 -0
  99. package/dist/components/ErrorSummary/types.js +2 -0
  100. package/dist/components/FeatureHeader/FeatureHeader.d.ts +7 -5
  101. package/dist/components/FeatureHeader/FeatureHeader.jsx +87 -50
  102. package/dist/components/FeatureHeader/types.d.ts +12 -0
  103. package/dist/components/FeatureHeader/types.js +2 -0
  104. package/dist/components/FileDownload/FileDownload.d.ts +2 -1
  105. package/dist/components/FileDownload/FileDownload.jsx +4 -3
  106. package/dist/components/FileDownload/types.d.ts +10 -0
  107. package/dist/components/FileDownload/types.js +2 -0
  108. package/dist/components/HideThisPage/HideThisPage.d.ts +2 -1
  109. package/dist/components/HideThisPage/HideThisPage.jsx +5 -4
  110. package/dist/components/HideThisPage/types.d.ts +3 -0
  111. package/dist/components/HideThisPage/types.js +2 -0
  112. package/dist/components/InsetText/InsetText.d.ts +1 -1
  113. package/dist/components/InsetText/InsetText.jsx +6 -2
  114. package/dist/components/NotificationBanner/NotificationBanner.d.ts +3 -2
  115. package/dist/components/NotificationBanner/NotificationBanner.jsx +5 -4
  116. package/dist/components/NotificationPanel/NotificationPanel.d.ts +2 -1
  117. package/dist/components/NotificationPanel/NotificationPanel.jsx +3 -2
  118. package/dist/components/NotificationPanel/types.d.ts +6 -0
  119. package/dist/components/NotificationPanel/types.js +2 -0
  120. package/dist/components/NotificationTag/NotificationTag.d.ts +6 -0
  121. package/dist/components/NotificationTag/NotificationTag.jsx +20 -0
  122. package/dist/components/NotificationTag/index.d.ts +1 -0
  123. package/dist/components/NotificationTag/index.js +8 -0
  124. package/dist/components/NotificationTag/types.d.ts +5 -0
  125. package/dist/components/NotificationTag/types.js +2 -0
  126. package/dist/components/PageHeader/PageHeader.d.ts +2 -1
  127. package/dist/components/PageHeader/PageHeader.jsx +6 -2
  128. package/dist/components/PageHeader/types.d.ts +5 -0
  129. package/dist/components/PageHeader/types.js +2 -0
  130. package/dist/components/PageMetadata/PageMetadata.d.ts +3 -2
  131. package/dist/components/PageMetadata/PageMetadata.jsx +8 -4
  132. package/dist/components/PageMetadata/types.d.ts +6 -0
  133. package/dist/components/PageMetadata/types.js +2 -0
  134. package/dist/components/Pagination/Pagination.d.ts +3 -2
  135. package/dist/components/Pagination/Pagination.jsx +7 -5
  136. package/dist/components/Pagination/types.d.ts +18 -0
  137. package/dist/components/Pagination/types.js +2 -0
  138. package/dist/components/PhaseBanner/PhaseBanner.d.ts +2 -1
  139. package/dist/components/PhaseBanner/PhaseBanner.jsx +3 -2
  140. package/dist/components/PhaseBanner/types.d.ts +3 -0
  141. package/dist/components/PhaseBanner/types.js +2 -0
  142. package/dist/components/Question/Question.d.ts +2 -1
  143. package/dist/components/Question/Question.jsx +4 -3
  144. package/dist/components/Question/types.d.ts +9 -0
  145. package/dist/components/Question/types.js +2 -0
  146. package/dist/components/RadioButton/RadioButton.d.ts +2 -1
  147. package/dist/components/RadioButton/RadioButton.jsx +4 -3
  148. package/dist/components/RadioButton/RadioGroup.d.ts +2 -1
  149. package/dist/components/RadioButton/RadioGroup.jsx +3 -2
  150. package/dist/components/RadioButton/types.d.ts +10 -0
  151. package/dist/components/RadioButton/types.js +2 -0
  152. package/dist/components/SearchFacets/SearchFacets.d.ts +4 -3
  153. package/dist/components/SearchFacets/SearchFacets.jsx +3 -2
  154. package/dist/components/SearchFacets/types.d.ts +12 -0
  155. package/dist/components/SearchFacets/types.js +2 -0
  156. package/dist/components/SearchFilters/SearchFilters.d.ts +5 -4
  157. package/dist/components/SearchFilters/types.d.ts +12 -0
  158. package/dist/components/SearchFilters/types.js +2 -0
  159. package/dist/components/SearchResult/SearchResult.d.ts +8 -11
  160. package/dist/components/SearchResult/SearchResult.jsx +6 -7
  161. package/dist/components/SearchResult/types.d.ts +11 -0
  162. package/dist/components/SearchResult/types.js +2 -0
  163. package/dist/components/SearchSort/SearchSort.d.ts +2 -1
  164. package/dist/components/SearchSort/SearchSort.jsx +3 -2
  165. package/dist/components/SearchSort/types.d.ts +7 -0
  166. package/dist/components/SearchSort/types.js +2 -0
  167. package/dist/components/Select/Select.d.ts +2 -1
  168. package/dist/components/Select/Select.jsx +4 -3
  169. package/dist/components/Select/types.d.ts +6 -0
  170. package/dist/components/Select/types.js +2 -0
  171. package/dist/components/SequentialNavigation/SequentialNavigation.d.ts +4 -3
  172. package/dist/components/SequentialNavigation/SequentialNavigation.jsx +10 -6
  173. package/dist/components/SequentialNavigation/types.d.ts +10 -0
  174. package/dist/components/SequentialNavigation/types.js +2 -0
  175. package/dist/components/SideNavigation/SideNavigation.d.ts +4 -3
  176. package/dist/components/SideNavigation/SideNavigation.jsx +10 -7
  177. package/dist/components/SideNavigation/types.d.ts +13 -0
  178. package/dist/components/SideNavigation/types.js +2 -0
  179. package/dist/components/SiteFooter/SiteFooter.d.ts +6 -5
  180. package/dist/components/SiteFooter/SiteFooter.jsx +4 -3
  181. package/dist/components/SiteFooter/types.d.ts +16 -0
  182. package/dist/components/SiteFooter/types.js +2 -0
  183. package/dist/components/SiteHeader/SiteHeader.d.ts +6 -5
  184. package/dist/components/SiteHeader/SiteHeader.jsx +1 -1
  185. package/dist/components/SiteHeader/types.d.ts +20 -0
  186. package/dist/components/SiteHeader/types.js +2 -0
  187. package/dist/components/SiteNavigation/SiteNavigation.d.ts +3 -2
  188. package/dist/components/SiteNavigation/SiteNavigation.jsx +12 -4
  189. package/dist/components/SiteNavigation/types.d.ts +9 -0
  190. package/dist/components/SiteNavigation/types.js +2 -0
  191. package/dist/components/SiteSearch/SiteSearch.d.ts +2 -1
  192. package/dist/components/SiteSearch/SiteSearch.jsx +12 -11
  193. package/dist/components/SiteSearch/types.d.ts +17 -0
  194. package/dist/components/SiteSearch/types.js +2 -0
  195. package/dist/components/SkipLinks/SkipLinks.d.ts +3 -2
  196. package/dist/components/SkipLinks/SkipLinks.jsx +4 -4
  197. package/dist/components/SkipLinks/types.d.ts +8 -0
  198. package/dist/components/SkipLinks/types.js +2 -0
  199. package/dist/components/SummaryCard/SummaryCard.d.ts +4 -2
  200. package/dist/components/SummaryCard/SummaryCard.jsx +5 -4
  201. package/dist/components/SummaryCard/types.d.ts +5 -0
  202. package/dist/components/SummaryCard/types.js +2 -0
  203. package/dist/components/SummaryList/SummaryList.d.ts +6 -4
  204. package/dist/components/SummaryList/SummaryList.jsx +5 -4
  205. package/dist/components/SummaryList/types.d.ts +6 -0
  206. package/dist/components/SummaryList/types.js +2 -0
  207. package/dist/components/Table/Table.d.ts +2 -1
  208. package/dist/components/Table/Table.jsx +5 -4
  209. package/dist/components/Table/types.d.ts +6 -0
  210. package/dist/components/Table/types.js +2 -0
  211. package/dist/components/Tabs/Tabs.d.ts +3 -2
  212. package/dist/components/Tabs/Tabs.jsx +6 -5
  213. package/dist/components/Tabs/types.d.ts +16 -0
  214. package/dist/components/Tabs/types.js +2 -0
  215. package/dist/components/Tag/Tag.d.ts +2 -1
  216. package/dist/components/Tag/Tag.jsx +7 -3
  217. package/dist/components/Tag/types.d.ts +4 -0
  218. package/dist/components/Tag/types.js +2 -0
  219. package/dist/components/TaskList/TaskList.d.ts +4 -3
  220. package/dist/components/TaskList/TaskList.jsx +11 -8
  221. package/dist/components/TaskList/types.d.ts +17 -0
  222. package/dist/components/TaskList/types.js +2 -0
  223. package/dist/components/TextInput/TextInput.d.ts +2 -1
  224. package/dist/components/TextInput/TextInput.jsx +10 -9
  225. package/dist/components/TextInput/types.d.ts +11 -0
  226. package/dist/components/TextInput/types.js +2 -0
  227. package/dist/components/Textarea/Textarea.d.ts +2 -1
  228. package/dist/components/Textarea/Textarea.jsx +6 -5
  229. package/dist/components/WarningText/WarningText.d.ts +1 -1
  230. package/dist/components/WarningText/WarningText.jsx +6 -2
  231. package/dist/hooks/useTracking/useTracking.js +0 -1
  232. package/dist/index.d.ts +4 -0
  233. package/dist/index.js +40 -0
  234. package/dist/shared-types.d.ts +35 -0
  235. package/dist/shared-types.js +2 -0
  236. package/dist/tsconfig.tsbuildinfo +1 -0
  237. package/package.json +5 -3
  238. package/src/common/AbstractNotificationBanner/AbstractNotificationBanner.tsx +8 -6
  239. package/src/common/Icon/Icon.tsx +3 -2
  240. package/src/components/Accordion/Accordion.test.tsx +11 -0
  241. package/src/components/Accordion/Accordion.tsx +11 -10
  242. package/src/components/AspectBox/AspectBox.tsx +4 -11
  243. package/src/components/BackToTop/BackToTop.test.tsx +21 -1
  244. package/src/components/BackToTop/BackToTop.tsx +4 -3
  245. package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -2
  246. package/src/components/Button/Button.tsx +4 -3
  247. package/src/components/Button/ButtonGroup.stories.tsx +22 -0
  248. package/src/components/Button/ButtonGroup.test.tsx +21 -0
  249. package/src/components/Button/ButtonGroup.tsx +6 -3
  250. package/src/components/Button/types.ts +1 -0
  251. package/src/components/Card/Card.stories.tsx +446 -0
  252. package/src/components/Card/Card.test.tsx +282 -0
  253. package/src/components/Card/Card.tsx +208 -0
  254. package/src/components/Card/index.ts +1 -0
  255. package/src/components/Card/types.ts +30 -0
  256. package/src/components/CategoryItem/CategoryItem.tsx +3 -2
  257. package/src/components/CategoryList/CategoryList.tsx +3 -2
  258. package/src/components/Checkbox/Checkbox.test.tsx +30 -0
  259. package/src/components/Checkbox/Checkbox.tsx +3 -3
  260. package/src/components/Checkbox/CheckboxGroup.test.tsx +10 -0
  261. package/src/components/Checkbox/CheckboxGroup.tsx +5 -4
  262. package/src/components/ConfirmationMessage/ConfirmationMessage.tsx +3 -2
  263. package/src/components/ContentsNav/ContentsNav.tsx +8 -5
  264. package/src/components/CookieBanner/CookieBanner.test.tsx +18 -1
  265. package/src/components/CookieBanner/CookieBanner.tsx +5 -4
  266. package/src/components/DatePicker/DatePicker.test.tsx +52 -14
  267. package/src/components/DatePicker/DatePicker.tsx +6 -7
  268. package/src/components/DatePicker/types.ts +2 -3
  269. package/src/components/Details/Details.tsx +3 -2
  270. package/src/components/ErrorMessage/ErrorMessage.tsx +3 -2
  271. package/src/components/ErrorSummary/ErrorSummary.tsx +3 -2
  272. package/src/components/FeatureHeader/FeatureHeader.stories.tsx +223 -0
  273. package/src/components/FeatureHeader/FeatureHeader.test.tsx +298 -0
  274. package/src/components/FeatureHeader/FeatureHeader.tsx +119 -0
  275. package/src/components/FeatureHeader/index.ts +1 -0
  276. package/src/components/FeatureHeader/types.ts +13 -0
  277. package/src/components/FileDownload/FileDownload.test.tsx +1 -5
  278. package/src/components/FileDownload/FileDownload.tsx +4 -3
  279. package/src/components/HideThisPage/HideThisPage.test.tsx +12 -1
  280. package/src/components/HideThisPage/HideThisPage.tsx +5 -4
  281. package/src/components/InsetText/InsetText.tsx +4 -2
  282. package/src/components/NotificationBanner/NotificationBanner.test.tsx +10 -0
  283. package/src/components/NotificationBanner/NotificationBanner.tsx +4 -3
  284. package/src/components/NotificationPanel/NotificationPanel.tsx +3 -2
  285. package/src/components/NotificationTag/NotificationTag.stories.tsx +68 -0
  286. package/src/components/NotificationTag/NotificationTag.test.tsx +70 -0
  287. package/src/components/NotificationTag/NotificationTag.tsx +32 -0
  288. package/src/components/NotificationTag/index.ts +1 -0
  289. package/src/components/NotificationTag/types.ts +5 -0
  290. package/src/components/PageHeader/PageHeader.tsx +3 -2
  291. package/src/components/PageMetadata/PageMetadata.tsx +5 -4
  292. package/src/components/Pagination/Pagination.test.tsx +20 -0
  293. package/src/components/Pagination/Pagination.tsx +7 -5
  294. package/src/components/PhaseBanner/PhaseBanner.tsx +3 -2
  295. package/src/components/Question/Question.tsx +3 -2
  296. package/src/components/Question/types.ts +2 -2
  297. package/src/components/RadioButton/RadioButton.test.tsx +30 -0
  298. package/src/components/RadioButton/RadioButton.tsx +3 -3
  299. package/src/components/RadioButton/RadioGroup.tsx +3 -2
  300. package/src/components/SearchFacets/SearchFacets.stories.tsx +1 -1
  301. package/src/components/SearchFacets/SearchFacets.tsx +3 -2
  302. package/src/components/SearchResult/SearchResult.stories.tsx +14 -13
  303. package/src/components/SearchResult/SearchResult.test.tsx +5 -4
  304. package/src/components/SearchResult/SearchResult.tsx +6 -7
  305. package/src/components/SearchSort/SearchSort.tsx +3 -2
  306. package/src/components/Select/Select.test.tsx +42 -0
  307. package/src/components/Select/Select.tsx +3 -2
  308. package/src/components/SequentialNavigation/SequentialNavigation.tsx +7 -6
  309. package/src/components/SideNavigation/SideNavigation.test.tsx +24 -0
  310. package/src/components/SideNavigation/SideNavigation.tsx +10 -7
  311. package/src/components/SiteFooter/SiteFooter.tsx +3 -2
  312. package/src/components/SiteHeader/SiteHeader.test.tsx +29 -16
  313. package/src/components/SiteHeader/SiteHeader.tsx +1 -1
  314. package/src/components/SiteNavigation/SiteNavigation.test.tsx +16 -1
  315. package/src/components/SiteNavigation/SiteNavigation.tsx +9 -4
  316. package/src/components/SiteSearch/SiteSearch.test.tsx +22 -0
  317. package/src/components/SiteSearch/SiteSearch.tsx +10 -9
  318. package/src/components/SiteSearch/types.ts +7 -1
  319. package/src/components/SkipLinks/SkipLinks.tsx +4 -4
  320. package/src/components/SummaryCard/SummaryCard.tsx +3 -2
  321. package/src/components/SummaryList/SummaryList.tsx +4 -4
  322. package/src/components/Table/Table.test.tsx +36 -0
  323. package/src/components/Table/Table.tsx +5 -4
  324. package/src/components/Tabs/Tabs.test.tsx +14 -0
  325. package/src/components/Tabs/Tabs.tsx +6 -5
  326. package/src/components/Tag/Tag.tsx +4 -3
  327. package/src/components/TaskList/TaskList.tsx +5 -4
  328. package/src/components/TextInput/TextInput.test.tsx +53 -1
  329. package/src/components/TextInput/TextInput.tsx +12 -7
  330. package/src/components/Textarea/Textarea.test.tsx +53 -1
  331. package/src/components/Textarea/Textarea.tsx +5 -4
  332. package/src/components/WarningText/WarningText.tsx +4 -2
  333. package/src/hooks/useTracking/useTracking.ts +0 -1
  334. package/src/images/icons/arrow_upward.tsx +10 -10
  335. package/src/images/icons/calendar_today.tsx +10 -10
  336. package/src/images/icons/cancel.tsx +8 -8
  337. package/src/images/icons/check_circle.tsx +10 -10
  338. package/src/images/icons/chevron_left.tsx +10 -10
  339. package/src/images/icons/chevron_right.tsx +10 -10
  340. package/src/images/icons/close.tsx +10 -10
  341. package/src/images/icons/description.tsx +10 -10
  342. package/src/images/icons/double_chevron_left.tsx +8 -8
  343. package/src/images/icons/double_chevron_right.tsx +8 -8
  344. package/src/images/icons/error.tsx +10 -10
  345. package/src/images/icons/expand_less.tsx +10 -10
  346. package/src/images/icons/expand_more.tsx +10 -10
  347. package/src/images/icons/list.tsx +13 -13
  348. package/src/images/icons/menu.tsx +10 -10
  349. package/src/images/icons/priority_high.tsx +11 -11
  350. package/src/images/icons/search.tsx +10 -10
  351. package/src/shared-types.ts +3 -3
  352. package/static/images/illustration.svg +502 -0
  353. package/tsconfig.json +0 -3
  354. package/vite.config.ts +4 -0
@@ -134,6 +134,48 @@ test('select with change function', () => {
134
134
  expect(ONCHANGE_FUNCTION).toHaveBeenCalled();
135
135
  });
136
136
 
137
+ test('select with onBlur that is not a function', () => {
138
+ render(
139
+ <Select
140
+ id={SELECT_ID}
141
+ label={LABEL_TEXT}
142
+ // @ts-expect-error onBlur is not a function
143
+ onBlur='foo'
144
+ >
145
+ {OPTIONS}
146
+ </Select>
147
+ );
148
+
149
+ const select = screen.getByRole('combobox');
150
+
151
+ fireEvent.blur(select);
152
+
153
+ // todo: assertion
154
+ // success indicated by no errors thrown
155
+ // error would be thrown on an untestable thread
156
+ });
157
+
158
+ test('select with onChange that is not a function', () => {
159
+ render(
160
+ <Select
161
+ id={SELECT_ID}
162
+ label={LABEL_TEXT}
163
+ // @ts-expect-error onChange is not a function
164
+ onChange='foo'
165
+ >
166
+ {OPTIONS}
167
+ </Select>
168
+ );
169
+
170
+ const select = screen.getByRole('combobox');
171
+
172
+ fireEvent.change(select, {target: {value: 'button'}});
173
+
174
+ // todo: assertion
175
+ // success indicated by no errors thrown
176
+ // error would be thrown on an untestable thread
177
+ });
178
+
137
179
  test('select with placeholder option', () => {
138
180
  const PLACEHOLDER_TEXT = 'foo';
139
181
 
@@ -1,6 +1,7 @@
1
1
  import ErrorMessage from '../ErrorMessage';
2
2
  import HintText from '../../common/HintText';
3
3
  import { SelectProps } from './types';
4
+ import clsx from 'clsx';
4
5
 
5
6
  const Select = function ({
6
7
  children,
@@ -43,12 +44,12 @@ const Select = function ({
43
44
  {hintText && <HintText id={hintTextId}>{hintText}</HintText>}
44
45
  {errorMessage && <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>}
45
46
  <div
46
- className={[
47
+ className={clsx([
47
48
  "ds_select-wrapper",
48
49
  hasError && 'ds_input--error',
49
50
  width && `ds_input--${width}`,
50
51
  className
51
- ].join(' ')}
52
+ ])}
52
53
  {...props}
53
54
  >
54
55
  <select
@@ -1,4 +1,5 @@
1
1
  import { SequentialNavigationLinkProps, SequentialNavigationProps } from "./types";
2
+ import clsx from 'clsx';
2
3
 
3
4
  const SeqNavLink = ({
4
5
  children,
@@ -7,15 +8,15 @@ const SeqNavLink = ({
7
8
  linkComponent,
8
9
  textLabel
9
10
  }:SequentialNavigationLinkProps) => {
10
- const LINK_CLASSES = [
11
+ const LINK_CLASSES = clsx([
11
12
  'ds_sequential-nav__button',
12
13
  isPrev ? 'ds_sequential-nav__button--left' : 'ds_sequential-nav__button--right'
13
- ].join(' ');
14
+ ]);
14
15
 
15
- const ITEM_CLASSES = [
16
+ const ITEM_CLASSES = clsx([
16
17
  'ds_sequential-nav__item',
17
18
  isPrev ? 'ds_sequential-nav__item--prev' : 'ds_sequential-nav__item--next'
18
- ].join(' ');
19
+ ]);
19
20
 
20
21
  function processChildren(children: React.ReactNode) {
21
22
  const linkInner = <span className="ds_sequential-nav__text" data-label={textLabel}>{children}</span>
@@ -62,10 +63,10 @@ const SequentialNavigation = ({
62
63
  }: SequentialNavigationProps) => {
63
64
  return (
64
65
  <nav
65
- className={[
66
+ className={clsx([
66
67
  'ds_sequential-nav',
67
68
  className
68
- ].join(' ')}
69
+ ])}
69
70
  aria-label={ariaLabel}
70
71
  {...props}
71
72
  >
@@ -109,6 +109,30 @@ test('side nav link with custom element', () => {
109
109
  expect(link?.textContent).toEqual(LINK_TEXT);
110
110
  });
111
111
 
112
+ test('instantiating/initialising DS component script', () => {
113
+ render(
114
+ <SideNavigation>
115
+ <SideNavigation.List>
116
+ <SideNavigation.Item href="#dates" title="Dates"/>
117
+ </SideNavigation.List>
118
+ </SideNavigation>
119
+ );
120
+
121
+ const sideNavigation = screen.getByRole('navigation');
122
+ expect(sideNavigation).toHaveClass('js-initialised');
123
+ expect(sideNavigation).toHaveClass('js-instantiated');
124
+ });
125
+
126
+ test('instantiating/initialising DS component script: no children', () => {
127
+ render(
128
+ <SideNavigation />
129
+ );
130
+
131
+ const sideNavigation = screen.getByRole('navigation');
132
+ expect(sideNavigation).not.toHaveClass('js-initialised');
133
+ expect(sideNavigation).not.toHaveClass('js-instantiated');
134
+ });
135
+
112
136
  test('passing additional props', () => {
113
137
  render(
114
138
  <SideNavigation data-test="foo" />
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useRef } from 'react';
2
- // @ts-expect-error no types from core SGDS
3
2
  import DSSideNavigation from '@scottish-government/design-system/src/components/side-navigation/side-navigation';
4
3
  import { SideNavigationItemProps, SideNavigationListProps, SideNavigationProps } from './types';
4
+ import clsx from 'clsx';
5
5
 
6
6
  const SideNavigationList = function ({
7
7
  children,
@@ -27,10 +27,10 @@ const SideNavigationItem = function ({
27
27
 
28
28
  return (
29
29
  <li
30
- className={[
30
+ className={clsx([
31
31
  'ds_side-navigation__item',
32
32
  children && 'ds_side-navigation__item--has-children'
33
- ].join(' ')}
33
+ ])}
34
34
  >
35
35
  {isCurrent ?
36
36
  <span className={LINK_CLASS + ' ds_current'}>{title}</span> :
@@ -52,18 +52,21 @@ const SideNavigation = function ({
52
52
  const ref = useRef(null);
53
53
 
54
54
  useEffect(() => {
55
- if (ref.current && children) {
56
- new DSSideNavigation(ref.current).init();
55
+ /* istanbul ignore else */
56
+ if (ref.current) {
57
+ if (children) {
58
+ new DSSideNavigation(ref.current).init();
59
+ }
57
60
  }
58
61
  }, [ref]);
59
62
 
60
63
  return (
61
64
  <nav
62
65
  aria-label={ariaLabel}
63
- className={[
66
+ className={clsx([
64
67
  'ds_side-navigation',
65
68
  className
66
- ].join(' ')}
69
+ ])}
67
70
  data-module="ds-side-navigation"
68
71
  ref={ref}
69
72
  {...props}
@@ -1,6 +1,7 @@
1
1
  import React, { Children } from 'react';
2
2
  import ConditionalWrapper from '../../common/ConditionalWrapper';
3
3
  import { SiteFooterLicenseProps, SiteFooterLinkProps, SiteFooterOrgProps, SiteFooterProps } from './types';
4
+ import clsx from 'clsx';
4
5
 
5
6
  const License = ({
6
7
  children,
@@ -79,10 +80,10 @@ const SiteFooter = ({
79
80
  }: SiteFooterProps) => {
80
81
  return (
81
82
  <footer
82
- className={[
83
+ className={clsx([
83
84
  "ds_site-footer",
84
85
  className
85
- ].join(' ')}
86
+ ])}
86
87
  {...props}
87
88
  >
88
89
  <div className="ds_wrapper">
@@ -5,6 +5,17 @@ import SiteNavigation from '../SiteNavigation';
5
5
  import SiteSearch from '../SiteSearch';
6
6
  import PhaseBanner from '../PhaseBanner';
7
7
 
8
+ const NAVIGATION_ITEMS = (
9
+ <>
10
+ <SiteNavigation.Item href="#about">About</SiteNavigation.Item>
11
+ <SiteNavigation.Item href="#get-started">Get started</SiteNavigation.Item>
12
+ <SiteNavigation.Item href="#styles">Styles</SiteNavigation.Item>
13
+ <SiteNavigation.Item href="#components" isCurrent>Components</SiteNavigation.Item>
14
+ <SiteNavigation.Item href="#patterns">Patterns</SiteNavigation.Item>
15
+ <SiteNavigation.Item href="#guidance">Guidance</SiteNavigation.Item>
16
+ </>
17
+ );
18
+
8
19
  test('site header renders correctly (maximal, testing markup structure)', () => {
9
20
  render(
10
21
  <SiteHeader>
@@ -13,12 +24,7 @@ test('site header renders correctly (maximal, testing markup structure)', () =>
13
24
  </SiteHeader.Brand>
14
25
  <SiteHeader.Navigation>
15
26
  <SiteNavigation>
16
- <SiteNavigation.Item href="#about">About</SiteNavigation.Item>
17
- <SiteNavigation.Item href="#get-started">Get started</SiteNavigation.Item>
18
- <SiteNavigation.Item href="#styles">Styles</SiteNavigation.Item>
19
- <SiteNavigation.Item href="#components" current>Components</SiteNavigation.Item>
20
- <SiteNavigation.Item href="#patterns">Patterns</SiteNavigation.Item>
21
- <SiteNavigation.Item href="#guidance">Guidance</SiteNavigation.Item>
27
+ {NAVIGATION_ITEMS}
22
28
  </SiteNavigation>
23
29
  </SiteHeader.Navigation>
24
30
  <SiteHeader.Search>
@@ -155,16 +161,7 @@ test('site header logo link link with custom element', () => {
155
161
  });
156
162
 
157
163
  test('site header with site navigation', () => {
158
- const NAVIGATION_ITEMS = (
159
- <>
160
- <SiteNavigation.Item href="#about">About</SiteNavigation.Item>
161
- <SiteNavigation.Item href="#get-started">Get started</SiteNavigation.Item>
162
- <SiteNavigation.Item href="#styles">Styles</SiteNavigation.Item>
163
- <SiteNavigation.Item href="#components" current>Components</SiteNavigation.Item>
164
- <SiteNavigation.Item href="#patterns">Patterns</SiteNavigation.Item>
165
- <SiteNavigation.Item href="#guidance">Guidance</SiteNavigation.Item>
166
- </>
167
- );
164
+
168
165
 
169
166
  render(
170
167
  <>
@@ -240,6 +237,22 @@ test('site header with phase banner', () => {
240
237
  expect(siteHeaderPhaseBanner?.innerHTML).toEqual(phaseBannerReference.innerHTML);
241
238
  });
242
239
 
240
+ test('instantiating/initialising DS component script', () => {
241
+ render(
242
+ <SiteHeader>
243
+ <SiteHeader.Navigation>
244
+ <SiteNavigation>
245
+ {NAVIGATION_ITEMS}
246
+ </SiteNavigation>
247
+ </SiteHeader.Navigation>
248
+ </SiteHeader>
249
+ );
250
+
251
+ const mobileNav = screen.getAllByRole('navigation')[0];
252
+ expect(mobileNav).toHaveClass('js-initialised');
253
+ expect(mobileNav).toHaveClass('js-instantiated');
254
+ });
255
+
243
256
  test('passing additional props', () => {
244
257
  render(
245
258
  <SiteHeader data-test="foo" />
@@ -1,7 +1,6 @@
1
1
  import React, { Children, useEffect, useRef } from 'react';
2
2
  import Icon from '../../common/Icon';
3
3
  import SiteNavigation from '../SiteNavigation';
4
- // @ts-expect-error no types from core SGDS
5
4
  import DSMobileMenu from '@scottish-government/design-system/src/components/site-navigation/site-navigation';
6
5
  import { SiteHeaderBrandProps, SiteHeaderProps } from './types';
7
6
  import { SiteNavigationProps } from '../SiteNavigation/types';
@@ -84,6 +83,7 @@ const SiteHeader = ({
84
83
  });
85
84
 
86
85
  useEffect(() => {
86
+ /* istanbul ignore else */
87
87
  if (mobileMenuRef.current) {
88
88
  new DSMobileMenu(mobileMenuRef.current).init();
89
89
  }
@@ -45,7 +45,7 @@ test('site navigation link renders correctly', () => {
45
45
  expect(link).toHaveAttribute('href', LINK_HREF)
46
46
  });
47
47
 
48
- test('site navigation link with custom element', () => {
48
+ test('site navigation item with custom link element', () => {
49
49
  render(
50
50
  <SiteNavigation.Item href={LINK_HREF} linkComponent={
51
51
  ({ className, ...props }) => (
@@ -62,6 +62,21 @@ test('site navigation link with custom element', () => {
62
62
  expect(link?.textContent).toEqual(LINK_TEXT);
63
63
  });
64
64
 
65
+ test('site navigation item without href', () => {
66
+ render(
67
+ // @ts-expect-error required prop missing
68
+ <SiteNavigation.Item>
69
+ {LINK_TEXT}
70
+ </SiteNavigation.Item>
71
+ );
72
+
73
+ const item = screen.getByRole('listitem');
74
+ const link = within(item).queryByRole('link');
75
+
76
+ expect(link).not.toBeInTheDocument();
77
+ expect(item.textContent).toEqual(LINK_TEXT);
78
+ });
79
+
65
80
  test('highlights current item', () => {
66
81
  render(
67
82
  <SiteNavigation.Item href={LINK_HREF} isCurrent>{LINK_TEXT}</SiteNavigation.Item>
@@ -1,4 +1,5 @@
1
1
  import { SiteNavigationItemProps, SiteNavigationProps } from "./types";
2
+ import clsx from 'clsx';
2
3
 
3
4
  const Item = ({
4
5
  children,
@@ -14,11 +15,15 @@ const Item = ({
14
15
  ariaCurrent = 'page';
15
16
  }
16
17
 
18
+ const classNamesString = clsx(classNames);
19
+
17
20
  function processChildren(children: React.ReactNode) {
18
21
  if (linkComponent) {
19
- return linkComponent({ className: classNames.join(' '), href, children });
22
+ return linkComponent({ className: classNamesString, href, children });
20
23
  } else if (href) {
21
- return <a href={href} aria-current={ariaCurrent ? ariaCurrent : undefined} className={classNames.join(' ')}>{children}</a>;
24
+ return <a href={href} aria-current={ariaCurrent ? ariaCurrent : undefined} className={classNamesString}>{children}</a>;
25
+ } else {
26
+ return <span className={classNamesString}>{children}</span>;
22
27
  }
23
28
  }
24
29
 
@@ -38,10 +43,10 @@ const SiteNavigation = ({
38
43
  }: SiteNavigationProps) => {
39
44
  return (
40
45
  <nav
41
- className={[
46
+ className={clsx([
42
47
  'ds_site-navigation',
43
48
  className
44
- ].join(' ')}
49
+ ])}
45
50
  {...props}
46
51
  >
47
52
  <ul className="ds_site-navigation__list">
@@ -142,6 +142,28 @@ test('autocomplete', () => {
142
142
 
143
143
  });
144
144
 
145
+ test('instantiating/initialising DS component script: autocomplete', () => {
146
+ render(
147
+ <SiteSearch autocompleteEndpoint="/endpoint" />
148
+ );
149
+
150
+ const searchForm = screen.getByRole('search');
151
+ const searchFormContainer = searchForm.parentElement;
152
+ expect(searchFormContainer).toHaveClass('js-initialised');
153
+ expect(searchFormContainer).toHaveClass('js-instantiated');
154
+ });
155
+
156
+ test('instantiating/initialising DS component script: no autocomplete', () => {
157
+ render(
158
+ <SiteSearch />
159
+ );
160
+
161
+ const searchForm = screen.getByRole('search');
162
+ const searchFormContainer = searchForm.parentElement;
163
+ expect(searchFormContainer).not.toHaveClass('js-initialised');
164
+ expect(searchFormContainer).not.toHaveClass('js-instantiated');
165
+ });
166
+
145
167
  test('passing additional props', () => {
146
168
  render(
147
169
  <SiteSearch data-test="foo" />
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useRef } from 'react';
2
- // @ts-expect-error no types from core SGDS
3
2
  import DSAutocomplete from '@scottish-government/design-system/src/components/autocomplete/autocomplete';
4
3
  import Button from '../Button';
5
4
  import { SiteSearchProps, SuggestionMappingFunctionProps } from './types';
5
+ import clsx from 'clsx';
6
6
 
7
7
  const SiteSearch = function ({
8
8
  action = '/search',
@@ -27,7 +27,8 @@ const SiteSearch = function ({
27
27
  }
28
28
 
29
29
  useEffect(() => {
30
- if (hasAutocomplete && ref.current) {
30
+ const autocompleteElement = document.getElementById(autocompleteId);
31
+ if (hasAutocomplete && autocompleteElement && ref.current) {
31
32
  const options: AutoCompleteOptions = {};
32
33
  if (minLength) {
33
34
  options.minLength = minLength;
@@ -37,7 +38,7 @@ const SiteSearch = function ({
37
38
  }
38
39
 
39
40
  const autocomplete = new DSAutocomplete(
40
- document.getElementById(autocompleteId),
41
+ autocompleteElement,
41
42
  autocompleteEndpoint,
42
43
  options
43
44
  );
@@ -48,11 +49,11 @@ const SiteSearch = function ({
48
49
 
49
50
  return (
50
51
  <div
51
- className={[
52
+ className={clsx([
52
53
  'ds_site-search',
53
54
  className,
54
- hasAutocomplete ? 'ds_autocomplete' : undefined
55
- ].join(' ')}
55
+ hasAutocomplete && 'ds_autocomplete'
56
+ ])}
56
57
  id={autocompleteId ? autocompleteId : undefined}
57
58
  ref={ref}
58
59
  {...props}
@@ -69,11 +70,11 @@ const SiteSearch = function ({
69
70
  <input aria-autocomplete={hasAutocomplete ? 'list' : undefined}
70
71
  aria-owns={hasAutocomplete ? 'autocomplete-suggestions' : undefined}
71
72
  autoComplete={hasAutocomplete ? 'off' : undefined}
72
- className={[
73
+ className={clsx([
73
74
  'ds_input',
74
75
  'ds_site-search__input',
75
- hasAutocomplete ? 'js-autocomplete-input' : undefined
76
- ].join(' ')}
76
+ hasAutocomplete && 'js-autocomplete-input'
77
+ ])}
77
78
  id={id}
78
79
  name={name}
79
80
  placeholder={placeholder}
@@ -1,5 +1,11 @@
1
1
  type FormMethods = 'GET' | 'POST';
2
- export type SuggestionMappingFunctionProps = (suggestionObj: {response: string}) => [];
2
+
3
+ export type Suggestion = {
4
+ displayText: string;
5
+ isActive: boolean;
6
+ }
7
+
8
+ export type SuggestionMappingFunctionProps = (suggestions: object[]) => Suggestion[];
3
9
 
4
10
  export interface SiteSearchProps extends React.AllHTMLAttributes<HTMLInputElement> {
5
11
  action?: string;
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react';
2
- // @ts-expect-error no types from core SGDS
3
2
  import dsSkipLinks from '@scottish-government/design-system/src/components/skip-links/skip-links';
4
3
  import { SkipLinksLinkProps, SkipLinksProps } from './types';
4
+ import clsx from 'clsx';
5
5
 
6
6
  const Link = ({
7
7
  children,
@@ -30,10 +30,10 @@ const SkipLinks = ({
30
30
 
31
31
  return (
32
32
  <div
33
- className={[
33
+ className={clsx([
34
34
  'ds_skip-links',
35
- isStatic && 'ds_skip-links--static',
36
- ].join(' ')}
35
+ isStatic && 'ds_skip-links--static'
36
+ ])}
37
37
  {...props}
38
38
  >
39
39
  <ul className="ds_skip-links__list">
@@ -5,6 +5,7 @@ import ConditionalWrapper from '../../common/ConditionalWrapper';
5
5
  import WrapperTag from "../../common/WrapperTag";
6
6
  import { SummaryCardProps } from './types';
7
7
  import { ActionLinkProps } from '../../common/ActionLink/types';
8
+ import clsx from 'clsx';
8
9
 
9
10
  const SummaryCard = ({
10
11
  children,
@@ -29,10 +30,10 @@ const SummaryCard = ({
29
30
 
30
31
  return (
31
32
  <div
32
- className={[
33
+ className={clsx([
33
34
  'ds_summary-card',
34
35
  className
35
- ].join(' ')}
36
+ ])}
36
37
  {...props}
37
38
  >
38
39
  <div className="ds_summary-card__header">
@@ -1,9 +1,9 @@
1
1
  import React, { Children, useId } from 'react';
2
-
3
2
  import ActionLink from '../../common/ActionLink';
4
3
  import ConditionalWrapper from '../../common/ConditionalWrapper';
5
4
  import { SummaryListItemProps, SummaryListProps } from './types';
6
- import { ActionLinkProps } from '@/src/common/ActionLink/types';
5
+ import { ActionLinkProps } from '../../common/ActionLink/types';
6
+ import clsx from 'clsx';
7
7
 
8
8
  const Item = ({
9
9
  children,
@@ -80,11 +80,11 @@ const SummaryList = ({
80
80
  }: SummaryListProps) => {
81
81
  return (
82
82
  <ol
83
- className={[
83
+ className={clsx([
84
84
  'ds_summary-list',
85
85
  isBorderless && 'ds_summary-list--no-border',
86
86
  className
87
- ].join(' ')}
87
+ ])}
88
88
  {...props}
89
89
  >
90
90
  {children}
@@ -58,6 +58,42 @@ test('table with smallscreen behaviour', () => {
58
58
  expect(table.nodeName).toEqual('TABLE');
59
59
  });
60
60
 
61
+ test('instantiating/initialising DS component script: smallscreen', () => {
62
+ render(
63
+ <Table smallscreen="scrolling">
64
+ <caption>Public holidays in 2020</caption>
65
+ <thead>
66
+ <tr>
67
+ <th scope="col">Date</th>
68
+ <th scope="col">Day</th>
69
+ <th scope="col">Holiday</th>
70
+ </tr>
71
+ </thead>
72
+ <tbody>
73
+ <tr>
74
+ <td>10 April</td>
75
+ <td>Friday</td>
76
+ <td>Good Friday</td>
77
+ </tr>
78
+ </tbody>
79
+ </Table>
80
+ );
81
+
82
+ const table = screen.getByRole('table');
83
+ expect(table).toHaveClass('js-initialised');
84
+ expect(table).toHaveClass('js-instantiated');
85
+ });
86
+
87
+ test('instantiating/initialising DS component script: not smallscreen', () => {
88
+ render(
89
+ <Table />
90
+ );
91
+
92
+ const table = screen.getByRole('table');
93
+ expect(table).not.toHaveClass('js-initialised');
94
+ expect(table).not.toHaveClass('js-instantiated');
95
+ });
96
+
61
97
  test('passing additional props', () => {
62
98
  render(
63
99
  <Table data-test="foo"/>
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useRef } from 'react';
2
- // @ts-expect-error no types from core SGDS
3
2
  import DSTable from '@scottish-government/design-system/src/components/table/table';
4
3
  import { TableProps } from './types';
4
+ import clsx from 'clsx';
5
5
 
6
6
  const Table = ({
7
7
  children,
@@ -12,17 +12,18 @@ const Table = ({
12
12
  const ref = useRef(null);
13
13
 
14
14
  useEffect(() => {
15
+ /* istanbul ignore else */
15
16
  if (ref.current) {
16
- new DSTable().init();
17
+ new DSTable(ref.current).init();
17
18
  }
18
19
  }, [ref]);
19
20
 
20
21
  return (
21
22
  <table
22
- className={[
23
+ className={clsx([
23
24
  'ds_table',
24
25
  className
25
- ].join(' ')}
26
+ ])}
26
27
  data-smallscreen={smallscreen}
27
28
  ref={ref}
28
29
  {...props}
@@ -187,6 +187,20 @@ test('with manual activation', () => {
187
187
  expect(tabContainer).toHaveClass('ds_tabs--manual');
188
188
  });
189
189
 
190
+ test('instantiating/initialising DS component script', () => {
191
+ render(
192
+ <Tabs data-testid="tabcontainer" data-test="foo">
193
+ <Tabs.Item tabLabel="Tab 1" data-testid="tabpanel1">
194
+ <div data-testid="tabpanel1content">Content one</div>
195
+ </Tabs.Item>
196
+ </Tabs>
197
+ );
198
+
199
+ const tabContainer = screen.getByTestId('tabcontainer');
200
+ expect(tabContainer).toHaveClass('js-initialised');
201
+ expect(tabContainer).toHaveClass('js-instantiated');
202
+ });
203
+
190
204
  test('passing additional props to tab container', () => {
191
205
  render(
192
206
  <Tabs data-testid="tabcontainer" data-test="foo">