@hmlr/govuk-react-components-library 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +9 -3
  2. package/assets/uml-diagram.svg +620 -575
  3. package/bundle-analysis-main.html +1 -3
  4. package/bundle-analysis-pdfvc.html +1 -1
  5. package/dist/PDFViewerCanvas.cjs.js +2003 -16
  6. package/dist/PDFViewerCanvas.cjs.js.map +1 -1
  7. package/dist/PDFViewerCanvas.d.ts +30 -0
  8. package/dist/PDFViewerCanvas.esm.js +1974 -5
  9. package/dist/PDFViewerCanvas.esm.js.map +1 -1
  10. package/dist/index.cjs.css +18 -11
  11. package/dist/index.cjs.js +2120 -125
  12. package/dist/index.cjs.js.map +1 -1
  13. package/dist/index.d.ts +81 -4
  14. package/dist/index.esm.css +18 -11
  15. package/dist/index.esm.js +2103 -108
  16. package/dist/index.esm.js.map +1 -1
  17. package/package.json +27 -29
  18. package/scripts/generateStories.mjs +3 -3
  19. package/dist/types/PDFViewerCanvas.d.ts +0 -1
  20. package/dist/types/components/Accordion/Accordion.config.d.ts +0 -5
  21. package/dist/types/components/Accordion/Accordion.d.ts +0 -4
  22. package/dist/types/components/Accordion/Accordion.types.d.ts +0 -20
  23. package/dist/types/components/Accordion/index.d.ts +0 -2
  24. package/dist/types/components/ActionLink/ActionLink.d.ts +0 -4
  25. package/dist/types/components/ActionLink/ActionLink.types.d.ts +0 -13
  26. package/dist/types/components/ActionLink/index.d.ts +0 -1
  27. package/dist/types/components/BackLink/BackLink.d.ts +0 -4
  28. package/dist/types/components/BackLink/BackLink.types.d.ts +0 -9
  29. package/dist/types/components/BackLink/index.d.ts +0 -1
  30. package/dist/types/components/Boolean/Boolean.d.ts +0 -4
  31. package/dist/types/components/Boolean/Boolean.types.d.ts +0 -39
  32. package/dist/types/components/Boolean/OmitKey.d.ts +0 -5
  33. package/dist/types/components/Boolean/index.d.ts +0 -1
  34. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +0 -4
  35. package/dist/types/components/Breadcrumbs/Breadcrumbs.types.d.ts +0 -13
  36. package/dist/types/components/Breadcrumbs/index.d.ts +0 -1
  37. package/dist/types/components/Button/Button.config.d.ts +0 -2
  38. package/dist/types/components/Button/Button.d.ts +0 -4
  39. package/dist/types/components/Button/Button.types.d.ts +0 -13
  40. package/dist/types/components/Button/index.d.ts +0 -2
  41. package/dist/types/components/CardColumn/CardColumn.d.ts +0 -5
  42. package/dist/types/components/CardColumn/CardColumn.types.d.ts +0 -5
  43. package/dist/types/components/CardColumn/index.d.ts +0 -1
  44. package/dist/types/components/CardLayout/CardLayout.d.ts +0 -4
  45. package/dist/types/components/CardLayout/CardLayout.types.d.ts +0 -5
  46. package/dist/types/components/CardLayout/index.d.ts +0 -1
  47. package/dist/types/components/CharacterCount/CharacterCount.config.d.ts +0 -2
  48. package/dist/types/components/CharacterCount/CharacterCount.d.ts +0 -4
  49. package/dist/types/components/CharacterCount/CharacterCount.types.d.ts +0 -12
  50. package/dist/types/components/CharacterCount/index.d.ts +0 -1
  51. package/dist/types/components/Checkboxes/Checkboxes.config.d.ts +0 -1
  52. package/dist/types/components/Checkboxes/Checkboxes.d.ts +0 -4
  53. package/dist/types/components/Checkboxes/Checkboxes.types.d.ts +0 -3
  54. package/dist/types/components/Checkboxes/index.d.ts +0 -2
  55. package/dist/types/components/CookieBanner/CookieBanner.d.ts +0 -4
  56. package/dist/types/components/CookieBanner/CookieBanner.types.d.ts +0 -21
  57. package/dist/types/components/CookieBanner/index.d.ts +0 -1
  58. package/dist/types/components/DataNavigation/DataNavigation.d.ts +0 -4
  59. package/dist/types/components/DataNavigation/DataNavigation.types.d.ts +0 -9
  60. package/dist/types/components/DataNavigation/index.d.ts +0 -1
  61. package/dist/types/components/DateInput/DateInput.d.ts +0 -4
  62. package/dist/types/components/DateInput/DateInput.types.d.ts +0 -29
  63. package/dist/types/components/DateInput/index.d.ts +0 -1
  64. package/dist/types/components/Details/Details.d.ts +0 -4
  65. package/dist/types/components/Details/Details.types.d.ts +0 -5
  66. package/dist/types/components/Details/index.d.ts +0 -1
  67. package/dist/types/components/DifferenceNavigation/DifferenceNavigation.d.ts +0 -4
  68. package/dist/types/components/DifferenceNavigation/DifferenceNavigation.types.d.ts +0 -7
  69. package/dist/types/components/DifferenceNavigation/index.d.ts +0 -1
  70. package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +0 -9
  71. package/dist/types/components/ErrorBoundary/ErrorBoundary.types.d.ts +0 -11
  72. package/dist/types/components/ErrorBoundary/index.d.ts +0 -1
  73. package/dist/types/components/ErrorMessage/ErrorMessage.d.ts +0 -4
  74. package/dist/types/components/ErrorMessage/ErrorMessage.types.d.ts +0 -6
  75. package/dist/types/components/ErrorMessage/index.d.ts +0 -1
  76. package/dist/types/components/ErrorSummary/ErrorSummary.config.d.ts +0 -2
  77. package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +0 -4
  78. package/dist/types/components/ErrorSummary/ErrorSummary.types.d.ts +0 -13
  79. package/dist/types/components/ErrorSummary/index.d.ts +0 -2
  80. package/dist/types/components/ExitThisPage/ExitThisPage.config.d.ts +0 -1
  81. package/dist/types/components/ExitThisPage/ExitThisPage.d.ts +0 -4
  82. package/dist/types/components/ExitThisPage/ExitThisPage.types.d.ts +0 -17
  83. package/dist/types/components/ExitThisPage/index.d.ts +0 -2
  84. package/dist/types/components/Fieldset/Fieldset.d.ts +0 -4
  85. package/dist/types/components/Fieldset/Fieldset.types.d.ts +0 -12
  86. package/dist/types/components/Fieldset/index.d.ts +0 -1
  87. package/dist/types/components/FileUpload/FileUpload.d.ts +0 -4
  88. package/dist/types/components/FileUpload/FileUpload.types.d.ts +0 -15
  89. package/dist/types/components/FileUpload/index.d.ts +0 -1
  90. package/dist/types/components/Footer/Footer.d.ts +0 -4
  91. package/dist/types/components/Footer/Footer.types.d.ts +0 -33
  92. package/dist/types/components/Footer/index.d.ts +0 -1
  93. package/dist/types/components/Header/Header.config.d.ts +0 -1
  94. package/dist/types/components/Header/Header.d.ts +0 -4
  95. package/dist/types/components/Header/Header.types.d.ts +0 -28
  96. package/dist/types/components/Header/index.d.ts +0 -2
  97. package/dist/types/components/Hint/Hint.d.ts +0 -4
  98. package/dist/types/components/Hint/Hint.types.d.ts +0 -4
  99. package/dist/types/components/Hint/index.d.ts +0 -1
  100. package/dist/types/components/Input/Input.d.ts +0 -4
  101. package/dist/types/components/Input/Input.types.d.ts +0 -22
  102. package/dist/types/components/Input/index.d.ts +0 -1
  103. package/dist/types/components/InsetText/InsetText.d.ts +0 -4
  104. package/dist/types/components/InsetText/InsetText.types.d.ts +0 -4
  105. package/dist/types/components/InsetText/index.d.ts +0 -1
  106. package/dist/types/components/Label/Label.d.ts +0 -4
  107. package/dist/types/components/Label/Label.types.d.ts +0 -6
  108. package/dist/types/components/Label/index.d.ts +0 -1
  109. package/dist/types/components/Landing/Landing.d.ts +0 -4
  110. package/dist/types/components/Landing/Landing.types.d.ts +0 -4
  111. package/dist/types/components/Landing/index.d.ts +0 -1
  112. package/dist/types/components/LinkWithRef/LinkWithRef.d.ts +0 -4
  113. package/dist/types/components/LinkWithRef/LinkWithRef.types.d.ts +0 -9
  114. package/dist/types/components/LinkWithRef/index.d.ts +0 -1
  115. package/dist/types/components/Loading/Loading.d.ts +0 -5
  116. package/dist/types/components/Loading/Loading.types.d.ts +0 -4
  117. package/dist/types/components/Loading/index.d.ts +0 -1
  118. package/dist/types/components/Main/Main.d.ts +0 -4
  119. package/dist/types/components/Main/Main.types.d.ts +0 -5
  120. package/dist/types/components/Main/index.d.ts +0 -1
  121. package/dist/types/components/NotFoundPage/NotFoundPage.d.ts +0 -3
  122. package/dist/types/components/NotFoundPage/index.d.ts +0 -1
  123. package/dist/types/components/NotificationBanner/NotificationBanner.config.d.ts +0 -2
  124. package/dist/types/components/NotificationBanner/NotificationBanner.d.ts +0 -4
  125. package/dist/types/components/NotificationBanner/NotificationBanner.types.d.ts +0 -12
  126. package/dist/types/components/NotificationBanner/index.d.ts +0 -1
  127. package/dist/types/components/PDFViewer/ObjectToQueryString.d.ts +0 -1
  128. package/dist/types/components/PDFViewer/PDFViewer.d.ts +0 -4
  129. package/dist/types/components/PDFViewer/PDFViewer.types.d.ts +0 -25
  130. package/dist/types/components/PDFViewer/PDFViewerBackend.d.ts +0 -2
  131. package/dist/types/components/PDFViewer/ResolvePDFSource.d.ts +0 -27
  132. package/dist/types/components/PDFViewer/Slugify.d.ts +0 -1
  133. package/dist/types/components/PDFViewer/index.d.ts +0 -2
  134. package/dist/types/components/PDFViewer/testutilities/SampleBase64.d.ts +0 -44
  135. package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.d.ts +0 -9
  136. package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.types.d.ts +0 -8
  137. package/dist/types/components/PDFViewerCanvas/index.d.ts +0 -1
  138. package/dist/types/components/Pagination/NavigationButton.d.ts +0 -3
  139. package/dist/types/components/Pagination/Pagination.d.ts +0 -4
  140. package/dist/types/components/Pagination/Pagination.types.d.ts +0 -32
  141. package/dist/types/components/Pagination/SvgIcon.d.ts +0 -3
  142. package/dist/types/components/Pagination/UsePagination.d.ts +0 -9
  143. package/dist/types/components/Pagination/index.d.ts +0 -3
  144. package/dist/types/components/Panel/Panel.d.ts +0 -4
  145. package/dist/types/components/Panel/Panel.types.d.ts +0 -7
  146. package/dist/types/components/Panel/index.d.ts +0 -1
  147. package/dist/types/components/PasswordInput/PasswordInput.config.d.ts +0 -1
  148. package/dist/types/components/PasswordInput/PasswordInput.d.ts +0 -4
  149. package/dist/types/components/PasswordInput/PasswordInput.types.d.ts +0 -49
  150. package/dist/types/components/PasswordInput/index.d.ts +0 -2
  151. package/dist/types/components/PhaseBanner/PhaseBanner.d.ts +0 -4
  152. package/dist/types/components/PhaseBanner/PhaseBanner.types.d.ts +0 -6
  153. package/dist/types/components/PhaseBanner/index.d.ts +0 -1
  154. package/dist/types/components/ProblemWithService/ProblemWithService.d.ts +0 -4
  155. package/dist/types/components/ProblemWithService/ProblemWithService.types.d.ts +0 -7
  156. package/dist/types/components/ProblemWithService/index.d.ts +0 -1
  157. package/dist/types/components/Radios/Radios.config.d.ts +0 -1
  158. package/dist/types/components/Radios/Radios.d.ts +0 -4
  159. package/dist/types/components/Radios/Radios.types.d.ts +0 -7
  160. package/dist/types/components/Radios/index.d.ts +0 -2
  161. package/dist/types/components/Select/Select.d.ts +0 -4
  162. package/dist/types/components/Select/Select.types.d.ts +0 -21
  163. package/dist/types/components/Select/index.d.ts +0 -1
  164. package/dist/types/components/ServiceNavigation/ServiceNavigation.d.ts +0 -4
  165. package/dist/types/components/ServiceNavigation/ServiceNavigation.types.d.ts +0 -21
  166. package/dist/types/components/ServiceNavigation/index.d.ts +0 -1
  167. package/dist/types/components/SkipLink/SkipLink.config.d.ts +0 -1
  168. package/dist/types/components/SkipLink/SkipLink.d.ts +0 -4
  169. package/dist/types/components/SkipLink/SkipLink.types.d.ts +0 -5
  170. package/dist/types/components/SkipLink/index.d.ts +0 -2
  171. package/dist/types/components/SummaryList/SummaryList.d.ts +0 -4
  172. package/dist/types/components/SummaryList/SummaryList.types.d.ts +0 -22
  173. package/dist/types/components/SummaryList/index.d.ts +0 -1
  174. package/dist/types/components/Table/Table.d.ts +0 -4
  175. package/dist/types/components/Table/Table.types.d.ts +0 -21
  176. package/dist/types/components/Table/index.d.ts +0 -1
  177. package/dist/types/components/Tabs/Tabs.config.d.ts +0 -1
  178. package/dist/types/components/Tabs/Tabs.d.ts +0 -4
  179. package/dist/types/components/Tabs/Tabs.types.d.ts +0 -14
  180. package/dist/types/components/Tabs/index.d.ts +0 -2
  181. package/dist/types/components/Tag/Tag.d.ts +0 -4
  182. package/dist/types/components/Tag/Tag.types.d.ts +0 -4
  183. package/dist/types/components/Tag/index.d.ts +0 -1
  184. package/dist/types/components/TaskList/TaskList.d.ts +0 -4
  185. package/dist/types/components/TaskList/TaskList.types.d.ts +0 -21
  186. package/dist/types/components/TaskList/index.d.ts +0 -1
  187. package/dist/types/components/Textarea/Textarea.d.ts +0 -4
  188. package/dist/types/components/Textarea/Textarea.types.d.ts +0 -14
  189. package/dist/types/components/Textarea/index.d.ts +0 -1
  190. package/dist/types/components/WarningInfo/WarningInfo.d.ts +0 -4
  191. package/dist/types/components/WarningInfo/WarningInfo.types.d.ts +0 -8
  192. package/dist/types/components/WarningInfo/index.d.ts +0 -1
  193. package/dist/types/components/WarningText/WarningText.d.ts +0 -4
  194. package/dist/types/components/WarningText/WarningText.types.d.ts +0 -4
  195. package/dist/types/components/WarningText/index.d.ts +0 -1
  196. package/dist/types/components/index.d.ts +0 -51
  197. package/dist/types/dynamics/index.d.ts +0 -3
  198. package/dist/types/dynamics/types.d.ts +0 -37
  199. package/dist/types/index.d.ts +0 -1
  200. package/dist/types/utils/ProcessExampleData.d.ts +0 -3
  201. package/dist/types/utils/StoriesFromFixtures.d.ts +0 -5
  202. package/dist/types/utils/TitleCase.d.ts +0 -2
  203. package/dist/types/utils/WithReference.d.ts +0 -5
  204. package/dist/types/utils/WithReference.types.d.ts +0 -15
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { HTMLAttributes, ElementType, ButtonHTMLAttributes, AnchorHTMLAttributes, TextareaHTMLAttributes, Component, ReactNode, SelectHTMLAttributes } from 'react';
2
2
  import { AccordionConfig } from 'govuk-frontend/dist/govuk/components/accordion/accordion';
