@tpzdsp/next-toolkit 2.5.0 → 3.0.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 (355) hide show
  1. package/package.json +22 -13
  2. package/src/assets/styles/globals.css +75 -95
  3. package/src/assets/styles/ol.css +57 -16
  4. package/src/assets/styles/utils.css +80 -0
  5. package/src/components/Accordion/Accordion.css +85 -0
  6. package/src/components/Accordion/Accordion.stories.tsx +264 -0
  7. package/src/components/Accordion/Accordion.tsx +98 -0
  8. package/src/components/Alert/Alert.css +129 -0
  9. package/src/components/Alert/Alert.stories.tsx +291 -0
  10. package/src/components/Alert/Alert.tsx +76 -0
  11. package/src/components/BackLink/BackLink.css +12 -0
  12. package/src/components/BackLink/BackLink.stories.tsx +52 -0
  13. package/src/components/BackLink/BackLink.tsx +44 -0
  14. package/src/components/BackToTop/BackToTop.css +23 -0
  15. package/src/components/BackToTop/BackToTop.stories.tsx +41 -0
  16. package/src/components/BackToTop/BackToTop.tsx +48 -0
  17. package/src/components/Breadcrumb/Breadcrumb.css +42 -0
  18. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +94 -0
  19. package/src/components/Breadcrumb/Breadcrumb.tsx +135 -0
  20. package/src/components/Button/Button.css +229 -0
  21. package/src/components/Button/Button.stories.tsx +140 -20
  22. package/src/components/Button/Button.tsx +53 -28
  23. package/src/components/Button/ButtonSkeleton.stories.tsx +50 -0
  24. package/src/components/Button/ButtonSkeleton.tsx +14 -0
  25. package/src/components/ButtonGroup/ButtonGroup.css +52 -0
  26. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +156 -0
  27. package/src/components/ButtonGroup/ButtonGroup.tsx +50 -0
  28. package/src/components/ButtonLink/ButtonLink.css +114 -0
  29. package/src/components/ButtonLink/ButtonLink.stories.tsx +38 -51
  30. package/src/components/ButtonLink/ButtonLink.tsx +54 -23
  31. package/src/components/Card/Card.css +13 -0
  32. package/src/components/Card/Card.stories.tsx +98 -57
  33. package/src/components/Card/Card.tsx +4 -13
  34. package/src/components/CardGroup/CardGroup.css +10 -0
  35. package/src/components/CardGroup/CardGroup.stories.tsx +81 -0
  36. package/src/components/CardGroup/CardGroup.tsx +9 -0
  37. package/src/components/Checkbox/Checkbox.css +49 -0
  38. package/src/components/Checkbox/Checkbox.stories.tsx +86 -0
  39. package/src/components/Checkbox/Checkbox.tsx +32 -0
  40. package/src/components/Chip/Chip.css +54 -0
  41. package/src/components/Chip/Chip.stories.tsx +94 -0
  42. package/src/components/Chip/Chip.tsx +34 -0
  43. package/src/components/CookieBanner/CookieBanner.css +19 -0
  44. package/src/components/CookieBanner/CookieBanner.stories.tsx +52 -0
  45. package/src/components/CookieBanner/CookieBanner.tsx +55 -0
  46. package/src/components/CopyButton/CopyButton.stories.tsx +28 -0
  47. package/src/components/CopyButton/CopyButton.tsx +65 -0
  48. package/src/components/DateInput/DateInput.css +13 -0
  49. package/src/components/DateInput/DateInput.stories.tsx +131 -0
  50. package/src/components/DateInput/DateInput.test.tsx +21 -0
  51. package/src/components/DateInput/DateInput.tsx +98 -0
  52. package/src/components/Details/Details.css +28 -0
  53. package/src/components/Details/Details.stories.tsx +48 -0
  54. package/src/components/Details/Details.tsx +41 -0
  55. package/src/components/Dropdown/Dropdown.css +81 -0
  56. package/src/components/Dropdown/Dropdown.stories.tsx +131 -0
  57. package/src/components/Dropdown/Dropdown.tsx +69 -0
  58. package/src/components/ErrorBoundary/ErrorBoundary.stories.tsx +4 -39
  59. package/src/components/ErrorBoundary/ErrorBoundary.tsx +7 -4
  60. package/src/components/ErrorBoundary/ErrorFallback.tsx +32 -66
  61. package/src/components/ErrorModal/ErrorModal.css +32 -0
  62. package/src/components/ErrorModal/ErrorModal.stories.tsx +101 -0
  63. package/src/components/ErrorModal/ErrorModal.tsx +120 -0
  64. package/src/components/ErrorText/ErrorText.css +22 -0
  65. package/src/components/ErrorText/ErrorText.stories.tsx +42 -27
  66. package/src/components/ErrorText/ErrorText.tsx +10 -8
  67. package/src/components/ExternalLink/ExternalLink.css +12 -0
  68. package/src/components/ExternalLink/ExternalLink.stories.tsx +43 -0
  69. package/src/components/ExternalLink/ExternalLink.tsx +43 -0
  70. package/src/components/Fieldset/Fieldset.css +103 -0
  71. package/src/components/Fieldset/Fieldset.stories.tsx +304 -0
  72. package/src/components/Fieldset/Fieldset.tsx +38 -0
  73. package/src/components/FileUpload/FileUpload.css +85 -0
  74. package/src/components/FileUpload/FileUpload.stories.tsx +106 -0
  75. package/src/components/FileUpload/FileUpload.tsx +99 -0
  76. package/src/components/{layout/footer → Footer}/Copyright.tsx +4 -2
  77. package/src/components/Footer/Footer.stories.tsx +24 -0
  78. package/src/components/Footer/Footer.tsx +41 -0
  79. package/src/components/Footer/Licence.tsx +18 -0
  80. package/src/components/{layout/footer → Footer}/MetaLinks.tsx +8 -3
  81. package/src/components/Footer/Small/SmallFooter.tsx +43 -42
  82. package/src/components/Form/FormGroup.css +18 -0
  83. package/src/components/Form/FormGroup.stories.tsx +87 -0
  84. package/src/components/Form/FormGroup.tsx +16 -0
  85. package/src/components/{layout/header → Header}/Header.stories.tsx +26 -12
  86. package/src/components/Header/Header.test.tsx +87 -0
  87. package/src/components/Header/Header.tsx +303 -0
  88. package/src/components/Header/HeaderAppContent.tsx +120 -0
  89. package/src/components/Heading/Heading.css +40 -0
  90. package/src/components/Heading/Heading.stories.tsx +15 -5
  91. package/src/components/Heading/Heading.tsx +21 -44
  92. package/src/components/Heading/HeadingSkeleton.stories.tsx +30 -0
  93. package/src/components/Heading/HeadingSkeleton.tsx +14 -0
  94. package/src/components/Hero/Hero.css +19 -0
  95. package/src/components/Hero/Hero.stories.tsx +41 -0
  96. package/src/components/Hero/Hero.tsx +14 -0
  97. package/src/components/HintText/HintText.css +5 -0
  98. package/src/components/HintText/HintText.stories.tsx +29 -0
  99. package/src/components/HintText/HintText.tsx +13 -0
  100. package/src/components/InfoBox/InfoBox.css +38 -0
  101. package/src/components/InfoBox/InfoBox.stories.tsx +51 -403
  102. package/src/components/InfoBox/InfoBox.tsx +31 -158
  103. package/src/components/Input/Input.css +77 -0
  104. package/src/components/Input/Input.stories.tsx +123 -0
  105. package/src/components/Input/Input.tsx +74 -0
  106. package/src/components/InputGroup/InputGroup.css +140 -0
  107. package/src/components/InputGroup/InputGroup.stories.tsx +125 -0
  108. package/src/components/InputGroup/InputGroup.tsx +47 -0
  109. package/src/components/InsetText/InsetText.css +5 -0
  110. package/src/components/InsetText/InsetText.stories.tsx +30 -0
  111. package/src/components/InsetText/InsetText.tsx +9 -0
  112. package/src/components/Keyboard/Keyboard.css +9 -0
  113. package/src/components/Keyboard/Keyboard.stories.tsx +63 -0
  114. package/src/components/Keyboard/Keyboard.tsx +30 -0
  115. package/src/components/Label/Label.css +27 -0
  116. package/src/components/Label/Label.stories.tsx +40 -0
  117. package/src/components/Label/Label.tsx +17 -0
  118. package/src/components/LayerSwitcher/LayerSwitcher.css +59 -0
  119. package/src/components/LayerSwitcher/LayerSwitcher.stories.tsx +112 -0
  120. package/src/components/LayerSwitcher/LayerSwitcher.tsx +61 -0
  121. package/src/components/Layout/401/401.stories.tsx +23 -0
  122. package/src/components/Layout/401/401.tsx +1 -0
  123. package/src/components/Layout/403/403.stories.tsx +23 -0
  124. package/src/components/Layout/403/403.tsx +21 -0
  125. package/src/components/Layout/404/404.stories.tsx +23 -0
  126. package/src/components/Layout/404/404.tsx +28 -0
  127. package/src/components/Layout/500/500.stories.tsx +56 -0
  128. package/src/components/Layout/500/500.tsx +63 -0
  129. package/src/components/Layout/ButtonGroup/ButtonGroup.css +52 -0
  130. package/src/components/Layout/ButtonGroup/ButtonGroup.stories.tsx +156 -0
  131. package/src/components/Layout/ButtonGroup/ButtonGroup.tsx +50 -0
  132. package/src/components/Layout/HeadingGroup/HeadingGroup.css +21 -0
  133. package/src/components/Layout/HeadingGroup/HeadingGroup.stories.tsx +84 -0
  134. package/src/components/Layout/HeadingGroup/HeadingGroup.tsx +9 -0
  135. package/src/components/Layout/MainWrapper/MainWrapper.css +12 -0
  136. package/src/components/Layout/MainWrapper/MainWrapper.stories.tsx +36 -0
  137. package/src/components/Layout/MainWrapper/MainWrapper.tsx +14 -0
  138. package/src/components/Layout/PageShell/PageShell.css +42 -0
  139. package/src/components/Layout/PageShell/PageShell.stories.tsx +108 -0
  140. package/src/components/Layout/PageShell/PageShell.tsx +31 -0
  141. package/src/components/Layout/ParagraphGroup/ParagraphGroup.css +5 -0
  142. package/src/components/Layout/ParagraphGroup/ParagraphGroup.stories.tsx +34 -0
  143. package/src/components/Layout/ParagraphGroup/ParagraphGroup.tsx +9 -0
  144. package/src/components/Layout/Stack/Stack.css +29 -0
  145. package/src/components/Layout/Stack/Stack.stories.tsx +83 -0
  146. package/src/components/Layout/Stack/Stack.tsx +19 -0
  147. package/src/components/Layout/WidthContainer/WidthContainer.css +17 -0
  148. package/src/components/Layout/WidthContainer/WidthContainer.stories.tsx +59 -0
  149. package/src/components/Layout/WidthContainer/WidthContainer.tsx +13 -0
  150. package/src/components/Legend/Legend.css +95 -0
  151. package/src/components/Legend/Legend.stories.tsx +81 -0
  152. package/src/components/Legend/Legend.tsx +32 -0
  153. package/src/components/Legend/LegendDot.tsx +15 -0
  154. package/src/components/Legend/LegendPanel.stories.tsx +101 -0
  155. package/src/components/Legend/LegendPanel.tsx +68 -0
  156. package/src/components/Legend/LegendSkeleton.stories.tsx +87 -0
  157. package/src/components/Legend/LegendSkeleton.tsx +73 -0
  158. package/src/components/LegendSelect/LegendSelect.css +8 -0
  159. package/src/components/LegendSelect/LegendSelect.stories.tsx +80 -0
  160. package/src/components/LegendSelect/LegendSelect.tsx +26 -0
  161. package/src/components/Link/Link.css +98 -0
  162. package/src/components/Link/Link.stories.tsx +70 -0
  163. package/src/components/Link/Link.tsx +52 -0
  164. package/src/components/LinkButton/LinkButton.css +67 -0
  165. package/src/components/LinkButton/LinkButton.stories.tsx +90 -42
  166. package/src/components/LinkButton/LinkButton.tsx +50 -63
  167. package/src/components/LinkList/LinkList.css +28 -0
  168. package/src/components/LinkList/LinkList.stories.tsx +46 -0
  169. package/src/components/LinkList/LinkList.tsx +23 -0
  170. package/src/components/List/Li.tsx +9 -0
  171. package/src/components/List/List.css +9 -0
  172. package/src/components/List/OrderedList.stories.tsx +36 -0
  173. package/src/components/List/OrderedList.tsx +9 -0
  174. package/src/components/List/UnorderedList.stories.tsx +36 -0
  175. package/src/components/List/UnorderedList.tsx +9 -0
  176. package/src/components/LoadingBox/LoadingBox.css +27 -0
  177. package/src/components/LoadingBox/LoadingBox.stories.tsx +66 -0
  178. package/src/components/LoadingBox/LoadingBox.tsx +40 -0
  179. package/src/components/Modal/Modal.css +114 -0
  180. package/src/components/Modal/Modal.stories.tsx +41 -160
  181. package/src/components/Modal/Modal.tsx +132 -75
  182. package/src/components/NoScriptBanner/NoScriptBanner.css +17 -0
  183. package/src/components/NoScriptBanner/NoScriptBanner.stories.tsx +46 -0
  184. package/src/components/NoScriptBanner/NoScriptBanner.tsx +26 -0
  185. package/src/components/Paragraph/Paragraph.css +22 -0
  186. package/src/components/Paragraph/Paragraph.stories.tsx +1 -42
  187. package/src/components/Paragraph/Paragraph.tsx +4 -3
  188. package/src/components/Paragraph/ParagraphSkeleton.stories.tsx +44 -0
  189. package/src/components/Paragraph/ParagraphSkeleton.tsx +33 -0
  190. package/src/components/PasswordInput/PasswordInput.css +3 -0
  191. package/src/components/PasswordInput/PasswordInput.stories.tsx +47 -0
  192. package/src/components/PasswordInput/PasswordInput.tsx +45 -0
  193. package/src/components/PhaseBanner/PhaseBanner.css +12 -0
  194. package/src/components/PhaseBanner/PhaseBanner.stories.tsx +61 -0
  195. package/src/components/PhaseBanner/PhaseBanner.tsx +17 -0
  196. package/src/components/Popover/Popover.css +43 -0
  197. package/src/components/Popover/Popover.stories.tsx +102 -0
  198. package/src/components/Popover/Popover.tsx +40 -0
  199. package/src/components/Radio/Radio.css +69 -0
  200. package/src/components/Radio/Radio.stories.tsx +169 -0
  201. package/src/components/Radio/Radio.tsx +56 -0
  202. package/src/components/Resizable/Resizable.css +86 -0
  203. package/src/components/Resizable/Resizable.stories.tsx +123 -0
  204. package/src/components/Resizable/Resizable.tsx +86 -0
  205. package/src/components/ScrollArea/ScrollArea.css +9 -0
  206. package/src/components/ScrollArea/ScrollArea.stories.tsx +42 -0
  207. package/src/components/ScrollArea/ScrollArea.tsx +11 -0
  208. package/src/components/SearchBox/SearchBox.stories.tsx +88 -0
  209. package/src/components/SearchBox/SearchBox.tsx +36 -0
  210. package/src/components/Select/AsyncSelect.stories.tsx +84 -0
  211. package/src/components/Select/AsyncSelect.tsx +41 -0
  212. package/src/components/Select/Select.css +194 -0
  213. package/src/components/Select/Select.stories.tsx +162 -0
  214. package/src/components/Select/Select.test.tsx +36 -0
  215. package/src/components/Select/Select.tsx +291 -0
  216. package/src/components/Select/SelectSkeleton.stories.tsx +51 -0
  217. package/src/components/Select/SelectSkeleton.tsx +23 -0
  218. package/src/components/Separator/Separator.css +41 -0
  219. package/src/components/Separator/Separator.stories.tsx +63 -0
  220. package/src/components/Separator/Separator.tsx +42 -0
  221. package/src/components/Sidebar/ResizableSidebar.tsx +118 -0
  222. package/src/components/Sidebar/Sidebar.css +203 -0
  223. package/src/components/Sidebar/Sidebar.stories.tsx +438 -0
  224. package/src/components/Sidebar/Sidebar.tsx +225 -0
  225. package/src/components/Skeleton/Skeleton.css +16 -0
  226. package/src/components/Skeleton/Skeleton.stories.tsx +39 -0
  227. package/src/components/Skeleton/Skeleton.tsx +12 -0
  228. package/src/components/SkipLink/SkipLink.css +16 -0
  229. package/src/components/SkipLink/SkipLink.stories.tsx +40 -0
  230. package/src/components/SkipLink/SkipLink.tsx +15 -0
  231. package/src/components/Spinner/Spinner.css +30 -0
  232. package/src/components/Spinner/Spinner.stories.tsx +36 -0
  233. package/src/components/Spinner/Spinner.tsx +45 -0
  234. package/src/components/StartButton/StartButton.css +13 -0
  235. package/src/components/StartButton/StartButton.stories.tsx +68 -0
  236. package/src/components/StartButton/StartButton.tsx +50 -0
  237. package/src/components/SubmitButton/SubmitButton.stories.tsx +31 -0
  238. package/src/components/SubmitButton/SubmitButton.tsx +14 -0
  239. package/src/components/SummaryList/SummaryList.css +71 -0
  240. package/src/components/SummaryList/SummaryList.stories.tsx +211 -0
  241. package/src/components/SummaryList/SummaryList.tsx +41 -0
  242. package/src/components/SummaryList/SummaryListSkeleton.stories.tsx +67 -0
  243. package/src/components/SummaryList/SummaryListSkeleton.tsx +40 -0
  244. package/src/components/Tabs/Tabs.css +84 -0
  245. package/src/components/Tabs/Tabs.stories.tsx +133 -0
  246. package/src/components/Tabs/Tabs.tsx +66 -0
  247. package/src/components/Tag/Tag.css +8 -0
  248. package/src/components/Tag/Tag.stories.tsx +96 -0
  249. package/src/components/Tag/Tag.tsx +34 -0
  250. package/src/components/Textarea/Textarea.css +38 -0
  251. package/src/components/Textarea/Textarea.stories.tsx +131 -0
  252. package/src/components/Textarea/Textarea.tsx +50 -0
  253. package/src/components/TextareaCount/TextareaCount.css +17 -0
  254. package/src/components/TextareaCount/TextareaCount.stories.tsx +131 -0
  255. package/src/components/TextareaCount/TextareaCount.tsx +108 -0
  256. package/src/components/Tooltip/Tooltip.css +43 -0
  257. package/src/components/Tooltip/Tooltip.stories.tsx +110 -0
  258. package/src/components/Tooltip/Tooltip.tsx +53 -0
  259. package/src/components/WarningText/WarningText.css +20 -0
  260. package/src/components/WarningText/WarningText.stories.tsx +29 -0
  261. package/src/components/WarningText/WarningText.tsx +17 -0
  262. package/src/components/index.ts +342 -61
  263. package/src/errors/errorDisplay.ts +70 -0
  264. package/src/errors/index.ts +1 -0
  265. package/src/http/constants.ts +1 -0
  266. package/src/http/fetch.ts +7 -3
  267. package/src/map/LayerSwitcherPanel.tsx +2 -173
  268. package/src/map/LegendShim.tsx +2 -0
  269. package/src/map/MapComponent.tsx +7 -17
  270. package/src/map/MapControlsOverlay.tsx +68 -175
  271. package/src/map/Popup.tsx +71 -24
  272. package/src/map/geocoder/Geocoder.test.tsx +46 -3
  273. package/src/map/geocoder/Geocoder.tsx +155 -278
  274. package/src/map/index.ts +1 -1
  275. package/src/types/utils.ts +0 -10
  276. package/src/utils/components.ts +96 -0
  277. package/src/utils/index.ts +1 -0
  278. package/src/utils/utils.ts +0 -12
  279. package/src/assets/images/defra-logo.svg +0 -51
  280. package/src/assets/images/ea-logo.svg +0 -58
  281. package/src/assets/images/ogl.svg +0 -1
  282. package/src/components/Button/Button.test.tsx +0 -53
  283. package/src/components/ButtonLink/ButtonLink.test.tsx +0 -154
  284. package/src/components/Card/Card.test.tsx +0 -51
  285. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +0 -75
  286. package/src/components/ErrorBoundary/ErrorFallback.test.tsx +0 -107
  287. package/src/components/ErrorText/ErrorText.test.tsx +0 -33
  288. package/src/components/Heading/Heading.test.tsx +0 -22
  289. package/src/components/Hint/Hint.stories.tsx +0 -58
  290. package/src/components/Hint/Hint.test.tsx +0 -33
  291. package/src/components/Hint/Hint.tsx +0 -12
  292. package/src/components/InfoBox/InfoBox.test.tsx +0 -330
  293. package/src/components/InfoBox/types.ts +0 -6
  294. package/src/components/LinkButton/LinkButton.test.tsx +0 -177
  295. package/src/components/Modal/Modal.test.tsx +0 -246
  296. package/src/components/NotificationBanner/NotificationBanner.stories.tsx +0 -45
  297. package/src/components/NotificationBanner/NotificationBanner.test.tsx +0 -58
  298. package/src/components/NotificationBanner/NotificationBanner.tsx +0 -45
  299. package/src/components/Paragraph/Paragraph.test.tsx +0 -10
  300. package/src/components/SlidingPanel/SlidingPanel.stories.tsx +0 -129
  301. package/src/components/SlidingPanel/SlidingPanel.test.tsx +0 -83
  302. package/src/components/SlidingPanel/SlidingPanel.tsx +0 -258
  303. package/src/components/accordion/Accordion.stories.tsx +0 -234
  304. package/src/components/accordion/Accordion.test.tsx +0 -192
  305. package/src/components/accordion/Accordion.tsx +0 -73
  306. package/src/components/backToTop/BackToTop.stories.tsx +0 -407
  307. package/src/components/backToTop/BackToTop.test.tsx +0 -57
  308. package/src/components/backToTop/BackToTop.tsx +0 -134
  309. package/src/components/chip/Chip.stories.tsx +0 -61
  310. package/src/components/chip/Chip.test.tsx +0 -31
  311. package/src/components/chip/Chip.tsx +0 -23
  312. package/src/components/container/Container.tsx +0 -42
  313. package/src/components/cookieBanner/CookieBanner.stories.tsx +0 -257
  314. package/src/components/cookieBanner/CookieBanner.test.tsx +0 -68
  315. package/src/components/cookieBanner/CookieBanner.tsx +0 -73
  316. package/src/components/divider/RuleDivider.stories.tsx +0 -254
  317. package/src/components/divider/RuleDivider.test.tsx +0 -164
  318. package/src/components/divider/RuleDivider.tsx +0 -23
  319. package/src/components/dropdown/DropdownMenu.test.tsx +0 -211
  320. package/src/components/dropdown/DropdownMenu.tsx +0 -108
  321. package/src/components/dropdown/useDropdownMenu.ts +0 -249
  322. package/src/components/form/Input.stories.tsx +0 -435
  323. package/src/components/form/Input.test.tsx +0 -206
  324. package/src/components/form/Input.tsx +0 -23
  325. package/src/components/form/TextArea.stories.tsx +0 -464
  326. package/src/components/form/TextArea.test.tsx +0 -232
  327. package/src/components/form/TextArea.tsx +0 -23
  328. package/src/components/layout/footer/Footer.tsx +0 -26
  329. package/src/components/layout/footer/Licence.tsx +0 -19
  330. package/src/components/layout/header/Header.test.tsx +0 -36
  331. package/src/components/layout/header/Header.tsx +0 -90
  332. package/src/components/layout/header/HeaderAuthClient.test.tsx +0 -45
  333. package/src/components/layout/header/HeaderAuthClient.tsx +0 -40
  334. package/src/components/layout/header/HeaderNavClient.test.tsx +0 -44
  335. package/src/components/layout/header/HeaderNavClient.tsx +0 -67
  336. package/src/components/link/ExternalLink.test.tsx +0 -102
  337. package/src/components/link/ExternalLink.tsx +0 -29
  338. package/src/components/link/Link.tsx +0 -26
  339. package/src/components/select/Select.stories.tsx +0 -336
  340. package/src/components/select/Select.test.tsx +0 -474
  341. package/src/components/select/Select.tsx +0 -125
  342. package/src/components/select/SelectSkeleton.stories.tsx +0 -194
  343. package/src/components/select/SelectSkeleton.test.tsx +0 -104
  344. package/src/components/select/SelectSkeleton.tsx +0 -23
  345. package/src/components/select/common.ts +0 -3
  346. package/src/components/select/index.ts +0 -18
  347. package/src/components/skipLink/SkipLink.stories.tsx +0 -346
  348. package/src/components/skipLink/SkipLink.test.tsx +0 -22
  349. package/src/components/skipLink/SkipLink.tsx +0 -49
  350. package/src/map/LegendPanel.tsx +0 -85
  351. /package/src/{components → assets}/images/DefraLogo.tsx +0 -0
  352. /package/src/{components → assets}/images/EaLogo.tsx +0 -0
  353. /package/src/{components → assets}/images/OglLogo.tsx +0 -0
  354. /package/src/components/{googleAnalytics → GoogleAnalytics}/GlobalVars.tsx +0 -0
  355. /package/src/components/{googleAnalytics → GoogleAnalytics}/GoogleAnalytics.tsx +0 -0
