diff --git a/change/@fluentui-react-components-430535e4-3f7f-445c-a584-0b68cd1de4e3.json b/change/@fluentui-react-components-430535e4-3f7f-445c-a584-0b68cd1de4e3.json new file mode 100644 index 0000000000000..71e99e9826b46 --- /dev/null +++ b/change/@fluentui-react-components-430535e4-3f7f-445c-a584-0b68cd1de4e3.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "feat: export react-table logic hooks", + "packageName": "@fluentui/react-components", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-components/etc/react-components.unstable.api.md b/packages/react-components/react-components/etc/react-components.unstable.api.md index 969cf8c038820..554961004c46c 100644 --- a/packages/react-components/react-components/etc/react-components.unstable.api.md +++ b/packages/react-components/react-components/etc/react-components.unstable.api.md @@ -50,6 +50,8 @@ import { CardState } from '@fluentui/react-card'; import { CheckboxField } from '@fluentui/react-field'; import { checkboxFieldClassNames } from '@fluentui/react-field'; import { CheckboxFieldProps } from '@fluentui/react-field'; +import { ColumnDefinition } from '@fluentui/react-table'; +import { ColumnId } from '@fluentui/react-table'; import { Combobox } from '@fluentui/react-combobox'; import { comboboxClassNames } from '@fluentui/react-combobox'; import { ComboboxContextValues } from '@fluentui/react-combobox'; @@ -143,6 +145,8 @@ import { renderTableHeaderCell_unstable } from '@fluentui/react-table'; import { renderTableRow_unstable } from '@fluentui/react-table'; import { renderTableSelectionCell_unstable } from '@fluentui/react-table'; import { renderToolbar_unstable } from '@fluentui/react-toolbar'; +import { RowId } from '@fluentui/react-table'; +import { RowState } from '@fluentui/react-table'; import { Select } from '@fluentui/react-select'; import { selectClassNames } from '@fluentui/react-select'; import { SelectField } from '@fluentui/react-field'; @@ -210,8 +214,11 @@ import { tableSelectionCellClassNames } from '@fluentui/react-table'; import { TableSelectionCellProps } from '@fluentui/react-table'; import { TableSelectionCellSlots } from '@fluentui/react-table'; import { TableSelectionCellState } from '@fluentui/react-table'; +import { TableSelectionState } from '@fluentui/react-table'; import { TableSlots } from '@fluentui/react-table'; +import { TableSortState } from '@fluentui/react-table'; import { TableState } from '@fluentui/react-table'; +import { TableStatePlugin } from '@fluentui/react-table'; import { TextareaField } from '@fluentui/react-field'; import { textareaFieldClassNames } from '@fluentui/react-field'; import { TextareaFieldProps } from '@fluentui/react-field'; @@ -268,7 +275,10 @@ import { usePersonaStyles_unstable } from '@fluentui/react-persona'; import { useProgress_unstable } from '@fluentui/react-progress'; import { useProgressStyles_unstable } from '@fluentui/react-progress'; import { useSelect_unstable } from '@fluentui/react-select'; +import { useSelection } from '@fluentui/react-table'; import { useSelectStyles_unstable } from '@fluentui/react-select'; +import { useSort } from '@fluentui/react-table'; +import { useTable } from '@fluentui/react-table'; import { useTable_unstable } from '@fluentui/react-table'; import { useTableBody_unstable } from '@fluentui/react-table'; import { useTableBodyStyles_unstable } from '@fluentui/react-table'; @@ -283,6 +293,7 @@ import { useTableHeader_unstable } from '@fluentui/react-table'; import { useTableHeaderCell_unstable } from '@fluentui/react-table'; import { useTableHeaderCellStyles_unstable } from '@fluentui/react-table'; import { useTableHeaderStyles_unstable } from '@fluentui/react-table'; +import { UseTableOptions } from '@fluentui/react-table'; import { useTableRow_unstable } from '@fluentui/react-table'; import { useTableRowStyles_unstable } from '@fluentui/react-table'; import { useTableSelectionCell_unstable } from '@fluentui/react-table'; @@ -384,6 +395,10 @@ export { checkboxFieldClassNames } export { CheckboxFieldProps } +export { ColumnDefinition } + +export { ColumnId } + export { Combobox } export { comboboxClassNames } @@ -570,6 +585,10 @@ export { renderTableSelectionCell_unstable } export { renderToolbar_unstable } +export { RowId } + +export { RowState } + export { Select } export { selectClassNames } @@ -704,10 +723,17 @@ export { TableSelectionCellSlots } export { TableSelectionCellState } +export { TableSelectionState } + export { TableSlots } +export { TableSortState } + +export { TableState as HeadlessTableState } export { TableState } +export { TableStatePlugin } + export { TextareaField } export { textareaFieldClassNames } @@ -820,8 +846,14 @@ export { useProgressStyles_unstable } export { useSelect_unstable } +export { useSelection } + export { useSelectStyles_unstable } +export { useSort } + +export { useTable } + export { useTable_unstable } export { useTableBody_unstable } @@ -850,6 +882,8 @@ export { useTableHeaderCellStyles_unstable } export { useTableHeaderStyles_unstable } +export { UseTableOptions } + export { useTableRow_unstable } export { useTableRowStyles_unstable } diff --git a/packages/react-components/react-components/src/unstable/index.ts b/packages/react-components/react-components/src/unstable/index.ts index e2c29df303d56..da3b89540619c 100644 --- a/packages/react-components/react-components/src/unstable/index.ts +++ b/packages/react-components/react-components/src/unstable/index.ts @@ -232,7 +232,11 @@ export { useTableCellLayoutStyles_unstable, renderTableCellLayout_unstable, tableCellLayoutClassNames, + useTable, + useSelection, + useSort, } from '@fluentui/react-table'; + export type { SortDirection, TableHeaderCellProps, @@ -261,6 +265,15 @@ export type { TableCellActionsProps, TableCellActionsState, TableCellActionsSlots, + UseTableOptions, + TableState as HeadlessTableState, + TableSelectionState, + TableSortState, + TableStatePlugin, + RowState, + RowId, + ColumnDefinition, + ColumnId, } from '@fluentui/react-table'; export {