3
- import { To } from 'react-router-dom';
3
+ import { To } from 'react-router';
4
4
  import { ButtonConfig } from 'govuk-frontend/dist/govuk/components/button/button';
5
5
  import { ErrorSummaryConfig } from 'govuk-frontend/dist/govuk/components/error-summary/error-summary';
6
6
 
@@ -162,6 +162,26 @@ interface CardColumnProps {
162
162
  link: string;
163
163
  header: string;
164
164
  body: string;
165
+ /**
166
+ * Text colour of the card header in its resting state.
167
+ *
168
+ * Defaults to the GOV.UK brand colour via the CSS custom property set by
169
+ * govuk-functional-colour("brand") in the SCSS — so if you've overridden
170
+ * $govuk-functional-colours at the Sass level, this default will follow.
171
+ *
172
+ * Pass an explicit value only when you need a per-instance override that
173
+ * sits outside the govuk-frontend theming system.
174
+ */
175
+ textColor?: string;
176
+ /**
177
+ * Background colour applied to the card header on hover.
178
+ *
179
+ * Defaults to the GOV.UK header background colour via the CSS custom
180
+ * property set by govuk-functional-colour("header-background") in the SCSS.
181
+ *
182
+ * Pass an explicit value only when you need a per-instance override.
183
+ */
184
+ hoverColor?: string;
165
185
  }
