Skip to content

Commit

Permalink
chore(react-dialog): adopts custom JSX pragma (#27475)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus authored Apr 15, 2023
1 parent eefbbb3 commit 46c89e8
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: adopts custom JSX pragma",
"packageName": "@fluentui/react-dialog",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react-components/react-dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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<DialogActionsSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogActionsSlots>(state);

// TODO Add additional slots in the appropriate place
return <slots.root {...slotProps.root} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DialogBodySlots>(state);
const { slots, slotProps } = getSlotsNext<DialogBodySlots>(state);

// TODO Add additional slots in the appropriate place
return <slots.root {...slotProps.root} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DialogContentSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogContentSlots>(state);

return <slots.root {...slotProps.root} />;
};
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<DialogSurfaceSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogSurfaceSlots>(state);

return (
<Portal>
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DialogTitleSlots>(state);
const { slots, slotProps } = getSlotsNext<DialogTitleSlots>(state);

return (
<>
Expand Down

0 comments on commit 46c89e8

Please sign in to comment.