@i-dot-ai-npm/component-library-react 0.0.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 (111) hide show
  1. package/package.json +27 -0
  2. package/src/accordion/Accordion.tsx +31 -0
  3. package/src/accordion/AccordionSection.tsx +17 -0
  4. package/src/accordion/AccordionSectionContent.tsx +17 -0
  5. package/src/accordion/AccordionSectionHeader.tsx +17 -0
  6. package/src/accordion/AccordionSectionHeading.tsx +19 -0
  7. package/src/accordion/AccordionSectionSummary.tsx +17 -0
  8. package/src/back-link/BackLink.tsx +24 -0
  9. package/src/breadcrumbs/BreadcrumbItem.tsx +20 -0
  10. package/src/breadcrumbs/Breadcrumbs.tsx +28 -0
  11. package/src/button/Button.tsx +26 -0
  12. package/src/button-group/ButtonGroup.tsx +17 -0
  13. package/src/card/Card.tsx +24 -0
  14. package/src/card/CardContent.tsx +17 -0
  15. package/src/card/CardGroup.tsx +17 -0
  16. package/src/card/CardHeading.tsx +17 -0
  17. package/src/card/CardIcon.tsx +17 -0
  18. package/src/card/CardLink.tsx +17 -0
  19. package/src/character-count/CharacterCount.tsx +14 -0
  20. package/src/character-count/CharacterCountMessage.tsx +17 -0
  21. package/src/checkboxes/CheckboxDivider.tsx +17 -0
  22. package/src/checkboxes/CheckboxInput.tsx +14 -0
  23. package/src/checkboxes/CheckboxItem.tsx +17 -0
  24. package/src/checkboxes/CheckboxLabel.tsx +17 -0
  25. package/src/checkboxes/Checkboxes.tsx +26 -0
  26. package/src/cookie-banner/CookieBanner.tsx +17 -0
  27. package/src/cookie-banner/CookieBannerActions.tsx +17 -0
  28. package/src/cookie-banner/CookieBannerContent.tsx +17 -0
  29. package/src/cookie-banner/CookieBannerHeading.tsx +17 -0
  30. package/src/cookie-banner/CookieBannerMessage.tsx +17 -0
  31. package/src/date-input/DateInput.tsx +17 -0
  32. package/src/date-input/DateInputField.tsx +21 -0
  33. package/src/date-input/DateInputItem.tsx +17 -0
  34. package/src/details/Details.tsx +17 -0
  35. package/src/details/DetailsSummary.tsx +19 -0
  36. package/src/details/DetailsText.tsx +17 -0
  37. package/src/error-message/ErrorMessage.tsx +20 -0
  38. package/src/error-summary/ErrorSummary.tsx +19 -0
  39. package/src/error-summary/ErrorSummaryBody.tsx +17 -0
  40. package/src/error-summary/ErrorSummaryItem.tsx +19 -0
  41. package/src/error-summary/ErrorSummaryList.tsx +17 -0
  42. package/src/error-summary/ErrorSummaryTitle.tsx +17 -0
  43. package/src/fieldset/Fieldset.tsx +17 -0
  44. package/src/fieldset/FieldsetLegend.tsx +24 -0
  45. package/src/file-upload/FileUpload.tsx +14 -0
  46. package/src/form-group/FormGroup.tsx +24 -0
  47. package/src/header/Header.tsx +24 -0
  48. package/src/hint/Hint.tsx +17 -0
  49. package/src/index.ts +110 -0
  50. package/src/input/Input.tsx +27 -0
  51. package/src/input-label/InputLabel.tsx +24 -0
  52. package/src/inset-text/InsetText.tsx +17 -0
  53. package/src/link/Link.tsx +28 -0
  54. package/src/list/List.tsx +24 -0
  55. package/src/list/ListItem.tsx +17 -0
  56. package/src/notification-banner/NotificationBanner.tsx +23 -0
  57. package/src/notification-banner/NotificationBannerContent.tsx +17 -0
  58. package/src/notification-banner/NotificationBannerHeader.tsx +17 -0
  59. package/src/notification-banner/NotificationBannerHeading.tsx +17 -0
  60. package/src/notification-banner/NotificationBannerTitle.tsx +17 -0
  61. package/src/pagination/Pagination.tsx +24 -0
  62. package/src/pagination/PaginationItem.tsx +26 -0
  63. package/src/pagination/PaginationList.tsx +17 -0
  64. package/src/pagination/PaginationNext.tsx +27 -0
  65. package/src/pagination/PaginationPrev.tsx +27 -0
  66. package/src/password-input/PasswordInput.tsx +20 -0
  67. package/src/phase-banner/PhaseBanner.tsx +19 -0
  68. package/src/radios/RadioDivider.tsx +17 -0
  69. package/src/radios/RadioInput.tsx +14 -0
  70. package/src/radios/RadioItem.tsx +17 -0
  71. package/src/radios/Radios.tsx +26 -0
  72. package/src/select/Select.tsx +26 -0
  73. package/src/select/SelectOption.tsx +17 -0
  74. package/src/service-navigation/ServiceNavigation.tsx +34 -0
  75. package/src/service-navigation/ServiceNavigationItem.tsx +20 -0
  76. package/src/side-nav/SideNav.tsx +17 -0
  77. package/src/side-nav/SideNavItem.tsx +20 -0
  78. package/src/side-nav/SideNavList.tsx +17 -0
  79. package/src/side-nav/SideNavSubnavHeading.tsx +17 -0
  80. package/src/side-nav/SideNavSubnavList.tsx +17 -0
  81. package/src/side-nav/SideNavTitle.tsx +17 -0
  82. package/src/skip-link/SkipLink.tsx +17 -0
  83. package/src/summary-list/SummaryList.tsx +24 -0
  84. package/src/summary-list/SummaryListActions.tsx +17 -0
  85. package/src/summary-list/SummaryListKey.tsx +17 -0
  86. package/src/summary-list/SummaryListRow.tsx +24 -0
  87. package/src/summary-list/SummaryListValue.tsx +17 -0
  88. package/src/table/Table.tsx +26 -0
  89. package/src/table/TableBody.tsx +17 -0
  90. package/src/table/TableCaption.tsx +24 -0
  91. package/src/table/TableCell.tsx +24 -0
  92. package/src/table/TableHead.tsx +17 -0
  93. package/src/table/TableHeader.tsx +24 -0
  94. package/src/table/TableRow.tsx +17 -0
  95. package/src/tabs/Tab.tsx +20 -0
  96. package/src/tabs/TabPanel.tsx +24 -0
  97. package/src/tabs/Tabs.tsx +31 -0
  98. package/src/tabs/TabsList.tsx +17 -0
  99. package/src/tabs/TabsTitle.tsx +17 -0
  100. package/src/tag/Tag.tsx +24 -0
  101. package/src/task-list/TaskList.tsx +17 -0
  102. package/src/task-list/TaskListHint.tsx +17 -0
  103. package/src/task-list/TaskListItem.tsx +24 -0
  104. package/src/task-list/TaskListLink.tsx +17 -0
  105. package/src/task-list/TaskListNameAndHint.tsx +17 -0
  106. package/src/task-list/TaskListStatus.tsx +17 -0
  107. package/src/textarea/Textarea.tsx +23 -0
  108. package/src/toggle/Toggle.tsx +16 -0
  109. package/src/toggle/ToggleItem.tsx +17 -0
  110. package/src/toggle/ToggleLabel.tsx +17 -0
  111. package/src/warning-text/WarningText.tsx +25 -0
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@i-dot-ai-npm/component-library-react",
3
+ "version": "0.0.1",
4
+ "description": "React components for i.AI GOV.UK (auto-generated from HTML specs).",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/index.ts",
8
+ "./*": "./src/*"
9
+ },
10
+ "files": [
11
+ "src"
12
+ ],
13
+ "peerDependencies": {
14
+ "react": ">=18",
15
+ "govuk-frontend": ">=6"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/i-dot-ai/component-library.git",
20
+ "directory": "packages/react"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public",
24
+ "registry": "https://registry.npmjs.org"
25
+ },
26
+ "license": "MIT"
27
+ }
@@ -0,0 +1,31 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+ import { useEffect, useRef } from "react";
3
+
4
+ type AccordionProps = {
5
+ class?: string;
6
+ children?: React.ReactNode;
7
+ [key: string]: unknown;
8
+ };
9
+
10
+ export default function Accordion({ class: className, children, ...rest }: AccordionProps) {
11
+ const ref = useRef<HTMLElement>(null);
12
+ const classes = ["govuk-accordion", className ?? ""].filter(Boolean).join(" ");
13
+ useEffect(() => {
14
+ const el = ref.current;
15
+ if (!el) return;
16
+ // Dynamic import keeps govuk-frontend out of SSR (it touches
17
+ // HTMLElement at module load, which is undefined in Node).
18
+ void import("govuk-frontend").then(({ Accordion }) => {
19
+ if (!ref.current) return;
20
+ // Guard double-init (govuk stamps data-<module>-init).
21
+ if (ref.current.hasAttribute(`data-${Accordion.moduleName}-init`)) return;
22
+ new Accordion(ref.current);
23
+ });
24
+ }, []);
25
+
26
+ return (
27
+ <div className={classes} data-module="govuk-accordion" ref={ref} {...rest}>
28
+ {children ?? ""}
29
+ </div>
30
+ );
31
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type AccordionSectionProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function AccordionSection({ class: className, children, ...rest }: AccordionSectionProps) {
10
+ const classes = ["govuk-accordion__section", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type AccordionSectionContentProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function AccordionSectionContent({ class: className, children, ...rest }: AccordionSectionContentProps) {
10
+ const classes = ["govuk-accordion__section-content", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type AccordionSectionHeaderProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function AccordionSectionHeader({ class: className, children, ...rest }: AccordionSectionHeaderProps) {
10
+ const classes = ["govuk-accordion__section-header", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,19 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type AccordionSectionHeadingProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function AccordionSectionHeading({ class: className, children, ...rest }: AccordionSectionHeadingProps) {
10
+ const classes = ["govuk-accordion__section-button", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <h2 className="govuk-accordion__section-heading">
14
+ <span className={classes} {...rest}>
15
+ {children ?? ""}
16
+ </span>
17
+ </h2>
18
+ );
19
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type AccordionSectionSummaryProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function AccordionSectionSummary({ class: className, children, ...rest }: AccordionSectionSummaryProps) {
10
+ const classes = ["govuk-accordion__section-summary govuk-body", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,24 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type BackLinkProps = {
4
+ inverse?: boolean;
5
+ class?: string;
6
+ children?: React.ReactNode;
7
+ [key: string]: unknown;
8
+ };
9
+
10
+ export default function BackLink({ inverse, class: className, children, ...rest }: BackLinkProps) {
11
+ const classes = [
12
+ "govuk-back-link",
13
+ inverse ? "govuk-back-link--inverse" : "",
14
+ className ?? "",
15
+ ]
16
+ .filter(Boolean)
17
+ .join(" ");
18
+
19
+ return (
20
+ <a className={classes} {...rest}>
21
+ {children ?? ""}
22
+ </a>
23
+ );
24
+ }
@@ -0,0 +1,20 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type BreadcrumbItemProps = {
4
+ href?: string;
5
+ class?: string;
6
+ children?: React.ReactNode;
7
+ [key: string]: unknown;
8
+ };
9
+
10
+ export default function BreadcrumbItem({ href, class: className, children, ...rest }: BreadcrumbItemProps) {
11
+ const classes = ["govuk-breadcrumbs__list-item", className ?? ""].filter(Boolean).join(" ");
12
+
13
+ return (
14
+ <li className={classes} {...rest}>
15
+ <a className="govuk-breadcrumbs__link" href={href}>
16
+ {children ?? ""}
17
+ </a>
18
+ </li>
19
+ );
20
+ }
@@ -0,0 +1,28 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type BreadcrumbsProps = {
4
+ inverse?: boolean;
5
+ collapseOnMobile?: boolean;
6
+ class?: string;
7
+ children?: React.ReactNode;
8
+ [key: string]: unknown;
9
+ };
10
+
11
+ export default function Breadcrumbs({ inverse, collapseOnMobile, class: className, children, ...rest }: BreadcrumbsProps) {
12
+ const classes = [
13
+ "govuk-breadcrumbs",
14
+ inverse ? "govuk-breadcrumbs--inverse" : "",
15
+ collapseOnMobile ? "govuk-breadcrumbs--collapse-on-mobile" : "",
16
+ className ?? "",
17
+ ]
18
+ .filter(Boolean)
19
+ .join(" ");
20
+
21
+ return (
22
+ <nav className={classes} aria-label="Breadcrumb" {...rest}>
23
+ <ol className="govuk-breadcrumbs__list">
24
+ {children ?? ""}
25
+ </ol>
26
+ </nav>
27
+ );
28
+ }
@@ -0,0 +1,26 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type ButtonProps = {
4
+ secondary?: boolean;
5
+ warning?: boolean;
6
+ inverse?: boolean;
7
+ href?: string;
8
+ class?: string;
9
+ children?: React.ReactNode;
10
+ [key: string]: unknown;
11
+ };
12
+
13
+ export default function Button({ secondary, warning, inverse, href, class: className, children, ...rest }: ButtonProps) {
14
+
15
+ return (
16
+ href ? (
17
+ <a href={href} role="button" className={["govuk-button", secondary ? "govuk-button--secondary" : "", warning ? "govuk-button--warning" : "", inverse ? "govuk-button--inverse" : "", className ?? ""].filter(Boolean).join(" ")} {...rest}>
18
+ {children ?? ""}
19
+ </a>
20
+ ) : (
21
+ <button className={["govuk-button", secondary ? "govuk-button--secondary" : "", warning ? "govuk-button--warning" : "", inverse ? "govuk-button--inverse" : "", className ?? ""].filter(Boolean).join(" ")} data-module="govuk-button" {...rest}>
22
+ {children ?? ""}
23
+ </button>
24
+ )
25
+ );
26
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type ButtonGroupProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function ButtonGroup({ class: className, children, ...rest }: ButtonGroupProps) {
10
+ const classes = ["govuk-button-group", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,24 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardProps = {
4
+ secondary?: boolean;
5
+ class?: string;
6
+ children?: React.ReactNode;
7
+ [key: string]: unknown;
8
+ };
9
+
10
+ export default function Card({ secondary, class: className, children, ...rest }: CardProps) {
11
+ const classes = [
12
+ "iai-card",
13
+ secondary ? "iai-card--secondary" : "",
14
+ className ?? "",
15
+ ]
16
+ .filter(Boolean)
17
+ .join(" ");
18
+
19
+ return (
20
+ <div className={classes} {...rest}>
21
+ {children ?? ""}
22
+ </div>
23
+ );
24
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardContentProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CardContent({ class: className, children, ...rest }: CardContentProps) {
10
+ const classes = ["iai-card__content", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardGroupProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CardGroup({ class: className, children, ...rest }: CardGroupProps) {
10
+ const classes = ["iai-card-group", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardHeadingProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CardHeading({ class: className, children, ...rest }: CardHeadingProps) {
10
+ const classes = ["iai-card__heading", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardIconProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CardIcon({ class: className, children, ...rest }: CardIconProps) {
10
+ const classes = ["iai-card__icon", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} aria-hidden="true" {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CardLinkProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CardLink({ class: className, children, ...rest }: CardLinkProps) {
10
+ const classes = ["iai-card__link", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <a className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </a>
16
+ );
17
+ }
@@ -0,0 +1,14 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CharacterCountProps = {
4
+ class?: string;
5
+ [key: string]: unknown;
6
+ };
7
+
8
+ export default function CharacterCount({ class: className, ...rest }: CharacterCountProps) {
9
+ const classes = ["govuk-textarea govuk-js-character-count", className ?? ""].filter(Boolean).join(" ");
10
+
11
+ return (
12
+ <textarea className={classes} {...rest}></textarea>
13
+ );
14
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CharacterCountMessageProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CharacterCountMessage({ class: className, children, ...rest }: CharacterCountMessageProps) {
10
+ const classes = ["govuk-hint govuk-character-count__message", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CheckboxDividerProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CheckboxDivider({ class: className, children }: CheckboxDividerProps) {
10
+ const classes = ["govuk-checkboxes__divider", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes}>
14
+ {children ?? "or"}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,14 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CheckboxInputProps = {
4
+ class?: string;
5
+ [key: string]: unknown;
6
+ };
7
+
8
+ export default function CheckboxInput({ class: className, ...rest }: CheckboxInputProps) {
9
+ const classes = ["govuk-checkboxes__input", className ?? ""].filter(Boolean).join(" ");
10
+
11
+ return (
12
+ <input className={classes} type="checkbox" {...rest} />
13
+ );
14
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CheckboxItemProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CheckboxItem({ class: className, children, ...rest }: CheckboxItemProps) {
10
+ const classes = ["govuk-checkboxes__item", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CheckboxLabelProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CheckboxLabel({ class: className, children, ...rest }: CheckboxLabelProps) {
10
+ const classes = ["govuk-label govuk-checkboxes__label", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <label className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </label>
16
+ );
17
+ }
@@ -0,0 +1,26 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CheckboxesProps = {
4
+ small?: boolean;
5
+ subtle?: boolean;
6
+ class?: string;
7
+ children?: React.ReactNode;
8
+ [key: string]: unknown;
9
+ };
10
+
11
+ export default function Checkboxes({ small, subtle, class: className, children, ...rest }: CheckboxesProps) {
12
+ const classes = [
13
+ "govuk-checkboxes",
14
+ small ? "govuk-checkboxes--small" : "",
15
+ subtle ? "govuk-checkboxes--subtle" : "",
16
+ className ?? "",
17
+ ]
18
+ .filter(Boolean)
19
+ .join(" ");
20
+
21
+ return (
22
+ <div className={classes} data-module="govuk-checkboxes" {...rest}>
23
+ {children ?? ""}
24
+ </div>
25
+ );
26
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CookieBannerProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CookieBanner({ class: className, children, ...rest }: CookieBannerProps) {
10
+ const classes = ["govuk-cookie-banner", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} data-nosnippet="" role="region" aria-label="Cookie banner" {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CookieBannerActionsProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CookieBannerActions({ class: className, children, ...rest }: CookieBannerActionsProps) {
10
+ const classes = ["govuk-button-group", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CookieBannerContentProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CookieBannerContent({ class: className, children, ...rest }: CookieBannerContentProps) {
10
+ const classes = ["govuk-cookie-banner__content", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CookieBannerHeadingProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CookieBannerHeading({ class: className, children, ...rest }: CookieBannerHeadingProps) {
10
+ const classes = ["govuk-cookie-banner__heading govuk-heading-m", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <h2 className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </h2>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type CookieBannerMessageProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function CookieBannerMessage({ class: className, children, ...rest }: CookieBannerMessageProps) {
10
+ const classes = ["govuk-cookie-banner__message govuk-width-container", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type DateInputProps = {
4
+ class?: string;
5
+ children?: React.ReactNode;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function DateInput({ class: className, children, ...rest }: DateInputProps) {
10
+ const classes = ["govuk-date-input", className ?? ""].filter(Boolean).join(" ");
11
+
12
+ return (
13
+ <div className={classes} {...rest}>
14
+ {children ?? ""}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,21 @@
1
+ // AUTO-GENERATED from HTML spec. Do not edit by hand.
2
+
3
+ type DateInputFieldProps = {
4
+ width?: "2" | "3" | "4";
5
+ class?: string;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export default function DateInputField({ width = "2", class: className, ...rest }: DateInputFieldProps) {
10
+ const classes = [
11
+ "govuk-input govuk-date-input__input",
12
+ ({ "2": "govuk-input--width-2", "3": "govuk-input--width-3", "4": "govuk-input--width-4" }[width] ?? ""),
13
+ className ?? "",
14
+ ]
15
+ .filter(Boolean)
16
+ .join(" ");
17
+
18
+ return (
19
+ <input className={classes} type="text" inputmode="numeric" {...rest} />
20
+ );
21
+ }