diff --git a/change/@fluentui-react-table-d5632f83-3b3d-4361-80f7-a4af77760493.json b/change/@fluentui-react-table-d5632f83-3b3d-4361-80f7-a4af77760493.json new file mode 100644 index 0000000000000..2c428c4a83dda --- /dev/null +++ b/change/@fluentui-react-table-d5632f83-3b3d-4361-80f7-a4af77760493.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: adopt custom JSX pragma", + "packageName": "@fluentui/react-table", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-table/package.json b/packages/react-components/react-table/package.json index d4a1165e6f5b0..657580af14016 100644 --- a/packages/react-components/react-table/package.json +++ b/packages/react-components/react-table/package.json @@ -43,6 +43,7 @@ "@fluentui/react-tabster": "^9.6.4", "@fluentui/react-theme": "^9.1.7", "@fluentui/react-utilities": "^9.7.4", + "@fluentui/react-jsx-runtime": "^9.0.0-alpha.0", "@griffel/react": "^1.5.2", "@swc/helpers": "^0.4.14" }, diff --git a/packages/react-components/react-table/src/components/DataGridBody/renderDataGridBody.tsx b/packages/react-components/react-table/src/components/DataGridBody/renderDataGridBody.tsx index bbb959b452e07..0f6f992b96043 100644 --- a/packages/react-components/react-table/src/components/DataGridBody/renderDataGridBody.tsx +++ b/packages/react-components/react-table/src/components/DataGridBody/renderDataGridBody.tsx @@ -1,5 +1,8 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { DataGridBodyState, DataGridBodySlots } from './DataGridBody.types'; import { TableRowIdContextProvider } from '../../contexts/rowIdContext'; @@ -7,7 +10,7 @@ import { TableRowIdContextProvider } from '../../contexts/rowIdContext'; * Render the final JSX of DataGridBody */ export const renderDataGridBody_unstable = (state: DataGridBodyState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx b/packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx index 2d8e4e4e52137..09be3fc392a6b 100644 --- a/packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx +++ b/packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx @@ -1,5 +1,8 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { DataGridRowState, DataGridRowSlots } from './DataGridRow.types'; import { ColumnIdContextProvider } from '../../contexts/columnIdContext'; @@ -7,7 +10,7 @@ import { ColumnIdContextProvider } from '../../contexts/columnIdContext'; * Render the final JSX of DataGridRow */ export const renderDataGridRow_unstable = (state: DataGridRowState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/Table/renderTable.tsx b/packages/react-components/react-table/src/components/Table/renderTable.tsx index ac68a7e4e772b..c5a38e6620f75 100644 --- a/packages/react-components/react-table/src/components/Table/renderTable.tsx +++ b/packages/react-components/react-table/src/components/Table/renderTable.tsx @@ -1,5 +1,8 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableState, TableSlots, TableContextValues } from './Table.types'; import { TableContextProvider } from '../../contexts/tableContext'; @@ -7,7 +10,7 @@ import { TableContextProvider } from '../../contexts/tableContext'; * Render the final JSX of Table */ export const renderTable_unstable = (state: TableState, contextValues: TableContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/TableBody/renderTableBody.tsx b/packages/react-components/react-table/src/components/TableBody/renderTableBody.tsx index 4a956ca6a0803..ac46024dd2192 100644 --- a/packages/react-components/react-table/src/components/TableBody/renderTableBody.tsx +++ b/packages/react-components/react-table/src/components/TableBody/renderTableBody.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableBodyState, TableBodySlots } from './TableBody.types'; /** * Render the final JSX of TableBody */ export const renderTableBody_unstable = (state: TableBodyState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-table/src/components/TableCell/renderTableCell.tsx b/packages/react-components/react-table/src/components/TableCell/renderTableCell.tsx index 308a9675c3b25..debecc9482327 100644 --- a/packages/react-components/react-table/src/components/TableCell/renderTableCell.tsx +++ b/packages/react-components/react-table/src/components/TableCell/renderTableCell.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableCellState, TableCellSlots } from './TableCell.types'; /** * Render the final JSX of TableCell */ export const renderTableCell_unstable = (state: TableCellState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-table/src/components/TableCellActions/renderTableCellActions.tsx b/packages/react-components/react-table/src/components/TableCellActions/renderTableCellActions.tsx index dbc8dc6130760..ebe801072ab99 100644 --- a/packages/react-components/react-table/src/components/TableCellActions/renderTableCellActions.tsx +++ b/packages/react-components/react-table/src/components/TableCellActions/renderTableCellActions.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableCellActionsState, TableCellActionsSlots } from './TableCellActions.types'; /** * Render the final JSX of TableCellActions */ export const renderTableCellActions_unstable = (state: TableCellActionsState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-table/src/components/TableCellLayout/renderTableCellLayout.tsx b/packages/react-components/react-table/src/components/TableCellLayout/renderTableCellLayout.tsx index d694f1ba11fc4..41f2b28315123 100644 --- a/packages/react-components/react-table/src/components/TableCellLayout/renderTableCellLayout.tsx +++ b/packages/react-components/react-table/src/components/TableCellLayout/renderTableCellLayout.tsx @@ -1,5 +1,8 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import { AvatarContextProvider } from '@fluentui/react-avatar'; import type { TableCellLayoutState, TableCellLayoutSlots, TableCellLayoutContextValues } from './TableCellLayout.types'; @@ -10,7 +13,7 @@ export const renderTableCellLayout_unstable = ( state: TableCellLayoutState, contextValues: TableCellLayoutContextValues, ) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx b/packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx index 6bb17e22bb915..c6620a57760ba 100644 --- a/packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx +++ b/packages/react-components/react-table/src/components/TableHeader/renderTableHeader.tsx @@ -1,5 +1,8 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import { TableHeaderContextProvider } from '../../contexts/tableHeaderContext'; import type { TableHeaderState, TableHeaderSlots } from './TableHeader.types'; @@ -7,7 +10,7 @@ import type { TableHeaderState, TableHeaderSlots } from './TableHeader.types'; * Render the final JSX of TableHeader */ export const renderTableHeader_unstable = (state: TableHeaderState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx b/packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx index 8c51b0c7425a4..3228cf041f67f 100644 --- a/packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx +++ b/packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableHeaderCellState, TableHeaderCellSlots } from './TableHeaderCell.types'; /** * Render the final JSX of TableHeaderCell */ export const renderTableHeaderCell_unstable = (state: TableHeaderCellState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx b/packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx index 2568e0f96d9d5..6c47997d7ab8b 100644 --- a/packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx +++ b/packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx @@ -1,11 +1,14 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableResizeHandleState, TableResizeHandleSlots } from './TableResizeHandle.types'; /** * Render the final JSX of TableResizeHandle */ export const renderTableResizeHandle_unstable = (state: TableResizeHandleState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx b/packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx index d89b87d07b55c..3c2741e92ff07 100644 --- a/packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx +++ b/packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableRowState, TableRowSlots } from './TableRow.types'; /** * Render the final JSX of TableRow */ export const renderTableRow_unstable = (state: TableRowState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx b/packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx index 1d6bbce7ecf9c..1face2eeaf8e1 100644 --- a/packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx +++ b/packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx @@ -1,12 +1,15 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; +import { getSlotsNext } from '@fluentui/react-utilities'; import type { TableSelectionCellState, TableSelectionCellSlots } from './TableSelectionCell.types'; /** * Render the final JSX of TableSelectionCell */ export const renderTableSelectionCell_unstable = (state: TableSelectionCellState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return (