@hmlr/govuk-react-components-library 1.2.3 → 1.3.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 +6 -8
  2. package/dist/PDFViewerCanvas.cjs.js +3 -2
  3. package/dist/PDFViewerCanvas.cjs.js.map +1 -1
  4. package/dist/PDFViewerCanvas.esm.js +3 -2
  5. package/dist/PDFViewerCanvas.esm.js.map +1 -1
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.d.ts +29 -60
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/PDFViewerCanvas.d.ts +1 -0
  10. package/dist/types/components/Accordion/Accordion.config.d.ts +5 -0
  11. package/dist/types/components/Accordion/Accordion.d.ts +4 -0
  12. package/dist/types/components/Accordion/Accordion.types.d.ts +20 -0
  13. package/dist/types/components/Accordion/index.d.ts +2 -0
  14. package/dist/types/components/ActionLink/ActionLink.d.ts +4 -0
  15. package/dist/types/components/ActionLink/ActionLink.types.d.ts +13 -0
  16. package/dist/types/components/ActionLink/index.d.ts +1 -0
  17. package/dist/types/components/BackLink/BackLink.d.ts +4 -0
  18. package/dist/types/components/BackLink/BackLink.types.d.ts +9 -0
  19. package/dist/types/components/BackLink/index.d.ts +1 -0
  20. package/dist/types/components/Boolean/Boolean.d.ts +4 -0
  21. package/dist/types/components/Boolean/Boolean.types.d.ts +37 -0
  22. package/dist/types/components/Boolean/OmitKey.d.ts +5 -0
  23. package/dist/types/components/Boolean/index.d.ts +1 -0
  24. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  25. package/dist/types/components/Breadcrumbs/Breadcrumbs.types.d.ts +13 -0
  26. package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
  27. package/dist/types/components/Button/Button.config.d.ts +2 -0
  28. package/dist/types/components/Button/Button.d.ts +4 -0
  29. package/dist/types/components/Button/Button.types.d.ts +13 -0
  30. package/dist/types/components/Button/index.d.ts +2 -0
  31. package/dist/types/components/CardColumn/CardColumn.d.ts +5 -0
  32. package/dist/types/components/CardColumn/CardColumn.types.d.ts +25 -0
  33. package/dist/types/components/CardColumn/index.d.ts +1 -0
  34. package/dist/types/components/CardLayout/CardLayout.d.ts +4 -0
  35. package/dist/types/components/CardLayout/CardLayout.types.d.ts +5 -0
  36. package/dist/types/components/CardLayout/index.d.ts +1 -0
  37. package/dist/types/components/CharacterCount/CharacterCount.config.d.ts +2 -0
  38. package/dist/types/components/CharacterCount/CharacterCount.d.ts +4 -0
  39. package/dist/types/components/CharacterCount/CharacterCount.types.d.ts +12 -0
  40. package/dist/types/components/CharacterCount/index.d.ts +1 -0
  41. package/dist/types/components/Checkboxes/Checkboxes.config.d.ts +1 -0
  42. package/dist/types/components/Checkboxes/Checkboxes.d.ts +4 -0
  43. package/dist/types/components/Checkboxes/Checkboxes.types.d.ts +3 -0
  44. package/dist/types/components/Checkboxes/index.d.ts +2 -0
  45. package/dist/types/components/CookieBanner/CookieBanner.d.ts +4 -0
  46. package/dist/types/components/CookieBanner/CookieBanner.types.d.ts +21 -0
  47. package/dist/types/components/CookieBanner/index.d.ts +1 -0
  48. package/dist/types/components/DataNavigation/DataNavigation.d.ts +4 -0
  49. package/dist/types/components/DataNavigation/DataNavigation.types.d.ts +34 -0
  50. package/dist/types/components/DataNavigation/index.d.ts +1 -0
  51. package/dist/types/components/DateInput/DateInput.d.ts +4 -0
  52. package/dist/types/components/DateInput/DateInput.types.d.ts +27 -0
  53. package/dist/types/components/DateInput/index.d.ts +1 -0
  54. package/dist/types/components/Details/Details.d.ts +4 -0
  55. package/dist/types/components/Details/Details.types.d.ts +5 -0
  56. package/dist/types/components/Details/index.d.ts +1 -0
  57. package/dist/types/components/DifferenceNavigation/DifferenceNavigation.d.ts +4 -0
  58. package/dist/types/components/DifferenceNavigation/DifferenceNavigation.types.d.ts +32 -0
  59. package/dist/types/components/DifferenceNavigation/index.d.ts +1 -0
  60. package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +9 -0
  61. package/dist/types/components/ErrorBoundary/ErrorBoundary.types.d.ts +11 -0
  62. package/dist/types/components/ErrorBoundary/index.d.ts +1 -0
  63. package/dist/types/components/ErrorMessage/ErrorMessage.d.ts +4 -0
  64. package/dist/types/components/ErrorMessage/ErrorMessage.types.d.ts +6 -0
  65. package/dist/types/components/ErrorMessage/index.d.ts +1 -0
  66. package/dist/types/components/ErrorSummary/ErrorSummary.config.d.ts +2 -0
  67. package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +4 -0
  68. package/dist/types/components/ErrorSummary/ErrorSummary.types.d.ts +13 -0
  69. package/dist/types/components/ErrorSummary/index.d.ts +2 -0
  70. package/dist/types/components/ExitThisPage/ExitThisPage.config.d.ts +1 -0
  71. package/dist/types/components/ExitThisPage/ExitThisPage.d.ts +4 -0
  72. package/dist/types/components/ExitThisPage/ExitThisPage.types.d.ts +17 -0
  73. package/dist/types/components/ExitThisPage/index.d.ts +2 -0
  74. package/dist/types/components/Fieldset/Fieldset.d.ts +4 -0
  75. package/dist/types/components/Fieldset/Fieldset.types.d.ts +12 -0
  76. package/dist/types/components/Fieldset/index.d.ts +1 -0
  77. package/dist/types/components/FileUpload/FileUpload.d.ts +4 -0
  78. package/dist/types/components/FileUpload/FileUpload.types.d.ts +13 -0
  79. package/dist/types/components/FileUpload/index.d.ts +1 -0
  80. package/dist/types/components/Footer/Footer.d.ts +4 -0
  81. package/dist/types/components/Footer/Footer.types.d.ts +40 -0
  82. package/dist/types/components/Footer/index.d.ts +1 -0
  83. package/dist/types/components/Header/Header.config.d.ts +1 -0
  84. package/dist/types/components/Header/Header.d.ts +4 -0
  85. package/dist/types/components/Header/Header.types.d.ts +28 -0
  86. package/dist/types/components/Header/index.d.ts +2 -0
  87. package/dist/types/components/Hint/Hint.d.ts +4 -0
  88. package/dist/types/components/Hint/Hint.types.d.ts +4 -0
  89. package/dist/types/components/Hint/index.d.ts +1 -0
  90. package/dist/types/components/Input/Input.d.ts +4 -0
  91. package/dist/types/components/Input/Input.types.d.ts +17 -0
  92. package/dist/types/components/Input/index.d.ts +1 -0
  93. package/dist/types/components/InsetText/InsetText.d.ts +4 -0
  94. package/dist/types/components/InsetText/InsetText.types.d.ts +4 -0
  95. package/dist/types/components/InsetText/index.d.ts +1 -0
  96. package/dist/types/components/Label/Label.d.ts +4 -0
  97. package/dist/types/components/Label/Label.types.d.ts +6 -0
  98. package/dist/types/components/Label/index.d.ts +1 -0
  99. package/dist/types/components/Landing/Landing.d.ts +4 -0
  100. package/dist/types/components/Landing/Landing.types.d.ts +4 -0
  101. package/dist/types/components/Landing/index.d.ts +1 -0
  102. package/dist/types/components/LinkWithRef/LinkWithRef.d.ts +4 -0
  103. package/dist/types/components/LinkWithRef/LinkWithRef.types.d.ts +9 -0
  104. package/dist/types/components/LinkWithRef/index.d.ts +1 -0
  105. package/dist/types/components/Loading/Loading.d.ts +5 -0
  106. package/dist/types/components/Loading/Loading.types.d.ts +4 -0
  107. package/dist/types/components/Loading/index.d.ts +1 -0
  108. package/dist/types/components/Main/Main.d.ts +4 -0
  109. package/dist/types/components/Main/Main.types.d.ts +5 -0
  110. package/dist/types/components/Main/index.d.ts +1 -0
  111. package/dist/types/components/NotFoundPage/NotFoundPage.d.ts +3 -0
  112. package/dist/types/components/NotFoundPage/index.d.ts +1 -0
  113. package/dist/types/components/NotificationBanner/NotificationBanner.config.d.ts +2 -0
  114. package/dist/types/components/NotificationBanner/NotificationBanner.d.ts +4 -0
  115. package/dist/types/components/NotificationBanner/NotificationBanner.types.d.ts +12 -0
  116. package/dist/types/components/NotificationBanner/index.d.ts +1 -0
  117. package/dist/types/components/PDFViewer/ObjectToQueryString.d.ts +1 -0
  118. package/dist/types/components/PDFViewer/PDFViewer.d.ts +4 -0
  119. package/dist/types/components/PDFViewer/PDFViewer.types.d.ts +25 -0
  120. package/dist/types/components/PDFViewer/PDFViewerBackend.d.ts +2 -0
  121. package/dist/types/components/PDFViewer/ResolvePDFSource.d.ts +27 -0
  122. package/dist/types/components/PDFViewer/Slugify.d.ts +1 -0
  123. package/dist/types/components/PDFViewer/index.d.ts +2 -0
  124. package/dist/types/components/PDFViewer/testutilities/SampleBase64.d.ts +44 -0
  125. package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.d.ts +9 -0
  126. package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.types.d.ts +38 -0
  127. package/dist/types/components/PDFViewerCanvas/index.d.ts +1 -0
  128. package/dist/types/components/Pagination/NavigationButton.d.ts +3 -0
  129. package/dist/types/components/Pagination/Pagination.d.ts +4 -0
  130. package/dist/types/components/Pagination/Pagination.types.d.ts +32 -0
  131. package/dist/types/components/Pagination/SvgIcon.d.ts +3 -0
  132. package/dist/types/components/Pagination/UsePagination.d.ts +9 -0
  133. package/dist/types/components/Pagination/index.d.ts +3 -0
  134. package/dist/types/components/Panel/Panel.d.ts +4 -0
  135. package/dist/types/components/Panel/Panel.types.d.ts +7 -0
  136. package/dist/types/components/Panel/index.d.ts +1 -0
  137. package/dist/types/components/PasswordInput/PasswordInput.config.d.ts +1 -0
  138. package/dist/types/components/PasswordInput/PasswordInput.d.ts +4 -0
  139. package/dist/types/components/PasswordInput/PasswordInput.types.d.ts +35 -0
  140. package/dist/types/components/PasswordInput/index.d.ts +2 -0
  141. package/dist/types/components/PhaseBanner/PhaseBanner.d.ts +4 -0
  142. package/dist/types/components/PhaseBanner/PhaseBanner.types.d.ts +6 -0
  143. package/dist/types/components/PhaseBanner/index.d.ts +1 -0
  144. package/dist/types/components/ProblemWithService/ProblemWithService.d.ts +4 -0
  145. package/dist/types/components/ProblemWithService/ProblemWithService.types.d.ts +7 -0
  146. package/dist/types/components/ProblemWithService/index.d.ts +1 -0
  147. package/dist/types/components/Radios/Radios.config.d.ts +1 -0
  148. package/dist/types/components/Radios/Radios.d.ts +4 -0
  149. package/dist/types/components/Radios/Radios.types.d.ts +7 -0
  150. package/dist/types/components/Radios/index.d.ts +2 -0
  151. package/dist/types/components/Select/Select.d.ts +4 -0
  152. package/dist/types/components/Select/Select.types.d.ts +19 -0
  153. package/dist/types/components/Select/index.d.ts +1 -0
  154. package/dist/types/components/ServiceNavigation/ServiceNavigation.d.ts +4 -0
  155. package/dist/types/components/ServiceNavigation/ServiceNavigation.types.d.ts +21 -0
  156. package/dist/types/components/ServiceNavigation/index.d.ts +1 -0
  157. package/dist/types/components/SkipLink/SkipLink.config.d.ts +1 -0
  158. package/dist/types/components/SkipLink/SkipLink.d.ts +4 -0
  159. package/dist/types/components/SkipLink/SkipLink.types.d.ts +5 -0
  160. package/dist/types/components/SkipLink/index.d.ts +2 -0
  161. package/dist/types/components/SummaryList/SummaryList.d.ts +4 -0
  162. package/dist/types/components/SummaryList/SummaryList.types.d.ts +22 -0
  163. package/dist/types/components/SummaryList/index.d.ts +1 -0
  164. package/dist/types/components/Table/Table.d.ts +4 -0
  165. package/dist/types/components/Table/Table.types.d.ts +21 -0
  166. package/dist/types/components/Table/index.d.ts +1 -0
  167. package/dist/types/components/Tabs/Tabs.config.d.ts +1 -0
  168. package/dist/types/components/Tabs/Tabs.d.ts +4 -0
  169. package/dist/types/components/Tabs/Tabs.types.d.ts +14 -0
  170. package/dist/types/components/Tabs/index.d.ts +2 -0
  171. package/dist/types/components/Tag/Tag.d.ts +4 -0
  172. package/dist/types/components/Tag/Tag.types.d.ts +4 -0
  173. package/dist/types/components/Tag/index.d.ts +1 -0
  174. package/dist/types/components/TaskList/TaskList.d.ts +4 -0
  175. package/dist/types/components/TaskList/TaskList.types.d.ts +21 -0
  176. package/dist/types/components/TaskList/index.d.ts +1 -0
  177. package/dist/types/components/Textarea/Textarea.d.ts +4 -0
  178. package/dist/types/components/Textarea/Textarea.types.d.ts +14 -0
  179. package/dist/types/components/Textarea/index.d.ts +1 -0
  180. package/dist/types/components/WarningInfo/WarningInfo.d.ts +4 -0
  181. package/dist/types/components/WarningInfo/WarningInfo.types.d.ts +8 -0
  182. package/dist/types/components/WarningInfo/index.d.ts +1 -0
  183. package/dist/types/components/WarningText/WarningText.d.ts +4 -0
  184. package/dist/types/components/WarningText/WarningText.types.d.ts +4 -0
  185. package/dist/types/components/WarningText/index.d.ts +1 -0
  186. package/dist/types/components/common.types.d.ts +10 -0
  187. package/dist/types/components/index.d.ts +51 -0
  188. package/dist/types/dynamics/index.d.ts +3 -0
  189. package/dist/types/dynamics/types.d.ts +37 -0
  190. package/dist/types/index.d.ts +1 -0
  191. package/dist/types/utils/ProcessExampleData.d.ts +3 -0
  192. package/dist/types/utils/StoriesFromFixtures.d.ts +5 -0
  193. package/dist/types/utils/TitleCase.d.ts +2 -0
  194. package/dist/types/utils/WithReference.d.ts +5 -0
  195. package/dist/types/utils/WithReference.types.d.ts +15 -0
  196. package/package.json +47 -27
  197. package/.gitattributes +0 -5
  198. package/.nvmrc +0 -1
  199. package/.prettierignore +0 -2
  200. package/.stylelintrc.json +0 -8
  201. package/assets/Advance-submodule-behaviours.png +0 -0
  202. package/assets/logo.png +0 -0
  203. package/assets/uml-diagram.svg +0 -2745
  204. package/scripts/generateStories.mjs +0 -451