166
186
 
167
187
  declare const CardColumn: React$1.FC<CardColumnProps>;
@@ -221,11 +241,36 @@ declare const CookieBanner: React$1.FC<CookieBannerProps & HTMLAttributes<HTMLDi
221
241
  interface DataNavigationProps {
222
242
  dataId: number;
223
243
  setDataFocus: (id: number) => void;
224
- previousText: string;
244
+ previousText?: string;
225
245
  previousCondition: boolean;
226
- nextText: string;
246
+ nextText?: string;
227
247
  nextCondition: boolean;
228
248
  dataDescription?: string;
249
+ /**
250
+ * Background colour of the navigation buttons in their resting state.
251
+ * Defaults to govuk-functional-colour("brand") (#1d70b8).
252
+ */
253
+ buttonColour?: string;
254
+ /**
255
+ * Text colour of the navigation buttons in their resting state.
256
+ * Defaults to govuk-colour("white") (#ffffff).
257
+ */
258
+ buttonTextColour?: string;
259
+ /**
260
+ * Shadow colour of the navigation buttons.
261
+ * Defaults to govuk-colour("black") (#0b0c0c).
262
+ */
263
+ buttonShadowColour?: string;
264
+ /**
265
+ * Background colour of the navigation buttons on hover.
266
+ * Defaults to govuk-functional-colour("focus") (#ffdd00).
267
+ */
268
+ buttonHoverColour?: string;
269
+ /**
270
+ * Text colour of the navigation buttons on hover.
271
+ * Defaults to govuk-functional-colour("focus-text") (#0b0c0c).
272
+ */
273
+ buttonHoverTextColour?: string;
229
274
  }
