@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.
Files changed (289) hide show
  1. package/assets/images/govuk-crest-2x.png +0 -0
  2. package/assets/images/govuk-crest.png +0 -0
  3. package/assets/svg/moduk-header-logo.svg +7 -0
  4. package/client/index.d.ts +2 -0
  5. package/client/index.d.ts.map +1 -0
  6. package/client/moduk-frontend.mjs +1 -0
  7. package/client/moduk-frontend.umd.js +2 -0
  8. package/client/moduk-frontend.umd.js.map +1 -0
  9. package/css/index.css +1 -0
  10. package/dist/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +9 -9
  11. package/lib/index.d.ts +2 -0
  12. package/lib/index.d.ts.map +1 -0
  13. package/lib/index.js +18 -0
  14. package/lib/index.js.map +1 -0
  15. package/lib/utils.d.ts +25 -0
  16. package/lib/utils.d.ts.map +1 -0
  17. package/lib/utils.js +111 -0
  18. package/lib/utils.js.map +1 -0
  19. package/nunjucks/moduk/components/accordion/__examples__/default.njk +39 -0
  20. package/nunjucks/moduk/components/accordion/__examples__/with-custom-text.njk +45 -0
  21. package/nunjucks/moduk/components/accordion/__examples__/with-expanded-items.njk +41 -0
  22. package/nunjucks/moduk/components/accordion/__examples__/with-h3-headings.njk +40 -0
  23. package/nunjucks/moduk/components/accordion/__examples__/with-remember-expanded-off.njk +40 -0
  24. package/nunjucks/moduk/components/accordion/__examples__/with-summary-lines.njk +122 -0
  25. package/nunjucks/moduk/components/accordion/__examples__/with-text-items.njk +41 -0
  26. package/nunjucks/moduk/components/accordion/macro.njk +5 -0
  27. package/nunjucks/moduk/components/back-link/__examples__/default.njk +6 -0
  28. package/nunjucks/moduk/components/back-link/macro.njk +5 -0
  29. package/nunjucks/moduk/components/breadcrumbs/__examples__/default.njk +18 -0
  30. package/nunjucks/moduk/components/breadcrumbs/macro.njk +5 -0
  31. package/nunjucks/moduk/components/button/__examples__/default.njk +5 -0
  32. package/nunjucks/moduk/components/button/__examples__/disabled.njk +6 -0
  33. package/nunjucks/moduk/components/button/__examples__/group-link.njk +9 -0
  34. package/nunjucks/moduk/components/button/__examples__/grouping.njk +12 -0
  35. package/nunjucks/moduk/components/button/__examples__/prevent-double-click.njk +30 -0
  36. package/nunjucks/moduk/components/button/__examples__/secondary.njk +6 -0
  37. package/nunjucks/moduk/components/button/__examples__/start.njk +7 -0
  38. package/nunjucks/moduk/components/button/__examples__/warning.njk +6 -0
  39. package/nunjucks/moduk/components/button/macro.njk +5 -0
  40. package/nunjucks/moduk/components/character-count/__examples__/default.njk +15 -0
  41. package/nunjucks/moduk/components/character-count/__examples__/not-as-page-heading.njk +10 -0
  42. package/nunjucks/moduk/components/character-count/__examples__/with-error-message.njk +19 -0
  43. package/nunjucks/moduk/components/character-count/__examples__/with-threshold.njk +14 -0
  44. package/nunjucks/moduk/components/character-count/__examples__/word-count.njk +12 -0
  45. package/nunjucks/moduk/components/character-count/macro.njk +5 -0
  46. package/nunjucks/moduk/components/checkboxes/__examples__/default.njk +37 -0
  47. package/nunjucks/moduk/components/checkboxes/__examples__/not-as-page-heading.njk +35 -0
  48. package/nunjucks/moduk/components/checkboxes/__examples__/small.njk +31 -0
  49. package/nunjucks/moduk/components/checkboxes/__examples__/with-conditional-reveal.njk +80 -0
  50. package/nunjucks/moduk/components/checkboxes/__examples__/with-error-message.njk +40 -0
  51. package/nunjucks/moduk/components/checkboxes/__examples__/with-item-hint.njk +32 -0
  52. package/nunjucks/moduk/components/checkboxes/__examples__/with-none-option.njk +45 -0
  53. package/nunjucks/moduk/components/checkboxes/macro.njk +5 -0
  54. package/nunjucks/moduk/components/cookie-banner/__examples__/accepted.njk +47 -0
  55. package/nunjucks/moduk/components/cookie-banner/__examples__/default.njk +34 -0
  56. package/nunjucks/moduk/components/cookie-banner/__examples__/rejected.njk +47 -0
  57. package/nunjucks/moduk/components/cookie-banner/macro.njk +5 -0
  58. package/nunjucks/moduk/components/date-input/__examples__/default.njk +16 -0
  59. package/nunjucks/moduk/components/date-input/__examples__/not-as-page-heading.njk +14 -0
  60. package/nunjucks/moduk/components/date-input/__examples__/with-date-part-error.njk +35 -0
  61. package/nunjucks/moduk/components/date-input/__examples__/with-whole-date-error.njk +36 -0
  62. package/nunjucks/moduk/components/date-input/macro.njk +5 -0
  63. package/nunjucks/moduk/components/details/__examples__/default.njk +6 -0
  64. package/nunjucks/moduk/components/details/__examples__/open.njk +7 -0
  65. package/nunjucks/moduk/components/details/macro.njk +11 -0
  66. package/nunjucks/moduk/components/error-message/__examples__/default.njk +5 -0
  67. package/nunjucks/moduk/components/error-message/macro.njk +5 -0
  68. package/nunjucks/moduk/components/error-summary/__examples__/default.njk +15 -0
  69. package/nunjucks/moduk/components/error-summary/__examples__/with-description-and-error-list.njk +16 -0
  70. package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-checkbox.njk +54 -0
  71. package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-date-part.njk +45 -0
  72. package/nunjucks/moduk/components/error-summary/macro.njk +11 -0
  73. package/nunjucks/moduk/components/fieldset/__examples__/default.njk +45 -0
  74. package/nunjucks/moduk/components/fieldset/macro.njk +11 -0
  75. package/nunjucks/moduk/components/file-upload/__examples__/default.njk +9 -0
  76. package/nunjucks/moduk/components/file-upload/__examples__/with-error.njk +12 -0
  77. package/nunjucks/moduk/components/file-upload/macro.njk +5 -0
  78. package/nunjucks/moduk/components/footer/__examples__/default.njk +3 -0
  79. package/nunjucks/moduk/components/footer/__examples__/with-links.njk +20 -0
  80. package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation-and-links.njk +72 -0
  81. package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation.njk +55 -0
  82. package/nunjucks/moduk/components/footer/macro.njk +5 -0
  83. package/nunjucks/moduk/components/header/__examples__/default.njk +3 -0
  84. package/nunjucks/moduk/components/header/__examples__/with-service-name-and-navigation.njk +26 -0
  85. package/nunjucks/moduk/components/header/__examples__/with-service-name-and-no-service-url.njk +6 -0
  86. package/nunjucks/moduk/components/header/__examples__/with-service-name.njk +7 -0
  87. package/nunjucks/moduk/components/header/macro.njk +62 -0
  88. package/nunjucks/moduk/components/input/__examples__/default.njk +11 -0
  89. package/nunjucks/moduk/components/input/__examples__/not-as-page-heading.njk +9 -0
  90. package/nunjucks/moduk/components/input/__examples__/with-error.njk +17 -0
  91. package/nunjucks/moduk/components/input/__examples__/with-fixed-width.njk +57 -0
  92. package/nunjucks/moduk/components/input/__examples__/with-fluid-width.njk +57 -0
  93. package/nunjucks/moduk/components/input/__examples__/with-hint.njk +14 -0
  94. package/nunjucks/moduk/components/input/__examples__/with-numeric.njk +17 -0
  95. package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix-error.njk +22 -0
  96. package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix.njk +19 -0
  97. package/nunjucks/moduk/components/input/__examples__/with-prefix.njk +16 -0
  98. package/nunjucks/moduk/components/input/__examples__/with-suffix.njk +16 -0
  99. package/nunjucks/moduk/components/input/macro.njk +5 -0
  100. package/nunjucks/moduk/components/inset-text/__examples__/default.njk +5 -0
  101. package/nunjucks/moduk/components/inset-text/macro.njk +11 -0
  102. package/nunjucks/moduk/components/notification-banner/__examples__/default.njk +5 -0
  103. package/nunjucks/moduk/components/notification-banner/__examples__/success.njk +13 -0
  104. package/nunjucks/moduk/components/notification-banner/__examples__/with-html.njk +12 -0
  105. package/nunjucks/moduk/components/notification-banner/macro.njk +11 -0
  106. package/nunjucks/moduk/components/pagination/__examples__/default.njk +25 -0
  107. package/nunjucks/moduk/components/pagination/__examples__/on-the-first-page.njk +22 -0
  108. package/nunjucks/moduk/components/pagination/__examples__/on-the-last-page.njk +22 -0
  109. package/nunjucks/moduk/components/pagination/__examples__/with-ellipses.njk +39 -0
  110. package/nunjucks/moduk/components/pagination/__examples__/with-link-labels.njk +12 -0
  111. package/nunjucks/moduk/components/pagination/__examples__/with-next-and-previous-only.njk +12 -0
  112. package/nunjucks/moduk/components/pagination/macro.njk +5 -0
  113. package/nunjucks/moduk/components/panel/__examples__/default.njk +6 -0
  114. package/nunjucks/moduk/components/panel/macro.njk +11 -0
  115. package/nunjucks/moduk/components/phase-banner/__examples__/beta.njk +8 -0
  116. package/nunjucks/moduk/components/phase-banner/__examples__/default.njk +12 -0
  117. package/nunjucks/moduk/components/phase-banner/__examples__/with-tag-override.njk +9 -0
  118. package/nunjucks/moduk/components/phase-banner/__examples__/with-text.njk +8 -0
  119. package/nunjucks/moduk/components/phase-banner/macro.njk +5 -0
  120. package/nunjucks/moduk/components/radios/__examples__/default.njk +30 -0
  121. package/nunjucks/moduk/components/radios/__examples__/inline.njk +26 -0
  122. package/nunjucks/moduk/components/radios/__examples__/not-as-page-heading.njk +29 -0
  123. package/nunjucks/moduk/components/radios/__examples__/small.njk +31 -0
  124. package/nunjucks/moduk/components/radios/__examples__/with-conditional-reveal.njk +80 -0
  125. package/nunjucks/moduk/components/radios/__examples__/with-divider-option.njk +29 -0
  126. package/nunjucks/moduk/components/radios/__examples__/with-error-message.njk +33 -0
  127. package/nunjucks/moduk/components/radios/__examples__/with-item-hint.njk +31 -0
  128. package/nunjucks/moduk/components/radios/macro.njk +5 -0
  129. package/nunjucks/moduk/components/select/__examples__/default.njk +28 -0
  130. package/nunjucks/moduk/components/select/__examples__/with-hint.njk +55 -0
  131. package/nunjucks/moduk/components/select/macro.njk +5 -0
  132. package/nunjucks/moduk/components/skip-link/__examples__/default.njk +11 -0
  133. package/nunjucks/moduk/components/skip-link/macro.njk +5 -0
  134. package/nunjucks/moduk/components/summary-list/__examples__/cards-with-action.njk +83 -0
  135. package/nunjucks/moduk/components/summary-list/__examples__/cards.njk +221 -0
  136. package/nunjucks/moduk/components/summary-list/__examples__/default.njk +74 -0
  137. package/nunjucks/moduk/components/summary-list/__examples__/with-no-actions.njk +38 -0
  138. package/nunjucks/moduk/components/summary-list/__examples__/with-no-border.njk +39 -0
  139. package/nunjucks/moduk/components/summary-list/macro.njk +5 -0
  140. package/nunjucks/moduk/components/table/__examples__/default.njk +41 -0
  141. package/nunjucks/moduk/components/table/__examples__/with-comparative-numbers.njk +61 -0
  142. package/nunjucks/moduk/components/table/__examples__/with-customised-column-widths.njk +56 -0
  143. package/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +41 -0
  144. package/nunjucks/moduk/components/table/macro.njk +5 -0
  145. package/nunjucks/moduk/components/tabs/__examples__/default.njk +243 -0
  146. package/nunjucks/moduk/components/tabs/macro.njk +5 -0
  147. package/nunjucks/moduk/components/tag/__examples__/blue.njk +6 -0
  148. package/nunjucks/moduk/components/tag/__examples__/default.njk +5 -0
  149. package/nunjucks/moduk/components/tag/__examples__/green.njk +6 -0
  150. package/nunjucks/moduk/components/tag/__examples__/grey.njk +6 -0
  151. package/nunjucks/moduk/components/tag/__examples__/orange.njk +6 -0
  152. package/nunjucks/moduk/components/tag/__examples__/pink.njk +6 -0
  153. package/nunjucks/moduk/components/tag/__examples__/purple.njk +6 -0
  154. package/nunjucks/moduk/components/tag/__examples__/red.njk +6 -0
  155. package/nunjucks/moduk/components/tag/__examples__/turquoise.njk +6 -0
  156. package/nunjucks/moduk/components/tag/__examples__/yellow.njk +6 -0
  157. package/nunjucks/moduk/components/tag/macro.njk +5 -0
  158. package/nunjucks/moduk/components/textarea/__examples__/default.njk +14 -0
  159. package/nunjucks/moduk/components/textarea/__examples__/not-as-page-heading.njk +9 -0
  160. package/nunjucks/moduk/components/textarea/__examples__/with-custom-height.njk +15 -0
  161. package/nunjucks/moduk/components/textarea/__examples__/with-error.njk +17 -0
  162. package/nunjucks/moduk/components/textarea/macro.njk +5 -0
  163. package/nunjucks/moduk/components/warning-text/__examples__/default.njk +6 -0
  164. package/nunjucks/moduk/components/warning-text/macro.njk +5 -0
  165. package/package.json +44 -35
  166. package/react/MODUKBody/MODUKBody.d.ts +6 -0
  167. package/react/MODUKBody/MODUKBody.d.ts.map +1 -0
  168. package/react/accordion/Accordion.d.ts +22 -0
  169. package/react/accordion/Accordion.d.ts.map +1 -0
  170. package/react/accordion/AccordionContext.d.ts +7 -0
  171. package/react/accordion/AccordionContext.d.ts.map +1 -0
  172. package/react/accordion/AccordionHeadingTag.d.ts +2 -0
  173. package/react/accordion/AccordionHeadingTag.d.ts.map +1 -0
  174. package/react/accordion/AccordionItem.d.ts +12 -0
  175. package/react/accordion/AccordionItem.d.ts.map +1 -0
  176. package/react/accordion/AccordionItemIndexContext.d.ts +2 -0
  177. package/react/accordion/AccordionItemIndexContext.d.ts.map +1 -0
  178. package/react/accordion/index.d.ts +4 -0
  179. package/react/accordion/index.d.ts.map +1 -0
  180. package/react/back-link/BackLink.d.ts +13 -0
  181. package/react/back-link/BackLink.d.ts.map +1 -0
  182. package/react/esm/MODUKBody/MODUKBody.js +37 -0
  183. package/react/esm/accordion/Accordion.js +81 -0
  184. package/react/esm/accordion/AccordionContext.js +5 -0
  185. package/react/esm/accordion/AccordionHeadingTag.js +1 -0
  186. package/react/esm/accordion/AccordionItem.js +45 -0
  187. package/react/esm/accordion/AccordionItemIndexContext.js +2 -0
  188. package/react/esm/accordion/index.js +5 -0
  189. package/react/esm/back-link/BackLink.js +25 -0
  190. package/react/esm/header/Header.js +124 -0
  191. package/react/esm/header/HeaderNavigationItem.js +29 -0
  192. package/react/esm/header/HeaderNavigationLink.js +25 -0
  193. package/react/esm/header/index.js +3 -0
  194. package/react/esm/index.js +7 -0
  195. package/react/esm/internal/Link/Link.js +23 -0
  196. package/react/esm/internal/hooks/useMODUKComponent/index.js +1 -0
  197. package/react/esm/internal/hooks/useMODUKComponent/useMODUKComponent.js +39 -0
  198. package/react/esm/internal/hooks/usePrevious/index.js +1 -0
  199. package/react/esm/internal/hooks/usePrevious/usePrevious.js +8 -0
  200. package/react/esm/internal/test-utils/Root.js +33 -0
  201. package/react/esm/table/Table.js +13 -0
  202. package/react/esm/table/TableBody.js +24 -0
  203. package/react/esm/table/TableCaption.js +24 -0
  204. package/react/esm/table/TableCell.js +25 -0
  205. package/react/esm/table/TableColumnHeader.js +26 -0
  206. package/react/esm/table/TableHead.js +24 -0
  207. package/react/esm/table/TableRow.js +24 -0
  208. package/react/esm/table/TableRowHeader.js +25 -0
  209. package/react/esm/table/index.js +8 -0
  210. package/react/header/Header.d.ts +20 -0
  211. package/react/header/Header.d.ts.map +1 -0
  212. package/react/header/HeaderNavigationItem.d.ts +11 -0
  213. package/react/header/HeaderNavigationItem.d.ts.map +1 -0
  214. package/react/header/HeaderNavigationLink.d.ts +11 -0
  215. package/react/header/HeaderNavigationLink.d.ts.map +1 -0
  216. package/react/header/index.d.ts +4 -0
  217. package/react/header/index.d.ts.map +1 -0
  218. package/react/index.d.ts +6 -0
  219. package/react/index.d.ts.map +1 -0
  220. package/react/index.js +3 -0
  221. package/react/index.js.LICENSE.txt +28 -0
  222. package/react/index.js.map +1 -0
  223. package/react/internal/Link/Link.d.ts +14 -0
  224. package/react/internal/Link/Link.d.ts.map +1 -0
  225. package/react/internal/hooks/useMODUKComponent/index.d.ts +2 -0
  226. package/react/internal/hooks/useMODUKComponent/index.d.ts.map +1 -0
  227. package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts +10 -0
  228. package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts.map +1 -0
  229. package/react/internal/hooks/usePrevious/index.d.ts +2 -0
  230. package/react/internal/hooks/usePrevious/index.d.ts.map +1 -0
  231. package/react/internal/hooks/usePrevious/usePrevious.d.ts +2 -0
  232. package/react/internal/hooks/usePrevious/usePrevious.d.ts.map +1 -0
  233. package/react/internal/test-utils/Root.d.ts +8 -0
  234. package/react/internal/test-utils/Root.d.ts.map +1 -0
  235. package/react/table/Table.d.ts +41 -0
  236. package/react/table/Table.d.ts.map +1 -0
  237. package/react/table/TableBody.d.ts +9 -0
  238. package/react/table/TableBody.d.ts.map +1 -0
  239. package/react/table/TableCaption.d.ts +9 -0
  240. package/react/table/TableCaption.d.ts.map +1 -0
  241. package/react/table/TableCell.d.ts +11 -0
  242. package/react/table/TableCell.d.ts.map +1 -0
  243. package/react/table/TableColumnHeader.d.ts +11 -0
  244. package/react/table/TableColumnHeader.d.ts.map +1 -0
  245. package/react/table/TableHead.d.ts +9 -0
  246. package/react/table/TableHead.d.ts.map +1 -0
  247. package/react/table/TableRow.d.ts +9 -0
  248. package/react/table/TableRow.d.ts.map +1 -0
  249. package/react/table/TableRowHeader.d.ts +9 -0
  250. package/react/table/TableRowHeader.d.ts.map +1 -0
  251. package/react/table/index.d.ts +9 -0
  252. package/react/table/index.d.ts.map +1 -0
  253. package/src/react/header/__examples__/with-service-name-and-navigation.tsx +13 -5
  254. package/src/react/table/__examples__/default.tsx +38 -0
  255. package/src/react/table/__examples__/with-comparative-numbers.tsx +42 -0
  256. package/src/react/table/__examples__/with-customised-column-widths.tsx +42 -0
  257. package/src/react/table/__examples__/with-large-caption.tsx +38 -0
  258. package/dist/nunjucks/moduk/components/accordion/__tests__/macro.test.ts +0 -9
  259. package/dist/nunjucks/moduk/components/back-link/__tests__/macro.test.ts +0 -9
  260. package/dist/nunjucks/moduk/components/breadcrumbs/__tests__/macro.test.ts +0 -31
  261. package/dist/nunjucks/moduk/components/button/__tests__/macro.test.ts +0 -25
  262. package/dist/nunjucks/moduk/components/character-count/__tests__/macro.test.ts +0 -9
  263. package/dist/nunjucks/moduk/components/checkboxes/__tests__/macro.test.ts +0 -9
  264. package/dist/nunjucks/moduk/components/cookie-banner/__tests__/macro.test.ts +0 -10
  265. package/dist/nunjucks/moduk/components/date-input/__tests__/macro.test.ts +0 -9
  266. package/dist/nunjucks/moduk/components/details/__tests__/macro.test.ts +0 -35
  267. package/dist/nunjucks/moduk/components/error-message/__tests__/macro.test.ts +0 -9
  268. package/dist/nunjucks/moduk/components/error-summary/__tests__/macro.test.ts +0 -55
  269. package/dist/nunjucks/moduk/components/fieldset/__tests__/macro.test.ts +0 -41
  270. package/dist/nunjucks/moduk/components/file-upload/__tests__/macro.test.ts +0 -9
  271. package/dist/nunjucks/moduk/components/footer/__tests__/macro.test.ts +0 -15
  272. package/dist/nunjucks/moduk/components/header/__tests__/macro.test.ts +0 -25
  273. package/dist/nunjucks/moduk/components/input/__tests__/macro.test.ts +0 -22
  274. package/dist/nunjucks/moduk/components/inset-text/__tests__/macro.test.ts +0 -35
  275. package/dist/nunjucks/moduk/components/notification-banner/__tests__/macro.test.ts +0 -32
  276. package/dist/nunjucks/moduk/components/pagination/__tests__/macro.test.ts +0 -9
  277. package/dist/nunjucks/moduk/components/panel/__tests__/macro.test.ts +0 -35
  278. package/dist/nunjucks/moduk/components/phase-banner/__tests__/macro.test.ts +0 -24
  279. package/dist/nunjucks/moduk/components/radios/__tests__/macro.test.ts +0 -9
  280. package/dist/nunjucks/moduk/components/select/__tests__/macro.test.ts +0 -9
  281. package/dist/nunjucks/moduk/components/skip-link/__tests__/macro.test.ts +0 -9
  282. package/dist/nunjucks/moduk/components/summary-list/__tests__/macro.test.ts +0 -9
  283. package/dist/nunjucks/moduk/components/table/__tests__/macro.test.ts +0 -9
  284. package/dist/nunjucks/moduk/components/tabs/__tests__/macro.test.ts +0 -9
  285. package/dist/nunjucks/moduk/components/tag/__tests__/macro.test.ts +0 -32
  286. package/dist/nunjucks/moduk/components/textarea/__tests__/macro.test.ts +0 -9
  287. package/dist/nunjucks/moduk/components/warning-text/__tests__/macro.test.ts +0 -9
  288. package/src/css/__tests__/_colour-palette.test.scss +0 -42
  289. package/src/css/__tests__/index.test.ts +0 -17