@@ -0,0 +1,19 @@
1
+ import { ErrorMessageProps } from "../ErrorMessage/ErrorMessage.types";
2
+ import { HintProps } from "../Hint/Hint.types";
3
+ import { LabelProps } from "../Label/Label.types";
4
+ import { FormGroupProps } from "../common.types";
5
+ export interface Option {
6
+ reactListKey?: string | number;
7
+ children: React.ReactNode;
8
+ [key: string]: unknown;
9
+ }
10
+ export interface SelectProps {
11
+ className?: string;
12
+ "aria-describedby"?: string;
13
+ errorMessage?: ErrorMessageProps;
14
+ formGroup?: FormGroupProps;
15
+ hint?: HintProps;
16
+ id?: string;
17
+ items?: Option[];
18
+ label: LabelProps;
19
+ }
@@ -0,0 +1 @@
1
+ export { default as Select } from "./Select";
@@ -0,0 +1,4 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ import { ServiceNavigationProps } from "./ServiceNavigation.types";
3
+ declare const ServiceNavigation: React.FC<ServiceNavigationProps & HTMLAttributes<HTMLDivElement>>;
4
+ export default ServiceNavigation;
@@ -0,0 +1,21 @@
1
+ import { To } from "react-router";
2
+ export interface NavigationItem {
3
+ active?: boolean;
4
+ className?: string;
5
+ children?: React.ReactNode;
6
+ href?: string;
7
+ to?: To;
8
+ reactListKey?: string | number;
9
+ [key: string]: unknown;
10
+ }
11
+ export interface ServiceNavigationProps {
12
+ className?: string;
13
+ containerClassName?: string;
14
+ menuButtonLabel?: string;
15
+ navigation?: NavigationItem[];
16
+ navigationClassName?: string;
17
+ navigationLabel?: string;
18
+ serviceName?: string;
19
+ serviceUrlHref?: string;
20
+ serviceUrlTo?: To;
21
+ }
@@ -0,0 +1 @@
1
+ export { default as ServiceNavigation } from "./ServiceNavigation";
@@ -0,0 +1 @@
1
+ export declare function ConfigureOverallSkipLink($scope?: Document | Element): void;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SkipLinkProps } from "./SkipLink.types";
3
+ declare const SkipLink: React.FC<SkipLinkProps & React.HTMLAttributes<HTMLOrSVGElement>>;
4
+ export default SkipLink;
@@ -0,0 +1,5 @@
1
+ export interface SkipLinkProps {
2
+ href: string;
3
+ className: string;
4
+ children?: React.ReactNode;
5
+ }
@@ -0,0 +1,2 @@
1
+ export { default as SkipLink } from "./SkipLink";
2
+ export * from "./SkipLink.config";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SummaryListProps } from "./SummaryList.types";
3
+ declare const SummaryList: React.FC<SummaryListProps>;
4
+ export default SummaryList;
@@ -0,0 +1,22 @@
1
+ import { Action } from "../ActionLink/ActionLink.types";
2
+ export interface Row {
3
+ reactListKey?: string;
4
+ key?: {
5
+ className?: string;
6
+ children: React.ReactNode;
7
+ };
8
+ value?: {
9
+ className?: string;
10
+ children: React.ReactNode;
11
+ };
12
+ actions?: {
13
+ items: Action[];
14
+ className?: string;
15
+ };
16
+ className?: string;
17
+ }
18
+ export interface SummaryListProps {
19
+ className?: string;
20
+ rows?: Row[];
21
+ [key: string]: unknown;
22
+ }
@@ -0,0 +1 @@
1
+ export { default as SummaryList } from "./SummaryList";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TableProps } from "./Table.types";
3
+ declare const Table: React.FC<TableProps>;
4
+ export default Table;
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes } from "react";
2
+ export interface TableItem {
3
+ className?: string;
4
+ format?: string;
5
+ children: React.ReactNode;
6
+ reactListKey?: string | number;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface TableRow {
10
+ cells: TableItem[];
11
+ reactListKey?: string | number;
12
+ }
13
+ export interface TableProps extends HTMLAttributes<HTMLTableElement> {
14
+ caption?: string;
15
+ captionClassName?: string;
16
+ firstCellIsHeader?: boolean;
17
+ className?: string;
18
+ head?: TableItem[];
19
+ rows?: TableRow[];
20
+ footer?: TableItem[];
21
+ }
@@ -0,0 +1 @@
1
+ export { default as Table } from "./Table";
@@ -0,0 +1 @@
1
+ export declare function ConfigureOverallTabs($scope?: Document | Element): void;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TabsProps } from "./Tabs.types";
3
+ declare const Tabs: React.FC<TabsProps>;
4
+ export default Tabs;
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes } from "react";
2
+ export interface TabItem {
3
+ id?: string;
4
+ label: string;
5
+ panel: HTMLAttributes<HTMLDivElement>;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface TabsProps extends HTMLAttributes<HTMLDivElement> {
9
+ className?: string;
10
+ id: string;
11
+ idPrefix?: string;
12
+ items: TabItem[];
13
+ title?: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Tabs } from "./Tabs";
2
+ export * from "./Tabs.config";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TagProps } from "./Tag.types";
3
+ declare const Tag: React.FC<TagProps & React.HTMLAttributes<HTMLOrSVGElement>>;
4
+ export default Tag;
@@ -0,0 +1,4 @@
1
+ export interface TagProps {
2
+ className?: string;
3
+ children?: React.ReactNode;
4
+ }
@@ -0,0 +1 @@
1
+ export { default as Tag } from "./Tag";
@@ -0,0 +1,4 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ import { TaskListProps } from "./TaskList.types";
3
+ declare const TaskList: React.FC<TaskListProps & HTMLAttributes<HTMLUListElement>>;
4
+ export default TaskList;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { HintProps } from "../Hint/Hint.types";
3
+ export interface TaskListItemProps {
4
+ title: {
5
+ children: React.ReactNode;
6
+ };
7
+ hint: HintProps;
8
+ status: {
9
+ children?: React.ReactNode;
10
+ tag?: {
11
+ children: React.ReactNode;
12
+ };
13
+ };
14
+ href?: string;
15
+ [key: string]: unknown;
16
+ }
17
+ export interface TaskListProps {
18
+ className?: string;
19
+ idPrefix?: string;
20
+ items: TaskListItemProps[];
21
+ }
@@ -0,0 +1 @@
1
+ export { default as TaskList } from "./TaskList";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TextareaProps } from "./Textarea.types";
3
+ declare const Textarea: React.FC<TextareaProps>;
4
+ export default Textarea;
@@ -0,0 +1,14 @@
1
+ import { TextareaHTMLAttributes } from "react";
2
+ import { ErrorMessageProps } from "../ErrorMessage/ErrorMessage.types";
3
+ import { HintProps } from "../Hint/Hint.types";
4
+ import { LabelProps } from "../Label/Label.types";
5
+ import { FormGroupProps } from "../common.types";
6
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
7
+ className?: string;
8
+ "aria-describedby"?: string;
9
+ errorMessage?: ErrorMessageProps;
10
+ formGroup?: FormGroupProps;
11
+ hint?: HintProps;
12
+ label?: LabelProps;
13
+ id?: string;
14
+ }
@@ -0,0 +1 @@
1
+ export { default as Textarea } from "./Textarea";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { WarningInfoProps } from "./WarningInfo.types";
3
+ declare const WarningInfo: React.FC<WarningInfoProps>;
4
+ export default WarningInfo;
@@ -0,0 +1,8 @@
1
+ export interface WarningInfoProps {
2
+ messageHeading?: string;
3
+ message?: string;
4
+ advice?: string;
5
+ applicationName?: string;
6
+ applicationRoute?: string;
7
+ basePageName?: string;
8
+ }
@@ -0,0 +1 @@
1
+ export { default as WarningInfo } from "./WarningInfo";
@@ -0,0 +1,4 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ import { WarningTextProps } from "./WarningText.types";
3
+ declare const WarningText: React.FC<WarningTextProps & HTMLAttributes<HTMLDivElement>>;
4
+ export default WarningText;
@@ -0,0 +1,4 @@
1
+ export interface WarningTextProps {
2
+ children?: React.ReactNode;
3
+ className?: string;
4
+ }
@@ -0,0 +1 @@
1
+ export { default as WarningText } from "./WarningText";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The `formGroup` prop accepted by form-field components (Input, Textarea,
3
+ * Select, Boolean, DateInput, PasswordInput, FileUpload). Only `className`
4
+ * is ever read by any of them - it's applied to the wrapping
5
+ * `govuk-form-group` div, nothing else is spread from it - so unlike props
6
+ * that genuinely forward arbitrary HTML attributes, this has no catch-all.
7
+ */
8
+ export interface FormGroupProps {
9
+ className?: string;
10
+ }
@@ -0,0 +1,51 @@
1
+ export * from "./Accordion";
2
+ export * from "./ActionLink";
3
+ export * from "./BackLink";
4
+ export * from "./Boolean";
5
+ export * from "./Breadcrumbs";
6
+ export * from "./Button";
7
+ export * from "./CardColumn";
8
+ export * from "./CardLayout";
9
+ export * from "./CharacterCount";
10
+ export * from "./Checkboxes";
11
+ export * from "./CookieBanner";
12
+ export * from "./DataNavigation";
13
+ export * from "./DateInput";
14
+ export * from "./Details";
15
+ export * from "./DifferenceNavigation";
16
+ export * from "./ErrorBoundary";
17
+ export * from "./ErrorMessage";
18
+ export * from "./ErrorSummary";
19
+ export * from "./ExitThisPage";
20
+ export * from "./Fieldset";
21
+ export * from "./FileUpload";
22
+ export * from "./Footer";
23
+ export * from "./Header";
24
+ export * from "./Hint";
25
+ export * from "./Input";
26
+ export * from "./InsetText";
27
+ export * from "./Label";
28
+ export * from "./Landing";
29
+ export * from "./LinkWithRef";
30
+ export * from "./Loading";
31
+ export * from "./Main";
32
+ export * from "./NotFoundPage";
33
+ export * from "./NotificationBanner";
34
+ export * from "./Pagination";
35
+ export * from "./Panel";
36
+ export * from "./PasswordInput";
37
+ export * from "./PDFViewer";
38
+ export * from "./PhaseBanner";
39
+ export * from "./ProblemWithService";
40
+ export * from "./Radios";
41
+ export * from "./Select";
42
+ export * from "./ServiceNavigation";
43
+ export * from "./SkipLink";
44
+ export * from "./SummaryList";
45
+ export * from "./Table";
46
+ export * from "./Tabs";
47
+ export * from "./Tag";
48
+ export * from "./TaskList";
49
+ export * from "./Textarea";
50
+ export * from "./WarningInfo";
51
+ export * from "./WarningText";
@@ -0,0 +1,3 @@
1
+ import type { DynamicConfig } from "./types";
2
+ export declare const defineStories: (config: DynamicConfig) => DynamicConfig;
3
+ export * from "./types";
@@ -0,0 +1,37 @@
1
+ import { ArgTypes, Tag } from "storybook/internal/csf";
2
+ type AnyJson = boolean | number | string | null | Array<AnyJson> | JsonMap | React.ReactNode | undefined;
3
+ interface JsonMap {
4
+ [key: string]: AnyJson;
5
+ }
6
+ interface AnnotationsConfig {
7
+ parameters?: JsonMap;
8
+ args?: JsonMap;
9
+ argTypes?: ArgTypes;
10
+ tags?: Tag[];
11
+ }
12
+ export interface MetaConfig extends AnnotationsConfig {
13
+ title?: string;
14
+ }
15
+ export interface StoryConfig extends AnnotationsConfig {
16
+ name?: string;
17
+ }
18
+ export type StoryConfigs = Record<string, StoryConfig>;
19
+ export interface DynamicConfig {
20
+ baseCsf: string;
21
+ storiesCsf?: string;
22
+ stories?: () => Promise<StoryConfigs> | StoryConfigs;
23
+ }
24
+ export interface ComponentFixture {
25
+ name: string;
26
+ options?: object;
27
+ hidden?: boolean;
28
+ description?: string;
29
+ previewLayoutModifiers?: unknown[];
30
+ screenshot?: boolean;
31
+ html?: string;
32
+ }
33
+ export interface ComponentFixtureRoot {
34
+ component: string;
35
+ fixtures: ComponentFixture[];
36
+ }
37
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./components";
@@ -0,0 +1,3 @@
1
+ import { ComponentFixture, ComponentFixtureRoot } from "../dynamics";
2
+ export default function processExampleData(data: unknown, componentName: string): Array<ComponentFixture>;
3
+ export declare function extractShownFixtures(fixtures: ComponentFixtureRoot): Array<ComponentFixture>;
@@ -0,0 +1,5 @@
1
+ import type { ComponentFixtureRoot, StoryConfigs } from "../dynamics";
2
+ export declare function loadFixturesAsJson(fileLocation: string): Promise<any>;
3
+ export declare function storiesFromFixtures(fixtures: ComponentFixtureRoot): StoryConfigs;
4
+ export declare function storiesFromFixturesSCF(fixtures: ComponentFixtureRoot, hasConfig?: boolean): string;
5
+ export declare function createBaseCSF(fixtureName: string, hasConfig?: boolean): string;
@@ -0,0 +1,2 @@
1
+ export declare function titleCase(str: string): string;
2
+ export declare function titleCaseNoSpace(str: string): string;
@@ -0,0 +1,5 @@
1
+ import { FC } from "react";
2
+ import { WithRefProps } from "./WithReference.types";
3
+ declare const WithRef: FC<WithRefProps>;
4
+ declare const WithItemRefs: FC<WithRefProps>;
5
+ export { WithRef, WithItemRefs };
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ type RefAcceptingComponent = React.ComponentType<Record<string, unknown> & {
3
+ ref?: React.Ref<HTMLElement>;
4
+ }>;
5
+ export interface WithRefProps {
6
+ Component: RefAcceptingComponent;
7
+ items?: unknown[];
8
+ [key: string]: unknown;
9
+ }
10
+ export interface InfoSectionProps {
11
+ refName: string;
12
+ Component: RefAcceptingComponent;
13
+ restProps: Record<string, unknown>;
14
+ }
15
+ export {};
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@hmlr/govuk-react-components-library",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "description": "These are common component use for React applications based on GDS and govuk-frontend",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
+ "sideEffects": [
9
+ "**/*.scss",
10
+ "**/*.css"
11
+ ],
12
+ "files": [
13
+ "dist"
14
+ ],
8
15
  "exports": {
9
16
  ".": {
10
17
  "import": "./dist/index.esm.js",
@@ -39,7 +46,7 @@
39
46
  },
40
47
  "repository": {
41
48
  "type": "git",
42
- "url": "https://github.com/LandRegistry/govuk-react-components-library"
49
+ "url": "git+https://github.com/LandRegistry/govuk-react-components-library.git"
43
50
  },
44
51
  "bugs": {
45
52
  "url": "https://github.com/LandRegistry/govuk-react-components-library/issues"
@@ -61,10 +68,10 @@
61
68
  "@babel/preset-react": "^7.29.7",
62
69
  "@babel/preset-typescript": "^7.29.7",
63
70
  "@chromatic-com/storybook": "^5.3.1",
64
- "@commitlint/cli": "^21.2.2",
65
- "@commitlint/config-conventional": "^21.2.2",
71
+ "@commitlint/cli": "^21.2.3",
72
+ "@commitlint/config-conventional": "^21.2.3",
66
73
  "@eslint/js": "^9.39.5",
67
- "@jest/globals": "^30.5.1",
74
+ "@jest/globals": "^30.5.2",
68
75
  "@rollup/plugin-commonjs": "^29.0.3",
69
76
  "@rollup/plugin-json": "^6.1.0",
70
77
  "@rollup/plugin-node-resolve": "^16.0.3",
@@ -82,13 +89,13 @@
82
89
  "@testing-library/react": "^16.3.3",
83
90
  "@types/govuk-frontend": "^5.11.0",
84
91
  "@types/jest": "^30.0.0",
85
- "@types/react": "^19.2.18",
86
- "@types/react-dom": "^19.2.7",
92
+ "@types/react": "^19.3.0",
93
+ "@types/react-dom": "^19.3.0",
87
94
  "assert": "^2.1.0",
88
- "autoprefixer": "^10.5.5",
89
- "babel-jest": "^30.5.1",
95
+ "autoprefixer": "^10.6.1",
96
+ "babel-jest": "^30.5.2",
90
97
  "bootstrap": "^5.3.8",
91
- "chromatic": "^18.7.2",
98
+ "chromatic": "^18.9.5",
92
99
  "concurrently": "^10.0.5",
93
100
  "css-loader": "^7.1.5",
94
101
  "deep-iterator": "^1.1.0",
@@ -96,31 +103,31 @@
96
103
  "eslint-plugin-react": "^7.37.5",
97
104
  "eslint-plugin-storybook": "^10.6.0",
98
105
  "globals": "^17.12.0",
99
- "govuk-frontend": "^6.5.0",
106
+ "govuk-frontend": "^6.5.1",
100
107
  "html-react-parser": "^5.2.17",
101
108
  "http-server": "^14.1.1",
102
109
  "husky": "^9.1.7",
103
110
  "identity-obj-proxy": "^3.0.0",
104
- "jest": "^30.5.1",
105
- "jest-environment-jsdom": "^30.5.1",
106
- "magicast": "^0.5.4",
111
+ "jest": "^30.5.2",
112
+ "jest-environment-jsdom": "^30.5.2",
113
+ "magicast": "^0.5.5",
107
114
  "pdfjs-dist": "^6.3.289",
108
115
  "postcss": "^8.5.28",
109
- "prettier": "^3.9.6",
110
- "react": "^19.2.8",
116
+ "prettier": "^3.9.9",
117
+ "react": "^19.3.0",
111
118
  "react-bootstrap": "^2.10.10",
112
- "react-dom": "^19.2.8",
119
+ "react-dom": "^19.3.0",
113
120
  "react-element-to-jsx-string": "^17.0.1",
114
121
  "react-router": "^7.18.3",
115
- "react-router-dom": "^7.18.3",
122
+ "react-router-dom": "^7.18.4",
116
123
  "rimraf": "^6.1.3",
117
- "rollup": "^4.63.1",
124
+ "rollup": "^4.63.4",
118
125
  "rollup-plugin-analyzer": "^4.0.0",
119
126
  "rollup-plugin-dts": "^6.5.1",
120
127
  "rollup-plugin-peer-deps-external": "^2.2.4",
121
128
  "rollup-plugin-postcss": "^4.0.2",
122
129
  "rollup-plugin-visualizer": "^6.0.11",
123
- "sass": "^1.104.0",
130
+ "sass": "^1.104.1",
124
131
  "sass-loader": "^17.0.1",
125
132
  "standard-version": "^9.5.0",
126
133
  "storybook": "^10.6.0",
@@ -133,10 +140,10 @@
133
140
  "tslib": "^2.8.1",
134
141
  "tsuml2": "^0.17.1",
135
142
  "typescript": "^6.0.3",
136
- "typescript-eslint": "^8.70.0",
137
- "unplugin": "^3.3.0",
143
+ "typescript-eslint": "^8.70.1",
144
+ "unplugin": "^3.4.0",
138
145
  "wait-on": "^9.1.0",
139
- "webpack": "^5.110.3"
146
+ "webpack": "^5.111.1"
140
147
  },
141
148
  "peerDependencies": {
142
149
  "govuk-frontend": ">=5.14.0",
@@ -163,7 +170,15 @@
163
170
  },
164
171
  "transformIgnorePatterns": [
165
172
  "node_modules/(?!(html-react-parser|domhandler|domelementtype|dom-serializer|entities|html-dom-parser)/)"
166
- ]
173
+ ],
174
+ "coverageThreshold": {
175
+ "global": {
176
+ "statements": 85,
177
+ "branches": 85,
178
+ "functions": 95,
179
+ "lines": 85
180
+ }
181
+ }
167
182
  },