230
275
 
231
276
  declare const DataNavigation: React$1.FC<DataNavigationProps>;
@@ -273,6 +318,31 @@ interface DifferenceNavigationProps {
273
318
  totalDifferences: number;
274
319
  keyword?: string;
275
320
  plural?: string;
321
+ /**
322
+ * Background colour of the navigation buttons in their resting state.
323
+ * Defaults to govuk-functional-colour("brand") (#1d70b8).
324
+ */
325
+ buttonColour?: string;
326
+ /**
327
+ * Text colour of the navigation buttons in their resting state.
328
+ * Defaults to govuk-colour("white") (#ffffff).
329
+ */
330
+ buttonTextColour?: string;
331
+ /**
332
+ * Shadow colour of the navigation buttons.
333
+ * Defaults to govuk-colour("black") (#0b0c0c).
334
+ */
335
+ buttonShadowColour?: string;
336
+ /**
337
+ * Background colour of the navigation buttons on hover.
338
+ * Defaults to govuk-functional-colour("focus") (#ffdd00).
339
+ */
340
+ buttonHoverColour?: string;
341
+ /**
342
+ * Text colour of the navigation buttons on hover.
343
+ * Defaults to govuk-functional-colour("focus-text") (#0b0c0c).
344
+ */
345
+ buttonHoverTextColour?: string;
276
346
  }
