@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
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,17 @@ interface LabelProps {
|
|
|
88
88
|
isPageHeading?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* The `formGroup` prop accepted by form-field components (Input, Textarea,
|
|
93
|
+
* Select, Boolean, DateInput, PasswordInput, FileUpload). Only `className`
|
|
94
|
+
* is ever read by any of them - it's applied to the wrapping
|
|
95
|
+
* `govuk-form-group` div, nothing else is spread from it - so unlike props
|
|
96
|
+
* that genuinely forward arbitrary HTML attributes, this has no catch-all.
|
|
97
|
+
*/
|
|
98
|
+
interface FormGroupProps {
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
91
102
|
interface BooleanItem {
|
|
92
103
|
id?: string;
|
|
93
104
|
children?: React.ReactNode;
|
|
@@ -109,10 +120,7 @@ interface BooleanProps {
|
|
|
109
120
|
className?: string;
|
|
110
121
|
errorMessage?: ErrorMessageProps;
|
|
111
122
|
fieldset?: FieldsetProps;
|
|
112
|
-
formGroup?:
|
|
113
|
-
className?: string;
|
|
114
|
-
[key: string]: unknown;
|
|
115
|
-
};
|
|
123
|
+
formGroup?: FormGroupProps;
|
|
116
124
|
hint?: HintProps;
|
|
117
125
|
idPrefix?: string;
|
|
118
126
|
items?: BooleanItem[];
|
|
@@ -290,10 +298,7 @@ interface DateInputProps {
|
|
|
290
298
|
className?: string;
|
|
291
299
|
errorMessage?: ErrorMessageProps;
|
|
292
300
|
fieldset?: FieldsetProps;
|
|
293
|
-
formGroup?:
|
|
294
|
-
className?: string;
|
|
295
|
-
[key: string]: unknown;
|
|
296
|
-
};
|
|
301
|
+
formGroup?: FormGroupProps;
|
|
297
302
|
hint?: HintProps;
|
|
298
303
|
id?: string;
|
|
299
304
|
items?: Array<DateInputItem>;
|
|
@@ -411,10 +416,7 @@ declare const Fieldset: React$1.FC<FieldsetProps>;
|
|
|
411
416
|
interface FileUploadProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
412
417
|
className?: string;
|
|
413
418
|
errorMessage?: ErrorMessageProps;
|
|
414
|
-
formGroup?:
|
|
415
|
-
className?: string;
|
|
416
|
-
[key: string]: unknown;
|
|
417
|
-
};
|
|
419
|
+
formGroup?: FormGroupProps;
|
|
418
420
|
hint?: HintProps;
|
|
419
421
|
label?: LabelProps;
|
|
420
422
|
"aria-describedby"?: string;
|
|
@@ -487,7 +489,7 @@ interface HeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
487
489
|
navigationLabel?: string;
|
|
488
490
|
menuButtonLabel?: string;
|
|
489
491
|
logo?: string;
|
|
490
|
-
removeGovUKHeader?:
|
|
492
|
+
removeGovUKHeader?: boolean;
|
|
491
493
|
assetsPath?: string;
|
|
492
494
|
}
|
|
493
495
|
|
|
@@ -500,24 +502,15 @@ declare const Hint: React$1.FC<HintProps & React$1.HTMLAttributes<HTMLOrSVGEleme
|
|
|
500
502
|
interface InputProps {
|
|
501
503
|
className?: string;
|
|
502
504
|
"aria-describedby"?: string;
|
|
503
|
-
errorMessage?:
|
|
504
|
-
formGroup?:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
};
|
|
508
|
-
hint?: object;
|
|
509
|
-
label?: object;
|
|
505
|
+
errorMessage?: ErrorMessageProps;
|
|
506
|
+
formGroup?: FormGroupProps;
|
|
507
|
+
hint?: HintProps;
|
|
508
|
+
label?: LabelProps;
|
|
510
509
|
name?: string;
|
|
511
510
|
id?: string;
|
|
512
511
|
type: string;
|
|
513
|
-
prefix?:
|
|
514
|
-
|
|
515
|
-
[key: string]: unknown;
|
|
516
|
-
};
|
|
517
|
-
suffix?: {
|
|
518
|
-
className?: string;
|
|
519
|
-
[key: string]: unknown;
|
|
520
|
-
};
|
|
512
|
+
prefix?: React.HTMLAttributes<HTMLDivElement>;
|
|
513
|
+
suffix?: React.HTMLAttributes<HTMLDivElement>;
|
|
521
514
|
}
|
|
522
515
|
|
|
523
516
|
declare const Input: React$1.FC<InputProps & React$1.InputHTMLAttributes<HTMLInputElement>>;
|
|
@@ -620,34 +613,16 @@ interface PanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
620
613
|
|
|
621
614
|
declare const Panel: React$1.FC<PanelProps>;
|
|
622
615
|
|
|
623
|
-
interface PasswordInputLabelProps {
|
|
624
|
-
children?: React.ReactNode;
|
|
625
|
-
className?: string;
|
|
626
|
-
isPageHeading?: boolean;
|
|
627
|
-
[key: string]: unknown;
|
|
628
|
-
}
|
|
629
616
|
interface PasswordInputProps {
|
|
630
617
|
/** Additional CSS classes for the `<input>` element. Maps from fixture `classes` → className */
|
|
631
618
|
className?: string;
|
|
632
619
|
/** Pre-existing aria-describedby value to prepend */
|
|
633
620
|
"aria-describedby"?: string;
|
|
634
|
-
|
|
635
|
-
errorMessage?: {
|
|
636
|
-
children?: React.ReactNode;
|
|
637
|
-
[key: string]: unknown;
|
|
638
|
-
};
|
|
621
|
+
errorMessage?: ErrorMessageProps;
|
|
639
622
|
/** Wrapper div options */
|
|
640
|
-
formGroup?:
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
};
|
|
644
|
-
/** Hint sub-object — `{ children }` after processExampleData transforms `text` */
|
|
645
|
-
hint?: {
|
|
646
|
-
children?: React.ReactNode;
|
|
647
|
-
[key: string]: unknown;
|
|
648
|
-
};
|
|
649
|
-
/** Label sub-object — `{ children, className, isPageHeading }` */
|
|
650
|
-
label?: PasswordInputLabelProps;
|
|
623
|
+
formGroup?: FormGroupProps;
|
|
624
|
+
hint?: HintProps;
|
|
625
|
+
label?: LabelProps;
|
|
651
626
|
/** Input name attribute */
|
|
652
627
|
name?: string;
|
|
653
628
|
/** Input id attribute — also used to link label and aria-describedby */
|
|
@@ -743,10 +718,7 @@ interface SelectProps {
|
|
|
743
718
|
className?: string;
|
|
744
719
|
"aria-describedby"?: string;
|
|
745
720
|
errorMessage?: ErrorMessageProps;
|
|
746
|
-
formGroup?:
|
|
747
|
-
className?: string;
|
|
748
|
-
[key: string]: unknown;
|
|
749
|
-
};
|
|
721
|
+
formGroup?: FormGroupProps;
|
|
750
722
|
hint?: HintProps;
|
|
751
723
|
id?: string;
|
|
752
724
|
items?: Option[];
|
|
@@ -881,12 +853,9 @@ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
|
881
853
|
className?: string;
|
|
882
854
|
"aria-describedby"?: string;
|
|
883
855
|
errorMessage?: ErrorMessageProps;
|
|
884
|
-
formGroup?:
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
};
|
|
888
|
-
hint?: object;
|
|
889
|
-
label?: object;
|
|
856
|
+
formGroup?: FormGroupProps;
|
|
857
|
+
hint?: HintProps;
|
|
858
|
+
label?: LabelProps;
|
|
890
859
|
id?: string;
|
|
891
860
|
}
|
|
892
861
|
|