168
183
  "babel": {
169
184
  "presets": [
@@ -182,11 +197,16 @@
182
197
  },
183
198
  "allowScripts": {
184
199
  "@parcel/watcher@2.6.0": true,
185
- "@swc/core@1.16.1": true,
186
200
  "core-js@2.6.12": true,
187
201
  "fsevents@2.3.2": true,
188
202
  "fsevents@2.3.3": true,
189
- "esbuild@0.27.7": true,
190
- "unrs-resolver@1.12.2": true
203
+ "unrs-resolver@1.12.2": true,
204
+ "esbuild@0.28.2": true,
205
+ "@swc/core@1.16.2": true
206
+ },
207
+ "standard-version": {
208
+ "scripts": {
209
+ "postchangelog": "prettier --write CHANGELOG.md"
210
+ }
191
211
  }
192
212
  }
package/.gitattributes DELETED
@@ -1,5 +0,0 @@
1
- /.storybook/public/pdfjs-4.4.168-dist/** linguist-vendored
2
- .storybook/public/pdfjs-4.4.168-dist/** linguist-vendored
3
- bundle-analysis-main.html linguist-generated
4
- bundle-analysis-pdfvc.html linguist-generated
5
- .storybook/public/pdfjs-4.4.168-dist/web/** linguist-vendored
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- lts/jod
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- # Vendored pdfjs build, copied in as static Storybook demo assets - not our code to format.
2
- .storybook/public/pdfjs-*-dist/
package/.stylelintrc.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": [
3
- "stylelint-config-standard",
4
- "stylelint-config-standard-scss",
5
- "stylelint-config-recess-order"
6
- ],
7
- "plugins": ["stylelint-order"]
8
- }
package/assets/logo.png DELETED
Binary file