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.
- package/dist/components/accordion/index.d.ts +68 -0
- package/dist/components/accordion/index.js +104 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/back-link/index.d.ts +1 -0
- package/dist/components/back-link/index.js +2 -0
- package/dist/components/back-link/index.js.map +1 -0
- package/dist/components/body/index.d.ts +1 -0
- package/dist/components/body/index.js +2 -0
- package/dist/components/body/index.js.map +1 -0
- package/dist/components/breadcrumbs/index.js +2 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/button/index.d.ts +24 -0
- package/dist/components/button/index.js +17 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/caption/index.d.ts +1 -0
- package/dist/components/caption/index.js +2 -0
- package/dist/components/caption/index.js.map +1 -0
- package/dist/components/character-count/index.d.ts +36 -0
- package/dist/components/character-count/index.js +82 -0
- package/dist/components/character-count/index.js.map +1 -0
- package/dist/components/checkboxes/index.d.ts +49 -0
- package/dist/components/checkboxes/index.js +73 -0
- package/dist/components/checkboxes/index.js.map +1 -0
- package/dist/components/cookie-banner/index.js +2 -0
- package/dist/components/cookie-banner/index.js.map +1 -0
- package/dist/components/date-input/index.js +2 -0
- package/dist/components/date-input/index.js.map +1 -0
- package/dist/components/details/index.js +2 -0
- package/dist/components/details/index.js.map +1 -0
- package/dist/components/document-footer-metadata/index.d.ts +35 -0
- package/dist/components/document-footer-metadata/index.js +36 -0
- package/dist/components/document-footer-metadata/index.js.map +1 -0
- package/dist/components/error-message/index.d.ts +1 -0
- package/dist/components/error-message/index.js +2 -0
- package/dist/components/error-message/index.js.map +1 -0
- package/dist/components/error-summary/index.d.ts +22 -0
- package/dist/components/error-summary/index.js +49 -0
- package/dist/components/error-summary/index.js.map +1 -0
- package/dist/components/exit-this-page/index.d.ts +33 -0
- package/dist/components/exit-this-page/index.js +66 -0
- package/dist/components/exit-this-page/index.js.map +1 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/components/feedback/index.js.map +1 -0
- package/dist/components/fieldset/index.js +2 -0
- package/dist/components/fieldset/index.js.map +1 -0
- package/dist/components/file-upload/control.d.ts +6 -0
- package/dist/components/file-upload/control.js +9 -0
- package/dist/components/file-upload/control.js.map +1 -0
- package/dist/components/file-upload/enhanced.d.ts +45 -0
- package/dist/components/file-upload/enhanced.js +84 -0
- package/dist/components/file-upload/enhanced.js.map +1 -0
- package/dist/components/file-upload/index.d.ts +12 -0
- package/dist/components/file-upload/index.js +18 -0
- package/dist/components/file-upload/index.js.map +1 -0
- package/dist/components/footer/index.js +2 -0
- package/dist/components/footer/index.js.map +1 -0
- package/dist/components/form-group/index.d.ts +1 -0
- package/dist/components/form-group/index.js +2 -0
- package/dist/components/form-group/index.js.map +1 -0
- package/dist/components/generic-header/index.js +2 -0
- package/dist/components/generic-header/index.js.map +1 -0
- package/dist/components/grid-column/index.d.ts +1 -0
- package/dist/components/grid-column/index.js +2 -0
- package/dist/components/grid-column/index.js.map +1 -0
- package/dist/components/grid-row/index.d.ts +1 -0
- package/dist/components/grid-row/index.js +2 -0
- package/dist/components/grid-row/index.js.map +1 -0
- package/dist/components/header/index.js +2 -0
- package/dist/components/header/index.js.map +1 -0
- package/dist/components/heading/index.d.ts +1 -0
- package/dist/components/heading/index.js +2 -0
- package/dist/components/heading/index.js.map +1 -0
- package/dist/components/hint/index.d.ts +1 -0
- package/dist/components/hint/index.js +2 -0
- package/dist/components/hint/index.js.map +1 -0
- package/dist/components/input/index.js +2 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/inset-text/index.d.ts +1 -0
- package/dist/components/inset-text/index.js +2 -0
- package/dist/components/inset-text/index.js.map +1 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/language-navigation/index.js +2 -0
- package/dist/components/language-navigation/index.js.map +1 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/link/index.js.map +1 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/index.js +2 -0
- package/dist/components/list/index.js.map +1 -0
- package/dist/components/loading-box/index.d.ts +35 -0
- package/dist/components/loading-box/index.js +45 -0
- package/dist/components/loading-box/index.js.map +1 -0
- package/dist/components/main-wrapper/index.d.ts +1 -0
- package/dist/components/main-wrapper/index.js +2 -0
- package/dist/components/main-wrapper/index.js.map +1 -0
- package/dist/components/modal/index.d.ts +33 -0
- package/dist/components/modal/index.js +55 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/notification-banner/index.d.ts +17 -0
- package/dist/components/notification-banner/index.js +44 -0
- package/dist/components/notification-banner/index.js.map +1 -0
- package/dist/{page.d.ts → components/page/index.d.ts} +2 -6
- package/dist/components/page/index.js +22 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/panel/index.js +2 -0
- package/dist/components/panel/index.js.map +1 -0
- package/dist/components/password-input/index.d.ts +26 -0
- package/dist/components/password-input/index.js +60 -0
- package/dist/components/password-input/index.js.map +1 -0
- package/dist/components/phase-banner/index.js +2 -0
- package/dist/components/phase-banner/index.js.map +1 -0
- package/dist/components/radios/index.d.ts +33 -0
- package/dist/components/radios/index.js +70 -0
- package/dist/components/radios/index.js.map +1 -0
- package/dist/components/related-items/index.d.ts +33 -0
- package/dist/components/related-items/index.js +45 -0
- package/dist/components/related-items/index.js.map +1 -0
- package/dist/components/search-box/index.d.ts +89 -0
- package/dist/components/search-box/index.js +136 -0
- package/dist/components/search-box/index.js.map +1 -0
- package/dist/components/section-break/index.d.ts +1 -0
- package/dist/components/section-break/index.js +2 -0
- package/dist/components/section-break/index.js.map +1 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/service-navigation/index.d.ts +64 -0
- package/dist/components/service-navigation/index.js +131 -0
- package/dist/components/service-navigation/index.js.map +1 -0
- package/dist/{skip-link.d.ts → components/skip-link/index.d.ts} +2 -6
- package/dist/components/skip-link/index.js +16 -0
- package/dist/components/skip-link/index.js.map +1 -0
- package/dist/components/summary-list/index.js +2 -0
- package/dist/components/summary-list/index.js.map +1 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +98 -0
- package/dist/components/tabs/index.js +105 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +2 -0
- package/dist/components/tag/index.js.map +1 -0
- package/dist/components/task-list/index.js +2 -0
- package/dist/components/task-list/index.js.map +1 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/index.js +2 -0
- package/dist/components/visually-hidden/index.js.map +1 -0
- package/dist/components/warning-text/index.js +2 -0
- package/dist/components/warning-text/index.js.map +1 -0
- package/dist/components/width-container/index.d.ts +1 -0
- package/dist/components/width-container/index.js +2 -0
- package/dist/components/width-container/index.js.map +1 -0
- package/dist/index.d.ts +58 -94
- package/dist/index.js +59 -59
- package/dist/index.js.map +1 -1
- package/dist/utils/join-ids.d.ts +2 -0
- package/dist/utils/join-ids.js +6 -0
- package/dist/utils/join-ids.js.map +1 -0
- package/package.json +6 -6
- package/dist/accordion.d.ts +0 -4
- package/dist/accordion.js +0 -4
- package/dist/accordion.js.map +0 -1
- package/dist/back-link.d.ts +0 -21
- package/dist/back-link.js +0 -4
- package/dist/back-link.js.map +0 -1
- package/dist/body.d.ts +0 -1
- package/dist/body.js +0 -4
- package/dist/body.js.map +0 -1
- package/dist/breadcrumbs.js +0 -3
- package/dist/breadcrumbs.js.map +0 -1
- package/dist/button.d.ts +0 -26
- package/dist/button.js +0 -4
- package/dist/button.js.map +0 -1
- package/dist/caption.d.ts +0 -1
- package/dist/caption.js +0 -4
- package/dist/caption.js.map +0 -1
- package/dist/character-count.d.ts +0 -4
- package/dist/character-count.js +0 -4
- package/dist/character-count.js.map +0 -1
- package/dist/checkboxes.d.ts +0 -3
- package/dist/checkboxes.js +0 -4
- package/dist/checkboxes.js.map +0 -1
- package/dist/chunk-2KPHO7N2.js +0 -3
- package/dist/chunk-2KPHO7N2.js.map +0 -1
- package/dist/chunk-2W35PR6E.js +0 -3
- package/dist/chunk-2W35PR6E.js.map +0 -1
- package/dist/chunk-57K6B6V2.js +0 -38
- package/dist/chunk-57K6B6V2.js.map +0 -1
- package/dist/chunk-5RYJUAI3.js +0 -3
- package/dist/chunk-5RYJUAI3.js.map +0 -1
- package/dist/chunk-5YT2PQAF.js +0 -3
- package/dist/chunk-5YT2PQAF.js.map +0 -1
- package/dist/chunk-B33BQUXM.js +0 -8
- package/dist/chunk-B33BQUXM.js.map +0 -1
- package/dist/chunk-BAXFWXMR.js +0 -41
- package/dist/chunk-BAXFWXMR.js.map +0 -1
- package/dist/chunk-BDIDAVNV.js +0 -22
- package/dist/chunk-BDIDAVNV.js.map +0 -1
- package/dist/chunk-D6TMELAY.js +0 -3
- package/dist/chunk-D6TMELAY.js.map +0 -1
- package/dist/chunk-DHTWPFZO.js +0 -8
- package/dist/chunk-DHTWPFZO.js.map +0 -1
- package/dist/chunk-DK2FZF7U.js +0 -3
- package/dist/chunk-DK2FZF7U.js.map +0 -1
- package/dist/chunk-EMM6RZT7.js +0 -3
- package/dist/chunk-EMM6RZT7.js.map +0 -1
- package/dist/chunk-EMNBPB3L.js +0 -8
- package/dist/chunk-EMNBPB3L.js.map +0 -1
- package/dist/chunk-FE2OFAA5.js +0 -8
- package/dist/chunk-FE2OFAA5.js.map +0 -1
- package/dist/chunk-FNDQEOKW.js +0 -20
- package/dist/chunk-FNDQEOKW.js.map +0 -1
- package/dist/chunk-HHH5BEO6.js +0 -3
- package/dist/chunk-HHH5BEO6.js.map +0 -1
- package/dist/chunk-HRURRTAU.js +0 -83
- package/dist/chunk-HRURRTAU.js.map +0 -1
- package/dist/chunk-IFETUZ4S.js +0 -3
- package/dist/chunk-IFETUZ4S.js.map +0 -1
- package/dist/chunk-JLNRFYFI.js +0 -3
- package/dist/chunk-JLNRFYFI.js.map +0 -1
- package/dist/chunk-K7VSNNQD.js +0 -8
- package/dist/chunk-K7VSNNQD.js.map +0 -1
- package/dist/chunk-KFWTQTVJ.js +0 -3
- package/dist/chunk-KFWTQTVJ.js.map +0 -1
- package/dist/chunk-L4GCVMBX.js +0 -3
- package/dist/chunk-L4GCVMBX.js.map +0 -1
- package/dist/chunk-L4O7OXGY.js +0 -151
- package/dist/chunk-L4O7OXGY.js.map +0 -1
- package/dist/chunk-LG7D7X4T.js +0 -8
- package/dist/chunk-LG7D7X4T.js.map +0 -1
- package/dist/chunk-M5BQAPSC.js +0 -8
- package/dist/chunk-M5BQAPSC.js.map +0 -1
- package/dist/chunk-NN44HUS7.js +0 -64
- package/dist/chunk-NN44HUS7.js.map +0 -1
- package/dist/chunk-NV2BSK6G.js +0 -3
- package/dist/chunk-NV2BSK6G.js.map +0 -1
- package/dist/chunk-OCGJIH5X.js +0 -159
- package/dist/chunk-OCGJIH5X.js.map +0 -1
- package/dist/chunk-OQVOKH2T.js +0 -8
- package/dist/chunk-OQVOKH2T.js.map +0 -1
- package/dist/chunk-OWBD4KZC.js +0 -115
- package/dist/chunk-OWBD4KZC.js.map +0 -1
- package/dist/chunk-PM2AAFY4.js +0 -35
- package/dist/chunk-PM2AAFY4.js.map +0 -1
- package/dist/chunk-PNMADTQQ.js +0 -3
- package/dist/chunk-PNMADTQQ.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -9
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-QOWZLJK4.js +0 -3
- package/dist/chunk-QOWZLJK4.js.map +0 -1
- package/dist/chunk-QV7AS734.js +0 -98
- package/dist/chunk-QV7AS734.js.map +0 -1
- package/dist/chunk-RC24GP47.js +0 -8
- package/dist/chunk-RC24GP47.js.map +0 -1
- package/dist/chunk-RIB3ADHK.js +0 -8
- package/dist/chunk-RIB3ADHK.js.map +0 -1
- package/dist/chunk-RODK5NYM.js +0 -3
- package/dist/chunk-RODK5NYM.js.map +0 -1
- package/dist/chunk-SKQVJZMM.js +0 -79
- package/dist/chunk-SKQVJZMM.js.map +0 -1
- package/dist/chunk-SMUQZFJ7.js +0 -179
- package/dist/chunk-SMUQZFJ7.js.map +0 -1
- package/dist/chunk-SVIOO5V5.js +0 -109
- package/dist/chunk-SVIOO5V5.js.map +0 -1
- package/dist/chunk-SYW45KJ5.js +0 -3
- package/dist/chunk-SYW45KJ5.js.map +0 -1
- package/dist/chunk-T56AQZA4.js +0 -3
- package/dist/chunk-T56AQZA4.js.map +0 -1
- package/dist/chunk-TK6FAARU.js +0 -12
- package/dist/chunk-TK6FAARU.js.map +0 -1
- package/dist/chunk-TQOVKJLU.js +0 -78
- package/dist/chunk-TQOVKJLU.js.map +0 -1
- package/dist/chunk-U2FEV65D.js +0 -8
- package/dist/chunk-U2FEV65D.js.map +0 -1
- package/dist/chunk-UHX5TMH6.js +0 -49
- package/dist/chunk-UHX5TMH6.js.map +0 -1
- package/dist/chunk-VB3GA2KO.js +0 -3
- package/dist/chunk-VB3GA2KO.js.map +0 -1
- package/dist/chunk-VGZUAGCQ.js +0 -8
- package/dist/chunk-VGZUAGCQ.js.map +0 -1
- package/dist/chunk-VKUBJY23.js +0 -8
- package/dist/chunk-VKUBJY23.js.map +0 -1
- package/dist/chunk-VQ4FRNV3.js +0 -8
- package/dist/chunk-VQ4FRNV3.js.map +0 -1
- package/dist/chunk-W7RN6ITL.js +0 -8
- package/dist/chunk-W7RN6ITL.js.map +0 -1
- package/dist/chunk-WFHQPUFE.js +0 -3
- package/dist/chunk-WFHQPUFE.js.map +0 -1
- package/dist/chunk-XO7OW5TM.js +0 -3
- package/dist/chunk-XO7OW5TM.js.map +0 -1
- package/dist/chunk-YOBXV2EG.js +0 -101
- package/dist/chunk-YOBXV2EG.js.map +0 -1
- package/dist/chunk-YYDYVLVS.js +0 -47
- package/dist/chunk-YYDYVLVS.js.map +0 -1
- package/dist/chunk-Z4J4DQCF.js +0 -8
- package/dist/chunk-Z4J4DQCF.js.map +0 -1
- package/dist/chunk-ZHHORZMC.js +0 -3
- package/dist/chunk-ZHHORZMC.js.map +0 -1
- package/dist/cookie-banner.js +0 -3
- package/dist/cookie-banner.js.map +0 -1
- package/dist/date-input.js +0 -3
- package/dist/date-input.js.map +0 -1
- package/dist/details.js +0 -3
- package/dist/details.js.map +0 -1
- package/dist/document-footer-metadata.d.ts +0 -2
- package/dist/document-footer-metadata.js +0 -4
- package/dist/document-footer-metadata.js.map +0 -1
- package/dist/error-message.d.ts +0 -1
- package/dist/error-message.js +0 -4
- package/dist/error-message.js.map +0 -1
- package/dist/error-summary.d.ts +0 -3
- package/dist/error-summary.js +0 -4
- package/dist/error-summary.js.map +0 -1
- package/dist/exit-this-page.d.ts +0 -4
- package/dist/exit-this-page.js +0 -4
- package/dist/exit-this-page.js.map +0 -1
- package/dist/feedback.js +0 -3
- package/dist/feedback.js.map +0 -1
- package/dist/fieldset.js +0 -3
- package/dist/fieldset.js.map +0 -1
- package/dist/file-upload.d.ts +0 -90
- package/dist/file-upload.js +0 -4
- package/dist/file-upload.js.map +0 -1
- package/dist/footer.js +0 -3
- package/dist/footer.js.map +0 -1
- package/dist/form-group.d.ts +0 -1
- package/dist/form-group.js +0 -4
- package/dist/form-group.js.map +0 -1
- package/dist/generic-header.js +0 -3
- package/dist/generic-header.js.map +0 -1
- package/dist/grid-column.d.ts +0 -1
- package/dist/grid-column.js +0 -4
- package/dist/grid-column.js.map +0 -1
- package/dist/grid-row.d.ts +0 -1
- package/dist/grid-row.js +0 -4
- package/dist/grid-row.js.map +0 -1
- package/dist/header.js +0 -3
- package/dist/header.js.map +0 -1
- package/dist/heading.d.ts +0 -1
- package/dist/heading.js +0 -4
- package/dist/heading.js.map +0 -1
- package/dist/hint.d.ts +0 -1
- package/dist/hint.js +0 -4
- package/dist/hint.js.map +0 -1
- package/dist/index-7cuUiEo3.d.ts +0 -98
- package/dist/index-B8fw-F9t.d.ts +0 -22
- package/dist/index-BBckYYWt.d.ts +0 -131
- package/dist/index-BOPiKua4.d.ts +0 -61
- package/dist/index-BOfUYry5.d.ts +0 -22
- package/dist/index-BP18qbj1.d.ts +0 -22
- package/dist/index-BQaNJq4d.d.ts +0 -22
- package/dist/index-BnYaP7AC.d.ts +0 -57
- package/dist/index-C-c5LroN.d.ts +0 -22
- package/dist/index-CAxOsfPr.d.ts +0 -22
- package/dist/index-CHKQTetM.d.ts +0 -52
- package/dist/index-CWRQhs3p.d.ts +0 -55
- package/dist/index-CidkuScr.d.ts +0 -22
- package/dist/index-D-5h70y_.d.ts +0 -22
- package/dist/index-DDvVZ8mX.d.ts +0 -22
- package/dist/index-DQaFKwpy.d.ts +0 -106
- package/dist/index-DWibEGiF.d.ts +0 -22
- package/dist/index-D_wOwhn9.d.ts +0 -127
- package/dist/index-DhPVSZNZ.d.ts +0 -40
- package/dist/index-DhjWVeDK.d.ts +0 -22
- package/dist/index-DnvlWvry.d.ts +0 -54
- package/dist/index-Dr0S9iUZ.d.ts +0 -22
- package/dist/index-Dw9RbQVO.d.ts +0 -22
- package/dist/index-MxQB65RM.d.ts +0 -48
- package/dist/index-RZtIJBvk.d.ts +0 -22
- package/dist/index-TgEbRgDh.d.ts +0 -22
- package/dist/index-a8sYZpTj.d.ts +0 -77
- package/dist/index-rQaOtoWF.d.ts +0 -59
- package/dist/index-trAlT6HP.d.ts +0 -22
- package/dist/index-vBukON0x.d.ts +0 -50
- package/dist/input.js +0 -3
- package/dist/input.js.map +0 -1
- package/dist/inset-text.d.ts +0 -1
- package/dist/inset-text.js +0 -4
- package/dist/inset-text.js.map +0 -1
- package/dist/label.d.ts +0 -1
- package/dist/label.js +0 -4
- package/dist/label.js.map +0 -1
- package/dist/language-navigation.js +0 -3
- package/dist/language-navigation.js.map +0 -1
- package/dist/link.d.ts +0 -1
- package/dist/link.js +0 -4
- package/dist/link.js.map +0 -1
- package/dist/list.d.ts +0 -1
- package/dist/list.js +0 -4
- package/dist/list.js.map +0 -1
- package/dist/loading-box.d.ts +0 -39
- package/dist/loading-box.js +0 -4
- package/dist/loading-box.js.map +0 -1
- package/dist/main-wrapper.d.ts +0 -1
- package/dist/main-wrapper.js +0 -4
- package/dist/main-wrapper.js.map +0 -1
- package/dist/modal.d.ts +0 -4
- package/dist/modal.js +0 -4
- package/dist/modal.js.map +0 -1
- package/dist/notification-banner.d.ts +0 -3
- package/dist/notification-banner.js +0 -4
- package/dist/notification-banner.js.map +0 -1
- package/dist/page.js +0 -7
- package/dist/page.js.map +0 -1
- package/dist/pagination.js +0 -3
- package/dist/pagination.js.map +0 -1
- package/dist/panel.js +0 -3
- package/dist/panel.js.map +0 -1
- package/dist/password-input.d.ts +0 -4
- package/dist/password-input.js +0 -4
- package/dist/password-input.js.map +0 -1
- package/dist/phase-banner.js +0 -3
- package/dist/phase-banner.js.map +0 -1
- package/dist/radios.d.ts +0 -3
- package/dist/radios.js +0 -4
- package/dist/radios.js.map +0 -1
- package/dist/related-items.d.ts +0 -2
- package/dist/related-items.js +0 -4
- package/dist/related-items.js.map +0 -1
- package/dist/search-box.d.ts +0 -3
- package/dist/search-box.js +0 -4
- package/dist/search-box.js.map +0 -1
- package/dist/section-break.d.ts +0 -1
- package/dist/section-break.js +0 -4
- package/dist/section-break.js.map +0 -1
- package/dist/select.js +0 -3
- package/dist/select.js.map +0 -1
- package/dist/service-navigation.d.ts +0 -4
- package/dist/service-navigation.js +0 -4
- package/dist/service-navigation.js.map +0 -1
- package/dist/skip-link.js +0 -4
- package/dist/skip-link.js.map +0 -1
- package/dist/summary-list.js +0 -3
- package/dist/summary-list.js.map +0 -1
- package/dist/table.js +0 -3
- package/dist/table.js.map +0 -1
- package/dist/tabs.d.ts +0 -3
- package/dist/tabs.js +0 -4
- package/dist/tabs.js.map +0 -1
- package/dist/tag.d.ts +0 -1
- package/dist/tag.js +0 -4
- package/dist/tag.js.map +0 -1
- package/dist/task-list.js +0 -3
- package/dist/task-list.js.map +0 -1
- package/dist/textarea.js +0 -3
- package/dist/textarea.js.map +0 -1
- package/dist/visually-hidden.d.ts +0 -1
- package/dist/visually-hidden.js +0 -4
- package/dist/visually-hidden.js.map +0 -1
- package/dist/warning-text.js +0 -3
- package/dist/warning-text.js.map +0 -1
- package/dist/width-container.d.ts +0 -1
- package/dist/width-container.js +0 -4
- package/dist/width-container.js.map +0 -1
- /package/dist/{breadcrumbs.d.ts → components/breadcrumbs/index.d.ts} +0 -0
- /package/dist/{cookie-banner.d.ts → components/cookie-banner/index.d.ts} +0 -0
- /package/dist/{date-input.d.ts → components/date-input/index.d.ts} +0 -0
- /package/dist/{details.d.ts → components/details/index.d.ts} +0 -0
- /package/dist/{feedback.d.ts → components/feedback/index.d.ts} +0 -0
- /package/dist/{fieldset.d.ts → components/fieldset/index.d.ts} +0 -0
- /package/dist/{footer.d.ts → components/footer/index.d.ts} +0 -0
- /package/dist/{generic-header.d.ts → components/generic-header/index.d.ts} +0 -0
- /package/dist/{header.d.ts → components/header/index.d.ts} +0 -0
- /package/dist/{input.d.ts → components/input/index.d.ts} +0 -0
- /package/dist/{language-navigation.d.ts → components/language-navigation/index.d.ts} +0 -0
- /package/dist/{pagination.d.ts → components/pagination/index.d.ts} +0 -0
- /package/dist/{panel.d.ts → components/panel/index.d.ts} +0 -0
- /package/dist/{phase-banner.d.ts → components/phase-banner/index.d.ts} +0 -0
- /package/dist/{select.d.ts → components/select/index.d.ts} +0 -0
- /package/dist/{summary-list.d.ts → components/summary-list/index.d.ts} +0 -0
- /package/dist/{table.d.ts → components/table/index.d.ts} +0 -0
- /package/dist/{task-list.d.ts → components/task-list/index.d.ts} +0 -0
- /package/dist/{textarea.d.ts → components/textarea/index.d.ts} +0 -0
- /package/dist/{warning-text.d.ts → components/warning-text/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/grid-row/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,2BAA2B,CAAC","sourcesContent":["export { GridRow, type GridRowProps } from 'govuk-frontend-react/grid';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/header/index.tsx"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from 'govuk-frontend-react/header';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Heading, type HeadingProps } from 'govuk-frontend-react/heading';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/heading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,8BAA8B,CAAC","sourcesContent":["export { Heading, type HeadingProps } from 'govuk-frontend-react/heading';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Hint, type HintProps } from 'govuk-frontend-react/hint';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/hint/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,2BAA2B,CAAC","sourcesContent":["export { Hint, type HintProps } from 'govuk-frontend-react/hint';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/input/index.tsx"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from 'govuk-frontend-react/input';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InsetText, type InsetTextProps } from 'govuk-frontend-react/inset-text';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/inset-text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,iCAAiC,CAAC","sourcesContent":["export { InsetText, type InsetTextProps } from 'govuk-frontend-react/inset-text';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label, LabelComposite, LabelWrapper, type LabelProps, type LabelCompositeProps, type LabelWrapperProps, } from 'govuk-frontend-react/label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/label/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,cAAc,EACd,YAAY,GAIb,MAAM,4BAA4B,CAAC","sourcesContent":["export {\n Label,\n LabelComposite,\n LabelWrapper,\n type LabelProps,\n type LabelCompositeProps,\n type LabelWrapperProps,\n} from 'govuk-frontend-react/label';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/language-navigation/index.tsx"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC","sourcesContent":["export * from 'govuk-frontend-react/language-navigation';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link, type LinkProps } from 'govuk-frontend-react/link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,2BAA2B,CAAC","sourcesContent":["export { Link, type LinkProps } from 'govuk-frontend-react/link';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { List, type ListProps } from 'govuk-frontend-react/list';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/list/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,2BAA2B,CAAC","sourcesContent":["export { List, type ListProps } from 'govuk-frontend-react/list';\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
/** Static styles, hoisted and deduplicated by React. Dynamic values come in through custom properties. */
|
|
4
|
+
export declare const loadingBoxCss = "\n.govuk-react-loading-box{position:relative;padding-bottom:2px;min-height:10px}\n.govuk-react-loading-box__overlay{position:absolute;inset:0;z-index:100;display:flex;justify-content:center;visibility:hidden;transition:visibility 0s linear var(--govuk-react-loading-box-time-out)}\n.govuk-react-loading-box__backdrop{position:absolute;inset:0;background-color:var(--govuk-react-loading-box-background-colour);opacity:0;transition:opacity var(--govuk-react-loading-box-time-out) ease-in-out}\n.govuk-react-loading-box__spinner{position:absolute;z-index:1;display:block;width:50px;height:100%;max-height:calc(50vh + 100px);opacity:0;transition:opacity var(--govuk-react-loading-box-time-out) ease-in-out}\n.govuk-react-loading-box__spinner rect{animation:govuk-react-loading-box-fade 1s infinite linear}\n.govuk-react-loading-box--loading>.govuk-react-loading-box__overlay{visibility:visible;transition-delay:0s}\n.govuk-react-loading-box--loading>.govuk-react-loading-box__overlay>.govuk-react-loading-box__backdrop{opacity:var(--govuk-react-loading-box-background-opacity);transition-duration:var(--govuk-react-loading-box-time-in)}\n.govuk-react-loading-box--loading>.govuk-react-loading-box__overlay>.govuk-react-loading-box__spinner{opacity:1;transition-duration:var(--govuk-react-loading-box-time-in);transition-delay:calc(var(--govuk-react-loading-box-time-in) / 2)}\n\n.govuk-react-loading-box__text{display:none;position:absolute;z-index:1;margin:0;padding-top:20px}\n@media (prefers-reduced-motion:reduce){.govuk-react-loading-box__overlay,.govuk-react-loading-box__backdrop,.govuk-react-loading-box__spinner{transition:none}.govuk-react-loading-box__spinner{display:none}.govuk-react-loading-box__text{display:block}}\n@keyframes govuk-react-loading-box-fade{0%{opacity:.250075}.01%{opacity:.25}.03%{opacity:1}100%{opacity:.250075}}\n";
|
|
5
|
+
export type LoadingBoxProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
6
|
+
/** Content that the loading box overlays. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Whether the content is loading. Shows the spinner and overlay, announces `statusText`, and sets `aria-busy` on the content. */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** Text announced to screen reader users while loading, and shown instead of the spinner when the user prefers reduced motion. Say what’s happening, such as “Sending your application”. */
|
|
11
|
+
statusText?: ReactNode;
|
|
12
|
+
/** Make the content inert while loading, so users can’t interact with it or move focus into it. Focus inside the content moves to the page body, so move focus yourself when loading ends. */
|
|
13
|
+
inertWhileLoading?: boolean;
|
|
14
|
+
/** Colour of the spinner, as any CSS colour. Defaults to the text colour. */
|
|
15
|
+
spinnerColor?: string;
|
|
16
|
+
/** Colour of the overlay, as any CSS colour. Defaults to the page background colour. */
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
/** Opacity of the overlay, from 0 to 1. */
|
|
19
|
+
backgroundColorOpacity?: number;
|
|
20
|
+
/** Length of the fade-in, in milliseconds. */
|
|
21
|
+
timeIn?: number;
|
|
22
|
+
/** Length of the fade-out, in milliseconds. */
|
|
23
|
+
timeOut?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Wraps content that loads asynchronously. While `loading` is `true`, a spinner and overlay cover the content and `statusText` is announced.
|
|
27
|
+
*
|
|
28
|
+
* - Say what’s happening in `statusText`, and keep it showing for at least a couple of seconds so it doesn’t flash and screen readers have time to announce it.
|
|
29
|
+
* - Don’t disable buttons while loading: disabled buttons have poor contrast and can confuse some users. Prevent repeat submissions in your submit handler, and on the server.
|
|
30
|
+
* - When loading ends, move focus to the result, or to the error summary if there are errors.
|
|
31
|
+
* - If loading fails or times out, show an error and a way to continue. Don’t leave the spinner running.
|
|
32
|
+
*
|
|
33
|
+
* @see https://github.com/alphagov/govuk-design-system/discussions/6167
|
|
34
|
+
*/
|
|
35
|
+
export declare function LoadingBox({ children, loading, statusText, inertWhileLoading, spinnerColor, backgroundColor, backgroundColorOpacity, timeIn, timeOut, className, style, ...props }: LoadingBoxProps): React.JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const name = 'govuk-react-loading-box';
|
|
3
|
+
/** Static styles, hoisted and deduplicated by React. Dynamic values come in through custom properties. */
|
|
4
|
+
export const loadingBoxCss = `
|
|
5
|
+
.${name}{position:relative;padding-bottom:2px;min-height:10px}
|
|
6
|
+
.${name}__overlay{position:absolute;inset:0;z-index:100;display:flex;justify-content:center;visibility:hidden;transition:visibility 0s linear var(--${name}-time-out)}
|
|
7
|
+
.${name}__backdrop{position:absolute;inset:0;background-color:var(--${name}-background-colour);opacity:0;transition:opacity var(--${name}-time-out) ease-in-out}
|
|
8
|
+
.${name}__spinner{position:absolute;z-index:1;display:block;width:50px;height:100%;max-height:calc(50vh + 100px);opacity:0;transition:opacity var(--${name}-time-out) ease-in-out}
|
|
9
|
+
.${name}__spinner rect{animation:${name}-fade 1s infinite linear}
|
|
10
|
+
.${name}--loading>.${name}__overlay{visibility:visible;transition-delay:0s}
|
|
11
|
+
.${name}--loading>.${name}__overlay>.${name}__backdrop{opacity:var(--${name}-background-opacity);transition-duration:var(--${name}-time-in)}
|
|
12
|
+
.${name}--loading>.${name}__overlay>.${name}__spinner{opacity:1;transition-duration:var(--${name}-time-in);transition-delay:calc(var(--${name}-time-in) / 2)}
|
|
13
|
+
|
|
14
|
+
.${name}__text{display:none;position:absolute;z-index:1;margin:0;padding-top:20px}
|
|
15
|
+
@media (prefers-reduced-motion:reduce){.${name}__overlay,.${name}__backdrop,.${name}__spinner{transition:none}.${name}__spinner{display:none}.${name}__text{display:block}}
|
|
16
|
+
@keyframes ${name}-fade{0%{opacity:.250075}.01%{opacity:.25}.03%{opacity:1}100%{opacity:.250075}}
|
|
17
|
+
`;
|
|
18
|
+
/**
|
|
19
|
+
* Wraps content that loads asynchronously. While `loading` is `true`, a spinner and overlay cover the content and `statusText` is announced.
|
|
20
|
+
*
|
|
21
|
+
* - Say what’s happening in `statusText`, and keep it showing for at least a couple of seconds so it doesn’t flash and screen readers have time to announce it.
|
|
22
|
+
* - Don’t disable buttons while loading: disabled buttons have poor contrast and can confuse some users. Prevent repeat submissions in your submit handler, and on the server.
|
|
23
|
+
* - When loading ends, move focus to the result, or to the error summary if there are errors.
|
|
24
|
+
* - If loading fails or times out, show an error and a way to continue. Don’t leave the spinner running.
|
|
25
|
+
*
|
|
26
|
+
* @see https://github.com/alphagov/govuk-design-system/discussions/6167
|
|
27
|
+
*/
|
|
28
|
+
export function LoadingBox({ children, loading = false, statusText = 'Loading', inertWhileLoading = false, spinnerColor = 'var(--govuk-text-colour, #0b0c0c)', backgroundColor = 'var(--govuk-body-background-colour, #fff)', backgroundColorOpacity = 0.85, timeIn = 800, timeOut = 200, className, style, ...props }) {
|
|
29
|
+
const variables = {
|
|
30
|
+
[`--${name}-background-colour`]: backgroundColor,
|
|
31
|
+
[`--${name}-background-opacity`]: String(backgroundColorOpacity),
|
|
32
|
+
[`--${name}-time-in`]: `${timeIn}ms`,
|
|
33
|
+
[`--${name}-time-out`]: `${timeOut}ms`,
|
|
34
|
+
...style,
|
|
35
|
+
};
|
|
36
|
+
return (React.createElement("div", { className: [name, loading && `${name}--loading`, className].filter(Boolean).join(' '), style: variables, ...props },
|
|
37
|
+
React.createElement("style", { href: name, precedence: "default" }, loadingBoxCss),
|
|
38
|
+
React.createElement("div", { className: `${name}__overlay`, "aria-hidden": "true" },
|
|
39
|
+
React.createElement("svg", { className: `${name}__spinner`, viewBox: "-25 -25 50 50", preserveAspectRatio: "xMidYMid meet", fill: spinnerColor, focusable: "false" }, Array.from({ length: 12 }, (_, i) => (React.createElement("rect", { key: i, width: "12", height: "5", rx: "2.5", ry: "2.5", opacity: "0", transform: `rotate(${i * 30}, 0, 2) translate(10 0)`, style: { animationDelay: `${i * 83}ms` } })))),
|
|
40
|
+
React.createElement("p", { className: `govuk-body govuk-!-font-weight-bold ${name}__text` }, statusText),
|
|
41
|
+
React.createElement("div", { className: `${name}__backdrop` })),
|
|
42
|
+
React.createElement("div", { className: "govuk-visually-hidden", role: "status" }, loading ? statusText : null),
|
|
43
|
+
React.createElement("div", { "aria-busy": loading, inert: inertWhileLoading && loading }, children)));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/loading-box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,IAAI,GAAG,yBAAyB,CAAC;AAEvC,0GAA0G;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAG;GAC1B,IAAI;GACJ,IAAI,+IAA+I,IAAI;GACvJ,IAAI,+DAA+D,IAAI,0DAA0D,IAAI;GACrI,IAAI,+IAA+I,IAAI;GACvJ,IAAI,4BAA4B,IAAI;GACpC,IAAI,cAAc,IAAI;GACtB,IAAI,cAAc,IAAI,cAAc,IAAI,4BAA4B,IAAI,kDAAkD,IAAI;GAC9H,IAAI,cAAc,IAAI,cAAc,IAAI,iDAAiD,IAAI,yCAAyC,IAAI;;GAE1I,IAAI;0CACmC,IAAI,cAAc,IAAI,eAAe,IAAI,8BAA8B,IAAI,2BAA2B,IAAI;aACvI,IAAI;CAChB,CAAC;AAuBF;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,UAAU,GAAG,SAAS,EACtB,iBAAiB,GAAG,KAAK,EACzB,YAAY,GAAG,mCAAmC,EAClD,eAAe,GAAG,2CAA2C,EAC7D,sBAAsB,GAAG,IAAI,EAC7B,MAAM,GAAG,GAAG,EACZ,OAAO,GAAG,GAAG,EACb,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACQ;IAChB,MAAM,SAAS,GAAkD;QAC/D,CAAC,KAAK,IAAI,oBAAoB,CAAC,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AAC,uBAAuB,EAAC,IAAI,EAAC,QAAQ,IACjD,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CACxB;QACN,0CAAgB,OAAO,EAAE,KAAK,EAAE,iBAAiB,IAAI,OAAO,IACzD,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport type { CSSProperties, ComponentProps, ReactNode } from 'react';\n\nconst name = 'govuk-react-loading-box';\n\n/** Static styles, hoisted and deduplicated by React. Dynamic values come in through custom properties. */\nexport const loadingBoxCss = `\n.${name}{position:relative;padding-bottom:2px;min-height:10px}\n.${name}__overlay{position:absolute;inset:0;z-index:100;display:flex;justify-content:center;visibility:hidden;transition:visibility 0s linear var(--${name}-time-out)}\n.${name}__backdrop{position:absolute;inset:0;background-color:var(--${name}-background-colour);opacity:0;transition:opacity var(--${name}-time-out) ease-in-out}\n.${name}__spinner{position:absolute;z-index:1;display:block;width:50px;height:100%;max-height:calc(50vh + 100px);opacity:0;transition:opacity var(--${name}-time-out) ease-in-out}\n.${name}__spinner rect{animation:${name}-fade 1s infinite linear}\n.${name}--loading>.${name}__overlay{visibility:visible;transition-delay:0s}\n.${name}--loading>.${name}__overlay>.${name}__backdrop{opacity:var(--${name}-background-opacity);transition-duration:var(--${name}-time-in)}\n.${name}--loading>.${name}__overlay>.${name}__spinner{opacity:1;transition-duration:var(--${name}-time-in);transition-delay:calc(var(--${name}-time-in) / 2)}\n\n.${name}__text{display:none;position:absolute;z-index:1;margin:0;padding-top:20px}\n@media (prefers-reduced-motion:reduce){.${name}__overlay,.${name}__backdrop,.${name}__spinner{transition:none}.${name}__spinner{display:none}.${name}__text{display:block}}\n@keyframes ${name}-fade{0%{opacity:.250075}.01%{opacity:.25}.03%{opacity:1}100%{opacity:.250075}}\n`;\n\nexport type LoadingBoxProps = Omit<ComponentProps<'div'>, 'title'> & {\n /** Content that the loading box overlays. */\n children?: ReactNode;\n /** Whether the content is loading. Shows the spinner and overlay, announces `statusText`, and sets `aria-busy` on the content. */\n loading?: boolean;\n /** Text announced to screen reader users while loading, and shown instead of the spinner when the user prefers reduced motion. Say what’s happening, such as “Sending your application”. */\n statusText?: ReactNode;\n /** Make the content inert while loading, so users can’t interact with it or move focus into it. Focus inside the content moves to the page body, so move focus yourself when loading ends. */\n inertWhileLoading?: boolean;\n /** Colour of the spinner, as any CSS colour. Defaults to the text colour. */\n spinnerColor?: string;\n /** Colour of the overlay, as any CSS colour. Defaults to the page background colour. */\n backgroundColor?: string;\n /** Opacity of the overlay, from 0 to 1. */\n backgroundColorOpacity?: number;\n /** Length of the fade-in, in milliseconds. */\n timeIn?: number;\n /** Length of the fade-out, in milliseconds. */\n timeOut?: number;\n};\n\n/**\n * Wraps content that loads asynchronously. While `loading` is `true`, a spinner and overlay cover the content and `statusText` is announced.\n *\n * - Say what’s happening in `statusText`, and keep it showing for at least a couple of seconds so it doesn’t flash and screen readers have time to announce it.\n * - Don’t disable buttons while loading: disabled buttons have poor contrast and can confuse some users. Prevent repeat submissions in your submit handler, and on the server.\n * - When loading ends, move focus to the result, or to the error summary if there are errors.\n * - If loading fails or times out, show an error and a way to continue. Don’t leave the spinner running.\n *\n * @see https://github.com/alphagov/govuk-design-system/discussions/6167\n */\nexport function LoadingBox({\n children,\n loading = false,\n statusText = 'Loading',\n inertWhileLoading = false,\n spinnerColor = 'var(--govuk-text-colour, #0b0c0c)',\n backgroundColor = 'var(--govuk-body-background-colour, #fff)',\n backgroundColorOpacity = 0.85,\n timeIn = 800,\n timeOut = 200,\n className,\n style,\n ...props\n}: LoadingBoxProps) {\n const variables: CSSProperties & Record<`--${string}`, string> = {\n [`--${name}-background-colour`]: backgroundColor,\n [`--${name}-background-opacity`]: String(backgroundColorOpacity),\n [`--${name}-time-in`]: `${timeIn}ms`,\n [`--${name}-time-out`]: `${timeOut}ms`,\n ...style,\n };\n return (\n <div\n className={[name, loading && `${name}--loading`, className].filter(Boolean).join(' ')}\n style={variables}\n {...props}\n >\n <style href={name} precedence=\"default\">\n {loadingBoxCss}\n </style>\n <div className={`${name}__overlay`} aria-hidden=\"true\">\n <svg\n className={`${name}__spinner`}\n viewBox=\"-25 -25 50 50\"\n preserveAspectRatio=\"xMidYMid meet\"\n fill={spinnerColor}\n focusable=\"false\"\n >\n {Array.from({ length: 12 }, (_, i) => (\n <rect\n key={i}\n width=\"12\"\n height=\"5\"\n rx=\"2.5\"\n ry=\"2.5\"\n opacity=\"0\"\n transform={`rotate(${i * 30}, 0, 2) translate(10 0)`}\n style={{ animationDelay: `${i * 83}ms` }}\n />\n ))}\n </svg>\n <p className={`govuk-body govuk-!-font-weight-bold ${name}__text`}>{statusText}</p>\n <div className={`${name}__backdrop`} />\n </div>\n <div className=\"govuk-visually-hidden\" role=\"status\">\n {loading ? statusText : null}\n </div>\n <div aria-busy={loading} inert={inertWhileLoading && loading}>\n {children}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MainWrapper, type MainWrapperProps } from 'govuk-frontend-react/main-wrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/main-wrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,mCAAmC,CAAC","sourcesContent":["export { MainWrapper, type MainWrapperProps } from 'govuk-frontend-react/main-wrapper';\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import * as Primitives from '@govuk-react/primitives/modal';
|
|
4
|
+
import { type ButtonProps } from 'govuk-frontend-react/button';
|
|
5
|
+
/** Styles govuk-frontend has no class for, hoisted and deduplicated by React. */
|
|
6
|
+
export declare const modalCss = "\n.govuk-react-modal{box-sizing:border-box;width:calc(100% - 30px);max-width:640px;max-height:calc(100% - 30px);padding:30px;border:5px solid var(--govuk-text-colour,#0b0c0c);background:var(--govuk-body-background-colour,#fff);color:var(--govuk-text-colour,#0b0c0c)}\n.govuk-react-modal:focus{outline:3px solid var(--govuk-focus-colour,#fd0);outline-offset:0}\n.govuk-react-modal::backdrop{background:rgb(11 12 12 / .8)}\n.govuk-react-modal>:last-child{margin-bottom:0}\n@media (max-width:40.0525em){.govuk-react-modal{padding:15px}}\n";
|
|
7
|
+
export type RootProps = Primitives.RootProps;
|
|
8
|
+
/** Holds the modal and the buttons that open and close it. */
|
|
9
|
+
export declare function Root({ children, ...props }: RootProps): React.JSX.Element;
|
|
10
|
+
export type TriggerProps = Omit<ButtonProps, 'as' | 'href' | 'type'> & Pick<Primitives.TriggerProps, 'dialogId'>;
|
|
11
|
+
/** A button that opens the modal. */
|
|
12
|
+
export declare function Trigger({ dialogId, ...props }: TriggerProps): React.JSX.Element;
|
|
13
|
+
export type CloseProps = TriggerProps;
|
|
14
|
+
/** A button that closes the modal. A secondary button, unless you pass another `variant`, or `undefined` for a primary one. */
|
|
15
|
+
export declare function Close({ dialogId, ...props }: CloseProps): React.JSX.Element;
|
|
16
|
+
export type ContentProps = Omit<Primitives.ContentProps, 'asChild'>;
|
|
17
|
+
/** The modal dialog. Give it a Title. */
|
|
18
|
+
export declare function Content({ className, ...props }: ContentProps): React.JSX.Element;
|
|
19
|
+
export type TitleProps = Omit<Primitives.TitleProps, 'asChild'>;
|
|
20
|
+
/** The modal's heading, which names it. */
|
|
21
|
+
export declare function Title({ className, ...props }: TitleProps): React.JSX.Element;
|
|
22
|
+
export type CompositeProps = Omit<RootProps, 'title'> & {
|
|
23
|
+
/** The text of the button that opens the modal. */
|
|
24
|
+
triggerText: ReactNode;
|
|
25
|
+
/** The modal's heading. */
|
|
26
|
+
title: ReactNode;
|
|
27
|
+
/** The text of the button that closes the modal. Defaults to "Cancel". */
|
|
28
|
+
closeText?: ReactNode;
|
|
29
|
+
/** Other actions, such as a button that confirms, shown before the close button. */
|
|
30
|
+
actions?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
/** A button that opens a modal with a title, content and actions. */
|
|
33
|
+
export declare function Composite({ triggerText, title, closeText, actions, children, ...props }: CompositeProps): React.JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import * as Primitives from '@govuk-react/primitives/modal';
|
|
4
|
+
import { Button } from 'govuk-frontend-react/button';
|
|
5
|
+
/*
|
|
6
|
+
* A modal dialog on GOV.UK styles, with the behaviour from @govuk-react/primitives. govuk-frontend
|
|
7
|
+
* has no modal, so its look follows the dialogs that GOV.UK services already use, such as the
|
|
8
|
+
* HMRC timeout warning. Where the browser supports invoker commands, it is a true modal without
|
|
9
|
+
* JavaScript.
|
|
10
|
+
*/
|
|
11
|
+
const name = 'govuk-react-modal';
|
|
12
|
+
/** Styles govuk-frontend has no class for, hoisted and deduplicated by React. */
|
|
13
|
+
export const modalCss = `
|
|
14
|
+
.${name}{box-sizing:border-box;width:calc(100% - 30px);max-width:640px;max-height:calc(100% - 30px);padding:30px;border:5px solid var(--govuk-text-colour,#0b0c0c);background:var(--govuk-body-background-colour,#fff);color:var(--govuk-text-colour,#0b0c0c)}
|
|
15
|
+
.${name}:focus{outline:3px solid var(--govuk-focus-colour,#fd0);outline-offset:0}
|
|
16
|
+
.${name}::backdrop{background:rgb(11 12 12 / .8)}
|
|
17
|
+
.${name}>:last-child{margin-bottom:0}
|
|
18
|
+
@media (max-width:40.0525em){.${name}{padding:15px}}
|
|
19
|
+
`;
|
|
20
|
+
/** Holds the modal and the buttons that open and close it. */
|
|
21
|
+
export function Root({ children, ...props }) {
|
|
22
|
+
return (React.createElement(Primitives.Root, { ...props },
|
|
23
|
+
React.createElement("style", { href: name, precedence: "default" }, modalCss),
|
|
24
|
+
children));
|
|
25
|
+
}
|
|
26
|
+
/** A button that opens the modal. */
|
|
27
|
+
export function Trigger({ dialogId, ...props }) {
|
|
28
|
+
return (React.createElement(Primitives.Trigger, { dialogId: dialogId, asChild: true },
|
|
29
|
+
React.createElement(Button, { type: "button", ...props })));
|
|
30
|
+
}
|
|
31
|
+
/** A button that closes the modal. A secondary button, unless you pass another `variant`, or `undefined` for a primary one. */
|
|
32
|
+
export function Close({ dialogId, ...props }) {
|
|
33
|
+
return (React.createElement(Primitives.Close, { dialogId: dialogId, asChild: true },
|
|
34
|
+
React.createElement(Button, { type: "button", variant: "secondary", ...props })));
|
|
35
|
+
}
|
|
36
|
+
/** The modal dialog. Give it a Title. */
|
|
37
|
+
export function Content({ className, ...props }) {
|
|
38
|
+
return React.createElement(Primitives.Content, { className: clsx(name, className), ...props });
|
|
39
|
+
}
|
|
40
|
+
/** The modal's heading, which names it. */
|
|
41
|
+
export function Title({ className, ...props }) {
|
|
42
|
+
return React.createElement(Primitives.Title, { className: clsx('govuk-heading-m', className), ...props });
|
|
43
|
+
}
|
|
44
|
+
/** A button that opens a modal with a title, content and actions. */
|
|
45
|
+
export function Composite({ triggerText, title, closeText = 'Cancel', actions, children, ...props }) {
|
|
46
|
+
return (React.createElement(Root, { ...props },
|
|
47
|
+
React.createElement(Trigger, null, triggerText),
|
|
48
|
+
React.createElement(Content, null,
|
|
49
|
+
React.createElement(Title, null, title),
|
|
50
|
+
children,
|
|
51
|
+
React.createElement("div", { className: "govuk-button-group" },
|
|
52
|
+
actions,
|
|
53
|
+
React.createElement(Close, null, closeText)))));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAoB,MAAM,6BAA6B,CAAC;AAEvE;;;;;GAKG;AAEH,MAAM,IAAI,GAAG,mBAAmB,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UAAU,CAAC,KAAK,IAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACxF,CAAC;AAaD,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,GAAG,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IACjH,OAAO,CACL,oBAAC,IAAI,OAAK,KAAK;QACb,oBAAC,OAAO,QAAE,WAAW,CAAW;QAChC,oBAAC,OAAO;YACN,oBAAC,KAAK,QAAE,KAAK,CAAS;YACrB,QAAQ;YACT,6BAAK,SAAS,EAAC,oBAAoB;gBAChC,OAAO;gBACR,oBAAC,KAAK,QAAE,SAAS,CAAS,CACtB,CACE,CACL,CACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport type { ReactNode } from 'react';\nimport { clsx } from 'clsx';\nimport * as Primitives from '@govuk-react/primitives/modal';\nimport { Button, type ButtonProps } from 'govuk-frontend-react/button';\n\n/*\n * A modal dialog on GOV.UK styles, with the behaviour from @govuk-react/primitives. govuk-frontend\n * has no modal, so its look follows the dialogs that GOV.UK services already use, such as the\n * HMRC timeout warning. Where the browser supports invoker commands, it is a true modal without\n * JavaScript.\n */\n\nconst name = 'govuk-react-modal';\n\n/** Styles govuk-frontend has no class for, hoisted and deduplicated by React. */\nexport const modalCss = `\n.${name}{box-sizing:border-box;width:calc(100% - 30px);max-width:640px;max-height:calc(100% - 30px);padding:30px;border:5px solid var(--govuk-text-colour,#0b0c0c);background:var(--govuk-body-background-colour,#fff);color:var(--govuk-text-colour,#0b0c0c)}\n.${name}:focus{outline:3px solid var(--govuk-focus-colour,#fd0);outline-offset:0}\n.${name}::backdrop{background:rgb(11 12 12 / .8)}\n.${name}>:last-child{margin-bottom:0}\n@media (max-width:40.0525em){.${name}{padding:15px}}\n`;\n\nexport type RootProps = Primitives.RootProps;\n\n/** Holds the modal and the buttons that open and close it. */\nexport function Root({ children, ...props }: RootProps) {\n return (\n <Primitives.Root {...props}>\n <style href={name} precedence=\"default\">\n {modalCss}\n </style>\n {children}\n </Primitives.Root>\n );\n}\n\nexport type TriggerProps = Omit<ButtonProps, 'as' | 'href' | 'type'> & Pick<Primitives.TriggerProps, 'dialogId'>;\n\n/** A button that opens the modal. */\nexport function Trigger({ dialogId, ...props }: TriggerProps) {\n return (\n <Primitives.Trigger dialogId={dialogId} asChild>\n <Button type=\"button\" {...props} />\n </Primitives.Trigger>\n );\n}\n\nexport type CloseProps = TriggerProps;\n\n/** A button that closes the modal. A secondary button, unless you pass another `variant`, or `undefined` for a primary one. */\nexport function Close({ dialogId, ...props }: CloseProps) {\n return (\n <Primitives.Close dialogId={dialogId} asChild>\n <Button type=\"button\" variant=\"secondary\" {...props} />\n </Primitives.Close>\n );\n}\n\nexport type ContentProps = Omit<Primitives.ContentProps, 'asChild'>;\n\n/** The modal dialog. Give it a Title. */\nexport function Content({ className, ...props }: ContentProps) {\n return <Primitives.Content className={clsx(name, className)} {...props} />;\n}\n\nexport type TitleProps = Omit<Primitives.TitleProps, 'asChild'>;\n\n/** The modal's heading, which names it. */\nexport function Title({ className, ...props }: TitleProps) {\n return <Primitives.Title className={clsx('govuk-heading-m', className)} {...props} />;\n}\n\nexport type CompositeProps = Omit<RootProps, 'title'> & {\n /** The text of the button that opens the modal. */\n triggerText: ReactNode;\n /** The modal's heading. */\n title: ReactNode;\n /** The text of the button that closes the modal. Defaults to \"Cancel\". */\n closeText?: ReactNode;\n /** Other actions, such as a button that confirms, shown before the close button. */\n actions?: ReactNode;\n};\n\n/** A button that opens a modal with a title, content and actions. */\nexport function Composite({ triggerText, title, closeText = 'Cancel', actions, children, ...props }: CompositeProps) {\n return (\n <Root {...props}>\n <Trigger>{triggerText}</Trigger>\n <Content>\n <Title>{title}</Title>\n {children}\n <div className=\"govuk-button-group\">\n {actions}\n <Close>{closeText}</Close>\n </div>\n </Content>\n </Root>\n );\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as Markup from 'govuk-frontend-react/notification-banner';
|
|
3
|
+
export { Header, Title, Content, Heading, Link, type HeaderProps, type TitleProps, type ContentProps, type HeadingProps, type LinkProps, } from 'govuk-frontend-react/notification-banner';
|
|
4
|
+
export type RootProps = Markup.RootProps;
|
|
5
|
+
/**
|
|
6
|
+
* Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
|
|
7
|
+
*
|
|
8
|
+
* @see https://design-system.service.gov.uk/components/notification-banner/
|
|
9
|
+
*/
|
|
10
|
+
export declare function Root({ disableAutoFocus, ...props }: RootProps): React.JSX.Element;
|
|
11
|
+
export type CompositeProps = Markup.CompositeProps;
|
|
12
|
+
/**
|
|
13
|
+
* Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
|
|
14
|
+
*
|
|
15
|
+
* @see https://design-system.service.gov.uk/components/notification-banner/
|
|
16
|
+
*/
|
|
17
|
+
export declare function Composite({ title, titleId, titleHeadingLevel, heading, success, children, ...props }: CompositeProps): React.JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AutoFocus from '@govuk-react/primitives/auto-focus';
|
|
3
|
+
import * as Markup from 'govuk-frontend-react/notification-banner';
|
|
4
|
+
/*
|
|
5
|
+
* govuk-frontend-react's NotificationBanner markup, with govuk-frontend's focus behaviour from
|
|
6
|
+
* @govuk-react/primitives. A success banner, or one with `role="alert"`, takes focus when it
|
|
7
|
+
* appears, and is rendered with `autofocus`, so it takes focus when the page loads even without
|
|
8
|
+
* JavaScript.
|
|
9
|
+
*/
|
|
10
|
+
export { Header, Title, Content, Heading, Link, } from 'govuk-frontend-react/notification-banner';
|
|
11
|
+
/**
|
|
12
|
+
* Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
|
|
13
|
+
*
|
|
14
|
+
* @see https://design-system.service.gov.uk/components/notification-banner/
|
|
15
|
+
*/
|
|
16
|
+
export function Root({ disableAutoFocus, ...props }) {
|
|
17
|
+
var _a;
|
|
18
|
+
// As govuk-frontend: only an alert takes focus.
|
|
19
|
+
const disabled = Boolean(disableAutoFocus) || ((_a = props.role) !== null && _a !== void 0 ? _a : (props.success ? 'alert' : 'region')) !== 'alert';
|
|
20
|
+
return (React.createElement(AutoFocus.Root, { disabled: disabled },
|
|
21
|
+
React.createElement(AutoFocus.Target, { asChild: true, disabled: disabled },
|
|
22
|
+
React.createElement(Markup.Root, { disableAutoFocus: disableAutoFocus, ...props }))));
|
|
23
|
+
}
|
|
24
|
+
const hasContent = (node) => {
|
|
25
|
+
if (node === null || node === undefined || node === false || node === true || node === '')
|
|
26
|
+
return false;
|
|
27
|
+
if (Array.isArray(node))
|
|
28
|
+
return node.some(hasContent);
|
|
29
|
+
return true;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.
|
|
33
|
+
*
|
|
34
|
+
* @see https://design-system.service.gov.uk/components/notification-banner/
|
|
35
|
+
*/
|
|
36
|
+
export function Composite({ title, titleId, titleHeadingLevel, heading, success, children, ...props }) {
|
|
37
|
+
return (React.createElement(Root, { success: success, ...(titleId && { 'aria-labelledby': titleId }), ...props },
|
|
38
|
+
React.createElement(Markup.Header, null,
|
|
39
|
+
React.createElement(Markup.Title, { headingLevel: titleHeadingLevel, ...(titleId && { id: titleId }) }, hasContent(title) ? title : success ? 'Success' : undefined)),
|
|
40
|
+
React.createElement(Markup.Content, null,
|
|
41
|
+
hasContent(heading) && React.createElement(Markup.Heading, null, heading),
|
|
42
|
+
children)));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/notification-banner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/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AAkB;IACnH,OAAO,CACL,oBAAC,IAAI,IAAC,OAAO,EAAE,OAAO,KAAM,CAAC,OAAO,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,KAAM,KAAK;QAChF,oBAAC,MAAM,CAAC,MAAM;YACZ,oBAAC,MAAM,CAAC,KAAK,IAAC,YAAY,EAAE,iBAAiB,KAAM,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,IAC5E,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAC/C,CACD;QAChB,oBAAC,MAAM,CAAC,OAAO;YACZ,UAAU,CAAC,OAAO,CAAC,IAAI,oBAAC,MAAM,CAAC,OAAO,QAAE,OAAO,CAAkB;YACjE,QAAQ,CACM,CACZ,CACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport * as AutoFocus from '@govuk-react/primitives/auto-focus';\nimport * as Markup from 'govuk-frontend-react/notification-banner';\n\n/*\n * govuk-frontend-react's NotificationBanner markup, with govuk-frontend's focus behaviour from\n * @govuk-react/primitives. A success banner, or one with `role=\"alert\"`, takes focus when it\n * appears, and is rendered with `autofocus`, so it takes focus when the page loads even without\n * JavaScript.\n */\n\nexport {\n Header,\n Title,\n Content,\n Heading,\n Link,\n type HeaderProps,\n type TitleProps,\n type ContentProps,\n type HeadingProps,\n type LinkProps,\n} from 'govuk-frontend-react/notification-banner';\n\nexport type RootProps = Markup.RootProps;\n\n/**\n * Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.\n *\n * @see https://design-system.service.gov.uk/components/notification-banner/\n */\nexport function Root({ disableAutoFocus, ...props }: RootProps) {\n // As govuk-frontend: only an alert takes focus.\n const disabled = Boolean(disableAutoFocus) || (props.role ?? (props.success ? 'alert' : 'region')) !== 'alert';\n return (\n <AutoFocus.Root disabled={disabled}>\n <AutoFocus.Target asChild disabled={disabled}>\n <Markup.Root disableAutoFocus={disableAutoFocus} {...props} />\n </AutoFocus.Target>\n </AutoFocus.Root>\n );\n}\n\nexport type CompositeProps = Markup.CompositeProps;\n\nconst hasContent = (node: React.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\n/**\n * Use a notification banner to tell the user about something they need to know about, but that’s not directly related to the page content.\n *\n * @see https://design-system.service.gov.uk/components/notification-banner/\n */\nexport function Composite({ title, titleId, titleHeadingLevel, heading, success, children, ...props }: CompositeProps) {\n return (\n <Root success={success} {...(titleId && { 'aria-labelledby': titleId })} {...props}>\n <Markup.Header>\n <Markup.Title headingLevel={titleHeadingLevel} {...(titleId && { id: titleId })}>\n {hasContent(title) ? title : success ? 'Success' : undefined}\n </Markup.Title>\n </Markup.Header>\n <Markup.Content>\n {hasContent(heading) && <Markup.Heading>{heading}</Markup.Heading>}\n {children}\n </Markup.Content>\n </Root>\n );\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type PageProps = {
|
|
2
|
+
export type PageProps = {
|
|
4
3
|
/** Page contents, rendered inside the main wrapper. */
|
|
5
4
|
children?: React.ReactNode;
|
|
6
5
|
/** Id of the main wrapper, which the skip link points to. */
|
|
@@ -21,7 +20,4 @@ type PageProps = {
|
|
|
21
20
|
* - https://design-system.service.gov.uk/styles/page-template/
|
|
22
21
|
* - https://design-system.service.gov.uk/styles/layout/#page-wrappers
|
|
23
22
|
*/
|
|
24
|
-
declare function Page({ header, footer, children, id, beforeChildren, skipLinkText, }: PageProps): React.JSX.Element;
|
|
25
|
-
|
|
26
|
-
export { Page };
|
|
27
|
-
export type { PageProps };
|
|
23
|
+
export declare function Page({ header, footer, children, id, beforeChildren, skipLinkText, }: PageProps): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SkipLink } from '../skip-link/index.js';
|
|
3
|
+
import { WidthContainer } from '../width-container/index.js';
|
|
4
|
+
import { MainWrapper } from '../main-wrapper/index.js';
|
|
5
|
+
import { Header as TemplateHeader, Footer as TemplateFooter } from 'govuk-frontend-react/template';
|
|
6
|
+
/**
|
|
7
|
+
* Lays out the body of a GOV.UK page: skip link, header and footer landmarks, width container and main wrapper.
|
|
8
|
+
* For custom layouts, compose `SkipLink`, `WidthContainer` and `MainWrapper` directly.
|
|
9
|
+
*
|
|
10
|
+
* - https://design-system.service.gov.uk/styles/page-template/
|
|
11
|
+
* - https://design-system.service.gov.uk/styles/layout/#page-wrappers
|
|
12
|
+
*/
|
|
13
|
+
export function Page({ header, footer, children, id = 'main-content', beforeChildren, skipLinkText = 'Skip to main content', }) {
|
|
14
|
+
return (React.createElement(React.Fragment, null,
|
|
15
|
+
React.createElement(SkipLink, { href: `#${id}` }, skipLinkText),
|
|
16
|
+
header && React.createElement(TemplateHeader, null, header),
|
|
17
|
+
React.createElement(WidthContainer, null,
|
|
18
|
+
beforeChildren,
|
|
19
|
+
React.createElement(MainWrapper, { id: id }, children)),
|
|
20
|
+
footer && React.createElement(TemplateFooter, null, footer)));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/page/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAiBnG;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,EAAE,GAAG,cAAc,EACnB,cAAc,EACd,YAAY,GAAG,sBAAsB,GAC3B;IACV,OAAO,CACL;QACE,oBAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAG,YAAY,CAAY;QAClD,MAAM,IAAI,oBAAC,cAAc,QAAE,MAAM,CAAkB;QACpD,oBAAC,cAAc;YACZ,cAAc;YACf,oBAAC,WAAW,IAAC,EAAE,EAAE,EAAE,IAAG,QAAQ,CAAe,CAC9B;QAChB,MAAM,IAAI,oBAAC,cAAc,QAAE,MAAM,CAAkB,CACnD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\nimport { SkipLink } from '../skip-link/index.js';\nimport { WidthContainer } from '../width-container/index.js';\nimport { MainWrapper } from '../main-wrapper/index.js';\nimport { Header as TemplateHeader, Footer as TemplateFooter } from 'govuk-frontend-react/template';\n\nexport type PageProps = {\n /** Page contents, rendered inside the main wrapper. */\n children?: React.ReactNode;\n /** Id of the main wrapper, which the skip link points to. */\n id?: string;\n /** Page header, such as `Header.Composite` or `ServiceNavigation`. */\n header?: React.ReactNode;\n /** Page footer, such as `Footer.Composite`. */\n footer?: React.ReactNode;\n /** Content outside the main wrapper but inside the width container, such as a back link, breadcrumbs or phase banner. */\n beforeChildren?: React.ReactNode;\n /** Text for the skip link. */\n skipLinkText?: React.ReactNode;\n};\n\n/**\n * Lays out the body of a GOV.UK page: skip link, header and footer landmarks, width container and main wrapper.\n * For custom layouts, compose `SkipLink`, `WidthContainer` and `MainWrapper` directly.\n *\n * - https://design-system.service.gov.uk/styles/page-template/\n * - https://design-system.service.gov.uk/styles/layout/#page-wrappers\n */\nexport function Page({\n header,\n footer,\n children,\n id = 'main-content',\n beforeChildren,\n skipLinkText = 'Skip to main content',\n}: PageProps) {\n return (\n <>\n <SkipLink href={`#${id}`}>{skipLinkText}</SkipLink>\n {header && <TemplateHeader>{header}</TemplateHeader>}\n <WidthContainer>\n {beforeChildren}\n <MainWrapper id={id}>{children}</MainWrapper>\n </WidthContainer>\n {footer && <TemplateFooter>{footer}</TemplateFooter>}\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/pagination/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","sourcesContent":["export * from 'govuk-frontend-react/pagination';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/panel/index.tsx"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from 'govuk-frontend-react/panel';\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as Primitives from '@govuk-react/primitives/password-input';
|
|
3
|
+
import * as Markup from 'govuk-frontend-react/password-input';
|
|
4
|
+
export type RootProps = Markup.RootProps;
|
|
5
|
+
/**
|
|
6
|
+
* Help users accessibly enter passwords.
|
|
7
|
+
*
|
|
8
|
+
* @see https://design-system.service.gov.uk/components/password-input/
|
|
9
|
+
*/
|
|
10
|
+
export declare function Root({ showPasswordText, hidePasswordText, showPasswordAriaLabelText, hidePasswordAriaLabelText, passwordShownAnnouncementText, passwordHiddenAnnouncementText, ...props }: RootProps): React.JSX.Element;
|
|
11
|
+
export { Wrapper, type WrapperProps } from 'govuk-frontend-react/password-input';
|
|
12
|
+
export type InputProps = Markup.InputProps;
|
|
13
|
+
export declare function Input(props: InputProps): React.JSX.Element;
|
|
14
|
+
export type ToggleProps = Markup.ToggleProps;
|
|
15
|
+
/** The show and hide button. Hidden until JavaScript runs. */
|
|
16
|
+
export declare function Toggle(props: ToggleProps): React.JSX.Element;
|
|
17
|
+
export type StatusProps = Omit<Primitives.StatusProps, 'asChild'>;
|
|
18
|
+
/** A visually hidden live region that announces when the password is shown or hidden. */
|
|
19
|
+
export declare function Status({ className, ...props }: StatusProps): React.JSX.Element;
|
|
20
|
+
export type FieldProps = Markup.FieldProps;
|
|
21
|
+
/**
|
|
22
|
+
* Help users accessibly enter passwords.
|
|
23
|
+
*
|
|
24
|
+
* @see https://design-system.service.gov.uk/components/password-input/
|
|
25
|
+
*/
|
|
26
|
+
export declare function Field({ id: idProp, name, label, labelSize, labelIsPageHeading, hint, errorMessage, showPasswordText, hidePasswordText, showPasswordAriaLabelText, hidePasswordAriaLabelText, passwordShownAnnouncementText, passwordHiddenAnnouncementText, 'aria-describedby': describedBy, ...props }: FieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import * as Primitives from '@govuk-react/primitives/password-input';
|
|
4
|
+
import * as Markup from 'govuk-frontend-react/password-input';
|
|
5
|
+
import { ErrorMessageComposite } from 'govuk-frontend-react/error-message';
|
|
6
|
+
import { Hint } from 'govuk-frontend-react/hint';
|
|
7
|
+
import { LabelComposite } from 'govuk-frontend-react/label';
|
|
8
|
+
import { joinIds } from '../../utils/join-ids.js';
|
|
9
|
+
/**
|
|
10
|
+
* Help users accessibly enter passwords.
|
|
11
|
+
*
|
|
12
|
+
* @see https://design-system.service.gov.uk/components/password-input/
|
|
13
|
+
*/
|
|
14
|
+
export function Root({ showPasswordText, hidePasswordText, showPasswordAriaLabelText, hidePasswordAriaLabelText, passwordShownAnnouncementText, passwordHiddenAnnouncementText, ...props }) {
|
|
15
|
+
const text = {
|
|
16
|
+
showPasswordText,
|
|
17
|
+
hidePasswordText,
|
|
18
|
+
showPasswordAriaLabelText,
|
|
19
|
+
hidePasswordAriaLabelText,
|
|
20
|
+
passwordShownAnnouncementText,
|
|
21
|
+
passwordHiddenAnnouncementText,
|
|
22
|
+
};
|
|
23
|
+
return (React.createElement(Primitives.Root, { showText: showPasswordText, hideText: hidePasswordText, showLabel: showPasswordAriaLabelText, hideLabel: hidePasswordAriaLabelText, shownAnnouncement: passwordShownAnnouncementText, hiddenAnnouncement: passwordHiddenAnnouncementText },
|
|
24
|
+
React.createElement(Markup.Root, { ...text, ...props })));
|
|
25
|
+
}
|
|
26
|
+
export { Wrapper } from 'govuk-frontend-react/password-input';
|
|
27
|
+
export function Input(props) {
|
|
28
|
+
return (React.createElement(Primitives.Input, { asChild: true },
|
|
29
|
+
React.createElement(Markup.Input, { ...props })));
|
|
30
|
+
}
|
|
31
|
+
/** The show and hide button. Hidden until JavaScript runs. */
|
|
32
|
+
export function Toggle(props) {
|
|
33
|
+
return (React.createElement(Primitives.Toggle, { asChild: true },
|
|
34
|
+
React.createElement(Markup.Toggle, { ...props })));
|
|
35
|
+
}
|
|
36
|
+
/** A visually hidden live region that announces when the password is shown or hidden. */
|
|
37
|
+
export function Status({ className, ...props }) {
|
|
38
|
+
return (React.createElement(Primitives.Status, { className: clsx('govuk-password-input__sr-status', 'govuk-visually-hidden', className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
const isSet = (node) => node !== undefined && node !== null && node !== false && node !== '';
|
|
41
|
+
/**
|
|
42
|
+
* Help users accessibly enter passwords.
|
|
43
|
+
*
|
|
44
|
+
* @see https://design-system.service.gov.uk/components/password-input/
|
|
45
|
+
*/
|
|
46
|
+
export function Field({ id: idProp, name, label, labelSize, labelIsPageHeading, hint, errorMessage, showPasswordText, hidePasswordText, showPasswordAriaLabelText, hidePasswordAriaLabelText, passwordShownAnnouncementText, passwordHiddenAnnouncementText, 'aria-describedby': describedBy, ...props }) {
|
|
47
|
+
const id = idProp || name;
|
|
48
|
+
const hintId = isSet(hint) ? `${id}-hint` : undefined;
|
|
49
|
+
const errorId = isSet(errorMessage) ? `${id}-error` : undefined;
|
|
50
|
+
const ariaDescribedBy = joinIds(describedBy, hintId, errorId);
|
|
51
|
+
return (React.createElement(Root, { error: Boolean(errorId), showPasswordText: showPasswordText, hidePasswordText: hidePasswordText, showPasswordAriaLabelText: showPasswordAriaLabelText, hidePasswordAriaLabelText: hidePasswordAriaLabelText, passwordShownAnnouncementText: passwordShownAnnouncementText, passwordHiddenAnnouncementText: passwordHiddenAnnouncementText },
|
|
52
|
+
React.createElement(LabelComposite, { htmlFor: id, size: labelSize, isPageHeading: labelIsPageHeading }, label),
|
|
53
|
+
hintId && React.createElement(Hint, { id: hintId }, hint),
|
|
54
|
+
errorId && React.createElement(ErrorMessageComposite, { id: errorId }, errorMessage),
|
|
55
|
+
React.createElement(Markup.Wrapper, null,
|
|
56
|
+
React.createElement(Input, { id: id, name: name, error: Boolean(errorId), "aria-describedby": ariaDescribedBy, ...props }),
|
|
57
|
+
React.createElement(Status, null),
|
|
58
|
+
React.createElement(Toggle, { "aria-controls": id, "aria-label": showPasswordAriaLabelText }, showPasswordText))));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/password-input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,UAAU,MAAM,wCAAwC,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AASlD;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,GAAG,KAAK,EACE;IACV,MAAM,IAAI,GAAG;QACX,gBAAgB;QAChB,gBAAgB;QAChB,yBAAyB;QACzB,yB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BAAC,MAAM,OAAG;YACV,oBAAC,MAAM,qBAAgB,EAAE,gBAAc,yBAAyB,IAC7D,gBAAgB,CACV,CACM,CACZ,CACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\nimport * as Primitives from '@govuk-react/primitives/password-input';\nimport * as Markup from 'govuk-frontend-react/password-input';\nimport { ErrorMessageComposite } from 'govuk-frontend-react/error-message';\nimport { Hint } from 'govuk-frontend-react/hint';\nimport { LabelComposite } from 'govuk-frontend-react/label';\nimport { joinIds } from '../../utils/join-ids.js';\n\n/*\n * govuk-frontend-react's PasswordInput markup, with the show and hide button from\n * @govuk-react/primitives. Without JavaScript it is a password field with no button.\n */\n\nexport type RootProps = Markup.RootProps;\n\n/**\n * Help users accessibly enter passwords.\n *\n * @see https://design-system.service.gov.uk/components/password-input/\n */\nexport function Root({\n showPasswordText,\n hidePasswordText,\n showPasswordAriaLabelText,\n hidePasswordAriaLabelText,\n passwordShownAnnouncementText,\n passwordHiddenAnnouncementText,\n ...props\n}: RootProps) {\n const text = {\n showPasswordText,\n hidePasswordText,\n showPasswordAriaLabelText,\n hidePasswordAriaLabelText,\n passwordShownAnnouncementText,\n passwordHiddenAnnouncementText,\n };\n return (\n <Primitives.Root\n showText={showPasswordText}\n hideText={hidePasswordText}\n showLabel={showPasswordAriaLabelText}\n hideLabel={hidePasswordAriaLabelText}\n shownAnnouncement={passwordShownAnnouncementText}\n hiddenAnnouncement={passwordHiddenAnnouncementText}\n >\n <Markup.Root {...text} {...props} />\n </Primitives.Root>\n );\n}\n\nexport { Wrapper, type WrapperProps } from 'govuk-frontend-react/password-input';\n\nexport type InputProps = Markup.InputProps;\n\nexport function Input(props: InputProps) {\n return (\n <Primitives.Input asChild>\n <Markup.Input {...props} />\n </Primitives.Input>\n );\n}\n\nexport type ToggleProps = Markup.ToggleProps;\n\n/** The show and hide button. Hidden until JavaScript runs. */\nexport function Toggle(props: ToggleProps) {\n return (\n <Primitives.Toggle asChild>\n <Markup.Toggle {...props} />\n </Primitives.Toggle>\n );\n}\n\nexport type StatusProps = Omit<Primitives.StatusProps, 'asChild'>;\n\n/** A visually hidden live region that announces when the password is shown or hidden. */\nexport function Status({ className, ...props }: StatusProps) {\n return (\n <Primitives.Status\n className={clsx('govuk-password-input__sr-status', 'govuk-visually-hidden', className)}\n {...props}\n />\n );\n}\n\nexport type FieldProps = Markup.FieldProps;\n\nconst isSet = (node: React.ReactNode) => node !== undefined && node !== null && node !== false && node !== '';\n\n/**\n * Help users accessibly enter passwords.\n *\n * @see https://design-system.service.gov.uk/components/password-input/\n */\nexport function Field({\n id: idProp,\n name,\n label,\n labelSize,\n labelIsPageHeading,\n hint,\n errorMessage,\n showPasswordText,\n hidePasswordText,\n showPasswordAriaLabelText,\n hidePasswordAriaLabelText,\n passwordShownAnnouncementText,\n passwordHiddenAnnouncementText,\n 'aria-describedby': describedBy,\n ...props\n}: FieldProps) {\n const id = idProp || name;\n const hintId = isSet(hint) ? `${id}-hint` : undefined;\n const errorId = isSet(errorMessage) ? `${id}-error` : undefined;\n const ariaDescribedBy = joinIds(describedBy, hintId, errorId);\n\n return (\n <Root\n error={Boolean(errorId)}\n showPasswordText={showPasswordText}\n hidePasswordText={hidePasswordText}\n showPasswordAriaLabelText={showPasswordAriaLabelText}\n hidePasswordAriaLabelText={hidePasswordAriaLabelText}\n passwordShownAnnouncementText={passwordShownAnnouncementText}\n passwordHiddenAnnouncementText={passwordHiddenAnnouncementText}\n >\n <LabelComposite htmlFor={id} size={labelSize} isPageHeading={labelIsPageHeading}>\n {label}\n </LabelComposite>\n {hintId && <Hint id={hintId}>{hint}</Hint>}\n {errorId && <ErrorMessageComposite id={errorId}>{errorMessage}</ErrorMessageComposite>}\n <Markup.Wrapper>\n <Input id={id} name={name} error={Boolean(errorId)} aria-describedby={ariaDescribedBy} {...props} />\n <Status />\n <Toggle aria-controls={id} aria-label={showPasswordAriaLabelText}>\n {showPasswordText}\n </Toggle>\n </Markup.Wrapper>\n </Root>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/phase-banner/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from 'govuk-frontend-react/phase-banner';\n"]}
|