From 2c2438a98002403210039275ce54f94367f2b3fe Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Tue, 18 Apr 2023 16:48:49 +0200 Subject: [PATCH] chore(react-card): adopt custom JSX pragma (#27606) --- ...eact-card-9dbc7783-9c6c-4b60-b30d-bf7684587328.json | 7 +++++++ packages/react-components/react-card/package.json | 1 + .../react-card/src/components/Card/renderCard.tsx | 10 +++++++--- .../src/components/CardFooter/renderCardFooter.tsx | 10 +++++++--- .../src/components/CardHeader/renderCardHeader.tsx | 10 +++++++--- .../src/components/CardPreview/renderCardPreview.tsx | 10 +++++++--- 6 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 change/@fluentui-react-card-9dbc7783-9c6c-4b60-b30d-bf7684587328.json diff --git a/change/@fluentui-react-card-9dbc7783-9c6c-4b60-b30d-bf7684587328.json b/change/@fluentui-react-card-9dbc7783-9c6c-4b60-b30d-bf7684587328.json new file mode 100644 index 00000000000000..06a6a72280f623 --- /dev/null +++ b/change/@fluentui-react-card-9dbc7783-9c6c-4b60-b30d-bf7684587328.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: adopt custom JSX pragma", + "packageName": "@fluentui/react-card", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-card/package.json b/packages/react-components/react-card/package.json index f12d3001d262e3..22f6e510166734 100644 --- a/packages/react-components/react-card/package.json +++ b/packages/react-components/react-card/package.json @@ -41,6 +41,7 @@ "@fluentui/react-tabster": "^9.6.5", "@fluentui/react-theme": "^9.1.7", "@fluentui/react-utilities": "^9.8.0", + "@fluentui/react-jsx-runtime": "9.0.0-alpha.1", "@griffel/react": "^1.5.2", "@swc/helpers": "^0.4.14" }, diff --git a/packages/react-components/react-card/src/components/Card/renderCard.tsx b/packages/react-components/react-card/src/components/Card/renderCard.tsx index e934d7567b9028..82efe6a178a756 100644 --- a/packages/react-components/react-card/src/components/Card/renderCard.tsx +++ b/packages/react-components/react-card/src/components/Card/renderCard.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 { CardContextValue, CardSlots, CardState } from './Card.types'; import { CardProvider } from './CardContext'; @@ -7,7 +11,7 @@ import { CardProvider } from './CardContext'; * Render the final JSX of Card. */ export const renderCard_unstable = (state: CardState, cardContextValue: CardContextValue) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-card/src/components/CardFooter/renderCardFooter.tsx b/packages/react-components/react-card/src/components/CardFooter/renderCardFooter.tsx index 129e9ba10dc95a..2e002dbc7ec8d7 100644 --- a/packages/react-components/react-card/src/components/CardFooter/renderCardFooter.tsx +++ b/packages/react-components/react-card/src/components/CardFooter/renderCardFooter.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 { CardFooterSlots, CardFooterState } from './CardFooter.types'; /** * Render the final JSX of CardFooter. */ export const renderCardFooter_unstable = (state: CardFooterState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-card/src/components/CardHeader/renderCardHeader.tsx b/packages/react-components/react-card/src/components/CardHeader/renderCardHeader.tsx index 46649f68fc4968..50df7c35a3236c 100644 --- a/packages/react-components/react-card/src/components/CardHeader/renderCardHeader.tsx +++ b/packages/react-components/react-card/src/components/CardHeader/renderCardHeader.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 { CardHeaderSlots, CardHeaderState } from './CardHeader.types'; /** * Render the final JSX of CardHeader. */ export const renderCardHeader_unstable = (state: CardHeaderState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-card/src/components/CardPreview/renderCardPreview.tsx b/packages/react-components/react-card/src/components/CardPreview/renderCardPreview.tsx index f85b88f18e66c7..ce7491ba7af4da 100644 --- a/packages/react-components/react-card/src/components/CardPreview/renderCardPreview.tsx +++ b/packages/react-components/react-card/src/components/CardPreview/renderCardPreview.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 { CardPreviewSlots, CardPreviewState } from './CardPreview.types'; /** * Render the final JSX of CardPreview. */ export const renderCardPreview_unstable = (state: CardPreviewState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return (