@i-dot-ai-npm/component-library-react 0.0.7 → 0.0.9

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 (141) hide show
  1. package/package.json +11 -3
  2. package/src/accordion/Accordion.tsx +2 -3
  3. package/src/accordion/AccordionSection.tsx +2 -3
  4. package/src/accordion/AccordionSectionContent.tsx +2 -3
  5. package/src/accordion/AccordionSectionHeader.tsx +2 -3
  6. package/src/accordion/AccordionSectionHeading.tsx +2 -3
  7. package/src/accordion/AccordionSectionSummary.tsx +2 -3
  8. package/src/back-link/BackLink.tsx +2 -3
  9. package/src/breadcrumbs/BreadcrumbItem.tsx +2 -3
  10. package/src/breadcrumbs/Breadcrumbs.tsx +2 -3
  11. package/src/button/Button.tsx +2 -3
  12. package/src/button-group/ButtonGroup.tsx +2 -3
  13. package/src/card/Card.tsx +2 -3
  14. package/src/card/CardContent.tsx +2 -3
  15. package/src/card/CardGroup.tsx +2 -3
  16. package/src/card/CardHeading.tsx +2 -3
  17. package/src/card/CardIcon.tsx +2 -3
  18. package/src/card/CardLink.tsx +2 -3
  19. package/src/character-count/CharacterCount.tsx +2 -3
  20. package/src/character-count/CharacterCountMessage.tsx +2 -3
  21. package/src/checkboxes/CheckboxConditional.tsx +2 -3
  22. package/src/checkboxes/CheckboxDivider.tsx +1 -2
  23. package/src/checkboxes/CheckboxInput.tsx +3 -2
  24. package/src/checkboxes/CheckboxItem.tsx +2 -3
  25. package/src/checkboxes/CheckboxLabel.tsx +2 -3
  26. package/src/checkboxes/Checkboxes.tsx +2 -3
  27. package/src/contents-panel/ContentsPanel.tsx +2 -3
  28. package/src/contents-panel/ContentsPanelItem.tsx +2 -3
  29. package/src/contents-panel/ContentsPanelList.tsx +2 -3
  30. package/src/contents-panel/ContentsPanelListHeading.tsx +2 -3
  31. package/src/cookie-banner/CookieBanner.tsx +2 -3
  32. package/src/cookie-banner/CookieBannerActions.tsx +2 -3
  33. package/src/cookie-banner/CookieBannerContent.tsx +2 -3
  34. package/src/cookie-banner/CookieBannerHeading.tsx +2 -3
  35. package/src/cookie-banner/CookieBannerMessage.tsx +2 -3
  36. package/src/date-input/DateInput.tsx +2 -3
  37. package/src/date-input/DateInputField.tsx +5 -4
  38. package/src/date-input/DateInputItem.tsx +2 -3
  39. package/src/details/Details.tsx +2 -3
  40. package/src/details/DetailsSummary.tsx +2 -3
  41. package/src/details/DetailsText.tsx +2 -3
  42. package/src/error-message/ErrorMessage.tsx +2 -3
  43. package/src/error-summary/ErrorSummary.tsx +2 -3
  44. package/src/error-summary/ErrorSummaryBody.tsx +2 -3
  45. package/src/error-summary/ErrorSummaryItem.tsx +2 -3
  46. package/src/error-summary/ErrorSummaryList.tsx +2 -3
  47. package/src/error-summary/ErrorSummaryTitle.tsx +2 -3
  48. package/src/exit-this-page/ExitThisPage.tsx +2 -3
  49. package/src/feedback/Feedback.tsx +2 -3
  50. package/src/fieldset/Fieldset.tsx +2 -3
  51. package/src/fieldset/FieldsetLegend.tsx +2 -3
  52. package/src/file-upload/FileUpload.tsx +3 -2
  53. package/src/footer/Footer.tsx +2 -3
  54. package/src/form-group/FormGroup.tsx +2 -3
  55. package/src/govuk-footer/GovukFooter.tsx +2 -3
  56. package/src/govuk-header/GovukHeader.tsx +3 -2
  57. package/src/header/Header.tsx +2 -3
  58. package/src/hint/Hint.tsx +2 -3
  59. package/src/index.ts +4 -0
  60. package/src/input/Input.tsx +5 -4
  61. package/src/input-label/InputLabel.tsx +2 -3
  62. package/src/inset-text/InsetText.tsx +2 -3
  63. package/src/label/Label.tsx +2 -3
  64. package/src/language-navigation/LanguageNavigation.tsx +2 -3
  65. package/src/language-navigation/LanguageNavigationItem.tsx +2 -3
  66. package/src/link/Link.tsx +2 -3
  67. package/src/list/List.tsx +2 -3
  68. package/src/list/ListItem.tsx +2 -3
  69. package/src/modal/Modal.tsx +53 -0
  70. package/src/modal/ModalBody.tsx +16 -0
  71. package/src/modal/ModalFooter.tsx +18 -0
  72. package/src/modal/ModalTitle.tsx +18 -0
  73. package/src/notification-banner/NotificationBanner.tsx +2 -3
  74. package/src/notification-banner/NotificationBannerContent.tsx +2 -3
  75. package/src/notification-banner/NotificationBannerHeader.tsx +2 -3
  76. package/src/notification-banner/NotificationBannerHeading.tsx +2 -3
  77. package/src/notification-banner/NotificationBannerTitle.tsx +2 -3
  78. package/src/pagination/Pagination.tsx +2 -3
  79. package/src/pagination/PaginationItem.tsx +2 -3
  80. package/src/pagination/PaginationList.tsx +2 -3
  81. package/src/pagination/PaginationNext.tsx +2 -3
  82. package/src/pagination/PaginationPrev.tsx +2 -3
  83. package/src/panel/Panel.tsx +2 -3
  84. package/src/panel/PanelActions.tsx +2 -3
  85. package/src/panel/PanelBody.tsx +2 -3
  86. package/src/panel/PanelTitle.tsx +2 -3
  87. package/src/password-input/PasswordInput.tsx +2 -3
  88. package/src/phase-banner/PhaseBanner.tsx +2 -3
  89. package/src/phase-banner/PhaseBannerText.tsx +2 -3
  90. package/src/radios/RadioConditional.tsx +2 -3
  91. package/src/radios/RadioDivider.tsx +1 -2
  92. package/src/radios/RadioInput.tsx +3 -2
  93. package/src/radios/RadioItem.tsx +2 -3
  94. package/src/radios/RadioLabel.tsx +2 -3
  95. package/src/radios/Radios.tsx +2 -3
  96. package/src/select/Select.tsx +2 -3
  97. package/src/select/SelectOption.tsx +2 -3
  98. package/src/service-navigation/ServiceNavigation.tsx +2 -3
  99. package/src/service-navigation/ServiceNavigationItem.tsx +2 -3
  100. package/src/side-nav/SideNav.tsx +2 -3
  101. package/src/side-nav/SideNavItem.tsx +2 -3
  102. package/src/side-nav/SideNavList.tsx +2 -3
  103. package/src/side-nav/SideNavSubnavHeading.tsx +2 -3
  104. package/src/side-nav/SideNavSubnavList.tsx +2 -3
  105. package/src/side-nav/SideNavTitle.tsx +2 -3
  106. package/src/skip-link/SkipLink.tsx +2 -3
  107. package/src/summary-card/SummaryCard.tsx +2 -3
  108. package/src/summary-card/SummaryCardAction.tsx +2 -3
  109. package/src/summary-card/SummaryCardActions.tsx +2 -3
  110. package/src/summary-card/SummaryCardContent.tsx +2 -3
  111. package/src/summary-card/SummaryCardTitle.tsx +2 -3
  112. package/src/summary-card/SummaryCardTitleWrapper.tsx +2 -3
  113. package/src/summary-list/SummaryList.tsx +2 -3
  114. package/src/summary-list/SummaryListActions.tsx +2 -3
  115. package/src/summary-list/SummaryListKey.tsx +2 -3
  116. package/src/summary-list/SummaryListRow.tsx +2 -3
  117. package/src/summary-list/SummaryListValue.tsx +2 -3
  118. package/src/table/Table.tsx +2 -3
  119. package/src/table/TableBody.tsx +2 -3
  120. package/src/table/TableCaption.tsx +2 -3
  121. package/src/table/TableCell.tsx +2 -3
  122. package/src/table/TableHead.tsx +2 -3
  123. package/src/table/TableHeader.tsx +2 -3
  124. package/src/table/TableRow.tsx +2 -3
  125. package/src/tabs/Tab.tsx +2 -3
  126. package/src/tabs/TabPanel.tsx +2 -3
  127. package/src/tabs/Tabs.tsx +2 -3
  128. package/src/tabs/TabsList.tsx +2 -3
  129. package/src/tabs/TabsTitle.tsx +2 -3
  130. package/src/tag/Tag.tsx +2 -3
  131. package/src/task-list/TaskList.tsx +2 -3
  132. package/src/task-list/TaskListHint.tsx +2 -3
  133. package/src/task-list/TaskListItem.tsx +2 -3
  134. package/src/task-list/TaskListLink.tsx +2 -3
  135. package/src/task-list/TaskListNameAndHint.tsx +2 -3
  136. package/src/task-list/TaskListStatus.tsx +2 -3
  137. package/src/textarea/Textarea.tsx +3 -2
  138. package/src/toggle/Toggle.tsx +3 -2
  139. package/src/toggle/ToggleItem.tsx +2 -3
  140. package/src/toggle/ToggleLabel.tsx +2 -3
  141. package/src/warning-text/WarningText.tsx +2 -3
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@i-dot-ai-npm/component-library-react",
3
- "version": "0.0.7",
4
- "description": "React components for i.AI GOV.UK (auto-generated from HTML specs).",
3
+ "version": "0.0.9",
4
+ "description": "React components for i.AI GOV.UK.",
5
5
  "type": "module",
