diff --git a/change/@fluentui-react-dialog-5fee8f81-b41f-4655-a1c6-5dd45a7c336e.json b/change/@fluentui-react-dialog-5fee8f81-b41f-4655-a1c6-5dd45a7c336e.json new file mode 100644 index 00000000000000..dedbde25c905a4 --- /dev/null +++ b/change/@fluentui-react-dialog-5fee8f81-b41f-4655-a1c6-5dd45a7c336e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: adopts custom JSX pragma", + "packageName": "@fluentui/react-dialog", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-dialog/package.json b/packages/react-components/react-dialog/package.json index d197ee00ee6aa1..9403de25d8c6b8 100644 --- a/packages/react-components/react-dialog/package.json +++ b/packages/react-components/react-dialog/package.json @@ -37,6 +37,7 @@ "dependencies": { "@griffel/react": "^1.5.2", "@fluentui/react-utilities": "^9.7.4", + "@fluentui/react-jsx-runtime": "^9.0.0-alpha.0", "@fluentui/keyboard-keys": "^9.0.2", "@fluentui/react-context-selector": "^9.1.17", "@fluentui/react-shared-contexts": "^9.3.3", diff --git a/packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx b/packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx index 5429255accfb5e..320a9b1d2231ab 100644 --- a/packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx +++ b/packages/react-components/react-dialog/src/components/Dialog/renderDialog.tsx @@ -1,4 +1,8 @@ -import * as React from 'react'; +/** @jsxRuntime classic */ +/** @jsx createElement */ + +import { createElement } from '@fluentui/react-jsx-runtime'; + import { DialogProvider, DialogSurfaceProvider } from '../../contexts'; import type { DialogState, DialogContextValues } from './Dialog.types'; diff --git a/packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx b/packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx index edc1d553f7820d..570ad41b87a276 100644 --- a/packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx +++ b/packages/react-components/react-dialog/src/components/DialogActions/renderDialogActions.tsx @@ -1,12 +1,16 @@ -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 { DialogActionsState, DialogActionsSlots } from './DialogActions.types'; /** * Render the final JSX of DialogActions */ export const renderDialogActions_unstable = (state: DialogActionsState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); // TODO Add additional slots in the appropriate place return ; diff --git a/packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx b/packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx index 22d43bee81226b..df955d0229de25 100644 --- a/packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx +++ b/packages/react-components/react-dialog/src/components/DialogBody/renderDialogBody.tsx @@ -1,12 +1,16 @@ -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 { DialogBodyState, DialogBodySlots } from './DialogBody.types'; /** * Render the final JSX of DialogBody */ export const renderDialogBody_unstable = (state: DialogBodyState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); // TODO Add additional slots in the appropriate place return ; diff --git a/packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx b/packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx index 56ef46582797d8..b437f88c95efb1 100644 --- a/packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx +++ b/packages/react-components/react-dialog/src/components/DialogContent/renderDialogContent.tsx @@ -1,12 +1,16 @@ -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 { DialogContentState, DialogContentSlots } from './DialogContent.types'; /** * Render the final JSX of DialogContent */ export const renderDialogContent_unstable = (state: DialogContentState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx b/packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx index eca49f7ae801c0..76721af33f01a8 100644 --- a/packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx +++ b/packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx @@ -1,5 +1,9 @@ -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 { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types'; import { DialogSurfaceProvider } from '../../contexts'; import { Portal } from '@fluentui/react-portal'; @@ -8,7 +12,7 @@ import { Portal } from '@fluentui/react-portal'; * Render the final JSX of DialogSurface */ export const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx b/packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx index dfde817700f03c..bc592e6091c3b5 100644 --- a/packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx +++ b/packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx @@ -1,12 +1,17 @@ -import * as React from 'react'; -import { getSlots } from '@fluentui/react-utilities'; +/** @jsxRuntime classic */ +/** @jsxFrag Fragment */ +/** @jsx createElement */ + +import { createElement, Fragment } from '@fluentui/react-jsx-runtime'; + +import { getSlotsNext } from '@fluentui/react-utilities'; import type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types'; /** * Render the final JSX of DialogTitle */ export const renderDialogTitle_unstable = (state: DialogTitleState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( <>