@moduk/frontend 1.2.0 → 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 +44 -35
- 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,45 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
{% from "moduk/components/fieldset/macro.njk" import modukFieldset -%}
|
|
3
|
+
|
|
4
|
+
{% call modukFieldset({
|
|
5
|
+
legend: {
|
|
6
|
+
text: "What is your address?",
|
|
7
|
+
classes: "govuk-fieldset__legend--l",
|
|
8
|
+
isPageHeading: true
|
|
9
|
+
}
|
|
10
|
+
}) -%}
|
|
11
|
+
{{ modukInput({
|
|
12
|
+
label: {
|
|
13
|
+
text: 'Address line 1'
|
|
14
|
+
},
|
|
15
|
+
id: "address-line-1",
|
|
16
|
+
name: "address-line-1",
|
|
17
|
+
autocomplete: "address-line1"
|
|
18
|
+
}) -}}
|
|
19
|
+
{{ modukInput({
|
|
20
|
+
label: {
|
|
21
|
+
text: 'Address line 2 (optional)'
|
|
22
|
+
},
|
|
23
|
+
id: "address-line-2",
|
|
24
|
+
name: "address-line-2",
|
|
25
|
+
autocomplete: "address-line2"
|
|
26
|
+
}) -}}
|
|
27
|
+
{{ modukInput({
|
|
28
|
+
label: {
|
|
29
|
+
text: "Town or city"
|
|
30
|
+
},
|
|
31
|
+
classes: "govuk-!-width-two-thirds",
|
|
32
|
+
id: "address-town",
|
|
33
|
+
name: "address-town",
|
|
34
|
+
autocomplete: "address-level2"
|
|
35
|
+
}) -}}
|
|
36
|
+
{{ modukInput({
|
|
37
|
+
label: {
|
|
38
|
+
text: "Postcode"
|
|
39
|
+
},
|
|
40
|
+
classes: "govuk-input--width-10",
|
|
41
|
+
id: "address-postcode",
|
|
42
|
+
name: "address-postcode",
|
|
43
|
+
autocomplete: "postal-code"
|
|
44
|
+
}) -}}
|
|
45
|
+
{% endcall -%}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
|
|
2
|
+
|
|
3
|
+
{% macro modukFieldset(params) -%}
|
|
4
|
+
{% if caller -%}
|
|
5
|
+
{% call govukFieldset(params) -%}
|
|
6
|
+
{{ caller() }}
|
|
7
|
+
{%- endcall %}
|
|
8
|
+
{%- else -%}
|
|
9
|
+
{{ govukFieldset(params) }}
|
|
10
|
+
{%- endif %}
|
|
11
|
+
{%- endmacro %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% from "moduk/components/file-upload/macro.njk" import modukFileUpload -%}
|
|
2
|
+
|
|
3
|
+
{{ modukFileUpload({
|
|
4
|
+
id: "file-upload-with-error",
|
|
5
|
+
name: "file-upload-with-error",
|
|
6
|
+
label: {
|
|
7
|
+
text: "Upload a file"
|
|
8
|
+
},
|
|
9
|
+
errorMessage: {
|
|
10
|
+
text: "The CSV must be smaller than 2MB"
|
|
11
|
+
}
|
|
12
|
+
}) -}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% from "moduk/components/footer/macro.njk" import modukFooter -%}
|
|
2
|
+
|
|
3
|
+
{{ modukFooter({
|
|
4
|
+
meta: {
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
href: "#1",
|
|
8
|
+
text: "Item 1"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
href: "#2",
|
|
12
|
+
text: "Item 2"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: "#3",
|
|
16
|
+
text: "Item 3"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}) -}}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{% from "moduk/components/footer/macro.njk" import modukFooter -%}
|
|
2
|
+
|
|
3
|
+
{{ modukFooter({
|
|
4
|
+
navigation: [
|
|
5
|
+
{
|
|
6
|
+
title: "Two column list",
|
|
7
|
+
width: "two-thirds",
|
|
8
|
+
columns: 2,
|
|
9
|
+
items: [
|
|
10
|
+
{
|
|
11
|
+
href: "#1",
|
|
12
|
+
text: "Navigation item 1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: "#2",
|
|
16
|
+
text: "Navigation item 2"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
href: "#3",
|
|
20
|
+
text: "Navigation item 3"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
href: "#4",
|
|
24
|
+
text: "Navigation item 4"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
href: "#5",
|
|
28
|
+
text: "Navigation item 5"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
href: "#6",
|
|
32
|
+
text: "Navigation item 6"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Single column list",
|
|
38
|
+
width: "one-third",
|
|
39
|
+
items: [
|
|
40
|
+
{
|
|
41
|
+
href: "#1",
|
|
42
|
+
text: "Navigation item 1"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
href: "#2",
|
|
46
|
+
text: "Navigation item 2"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
href: "#3",
|
|
50
|
+
text: "Navigation item 3"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
meta: {
|
|
56
|
+
items: [
|
|
57
|
+
{
|
|
58
|
+
href: "#1",
|
|
59
|
+
text: "Item 1"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
href: "#2",
|
|
63
|
+
text: "Item 2"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
href: "#3",
|
|
67
|
+
text: "Item 3"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
html: 'Built by <a href="#" class="govuk-footer__link">Defence Digital</a>'
|
|
71
|
+
}
|
|
72
|
+
}) -}}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{% from "moduk/components/footer/macro.njk" import modukFooter -%}
|
|
2
|
+
|
|
3
|
+
{{ modukFooter({
|
|
4
|
+
navigation: [
|
|
5
|
+
{
|
|
6
|
+
title: "Two column list",
|
|
7
|
+
width: "two-thirds",
|
|
8
|
+
columns: 2,
|
|
9
|
+
items: [
|
|
10
|
+
{
|
|
11
|
+
href: "#1",
|
|
12
|
+
text: "Navigation item 1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: "#2",
|
|
16
|
+
text: "Navigation item 2"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
href: "#3",
|
|
20
|
+
text: "Navigation item 3"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
href: "#4",
|
|
24
|
+
text: "Navigation item 4"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
href: "#5",
|
|
28
|
+
text: "Navigation item 5"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
href: "#6",
|
|
32
|
+
text: "Navigation item 6"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Single column list",
|
|
38
|
+
width: "one-third",
|
|
39
|
+
items: [
|
|
40
|
+
{
|
|
41
|
+
href: "#1",
|
|
42
|
+
text: "Navigation item 1"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
href: "#2",
|
|
46
|
+
text: "Navigation item 2"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
href: "#3",
|
|
50
|
+
text: "Navigation item 3"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}) -}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{% from "moduk/components/header/macro.njk" import modukHeader -%}
|
|
2
|
+
|
|
3
|
+
{{ modukHeader({
|
|
4
|
+
homepageUrl: "#",
|
|
5
|
+
serviceName: "Service name",
|
|
6
|
+
serviceUrl: "#",
|
|
7
|
+
navigation: [
|
|
8
|
+
{
|
|
9
|
+
href: "#1",
|
|
10
|
+
text: "Navigation item 1",
|
|
11
|
+
active: true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
href: "#2",
|
|
15
|
+
text: "Navigation item 2"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
href: "#3",
|
|
19
|
+
text: "Navigation item 3"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
href: "#4",
|
|
23
|
+
text: "Navigation item 4"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}) -}}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{#
|
|
2
|
+
This macro is based on the GOV.UK equivalent from the GOV.UK Frontend:
|
|
3
|
+
https://github.com/alphagov/govuk-frontend/blob/cdfc281bebf0afb6ea121ee8f52eb332dfc40615/src/govuk/components/header/template.njk
|
|
4
|
+
|
|
5
|
+
The logo has been changed, some CSS classes have been added and there are some slight markup changes.
|
|
6
|
+
#}
|
|
7
|
+
|
|
8
|
+
{% macro modukHeader(params) -%}
|
|
9
|
+
|
|
10
|
+
{% set menuButtonText = params.menuButtonText if params.menuButtonText else 'Menu' -%}
|
|
11
|
+
|
|
12
|
+
<header class="govuk-header {{ params.classes if params.classes }}" role="banner" data-module="govuk-header"
|
|
13
|
+
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
14
|
+
<div class="govuk-header__container {{ params.containerClasses | default('govuk-width-container') }}">
|
|
15
|
+
<div class="moduk-header__logo govuk-header__logo">
|
|
16
|
+
<a href="{{ params.homepageUrl | default('/') }}" class="govuk-header__link govuk-header__link--homepage" title="Home">
|
|
17
|
+
<span class="govuk-header__logotype">
|
|
18
|
+
{#- Note that this is deliberately an inline SVG, so that currentColor is used.
|
|
19
|
+
See the original macro in GOV.UK Frontend for more details. #}
|
|
20
|
+
{% MODUKincludeSVG 'moduk-header-logo' %}
|
|
21
|
+
</span>
|
|
22
|
+
</a>
|
|
23
|
+
</div>
|
|
24
|
+
{%- if params.serviceName or params.navigation %}
|
|
25
|
+
<div class="govuk-header__content">
|
|
26
|
+
{%- if params.serviceName %}
|
|
27
|
+
{%- if params.serviceUrl %}
|
|
28
|
+
<a href="{{ params.serviceUrl }}" class="govuk-header__link moduk-header__service-name govuk-header__service-name">
|
|
29
|
+
{{ params.serviceName }}
|
|
30
|
+
</a>
|
|
31
|
+
{%- else %}
|
|
32
|
+
<span class="moduk-header__service-name govuk-header__service-name">
|
|
33
|
+
{{ params.serviceName }}
|
|
34
|
+
</span>
|
|
35
|
+
{% endif -%}
|
|
36
|
+
{%- endif -%}
|
|
37
|
+
{%- if params.navigation %}
|
|
38
|
+
<nav aria-label="{{ params.navigationLabel | default(menuButtonText) }}" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}">
|
|
39
|
+
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="{{ params.menuButtonLabel | default('Show or hide menu') }}" hidden>{{ menuButtonText }}</button>
|
|
40
|
+
<ul id="navigation" class="govuk-header__navigation-list">
|
|
41
|
+
{%- for item in params.navigation -%}
|
|
42
|
+
{%- if item.text or item.html %}
|
|
43
|
+
<li class="govuk-header__navigation-item{{ ' govuk-header__navigation-item--active moduk-header__navigation-item--active' if item.active }}">
|
|
44
|
+
{% if item.href -%}
|
|
45
|
+
<a class="govuk-header__link" href="{{ item.href }}"{% for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
|
46
|
+
{%- endif -%}
|
|
47
|
+
{{ item.html | safe if item.html else item.text }}
|
|
48
|
+
{%- if item.href -%}
|
|
49
|
+
</a>
|
|
50
|
+
{%- endif %}
|
|
51
|
+
</li>
|
|
52
|
+
{%- endif %}
|
|
53
|
+
{%- endfor %}
|
|
54
|
+
</ul>
|
|
55
|
+
</nav>
|
|
56
|
+
{%- endif %}
|
|
57
|
+
</div>
|
|
58
|
+
{%- endif %}
|
|
59
|
+
</div>
|
|
60
|
+
</header>
|
|
61
|
+
|
|
62
|
+
{%- endmacro -%}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
label: {
|
|
5
|
+
text: "What is the name of the event?",
|
|
6
|
+
classes: "govuk-label--l",
|
|
7
|
+
isPageHeading: true
|
|
8
|
+
},
|
|
9
|
+
id: "with-error",
|
|
10
|
+
name: "event-name-with-error",
|
|
11
|
+
hint: {
|
|
12
|
+
text: "The name you’ll use on promotional material"
|
|
13
|
+
},
|
|
14
|
+
errorMessage: {
|
|
15
|
+
text: "Enter an event name"
|
|
16
|
+
}
|
|
17
|
+
}) -}}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
{{- modukInput({
|
|
5
|
+
label: {
|
|
6
|
+
text: "20 character width"
|
|
7
|
+
},
|
|
8
|
+
classes: "govuk-input--width-20",
|
|
9
|
+
id: "width-20",
|
|
10
|
+
name: "width-20"
|
|
11
|
+
}) -}}
|
|
12
|
+
|
|
13
|
+
{{ modukInput({
|
|
14
|
+
label: {
|
|
15
|
+
text: "10 character width"
|
|
16
|
+
},
|
|
17
|
+
classes: "govuk-input--width-10",
|
|
18
|
+
id: "width-10",
|
|
19
|
+
name: "width-10"
|
|
20
|
+
}) -}}
|
|
21
|
+
|
|
22
|
+
{{ modukInput({
|
|
23
|
+
label: {
|
|
24
|
+
text: "5 character width"
|
|
25
|
+
},
|
|
26
|
+
classes: "govuk-input--width-5",
|
|
27
|
+
id: "width-5",
|
|
28
|
+
name: "width-5"
|
|
29
|
+
}) -}}
|
|
30
|
+
|
|
31
|
+
{{ modukInput({
|
|
32
|
+
label: {
|
|
33
|
+
text: "4 character width"
|
|
34
|
+
},
|
|
35
|
+
classes: "govuk-input--width-4",
|
|
36
|
+
id: "width-4",
|
|
37
|
+
name: "width-4"
|
|
38
|
+
}) -}}
|
|
39
|
+
|
|
40
|
+
{{ modukInput({
|
|
41
|
+
label: {
|
|
42
|
+
text: "3 character width"
|
|
43
|
+
},
|
|
44
|
+
classes: "govuk-input--width-3",
|
|
45
|
+
id: "width-3",
|
|
46
|
+
name: "width-3"
|
|
47
|
+
}) -}}
|
|
48
|
+
|
|
49
|
+
{{ modukInput({
|
|
50
|
+
label: {
|
|
51
|
+
text: "2 character width"
|
|
52
|
+
},
|
|
53
|
+
classes: "govuk-input--width-2",
|
|
54
|
+
id: "width-2",
|
|
55
|
+
name: "width-2"
|
|
56
|
+
}) -}}
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
{{- modukInput({
|
|
5
|
+
label: {
|
|
6
|
+
text: "Full width"
|
|
7
|
+
},
|
|
8
|
+
classes: "govuk-!-width-full",
|
|
9
|
+
id: "full",
|
|
10
|
+
name: "full"
|
|
11
|
+
}) -}}
|
|
12
|
+
|
|
13
|
+
{{ modukInput({
|
|
14
|
+
label: {
|
|
15
|
+
text: "Three-quarters width"
|
|
16
|
+
},
|
|
17
|
+
classes: "govuk-!-width-three-quarters",
|
|
18
|
+
id: "three-quarters",
|
|
19
|
+
name: "three-quarters"
|
|
20
|
+
}) -}}
|
|
21
|
+
|
|
22
|
+
{{ modukInput({
|
|
23
|
+
label: {
|
|
24
|
+
text: "Two-thirds width"
|
|
25
|
+
},
|
|
26
|
+
classes: "govuk-!-width-two-thirds",
|
|
27
|
+
id: "two-thirds",
|
|
28
|
+
name: "two-thirds"
|
|
29
|
+
}) -}}
|
|
30
|
+
|
|
31
|
+
{{ modukInput({
|
|
32
|
+
label: {
|
|
33
|
+
text: "One-half width"
|
|
34
|
+
},
|
|
35
|
+
classes: "govuk-!-width-one-half",
|
|
36
|
+
id: "one-half",
|
|
37
|
+
name: "one-half"
|
|
38
|
+
}) -}}
|
|
39
|
+
|
|
40
|
+
{{ modukInput({
|
|
41
|
+
label: {
|
|
42
|
+
text: "One-third width"
|
|
43
|
+
},
|
|
44
|
+
classes: "govuk-!-width-one-third",
|
|
45
|
+
id: "one-third",
|
|
46
|
+
name: "one-third"
|
|
47
|
+
}) -}}
|
|
48
|
+
|
|
49
|
+
{{ modukInput({
|
|
50
|
+
label: {
|
|
51
|
+
text: "One-quarter width"
|
|
52
|
+
},
|
|
53
|
+
classes: "govuk-!-width-one-quarter",
|
|
54
|
+
id: "one-quarter",
|
|
55
|
+
name: "one-quarter"
|
|
56
|
+
}) -}}
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
label: {
|
|
5
|
+
text: "What is the name of the event?",
|
|
6
|
+
classes: "govuk-label--l",
|
|
7
|
+
isPageHeading: true
|
|
8
|
+
},
|
|
9
|
+
hint: {
|
|
10
|
+
text: "The name you’ll use on promotional material"
|
|
11
|
+
},
|
|
12
|
+
id: "with-hint",
|
|
13
|
+
name: "event-name-with-hint"
|
|
14
|
+
}) -}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
label: {
|
|
5
|
+
text: "What is your account number?",
|
|
6
|
+
classes: "govuk-label--l",
|
|
7
|
+
isPageHeading: true
|
|
8
|
+
},
|
|
9
|
+
classes: "govuk-input--width-10",
|
|
10
|
+
hint: {
|
|
11
|
+
text: "Must be between 6 and 8 digits long"
|
|
12
|
+
},
|
|
13
|
+
id: "with-numeric",
|
|
14
|
+
name: "account-number-with-numeric",
|
|
15
|
+
inputmode: "numeric",
|
|
16
|
+
spellcheck: false
|
|
17
|
+
}) -}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
id: "with-prefix-and-suffix-error",
|
|
5
|
+
name: "cost-per-item-with-prefix-and-suffix-error",
|
|
6
|
+
label: {
|
|
7
|
+
text: "What is the cost per item, in pounds?",
|
|
8
|
+
classes: "govuk-label--l",
|
|
9
|
+
isPageHeading: true
|
|
10
|
+
},
|
|
11
|
+
prefix: {
|
|
12
|
+
text: "£"
|
|
13
|
+
},
|
|
14
|
+
suffix: {
|
|
15
|
+
text: "per item"
|
|
16
|
+
},
|
|
17
|
+
errorMessage: {
|
|
18
|
+
text: "Enter a cost per item, in pounds"
|
|
19
|
+
},
|
|
20
|
+
classes: "govuk-input--width-5",
|
|
21
|
+
spellcheck: false
|
|
22
|
+
}) -}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
id: "with-prefix-and-suffix",
|
|
5
|
+
name: "cost-per-item-with-prefix-and-suffix",
|
|
6
|
+
label: {
|
|
7
|
+
text: "What is the cost per item, in pounds?",
|
|
8
|
+
classes: "govuk-label--l",
|
|
9
|
+
isPageHeading: true
|
|
10
|
+
},
|
|
11
|
+
prefix: {
|
|
12
|
+
text: "£"
|
|
13
|
+
},
|
|
14
|
+
suffix: {
|
|
15
|
+
text: "per item"
|
|
16
|
+
},
|
|
17
|
+
classes: "govuk-input--width-5",
|
|
18
|
+
spellcheck: false
|
|
19
|
+
}) -}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
id: "with-prefix",
|
|
5
|
+
name: "cost-with-prefix",
|
|
6
|
+
label: {
|
|
7
|
+
text: "What is the cost in pounds?",
|
|
8
|
+
classes: "govuk-label--l",
|
|
9
|
+
isPageHeading: true
|
|
10
|
+
},
|
|
11
|
+
prefix: {
|
|
12
|
+
text: "£"
|
|
13
|
+
},
|
|
14
|
+
classes: "govuk-input--width-5",
|
|
15
|
+
spellcheck: false
|
|
16
|
+
}) -}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{% from "moduk/components/input/macro.njk" import modukInput -%}
|
|
2
|
+
|
|
3
|
+
{{ modukInput({
|
|
4
|
+
id: "with-suffix",
|
|
5
|
+
name: "weight-with-suffix",
|
|
6
|
+
label: {
|
|
7
|
+
text: "What is the weight in kilograms?",
|
|
8
|
+
classes: "govuk-label--l",
|
|
9
|
+
isPageHeading: true
|
|
10
|
+
},
|
|
11
|
+
suffix: {
|
|
12
|
+
text: "kg"
|
|
13
|
+
},
|
|
14
|
+
classes: "govuk-input--width-5",
|
|
15
|
+
spellcheck: false
|
|
16
|
+
}) -}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
|
|
2
|
+
|
|
3
|
+
{% macro modukInsetText(params) -%}
|
|
4
|
+
{% if caller -%}
|
|
5
|
+
{% call govukInsetText(params) -%}
|
|
6
|
+
{{ caller() }}
|
|
7
|
+
{%- endcall %}
|
|
8
|
+
{%- else -%}
|
|
9
|
+
{{ govukInsetText(params) }}
|
|
10
|
+
{%- endif -%}
|
|
11
|
+
{%- endmacro %}
|