diff --git a/packages/react/src/Accordion/Accordion.tsx b/packages/react/src/Accordion/Accordion.tsx index 74d9366861..2f65c8ec27 100644 --- a/packages/react/src/Accordion/Accordion.tsx +++ b/packages/react/src/Accordion/Accordion.tsx @@ -10,7 +10,6 @@ import { ForwardRefExoticComponent, HTMLAttributes, PropsWithChildren, - ReactNode, RefAttributes, useImperativeHandle, useRef, @@ -20,16 +19,12 @@ import { AccordionSection } from './AccordionSection' import useFocusWithArrows from './useFocusWithArrows' import { HeadingLevel } from '../Heading/Heading' -export interface AccordionProps extends HTMLAttributes { - children?: ReactNode +export interface AccordionProps extends PropsWithChildren> { headingLevel: HeadingLevel section?: boolean } -export interface AccordionComponent - extends ForwardRefExoticComponent< - PropsWithChildren> & RefAttributes & AccordionProps - > { +export interface AccordionComponent extends ForwardRefExoticComponent> { Section: typeof AccordionSection } diff --git a/packages/react/src/Breadcrumb/Breadcrumb.tsx b/packages/react/src/Breadcrumb/Breadcrumb.tsx index 07cb4eeac9..4f91b8aedc 100644 --- a/packages/react/src/Breadcrumb/Breadcrumb.tsx +++ b/packages/react/src/Breadcrumb/Breadcrumb.tsx @@ -7,20 +7,19 @@ import { RefAttributes, } from 'react' -interface BreadcrumbComponent - extends ForwardRefExoticComponent> & RefAttributes> { +type BreadcrumbProps = PropsWithChildren> + +interface BreadcrumbComponent extends ForwardRefExoticComponent> { Item: typeof BreadcrumbItem } -export const Breadcrumb = forwardRef( - ({ children, ...restProps }: PropsWithChildren>, ref: ForwardedRef) => { - return ( - - ) - }, -) as BreadcrumbComponent +export const Breadcrumb = forwardRef(({ children, ...restProps }: BreadcrumbProps, ref: ForwardedRef) => { + return ( + + ) +}) as BreadcrumbComponent Breadcrumb.displayName = 'Breadcrumb' diff --git a/packages/react/src/Card/Card.tsx b/packages/react/src/Card/Card.tsx index fd924d12e0..1edfe6e855 100644 --- a/packages/react/src/Card/Card.tsx +++ b/packages/react/src/Card/Card.tsx @@ -45,10 +45,7 @@ CardLink.displayName = 'CardLink' export interface CardProps extends PropsWithChildren> {} -export interface CardComponent - extends ForwardRefExoticComponent< - PropsWithChildren> & RefAttributes & CardProps - > { +export interface CardComponent extends ForwardRefExoticComponent> { HeadingGroup: typeof CardHeadingGroup Link: typeof CardLink } diff --git a/packages/react/src/Footer/Footer.tsx b/packages/react/src/Footer/Footer.tsx index 6f02122815..64f2566625 100644 --- a/packages/react/src/Footer/Footer.tsx +++ b/packages/react/src/Footer/Footer.tsx @@ -40,17 +40,15 @@ export const FooterBottom = forwardRef( FooterBottom.displayName = 'FooterBottom' -interface FooterComponent - extends ForwardRefExoticComponent> & RefAttributes> { +type FooterProps = PropsWithChildren> + +interface FooterComponent extends ForwardRefExoticComponent> { Top: typeof FooterTop Bottom: typeof FooterBottom } export const Footer = forwardRef( - ( - { children, className, ...restProps }: PropsWithChildren>, - ref: ForwardedRef, - ) => ( + ({ children, className, ...restProps }: FooterProps, ref: ForwardedRef) => (