From f671af53d9e21e241778ec20b9182cdb26964e8f Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Tue, 18 Apr 2023 21:22:37 +0200 Subject: [PATCH] chore(react-accordion): adopt custom JSX pragma (#27601) --- ...accordion-0886e6c0-bf89-457f-a6c6-d81ecd0afd83.json | 7 +++++++ packages/react-components/react-accordion/package.json | 1 + .../src/components/Accordion/renderAccordion.tsx | 10 +++++++--- .../AccordionHeader/renderAccordionHeader.tsx | 10 +++++++--- .../components/AccordionItem/renderAccordionItem.tsx | 10 +++++++--- .../components/AccordionPanel/renderAccordionPanel.tsx | 10 +++++++--- 6 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 change/@fluentui-react-accordion-0886e6c0-bf89-457f-a6c6-d81ecd0afd83.json diff --git a/change/@fluentui-react-accordion-0886e6c0-bf89-457f-a6c6-d81ecd0afd83.json b/change/@fluentui-react-accordion-0886e6c0-bf89-457f-a6c6-d81ecd0afd83.json new file mode 100644 index 00000000000000..6a7978816f1d5e --- /dev/null +++ b/change/@fluentui-react-accordion-0886e6c0-bf89-457f-a6c6-d81ecd0afd83.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "feat: adopt custom JSX pragma", + "packageName": "@fluentui/react-accordion", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-accordion/package.json b/packages/react-components/react-accordion/package.json index 40aa7974f46c00..4892f495b1f5ae 100644 --- a/packages/react-components/react-accordion/package.json +++ b/packages/react-components/react-accordion/package.json @@ -35,6 +35,7 @@ "@fluentui/react-aria": "^9.3.18", "@fluentui/react-context-selector": "^9.1.18", "@fluentui/react-icons": "^2.0.196", + "@fluentui/react-jsx-runtime": "9.0.0-alpha.1", "@fluentui/react-shared-contexts": "^9.3.3", "@fluentui/react-tabster": "^9.6.5", "@fluentui/react-theme": "^9.1.7", diff --git a/packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx b/packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx index 7e04c2e7583305..c2ee7bd559b1c4 100644 --- a/packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx +++ b/packages/react-components/react-accordion/src/components/Accordion/renderAccordion.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 { AccordionContext } from './AccordionContext'; import type { AccordionState, AccordionSlots, AccordionContextValues } from './Accordion.types'; @@ -8,7 +12,7 @@ import type { AccordionState, AccordionSlots, AccordionContextValues } from './A * Function that renders the final JSX of the component */ export const renderAccordion_unstable = (state: AccordionState, contextValues: AccordionContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx b/packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx index 7613332db1b678..937a1812bd1a30 100644 --- a/packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx +++ b/packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.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 { AccordionHeaderContext } from './AccordionHeaderContext'; import type { AccordionHeaderState, AccordionHeaderSlots, AccordionHeaderContextValues } from './AccordionHeader.types'; @@ -10,7 +14,7 @@ export const renderAccordionHeader_unstable = ( state: AccordionHeaderState, contextValues: AccordionHeaderContextValues, ) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-accordion/src/components/AccordionItem/renderAccordionItem.tsx b/packages/react-components/react-accordion/src/components/AccordionItem/renderAccordionItem.tsx index 0c65a6488aa1a2..659b3851ab40bc 100644 --- a/packages/react-components/react-accordion/src/components/AccordionItem/renderAccordionItem.tsx +++ b/packages/react-components/react-accordion/src/components/AccordionItem/renderAccordionItem.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 { AccordionItemContext } from './AccordionItemContext'; import type { AccordionItemState, AccordionItemSlots, AccordionItemContextValues } from './AccordionItem.types'; @@ -7,7 +11,7 @@ import type { AccordionItemState, AccordionItemSlots, AccordionItemContextValues * Function that renders the final JSX of the component */ export const renderAccordionItem_unstable = (state: AccordionItemState, contextValues: AccordionItemContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-accordion/src/components/AccordionPanel/renderAccordionPanel.tsx b/packages/react-components/react-accordion/src/components/AccordionPanel/renderAccordionPanel.tsx index 68e8818a9347a6..7a4ebb205f5ed2 100644 --- a/packages/react-components/react-accordion/src/components/AccordionPanel/renderAccordionPanel.tsx +++ b/packages/react-components/react-accordion/src/components/AccordionPanel/renderAccordionPanel.tsx @@ -1,11 +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 { AccordionPanelState, AccordionPanelSlots } from './AccordionPanel.types'; /** * Function that renders the final JSX of the component */ export const renderAccordionPanel_unstable = (state: AccordionPanelState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return state.open ? {slotProps.root.children} : null; };