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..10aff7539c075f 100644 --- a/packages/react-components/react-accordion/package.json +++ b/packages/react-components/react-accordion/package.json @@ -39,6 +39,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-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; };