diff --git a/.changeset/polite-hairs-switch.md b/.changeset/polite-hairs-switch.md new file mode 100644 index 00000000000..a40ad3148c1 --- /dev/null +++ b/.changeset/polite-hairs-switch.md @@ -0,0 +1,7 @@ +--- +'@primer/react': minor +--- + +Add the Column type and createColumnHelper function to easily define columns for DataTable + + diff --git a/src/DataTable/index.ts b/src/DataTable/index.ts index 982608fc418..620df9a88f3 100644 --- a/src/DataTable/index.ts +++ b/src/DataTable/index.ts @@ -49,3 +49,5 @@ export type { TableActionsProps, TableSkeletonProps, } from './Table' +export {createColumnHelper} from './column' +export type {Column} from './column' diff --git a/src/__tests__/__snapshots__/exports.test.ts.snap b/src/__tests__/__snapshots__/exports.test.ts.snap index c47f8efcd96..2cf204be6c4 100644 --- a/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/src/__tests__/__snapshots__/exports.test.ts.snap @@ -156,6 +156,7 @@ exports[`@primer/react/drafts should not update exports without a semver change "TreeView", "UnderlineNav", "callbackCancelledResult", + "createColumnHelper", "useCombobox", "useDynamicTextareaHeight", "useIgnoreKeyboardActionsWhileComposing", diff --git a/src/drafts/index.ts b/src/drafts/index.ts index 42e58458551..c58163e46eb 100644 --- a/src/drafts/index.ts +++ b/src/drafts/index.ts @@ -9,7 +9,7 @@ export {Blankslate} from '../Blankslate' export type {BlankslateProps} from '../Blankslate' -export {DataTable, Table} from '../DataTable' +export {DataTable, Table, createColumnHelper} from '../DataTable' export type { DataTableProps, TableProps, @@ -22,6 +22,7 @@ export type { TableTitleProps, TableSubtitleProps, TableActionsProps, + Column, } from '../DataTable' export * from '../Dialog/Dialog'