6
+ "scripts": {
7
+ "typecheck": "tsc --noEmit"
8
+ },
6
9
  "exports": {
7
10
  ".": {
8
11
  "types": "./src/index.ts",
@@ -18,6 +21,7 @@
18
21
  "src"
19
22
  ],
20
23
  "peerDependencies": {
24
+ "@i-dot-ai-npm/component-library-frontend": ">=0.0.9",
21
25
  "govuk-frontend": ">=6",
22
26
  "react": ">=18",
23
27
  "react-dom": ">=18"
@@ -33,6 +37,10 @@
33
37
  },
34
38
  "license": "MIT",
35
39
  "devDependencies": {
36
- "govuk-frontend": "^6.5.0"
40
+ "@i-dot-ai-npm/component-library-frontend": "workspace:*",
41
+ "@types/react": "^19.3.0",
42
+ "govuk-frontend": "^6.5.0",
43
+ "react": "^19.3.0",
44
+ "typescript": "^5.9.3"
37
45
  }
38
46
  }
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { useEffect, useRef } from "react";
3
3
 
4
- type AccordionProps = {
4
+ type AccordionProps = ComponentPropsWithoutRef<'div'> & {
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function Accordion({ class: className, children, ...rest }: AccordionProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type AccordionSectionProps = {
3
+ type AccordionSectionProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function AccordionSection({ class: className, children, ...rest }: AccordionSectionProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type AccordionSectionContentProps = {
3
+ type AccordionSectionContentProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function AccordionSectionContent({ class: className, children, ...rest }: AccordionSectionContentProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type AccordionSectionHeaderProps = {
3
+ type AccordionSectionHeaderProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function AccordionSectionHeader({ class: className, children, ...rest }: AccordionSectionHeaderProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type AccordionSectionHeadingProps = {
3
+ type AccordionSectionHeadingProps = ComponentPropsWithoutRef<'span'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function AccordionSectionHeading({ class: className, children, ...rest }: AccordionSectionHeadingProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type AccordionSectionSummaryProps = {
3
+ type AccordionSectionSummaryProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function AccordionSectionSummary({ class: className, children, ...rest }: AccordionSectionSummaryProps) {
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type BackLinkProps = {
3
+ type BackLinkProps = ComponentPropsWithoutRef<'a'> & {
4
4
  inverse?: boolean;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function BackLink({ inverse, class: className, children, ...rest }: BackLinkProps) {
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type BreadcrumbItemProps = {
3
+ type BreadcrumbItemProps = ComponentPropsWithoutRef<'li'> & {
4
4
  href?: string;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function BreadcrumbItem({ href, class: className, children, ...rest }: BreadcrumbItemProps) {
@@ -1,11 +1,10 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type BreadcrumbsProps = {
3
+ type BreadcrumbsProps = ComponentPropsWithoutRef<'nav'> & {
4
4
  inverse?: boolean;
5
5
  collapseOnMobile?: boolean;
6
6
  class?: string;
7
7
  children?: ReactNode;
8
- [key: string]: unknown;
9
8
  };
10
9
 
11
10
  export default function Breadcrumbs({ inverse, collapseOnMobile, class: className, children, ...rest }: BreadcrumbsProps) {
@@ -1,6 +1,6 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ButtonProps = {
3
+ type ButtonProps = Omit<ComponentPropsWithoutRef<'a'> & ComponentPropsWithoutRef<'button'>, 'type' | 'href'> & {
4
4
  secondary?: boolean;
5
5
  tertiary?: boolean;
6
6
  warning?: boolean;
@@ -11,7 +11,6 @@ type ButtonProps = {
11
11
  type?: "button" | "reset" | "submit";
12
12
  class?: string;
13
13
  children?: ReactNode;
14
- [key: string]: unknown;
15
14
  };
16
15
 
17
16
  const StartIcon = () => (
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ButtonGroupProps = {
3
+ type ButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ButtonGroup({ class: className, children, ...rest }: ButtonGroupProps) {
package/src/card/Card.tsx CHANGED
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardProps = {
3
+ type CardProps = ComponentPropsWithoutRef<'div'> & {
4
4
  secondary?: boolean;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function Card({ secondary, class: className, children, ...rest }: CardProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardContentProps = {
3
+ type CardContentProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CardContent({ class: className, children, ...rest }: CardContentProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardGroupProps = {
3
+ type CardGroupProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CardGroup({ class: className, children, ...rest }: CardGroupProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardHeadingProps = {
3
+ type CardHeadingProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CardHeading({ class: className, children, ...rest }: CardHeadingProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardIconProps = {
3
+ type CardIconProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CardIcon({ class: className, children, ...rest }: CardIconProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CardLinkProps = {
3
+ type CardLinkProps = ComponentPropsWithoutRef<'a'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CardLink({ class: className, children, ...rest }: CardLinkProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CharacterCountProps = {
3
+ type CharacterCountProps = ComponentPropsWithoutRef<'textarea'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CharacterCount({ class: className, children, ...rest }: CharacterCountProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CharacterCountMessageProps = {
3
+ type CharacterCountMessageProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CharacterCountMessage({ class: className, children, ...rest }: CharacterCountMessageProps) {
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CheckboxConditionalProps = {
3
+ type CheckboxConditionalProps = ComponentPropsWithoutRef<'div'> & {
4
4
  hidden?: boolean;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function CheckboxConditional({ hidden = true, class: className, children, ...rest }: CheckboxConditionalProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
 
3
3
  type CheckboxDividerProps = {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CheckboxDivider({ class: className, children }: CheckboxDividerProps) {
@@ -1,6 +1,7 @@
1
- type CheckboxInputProps = {
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+
3
+ type CheckboxInputProps = ComponentPropsWithoutRef<'input'> & {
2
4
  class?: string;
3
- [key: string]: unknown;
4
5
  };
5
6
 
6
7
  export default function CheckboxInput({ class: className, ...rest }: CheckboxInputProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CheckboxItemProps = {
3
+ type CheckboxItemProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CheckboxItem({ class: className, children, ...rest }: CheckboxItemProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CheckboxLabelProps = {
3
+ type CheckboxLabelProps = ComponentPropsWithoutRef<'label'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CheckboxLabel({ class: className, children, ...rest }: CheckboxLabelProps) {
@@ -1,11 +1,10 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CheckboxesProps = {
3
+ type CheckboxesProps = ComponentPropsWithoutRef<'div'> & {
4
4
  small?: boolean;
5
5
  subtle?: boolean;
6
6
  class?: string;
7
7
  children?: ReactNode;
8
- [key: string]: unknown;
9
8
  };
10
9
 
11
10
  export default function Checkboxes({ small, subtle, class: className, children, ...rest }: CheckboxesProps) {
@@ -1,11 +1,10 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ContentsPanelProps = {
3
+ type ContentsPanelProps = ComponentPropsWithoutRef<'nav'> & {
4
4
  heading?: string;
5
5
  headingId?: string;
6
6
  class?: string;
7
7
  children?: ReactNode;
8
- [key: string]: unknown;
9
8
  };
10
9
 
11
10
  export default function ContentsPanel({
@@ -1,11 +1,10 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ContentsPanelItemProps = {
3
+ type ContentsPanelItemProps = ComponentPropsWithoutRef<'li'> & {
4
4
  href?: string;
5
5
  current?: boolean;
6
6
  class?: string;
7
7
  children?: ReactNode;
8
- [key: string]: unknown;
9
8
  };
10
9
 
11
10
  export default function ContentsPanelItem({
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ContentsPanelListProps = {
3
+ type ContentsPanelListProps = ComponentPropsWithoutRef<'ul'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ContentsPanelList({ class: className, children, ...rest }: ContentsPanelListProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ContentsPanelListHeadingProps = {
3
+ type ContentsPanelListHeadingProps = ComponentPropsWithoutRef<'h3'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ContentsPanelListHeading({ class: className, children, ...rest }: ContentsPanelListHeadingProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CookieBannerProps = {
3
+ type CookieBannerProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CookieBanner({ class: className, children, ...rest }: CookieBannerProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CookieBannerActionsProps = {
3
+ type CookieBannerActionsProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CookieBannerActions({ class: className, children, ...rest }: CookieBannerActionsProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CookieBannerContentProps = {
3
+ type CookieBannerContentProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CookieBannerContent({ class: className, children, ...rest }: CookieBannerContentProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CookieBannerHeadingProps = {
3
+ type CookieBannerHeadingProps = ComponentPropsWithoutRef<'h2'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CookieBannerHeading({ class: className, children, ...rest }: CookieBannerHeadingProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type CookieBannerMessageProps = {
3
+ type CookieBannerMessageProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function CookieBannerMessage({ class: className, children, ...rest }: CookieBannerMessageProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type DateInputProps = {
3
+ type DateInputProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function DateInput({ class: className, children, ...rest }: DateInputProps) {
@@ -1,13 +1,14 @@
1
- type DateInputFieldProps = {
2
- width?: "2" | "3" | "4";
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+
3
+ type DateInputFieldProps = Omit<ComponentPropsWithoutRef<'input'>, 'width'> & {
4
+ width?: 2 | 3 | 4;
3
5
  class?: string;
4
- [key: string]: unknown;
5
6
  };
6
7
 
7
8
  export default function DateInputField({ width, class: className, ...rest }: DateInputFieldProps) {
8
9
  const classes = [
9
10
  "govuk-input govuk-date-input__input",
10
- (width ? { "2": "govuk-input--width-2", "3": "govuk-input--width-3", "4": "govuk-input--width-4" }[width] : ""),
11
+ (width ? { 2: "govuk-input--width-2", 3: "govuk-input--width-3", 4: "govuk-input--width-4" }[width] : ""),
11
12
  className ?? "",
12
13
  ]
13
14
  .filter(Boolean)
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type DateInputItemProps = {
3
+ type DateInputItemProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function DateInputItem({ class: className, children, ...rest }: DateInputItemProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type DetailsProps = {
3
+ type DetailsProps = ComponentPropsWithoutRef<'details'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function Details({ class: className, children, ...rest }: DetailsProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type DetailsSummaryProps = {
3
+ type DetailsSummaryProps = ComponentPropsWithoutRef<'summary'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function DetailsSummary({ class: className, children, ...rest }: DetailsSummaryProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type DetailsTextProps = {
3
+ type DetailsTextProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function DetailsText({ class: className, children, ...rest }: DetailsTextProps) {
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ErrorMessageProps = {
3
+ type ErrorMessageProps = ComponentPropsWithoutRef<'p'> & {
4
4
  visuallyHiddenText?: string;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function ErrorMessage({ visuallyHiddenText = "Error", class: className, children, ...rest }: ErrorMessageProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ErrorSummaryProps = {
3
+ type ErrorSummaryProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ErrorSummary({ class: className, children, ...rest }: ErrorSummaryProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ErrorSummaryBodyProps = {
3
+ type ErrorSummaryBodyProps = ComponentPropsWithoutRef<'div'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ErrorSummaryBody({ class: className, children, ...rest }: ErrorSummaryBodyProps) {
@@ -1,10 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ErrorSummaryItemProps = {
3
+ type ErrorSummaryItemProps = ComponentPropsWithoutRef<'a'> & {
4
4
  href?: string;
5
5
  class?: string;
6
6
  children?: ReactNode;
7
- [key: string]: unknown;
8
7
  };
9
8
 
10
9
  export default function ErrorSummaryItem({ href, class: className, children, ...rest }: ErrorSummaryItemProps) {
@@ -1,9 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- type ErrorSummaryListProps = {
3
+ type ErrorSummaryListProps = ComponentPropsWithoutRef<'ul'> & {
4
4
  class?: string;
5
5
  children?: ReactNode;
6
- [key: string]: unknown;
7
6
  };
8
7
 
9
8
  export default function ErrorSummaryList({ class: className, children, ...rest }: ErrorSummaryListProps) {