diff --git a/packages/react/src/components/ContainedList/ContainedList.tsx b/packages/react/src/components/ContainedList/ContainedList.tsx index 231d7bc5a6c1..b845f999f060 100644 --- a/packages/react/src/components/ContainedList/ContainedList.tsx +++ b/packages/react/src/components/ContainedList/ContainedList.tsx @@ -11,12 +11,17 @@ import classNames from 'classnames'; import { LayoutConstraint } from '../Layout'; import { useId } from '../../internal/useId'; import { usePrefix } from '../../internal/usePrefix'; +import ContainedListItem from './ContainedListItem'; const variants = ['on-page', 'disclosed'] as const; -type Variants = (typeof variants)[number]; +interface ContainedListType extends React.FC { + ContainedListItem: typeof ContainedListItem; +} + +export type Variants = (typeof variants)[number]; -interface ContainedListProps { +export interface ContainedListProps { /** * A slot for a possible interactive element to render. */ @@ -89,7 +94,7 @@ function renderChildren(children) { return children; } -const ContainedList: React.FC = ({ +const ContainedList: ContainedListType = ({ action, children, className, @@ -199,4 +204,5 @@ ContainedList.propTypes = { size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']), }; +ContainedList.ContainedListItem = ContainedListItem; export default ContainedList; diff --git a/packages/react/src/components/ContainedList/ContainedListItem/index.js b/packages/react/src/components/ContainedList/ContainedListItem/index.ts similarity index 100% rename from packages/react/src/components/ContainedList/ContainedListItem/index.js rename to packages/react/src/components/ContainedList/ContainedListItem/index.ts diff --git a/packages/react/src/components/ContainedList/index.js b/packages/react/src/components/ContainedList/index.ts similarity index 100% rename from packages/react/src/components/ContainedList/index.js rename to packages/react/src/components/ContainedList/index.ts