From b90e547639a7a906ef21cbf1a1c702c3d92210bc Mon Sep 17 00:00:00 2001 From: Josh Black Date: Wed, 13 Sep 2023 10:12:29 -0500 Subject: [PATCH] feat(drafts): add Column type and createColumnHelper to exports (#3739) * feat(drafts): add Column type and createColumnHelper to exports * chore: add changeset --------- Co-authored-by: Josh Black --- .changeset/polite-hairs-switch.md | 7 +++++++ src/DataTable/index.ts | 2 ++ src/__tests__/__snapshots__/exports.test.ts.snap | 1 + src/drafts/index.ts | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/polite-hairs-switch.md 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'