@@ -0,0 +1,80 @@
1
+ {% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
2
+ {% from "moduk/components/input/macro.njk" import modukInput -%}
3
+
4
+ {% set emailHtml %}
5
+ {{- modukInput({
6
+ id: "contact-by-email",
7
+ name: "contact-by-email",
8
+ type: "email",
9
+ autocomplete: "email",
10
+ spellcheck: false,
11
+ classes: "govuk-!-width-one-third",
12
+ label: {
13
+ text: "Email address"
14
+ }
15
+ }) -}}
16
+ {% endset -%}
17
+
18
+ {% set phoneHtml %}
19
+ {{- modukInput({
20
+ id: "contact-by-phone",
21
+ name: "contact-by-phone",
22
+ type: "tel",
23
+ autocomplete: "tel",
24
+ classes: "govuk-!-width-one-third",
25
+ label: {
26
+ text: "Phone number"
27
+ }
28
+ }) -}}
29
+ {% endset -%}
30
+
31
+ {% set textHtml %}
32
+ {{- modukInput({
33
+ id: "contact-by-text",
34
+ name: "contact-by-text",
35
+ type: "tel",
36
+ autocomplete: "tel",
37
+ classes: "govuk-!-width-one-third",
38
+ label: {
39
+ text: "Mobile phone number"
40
+ }
41
+ }) -}}
42
+ {% endset -%}
43
+
44
+ {{ modukCheckboxes({
45
+ name: "contact-with-conditional-reveal",
46
+ fieldset: {
47
+ legend: {
48
+ text: "How would you like to be contacted?",
49
+ isPageHeading: true,
50
+ classes: "govuk-fieldset__legend--l"
51
+ }
52
+ },
53
+ hint: {
54
+ text: "Select all options that are relevant to you."
55
+ },
56
+ items: [
57
+ {
58
+ value: "email",
59
+ text: "Email",
60
+ checked: true,
61
+ conditional: {
62
+ html: emailHtml
63
+ }
64
+ },
65
+ {
66
+ value: "phone",
67
+ text: "Phone",
68
+ conditional: {
69
+ html: phoneHtml
70
+ }
71
+ },
72
+ {
73
+ value: "text message",
74
+ text: "Text message",
75
+ conditional: {
76
+ html: textHtml
77
+ }
78
+ }
79
+ ]
80
+ }) -}}
@@ -0,0 +1,40 @@
1
+ {% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
2
+
3
+ {{ modukCheckboxes({
4
+ name: "incident-with-error-message",
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
+ errorMessage: {
16
+ text: "Select who you reported the incident to"
17
+ },
18
+ items: [
19
+ {
20
+ value: "unit-medic",
21
+ text: "Unit medic"
22
+ },
23
+ {
24
+ value: "hospital",
25
+ text: "Hospital"
26
+ },
27
+ {
28
+ value: "chain-of-command",
29
+ text: "Chain of command"
30
+ },
31
+ {
32
+ value: "colleague",
33
+ text: "Colleague"
34
+ },
35
+ {
36
+ value: "other-person",
37
+ text: "Other person"
38
+ }
39
+ ]
40
+ }) -}}
@@ -0,0 +1,32 @@
1
+ {% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
2
+
3
+ {{ modukCheckboxes({
4
+ name: "nationality-with-item-hint",
5
+ fieldset: {
6
+ legend: {
7
+ text: "What is your nationality?",
8
+ isPageHeading: true,
9
+ classes: "govuk-fieldset__legend--l"
10
+ }
11
+ },
12
+ hint: {
13
+ text: "If you have dual nationality, select all options that are relevant to you."
14
+ },
15
+ items: [
16
+ {
17
+ value: "british",
18
+ text: "British",
19
+ hint: {
20
+ text: "including English, Scottish, Welsh and Northern Irish"
21
+ }
22
+ },
23
+ {
24
+ value: "irish",
25
+ text: "Irish"
26
+ },
27
+ {
28
+ value: "another-country",
29
+ text: "Citizen of another country"
30
+ }
31
+ ]
32
+ }) -}}
@@ -0,0 +1,45 @@
1
+ {% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
2
+
3
+ {{ modukCheckboxes({
4
+ name: "incident-with-none-option",
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
+ divider: "or"
38
+ },
39
+ {
40
+ value: "none",
41
+ text: "I did not report the incident",
42
+ behaviour: "exclusive"
43
+ }
44
+ ]
45
+ }) -}}
@@ -0,0 +1,5 @@
1
+ {% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
2
+
3
+ {% macro modukCheckboxes(params) -%}
4
+ {{ govukCheckboxes(params) }}
5
+ {%- endmacro %}
@@ -0,0 +1,47 @@
1
+ {%- from "moduk/components/cookie-banner/macro.njk" import modukCookieBanner -%}
2
+
3
+ {% set html %}
4
+ <p class="govuk-body">We use some essential cookies to make this service work.</p>
5
+ <p class="govuk-body">We’d also like to use analytics cookies so we can understand how you use the service and make improvements.</p>
6
+ {% endset -%}
7
+
8
+ {%- set acceptHtml %}
9
+ <p class="govuk-body">You’ve accepted analytics cookies. You can <a class="govuk-link" href="#">change your cookie settings</a> at any time.</p>
10
+ {% endset -%}
11
+
12
+ {{ modukCookieBanner({
13
+ ariaLabel: "Cookies on the Defence Service Manual",
14
+ messages: [
15
+ {
16
+ headingText: "Cookies on the Defence Service Manual",
17
+ html: html,
18
+ hidden: true,
19
+ actions: [
20
+ {
21
+ text: "Accept analytics cookies",
22
+ type: "button",
23
+ name: "cookies",
24
+ value: "accept"
25
+ },
26
+ {
27
+ text: "Reject analytics cookies",
28
+ type: "button",
29
+ name: "cookies",
30
+ value: "reject"
31
+ },
32
+ {
33
+ text: "View cookies",
34
+ href: "#"
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ html: acceptHtml,
40
+ actions: [
41
+ {
42
+ text: "Hide cookie message"
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }) -}}
@@ -0,0 +1,34 @@
1
+ {%- from "moduk/components/cookie-banner/macro.njk" import modukCookieBanner -%}
2
+
3
+ {% set html %}
4
+ <p class="govuk-body">We use some essential cookies to make this service work.</p>
5
+ <p class="govuk-body">We’d also like to use analytics cookies so we can understand how you use the service and make improvements.</p>
6
+ {% endset -%}
7
+
8
+ {{ modukCookieBanner({
9
+ ariaLabel: "Cookies on [name of service]",
10
+ messages: [
11
+ {
12
+ headingText: "Cookies on [name of service]",
13
+ html: html,
14
+ actions: [
15
+ {
16
+ text: "Accept analytics cookies",
17
+ type: "button",
18
+ name: "cookies",
19
+ value: "accept"
20
+ },
21
+ {
22
+ text: "Reject analytics cookies",
23
+ type: "button",
24
+ name: "cookies",
25
+ value: "reject"
26
+ },
27
+ {
28
+ text: "View cookies",
29
+ href: "#"
30
+ }
31
+ ]
32
+ }
33
+ ]
34
+ }) -}}
@@ -0,0 +1,47 @@
1
+ {%- from "moduk/components/cookie-banner/macro.njk" import modukCookieBanner -%}
2
+
3
+ {%- set html %}
4
+ <p class="govuk-body">We use some essential cookies to make this service work.</p>
5
+ <p class="govuk-body">We’d also like to use analytics cookies so we can understand how you use the service and make improvements.</p>
6
+ {% endset -%}
7
+
8
+ {% set rejectHtml %}
9
+ <p class="govuk-body">You’ve rejected analytics cookies. You can <a class="govuk-link" href="#">change your cookie settings</a> at any time.</p>
10
+ {% endset -%}
11
+
12
+ {{ modukCookieBanner({
13
+ ariaLabel: "Cookies on the Defence Service Manual",
14
+ messages: [
15
+ {
16
+ headingText: "Cookies on the Defence Service Manual",
17
+ html: html,
18
+ hidden: true,
19
+ actions: [
20
+ {
21
+ text: "Accept analytics cookies",
22
+ type: "button",
23
+ name: "cookies",
24
+ value: "accept"
25
+ },
26
+ {
27
+ text: "Reject analytics cookies",
28
+ type: "button",
29
+ name: "cookies",
30
+ value: "reject"
31
+ },
32
+ {
33
+ text: "View cookies",
34
+ href: "#"
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ html: rejectHtml,
40
+ actions: [
41
+ {
42
+ text: "Hide cookie message"
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }) -}}
@@ -0,0 +1,5 @@
1
+ {%- from "govuk/components/cookie-banner/macro.njk" import govukCookieBanner %}
2
+
3
+ {%- macro modukCookieBanner(params) -%}
4
+ {{ govukCookieBanner(params) }}
5
+ {%- endmacro %}
@@ -0,0 +1,16 @@
1
+ {% from "moduk/components/date-input/macro.njk" import modukDateInput -%}
2
+
3
+ {{ modukDateInput({
4
+ id: "contract-start-date-default",
5
+ namePrefix: "contract-start-date-default",
6
+ fieldset: {
7
+ legend: {
8
+ text: "When will the contract start?",
9
+ isPageHeading: true,
10
+ classes: "govuk-fieldset__legend--l"
11
+ }
12
+ },
13
+ hint: {
14
+ text: "For example, 27 3 2023"
15
+ }
16
+ }) -}}
@@ -0,0 +1,14 @@
1
+ {% from "moduk/components/date-input/macro.njk" import modukDateInput -%}
2
+
3
+ {{ modukDateInput({
4
+ id: "contract-start-date-not-as-heading",
5
+ namePrefix: "contract-start-date-not-as-heading",
6
+ fieldset: {
7
+ legend: {
8
+ text: "When will the contract start?"
9
+ }
10
+ },
11
+ hint: {
12
+ text: "For example, 27 3 2023"
13
+ }
14
+ }) -}}
@@ -0,0 +1,35 @@
1
+ {% from "moduk/components/date-input/macro.njk" import modukDateInput -%}
2
+
3
+ {{ modukDateInput({
4
+ id: "contract-start-date-with-part-error",
5
+ namePrefix: "contract-start-date-with-part-error",
6
+ fieldset: {
7
+ legend: {
8
+ text: "When will the contract start?",
9
+ isPageHeading: true,
10
+ classes: "govuk-fieldset__legend--l"
11
+ }
12
+ },
13
+ hint: {
14
+ text: "For example, 27 3 2023"
15
+ },
16
+ errorMessage: {
17
+ text: "The start date of the contract must include a year"
18
+ },
19
+ items: [
20
+ {
21
+ classes: "govuk-input--width-2",
22
+ name: "day",
23
+ value: "6"
24
+ },
25
+ {
26
+ classes: "govuk-input--width-2",
27
+ name: "month",
28
+ value: "3"
29
+ },
30
+ {
31
+ classes: "govuk-input--width-4 govuk-input--error",
32
+ name: "year"
33
+ }
34
+ ]
35
+ }) -}}
@@ -0,0 +1,36 @@
1
+ {% from "moduk/components/date-input/macro.njk" import modukDateInput -%}
2
+
3
+ {{ modukDateInput({
4
+ id: "contract-start-date-with-whole-error",
5
+ namePrefix: "contract-start-date-with-whole-error",
6
+ fieldset: {
7
+ legend: {
8
+ text: "When will the contract start?",
9
+ isPageHeading: true,
10
+ classes: "govuk-fieldset__legend--l"
11
+ }
12
+ },
13
+ hint: {
14
+ text: "For example, 27 3 2023"
15
+ },
16
+ errorMessage: {
17
+ text: "Contract start date must be in the future"
18
+ },
19
+ items: [
20
+ {
21
+ classes: "govuk-input--width-2 govuk-input--error",
22
+ name: "day",
23
+ value: "6"
24
+ },
25
+ {
26
+ classes: "govuk-input--width-2 govuk-input--error",
27
+ name: "month",
28
+ value: "3"
29
+ },
30
+ {
31
+ classes: "govuk-input--width-4 govuk-input--error",
32
+ name: "year",
33
+ value: "2001"
34
+ }
35
+ ]
36
+ }) -}}
@@ -0,0 +1,5 @@
1
+ {% from "govuk/components/date-input/macro.njk" import govukDateInput -%}
2
+
3
+ {% macro modukDateInput(params) -%}
4
+ {{ govukDateInput(params) }}
5
+ {%- endmacro %}
@@ -0,0 +1,6 @@
1
+ {% from "moduk/components/details/macro.njk" import modukDetails -%}
2
+
3
+ {{ modukDetails({
4
+ summaryText: "Help with organisation",
5
+ text: "We need to know the organisation you work for so we can forward your request to the correct team."
6
+ }) -}}
@@ -0,0 +1,7 @@
1
+ {% from "moduk/components/details/macro.njk" import modukDetails -%}
2
+
3
+ {{ modukDetails({
4
+ summaryText: "Help with organisation",
5
+ text: "We need to know the organisation you work for so we can forward your request to the correct team.",
6
+ open: true
7
+ }) -}}
@@ -0,0 +1,11 @@
1
+ {% from "govuk/components/details/macro.njk" import govukDetails %}
2
+
3
+ {% macro modukDetails(params) -%}
4
+ {% if caller -%}
5
+ {% call govukDetails(params) -%}
6
+ {{ caller() }}
7
+ {%- endcall %}
8
+ {%- else -%}
9
+ {{ govukDetails(params) }}
10
+ {%- endif %}
11
+ {%- endmacro %}
@@ -0,0 +1,5 @@
1
+ {% from "moduk/components/error-message/macro.njk" import modukErrorMessage -%}
2
+
3
+ {{ modukErrorMessage({
4
+ text: "Enter a first name"
5
+ }) -}}
@@ -0,0 +1,5 @@
1
+ {% from "govuk/components/error-message/macro.njk" import govukErrorMessage %}
2
+
3
+ {% macro modukErrorMessage(params) -%}
4
+ {{ govukErrorMessage(params) }}
5
+ {%- endmacro %}
@@ -0,0 +1,15 @@
1
+ {% from "moduk/components/error-summary/macro.njk" import modukErrorSummary -%}
2
+
3
+ {{ modukErrorSummary({
4
+ titleText: "There is a problem",
5
+ errorList: [
6
+ {
7
+ text: "The start date of the contract must include a year",
8
+ href: "#incorect-date-format"
9
+ },
10
+ {
11
+ text: "Enter your full name",
12
+ href: "#full-name-input"
13
+ }
14
+ ]
15
+ }) -}}
@@ -0,0 +1,16 @@
1
+ {% from "moduk/components/error-summary/macro.njk" import modukErrorSummary -%}
2
+
3
+ {{ modukErrorSummary({
4
+ titleText: "There is a problem",
5
+ descriptionText: "There have been some errors when trying to submit your application.",
6
+ errorList: [
7
+ {
8
+ text: "The start date of the contract must include a year",
9
+ href: "#incorect-date-format"
10
+ },
11
+ {
12
+ text: "Enter your full name",
13
+ href: "#full-name-input"
14
+ }
15
+ ]
16
+ }) -}}
@@ -0,0 +1,54 @@
1
+ {% from "moduk/components/error-summary/macro.njk" import modukErrorSummary -%}
2
+ {% from "moduk/components/checkboxes/macro.njk" import modukCheckboxes -%}
3
+
4
+ <div>
5
+ {{ modukErrorSummary({
6
+ titleText: "There is a problem",
7
+ errorList: [
8
+ {
9
+ text: "Select which technologies you use in your role",
10
+ href: "#technologies"
11
+ }
12
+ ]
13
+ }) -}}
14
+
15
+ {{ modukCheckboxes({
16
+ name: "technologies",
17
+ fieldset: {
18
+ legend: {
19
+ text: "Which technologies do you use in your role?",
20
+ isPageHeading: true,
21
+ classes: "govuk-fieldset__legend--l"
22
+ }
23
+ },
24
+ hint: {
25
+ text: "Select all that apply."
26
+ },
27
+ errorMessage: {
28
+ text: "Select which technologies you use in your role"
29
+ },
30
+ items: [
31
+ {
32
+ value: "angular",
33
+ text: "Angular"
34
+ },
35
+ {
36
+ value: "nunjucks",
37
+ text: "Nunjucks"
38
+ },
39
+ {
40
+ value: "react",
41
+ text: "React"
42
+ },
43
+ {
44
+ value: "web-components",
45
+ text: "Web components"
46
+ },
47
+ {
48
+ value: "another-technology",
49
+ text: "Another technology"
50
+ }
51
+ ]
52
+ }) -}}
53
+
54
+ </div>
@@ -0,0 +1,45 @@
1
+ {% from "moduk/components/error-summary/macro.njk" import modukErrorSummary -%}
2
+ {% from "moduk/components/date-input/macro.njk" import modukDateInput -%}
3
+
4
+ <div>
5
+ {{ modukErrorSummary({
6
+ titleText: "There is a problem",
7
+ errorList: [
8
+ {
9
+ text: "The start date of the contract must include a year",
10
+ href: "#incorect-date-format-year"
11
+ }
12
+ ]
13
+ }) -}}
14
+
15
+ {{ modukDateInput({
16
+ id: "incorect-date-format",
17
+ namePrefix: "incorect-date-format",
18
+ fieldset: {
19
+ legend: {
20
+ isPageHeading: true,
21
+ text: "When will the contract start?",
22
+ classes: 'govuk-fieldset__legend--l'
23
+ }
24
+ },
25
+ errorMessage: {
26
+ text: "The start date of the contract must include a year"
27
+ },
28
+ items: [
29
+ {
30
+ classes: "govuk-input--width-2",
31
+ name: "day",
32
+ value: "6"
33
+ },
34
+ {
35
+ classes: "govuk-input--width-2",
36
+ name: "month",
37
+ value: "3"
38
+ },
39
+ {
40
+ classes: "govuk-input--width-4 govuk-input--error",
41
+ name: "year"
42
+ }
43
+ ]
44
+ }) }}
45
+ </div>
@@ -0,0 +1,11 @@
1
+ {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
2
+
3
+ {% macro modukErrorSummary(params) -%}
4
+ {% if caller -%}
5
+ {% call govukErrorSummary(params) -%}
6
+ {{ caller() }}
7
+ {%- endcall %}
8
+ {%- else -%}
9
+ {{ govukErrorSummary(params) }}
10
+ {%- endif %}
11
+ {%- endmacro %}