govuk-react 1.0.0-alpha.0 → 1.0.0-alpha.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 (479) hide show
  1. package/dist/components/accordion/index.d.ts +68 -0
  2. package/dist/components/accordion/index.js +104 -0
  3. package/dist/components/accordion/index.js.map +1 -0
  4. package/dist/components/back-link/index.d.ts +1 -0
  5. package/dist/components/back-link/index.js +2 -0
  6. package/dist/components/back-link/index.js.map +1 -0
  7. package/dist/components/body/index.d.ts +1 -0
  8. package/dist/components/body/index.js +2 -0
  9. package/dist/components/body/index.js.map +1 -0
  10. package/dist/components/breadcrumbs/index.js +2 -0
  11. package/dist/components/breadcrumbs/index.js.map +1 -0
  12. package/dist/components/button/index.d.ts +24 -0
  13. package/dist/components/button/index.js +17 -0
  14. package/dist/components/button/index.js.map +1 -0
  15. package/dist/components/caption/index.d.ts +1 -0
  16. package/dist/components/caption/index.js +2 -0
  17. package/dist/components/caption/index.js.map +1 -0
  18. package/dist/components/character-count/index.d.ts +36 -0
  19. package/dist/components/character-count/index.js +82 -0
  20. package/dist/components/character-count/index.js.map +1 -0
  21. package/dist/components/checkboxes/index.d.ts +49 -0
  22. package/dist/components/checkboxes/index.js +73 -0
  23. package/dist/components/checkboxes/index.js.map +1 -0
  24. package/dist/components/cookie-banner/index.js +2 -0
  25. package/dist/components/cookie-banner/index.js.map +1 -0
  26. package/dist/components/date-input/index.js +2 -0
  27. package/dist/components/date-input/index.js.map +1 -0
  28. package/dist/components/details/index.js +2 -0
  29. package/dist/components/details/index.js.map +1 -0
  30. package/dist/components/document-footer-metadata/index.d.ts +35 -0
  31. package/dist/components/document-footer-metadata/index.js +36 -0
  32. package/dist/components/document-footer-metadata/index.js.map +1 -0
  33. package/dist/components/error-message/index.d.ts +1 -0
  34. package/dist/components/error-message/index.js +2 -0
  35. package/dist/components/error-message/index.js.map +1 -0
  36. package/dist/components/error-summary/index.d.ts +22 -0
  37. package/dist/components/error-summary/index.js +49 -0
  38. package/dist/components/error-summary/index.js.map +1 -0
  39. package/dist/components/exit-this-page/index.d.ts +33 -0
  40. package/dist/components/exit-this-page/index.js +66 -0
  41. package/dist/components/exit-this-page/index.js.map +1 -0
  42. package/dist/components/feedback/index.js +2 -0
  43. package/dist/components/feedback/index.js.map +1 -0
  44. package/dist/components/fieldset/index.js +2 -0
  45. package/dist/components/fieldset/index.js.map +1 -0
  46. package/dist/components/file-upload/control.d.ts +6 -0
  47. package/dist/components/file-upload/control.js +9 -0
  48. package/dist/components/file-upload/control.js.map +1 -0
  49. package/dist/components/file-upload/enhanced.d.ts +45 -0
  50. package/dist/components/file-upload/enhanced.js +84 -0
  51. package/dist/components/file-upload/enhanced.js.map +1 -0
  52. package/dist/components/file-upload/index.d.ts +12 -0
  53. package/dist/components/file-upload/index.js +18 -0
  54. package/dist/components/file-upload/index.js.map +1 -0
  55. package/dist/components/footer/index.js +2 -0
  56. package/dist/components/footer/index.js.map +1 -0
  57. package/dist/components/form-group/index.d.ts +1 -0
  58. package/dist/components/form-group/index.js +2 -0
  59. package/dist/components/form-group/index.js.map +1 -0
  60. package/dist/components/generic-header/index.js +2 -0
  61. package/dist/components/generic-header/index.js.map +1 -0
  62. package/dist/components/grid-column/index.d.ts +1 -0
  63. package/dist/components/grid-column/index.js +2 -0
  64. package/dist/components/grid-column/index.js.map +1 -0
  65. package/dist/components/grid-row/index.d.ts +1 -0
  66. package/dist/components/grid-row/index.js +2 -0
  67. package/dist/components/grid-row/index.js.map +1 -0
  68. package/dist/components/header/index.js +2 -0
  69. package/dist/components/header/index.js.map +1 -0
  70. package/dist/components/heading/index.d.ts +1 -0
  71. package/dist/components/heading/index.js +2 -0
  72. package/dist/components/heading/index.js.map +1 -0
  73. package/dist/components/hint/index.d.ts +1 -0
  74. package/dist/components/hint/index.js +2 -0
  75. package/dist/components/hint/index.js.map +1 -0
  76. package/dist/components/input/index.js +2 -0
  77. package/dist/components/input/index.js.map +1 -0
  78. package/dist/components/inset-text/index.d.ts +1 -0
  79. package/dist/components/inset-text/index.js +2 -0
  80. package/dist/components/inset-text/index.js.map +1 -0
  81. package/dist/components/label/index.d.ts +1 -0
  82. package/dist/components/label/index.js +2 -0
  83. package/dist/components/label/index.js.map +1 -0
  84. package/dist/components/language-navigation/index.js +2 -0
  85. package/dist/components/language-navigation/index.js.map +1 -0
  86. package/dist/components/link/index.d.ts +1 -0
  87. package/dist/components/link/index.js +2 -0
  88. package/dist/components/link/index.js.map +1 -0
  89. package/dist/components/list/index.d.ts +1 -0
  90. package/dist/components/list/index.js +2 -0
  91. package/dist/components/list/index.js.map +1 -0
  92. package/dist/components/loading-box/index.d.ts +35 -0
  93. package/dist/components/loading-box/index.js +45 -0
  94. package/dist/components/loading-box/index.js.map +1 -0
  95. package/dist/components/main-wrapper/index.d.ts +1 -0
  96. package/dist/components/main-wrapper/index.js +2 -0
  97. package/dist/components/main-wrapper/index.js.map +1 -0
  98. package/dist/components/modal/index.d.ts +33 -0
  99. package/dist/components/modal/index.js +55 -0
  100. package/dist/components/modal/index.js.map +1 -0
  101. package/dist/components/notification-banner/index.d.ts +17 -0
  102. package/dist/components/notification-banner/index.js +44 -0
  103. package/dist/components/notification-banner/index.js.map +1 -0
  104. package/dist/{page.d.ts → components/page/index.d.ts} +2 -6
  105. package/dist/components/page/index.js +22 -0
  106. package/dist/components/page/index.js.map +1 -0
  107. package/dist/components/pagination/index.js +2 -0
  108. package/dist/components/pagination/index.js.map +1 -0
  109. package/dist/components/panel/index.js +2 -0
  110. package/dist/components/panel/index.js.map +1 -0
  111. package/dist/components/password-input/index.d.ts +26 -0
  112. package/dist/components/password-input/index.js +60 -0
  113. package/dist/components/password-input/index.js.map +1 -0
  114. package/dist/components/phase-banner/index.js +2 -0
  115. package/dist/components/phase-banner/index.js.map +1 -0
  116. package/dist/components/radios/index.d.ts +33 -0
  117. package/dist/components/radios/index.js +70 -0
  118. package/dist/components/radios/index.js.map +1 -0
  119. package/dist/components/related-items/index.d.ts +33 -0
  120. package/dist/components/related-items/index.js +45 -0
  121. package/dist/components/related-items/index.js.map +1 -0
  122. package/dist/components/search-box/index.d.ts +89 -0
  123. package/dist/components/search-box/index.js +136 -0
  124. package/dist/components/search-box/index.js.map +1 -0
  125. package/dist/components/section-break/index.d.ts +1 -0
  126. package/dist/components/section-break/index.js +2 -0
  127. package/dist/components/section-break/index.js.map +1 -0
  128. package/dist/components/select/index.js +2 -0
  129. package/dist/components/select/index.js.map +1 -0
  130. package/dist/components/service-navigation/index.d.ts +64 -0
  131. package/dist/components/service-navigation/index.js +131 -0
  132. package/dist/components/service-navigation/index.js.map +1 -0
  133. package/dist/{skip-link.d.ts → components/skip-link/index.d.ts} +2 -6
  134. package/dist/components/skip-link/index.js +16 -0
  135. package/dist/components/skip-link/index.js.map +1 -0
  136. package/dist/components/summary-list/index.js +2 -0
  137. package/dist/components/summary-list/index.js.map +1 -0
  138. package/dist/components/table/index.js +2 -0
  139. package/dist/components/table/index.js.map +1 -0
  140. package/dist/components/tabs/index.d.ts +98 -0
  141. package/dist/components/tabs/index.js +105 -0
  142. package/dist/components/tabs/index.js.map +1 -0
  143. package/dist/components/tag/index.d.ts +1 -0
  144. package/dist/components/tag/index.js +2 -0
  145. package/dist/components/tag/index.js.map +1 -0
  146. package/dist/components/task-list/index.js +2 -0
  147. package/dist/components/task-list/index.js.map +1 -0
  148. package/dist/components/textarea/index.js +2 -0
  149. package/dist/components/textarea/index.js.map +1 -0
  150. package/dist/components/visually-hidden/index.d.ts +1 -0
  151. package/dist/components/visually-hidden/index.js +2 -0
  152. package/dist/components/visually-hidden/index.js.map +1 -0
  153. package/dist/components/warning-text/index.js +2 -0
  154. package/dist/components/warning-text/index.js.map +1 -0
  155. package/dist/components/width-container/index.d.ts +1 -0
  156. package/dist/components/width-container/index.js +2 -0
  157. package/dist/components/width-container/index.js.map +1 -0
  158. package/dist/index.d.ts +58 -94
  159. package/dist/index.js +59 -59
  160. package/dist/index.js.map +1 -1
  161. package/dist/utils/join-ids.d.ts +2 -0
  162. package/dist/utils/join-ids.js +6 -0
  163. package/dist/utils/join-ids.js.map +1 -0
  164. package/package.json +6 -6
  165. package/dist/accordion.d.ts +0 -4
  166. package/dist/accordion.js +0 -4
  167. package/dist/accordion.js.map +0 -1
  168. package/dist/back-link.d.ts +0 -21
  169. package/dist/back-link.js +0 -4
  170. package/dist/back-link.js.map +0 -1
  171. package/dist/body.d.ts +0 -1
  172. package/dist/body.js +0 -4
  173. package/dist/body.js.map +0 -1
  174. package/dist/breadcrumbs.js +0 -3
  175. package/dist/breadcrumbs.js.map +0 -1
  176. package/dist/button.d.ts +0 -26
  177. package/dist/button.js +0 -4
  178. package/dist/button.js.map +0 -1
  179. package/dist/caption.d.ts +0 -1
  180. package/dist/caption.js +0 -4
  181. package/dist/caption.js.map +0 -1
  182. package/dist/character-count.d.ts +0 -4
  183. package/dist/character-count.js +0 -4
  184. package/dist/character-count.js.map +0 -1
  185. package/dist/checkboxes.d.ts +0 -3
  186. package/dist/checkboxes.js +0 -4
  187. package/dist/checkboxes.js.map +0 -1
  188. package/dist/chunk-2KPHO7N2.js +0 -3
  189. package/dist/chunk-2KPHO7N2.js.map +0 -1
  190. package/dist/chunk-2W35PR6E.js +0 -3
  191. package/dist/chunk-2W35PR6E.js.map +0 -1
  192. package/dist/chunk-57K6B6V2.js +0 -38
  193. package/dist/chunk-57K6B6V2.js.map +0 -1
  194. package/dist/chunk-5RYJUAI3.js +0 -3
  195. package/dist/chunk-5RYJUAI3.js.map +0 -1
  196. package/dist/chunk-5YT2PQAF.js +0 -3
  197. package/dist/chunk-5YT2PQAF.js.map +0 -1
  198. package/dist/chunk-B33BQUXM.js +0 -8
  199. package/dist/chunk-B33BQUXM.js.map +0 -1
  200. package/dist/chunk-BAXFWXMR.js +0 -41
  201. package/dist/chunk-BAXFWXMR.js.map +0 -1
  202. package/dist/chunk-BDIDAVNV.js +0 -22
  203. package/dist/chunk-BDIDAVNV.js.map +0 -1
  204. package/dist/chunk-D6TMELAY.js +0 -3
  205. package/dist/chunk-D6TMELAY.js.map +0 -1
  206. package/dist/chunk-DHTWPFZO.js +0 -8
  207. package/dist/chunk-DHTWPFZO.js.map +0 -1
  208. package/dist/chunk-DK2FZF7U.js +0 -3
  209. package/dist/chunk-DK2FZF7U.js.map +0 -1
  210. package/dist/chunk-EMM6RZT7.js +0 -3
  211. package/dist/chunk-EMM6RZT7.js.map +0 -1
  212. package/dist/chunk-EMNBPB3L.js +0 -8
  213. package/dist/chunk-EMNBPB3L.js.map +0 -1
  214. package/dist/chunk-FE2OFAA5.js +0 -8
  215. package/dist/chunk-FE2OFAA5.js.map +0 -1
  216. package/dist/chunk-FNDQEOKW.js +0 -20
  217. package/dist/chunk-FNDQEOKW.js.map +0 -1
  218. package/dist/chunk-HHH5BEO6.js +0 -3
  219. package/dist/chunk-HHH5BEO6.js.map +0 -1
  220. package/dist/chunk-HRURRTAU.js +0 -83
  221. package/dist/chunk-HRURRTAU.js.map +0 -1
  222. package/dist/chunk-IFETUZ4S.js +0 -3
  223. package/dist/chunk-IFETUZ4S.js.map +0 -1
  224. package/dist/chunk-JLNRFYFI.js +0 -3
  225. package/dist/chunk-JLNRFYFI.js.map +0 -1
  226. package/dist/chunk-K7VSNNQD.js +0 -8
  227. package/dist/chunk-K7VSNNQD.js.map +0 -1
  228. package/dist/chunk-KFWTQTVJ.js +0 -3
  229. package/dist/chunk-KFWTQTVJ.js.map +0 -1
  230. package/dist/chunk-L4GCVMBX.js +0 -3
  231. package/dist/chunk-L4GCVMBX.js.map +0 -1
  232. package/dist/chunk-L4O7OXGY.js +0 -151
  233. package/dist/chunk-L4O7OXGY.js.map +0 -1
  234. package/dist/chunk-LG7D7X4T.js +0 -8
  235. package/dist/chunk-LG7D7X4T.js.map +0 -1
  236. package/dist/chunk-M5BQAPSC.js +0 -8
  237. package/dist/chunk-M5BQAPSC.js.map +0 -1
  238. package/dist/chunk-NN44HUS7.js +0 -64
  239. package/dist/chunk-NN44HUS7.js.map +0 -1
  240. package/dist/chunk-NV2BSK6G.js +0 -3
  241. package/dist/chunk-NV2BSK6G.js.map +0 -1
  242. package/dist/chunk-OCGJIH5X.js +0 -159
  243. package/dist/chunk-OCGJIH5X.js.map +0 -1
  244. package/dist/chunk-OQVOKH2T.js +0 -8
  245. package/dist/chunk-OQVOKH2T.js.map +0 -1
  246. package/dist/chunk-OWBD4KZC.js +0 -115
  247. package/dist/chunk-OWBD4KZC.js.map +0 -1
  248. package/dist/chunk-PM2AAFY4.js +0 -35
  249. package/dist/chunk-PM2AAFY4.js.map +0 -1
  250. package/dist/chunk-PNMADTQQ.js +0 -3
  251. package/dist/chunk-PNMADTQQ.js.map +0 -1
  252. package/dist/chunk-PZ5AY32C.js +0 -9
  253. package/dist/chunk-PZ5AY32C.js.map +0 -1
  254. package/dist/chunk-QOWZLJK4.js +0 -3
  255. package/dist/chunk-QOWZLJK4.js.map +0 -1
  256. package/dist/chunk-QV7AS734.js +0 -98
  257. package/dist/chunk-QV7AS734.js.map +0 -1
  258. package/dist/chunk-RC24GP47.js +0 -8
  259. package/dist/chunk-RC24GP47.js.map +0 -1
  260. package/dist/chunk-RIB3ADHK.js +0 -8
  261. package/dist/chunk-RIB3ADHK.js.map +0 -1
  262. package/dist/chunk-RODK5NYM.js +0 -3
  263. package/dist/chunk-RODK5NYM.js.map +0 -1
  264. package/dist/chunk-SKQVJZMM.js +0 -79
  265. package/dist/chunk-SKQVJZMM.js.map +0 -1
  266. package/dist/chunk-SMUQZFJ7.js +0 -179
  267. package/dist/chunk-SMUQZFJ7.js.map +0 -1
  268. package/dist/chunk-SVIOO5V5.js +0 -109
  269. package/dist/chunk-SVIOO5V5.js.map +0 -1
  270. package/dist/chunk-SYW45KJ5.js +0 -3
  271. package/dist/chunk-SYW45KJ5.js.map +0 -1
  272. package/dist/chunk-T56AQZA4.js +0 -3
  273. package/dist/chunk-T56AQZA4.js.map +0 -1
  274. package/dist/chunk-TK6FAARU.js +0 -12
  275. package/dist/chunk-TK6FAARU.js.map +0 -1
  276. package/dist/chunk-TQOVKJLU.js +0 -78
  277. package/dist/chunk-TQOVKJLU.js.map +0 -1
  278. package/dist/chunk-U2FEV65D.js +0 -8
  279. package/dist/chunk-U2FEV65D.js.map +0 -1
  280. package/dist/chunk-UHX5TMH6.js +0 -49
  281. package/dist/chunk-UHX5TMH6.js.map +0 -1
  282. package/dist/chunk-VB3GA2KO.js +0 -3
  283. package/dist/chunk-VB3GA2KO.js.map +0 -1
  284. package/dist/chunk-VGZUAGCQ.js +0 -8
  285. package/dist/chunk-VGZUAGCQ.js.map +0 -1
  286. package/dist/chunk-VKUBJY23.js +0 -8
  287. package/dist/chunk-VKUBJY23.js.map +0 -1
  288. package/dist/chunk-VQ4FRNV3.js +0 -8
  289. package/dist/chunk-VQ4FRNV3.js.map +0 -1
  290. package/dist/chunk-W7RN6ITL.js +0 -8
  291. package/dist/chunk-W7RN6ITL.js.map +0 -1
  292. package/dist/chunk-WFHQPUFE.js +0 -3
  293. package/dist/chunk-WFHQPUFE.js.map +0 -1
  294. package/dist/chunk-XO7OW5TM.js +0 -3
  295. package/dist/chunk-XO7OW5TM.js.map +0 -1
  296. package/dist/chunk-YOBXV2EG.js +0 -101
  297. package/dist/chunk-YOBXV2EG.js.map +0 -1
  298. package/dist/chunk-YYDYVLVS.js +0 -47
  299. package/dist/chunk-YYDYVLVS.js.map +0 -1
  300. package/dist/chunk-Z4J4DQCF.js +0 -8
  301. package/dist/chunk-Z4J4DQCF.js.map +0 -1
  302. package/dist/chunk-ZHHORZMC.js +0 -3
  303. package/dist/chunk-ZHHORZMC.js.map +0 -1
  304. package/dist/cookie-banner.js +0 -3
  305. package/dist/cookie-banner.js.map +0 -1
  306. package/dist/date-input.js +0 -3
  307. package/dist/date-input.js.map +0 -1
  308. package/dist/details.js +0 -3
  309. package/dist/details.js.map +0 -1
  310. package/dist/document-footer-metadata.d.ts +0 -2
  311. package/dist/document-footer-metadata.js +0 -4
  312. package/dist/document-footer-metadata.js.map +0 -1
  313. package/dist/error-message.d.ts +0 -1
  314. package/dist/error-message.js +0 -4
  315. package/dist/error-message.js.map +0 -1
  316. package/dist/error-summary.d.ts +0 -3
  317. package/dist/error-summary.js +0 -4
  318. package/dist/error-summary.js.map +0 -1
  319. package/dist/exit-this-page.d.ts +0 -4
  320. package/dist/exit-this-page.js +0 -4
  321. package/dist/exit-this-page.js.map +0 -1
  322. package/dist/feedback.js +0 -3
  323. package/dist/feedback.js.map +0 -1
  324. package/dist/fieldset.js +0 -3
  325. package/dist/fieldset.js.map +0 -1
  326. package/dist/file-upload.d.ts +0 -90
  327. package/dist/file-upload.js +0 -4
  328. package/dist/file-upload.js.map +0 -1
  329. package/dist/footer.js +0 -3
  330. package/dist/footer.js.map +0 -1
  331. package/dist/form-group.d.ts +0 -1
  332. package/dist/form-group.js +0 -4
  333. package/dist/form-group.js.map +0 -1
  334. package/dist/generic-header.js +0 -3
  335. package/dist/generic-header.js.map +0 -1
  336. package/dist/grid-column.d.ts +0 -1
  337. package/dist/grid-column.js +0 -4
  338. package/dist/grid-column.js.map +0 -1
  339. package/dist/grid-row.d.ts +0 -1
  340. package/dist/grid-row.js +0 -4
  341. package/dist/grid-row.js.map +0 -1
  342. package/dist/header.js +0 -3
  343. package/dist/header.js.map +0 -1
  344. package/dist/heading.d.ts +0 -1
  345. package/dist/heading.js +0 -4
  346. package/dist/heading.js.map +0 -1
  347. package/dist/hint.d.ts +0 -1
  348. package/dist/hint.js +0 -4
  349. package/dist/hint.js.map +0 -1
  350. package/dist/index-7cuUiEo3.d.ts +0 -98
  351. package/dist/index-B8fw-F9t.d.ts +0 -22
  352. package/dist/index-BBckYYWt.d.ts +0 -131
  353. package/dist/index-BOPiKua4.d.ts +0 -61
  354. package/dist/index-BOfUYry5.d.ts +0 -22
  355. package/dist/index-BP18qbj1.d.ts +0 -22
  356. package/dist/index-BQaNJq4d.d.ts +0 -22
  357. package/dist/index-BnYaP7AC.d.ts +0 -57
  358. package/dist/index-C-c5LroN.d.ts +0 -22
  359. package/dist/index-CAxOsfPr.d.ts +0 -22
  360. package/dist/index-CHKQTetM.d.ts +0 -52
  361. package/dist/index-CWRQhs3p.d.ts +0 -55
  362. package/dist/index-CidkuScr.d.ts +0 -22
  363. package/dist/index-D-5h70y_.d.ts +0 -22
  364. package/dist/index-DDvVZ8mX.d.ts +0 -22
  365. package/dist/index-DQaFKwpy.d.ts +0 -106
  366. package/dist/index-DWibEGiF.d.ts +0 -22
  367. package/dist/index-D_wOwhn9.d.ts +0 -127
  368. package/dist/index-DhPVSZNZ.d.ts +0 -40
  369. package/dist/index-DhjWVeDK.d.ts +0 -22
  370. package/dist/index-DnvlWvry.d.ts +0 -54
  371. package/dist/index-Dr0S9iUZ.d.ts +0 -22
  372. package/dist/index-Dw9RbQVO.d.ts +0 -22
  373. package/dist/index-MxQB65RM.d.ts +0 -48
  374. package/dist/index-RZtIJBvk.d.ts +0 -22
  375. package/dist/index-TgEbRgDh.d.ts +0 -22
  376. package/dist/index-a8sYZpTj.d.ts +0 -77
  377. package/dist/index-rQaOtoWF.d.ts +0 -59
  378. package/dist/index-trAlT6HP.d.ts +0 -22
  379. package/dist/index-vBukON0x.d.ts +0 -50
  380. package/dist/input.js +0 -3
  381. package/dist/input.js.map +0 -1
  382. package/dist/inset-text.d.ts +0 -1
  383. package/dist/inset-text.js +0 -4
  384. package/dist/inset-text.js.map +0 -1
  385. package/dist/label.d.ts +0 -1
  386. package/dist/label.js +0 -4
  387. package/dist/label.js.map +0 -1
  388. package/dist/language-navigation.js +0 -3
  389. package/dist/language-navigation.js.map +0 -1
  390. package/dist/link.d.ts +0 -1
  391. package/dist/link.js +0 -4
  392. package/dist/link.js.map +0 -1
  393. package/dist/list.d.ts +0 -1
  394. package/dist/list.js +0 -4
  395. package/dist/list.js.map +0 -1
  396. package/dist/loading-box.d.ts +0 -39
  397. package/dist/loading-box.js +0 -4
  398. package/dist/loading-box.js.map +0 -1
  399. package/dist/main-wrapper.d.ts +0 -1
  400. package/dist/main-wrapper.js +0 -4
  401. package/dist/main-wrapper.js.map +0 -1
  402. package/dist/modal.d.ts +0 -4
  403. package/dist/modal.js +0 -4
  404. package/dist/modal.js.map +0 -1
  405. package/dist/notification-banner.d.ts +0 -3
  406. package/dist/notification-banner.js +0 -4
  407. package/dist/notification-banner.js.map +0 -1
  408. package/dist/page.js +0 -7
  409. package/dist/page.js.map +0 -1
  410. package/dist/pagination.js +0 -3
  411. package/dist/pagination.js.map +0 -1
  412. package/dist/panel.js +0 -3
  413. package/dist/panel.js.map +0 -1
  414. package/dist/password-input.d.ts +0 -4
  415. package/dist/password-input.js +0 -4
  416. package/dist/password-input.js.map +0 -1
  417. package/dist/phase-banner.js +0 -3
  418. package/dist/phase-banner.js.map +0 -1
  419. package/dist/radios.d.ts +0 -3
  420. package/dist/radios.js +0 -4
  421. package/dist/radios.js.map +0 -1
  422. package/dist/related-items.d.ts +0 -2
  423. package/dist/related-items.js +0 -4
  424. package/dist/related-items.js.map +0 -1
  425. package/dist/search-box.d.ts +0 -3
  426. package/dist/search-box.js +0 -4
  427. package/dist/search-box.js.map +0 -1
  428. package/dist/section-break.d.ts +0 -1
  429. package/dist/section-break.js +0 -4
  430. package/dist/section-break.js.map +0 -1
  431. package/dist/select.js +0 -3
  432. package/dist/select.js.map +0 -1
  433. package/dist/service-navigation.d.ts +0 -4
  434. package/dist/service-navigation.js +0 -4
  435. package/dist/service-navigation.js.map +0 -1
  436. package/dist/skip-link.js +0 -4
  437. package/dist/skip-link.js.map +0 -1
  438. package/dist/summary-list.js +0 -3
  439. package/dist/summary-list.js.map +0 -1
  440. package/dist/table.js +0 -3
  441. package/dist/table.js.map +0 -1
  442. package/dist/tabs.d.ts +0 -3
  443. package/dist/tabs.js +0 -4
  444. package/dist/tabs.js.map +0 -1
  445. package/dist/tag.d.ts +0 -1
  446. package/dist/tag.js +0 -4
  447. package/dist/tag.js.map +0 -1
  448. package/dist/task-list.js +0 -3
  449. package/dist/task-list.js.map +0 -1
  450. package/dist/textarea.js +0 -3
  451. package/dist/textarea.js.map +0 -1
  452. package/dist/visually-hidden.d.ts +0 -1
  453. package/dist/visually-hidden.js +0 -4
  454. package/dist/visually-hidden.js.map +0 -1
  455. package/dist/warning-text.js +0 -3
  456. package/dist/warning-text.js.map +0 -1
  457. package/dist/width-container.d.ts +0 -1
  458. package/dist/width-container.js +0 -4
  459. package/dist/width-container.js.map +0 -1
  460. /package/dist/{breadcrumbs.d.ts → components/breadcrumbs/index.d.ts} +0 -0
  461. /package/dist/{cookie-banner.d.ts → components/cookie-banner/index.d.ts} +0 -0
  462. /package/dist/{date-input.d.ts → components/date-input/index.d.ts} +0 -0
  463. /package/dist/{details.d.ts → components/details/index.d.ts} +0 -0
  464. /package/dist/{feedback.d.ts → components/feedback/index.d.ts} +0 -0
  465. /package/dist/{fieldset.d.ts → components/fieldset/index.d.ts} +0 -0
  466. /package/dist/{footer.d.ts → components/footer/index.d.ts} +0 -0
  467. /package/dist/{generic-header.d.ts → components/generic-header/index.d.ts} +0 -0
  468. /package/dist/{header.d.ts → components/header/index.d.ts} +0 -0
  469. /package/dist/{input.d.ts → components/input/index.d.ts} +0 -0
  470. /package/dist/{language-navigation.d.ts → components/language-navigation/index.d.ts} +0 -0
  471. /package/dist/{pagination.d.ts → components/pagination/index.d.ts} +0 -0
  472. /package/dist/{panel.d.ts → components/panel/index.d.ts} +0 -0
  473. /package/dist/{phase-banner.d.ts → components/phase-banner/index.d.ts} +0 -0
  474. /package/dist/{select.d.ts → components/select/index.d.ts} +0 -0
  475. /package/dist/{summary-list.d.ts → components/summary-list/index.d.ts} +0 -0
  476. /package/dist/{table.d.ts → components/table/index.d.ts} +0 -0
  477. /package/dist/{task-list.d.ts → components/task-list/index.d.ts} +0 -0
  478. /package/dist/{textarea.d.ts → components/textarea/index.d.ts} +0 -0
  479. /package/dist/{warning-text.d.ts → components/warning-text/index.d.ts} +0 -0
