From 413226e5b2a48db725896169b6b302210b9c5656 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 12 Sep 2023 15:50:31 -0500 Subject: [PATCH 1/2] feat(drafts): add Column type and createColumnHelper to exports --- src/DataTable/index.ts | 2 ++ src/__tests__/__snapshots__/exports.test.ts.snap | 1 + src/drafts/index.ts | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) 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' From c77faed2d1e6880ca33d4989b09aa32341068869 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 12 Sep 2023 15:51:29 -0500 Subject: [PATCH 2/2] chore: add changeset --- .changeset/polite-hairs-switch.md | 7 +++++++ 1 file changed, 7 insertions(+) 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 + +