@@ -1,464 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
-
3
- import { TextArea } from './TextArea';
4
-
5
- const meta = {
6
- title: 'Components/Form/TextArea',
7
- component: TextArea,
8
- parameters: {
9
- layout: 'centered',
10
- docs: {
11
- description: {
12
- component: 'A styled textarea component with error state support and customizable styling.',
13
- },
14
- },
15
- },
16
- tags: ['autodocs'],
17
- argTypes: {
18
- hasError: {
19
- control: 'boolean',
20
- description: 'Whether the textarea should display in error state',
21
- defaultValue: false,
22
- },
23
- rows: {
24
- control: { type: 'number', min: 1, max: 20 },
25
- description: 'Number of visible text lines',
26
- defaultValue: 4,
27
- },
28
- cols: {
29
- control: { type: 'number', min: 10, max: 100 },
30
- description: 'Number of visible character widths',
31
- },
32
- placeholder: {
33
- control: 'text',
34
- description: 'Placeholder text for the textarea',
35
- },
36
- disabled: {
37
- control: 'boolean',
38
- description: 'Whether the textarea is disabled',
39
- defaultValue: false,
40
- },
41
- required: {
42
- control: 'boolean',
43
- description: 'Whether the textarea is required',
44
- defaultValue: false,
45
- },
46
- maxLength: {
47
- control: { type: 'number', min: 0 },
48
- description: 'Maximum number of characters allowed',
49
- },
50
- },
51
- } satisfies Meta<typeof TextArea>;
52
-
53
- export default meta;
54
- type Story = StoryObj<typeof meta>;
55
-
56
- export const Default: Story = {
57
- args: {
58
- placeholder: 'Enter your message...',
59
- rows: 4,
60
- },
61
- parameters: {
62
- docs: {
63
- description: {
64
- story: 'Default textarea with standard styling.',
65
- },
66
- },
67
- },
68
- };
69
-
70
- export const WithError: Story = {
71
- args: {
72
- hasError: true,
73
- placeholder: 'This textarea has an error',
74
- value: 'Invalid content that caused an error',
75
- rows: 4,
76
- },
77
- parameters: {
78
- docs: {
79
- description: {
80
- story: 'Textarea in error state with red border styling.',
81
- },
82
- },
83
- },
84
- };
85
-
86
- export const Disabled: Story = {
87
- args: {
88
- disabled: true,
89
- placeholder: 'This textarea is disabled',
90
- value: 'This content cannot be edited',
91
- rows: 4,
92
- },
93
- parameters: {
94
- docs: {
95
- description: {
96
- story: 'Disabled textarea with reduced opacity and gray background.',
97
- },
98
- },
99
- },
100
- };
101
-
102
- export const Required: Story = {
103
- render: () => (
104
- <div className="w-96">
105
- <label htmlFor="required-textarea" className="block text-sm font-medium mb-1">
106
- Description <span className="text-red-500">*</span>
107
- </label>
108
-
109
- <TextArea
110
- id="required-textarea"
111
- required
112
- placeholder="Please provide a detailed description"
113
- rows={5}
114
- aria-describedby="required-help"
115
- />
116
-
117
- <p id="required-help" className="text-gray-600 text-xs mt-1">
118
- * This field is required
119
- </p>
120
- </div>
121
- ),
122
- parameters: {
123
- docs: {
124
- description: {
125
- story: 'Required textarea field with visual indicator (red asterisk) and helper text.',
126
- },
127
- },
128
- },
129
- };
130
-
131
- export const WithCharacterLimit: Story = {
132
- render: () => (
133
- <div className="w-96">
134
- <label htmlFor="limited-textarea" className="block text-sm font-medium mb-1">
135
- Comment (max 280 characters)
136
- </label>
137
-
138
- <TextArea
139
- id="limited-textarea"
140
- placeholder="What's on your mind?"
141
- maxLength={280}
142
- rows={4}
143
- aria-describedby="char-count"
144
- />
145
-
146
- <p id="char-count" className="text-gray-600 text-xs mt-1">
147
- 280 characters remaining
148
- </p>
149
- </div>
150
- ),
151
- parameters: {
152
- docs: {
153
- description: {
154
- story: 'Textarea with character limit and counter (note: counter is static in this demo).',
155
- },
156
- },
157
- },
158
- };
159
-
160
- export const DifferentSizes: Story = {
161
- render: () => (
162
- <div className="space-y-6 w-96">
163
- <div>
164
- <label htmlFor="small-textarea" className="block text-sm font-medium mb-1">
165
- Small (3 rows)
166
- </label>
167
-
168
- <TextArea id="small-textarea" placeholder="Short description..." rows={3} />
169
- </div>
170
-
171
- <div>
172
- <label htmlFor="medium-textarea" className="block text-sm font-medium mb-1">
173
- Medium (5 rows)
174
- </label>
175
-
176
- <TextArea id="medium-textarea" placeholder="Medium description..." rows={5} />
177
- </div>
178
-
179
- <div>
180
- <label htmlFor="large-textarea" className="block text-sm font-medium mb-1">
181
- Large (8 rows)
182
- </label>
183
-
184
- <TextArea id="large-textarea" placeholder="Long description..." rows={8} />
185
- </div>
186
- </div>
187
- ),
188
- parameters: {
189
- docs: {
190
- description: {
191
- story: 'Textareas with different row heights for various use cases.',
192
- },
193
- },
194
- },
195
- };
196
-
197
- export const FormExample: Story = {
198
- render: () => (
199
- <form className="space-y-6 w-96">
200
- <div>
201
- <label htmlFor="subject" className="block text-sm font-medium mb-1">
202
- Subject <span className="text-red-500">*</span>
203
- </label>
204
-
205
- <input
206
- id="subject"
207
- type="text"
208
- className="w-full rounded-md border p-2"
209
- placeholder="Brief subject line"
210
- required
211
- />
212
- </div>
213
-
214
- <div>
215
- <label htmlFor="message" className="block text-sm font-medium mb-1">
216
- Message <span className="text-red-500">*</span>
217
- </label>
218
-
219
- <TextArea
220
- id="message"
221
- placeholder="Enter your detailed message here..."
222
- rows={6}
223
- required
224
- aria-describedby="message-help"
225
- />
226
-
227
- <p id="message-help" className="text-gray-600 text-xs mt-1">
228
- Please provide as much detail as possible
229
- </p>
230
- </div>
231
-
232
- <div>
233
- <label htmlFor="notes" className="block text-sm font-medium mb-1">
234
- Additional Notes
235
- </label>
236
-
237
- <TextArea id="notes" placeholder="Any additional information (optional)" rows={3} />
238
- </div>
239
-
240
- <button
241
- type="submit"
242
- className="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700
243
- focus:outline-none focus:ring-2 focus:ring-blue-500"
244
- >
245
- Send Message
246
- </button>
247
- </form>
248
- ),
249
- parameters: {
250
- docs: {
251
- description: {
252
- story:
253
- 'Complete form example showing textareas in a realistic context with proper labels and validation.',
254
- },
255
- },
256
- },
257
- };
258
-
259
- export const ErrorStates: Story = {
260
- render: () => (
261
- <div className="space-y-6 w-96">
262
- <div>
263
- <label htmlFor="error-required" className="block text-sm font-medium mb-1">
264
- Required Field <span className="text-red-500">*</span>
265
- </label>
266
-
267
- <TextArea
268
- id="error-required"
269
- hasError
270
- placeholder="This field is required"
271
- rows={4}
272
- aria-invalid="true"
273
- aria-describedby="required-error"
274
- />
275
-
276
- <p id="required-error" className="text-red-600 text-xs mt-1" role="alert">
277
- This field is required.
278
- </p>
279
- </div>
280
-
281
- <div>
282
- <label htmlFor="error-length" className="block text-sm font-medium mb-1">
283
- Description (min 10 characters)
284
- </label>
285
-
286
- <TextArea
287
- id="error-length"
288
- hasError
289
- value="Too short"
290
- rows={4}
291
- minLength={10}
292
- aria-invalid="true"
293
- aria-describedby="length-error"
294
- />
295
-
296
- <p id="length-error" className="text-red-600 text-xs mt-1" role="alert">
297
- Description must be at least 10 characters long.
298
- </p>
299
- </div>
300
-
301
- <div>
302
- <label htmlFor="error-content" className="block text-sm font-medium mb-1">
303
- Content Review
304
- </label>
305
-
306
- <TextArea
307
- id="error-content"
308
- hasError
309
- value="This content contains inappropriate language..."
310
- rows={4}
311
- aria-invalid="true"
312
- aria-describedby="content-error"
313
- />
314
-
315
- <p id="content-error" className="text-red-600 text-xs mt-1" role="alert">
316
- Please review your content and remove inappropriate language.
317
- </p>
318
- </div>
319
- </div>
320
- ),
321
- parameters: {
322
- docs: {
323
- description: {
324
- story:
325
- 'Examples of textarea error states with proper ARIA attributes and error messages for accessibility.',
326
- },
327
- },
328
- },
329
- };
330
-
331
- export const CustomStyling: Story = {
332
- render: () => (
333
- <div className="space-y-6 w-96">
334
- <div>
335
- <label htmlFor="large-textarea" className="block text-sm font-medium mb-1">
336
- Large Text
337
- </label>
338
-
339
- <TextArea
340
- id="large-textarea"
341
- placeholder="Large text size"
342
- className="text-lg p-3"
343
- rows={4}
344
- />
345
- </div>
346
-
347
- <div>
348
- <label htmlFor="custom-border" className="block text-sm font-medium mb-1">
349
- Custom Border
350
- </label>
351
-
352
- <TextArea
353
- id="custom-border"
354
- placeholder="Custom border color"
355
- className="border-2 border-purple-500 focus:border-purple-700"
356
- rows={4}
357
- />
358
- </div>
359
-
360
- <div>
361
- <label htmlFor="no-rounded" className="block text-sm font-medium mb-1">
362
- Square Corners
363
- </label>
364
-
365
- <TextArea
366
- id="no-rounded"
367
- placeholder="No border radius"
368
- className="rounded-none"
369
- rows={4}
370
- />
371
- </div>
372
-
373
- <div>
374
- <label htmlFor="full-width" className="block text-sm font-medium mb-1">
375
- Full Width
376
- </label>
377
-
378
- <TextArea
379
- id="full-width"
380
- placeholder="Full width textarea"
381
- className="w-full resize-none"
382
- rows={4}
383
- />
384
- </div>
385
- </div>
386
- ),
387
- parameters: {
388
- docs: {
389
- description: {
390
- story:
391
- 'Examples of custom styling using className prop. The component uses tailwind-merge to properly handle class overrides.',
392
- },
393
- },
394
- },
395
- };
396
-
397
- export const Accessibility: Story = {
398
- render: () => (
399
- <div className="space-y-6 w-96">
400
- <div className="bg-blue-50 border border-blue-200 rounded p-4">
401
- <h3 className="font-bold text-blue-800 mb-2">Accessibility Features:</h3>
402
-
403
- <ul className="list-disc list-inside space-y-1 text-blue-700 text-sm">
404
- <li>Proper label association with htmlFor/id</li>
405
-
406
- <li>ARIA attributes for error states</li>
407
-
408
- <li>Descriptive error messages</li>
409
-
410
- <li>Keyboard navigation support</li>
411
-
412
- <li>Screen reader compatibility</li>
413
-
414
- <li>Character count announcements</li>
415
- </ul>
416
- </div>
417
-
418
- <div>
419
- <label htmlFor="accessible-textarea" className="block text-sm font-medium mb-1">
420
- Accessible Textarea Example
421
- </label>
422
-
423
- <TextArea
424
- id="accessible-textarea"
425
- placeholder="Enter your feedback..."
426
- rows={5}
427
- aria-describedby="textarea-help"
428
- maxLength={500}
429
- />
430
-
431
- <p id="textarea-help" className="text-gray-600 text-xs mt-1">
432
- Your feedback helps us improve our services. Maximum 500 characters.
433
- </p>
434
- </div>
435
-
436
- <div>
437
- <label htmlFor="accessible-error" className="block text-sm font-medium mb-1">
438
- Textarea with Error
439
- </label>
440
-
441
- <TextArea
442
- id="accessible-error"
443
- hasError
444
- value="This content needs review..."
445
- rows={4}
446
- aria-invalid="true"
447
- aria-describedby="accessible-error-msg"
448
- />
449
-
450
- <p id="accessible-error-msg" className="text-red-600 text-xs mt-1" role="alert">
451
- Please provide more specific details in your description.
452
- </p>
453
- </div>
454
- </div>
455
- ),
456
- parameters: {
457
- docs: {
458
- description: {
459
- story:
460
- 'Comprehensive accessibility example showing proper ARIA attributes, error handling, and screen reader support.',
461
- },
462
- },
463
- },
464
- };
@@ -1,232 +0,0 @@
1
- import { render, screen } from '@testing-library/react';
2
-
3
- import { TextArea } from './TextArea';
4
-
5
- // Constants for repeated class names
6
- const BORDER = 'border';
7
- const P_1 = 'p-1';
8
- const DISABLED_OPACITY = 'disabled:opacity-60';
9
- const DISABLED_BG = 'disabled:bg-gray-100';
10
- const BORDER_ERROR = 'border-error';
11
-
12
- describe('TextArea', () => {
13
- describe('general', () => {
14
- it('renders a textarea element', () => {
15
- render(<TextArea />);
16
-
17
- const textarea = screen.getByRole('textbox');
18
-
19
- expect(textarea).toBeInTheDocument();
20
- expect(textarea.tagName).toBe('TEXTAREA');
21
- });
22
-
23
- it('applies default classes', () => {
24
- render(<TextArea />);
25
-
26
- const textarea = screen.getByRole('textbox');
27
-
28
- expect(textarea).toHaveClass(BORDER, P_1, DISABLED_OPACITY, DISABLED_BG);
29
- });
30
-
31
- it('applies error styling when hasError is true', () => {
32
- render(<TextArea hasError />);
33
-
34
- const textarea = screen.getByRole('textbox');
35
-
36
- expect(textarea).toHaveClass(BORDER_ERROR);
37
- });
38
-
39
- it('does not apply error styling when hasError is false', () => {
40
- render(<TextArea hasError={false} />);
41
-
42
- const textarea = screen.getByRole('textbox');
43
-
44
- expect(textarea).not.toHaveClass(BORDER_ERROR);
45
- });
46
-
47
- it('does not apply error styling when hasError is undefined', () => {
48
- render(<TextArea />);
49
-
50
- const textarea = screen.getByRole('textbox');
51
-
52
- expect(textarea).not.toHaveClass(BORDER_ERROR);
53
- });
54
-
55
- it('merges custom className with default classes', () => {
56
- render(<TextArea className="custom-class" />);
57
-
58
- const textarea = screen.getByRole('textbox');
59
-
60
- expect(textarea).toHaveClass(BORDER, P_1, 'custom-class');
61
- });
62
-
63
- it('allows custom className to override default classes', () => {
64
- render(<TextArea className="p-4" />);
65
-
66
- const textarea = screen.getByRole('textbox');
67
-
68
- expect(textarea).toHaveClass('p-4');
69
- expect(textarea).toHaveClass(BORDER); // Base border class remains
70
- expect(textarea).not.toHaveClass(P_1); // Overridden by p-4
71
- });
72
-
73
- it('forwards standard textarea props', () => {
74
- render(
75
- <TextArea
76
- placeholder="Enter description"
77
- value="test content"
78
- name="description"
79
- id="description-textarea"
80
- rows={5}
81
- cols={50}
82
- readOnly
83
- />,
84
- );
85
-
86
- const textarea = screen.getByRole('textbox');
87
-
88
- expect(textarea).toHaveAttribute('placeholder', 'Enter description');
89
- expect(textarea).toHaveValue('test content'); // Use toHaveValue instead of toHaveAttribute
90
- expect(textarea).toHaveAttribute('name', 'description');
91
- expect(textarea).toHaveAttribute('id', 'description-textarea');
92
- expect(textarea).toHaveAttribute('rows', '5');
93
- expect(textarea).toHaveAttribute('cols', '50');
94
- expect(textarea).toHaveAttribute('readonly');
95
- });
96
-
97
- it('applies disabled styling when disabled', () => {
98
- render(<TextArea disabled />);
99
-
100
- const textarea = screen.getByRole('textbox');
101
-
102
- expect(textarea).toBeDisabled();
103
- expect(textarea).toHaveClass(DISABLED_OPACITY, DISABLED_BG);
104
- });
105
-
106
- it('combines hasError with custom className', () => {
107
- render(<TextArea hasError className="w-full" />);
108
-
109
- const textarea = screen.getByRole('textbox');
110
-
111
- expect(textarea).toHaveClass(BORDER_ERROR, 'w-full', BORDER, P_1);
112
- });
113
-
114
- it('supports required attribute', () => {
115
- render(<TextArea required />);
116
-
117
- const textarea = screen.getByRole('textbox');
118
-
119
- expect(textarea).toBeRequired();
120
- });
121
-
122
- it('supports aria attributes', () => {
123
- render(
124
- <TextArea
125
- aria-label="Description"
126
- aria-describedby="description-help"
127
- aria-invalid="true"
128
- />,
129
- );
130
-
131
- const textarea = screen.getByRole('textbox');
132
-
133
- expect(textarea).toHaveAttribute('aria-label', 'Description');
134
- expect(textarea).toHaveAttribute('aria-describedby', 'description-help');
135
- expect(textarea).toHaveAttribute('aria-invalid', 'true');
136
- });
137
-
138
- it('handles complex className override scenarios', () => {
139
- render(<TextArea hasError className="border-green-500 p-4" />);
140
-
141
- const textarea = screen.getByRole('textbox');
142
-
143
- // Custom classes should override defaults due to twMerge
144
- expect(textarea).toHaveClass('border-green-500', 'p-4');
145
- expect(textarea).toHaveClass(BORDER); // Base border class is still present
146
- expect(textarea).not.toHaveClass(P_1); // Overridden by p-4
147
- expect(textarea).not.toHaveClass(BORDER_ERROR); // Overridden by border-green-500
148
- });
149
-
150
- it('supports textarea-specific attributes', () => {
151
- render(<TextArea rows={10} cols={80} wrap="soft" maxLength={500} minLength={10} />);
152
-
153
- const textarea = screen.getByRole('textbox');
154
-
155
- expect(textarea).toHaveAttribute('rows', '10');
156
- expect(textarea).toHaveAttribute('cols', '80');
157
- expect(textarea).toHaveAttribute('wrap', 'soft');
158
- expect(textarea).toHaveAttribute('maxlength', '500');
159
- expect(textarea).toHaveAttribute('minlength', '10');
160
- });
161
- });
162
-
163
- describe('accessibility', () => {
164
- it('is accessible by role', () => {
165
- render(<TextArea />);
166
-
167
- expect(screen.getByRole('textbox')).toBeInTheDocument();
168
- });
169
-
170
- it('supports form labels via id', () => {
171
- render(
172
- <>
173
- <label htmlFor="test-textarea">Description</label>
174
-
175
- <TextArea id="test-textarea" />
176
- </>,
177
- );
178
-
179
- const textarea = screen.getByLabelText('Description');
180
-
181
- expect(textarea).toBeInTheDocument();
182
- expect(textarea.tagName).toBe('TEXTAREA');
183
- });
184
-
185
- it('supports error state for screen readers', () => {
186
- render(<TextArea hasError aria-invalid="true" />);
187
-
188
- const textarea = screen.getByRole('textbox');
189
-
190
- expect(textarea).toHaveAttribute('aria-invalid', 'true');
191
- expect(textarea).toHaveClass(BORDER_ERROR);
192
- });
193
-
194
- it('supports textarea with associated help text', () => {
195
- render(
196
- <>
197
- <label htmlFor="description">Description</label>
198
-
199
- <TextArea id="description" aria-describedby="description-help" />
200
-
201
- <div id="description-help">Please provide a detailed description</div>
202
- </>,
203
- );
204
-
205
- const textarea = screen.getByLabelText('Description');
206
-
207
- expect(textarea).toHaveAttribute('aria-describedby', 'description-help');
208
- });
209
- });
210
-
211
- describe('form integration', () => {
212
- it('works with controlled components', () => {
213
- const { rerender } = render(<TextArea value="initial value" readOnly />);
214
-
215
- let textarea = screen.getByRole('textbox');
216
-
217
- expect(textarea).toHaveValue('initial value');
218
-
219
- rerender(<TextArea value="updated value" readOnly />);
220
- textarea = screen.getByRole('textbox');
221
- expect(textarea).toHaveValue('updated value');
222
- });
223
-
224
- it('supports placeholder text', () => {
225
- render(<TextArea placeholder="Enter your thoughts here..." />);
226
-
227
- const textarea = screen.getByPlaceholderText('Enter your thoughts here...');
228
-
229
- expect(textarea).toBeInTheDocument();
230
- });
231
- });
232
- });