@@ -0,0 +1,131 @@
1
+ import * as React from 'react';
2
+ import { Children, useEffect, useRef } from 'react';
3
+ import { clsx } from 'clsx';
4
+ import * as Primitives from '@govuk-react/primitives/disclosure';
5
+ import * as Markup from 'govuk-frontend-react/service-navigation';
6
+ /*
7
+ * govuk-frontend-react's ServiceNavigation markup, with the menu button from
8
+ * @govuk-react/primitives. As in govuk-frontend, the navigation collapses behind the button
9
+ * below tablet width. Without JavaScript the navigation is always shown and the button hidden,
10
+ * unless you use `DetailsMenu`, which works without JavaScript.
11
+ */
12
+ export { Root, WidthContainer, Container, ServiceName, Link, Text, Item, ActiveFallback, ItemComposite, } from 'govuk-frontend-react/service-navigation';
13
+ /** govuk-frontend's tablet breakpoint, from which the navigation is always shown. */
14
+ const tablet = '(min-width: 40.0625em)';
15
+ export { Wrapper } from 'govuk-frontend-react/service-navigation';
16
+ /**
17
+ * govuk-frontend's menu: inside `Wrapper`, around `Toggle` and `List`. Below tablet width the
18
+ * button shows and hides the list once JavaScript runs. Without JavaScript the list is always
19
+ * shown and the button hidden.
20
+ */
21
+ export function Menu({ style, ...props }) {
22
+ // Takes no space, so govuk-frontend's styles still apply to the button and list.
23
+ return React.createElement(Primitives.Root, { media: tablet, style: { display: 'contents', ...style }, ...props });
24
+ }
25
+ /** The menu button, inside `Menu`. Hidden from tablet width up, and without JavaScript. */
26
+ export function Toggle(props) {
27
+ return (React.createElement(Primitives.Toggle, { asChild: true },
28
+ React.createElement(Markup.Toggle, { ...props })));
29
+ }
30
+ const detailsClass = 'govuk-react-service-navigation__details';
31
+ /** Styles govuk-frontend has no class for, hoisted and deduplicated by React. */
32
+ export const detailsCss = `
33
+ .${detailsClass}>summary{list-style:none}
34
+ .${detailsClass}>summary::-webkit-details-marker{display:none}
35
+ .${detailsClass}[open]>summary::after{transform:rotate(180deg)}
36
+ @supports selector(::details-content){@media ${tablet}{.${detailsClass}>summary{display:none}.${detailsClass}::details-content{content-visibility:visible;display:contents}}}
37
+ `;
38
+ /**
39
+ * A menu that works without JavaScript: a native `details`, inside `Wrapper`, around `Summary`
40
+ * and `List`. Below tablet width the summary shows and hides the list. From tablet width the list
41
+ * shows where the browser supports `::details-content` (Chrome and Edge 131, Safari 18.4,
42
+ * Firefox 143), and stays behind the menu where it doesn't.
43
+ *
44
+ * Check it with your users' assistive technology before choosing it over `Menu`. GOV.UK's audits
45
+ * of the Details component found VoiceOver doesn't convey a `summary`'s state on iOS before 17,
46
+ * and Dragon voice control can have trouble opening one.
47
+ *
48
+ * @see https://github.com/alphagov/govuk-design-system/issues/4030
49
+ * @see https://github.com/alphagov/govuk-frontend/issues/5310
50
+ */
51
+ export function DetailsMenu({ open, onOpenChange, onToggle, className, children, ...props }) {
52
+ const details = useRef(null);
53
+ const onOpenChangeRef = useRef(onOpenChange);
54
+ useEffect(() => {
55
+ onOpenChangeRef.current = onOpenChange;
56
+ });
57
+ // A menu opened before hydration is reported, rather than left out of step with `open`.
58
+ const initialOpen = useRef(open);
59
+ useEffect(() => {
60
+ var _a;
61
+ const node = details.current;
62
+ if (node && initialOpen.current !== undefined && node.open !== initialOpen.current) {
63
+ (_a = onOpenChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onOpenChangeRef, node.open);
64
+ }
65
+ }, []);
66
+ return (React.createElement("details", { ref: details, className: clsx(detailsClass, className), open: open, onToggle: (event) => {
67
+ onToggle === null || onToggle === void 0 ? void 0 : onToggle(event);
68
+ if (event.currentTarget.open !== open)
69
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event.currentTarget.open);
70
+ },
71
+ // The user can open it before hydration.
72
+ suppressHydrationWarning: true, ...props },
73
+ React.createElement("style", { href: detailsClass, precedence: "default" }, detailsCss),
74
+ children));
75
+ }
76
+ /** The menu button of `DetailsMenu`. Hidden from tablet width up, where the browser can show the list. */
77
+ export function Summary({ className, children = 'Menu', ...props }) {
78
+ return (React.createElement("summary", { className: clsx('govuk-service-navigation__toggle', className), ...props }, children));
79
+ }
80
+ /** The navigation list, inside `Menu` or `DetailsMenu`, or straight inside `Wrapper` with no menu. */
81
+ export function List(props) {
82
+ return (React.createElement(Primitives.Content, { asChild: true },
83
+ React.createElement(Markup.List, { ...props })));
84
+ }
85
+ function render({ serviceName, serviceHref, navigationLabel, menuButtonText, collapseNavigationOnMobile, open, onOpenChange, as, items, children, ...props }, renderMenu) {
86
+ const list = items
87
+ ? items.map((item, index) => React.createElement(Markup.ItemComposite, { key: index, ...item }))
88
+ : Children.toArray(children);
89
+ const collapse = collapseNavigationOnMobile !== null && collapseNavigationOnMobile !== void 0 ? collapseNavigationOnMobile : list.length > 1;
90
+ const hasServiceName = hasContent(serviceName);
91
+ return (React.createElement(Markup.Root, { as: as !== null && as !== void 0 ? as : (hasServiceName ? 'section' : 'div'), ...props },
92
+ React.createElement(Markup.WidthContainer, null,
93
+ React.createElement(Markup.Container, null,
94
+ hasServiceName && (React.createElement(Markup.ServiceName, null, serviceHref ? (React.createElement(Markup.Link, { href: serviceHref }, serviceName)) : (React.createElement(Markup.Text, null, serviceName)))),
95
+ list.length > 0 && (React.createElement(Markup.Wrapper, { "aria-label": navigationLabel || menuButtonText || 'Menu' }, collapse ? (renderMenu({ open, onOpenChange, menuButtonText, children: React.createElement(List, null, list) })) : (React.createElement(List, null, list))))))));
96
+ }
97
+ /**
98
+ * Service navigation helps users understand that they’re using your service and lets them navigate around your service.
99
+ *
100
+ * Children are `ItemComposite`s. The menu is govuk-frontend's: without JavaScript the
101
+ * navigation is always shown.
102
+ *
103
+ * @see https://design-system.service.gov.uk/components/service-navigation/
104
+ */
105
+ export function Composite(props) {
106
+ return render(props, ({ menuButtonText, children, ...menu }) => (React.createElement(Menu, { ...menu },
107
+ React.createElement(Toggle, null, menuButtonText),
108
+ children)));
109
+ }
110
+ /**
111
+ * Service navigation helps users understand that they’re using your service and lets them navigate around your service.
112
+ *
113
+ * Children are `ItemComposite`s. The menu is a `DetailsMenu`, which works without JavaScript but
114
+ * has screen reader and voice control caveats: see `DetailsMenu`.
115
+ *
116
+ * @see https://design-system.service.gov.uk/components/service-navigation/
117
+ */
118
+ export function DetailsComposite(props) {
119
+ return render(props, ({ menuButtonText, children, ...menu }) => (React.createElement(DetailsMenu, { ...menu },
120
+ React.createElement(Summary, null, menuButtonText),
121
+ children)));
122
+ }
123
+ // As govuk-frontend-react decides whether there is a service name.
124
+ function hasContent(node) {
125
+ if (node === null || node === undefined || node === false || node === true || node === '')
126
+ return false;
127
+ if (Array.isArray(node))
128
+ return node.some(hasContent);
129
+ return true;
130
+ }
131
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/service-navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,UAAU,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;AAElE;;;;;GAKG;AAEH,OAAO,EACL,IAAI,EACJ,cAAc,EACd,SAAS,EACT,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,aAAa,GAUd,MAAM,yCAAyC,CAAC;AAEjD,qFAAqF;AACrF,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAqB,MAAM,yCAAyC,CAAC;AAWrF;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAa;IACjD,iFAAiF;IACjF,OAAO,oBAAC,UAAU,CAAC,IAAI,IAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,KAAM,KAAK,GAAI,CAAC;AACjG,CAAC;AAID,2FAA2F;AAC3F,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,CACL,oBAAC,UAAU,CAAC,MAAM,I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AAM,UAAU,gBAAgB,CAAC,KAAqB;IACpD,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAC9D,oBAAC,WAAW,OAAK,IAAI;QACnB,oBAAC,OAAO,QAAE,cAAc,CAAW;QAClC,QAAQ,CACG,CACf,CAAC,CAAC;AACL,CAAC;AAED,mEAAmE;AACnE,SAAS,UAAU,CAAC,IAAe;IACjC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACxG,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import * as React from 'react';\nimport { Children, useEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\nimport type { ComponentProps, ReactNode } from 'react';\nimport * as Primitives from '@govuk-react/primitives/disclosure';\nimport * as Markup from 'govuk-frontend-react/service-navigation';\n\n/*\n * govuk-frontend-react's ServiceNavigation markup, with the menu button from\n * @govuk-react/primitives. As in govuk-frontend, the navigation collapses behind the button\n * below tablet width. Without JavaScript the navigation is always shown and the button hidden,\n * unless you use `DetailsMenu`, which works without JavaScript.\n */\n\nexport {\n Root,\n WidthContainer,\n Container,\n ServiceName,\n Link,\n Text,\n Item,\n ActiveFallback,\n ItemComposite,\n type RootProps,\n type WidthContainerProps,\n type ContainerProps,\n type ServiceNameProps,\n type LinkProps,\n type TextProps,\n type ItemProps,\n type ActiveFallbackProps,\n type ItemCompositeProps,\n} from 'govuk-frontend-react/service-navigation';\n\n/** govuk-frontend's tablet breakpoint, from which the navigation is always shown. */\nconst tablet = '(min-width: 40.0625em)';\n\nexport { Wrapper, type WrapperProps } from 'govuk-frontend-react/service-navigation';\n\ntype MenuState = {\n /** Whether the menu is open below tablet width, to control it once hydrated, such as to close it after navigating. */\n open?: boolean;\n /** Called when the user opens or closes the menu. */\n onOpenChange?: (open: boolean) => void;\n};\n\nexport type MenuProps = Omit<Primitives.RootProps, 'media' | 'defaultOpen'> & MenuState;\n\n/**\n * govuk-frontend's menu: inside `Wrapper`, around `Toggle` and `List`. Below tablet width the\n * button shows and hides the list once JavaScript runs. Without JavaScript the list is always\n * shown and the button hidden.\n */\nexport function Menu({ style, ...props }: MenuProps) {\n // Takes no space, so govuk-frontend's styles still apply to the button and list.\n return <Primitives.Root media={tablet} style={{ display: 'contents', ...style }} {...props} />;\n}\n\nexport type ToggleProps = Markup.ToggleProps;\n\n/** The menu button, inside `Menu`. Hidden from tablet width up, and without JavaScript. */\nexport function Toggle(props: ToggleProps) {\n return (\n <Primitives.Toggle asChild>\n <Markup.Toggle {...props} />\n </Primitives.Toggle>\n );\n}\n\nconst detailsClass = 'govuk-react-service-navigation__details';\n\n/** Styles govuk-frontend has no class for, hoisted and deduplicated by React. */\nexport const detailsCss = `\n.${detailsClass}>summary{list-style:none}\n.${detailsClass}>summary::-webkit-details-marker{display:none}\n.${detailsClass}[open]>summary::after{transform:rotate(180deg)}\n@supports selector(::details-content){@media ${tablet}{.${detailsClass}>summary{display:none}.${detailsClass}::details-content{content-visibility:visible;display:contents}}}\n`;\n\nexport type DetailsMenuProps = Omit<ComponentProps<'details'>, 'open'> & MenuState;\n\n/**\n * A menu that works without JavaScript: a native `details`, inside `Wrapper`, around `Summary`\n * and `List`. Below tablet width the summary shows and hides the list. From tablet width the list\n * shows where the browser supports `::details-content` (Chrome and Edge 131, Safari 18.4,\n * Firefox 143), and stays behind the menu where it doesn't.\n *\n * Check it with your users' assistive technology before choosing it over `Menu`. GOV.UK's audits\n * of the Details component found VoiceOver doesn't convey a `summary`'s state on iOS before 17,\n * and Dragon voice control can have trouble opening one.\n *\n * @see https://github.com/alphagov/govuk-design-system/issues/4030\n * @see https://github.com/alphagov/govuk-frontend/issues/5310\n */\nexport function DetailsMenu({ open, onOpenChange, onToggle, className, children, ...props }: DetailsMenuProps) {\n const details = useRef<HTMLDetailsElement>(null);\n const onOpenChangeRef = useRef(onOpenChange);\n useEffect(() => {\n onOpenChangeRef.current = onOpenChange;\n });\n // A menu opened before hydration is reported, rather than left out of step with `open`.\n const initialOpen = useRef(open);\n useEffect(() => {\n const node = details.current;\n if (node && initialOpen.current !== undefined && node.open !== initialOpen.current) {\n onOpenChangeRef.current?.(node.open);\n }\n }, []);\n return (\n <details\n ref={details}\n className={clsx(detailsClass, className)}\n open={open}\n onToggle={(event) => {\n onToggle?.(event);\n if (event.currentTarget.open !== open) onOpenChange?.(event.currentTarget.open);\n }}\n // The user can open it before hydration.\n suppressHydrationWarning\n {...props}\n >\n <style href={detailsClass} precedence=\"default\">\n {detailsCss}\n </style>\n {children}\n </details>\n );\n}\n\nexport type SummaryProps = ComponentProps<'summary'>;\n\n/** The menu button of `DetailsMenu`. Hidden from tablet width up, where the browser can show the list. */\nexport function Summary({ className, children = 'Menu', ...props }: SummaryProps) {\n return (\n <summary className={clsx('govuk-service-navigation__toggle', className)} {...props}>\n {children}\n </summary>\n );\n}\n\nexport type ListProps = Markup.ListProps;\n\n/** The navigation list, inside `Menu` or `DetailsMenu`, or straight inside `Wrapper` with no menu. */\nexport function List(props: ListProps) {\n return (\n <Primitives.Content asChild>\n <Markup.List {...props} />\n </Primitives.Content>\n );\n}\n\nexport type CompositeProps = Markup.CompositeProps & MenuState;\n\ntype MenuRenderer = (props: MenuState & { menuButtonText?: string; children: ReactNode }) => ReactNode;\n\nfunction render(\n {\n serviceName,\n serviceHref,\n navigationLabel,\n menuButtonText,\n collapseNavigationOnMobile,\n open,\n onOpenChange,\n as,\n items,\n children,\n ...props\n }: CompositeProps,\n renderMenu: MenuRenderer\n) {\n const list = items\n ? items.map((item, index) => <Markup.ItemComposite key={index} {...item} />)\n : Children.toArray(children);\n const collapse = collapseNavigationOnMobile ?? list.length > 1;\n const hasServiceName = hasContent(serviceName);\n return (\n <Markup.Root as={as ?? (hasServiceName ? 'section' : 'div')} {...props}>\n <Markup.WidthContainer>\n <Markup.Container>\n {hasServiceName && (\n <Markup.ServiceName>\n {serviceHref ? (\n <Markup.Link href={serviceHref}>{serviceName}</Markup.Link>\n ) : (\n <Markup.Text>{serviceName}</Markup.Text>\n )}\n </Markup.ServiceName>\n )}\n {list.length > 0 && (\n <Markup.Wrapper aria-label={navigationLabel || menuButtonText || 'Menu'}>\n {collapse ? (\n renderMenu({ open, onOpenChange, menuButtonText, children: <List>{list}</List> })\n ) : (\n <List>{list}</List>\n )}\n </Markup.Wrapper>\n )}\n </Markup.Container>\n </Markup.WidthContainer>\n </Markup.Root>\n );\n}\n\n/**\n * Service navigation helps users understand that they’re using your service and lets them navigate around your service.\n *\n * Children are `ItemComposite`s. The menu is govuk-frontend's: without JavaScript the\n * navigation is always shown.\n *\n * @see https://design-system.service.gov.uk/components/service-navigation/\n */\nexport function Composite(props: CompositeProps) {\n return render(props, ({ menuButtonText, children, ...menu }) => (\n <Menu {...menu}>\n <Toggle>{menuButtonText}</Toggle>\n {children}\n </Menu>\n ));\n}\n\n/**\n * Service navigation helps users understand that they’re using your service and lets them navigate around your service.\n *\n * Children are `ItemComposite`s. The menu is a `DetailsMenu`, which works without JavaScript but\n * has screen reader and voice control caveats: see `DetailsMenu`.\n *\n * @see https://design-system.service.gov.uk/components/service-navigation/\n */\nexport function DetailsComposite(props: CompositeProps) {\n return render(props, ({ menuButtonText, children, ...menu }) => (\n <DetailsMenu {...menu}>\n <Summary>{menuButtonText}</Summary>\n {children}\n </DetailsMenu>\n ));\n}\n\n// As govuk-frontend-react decides whether there is a service name.\nfunction hasContent(node: ReactNode): boolean {\n if (node === null || node === undefined || node === false || node === true || node === '') return false;\n if (Array.isArray(node)) return node.some(hasContent);\n return true;\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as Markup from 'govuk-frontend-react/skip-link';
3
-
4
- type SkipLinkProps = Markup.SkipLinkProps;
3
+ export type SkipLinkProps = Markup.SkipLinkProps;
5
4
  /**
6
5
  * Use the skip link component to help keyboard-only users skip to the main content on a page.
7
6
  *
@@ -10,7 +9,4 @@ type SkipLinkProps = Markup.SkipLinkProps;
10
9
  *
11
10
  * @see https://design-system.service.gov.uk/components/skip-link/
12
11
  */
13
- declare function SkipLink(props: SkipLinkProps): React.JSX.Element;
14
-
15
- export { SkipLink };
16
- export type { SkipLinkProps };
12
+ export declare function SkipLink(props: SkipLinkProps): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import * as FocusLinks from '@govuk-react/primitives/focus-links';
3
+ import * as Markup from 'govuk-frontend-react/skip-link';
4
+ /**
5
+ * Use the skip link component to help keyboard-only users skip to the main content on a page.
6
+ *
7
+ * As in govuk-frontend, once JavaScript runs it moves focus to the main content, which is outlined
8
+ * until focus moves on.
9
+ *
10
+ * @see https://design-system.service.gov.uk/components/skip-link/
11
+ */
12
+ export function SkipLink(props) {
13
+ return (React.createElement(FocusLinks.Root, { focusedClass: "govuk-skip-link-focused-element" },
14
+ React.createElement(Markup.SkipLink, { ...props })));
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/skip-link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AAIzD;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,CACL,oBAAC,UAAU,CAAC,IAAI,IAAC,YAAY,EAAC,iCAAiC;QAC7D,oBAAC,MAAM,CAAC,QAAQ,OAAK,KAAK,GAAI,CACd,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport * as FocusLinks from '@govuk-react/primitives/focus-links';\nimport * as Markup from 'govuk-frontend-react/skip-link';\n\nexport type SkipLinkProps = Markup.SkipLinkProps;\n\n/**\n * Use the skip link component to help keyboard-only users skip to the main content on a page.\n *\n * As in govuk-frontend, once JavaScript runs it moves focus to the main content, which is outlined\n * until focus moves on.\n *\n * @see https://design-system.service.gov.uk/components/skip-link/\n */\nexport function SkipLink(props: SkipLinkProps) {\n return (\n <FocusLinks.Root focusedClass=\"govuk-skip-link-focused-element\">\n <Markup.SkipLink {...props} />\n </FocusLinks.Root>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from 'govuk-frontend-react/summary-list';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/summary-list/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from 'govuk-frontend-react/summary-list';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from 'govuk-frontend-react/table';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from 'govuk-frontend-react/table';\n"]}
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ import * as Markup from 'govuk-frontend-react/tabs';
4
+ type BaseRootProps = Omit<Markup.RootProps, 'defaultValue' | 'onChange'> & {
5
+ /** Called when the user selects a tab. */
6
+ onValueChange?: (value: string) => void;
7
+ /**
8
+ * When controlled, what happens to a tab the user picked before hydration: "ignore" keeps
9
+ * `value`, "report" calls `onValueChange` with the pick so you can adopt it.
10
+ */
11
+ preHydration?: 'ignore' | 'report';
12
+ /** The panels' radio group name. Defaults to a generated one. */
13
+ name?: string;
14
+ };
15
+ export type RootProps = BaseRootProps & {
16
+ /** The selected tab's value, to control the tabs. */
17
+ value?: string;
18
+ /** The tab selected at first, when uncontrolled. Defaults to the first tab. */
19
+ defaultValue?: string;
20
+ };
21
+ /**
22
+ * Tabs can be a helpful way of letting users quickly switch between related information.
23
+ *
24
+ * As in govuk-frontend, without JavaScript the tabs are a list of links to every panel. Use `Tab`
25
+ * and `Panel` inside it. Each tab's `value` is its panel's id.
26
+ *
27
+ * @see https://design-system.service.gov.uk/components/tabs/
28
+ */
29
+ export declare function Root({ value, defaultValue, onValueChange, preHydration, name, ...props }: RootProps): React.JSX.Element;
30
+ export type RadiosRootProps = BaseRootProps & ({
31
+ value: string;
32
+ defaultValue?: string;
33
+ } | {
34
+ value?: string;
35
+ defaultValue: string;
36
+ });
37
+ /**
38
+ * Tabs that switch panels without JavaScript too, through a hidden radio in each panel. Use
39
+ * `RadioTab` and `RadioPanel` inside it. Each tab's `value` is its panel's id.
40
+ *
41
+ * @see https://design-system.service.gov.uk/components/tabs/
42
+ */
43
+ export declare function RadiosRoot({ value, defaultValue, onValueChange, preHydration, name, ...props }: RadiosRootProps): React.JSX.Element;
44
+ export { Title, type TitleProps } from 'govuk-frontend-react/tabs';
45
+ export type ListProps = Markup.ListProps;
46
+ export declare function List(props: ListProps): React.JSX.Element;
47
+ export type ListItemProps = Markup.ListItemProps & {
48
+ /** The value of the tab inside it. */
49
+ value: string;
50
+ };
51
+ export declare function ListItem({ value, selected, ...props }: ListItemProps): React.JSX.Element;
52
+ export type TabProps = Omit<Markup.TabProps, 'href' | 'asChild'> & {
53
+ /** Its panel's value, which is the panel's id. */
54
+ value: string;
55
+ };
56
+ /** A tab in a `Root`: a link to its panel. */
57
+ export declare function Tab({ value, children, ...props }: TabProps): React.JSX.Element;
58
+ export type RadioTabProps = TabProps & {
59
+ /** The panels' radio group name. Set by RadiosRoot: pass it to a tab rendered without one, such as in an island. */
60
+ name?: string;
61
+ };
62
+ /** A tab in a `RadiosRoot`: a label for its panel's radio. */
63
+ export declare function RadioTab({ value, name, children, ...props }: RadioTabProps): React.JSX.Element;
64
+ export type PanelProps = Omit<Markup.PanelProps, 'id'> & {
65
+ /** Its tab's value, which is the panel's id. */
66
+ value: string;
67
+ /** The panels' radio group name. Set by Root: pass it to a panel rendered without one, such as in an island. */
68
+ name?: string;
69
+ };
70
+ /** A panel in a `Root`. */
71
+ export declare function Panel({ value, selected, name, ...props }: PanelProps): React.JSX.Element;
72
+ export type RadioPanelProps = PanelProps;
73
+ /** A panel in a `RadiosRoot`, shown without JavaScript only while its tab is chosen. */
74
+ export declare function RadioPanel({ value, selected, name, ...props }: RadioPanelProps): React.JSX.Element;
75
+ export type CompositeItem = {
76
+ /** The panel's id, and the tab's value. */
77
+ id: string;
78
+ label: ReactNode;
79
+ panel: ReactNode;
80
+ };
81
+ export type CompositeProps = Omit<RootProps, 'title'> & {
82
+ /** The heading shown above the list of links when the tabs aren't shown. Defaults to "Contents". */
83
+ title?: ReactNode;
84
+ items: CompositeItem[];
85
+ };
86
+ /** The tabs, with a tab and panel for each item. Without JavaScript, a list of links to every panel. */
87
+ export declare function Composite({ title, items, value, defaultValue, ...props }: CompositeProps): React.JSX.Element;
88
+ export type RadiosCompositeProps = Omit<BaseRootProps, 'title'> & {
89
+ /** The heading shown above the list of tabs when they aren't styled as tabs. Defaults to "Contents". */
90
+ title?: ReactNode;
91
+ items: CompositeItem[];
92
+ /** The selected tab's value, to control the tabs. */
93
+ value?: string;
94
+ /** The tab selected at first, when uncontrolled. Defaults to the first tab. */
95
+ defaultValue?: string;
96
+ };
97
+ /** The tabs, with a tab and panel for each item. They switch panels without JavaScript too. */
98
+ export declare function RadiosComposite({ title, items, value, defaultValue, ...props }: RadiosCompositeProps): React.JSX.Element;
@@ -0,0 +1,105 @@
1
+ import * as React from 'react';
2
+ import { createContext, useContext } from 'react';
3
+ import * as Primitives from '@govuk-react/primitives/tabs';
4
+ import * as Markup from 'govuk-frontend-react/tabs';
5
+ /*
6
+ * govuk-frontend-react's Tabs markup, with the tab behaviour from @govuk-react/primitives. The
7
+ * behaviour matches govuk-frontend's: tabs from tablet width up, and a list of links to every
8
+ * panel below it or without JavaScript. With `RadiosRoot`, tabs switch without JavaScript too.
9
+ */
10
+ // Fills in defaults only: in an island without a Root, pass `selected` to the parts.
11
+ const TabsContext = createContext({});
12
+ /** govuk-frontend's tablet breakpoint, where its tabs start. */
13
+ const tablet = '(min-width: 40.0625em)';
14
+ // The classes govuk-frontend's styles key off.
15
+ const classes = {
16
+ media: tablet,
17
+ // govuk-frontend styles tabs under `govuk-frontend-supported`, which its JavaScript adds to the body.
18
+ upgradedClass: 'govuk-frontend-supported',
19
+ activeItemClass: 'govuk-tabs__list-item--selected',
20
+ hiddenContentClass: 'govuk-tabs__panel--hidden',
21
+ };
22
+ /**
23
+ * Tabs can be a helpful way of letting users quickly switch between related information.
24
+ *
25
+ * As in govuk-frontend, without JavaScript the tabs are a list of links to every panel. Use `Tab`
26
+ * and `Panel` inside it. Each tab's `value` is its panel's id.
27
+ *
28
+ * @see https://design-system.service.gov.uk/components/tabs/
29
+ */
30
+ export function Root({ value, defaultValue, onValueChange, preHydration, name, ...props }) {
31
+ return (React.createElement(TabsContext.Provider, { value: { selected: value !== null && value !== void 0 ? value : defaultValue } },
32
+ React.createElement(Primitives.Root, { value: value, defaultValue: defaultValue, onValueChange: onValueChange, preHydration: preHydration, name: name, ...classes },
33
+ React.createElement(Markup.Root, { ...props }))));
34
+ }
35
+ /**
36
+ * Tabs that switch panels without JavaScript too, through a hidden radio in each panel. Use
37
+ * `RadioTab` and `RadioPanel` inside it. Each tab's `value` is its panel's id.
38
+ *
39
+ * @see https://design-system.service.gov.uk/components/tabs/
40
+ */
41
+ export function RadiosRoot({ value, defaultValue, onValueChange, preHydration, name, ...props }) {
42
+ const selection = value !== undefined ? { value, defaultValue } : { defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : '' };
43
+ return (React.createElement(TabsContext.Provider, { value: { selected: value !== null && value !== void 0 ? value : defaultValue } },
44
+ React.createElement(Primitives.RadiosRoot, { ...selection, onValueChange: onValueChange, preHydration: preHydration, name: name, ...classes },
45
+ React.createElement(Markup.Root, { ...props }))));
46
+ }
47
+ export { Title } from 'govuk-frontend-react/tabs';
48
+ export function List(props) {
49
+ return (React.createElement(Primitives.List, { asChild: true },
50
+ React.createElement(Markup.List, { ...props })));
51
+ }
52
+ function useSelected(value, selected) {
53
+ const context = useContext(TabsContext);
54
+ // With no value set, the first tab is selected, which the parts can't know: the element selects it.
55
+ return selected !== null && selected !== void 0 ? selected : value === context.selected;
56
+ }
57
+ export function ListItem({ value, selected, ...props }) {
58
+ return (React.createElement(Primitives.Item, { value: value, asChild: true },
59
+ React.createElement(Markup.ListItem, { selected: useSelected(value, selected), ...props })));
60
+ }
61
+ /** A tab in a `Root`: a link to its panel. */
62
+ export function Tab({ value, children, ...props }) {
63
+ return (React.createElement(Primitives.Trigger, { value: value, asChild: true },
64
+ React.createElement(Markup.Tab, { ...props }, children)));
65
+ }
66
+ /** A tab in a `RadiosRoot`: a label for its panel's radio. */
67
+ export function RadioTab({ value, name, children, ...props }) {
68
+ return (React.createElement(Primitives.RadioTrigger, { value: value, name: name, asChild: true },
69
+ React.createElement(Markup.Tab, { asChild: true, ...props },
70
+ React.createElement("label", null, children))));
71
+ }
72
+ /** A panel in a `Root`. */
73
+ export function Panel({ value, selected, name, ...props }) {
74
+ const isSelected = useSelected(value, selected);
75
+ return (React.createElement(Primitives.Content, { value: value, name: name, defaultSelected: isSelected, asChild: true },
76
+ React.createElement(Markup.Panel, { selected: isSelected, ...props })));
77
+ }
78
+ /** A panel in a `RadiosRoot`, shown without JavaScript only while its tab is chosen. */
79
+ export function RadioPanel({ value, selected, name, ...props }) {
80
+ const isSelected = useSelected(value, selected);
81
+ return (React.createElement(Primitives.RadioContent, { value: value, name: name, defaultSelected: isSelected, asChild: true },
82
+ React.createElement(Markup.Panel, { selected: isSelected, ...props })));
83
+ }
84
+ /** The tabs, with a tab and panel for each item. Without JavaScript, a list of links to every panel. */
85
+ export function Composite({ title, items, value, defaultValue, ...props }) {
86
+ var _a;
87
+ // As in govuk-frontend, the first tab is selected unless another is.
88
+ const initial = value === undefined ? (defaultValue !== null && defaultValue !== void 0 ? defaultValue : (_a = items[0]) === null || _a === void 0 ? void 0 : _a.id) : defaultValue;
89
+ return (React.createElement(Root, { ...props, value: value, defaultValue: initial },
90
+ React.createElement(Markup.Title, null, title),
91
+ React.createElement(List, null, items.map((item) => (React.createElement(ListItem, { key: item.id, value: item.id },
92
+ React.createElement(Tab, { value: item.id }, item.label))))),
93
+ items.map((item) => (React.createElement(Panel, { key: item.id, value: item.id }, item.panel)))));
94
+ }
95
+ /** The tabs, with a tab and panel for each item. They switch panels without JavaScript too. */
96
+ export function RadiosComposite({ title, items, value, defaultValue, ...props }) {
97
+ var _a, _b;
98
+ const initial = (_b = defaultValue !== null && defaultValue !== void 0 ? defaultValue : (_a = items[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '';
99
+ return (React.createElement(RadiosRoot, { ...props, value: value, defaultValue: initial },
100
+ React.createElement(Markup.Title, null, title),
101
+ React.createElement(List, null, items.map((item) => (React.createElement(ListItem, { key: item.id, value: item.id },
102
+ React.createElement(RadioTab, { value: item.id }, item.label))))),
103
+ items.map((item) => (React.createElement(RadioPanel, { key: item.id, value: item.id }, item.panel)))));
104
+ }
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAEpD;;;;GAIG;AAEH,qFAAqF;AACrF,MAAM,WAAW,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC;AAE7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AC,IAAI,EAAE,EAAE,CAAC,CACnB,oBAAC,QAAQ,IAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE;YACpC,oBAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAG,IAAI,CAAC,KAAK,CAAY,CACxC,CACZ,CAAC,CACG;QACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,oBAAC,UAAU,IAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IACrC,IAAI,CAAC,KAAK,CACA,CACd,CAAC,CACS,CACd,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\nimport * as Primitives from '@govuk-react/primitives/tabs';\nimport * as Markup from 'govuk-frontend-react/tabs';\n\n/*\n * govuk-frontend-react's Tabs markup, with the tab behaviour from @govuk-react/primitives. The\n * behaviour matches govuk-frontend's: tabs from tablet width up, and a list of links to every\n * panel below it or without JavaScript. With `RadiosRoot`, tabs switch without JavaScript too.\n */\n\n// Fills in defaults only: in an island without a Root, pass `selected` to the parts.\nconst TabsContext = createContext<{ selected?: string }>({});\n\n/** govuk-frontend's tablet breakpoint, where its tabs start. */\nconst tablet = '(min-width: 40.0625em)';\n\ntype BaseRootProps = Omit<Markup.RootProps, 'defaultValue' | 'onChange'> & {\n /** Called when the user selects a tab. */\n onValueChange?: (value: string) => void;\n /**\n * When controlled, what happens to a tab the user picked before hydration: \"ignore\" keeps\n * `value`, \"report\" calls `onValueChange` with the pick so you can adopt it.\n */\n preHydration?: 'ignore' | 'report';\n /** The panels' radio group name. Defaults to a generated one. */\n name?: string;\n};\n\nexport type RootProps = BaseRootProps & {\n /** The selected tab's value, to control the tabs. */\n value?: string;\n /** The tab selected at first, when uncontrolled. Defaults to the first tab. */\n defaultValue?: string;\n};\n\n// The classes govuk-frontend's styles key off.\nconst classes = {\n media: tablet,\n // govuk-frontend styles tabs under `govuk-frontend-supported`, which its JavaScript adds to the body.\n upgradedClass: 'govuk-frontend-supported',\n activeItemClass: 'govuk-tabs__list-item--selected',\n hiddenContentClass: 'govuk-tabs__panel--hidden',\n};\n\n/**\n * Tabs can be a helpful way of letting users quickly switch between related information.\n *\n * As in govuk-frontend, without JavaScript the tabs are a list of links to every panel. Use `Tab`\n * and `Panel` inside it. Each tab's `value` is its panel's id.\n *\n * @see https://design-system.service.gov.uk/components/tabs/\n */\nexport function Root({ value, defaultValue, onValueChange, preHydration, name, ...props }: RootProps) {\n return (\n <TabsContext.Provider value={{ selected: value ?? defaultValue }}>\n <Primitives.Root\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n preHydration={preHydration}\n name={name}\n {...classes}\n >\n <Markup.Root {...props} />\n </Primitives.Root>\n </TabsContext.Provider>\n );\n}\n\nexport type RadiosRootProps = BaseRootProps &\n // Without JavaScript only the checked radio's panel shows, so one must be selected from the start.\n ({ value: string; defaultValue?: string } | { value?: string; defaultValue: string });\n\n/**\n * Tabs that switch panels without JavaScript too, through a hidden radio in each panel. Use\n * `RadioTab` and `RadioPanel` inside it. Each tab's `value` is its panel's id.\n *\n * @see https://design-system.service.gov.uk/components/tabs/\n */\nexport function RadiosRoot({ value, defaultValue, onValueChange, preHydration, name, ...props }: RadiosRootProps) {\n const selection: Pick<Primitives.RadiosRootProps, 'value' | 'defaultValue'> &\n ({ value: string } | { defaultValue: string }) =\n value !== undefined ? { value, defaultValue } : { defaultValue: defaultValue ?? '' };\n return (\n <TabsContext.Provider value={{ selected: value ?? defaultValue }}>\n <Primitives.RadiosRoot\n {...selection}\n onValueChange={onValueChange}\n preHydration={preHydration}\n name={name}\n {...classes}\n >\n <Markup.Root {...props} />\n </Primitives.RadiosRoot>\n </TabsContext.Provider>\n );\n}\n\nexport { Title, type TitleProps } from 'govuk-frontend-react/tabs';\n\nexport type ListProps = Markup.ListProps;\n\nexport function List(props: ListProps) {\n return (\n <Primitives.List asChild>\n <Markup.List {...props} />\n </Primitives.List>\n );\n}\n\nfunction useSelected(value: string, selected: boolean | undefined) {\n const context = useContext(TabsContext);\n // With no value set, the first tab is selected, which the parts can't know: the element selects it.\n return selected ?? value === context.selected;\n}\n\nexport type ListItemProps = Markup.ListItemProps & {\n /** The value of the tab inside it. */\n value: string;\n};\n\nexport function ListItem({ value, selected, ...props }: ListItemProps) {\n return (\n <Primitives.Item value={value} asChild>\n <Markup.ListItem selected={useSelected(value, selected)} {...props} />\n </Primitives.Item>\n );\n}\n\nexport type TabProps = Omit<Markup.TabProps, 'href' | 'asChild'> & {\n /** Its panel's value, which is the panel's id. */\n value: string;\n};\n\n/** A tab in a `Root`: a link to its panel. */\nexport function Tab({ value, children, ...props }: TabProps) {\n return (\n <Primitives.Trigger value={value} asChild>\n <Markup.Tab {...props}>{children}</Markup.Tab>\n </Primitives.Trigger>\n );\n}\n\nexport type RadioTabProps = TabProps & {\n /** The panels' radio group name. Set by RadiosRoot: pass it to a tab rendered without one, such as in an island. */\n name?: string;\n};\n\n/** A tab in a `RadiosRoot`: a label for its panel's radio. */\nexport function RadioTab({ value, name, children, ...props }: RadioTabProps) {\n return (\n <Primitives.RadioTrigger value={value} name={name} asChild>\n <Markup.Tab asChild {...props}>\n <label>{children}</label>\n </Markup.Tab>\n </Primitives.RadioTrigger>\n );\n}\n\nexport type PanelProps = Omit<Markup.PanelProps, 'id'> & {\n /** Its tab's value, which is the panel's id. */\n value: string;\n /** The panels' radio group name. Set by Root: pass it to a panel rendered without one, such as in an island. */\n name?: string;\n};\n\n/** A panel in a `Root`. */\nexport function Panel({ value, selected, name, ...props }: PanelProps) {\n const isSelected = useSelected(value, selected);\n return (\n <Primitives.Content value={value} name={name} defaultSelected={isSelected} asChild>\n <Markup.Panel selected={isSelected} {...props} />\n </Primitives.Content>\n );\n}\n\nexport type RadioPanelProps = PanelProps;\n\n/** A panel in a `RadiosRoot`, shown without JavaScript only while its tab is chosen. */\nexport function RadioPanel({ value, selected, name, ...props }: RadioPanelProps) {\n const isSelected = useSelected(value, selected);\n return (\n <Primitives.RadioContent value={value} name={name} defaultSelected={isSelected} asChild>\n <Markup.Panel selected={isSelected} {...props} />\n </Primitives.RadioContent>\n );\n}\n\nexport type CompositeItem = {\n /** The panel's id, and the tab's value. */\n id: string;\n label: ReactNode;\n panel: ReactNode;\n};\n\nexport type CompositeProps = Omit<RootProps, 'title'> & {\n /** The heading shown above the list of links when the tabs aren't shown. Defaults to \"Contents\". */\n title?: ReactNode;\n items: CompositeItem[];\n};\n\n/** The tabs, with a tab and panel for each item. Without JavaScript, a list of links to every panel. */\nexport function Composite({ title, items, value, defaultValue, ...props }: CompositeProps) {\n // As in govuk-frontend, the first tab is selected unless another is.\n const initial = value === undefined ? (defaultValue ?? items[0]?.id) : defaultValue;\n return (\n <Root {...props} value={value} defaultValue={initial}>\n <Markup.Title>{title}</Markup.Title>\n <List>\n {items.map((item) => (\n <ListItem key={item.id} value={item.id}>\n <Tab value={item.id}>{item.label}</Tab>\n </ListItem>\n ))}\n </List>\n {items.map((item) => (\n <Panel key={item.id} value={item.id}>\n {item.panel}\n </Panel>\n ))}\n </Root>\n );\n}\n\nexport type RadiosCompositeProps = Omit<BaseRootProps, 'title'> & {\n /** The heading shown above the list of tabs when they aren't styled as tabs. Defaults to \"Contents\". */\n title?: ReactNode;\n items: CompositeItem[];\n /** The selected tab's value, to control the tabs. */\n value?: string;\n /** The tab selected at first, when uncontrolled. Defaults to the first tab. */\n defaultValue?: string;\n};\n\n/** The tabs, with a tab and panel for each item. They switch panels without JavaScript too. */\nexport function RadiosComposite({ title, items, value, defaultValue, ...props }: RadiosCompositeProps) {\n const initial = defaultValue ?? items[0]?.id ?? '';\n return (\n <RadiosRoot {...props} value={value} defaultValue={initial}>\n <Markup.Title>{title}</Markup.Title>\n <List>\n {items.map((item) => (\n <ListItem key={item.id} value={item.id}>\n <RadioTab value={item.id}>{item.label}</RadioTab>\n </ListItem>\n ))}\n </List>\n {items.map((item) => (\n <RadioPanel key={item.id} value={item.id}>\n {item.panel}\n </RadioPanel>\n ))}\n </RadiosRoot>\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ export { Tag, type TagProps } from 'govuk-frontend-react/tag';
@@ -0,0 +1,2 @@
1
+ export { Tag } from 'govuk-frontend-react/tag';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/tag/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAiB,MAAM,0BAA0B,CAAC","sourcesContent":["export { Tag, type TagProps } from 'govuk-frontend-react/tag';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from 'govuk-frontend-react/task-list';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/task-list/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from 'govuk-frontend-react/task-list';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from 'govuk-frontend-react/textarea';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/textarea/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from 'govuk-frontend-react/textarea';\n"]}
@@ -0,0 +1 @@
1
+ export { VisuallyHidden, type VisuallyHiddenProps } from 'govuk-frontend-react/visually-hidden';
@@ -0,0 +1,2 @@
1
+ export { VisuallyHidden } from 'govuk-frontend-react/visually-hidden';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/visually-hidden/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,MAAM,sCAAsC,CAAC","sourcesContent":["export { VisuallyHidden, type VisuallyHiddenProps } from 'govuk-frontend-react/visually-hidden';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from 'govuk-frontend-react/warning-text';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/warning-text/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from 'govuk-frontend-react/warning-text';\n"]}
@@ -0,0 +1 @@
1
+ export { WidthContainer, type WidthContainerProps } from 'govuk-frontend-react/width-container';
@@ -0,0 +1,2 @@
1
+ export { WidthContainer } from 'govuk-frontend-react/width-container';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/width-container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,MAAM,sCAAsC,CAAC","sourcesContent":["export { WidthContainer, type WidthContainerProps } from 'govuk-frontend-react/width-container';\n"]}