@hmlr/govuk-react-components-library 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.stylelintrc.json +1 -1
- package/README.md +215 -1
- package/assets/uml-diagram.svg +731 -572
- package/bundle-analysis-main.html +2 -2
- package/bundle-analysis-pdfvc.html +1 -1
- package/dist/PDFViewerCanvas.cjs.css +4 -4
- package/dist/PDFViewerCanvas.cjs.js +91 -7
- package/dist/PDFViewerCanvas.cjs.js.map +1 -1
- package/dist/PDFViewerCanvas.esm.css +4 -4
- package/dist/PDFViewerCanvas.esm.js +91 -7
- package/dist/PDFViewerCanvas.esm.js.map +1 -1
- package/dist/index.cjs.css +13 -8
- package/dist/index.cjs.js +356 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +104 -10
- package/dist/index.esm.css +13 -8
- package/dist/index.esm.js +357 -67
- package/dist/index.esm.js.map +1 -1
- 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/PDFViewer/ResolvePDFSource.d.ts +24 -1
- package/dist/types/components/Pagination/Pagination.types.d.ts +23 -13
- package/dist/types/components/Pagination/index.d.ts +2 -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 +49 -0
- package/dist/types/components/PasswordInput/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/utils/WithReference.types.d.ts +7 -2
- package/package.json +70 -66
- package/scripts/generateStories.mjs +433 -0
- package/dist/types/JestSetup.d.ts +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface PasswordInputLabelProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
isPageHeading?: boolean;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface PasswordInputProps {
|
|
8
|
+
/** Additional CSS classes for the `<input>` element. Maps from fixture `classes` → className */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Pre-existing aria-describedby value to prepend */
|
|
11
|
+
"aria-describedby"?: string;
|
|
12
|
+
/** Error message sub-object — `{ children }` after processExampleData transforms `text` */
|
|
13
|
+
errorMessage?: {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
/** Wrapper div options */
|
|
18
|
+
formGroup?: {
|
|
19
|
+
className?: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
/** Hint sub-object — `{ children }` after processExampleData transforms `text` */
|
|
23
|
+
hint?: {
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
/** Label sub-object — `{ children, className, isPageHeading }` */
|
|
28
|
+
label?: PasswordInputLabelProps;
|
|
29
|
+
/** Input name attribute */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Input id attribute — also used to link label and aria-describedby */
|
|
32
|
+
id?: string;
|
|
33
|
+
/** autocomplete attribute — defaults to "current-password" */
|
|
34
|
+
autoComplete?: string;
|
|
35
|
+
/** i18n: label for the show-password button (default: "Show") */
|
|
36
|
+
showPasswordText?: string;
|
|
37
|
+
/** i18n: label for the hide-password button (default: "Hide") */
|
|
38
|
+
hidePasswordText?: string;
|
|
39
|
+
/** i18n: aria-label for the show-password button */
|
|
40
|
+
showPasswordAriaLabelText?: string;
|
|
41
|
+
/** i18n: aria-label for the hide-password button */
|
|
42
|
+
hidePasswordAriaLabelText?: string;
|
|
43
|
+
/** i18n: text announced when the password becomes visible */
|
|
44
|
+
passwordShownAnnouncementText?: string;
|
|
45
|
+
/** i18n: text announced when the password is hidden */
|
|
46
|
+
passwordHiddenAnnouncementText?: string;
|
|
47
|
+
/** Allow pass-through of any other HTML input attributes */
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
@@ -16,6 +16,7 @@ export * from "./DifferenceNavigation";
|
|
|
16
16
|
export * from "./ErrorBoundary";
|
|
17
17
|
export * from "./ErrorMessage";
|
|
18
18
|
export * from "./ErrorSummary";
|
|
19
|
+
export * from "./ExitThisPage";
|
|
19
20
|
export * from "./Fieldset";
|
|
20
21
|
export * from "./FileUpload";
|
|
21
22
|
export * from "./Footer";
|
|
@@ -32,6 +33,7 @@ export * from "./NotFoundPage";
|
|
|
32
33
|
export * from "./NotificationBanner";
|
|
33
34
|
export * from "./Pagination";
|
|
34
35
|
export * from "./Panel";
|
|
36
|
+
export * from "./PasswordInput";
|
|
35
37
|
export * from "./PDFViewer";
|
|
36
38
|
export * from "./PhaseBanner";
|
|
37
39
|
export * from "./ProblemWithService";
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
type RefAcceptingComponent = React.ComponentType<Record<string, unknown> & {
|
|
3
|
+
ref?: React.Ref<HTMLElement>;
|
|
4
|
+
}>;
|
|
2
5
|
export interface WithRefProps {
|
|
3
|
-
Component:
|
|
6
|
+
Component: RefAcceptingComponent;
|
|
7
|
+
items?: unknown[];
|
|
4
8
|
[key: string]: unknown;
|
|
5
9
|
}
|
|
6
10
|
export interface InfoSectionProps {
|
|
7
11
|
refName: string;
|
|
8
|
-
Component:
|
|
12
|
+
Component: RefAcceptingComponent;
|
|
9
13
|
restProps: Record<string, unknown>;
|
|
10
14
|
}
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmlr/govuk-react-components-library",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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",
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
"prepare": "husky",
|
|
31
31
|
"release": "standard-version",
|
|
32
32
|
"uml": "tsuml2 --glob './src/**/\\!(*.spec|*.test|TestUtilities|JestSetup).[t]s?(x)' -o './assets/uml-diagram.svg'",
|
|
33
|
-
"chromatic": "npx chromatic --exit-zero-on-changes"
|
|
33
|
+
"chromatic": "npx chromatic --exit-zero-on-changes",
|
|
34
|
+
"generate-stories": "node scripts/generateStories.mjs",
|
|
35
|
+
"prestorybook": "npm run generate-stories",
|
|
36
|
+
"prebuild-storybook": "npm run generate-stories"
|
|
34
37
|
},
|
|
35
38
|
"repository": {
|
|
36
39
|
"type": "git",
|
|
@@ -51,89 +54,90 @@
|
|
|
51
54
|
"author": "Cyril Adelekan",
|
|
52
55
|
"license": "MIT",
|
|
53
56
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.
|
|
55
|
-
"@babel/preset-env": "^7.
|
|
56
|
-
"@babel/preset-react": "^7.
|
|
57
|
-
"@babel/preset-typescript": "^7.
|
|
58
|
-
"@chromatic-com/storybook": "^
|
|
59
|
-
"@commitlint/cli": "^
|
|
60
|
-
"@commitlint/config-conventional": "^
|
|
61
|
-
"@eslint/js": "^9.
|
|
62
|
-
"@jest/globals": "^30.0
|
|
63
|
-
"@rollup/plugin-commonjs": "^
|
|
57
|
+
"@babel/core": "^7.29.0",
|
|
58
|
+
"@babel/preset-env": "^7.29.0",
|
|
59
|
+
"@babel/preset-react": "^7.28.5",
|
|
60
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
61
|
+
"@chromatic-com/storybook": "^5.0.1",
|
|
62
|
+
"@commitlint/cli": "^20.4.4",
|
|
63
|
+
"@commitlint/config-conventional": "^20.4.4",
|
|
64
|
+
"@eslint/js": "^9.37.0",
|
|
65
|
+
"@jest/globals": "^30.3.0",
|
|
66
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
64
67
|
"@rollup/plugin-json": "^6.1.0",
|
|
65
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
66
|
-
"@rollup/plugin-terser": "^0.
|
|
67
|
-
"@rollup/plugin-typescript": "^12.
|
|
68
|
-
"@storybook/addon-a11y": "^
|
|
69
|
-
"@storybook/addon-links": "^
|
|
70
|
-
"@storybook/addon-styling-webpack": "^
|
|
71
|
-
"@storybook/addon-webpack5-compiler-swc": "^
|
|
72
|
-
"@storybook/
|
|
73
|
-
"@storybook/react-
|
|
74
|
-
"@storybook/
|
|
75
|
-
"@
|
|
76
|
-
"@testing-library/
|
|
77
|
-
"@
|
|
68
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
69
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
70
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
71
|
+
"@storybook/addon-a11y": "^10.2.18",
|
|
72
|
+
"@storybook/addon-links": "^10.2.18",
|
|
73
|
+
"@storybook/addon-styling-webpack": "^3.0.0",
|
|
74
|
+
"@storybook/addon-webpack5-compiler-swc": "^4.0.2",
|
|
75
|
+
"@storybook/csf": "^0.1.13",
|
|
76
|
+
"@storybook/react-vite": "^10.2.18",
|
|
77
|
+
"@storybook/react-webpack5": "^10.2.18",
|
|
78
|
+
"@storybook/test-runner": "^0.24.2",
|
|
79
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
80
|
+
"@testing-library/react": "^16.3.2",
|
|
81
|
+
"@types/govuk-frontend": "^5.11.0",
|
|
78
82
|
"@types/jest": "^30.0.0",
|
|
79
|
-
"@types/react": "^19.
|
|
80
|
-
"@types/react-dom": "^19.
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
82
|
-
"@typescript-eslint/parser": "^8.
|
|
83
|
+
"@types/react": "^19.2.14",
|
|
84
|
+
"@types/react-dom": "^19.2.3",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
86
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
83
87
|
"assert": "^2.1.0",
|
|
84
|
-
"autoprefixer": "^10.4.
|
|
85
|
-
"babel-jest": "^30.0
|
|
86
|
-
"bootstrap": "^5.3.
|
|
87
|
-
"chromatic": "^
|
|
88
|
-
"css-loader": "^7.1.
|
|
88
|
+
"autoprefixer": "^10.4.27",
|
|
89
|
+
"babel-jest": "^30.3.0",
|
|
90
|
+
"bootstrap": "^5.3.8",
|
|
91
|
+
"chromatic": "^15.2.0",
|
|
92
|
+
"css-loader": "^7.1.4",
|
|
89
93
|
"deep-iterator": "^1.1.0",
|
|
90
|
-
"eslint": "^9.
|
|
94
|
+
"eslint": "^9.37.0",
|
|
91
95
|
"eslint-plugin-react": "^7.37.5",
|
|
92
|
-
"eslint-plugin-storybook": "^
|
|
93
|
-
"globals": "^
|
|
94
|
-
"govuk-frontend": "^5.
|
|
95
|
-
"html-react-parser": "^5.2.
|
|
96
|
+
"eslint-plugin-storybook": "^10.2.18",
|
|
97
|
+
"globals": "^17.4.0",
|
|
98
|
+
"govuk-frontend": "^5.14.0",
|
|
99
|
+
"html-react-parser": "^5.2.17",
|
|
96
100
|
"husky": "^9.1.7",
|
|
97
101
|
"identity-obj-proxy": "^3.0.0",
|
|
98
|
-
"jest": "^30.0
|
|
99
|
-
"jest-environment-jsdom": "^30.0
|
|
100
|
-
"magicast": "^0.
|
|
102
|
+
"jest": "^30.3.0",
|
|
103
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
104
|
+
"magicast": "^0.5.2",
|
|
101
105
|
"pdfjs-dist": "^4.10.38",
|
|
102
|
-
"postcss": "^8.5.
|
|
103
|
-
"prettier": "^3.
|
|
104
|
-
"react": "^19.
|
|
106
|
+
"postcss": "^8.5.8",
|
|
107
|
+
"prettier": "^3.8.1",
|
|
108
|
+
"react": "^19.2.4",
|
|
105
109
|
"react-bootstrap": "^2.10.10",
|
|
106
|
-
"react-dom": "^19.
|
|
110
|
+
"react-dom": "^19.2.4",
|
|
107
111
|
"react-element-to-jsx-string": "^17.0.1",
|
|
108
|
-
"react-router": "^7.
|
|
109
|
-
"react-router-dom": "^7.
|
|
110
|
-
"rimraf": "^6.
|
|
111
|
-
"rollup": "^4.
|
|
112
|
+
"react-router": "^7.13.1",
|
|
113
|
+
"react-router-dom": "^7.13.1",
|
|
114
|
+
"rimraf": "^6.1.3",
|
|
115
|
+
"rollup": "^4.59.0",
|
|
112
116
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
113
|
-
"rollup-plugin-dts": "^6.
|
|
117
|
+
"rollup-plugin-dts": "^6.4.0",
|
|
114
118
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
115
119
|
"rollup-plugin-postcss": "^4.0.2",
|
|
116
|
-
"rollup-plugin-visualizer": "^6.0.
|
|
117
|
-
"sass": "^1.
|
|
118
|
-
"sass-loader": "^16.0.
|
|
120
|
+
"rollup-plugin-visualizer": "^6.0.4",
|
|
121
|
+
"sass": "^1.98.0",
|
|
122
|
+
"sass-loader": "^16.0.7",
|
|
119
123
|
"standard-version": "^9.5.0",
|
|
120
|
-
"storybook": "^
|
|
124
|
+
"storybook": "^10.2.18",
|
|
121
125
|
"style-loader": "^4.0.0",
|
|
122
|
-
"stylelint": "^
|
|
123
|
-
"stylelint-config-
|
|
124
|
-
"stylelint-config-standard": "^
|
|
125
|
-
"stylelint-config-standard-scss": "^
|
|
126
|
-
"stylelint-order": "^7.0.
|
|
126
|
+
"stylelint": "^17.4.0",
|
|
127
|
+
"stylelint-config-recess-order": "^7.6.1",
|
|
128
|
+
"stylelint-config-standard": "^40.0.0",
|
|
129
|
+
"stylelint-config-standard-scss": "^17.0.0",
|
|
130
|
+
"stylelint-order": "^7.0.1",
|
|
127
131
|
"tslib": "^2.8.1",
|
|
128
132
|
"tsuml2": "^0.17.1",
|
|
129
|
-
"typescript": "^5.
|
|
130
|
-
"typescript-eslint": "^8.
|
|
131
|
-
"unplugin": "^
|
|
132
|
-
"webpack": "^5.
|
|
133
|
-
"@storybook/addon-docs": "^
|
|
133
|
+
"typescript": "^5.9.3",
|
|
134
|
+
"typescript-eslint": "^8.57.0",
|
|
135
|
+
"unplugin": "^3.0.0",
|
|
136
|
+
"webpack": "^5.105.4",
|
|
137
|
+
"@storybook/addon-docs": "^10.2.18"
|
|
134
138
|
},
|
|
135
139
|
"peerDependencies": {
|
|
136
|
-
"govuk-frontend": ">=5.
|
|
140
|
+
"govuk-frontend": ">=5.14.0",
|
|
137
141
|
"react": ">=18.2.0",
|
|
138
142
|
"react-dom": ">=18.2.0",
|
|
139
143
|
"react-router-dom": ">=6.30.0"
|