diff --git a/packages/react/src/components/Table/TableCell/BaseTableCell.tsx b/packages/react/src/components/Table/TableCell/BaseTableCell.tsx index 4eb3c8b4..2fff7654 100644 --- a/packages/react/src/components/Table/TableCell/BaseTableCell.tsx +++ b/packages/react/src/components/Table/TableCell/BaseTableCell.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { BaseTableCellProps } from './types'; +import { BaseTableCellProps } from '../types'; const css = { header: 'nds-table-cell__header', diff --git a/packages/react/src/components/Table/TableCell/TableCell.tsx b/packages/react/src/components/Table/TableCell/TableCell.tsx index 211f0293..02f73f48 100644 --- a/packages/react/src/components/Table/TableCell/TableCell.tsx +++ b/packages/react/src/components/Table/TableCell/TableCell.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { BaseTableCell } from './BaseTableCell'; import { SortingCellData, useSortingState } from '../ComposableTable/SortingContext'; -import { TableCellProps } from './types'; +import { TableCellProps } from '../types'; import { useHeaderFor } from '../ComposableTable/HeadersContext'; function getSiblingIndex(el: HTMLElement): number { diff --git a/packages/react/src/components/Table/TableCell/types.ts b/packages/react/src/components/Table/TableCell/types.ts deleted file mode 100644 index c7aee88c..00000000 --- a/packages/react/src/components/Table/TableCell/types.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { SortableValue } from '../types'; - -export interface BaseTableCellProps extends React.TableHTMLAttributes { - /** - * The content of the header that corresponds to this cell. - * This will only render in the XS breakpoint to give visual context - * to users. - */ - header?: React.ReactNode; -} - -export interface TableCellProps extends BaseTableCellProps { - /** - * Override or extend existing table style. - */ - className?: string; - - /** - * The value of the cell. - * In uncontrolled sorting the value is used to sort the column. If none is defined - * the text content of the cell is used as value. - */ - value?: SortableValue; -} diff --git a/packages/react/src/components/Table/index.ts b/packages/react/src/components/Table/index.ts new file mode 100644 index 00000000..76382536 --- /dev/null +++ b/packages/react/src/components/Table/index.ts @@ -0,0 +1,8 @@ +export * from './types'; + +export { Table } from './Table'; +export { TableHeader } from './TableHeader/TableHeader'; +export { TableHeaderCell } from './TableHeaderCell/TableHeaderCell'; +export { TableRow } from './TableRow/TableRow'; +export { TableBody } from './TableBody/TableBody'; +export { TableCell } from './TableCell/TableCell'; diff --git a/packages/react/src/components/Table/types.ts b/packages/react/src/components/Table/types.ts index 358ce9bb..0c0763d4 100644 --- a/packages/react/src/components/Table/types.ts +++ b/packages/react/src/components/Table/types.ts @@ -142,3 +142,26 @@ export interface TableRowProps extends React.TableHTMLAttributes { + /** + * The content of the header that corresponds to this cell. + * This will only render in the XS breakpoint to give visual context + * to users. + */ + header?: React.ReactNode; +} + +export interface TableCellProps extends BaseTableCellProps { + /** + * Override or extend existing table style. + */ + className?: string; + + /** + * The value of the cell. + * In uncontrolled sorting the value is used to sort the column. If none is defined + * the text content of the cell is used as value. + */ + value?: SortableValue; +} diff --git a/packages/react/src/components/index.ts b/packages/react/src/components/index.ts index d9eb9fed..ca8fb2e6 100644 --- a/packages/react/src/components/index.ts +++ b/packages/react/src/components/index.ts @@ -21,6 +21,7 @@ export * from './ResponseIndicator'; export * from './Spinner'; export * from './StepIndicator'; export * from './Switch'; +export * from './Table'; export * from './Tabs'; export * from './Tag'; export * from './TextField';