@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.
- package/README.md +6 -8
- package/dist/PDFViewerCanvas.cjs.js +3 -2
- package/dist/PDFViewerCanvas.cjs.js.map +1 -1
- package/dist/PDFViewerCanvas.esm.js +3 -2
- package/dist/PDFViewerCanvas.esm.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +29 -60
- package/dist/index.esm.js.map +1 -1
- package/dist/types/PDFViewerCanvas.d.ts +1 -0
- package/dist/types/components/Accordion/Accordion.config.d.ts +5 -0
- package/dist/types/components/Accordion/Accordion.d.ts +4 -0
- package/dist/types/components/Accordion/Accordion.types.d.ts +20 -0
- package/dist/types/components/Accordion/index.d.ts +2 -0
- package/dist/types/components/ActionLink/ActionLink.d.ts +4 -0
- package/dist/types/components/ActionLink/ActionLink.types.d.ts +13 -0
- package/dist/types/components/ActionLink/index.d.ts +1 -0
- package/dist/types/components/BackLink/BackLink.d.ts +4 -0
- package/dist/types/components/BackLink/BackLink.types.d.ts +9 -0
- package/dist/types/components/BackLink/index.d.ts +1 -0
- package/dist/types/components/Boolean/Boolean.d.ts +4 -0
- package/dist/types/components/Boolean/Boolean.types.d.ts +37 -0
- package/dist/types/components/Boolean/OmitKey.d.ts +5 -0
- package/dist/types/components/Boolean/index.d.ts +1 -0
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/types/components/Breadcrumbs/Breadcrumbs.types.d.ts +13 -0
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/types/components/Button/Button.config.d.ts +2 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Button/Button.types.d.ts +13 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/CardColumn/CardColumn.d.ts +5 -0
- package/dist/types/components/CardColumn/CardColumn.types.d.ts +25 -0
- package/dist/types/components/CardColumn/index.d.ts +1 -0
- package/dist/types/components/CardLayout/CardLayout.d.ts +4 -0
- package/dist/types/components/CardLayout/CardLayout.types.d.ts +5 -0
- package/dist/types/components/CardLayout/index.d.ts +1 -0
- package/dist/types/components/CharacterCount/CharacterCount.config.d.ts +2 -0
- package/dist/types/components/CharacterCount/CharacterCount.d.ts +4 -0
- package/dist/types/components/CharacterCount/CharacterCount.types.d.ts +12 -0
- package/dist/types/components/CharacterCount/index.d.ts +1 -0
- package/dist/types/components/Checkboxes/Checkboxes.config.d.ts +1 -0
- package/dist/types/components/Checkboxes/Checkboxes.d.ts +4 -0
- package/dist/types/components/Checkboxes/Checkboxes.types.d.ts +3 -0
- package/dist/types/components/Checkboxes/index.d.ts +2 -0
- package/dist/types/components/CookieBanner/CookieBanner.d.ts +4 -0
- package/dist/types/components/CookieBanner/CookieBanner.types.d.ts +21 -0
- package/dist/types/components/CookieBanner/index.d.ts +1 -0
- package/dist/types/components/DataNavigation/DataNavigation.d.ts +4 -0
- package/dist/types/components/DataNavigation/DataNavigation.types.d.ts +34 -0
- package/dist/types/components/DataNavigation/index.d.ts +1 -0
- package/dist/types/components/DateInput/DateInput.d.ts +4 -0
- package/dist/types/components/DateInput/DateInput.types.d.ts +27 -0
- package/dist/types/components/DateInput/index.d.ts +1 -0
- package/dist/types/components/Details/Details.d.ts +4 -0
- package/dist/types/components/Details/Details.types.d.ts +5 -0
- package/dist/types/components/Details/index.d.ts +1 -0
- package/dist/types/components/DifferenceNavigation/DifferenceNavigation.d.ts +4 -0
- package/dist/types/components/DifferenceNavigation/DifferenceNavigation.types.d.ts +32 -0
- package/dist/types/components/DifferenceNavigation/index.d.ts +1 -0
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +9 -0
- package/dist/types/components/ErrorBoundary/ErrorBoundary.types.d.ts +11 -0
- package/dist/types/components/ErrorBoundary/index.d.ts +1 -0
- package/dist/types/components/ErrorMessage/ErrorMessage.d.ts +4 -0
- package/dist/types/components/ErrorMessage/ErrorMessage.types.d.ts +6 -0
- package/dist/types/components/ErrorMessage/index.d.ts +1 -0
- package/dist/types/components/ErrorSummary/ErrorSummary.config.d.ts +2 -0
- package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +4 -0
- package/dist/types/components/ErrorSummary/ErrorSummary.types.d.ts +13 -0
- package/dist/types/components/ErrorSummary/index.d.ts +2 -0
- package/dist/types/components/ExitThisPage/ExitThisPage.config.d.ts +1 -0
- package/dist/types/components/ExitThisPage/ExitThisPage.d.ts +4 -0
- package/dist/types/components/ExitThisPage/ExitThisPage.types.d.ts +17 -0
- package/dist/types/components/ExitThisPage/index.d.ts +2 -0
- package/dist/types/components/Fieldset/Fieldset.d.ts +4 -0
- package/dist/types/components/Fieldset/Fieldset.types.d.ts +12 -0
- package/dist/types/components/Fieldset/index.d.ts +1 -0
- package/dist/types/components/FileUpload/FileUpload.d.ts +4 -0
- package/dist/types/components/FileUpload/FileUpload.types.d.ts +13 -0
- package/dist/types/components/FileUpload/index.d.ts +1 -0
- package/dist/types/components/Footer/Footer.d.ts +4 -0
- package/dist/types/components/Footer/Footer.types.d.ts +40 -0
- package/dist/types/components/Footer/index.d.ts +1 -0
- package/dist/types/components/Header/Header.config.d.ts +1 -0
- package/dist/types/components/Header/Header.d.ts +4 -0
- package/dist/types/components/Header/Header.types.d.ts +28 -0
- package/dist/types/components/Header/index.d.ts +2 -0
- package/dist/types/components/Hint/Hint.d.ts +4 -0
- package/dist/types/components/Hint/Hint.types.d.ts +4 -0
- package/dist/types/components/Hint/index.d.ts +1 -0
- package/dist/types/components/Input/Input.d.ts +4 -0
- package/dist/types/components/Input/Input.types.d.ts +17 -0
- package/dist/types/components/Input/index.d.ts +1 -0
- package/dist/types/components/InsetText/InsetText.d.ts +4 -0
- package/dist/types/components/InsetText/InsetText.types.d.ts +4 -0
- package/dist/types/components/InsetText/index.d.ts +1 -0
- package/dist/types/components/Label/Label.d.ts +4 -0
- package/dist/types/components/Label/Label.types.d.ts +6 -0
- package/dist/types/components/Label/index.d.ts +1 -0
- package/dist/types/components/Landing/Landing.d.ts +4 -0
- package/dist/types/components/Landing/Landing.types.d.ts +4 -0
- package/dist/types/components/Landing/index.d.ts +1 -0
- package/dist/types/components/LinkWithRef/LinkWithRef.d.ts +4 -0
- package/dist/types/components/LinkWithRef/LinkWithRef.types.d.ts +9 -0
- package/dist/types/components/LinkWithRef/index.d.ts +1 -0
- package/dist/types/components/Loading/Loading.d.ts +5 -0
- package/dist/types/components/Loading/Loading.types.d.ts +4 -0
- package/dist/types/components/Loading/index.d.ts +1 -0
- package/dist/types/components/Main/Main.d.ts +4 -0
- package/dist/types/components/Main/Main.types.d.ts +5 -0
- package/dist/types/components/Main/index.d.ts +1 -0
- package/dist/types/components/NotFoundPage/NotFoundPage.d.ts +3 -0
- package/dist/types/components/NotFoundPage/index.d.ts +1 -0
- package/dist/types/components/NotificationBanner/NotificationBanner.config.d.ts +2 -0
- package/dist/types/components/NotificationBanner/NotificationBanner.d.ts +4 -0
- package/dist/types/components/NotificationBanner/NotificationBanner.types.d.ts +12 -0
- package/dist/types/components/NotificationBanner/index.d.ts +1 -0
- package/dist/types/components/PDFViewer/ObjectToQueryString.d.ts +1 -0
- package/dist/types/components/PDFViewer/PDFViewer.d.ts +4 -0
- package/dist/types/components/PDFViewer/PDFViewer.types.d.ts +25 -0
- package/dist/types/components/PDFViewer/PDFViewerBackend.d.ts +2 -0
- package/dist/types/components/PDFViewer/ResolvePDFSource.d.ts +27 -0
- package/dist/types/components/PDFViewer/Slugify.d.ts +1 -0
- package/dist/types/components/PDFViewer/index.d.ts +2 -0
- package/dist/types/components/PDFViewer/testutilities/SampleBase64.d.ts +44 -0
- package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.d.ts +9 -0
- package/dist/types/components/PDFViewerCanvas/PDFViewerCanvas.types.d.ts +38 -0
- package/dist/types/components/PDFViewerCanvas/index.d.ts +1 -0
- package/dist/types/components/Pagination/NavigationButton.d.ts +3 -0
- package/dist/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/types/components/Pagination/Pagination.types.d.ts +32 -0
- package/dist/types/components/Pagination/SvgIcon.d.ts +3 -0
- package/dist/types/components/Pagination/UsePagination.d.ts +9 -0
- package/dist/types/components/Pagination/index.d.ts +3 -0
- package/dist/types/components/Panel/Panel.d.ts +4 -0
- package/dist/types/components/Panel/Panel.types.d.ts +7 -0
- package/dist/types/components/Panel/index.d.ts +1 -0
- package/dist/types/components/PasswordInput/PasswordInput.config.d.ts +1 -0
- package/dist/types/components/PasswordInput/PasswordInput.d.ts +4 -0
- package/dist/types/components/PasswordInput/PasswordInput.types.d.ts +35 -0
- package/dist/types/components/PasswordInput/index.d.ts +2 -0
- package/dist/types/components/PhaseBanner/PhaseBanner.d.ts +4 -0
- package/dist/types/components/PhaseBanner/PhaseBanner.types.d.ts +6 -0
- package/dist/types/components/PhaseBanner/index.d.ts +1 -0
- package/dist/types/components/ProblemWithService/ProblemWithService.d.ts +4 -0
- package/dist/types/components/ProblemWithService/ProblemWithService.types.d.ts +7 -0
- package/dist/types/components/ProblemWithService/index.d.ts +1 -0
- package/dist/types/components/Radios/Radios.config.d.ts +1 -0
- package/dist/types/components/Radios/Radios.d.ts +4 -0
- package/dist/types/components/Radios/Radios.types.d.ts +7 -0
- package/dist/types/components/Radios/index.d.ts +2 -0
- package/dist/types/components/Select/Select.d.ts +4 -0
- package/dist/types/components/Select/Select.types.d.ts +19 -0
- package/dist/types/components/Select/index.d.ts +1 -0
- package/dist/types/components/ServiceNavigation/ServiceNavigation.d.ts +4 -0
- package/dist/types/components/ServiceNavigation/ServiceNavigation.types.d.ts +21 -0
- package/dist/types/components/ServiceNavigation/index.d.ts +1 -0
- package/dist/types/components/SkipLink/SkipLink.config.d.ts +1 -0
- package/dist/types/components/SkipLink/SkipLink.d.ts +4 -0
- package/dist/types/components/SkipLink/SkipLink.types.d.ts +5 -0
- package/dist/types/components/SkipLink/index.d.ts +2 -0
- package/dist/types/components/SummaryList/SummaryList.d.ts +4 -0
- package/dist/types/components/SummaryList/SummaryList.types.d.ts +22 -0
- package/dist/types/components/SummaryList/index.d.ts +1 -0
- package/dist/types/components/Table/Table.d.ts +4 -0
- package/dist/types/components/Table/Table.types.d.ts +21 -0
- package/dist/types/components/Table/index.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.config.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/types/components/Tabs/Tabs.types.d.ts +14 -0
- package/dist/types/components/Tabs/index.d.ts +2 -0
- package/dist/types/components/Tag/Tag.d.ts +4 -0
- package/dist/types/components/Tag/Tag.types.d.ts +4 -0
- package/dist/types/components/Tag/index.d.ts +1 -0
- package/dist/types/components/TaskList/TaskList.d.ts +4 -0
- package/dist/types/components/TaskList/TaskList.types.d.ts +21 -0
- package/dist/types/components/TaskList/index.d.ts +1 -0
- package/dist/types/components/Textarea/Textarea.d.ts +4 -0
- package/dist/types/components/Textarea/Textarea.types.d.ts +14 -0
- package/dist/types/components/Textarea/index.d.ts +1 -0
- package/dist/types/components/WarningInfo/WarningInfo.d.ts +4 -0
- package/dist/types/components/WarningInfo/WarningInfo.types.d.ts +8 -0
- package/dist/types/components/WarningInfo/index.d.ts +1 -0
- package/dist/types/components/WarningText/WarningText.d.ts +4 -0
- package/dist/types/components/WarningText/WarningText.types.d.ts +4 -0
- package/dist/types/components/WarningText/index.d.ts +1 -0
- package/dist/types/components/common.types.d.ts +10 -0
- package/dist/types/components/index.d.ts +51 -0
- package/dist/types/dynamics/index.d.ts +3 -0
- package/dist/types/dynamics/types.d.ts +37 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/ProcessExampleData.d.ts +3 -0
- package/dist/types/utils/StoriesFromFixtures.d.ts +5 -0
- package/dist/types/utils/TitleCase.d.ts +2 -0
- package/dist/types/utils/WithReference.d.ts +5 -0
- package/dist/types/utils/WithReference.types.d.ts +15 -0
- package/package.json +47 -27
- package/.gitattributes +0 -5
- package/.nvmrc +0 -1
- package/.prettierignore +0 -2
- package/.stylelintrc.json +0 -8
- package/assets/Advance-submodule-behaviours.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/uml-diagram.svg +0 -2745
- 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,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,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,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,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 @@
|
|
|
1
|
+
export { default as Tag } from "./Tag";
|
|
@@ -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,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 @@
|
|
|
1
|
+
export { default as WarningInfo } from "./WarningInfo";
|
|
@@ -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,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,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.
|
|
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.
|
|
65
|
-
"@commitlint/config-conventional": "^21.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.
|
|
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.
|
|
86
|
-
"@types/react-dom": "^19.
|
|
92
|
+
"@types/react": "^19.3.0",
|
|
93
|
+
"@types/react-dom": "^19.3.0",
|
|
87
94
|
"assert": "^2.1.0",
|
|
88
|
-
"autoprefixer": "^10.
|
|
89
|
-
"babel-jest": "^30.5.
|
|
95
|
+
"autoprefixer": "^10.6.1",
|
|
96
|
+
"babel-jest": "^30.5.2",
|
|
90
97
|
"bootstrap": "^5.3.8",
|
|
91
|
-
"chromatic": "^18.
|
|
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.
|
|
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.
|
|
105
|
-
"jest-environment-jsdom": "^30.5.
|
|
106
|
-
"magicast": "^0.5.
|
|
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.
|
|
110
|
-
"react": "^19.
|
|
116
|
+
"prettier": "^3.9.9",
|
|
117
|
+
"react": "^19.3.0",
|
|
111
118
|
"react-bootstrap": "^2.10.10",
|
|
112
|
-
"react-dom": "^19.
|
|
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.
|
|
122
|
+
"react-router-dom": "^7.18.4",
|
|
116
123
|
"rimraf": "^6.1.3",
|
|
117
|
-
"rollup": "^4.63.
|
|
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.
|
|
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.
|
|
137
|
-
"unplugin": "^3.
|
|
143
|
+
"typescript-eslint": "^8.70.1",
|
|
144
|
+
"unplugin": "^3.4.0",
|
|
138
145
|
"wait-on": "^9.1.0",
|
|
139
|
-
"webpack": "^5.
|
|
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
|
-
"
|
|
190
|
-
"
|
|
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
package/.stylelintrc.json
DELETED
|
Binary file
|
package/assets/logo.png
DELETED
|
Binary file
|