@moduk/frontend 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/govuk-crest-2x.png +0 -0
- package/assets/images/govuk-crest.png +0 -0
- package/assets/svg/moduk-header-logo.svg +7 -0
- package/client/index.d.ts +2 -0
- package/client/index.d.ts.map +1 -0
- package/client/moduk-frontend.mjs +1 -0
- package/client/moduk-frontend.umd.js +2 -0
- package/client/moduk-frontend.umd.js.map +1 -0
- package/css/index.css +1 -0
- package/dist/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +9 -9
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/utils.d.ts +25 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +111 -0
- package/lib/utils.js.map +1 -0
- package/nunjucks/moduk/components/accordion/__examples__/default.njk +39 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-custom-text.njk +45 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-expanded-items.njk +41 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-h3-headings.njk +40 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-remember-expanded-off.njk +40 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-summary-lines.njk +122 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-text-items.njk +41 -0
- package/nunjucks/moduk/components/accordion/macro.njk +5 -0
- package/nunjucks/moduk/components/back-link/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/back-link/macro.njk +5 -0
- package/nunjucks/moduk/components/breadcrumbs/__examples__/default.njk +18 -0
- package/nunjucks/moduk/components/breadcrumbs/macro.njk +5 -0
- package/nunjucks/moduk/components/button/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/button/__examples__/disabled.njk +6 -0
- package/nunjucks/moduk/components/button/__examples__/group-link.njk +9 -0
- package/nunjucks/moduk/components/button/__examples__/grouping.njk +12 -0
- package/nunjucks/moduk/components/button/__examples__/prevent-double-click.njk +30 -0
- package/nunjucks/moduk/components/button/__examples__/secondary.njk +6 -0
- package/nunjucks/moduk/components/button/__examples__/start.njk +7 -0
- package/nunjucks/moduk/components/button/__examples__/warning.njk +6 -0
- package/nunjucks/moduk/components/button/macro.njk +5 -0
- package/nunjucks/moduk/components/character-count/__examples__/default.njk +15 -0
- package/nunjucks/moduk/components/character-count/__examples__/not-as-page-heading.njk +10 -0
- package/nunjucks/moduk/components/character-count/__examples__/with-error-message.njk +19 -0
- package/nunjucks/moduk/components/character-count/__examples__/with-threshold.njk +14 -0
- package/nunjucks/moduk/components/character-count/__examples__/word-count.njk +12 -0
- package/nunjucks/moduk/components/character-count/macro.njk +5 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/default.njk +37 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/not-as-page-heading.njk +35 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/small.njk +31 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-conditional-reveal.njk +80 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-error-message.njk +40 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-item-hint.njk +32 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-none-option.njk +45 -0
- package/nunjucks/moduk/components/checkboxes/macro.njk +5 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/accepted.njk +47 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/default.njk +34 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/rejected.njk +47 -0
- package/nunjucks/moduk/components/cookie-banner/macro.njk +5 -0
- package/nunjucks/moduk/components/date-input/__examples__/default.njk +16 -0
- package/nunjucks/moduk/components/date-input/__examples__/not-as-page-heading.njk +14 -0
- package/nunjucks/moduk/components/date-input/__examples__/with-date-part-error.njk +35 -0
- package/nunjucks/moduk/components/date-input/__examples__/with-whole-date-error.njk +36 -0
- package/nunjucks/moduk/components/date-input/macro.njk +5 -0
- package/nunjucks/moduk/components/details/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/details/__examples__/open.njk +7 -0
- package/nunjucks/moduk/components/details/macro.njk +11 -0
- package/nunjucks/moduk/components/error-message/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/error-message/macro.njk +5 -0
- package/nunjucks/moduk/components/error-summary/__examples__/default.njk +15 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-description-and-error-list.njk +16 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-checkbox.njk +54 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-date-part.njk +45 -0
- package/nunjucks/moduk/components/error-summary/macro.njk +11 -0
- package/nunjucks/moduk/components/fieldset/__examples__/default.njk +45 -0
- package/nunjucks/moduk/components/fieldset/macro.njk +11 -0
- package/nunjucks/moduk/components/file-upload/__examples__/default.njk +9 -0
- package/nunjucks/moduk/components/file-upload/__examples__/with-error.njk +12 -0
- package/nunjucks/moduk/components/file-upload/macro.njk +5 -0
- package/nunjucks/moduk/components/footer/__examples__/default.njk +3 -0
- package/nunjucks/moduk/components/footer/__examples__/with-links.njk +20 -0
- package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation-and-links.njk +72 -0
- package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation.njk +55 -0
- package/nunjucks/moduk/components/footer/macro.njk +5 -0
- package/nunjucks/moduk/components/header/__examples__/default.njk +3 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name-and-navigation.njk +26 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name-and-no-service-url.njk +6 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name.njk +7 -0
- package/nunjucks/moduk/components/header/macro.njk +62 -0
- package/nunjucks/moduk/components/input/__examples__/default.njk +11 -0
- package/nunjucks/moduk/components/input/__examples__/not-as-page-heading.njk +9 -0
- package/nunjucks/moduk/components/input/__examples__/with-error.njk +17 -0
- package/nunjucks/moduk/components/input/__examples__/with-fixed-width.njk +57 -0
- package/nunjucks/moduk/components/input/__examples__/with-fluid-width.njk +57 -0
- package/nunjucks/moduk/components/input/__examples__/with-hint.njk +14 -0
- package/nunjucks/moduk/components/input/__examples__/with-numeric.njk +17 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix-error.njk +22 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix.njk +19 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix.njk +16 -0
- package/nunjucks/moduk/components/input/__examples__/with-suffix.njk +16 -0
- package/nunjucks/moduk/components/input/macro.njk +5 -0
- package/nunjucks/moduk/components/inset-text/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/inset-text/macro.njk +11 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/success.njk +13 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/with-html.njk +12 -0
- package/nunjucks/moduk/components/notification-banner/macro.njk +11 -0
- package/nunjucks/moduk/components/pagination/__examples__/default.njk +25 -0
- package/nunjucks/moduk/components/pagination/__examples__/on-the-first-page.njk +22 -0
- package/nunjucks/moduk/components/pagination/__examples__/on-the-last-page.njk +22 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-ellipses.njk +39 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-link-labels.njk +12 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-next-and-previous-only.njk +12 -0
- package/nunjucks/moduk/components/pagination/macro.njk +5 -0
- package/nunjucks/moduk/components/panel/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/panel/macro.njk +11 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/beta.njk +8 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/default.njk +12 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/with-tag-override.njk +9 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/with-text.njk +8 -0
- package/nunjucks/moduk/components/phase-banner/macro.njk +5 -0
- package/nunjucks/moduk/components/radios/__examples__/default.njk +30 -0
- package/nunjucks/moduk/components/radios/__examples__/inline.njk +26 -0
- package/nunjucks/moduk/components/radios/__examples__/not-as-page-heading.njk +29 -0
- package/nunjucks/moduk/components/radios/__examples__/small.njk +31 -0
- package/nunjucks/moduk/components/radios/__examples__/with-conditional-reveal.njk +80 -0
- package/nunjucks/moduk/components/radios/__examples__/with-divider-option.njk +29 -0
- package/nunjucks/moduk/components/radios/__examples__/with-error-message.njk +33 -0
- package/nunjucks/moduk/components/radios/__examples__/with-item-hint.njk +31 -0
- package/nunjucks/moduk/components/radios/macro.njk +5 -0
- package/nunjucks/moduk/components/select/__examples__/default.njk +28 -0
- package/nunjucks/moduk/components/select/__examples__/with-hint.njk +55 -0
- package/nunjucks/moduk/components/select/macro.njk +5 -0
- package/nunjucks/moduk/components/skip-link/__examples__/default.njk +11 -0
- package/nunjucks/moduk/components/skip-link/macro.njk +5 -0
- package/nunjucks/moduk/components/summary-list/__examples__/cards-with-action.njk +83 -0
- package/nunjucks/moduk/components/summary-list/__examples__/cards.njk +221 -0
- package/nunjucks/moduk/components/summary-list/__examples__/default.njk +74 -0
- package/nunjucks/moduk/components/summary-list/__examples__/with-no-actions.njk +38 -0
- package/nunjucks/moduk/components/summary-list/__examples__/with-no-border.njk +39 -0
- package/nunjucks/moduk/components/summary-list/macro.njk +5 -0
- package/nunjucks/moduk/components/table/__examples__/default.njk +41 -0
- package/nunjucks/moduk/components/table/__examples__/with-comparative-numbers.njk +61 -0
- package/nunjucks/moduk/components/table/__examples__/with-customised-column-widths.njk +56 -0
- package/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +41 -0
- package/nunjucks/moduk/components/table/macro.njk +5 -0
- package/nunjucks/moduk/components/tabs/__examples__/default.njk +243 -0
- package/nunjucks/moduk/components/tabs/macro.njk +5 -0
- package/nunjucks/moduk/components/tag/__examples__/blue.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/tag/__examples__/green.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/grey.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/orange.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/pink.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/purple.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/red.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/turquoise.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/yellow.njk +6 -0
- package/nunjucks/moduk/components/tag/macro.njk +5 -0
- package/nunjucks/moduk/components/textarea/__examples__/default.njk +14 -0
- package/nunjucks/moduk/components/textarea/__examples__/not-as-page-heading.njk +9 -0
- package/nunjucks/moduk/components/textarea/__examples__/with-custom-height.njk +15 -0
- package/nunjucks/moduk/components/textarea/__examples__/with-error.njk +17 -0
- package/nunjucks/moduk/components/textarea/macro.njk +5 -0
- package/nunjucks/moduk/components/warning-text/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/warning-text/macro.njk +5 -0
- package/package.json +36 -27
- package/react/MODUKBody/MODUKBody.d.ts +6 -0
- package/react/MODUKBody/MODUKBody.d.ts.map +1 -0
- package/react/accordion/Accordion.d.ts +22 -0
- package/react/accordion/Accordion.d.ts.map +1 -0
- package/react/accordion/AccordionContext.d.ts +7 -0
- package/react/accordion/AccordionContext.d.ts.map +1 -0
- package/react/accordion/AccordionHeadingTag.d.ts +2 -0
- package/react/accordion/AccordionHeadingTag.d.ts.map +1 -0
- package/react/accordion/AccordionItem.d.ts +12 -0
- package/react/accordion/AccordionItem.d.ts.map +1 -0
- package/react/accordion/AccordionItemIndexContext.d.ts +2 -0
- package/react/accordion/AccordionItemIndexContext.d.ts.map +1 -0
- package/react/accordion/index.d.ts +4 -0
- package/react/accordion/index.d.ts.map +1 -0
- package/react/back-link/BackLink.d.ts +13 -0
- package/react/back-link/BackLink.d.ts.map +1 -0
- package/react/esm/MODUKBody/MODUKBody.js +37 -0
- package/react/esm/accordion/Accordion.js +81 -0
- package/react/esm/accordion/AccordionContext.js +5 -0
- package/react/esm/accordion/AccordionHeadingTag.js +1 -0
- package/react/esm/accordion/AccordionItem.js +45 -0
- package/react/esm/accordion/AccordionItemIndexContext.js +2 -0
- package/react/esm/accordion/index.js +5 -0
- package/react/esm/back-link/BackLink.js +25 -0
- package/react/esm/header/Header.js +124 -0
- package/react/esm/header/HeaderNavigationItem.js +29 -0
- package/react/esm/header/HeaderNavigationLink.js +25 -0
- package/react/esm/header/index.js +3 -0
- package/react/esm/index.js +7 -0
- package/react/esm/internal/Link/Link.js +23 -0
- package/react/esm/internal/hooks/useMODUKComponent/index.js +1 -0
- package/react/esm/internal/hooks/useMODUKComponent/useMODUKComponent.js +39 -0
- package/react/esm/internal/hooks/usePrevious/index.js +1 -0
- package/react/esm/internal/hooks/usePrevious/usePrevious.js +8 -0
- package/react/esm/internal/test-utils/Root.js +33 -0
- package/react/esm/table/Table.js +13 -0
- package/react/esm/table/TableBody.js +24 -0
- package/react/esm/table/TableCaption.js +24 -0
- package/react/esm/table/TableCell.js +25 -0
- package/react/esm/table/TableColumnHeader.js +26 -0
- package/react/esm/table/TableHead.js +24 -0
- package/react/esm/table/TableRow.js +24 -0
- package/react/esm/table/TableRowHeader.js +25 -0
- package/react/esm/table/index.js +8 -0
- package/react/header/Header.d.ts +20 -0
- package/react/header/Header.d.ts.map +1 -0
- package/react/header/HeaderNavigationItem.d.ts +11 -0
- package/react/header/HeaderNavigationItem.d.ts.map +1 -0
- package/react/header/HeaderNavigationLink.d.ts +11 -0
- package/react/header/HeaderNavigationLink.d.ts.map +1 -0
- package/react/header/index.d.ts +4 -0
- package/react/header/index.d.ts.map +1 -0
- package/react/index.d.ts +6 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +3 -0
- package/react/index.js.LICENSE.txt +28 -0
- package/react/index.js.map +1 -0
- package/react/internal/Link/Link.d.ts +14 -0
- package/react/internal/Link/Link.d.ts.map +1 -0
- package/react/internal/hooks/useMODUKComponent/index.d.ts +2 -0
- package/react/internal/hooks/useMODUKComponent/index.d.ts.map +1 -0
- package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts +10 -0
- package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts.map +1 -0
- package/react/internal/hooks/usePrevious/index.d.ts +2 -0
- package/react/internal/hooks/usePrevious/index.d.ts.map +1 -0
- package/react/internal/hooks/usePrevious/usePrevious.d.ts +2 -0
- package/react/internal/hooks/usePrevious/usePrevious.d.ts.map +1 -0
- package/react/internal/test-utils/Root.d.ts +8 -0
- package/react/internal/test-utils/Root.d.ts.map +1 -0
- package/react/table/Table.d.ts +41 -0
- package/react/table/Table.d.ts.map +1 -0
- package/react/table/TableBody.d.ts +9 -0
- package/react/table/TableBody.d.ts.map +1 -0
- package/react/table/TableCaption.d.ts +9 -0
- package/react/table/TableCaption.d.ts.map +1 -0
- package/react/table/TableCell.d.ts +11 -0
- package/react/table/TableCell.d.ts.map +1 -0
- package/react/table/TableColumnHeader.d.ts +11 -0
- package/react/table/TableColumnHeader.d.ts.map +1 -0
- package/react/table/TableHead.d.ts +9 -0
- package/react/table/TableHead.d.ts.map +1 -0
- package/react/table/TableRow.d.ts +9 -0
- package/react/table/TableRow.d.ts.map +1 -0
- package/react/table/TableRowHeader.d.ts +9 -0
- package/react/table/TableRowHeader.d.ts.map +1 -0
- package/react/table/index.d.ts +9 -0
- package/react/table/index.d.ts.map +1 -0
- package/src/react/header/__examples__/with-service-name-and-navigation.tsx +13 -5
- package/src/react/table/__examples__/default.tsx +38 -0
- package/src/react/table/__examples__/with-comparative-numbers.tsx +42 -0
- package/src/react/table/__examples__/with-customised-column-widths.tsx +42 -0
- package/src/react/table/__examples__/with-large-caption.tsx +38 -0
- package/dist/nunjucks/moduk/components/accordion/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/back-link/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/breadcrumbs/__tests__/macro.test.ts +0 -31
- package/dist/nunjucks/moduk/components/button/__tests__/macro.test.ts +0 -25
- package/dist/nunjucks/moduk/components/character-count/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/checkboxes/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/cookie-banner/__tests__/macro.test.ts +0 -10
- package/dist/nunjucks/moduk/components/date-input/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/details/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/error-message/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/error-summary/__tests__/macro.test.ts +0 -55
- package/dist/nunjucks/moduk/components/fieldset/__tests__/macro.test.ts +0 -41
- package/dist/nunjucks/moduk/components/file-upload/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/footer/__tests__/macro.test.ts +0 -15
- package/dist/nunjucks/moduk/components/header/__tests__/macro.test.ts +0 -25
- package/dist/nunjucks/moduk/components/input/__tests__/macro.test.ts +0 -22
- package/dist/nunjucks/moduk/components/inset-text/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/notification-banner/__tests__/macro.test.ts +0 -32
- package/dist/nunjucks/moduk/components/pagination/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/panel/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/phase-banner/__tests__/macro.test.ts +0 -24
- package/dist/nunjucks/moduk/components/radios/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/select/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/skip-link/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/summary-list/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/table/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/tabs/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/tag/__tests__/macro.test.ts +0 -32
- package/dist/nunjucks/moduk/components/textarea/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/warning-text/__tests__/macro.test.ts +0 -9
- package/src/css/__tests__/_colour-palette.test.scss +0 -42
- package/src/css/__tests__/index.test.ts +0 -17
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
var _excluded = ["children", "className"];
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
+
import clsx from 'clsx';
|
|
19
|
+
import { useEffect, useState } from 'react';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
export var MODUKBody = function MODUKBody(_ref) {
|
|
22
|
+
var children = _ref.children,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var _useState = useState(false),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
isClient = _useState2[0],
|
|
28
|
+
setClient = _useState2[1];
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
setClient(true);
|
|
31
|
+
}, []);
|
|
32
|
+
return _jsx("body", _objectSpread(_objectSpread({
|
|
33
|
+
className: clsx(isClient && 'js-enabled', className) || undefined
|
|
34
|
+
}, rest), {}, {
|
|
35
|
+
children: children
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
var _excluded = ["children", "className", "headingTag", "hideAllSectionsText", "hideSectionText", "hideSectionAriaLabelText", "id", "rememberExpanded", "showAllSectionsText", "showSectionText", "showSectionAriaLabelText"];
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
import { isEqual, pick } from 'lodash';
|
|
14
|
+
import { Children, forwardRef, isValidElement, useRef } from 'react';
|
|
15
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
16
|
+
import { mergeRefs } from 'react-merge-refs';
|
|
17
|
+
import { useMODUKComponent } from '../internal/hooks/useMODUKComponent';
|
|
18
|
+
import { usePrevious } from '../internal/hooks/usePrevious';
|
|
19
|
+
import { AccordionContext } from './AccordionContext';
|
|
20
|
+
import { AccordionItemIndexContext } from './AccordionItemIndexContext';
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
function getRemountProps(props) {
|
|
23
|
+
var rootProps = pick(props, ['headingTag', 'hideAllSectionsText', 'hideSectionAriaLabelText', 'hideSectionText', 'rememberExpanded', 'showAllSectionsText', 'showSectionAriaLabelText', 'showSectionText']);
|
|
24
|
+
var childrenProps = flattenChildren(props.children).filter(isValidElement).map(function (child) {
|
|
25
|
+
return pick(child.props, ['heading', 'summary', 'expanded']);
|
|
26
|
+
});
|
|
27
|
+
return [rootProps, childrenProps];
|
|
28
|
+
}
|
|
29
|
+
export var Accordion = forwardRef(function (props, forwardedRef) {
|
|
30
|
+
var _useMODUKComponent = useMODUKComponent('Accordion'),
|
|
31
|
+
ref = _useMODUKComponent.ref;
|
|
32
|
+
var key = useRef(0);
|
|
33
|
+
var remountProps = getRemountProps(props);
|
|
34
|
+
var previousRemountProps = usePrevious(remountProps);
|
|
35
|
+
if (!isEqual(previousRemountProps, remountProps)) {
|
|
36
|
+
key.current += 1;
|
|
37
|
+
}
|
|
38
|
+
var children = props.children,
|
|
39
|
+
className = props.className,
|
|
40
|
+
_props$headingTag = props.headingTag,
|
|
41
|
+
headingTag = _props$headingTag === void 0 ? 'h2' : _props$headingTag,
|
|
42
|
+
hideAllSectionsText = props.hideAllSectionsText,
|
|
43
|
+
hideSectionText = props.hideSectionText,
|
|
44
|
+
hideSectionAriaLabelText = props.hideSectionAriaLabelText,
|
|
45
|
+
id = props.id,
|
|
46
|
+
rememberExpanded = props.rememberExpanded,
|
|
47
|
+
showAllSectionsText = props.showAllSectionsText,
|
|
48
|
+
showSectionText = props.showSectionText,
|
|
49
|
+
showSectionAriaLabelText = props.showSectionAriaLabelText,
|
|
50
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
51
|
+
var i18nAttributes = {
|
|
52
|
+
'data-i18n.hide-all-sections': hideAllSectionsText,
|
|
53
|
+
'data-i18n.hide-section': hideSectionText,
|
|
54
|
+
'data-i18n.hide-section-aria-label': hideSectionAriaLabelText,
|
|
55
|
+
'data-i18n.show-all-sections': showAllSectionsText,
|
|
56
|
+
'data-i18n.show-section': showSectionText,
|
|
57
|
+
'data-i18n.show-section-aria-label': showSectionAriaLabelText
|
|
58
|
+
};
|
|
59
|
+
return _jsx(AccordionContext.Provider, {
|
|
60
|
+
value: {
|
|
61
|
+
headingTag: headingTag,
|
|
62
|
+
id: id
|
|
63
|
+
},
|
|
64
|
+
children: _jsx("div", _objectSpread(_objectSpread(_objectSpread({
|
|
65
|
+
ref: mergeRefs([ref, forwardedRef])
|
|
66
|
+
}, rest), {}, {
|
|
67
|
+
className: clsx('govuk-accordion', className),
|
|
68
|
+
"data-module": "govuk-accordion",
|
|
69
|
+
"data-remember-expanded": rememberExpanded,
|
|
70
|
+
id: id
|
|
71
|
+
}, i18nAttributes), {}, {
|
|
72
|
+
children: Children.map(children, function (child, index) {
|
|
73
|
+
return _jsx(AccordionItemIndexContext.Provider, {
|
|
74
|
+
value: index,
|
|
75
|
+
children: child
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
}), key.current)
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
Accordion.displayName = 'Accordion';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
import { AccordionContext } from './AccordionContext';
|
|
6
|
+
import { AccordionItemIndexContext } from './AccordionItemIndexContext';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export function AccordionItem(_ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
expanded = _ref.expanded,
|
|
12
|
+
heading = _ref.heading,
|
|
13
|
+
summary = _ref.summary;
|
|
14
|
+
var _useContext = useContext(AccordionContext),
|
|
15
|
+
Heading = _useContext.headingTag,
|
|
16
|
+
id = _useContext.id;
|
|
17
|
+
var index = useContext(AccordionItemIndexContext);
|
|
18
|
+
var headingId = "".concat(id, "-heading-").concat(index + 1);
|
|
19
|
+
var contentId = "".concat(id, "-content-").concat(index + 1);
|
|
20
|
+
return _jsxs("div", {
|
|
21
|
+
className: clsx('govuk-accordion__section', expanded && 'govuk-accordion__section--expanded'),
|
|
22
|
+
children: [_jsxs("div", {
|
|
23
|
+
className: "govuk-accordion__section-header",
|
|
24
|
+
children: [_jsx(Heading, {
|
|
25
|
+
className: "govuk-accordion__section-heading",
|
|
26
|
+
children: _jsx("span", {
|
|
27
|
+
className: "govuk-accordion__section-button",
|
|
28
|
+
id: headingId,
|
|
29
|
+
children: heading
|
|
30
|
+
})
|
|
31
|
+
}), summary && _jsx("div", {
|
|
32
|
+
className: "govuk-accordion__section-summary govuk-body",
|
|
33
|
+
children: summary
|
|
34
|
+
})]
|
|
35
|
+
}), _jsxs("div", {
|
|
36
|
+
id: contentId,
|
|
37
|
+
className: "govuk-accordion__section-content",
|
|
38
|
+
"aria-labelledby": headingId,
|
|
39
|
+
children: [typeof children === 'string' && _jsx("p", {
|
|
40
|
+
className: "govuk-body",
|
|
41
|
+
children: children
|
|
42
|
+
}), typeof children !== 'string' && children]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { LinkBase } from '../internal/Link/Link';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var BackLink = forwardRef(function (_ref, forwardedRef) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return _jsx(LinkBase, _objectSpread(_objectSpread({
|
|
19
|
+
ref: forwardedRef,
|
|
20
|
+
className: clsx('govuk-back-link', className)
|
|
21
|
+
}, props), {}, {
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
BackLink.displayName = 'BackLink';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className", "containerClassName", "homepageUrl", "menuButtonLabel", "menuButtonText", "navigationClassName", "navigationLabel", "serviceName", "serviceUrl"];
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
import React from "react";
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import { Children, forwardRef } from 'react';
|
|
13
|
+
import { mergeRefs } from 'react-merge-refs';
|
|
14
|
+
var MODUKHeaderLogo = function MODUKHeaderLogo(props) {
|
|
15
|
+
return _jsxs("svg", _objectSpread(_objectSpread({}, props), {}, {
|
|
16
|
+
children: [_jsx("title", {
|
|
17
|
+
children: "Ministry of Defence"
|
|
18
|
+
}), _jsx("path", {
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
d: "M1.7,0H0v40h1.7V0z M43.9,15.8h2.6L51,28l4.6-12.2h2.6v14.5h-1.8v-12h-0.1l-4.5,12h-1.7l-4.5-12v12h-1.8V15.8z M62.4,18h-1.7v-2.1h1.7V18z M60.7,19.8h1.7v10.5h-1.7V19.8z M64.5,19.8h1.6v1.7h0.1c0.8-1.3,1.9-1.9,3.4-1.9c2.7,0,3.6,1.6,3.6,3.8 v6.9h-1.7v-7.1c0-1.3-0.8-2.1-2.1-2.1c-2.1,0-3.1,1.4-3.1,3.3v5.9h-1.7L64.5,19.8L64.5,19.8z M77,18h-1.7v-2.1H77V18z M75.3,19.8H77 v10.5h-1.7V19.8z M80.3,27c0.1,1.6,1.4,2,2.8,2c1.1,0,2.5-0.3,2.5-1.6c0-1.3-1.7-1.6-3.4-1.9c-1.7-0.4-3.4-1-3.4-2.9 c0-2.1,2.1-2.9,3.9-2.9c2.3,0,4.1,0.8,4.3,3.3h-1.7c-0.1-1.3-1.3-1.8-2.4-1.8c-1,0-2.2,0.3-2.2,1.3c0,1.2,1.8,1.4,3.4,1.8 c1.7,0.4,3.4,1,3.4,2.9c0,2.5-2.3,3.3-4.5,3.3c-2.4,0-4.3-1-4.5-3.5H80.3z M91.3,19.8h2.1v1.5h-2.1v6.5c0,0.8,0.2,0.9,1.3,0.9h0.8 v1.5H92c-1.8,0-2.5-0.4-2.5-2.3v-6.6h-1.8v-1.5h1.8v-3.1h1.7V19.8z M94.6,19.8h1.6V22h0.1c0.8-1.7,2-2.5,3.9-2.5v1.8 c-2.8,0-3.8,1.6-3.8,4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9,0.4 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0.1-0.1,0.1-0.2,0.1c-0.3,0.2-0.5,0.3-0.7,0.4c0.1,0,0.1,0.1,0.1,0.1c0.8,0.4,1,0.4,1.1,0.4 c0.1,0,0.1,0,0.2,0.1c0.6,0.1,1.1,0.3,1.3,0.6c0,0,0,0.1,0.1,0.1c0.1,0.1,0.2,0.1,0.2,0.2c0,0,0,0.1,0.1,0.1 c0.3-0.1,0.5-0.2,0.7-0.3c0.1-0.1,0.1-0.1,0.2-0.1s0.1-0.1,0.2-0.1c0.3-0.3,0.6-0.5,1.2-0.8c1.8-0.7,4.7-1.1,4.7-1.1 S30.6,21.7,28.3,21.7z"
|
|
21
|
+
})]
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
MODUKHeaderLogo.defaultProps = {
|
|
25
|
+
'aria-hidden': "true",
|
|
26
|
+
focusable: "false",
|
|
27
|
+
className: "moduk-header__logotype-modlogo",
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
viewBox: "0 0 210 40",
|
|
30
|
+
height: "40",
|
|
31
|
+
width: "210"
|
|
32
|
+
};
|
|
33
|
+
import { useMODUKComponent } from '../internal/hooks/useMODUKComponent';
|
|
34
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
|
+
function HeaderContent(props) {
|
|
37
|
+
var children = props.children,
|
|
38
|
+
serviceName = props.serviceName,
|
|
39
|
+
serviceUrl = props.serviceUrl,
|
|
40
|
+
navigationLabel = props.navigationLabel,
|
|
41
|
+
menuButtonLabel = props.menuButtonLabel,
|
|
42
|
+
navigationClassName = props.navigationClassName,
|
|
43
|
+
_props$menuButtonText = props.menuButtonText,
|
|
44
|
+
menuButtonText = _props$menuButtonText === void 0 ? 'Menu' : _props$menuButtonText;
|
|
45
|
+
var hasNav = Boolean(Children.count(children));
|
|
46
|
+
if (!serviceName && !hasNav) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
var isLink = Boolean(serviceName && serviceUrl);
|
|
50
|
+
var HeaderTag = isLink ? 'a' : 'span';
|
|
51
|
+
return _jsxs("div", {
|
|
52
|
+
className: "govuk-header__content",
|
|
53
|
+
children: [serviceName && _jsx(HeaderTag, _objectSpread(_objectSpread({}, isLink ? {
|
|
54
|
+
href: serviceUrl
|
|
55
|
+
} : {}), {}, {
|
|
56
|
+
className: clsx(isLink && 'govuk-header__link', 'moduk-header__service-name govuk-header__service-name'),
|
|
57
|
+
children: serviceName
|
|
58
|
+
})), hasNav && _jsxs("nav", {
|
|
59
|
+
"aria-label": navigationLabel || menuButtonText,
|
|
60
|
+
className: clsx('govuk-header__navigation', navigationClassName),
|
|
61
|
+
children: [_jsx("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
className: "govuk-header__menu-button govuk-js-header-toggle",
|
|
64
|
+
"aria-controls": "navigation",
|
|
65
|
+
"aria-label": menuButtonLabel || 'Show or hide menu',
|
|
66
|
+
hidden: true,
|
|
67
|
+
children: menuButtonText
|
|
68
|
+
}), _jsx("ul", {
|
|
69
|
+
id: "navigation",
|
|
70
|
+
className: "govuk-header__navigation-list",
|
|
71
|
+
children: children
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export var Header = forwardRef(function (props, forwardedRef) {
|
|
77
|
+
var _useMODUKComponent = useMODUKComponent('Header'),
|
|
78
|
+
ref = _useMODUKComponent.ref;
|
|
79
|
+
var children = props.children,
|
|
80
|
+
className = props.className,
|
|
81
|
+
containerClassName = props.containerClassName,
|
|
82
|
+
homepageUrl = props.homepageUrl,
|
|
83
|
+
menuButtonLabel = props.menuButtonLabel,
|
|
84
|
+
_props$menuButtonText2 = props.menuButtonText,
|
|
85
|
+
menuButtonText = _props$menuButtonText2 === void 0 ? 'Menu' : _props$menuButtonText2,
|
|
86
|
+
navigationClassName = props.navigationClassName,
|
|
87
|
+
navigationLabel = props.navigationLabel,
|
|
88
|
+
serviceName = props.serviceName,
|
|
89
|
+
serviceUrl = props.serviceUrl,
|
|
90
|
+
rootProps = _objectWithoutProperties(props, _excluded);
|
|
91
|
+
var headerContentProps = {
|
|
92
|
+
menuButtonLabel: menuButtonLabel,
|
|
93
|
+
menuButtonText: menuButtonText,
|
|
94
|
+
navigationClassName: navigationClassName,
|
|
95
|
+
navigationLabel: navigationLabel,
|
|
96
|
+
serviceName: serviceName,
|
|
97
|
+
serviceUrl: serviceUrl
|
|
98
|
+
};
|
|
99
|
+
return _jsx("header", _objectSpread(_objectSpread({
|
|
100
|
+
ref: mergeRefs([ref, forwardedRef]),
|
|
101
|
+
className: clsx('govuk-header', className),
|
|
102
|
+
role: "banner",
|
|
103
|
+
"data-module": "govuk-header"
|
|
104
|
+
}, rootProps), {}, {
|
|
105
|
+
children: _jsxs("div", {
|
|
106
|
+
className: clsx('govuk-header__container', containerClassName || 'govuk-width-container'),
|
|
107
|
+
children: [_jsx("div", {
|
|
108
|
+
className: "moduk-header__logo govuk-header__logo",
|
|
109
|
+
children: _jsx("a", {
|
|
110
|
+
href: homepageUrl || '/',
|
|
111
|
+
className: "govuk-header__link govuk-header__link--homepage",
|
|
112
|
+
title: "Home",
|
|
113
|
+
children: _jsx("span", {
|
|
114
|
+
className: "govuk-header__logotype",
|
|
115
|
+
children: _jsx(MODUKHeaderLogo, {})
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
}), _jsx(HeaderContent, _objectSpread(_objectSpread({}, headerContentProps), {}, {
|
|
119
|
+
children: children
|
|
120
|
+
}))]
|
|
121
|
+
})
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
Header.displayName = 'Header';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["active", "children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
export var HeaderNavigationItem = forwardRef(function (_ref, ref) {
|
|
16
|
+
var active = _ref.active,
|
|
17
|
+
children = _ref.children,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return _jsxs(_Fragment, {
|
|
21
|
+
children: [_jsx("li", _objectSpread(_objectSpread({
|
|
22
|
+
ref: ref,
|
|
23
|
+
className: clsx('govuk-header__navigation-item', active && 'govuk-header__navigation-item--active moduk-header__navigation-item--active', className)
|
|
24
|
+
}, props), {}, {
|
|
25
|
+
children: children
|
|
26
|
+
})), ' ']
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
HeaderNavigationItem.displayName = 'HeaderNavigationItem';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { LinkBase } from '../internal/Link/Link';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var HeaderNavigationLink = forwardRef(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
return _jsx(LinkBase, _objectSpread(_objectSpread({
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: clsx('govuk-header__link', className)
|
|
21
|
+
}, props), {}, {
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
HeaderNavigationLink.displayName = 'HeaderNavigationLink';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children", "component"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export var LinkBase = forwardRef(function (_ref, ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
component = _ref.component,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var Component = component !== null && component !== void 0 ? component : 'a';
|
|
17
|
+
return _jsx(Component, _objectSpread(_objectSpread({
|
|
18
|
+
ref: ref
|
|
19
|
+
}, props), {}, {
|
|
20
|
+
children: children
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
LinkBase.displayName = 'LinkBase';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useMODUKComponent';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return { value: void 0, done: !0 }; } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable || "" === iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } throw new TypeError(_typeof(iterable) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
var initialiseComponent = function () {
|
|
7
|
+
var _ref = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(componentName, el) {
|
|
8
|
+
var client;
|
|
9
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
_context.next = 2;
|
|
13
|
+
return import('govuk-frontend');
|
|
14
|
+
case 2:
|
|
15
|
+
client = _context.sent;
|
|
16
|
+
new client[componentName](el).init();
|
|
17
|
+
case 4:
|
|
18
|
+
case "end":
|
|
19
|
+
return _context.stop();
|
|
20
|
+
}
|
|
21
|
+
}, _callee);
|
|
22
|
+
}));
|
|
23
|
+
return function initialiseComponent(_x, _x2) {
|
|
24
|
+
return _ref.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
}();
|
|
27
|
+
export function useMODUKComponent(componentName) {
|
|
28
|
+
var ref = useRef(null);
|
|
29
|
+
var previousRef = useRef(null);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
if (ref.current && ref.current !== previousRef.current) {
|
|
32
|
+
initialiseComponent(componentName, ref.current);
|
|
33
|
+
previousRef.current = ref.current;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
ref: ref
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePrevious';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MODUKBody } from '../../MODUKBody/MODUKBody';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export var Root = function Root(_ref) {
|
|
5
|
+
var exampleName = _ref.exampleName,
|
|
6
|
+
component = _ref.component,
|
|
7
|
+
children = _ref.children;
|
|
8
|
+
var titlePrefix = exampleName && component ? "".concat(exampleName, " \u2013 ").concat(component, " \u2013 ") : '';
|
|
9
|
+
return _jsxs("html", {
|
|
10
|
+
lang: "en",
|
|
11
|
+
children: [_jsxs("head", {
|
|
12
|
+
children: [_jsx("title", {
|
|
13
|
+
children: "".concat(titlePrefix, "MOD.UK Frontend React")
|
|
14
|
+
}), _jsx("meta", {
|
|
15
|
+
name: "viewport",
|
|
16
|
+
content: "width=device-width, initial-scale=1, viewport-fit=cover"
|
|
17
|
+
}), _jsx("meta", {
|
|
18
|
+
httpEquiv: "X-UA-Compatible",
|
|
19
|
+
content: "IE=edge"
|
|
20
|
+
}), _jsx("link", {
|
|
21
|
+
href: "/css/index.css",
|
|
22
|
+
rel: "stylesheet"
|
|
23
|
+
})]
|
|
24
|
+
}), _jsxs(MODUKBody, {
|
|
25
|
+
children: [_jsx("div", {
|
|
26
|
+
id: "root",
|
|
27
|
+
children: children
|
|
28
|
+
}), _jsx("script", {
|
|
29
|
+
src: "/react-example-client/index.js"
|
|
30
|
+
})]
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|