Skip to content

Commit

Permalink
feat(containedlist): added index.ts file for type generation (carbon-…
Browse files Browse the repository at this point in the history
…design-system#16302)

* feat(containedlist): added index.ts file for type generation

* Update packages/react/src/components/ContainedList/ContainedList.tsx

---------

Co-authored-by: Taylor Jones <[email protected]>
  • Loading branch information
Gururajj77 and tay1orjones authored May 9, 2024
1 parent 00bbf9e commit e70f08d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/react/src/components/ContainedList/ContainedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContainedListProps> {
ContainedListItem: typeof ContainedListItem;
}

export type Variants = (typeof variants)[number];

interface ContainedListProps {
export interface ContainedListProps {
/**
* A slot for a possible interactive element to render.
*/
Expand Down Expand Up @@ -89,7 +94,7 @@ function renderChildren(children) {
return children;
}

const ContainedList: React.FC<ContainedListProps> = ({
const ContainedList: ContainedListType = ({
action,
children,
className,
Expand Down Expand Up @@ -199,4 +204,5 @@ ContainedList.propTypes = {
size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
};

ContainedList.ContainedListItem = ContainedListItem;
export default ContainedList;

0 comments on commit e70f08d

Please sign in to comment.