277
347
 
278
348
  declare const DifferenceNavigation: React$1.FC<DifferenceNavigationProps>;
@@ -378,11 +448,18 @@ interface Meta {
378
448
  items?: MetaItem[];
379
449
  children?: React.ReactNode;
380
450
  }
451
+ interface ContentLicence {
452
+ className?: string;
453
+ children: React.ReactNode;
454
+ reactListKey?: string | number;
455
+ [key: string]: unknown;
456
+ }
381
457
  interface FooterProps extends HTMLAttributes<HTMLElement> {
382
458
  className?: string;
383
459
  containerClassName?: string;
384
460
  meta?: Meta;
385
461
  navigation?: NavigationItem$2[];
462
+ contentLicence?: ContentLicence;
386
463
  }
387
464
 
388
465
  declare const Footer: React$1.FC<FooterProps>;
@@ -416,7 +493,7 @@ interface HeaderProps extends HTMLAttributes<HTMLDivElement> {
416
493
 
417
494
  declare const Header: React$1.FC<HeaderProps>;
418
495
 
419
- declare function ConfigureOverallHeader($scope?: Document | Element): void;
496
+ declare function ConfigureOverallHeader($scope?: Document | Element): Promise<void>;
420
497
 
421
498
  declare const Hint: React$1.FC<HintProps & React$1.HTMLAttributes<HTMLOrSVGElement>>;
422
499
 
@@ -1,4 +1,11 @@
1
1
  @charset "UTF-8";
2
+
3
+
4
+
5
+
6
+
7
+
8
+
2
9
  /*!
3
10
  * Bootstrap v5.3.8 (https://getbootstrap.com/)
4
11
  * Copyright 2011-2025 The Bootstrap Authors
@@ -11860,26 +11867,26 @@ textarea.form-control-lg {
11860
11867
  }
11861
11868
  }
11862
11869
  .card-link {
11863
- color: #1d70b8;
11870
+ color: var(--card-text-color, var(--govuk-link-colour, #1a65a6));
11864
11871
  }
11865
-
11866
- .card-link :hover {
11867
- color: #003078;
11868
- border-color: #fd0;
11872
+ .card-link:hover {
11873
+ color: var(--card-hover-color, var(--govuk-link-hover-colour, #0f385c));
11874
+ border-color: var(--govuk-focus-colour, #ffdd00);
11869
11875
  }
11870
11876
 
11871
11877
  .card-header {
11872
11878
  padding-bottom: 65px;
11873
- color: #005ea5;
11879
+ color: var(--card-text-color, var(--govuk-brand-colour, #1d70b8));
11880
+ transition-duration: 0.3s;
11874
11881
  }
11875
11882
  .card-header:hover {
11876
- color: #f8f8f8;
11877
- background-color: #005ea5;
11878
- transition-duration: 0.3s;
11883
+ color: #ffffff;
11884
+ background-color: var(--card-hover-color, #0b0c0c);
11879
11885
  }
11880
11886
  .card-header:active {
11881
- background-color: gold;
11882
- border-bottom: #000 groove;
11887
+ color: var(--govuk-focus-text-colour, #0b0c0c);
11888
+ background-color: var(--govuk-focus-colour, #ffdd00);
11889
+ border-bottom: var(--govuk-focus-text-colour, #0b0c0c) groove;
11883
11890
  transition: ease-in-out;
11884
11891
  }
11885
11892