@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,41 @@
|
|
|
1
|
+
{% from "moduk/components/accordion/macro.njk" import modukAccordion -%}
|
|
2
|
+
|
|
3
|
+
{{ modukAccordion({
|
|
4
|
+
id: "accordion-default",
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
heading: {
|
|
8
|
+
text: "Writing well for the web"
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
html: "<p class='govuk-body'>This is the content for Writing well for the web.</p>"
|
|
12
|
+
},
|
|
13
|
+
expanded: true
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
heading: {
|
|
17
|
+
text: "Writing well for specialists"
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
html: "<p class='govuk-body'>This is the content for Writing well for specialists.</p>"
|
|
21
|
+
},
|
|
22
|
+
expanded: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
heading: {
|
|
26
|
+
text: "Know your audience"
|
|
27
|
+
},
|
|
28
|
+
content: {
|
|
29
|
+
html: "<p class='govuk-body'>This is the content for Know your audience.</p>"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
heading: {
|
|
34
|
+
text: "How people read"
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
html: "<p class='govuk-body'>This is the content for How people read.</p>"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}) -}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% from "moduk/components/accordion/macro.njk" import modukAccordion -%}
|
|
2
|
+
|
|
3
|
+
{{ modukAccordion({
|
|
4
|
+
id: "accordion-default",
|
|
5
|
+
headingLevel: 3,
|
|
6
|
+
items: [
|
|
7
|
+
{
|
|
8
|
+
heading: {
|
|
9
|
+
text: "Writing well for the web"
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
text: "This is the content for Writing well for the web."
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
heading: {
|
|
17
|
+
text: "Writing well for specialists"
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
text: "This is the content for Writing well for specialists."
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
heading: {
|
|
25
|
+
text: "Know your audience"
|
|
26
|
+
},
|
|
27
|
+
content: {
|
|
28
|
+
text: "This is the content for Know your audience."
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
heading: {
|
|
33
|
+
text: "How people read"
|
|
34
|
+
},
|
|
35
|
+
content: {
|
|
36
|
+
text: "This is the content for How people read."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}) -}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% from "moduk/components/accordion/macro.njk" import modukAccordion -%}
|
|
2
|
+
|
|
3
|
+
{{ modukAccordion({
|
|
4
|
+
id: "accordion-with-remember-expanded-off",
|
|
5
|
+
rememberExpanded: false,
|
|
6
|
+
items: [
|
|
7
|
+
{
|
|
8
|
+
heading: {
|
|
9
|
+
text: "Writing well for the web"
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
html: "<p class='govuk-body'>This is the content for Writing well for the web.</p>"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
heading: {
|
|
17
|
+
text: "Writing well for specialists"
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
html: "<p class='govuk-body'>This is the content for Writing well for specialists.</p>"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
heading: {
|
|
25
|
+
text: "Know your audience"
|
|
26
|
+
},
|
|
27
|
+
content: {
|
|
28
|
+
html: "<p class='govuk-body'>This is the content for Know your audience.</p>"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
heading: {
|
|
33
|
+
text: "How people read"
|
|
34
|
+
},
|
|
35
|
+
content: {
|
|
36
|
+
html: "<p class='govuk-body'>This is the content for How people read.</p>"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}) -}}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{% from "moduk/components/accordion/macro.njk" import modukAccordion -%}
|
|
2
|
+
|
|
3
|
+
{{ modukAccordion({
|
|
4
|
+
id: "accordion-with-summary-sections",
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
heading: {
|
|
8
|
+
text: "Understanding agile project management"
|
|
9
|
+
},
|
|
10
|
+
summary: {
|
|
11
|
+
text: "Introductions, methods, core features."
|
|
12
|
+
},
|
|
13
|
+
content: {
|
|
14
|
+
html:
|
|
15
|
+
'<ul class="govuk-list">
|
|
16
|
+
<li>
|
|
17
|
+
<a class="govuk-link" href="#">Agile and government services: an introduction</a>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<a class="govuk-link" href="#">Agile methods: an introduction</a>
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
<a class="govuk-link" href="#">Core principles of agile</a>
|
|
24
|
+
</li>
|
|
25
|
+
</ul>'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
heading: {
|
|
30
|
+
text: "Working with agile methods"
|
|
31
|
+
},
|
|
32
|
+
summary: {
|
|
33
|
+
text: "Workspaces, tools and techniques, user stories, planning."
|
|
34
|
+
},
|
|
35
|
+
content: {
|
|
36
|
+
html:
|
|
37
|
+
'<ul class="govuk-list">
|
|
38
|
+
<li>
|
|
39
|
+
<a class="govuk-link" href="#">Creating an agile working environment</a>
|
|
40
|
+
</li>
|
|
41
|
+
<li>
|
|
42
|
+
<a class="govuk-link" href="#">Agile tools and techniques</a>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<a class="govuk-link" href="#">Set up a team wall</a>
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<a class="govuk-link" href="#">Writing user stories</a>
|
|
49
|
+
</li>
|
|
50
|
+
<li>
|
|
51
|
+
<a class="govuk-link" href="#">Planning in agile</a>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<a class="govuk-link" href="#">Deciding on priorities</a>
|
|
55
|
+
</li>
|
|
56
|
+
<li>
|
|
57
|
+
<a class="govuk-link" href="#">Developing a roadmap</a>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
heading: {
|
|
64
|
+
text: "Governing agile services"
|
|
65
|
+
},
|
|
66
|
+
summary: {
|
|
67
|
+
text: "Principles, measuring progress, spending money."
|
|
68
|
+
},
|
|
69
|
+
content: {
|
|
70
|
+
html:
|
|
71
|
+
'<ul class="govuk-list">
|
|
72
|
+
<li>
|
|
73
|
+
<a class="govuk-link" href="#">Governance principles for agile service delivery</a>
|
|
74
|
+
</li>
|
|
75
|
+
<li>
|
|
76
|
+
<a class="govuk-link" href="#">Measuring and reporting progress</a>
|
|
77
|
+
</li>
|
|
78
|
+
<li>
|
|
79
|
+
<a class="govuk-link" href="#">Spend controls: check if you need approval to spend money on a service</a>
|
|
80
|
+
</li>
|
|
81
|
+
<li>
|
|
82
|
+
<a class="govuk-link" href="#">Spend controls: apply for approval to spend money on a service</a>
|
|
83
|
+
</li>
|
|
84
|
+
<li>
|
|
85
|
+
<a class="govuk-link" href="#">Spend controls: the new pipeline process</a>
|
|
86
|
+
</li>
|
|
87
|
+
<li>
|
|
88
|
+
<a class="govuk-link" href="#">Working across organisational boundaries</a>
|
|
89
|
+
</li>
|
|
90
|
+
</ul>'
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
heading: {
|
|
95
|
+
text: "Phases of an agile project"
|
|
96
|
+
},
|
|
97
|
+
summary: {
|
|
98
|
+
text: "Discovery, alpha, beta, live and retirement."
|
|
99
|
+
},
|
|
100
|
+
content: {
|
|
101
|
+
html:
|
|
102
|
+
'<ul class="govuk-list">
|
|
103
|
+
<li>
|
|
104
|
+
<a class="govuk-link" href="#">How the discovery phase works</a>
|
|
105
|
+
</li>
|
|
106
|
+
<li>
|
|
107
|
+
<a class="govuk-link" href="#">How the alpha phase works</a>
|
|
108
|
+
</li>
|
|
109
|
+
<li>
|
|
110
|
+
<a class="govuk-link" href="#">How the beta phase works</a>
|
|
111
|
+
</li>
|
|
112
|
+
<li>
|
|
113
|
+
<a class="govuk-link" href="#">How the live phase works</a>
|
|
114
|
+
</li>
|
|
115
|
+
<li>
|
|
116
|
+
<a class="govuk-link" href="#">Retiring your service</a>
|
|
117
|
+
</li>
|
|
118
|
+
</ul>'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}) -}}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{% from "moduk/components/accordion/macro.njk" import modukAccordion -%}
|
|
2
|
+
|
|
3
|
+
{{ modukAccordion({
|
|
4
|
+
id: "accordion-default",
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
heading: {
|
|
8
|
+
text: "Writing well for the web"
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
text: "This is the content for Writing well for the web."
|
|
12
|
+
},
|
|
13
|
+
expanded: true
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
heading: {
|
|
17
|
+
text: "Writing well for specialists"
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
text: "This is the content for Writing well for specialists."
|
|
21
|
+
},
|
|
22
|
+
expanded: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
heading: {
|
|
26
|
+
text: "Know your audience"
|
|
27
|
+
},
|
|
28
|
+
content: {
|
|
29
|
+
text: "This is the content for Know your audience."
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
heading: {
|
|
34
|
+
text: "How people read"
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
text: "This is the content for How people read."
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}) -}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{% from "moduk/components/breadcrumbs/macro.njk" import modukBreadcrumbs -%}
|
|
2
|
+
|
|
3
|
+
{{ modukBreadcrumbs({
|
|
4
|
+
items: [
|
|
5
|
+
{
|
|
6
|
+
text: "Home",
|
|
7
|
+
href: "#"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
text: "Components",
|
|
11
|
+
href: "#"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: "Breadcrumbs",
|
|
15
|
+
href: "#"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}) -}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% from "moduk/components/button/macro.njk" import modukButton -%}
|
|
2
|
+
|
|
3
|
+
<div class="govuk-button-group">
|
|
4
|
+
{{ modukButton({
|
|
5
|
+
text: "Save and continue"
|
|
6
|
+
}) -}}
|
|
7
|
+
|
|
8
|
+
{{- modukButton({
|
|
9
|
+
text: "Save as draft",
|
|
10
|
+
classes: "govuk-button--secondary"
|
|
11
|
+
}) -}}
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{% from "moduk/components/button/macro.njk" import modukButton -%}
|
|
2
|
+
|
|
3
|
+
<form id="testForm">
|
|
4
|
+
{{ modukButton({
|
|
5
|
+
text: "Confirm and send",
|
|
6
|
+
preventDoubleClick: true
|
|
7
|
+
}) }}
|
|
8
|
+
</form>
|
|
9
|
+
|
|
10
|
+
<div class="govuk-body" data-testid="submitCountDisplay"></div>
|
|
11
|
+
<div class="govuk-body" data-testid="buttonCountDisplay"></div>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
var submitCount = 0
|
|
15
|
+
var buttonCount = 0
|
|
16
|
+
|
|
17
|
+
var submitCountDisplay = document.querySelector('[data-testid="submitCountDisplay"]')
|
|
18
|
+
var buttonCountDisplay = document.querySelector('[data-testid="buttonCountDisplay"]')
|
|
19
|
+
|
|
20
|
+
document.getElementById('testForm').addEventListener('click', function () {
|
|
21
|
+
buttonCount += 1
|
|
22
|
+
buttonCountDisplay.innerText = 'Button click count ' + buttonCount;
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
document.getElementById('testForm').addEventListener('submit', function (event) {
|
|
26
|
+
event.preventDefault()
|
|
27
|
+
submitCount += 1
|
|
28
|
+
submitCountDisplay.innerText = 'Form submit count ' + submitCount;
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% from "moduk/components/character-count/macro.njk" import modukCharacterCount -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCharacterCount({
|
|
4
|
+
name: "with-hint",
|
|
5
|
+
id: "with-hint",
|
|
6
|
+
maxlength: 200,
|
|
7
|
+
label: {
|
|
8
|
+
text: "Can you provide more detail?",
|
|
9
|
+
classes: "govuk-label--l",
|
|
10
|
+
isPageHeading: true
|
|
11
|
+
},
|
|
12
|
+
hint: {
|
|
13
|
+
text: "Do not include personal information like your service number."
|
|
14
|
+
}
|
|
15
|
+
}) -}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% from "moduk/components/character-count/macro.njk" import modukCharacterCount -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCharacterCount({
|
|
4
|
+
id: "exceeding-characters",
|
|
5
|
+
name: "exceeding",
|
|
6
|
+
maxlength: 200,
|
|
7
|
+
value: "I would like to request my service record and have a question about what proof of address is acceptable. The guidance doesn’t say if a digital bank statement will be accepted. Can someone please confirm if",
|
|
8
|
+
label: {
|
|
9
|
+
text: "Can you provide more detail?",
|
|
10
|
+
classes: "govuk-label--l",
|
|
11
|
+
isPageHeading: true
|
|
12
|
+
},
|
|
13
|
+
hint: {
|
|
14
|
+
text: "Do not include personal information like your service number."
|
|
15
|
+
},
|
|
16
|
+
errorMessage: {
|
|
17
|
+
text: "Detail must be 200 characters or less"
|
|
18
|
+
}
|
|
19
|
+
}) -}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% from "moduk/components/character-count/macro.njk" import modukCharacterCount -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCharacterCount({
|
|
4
|
+
name: "threshold",
|
|
5
|
+
id: "threshold",
|
|
6
|
+
maxlength: 112,
|
|
7
|
+
threshold: 75,
|
|
8
|
+
value: "Type another letter into this field after this message to see the threshold feature",
|
|
9
|
+
label: {
|
|
10
|
+
text: "Can you provide more detail?",
|
|
11
|
+
classes: "govuk-label--l",
|
|
12
|
+
isPageHeading: true
|
|
13
|
+
}
|
|
14
|
+
}) -}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% from "moduk/components/character-count/macro.njk" import modukCharacterCount -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCharacterCount({
|
|
4
|
+
name: "word-count",
|
|
5
|
+
id: "word-count",
|
|
6
|
+
maxwords: 150,
|
|
7
|
+
label: {
|
|
8
|
+
text: "Enter a job description",
|
|
9
|
+
classes: "govuk-label--l",
|
|
10
|
+
isPageHeading: true
|
|
11
|
+
}
|
|
12
|
+
}) -}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCheckboxes({
|
|
4
|
+
name: "incident-default",
|
|
5
|
+
fieldset: {
|
|
6
|
+
legend: {
|
|
7
|
+
text: "Who did you report the incident to?",
|
|
8
|
+
isPageHeading: true,
|
|
9
|
+
classes: "govuk-fieldset__legend--l"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
hint: {
|
|
13
|
+
text: "Select all that apply."
|
|
14
|
+
},
|
|
15
|
+
items: [
|
|
16
|
+
{
|
|
17
|
+
value: "unit-medic",
|
|
18
|
+
text: "Unit medic"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "hospital",
|
|
22
|
+
text: "Hospital"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "chain-of-command",
|
|
26
|
+
text: "Chain of command"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "colleague",
|
|
30
|
+
text: "Colleague"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "other-person",
|
|
34
|
+
text: "Other person"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}) -}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCheckboxes({
|
|
4
|
+
name: "incident-not-as-page-heading",
|
|
5
|
+
fieldset: {
|
|
6
|
+
legend: {
|
|
7
|
+
text: "Who did you report the incident to?"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
hint: {
|
|
11
|
+
text: "Select all that apply."
|
|
12
|
+
},
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
value: "unit-medic",
|
|
16
|
+
text: "Unit medic"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "hospital",
|
|
20
|
+
text: "Hospital"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "chain-of-command",
|
|
24
|
+
text: "Chain of command"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "colleague",
|
|
28
|
+
text: "Colleague"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "other-person",
|
|
32
|
+
text: "Other person"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}) -}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
|
|
2
|
+
|
|
3
|
+
{{ modukCheckboxes({
|
|
4
|
+
name: "organisation-small",
|
|
5
|
+
classes: "govuk-checkboxes--small",
|
|
6
|
+
fieldset: {
|
|
7
|
+
legend: {
|
|
8
|
+
text: "Organisation",
|
|
9
|
+
isPageHeading: true,
|
|
10
|
+
classes: "govuk-fieldset__legend--m"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
value: "royal-navy",
|
|
16
|
+
text: "Royal Navy"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "british-army",
|
|
20
|
+
text: "British Army"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "royal-air-force",
|
|
24
|
+
text: "Royal Air Force"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "strategic-command",
|
|
28
|
+
text: "Strategic Command"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}) -}}
|