diff --git a/change/@fluentui-react-menu-7f4bdd51-64d7-41a9-94c9-993823b00f5d.json b/change/@fluentui-react-menu-7f4bdd51-64d7-41a9-94c9-993823b00f5d.json new file mode 100644 index 0000000000000..b66c87b07ccbc --- /dev/null +++ b/change/@fluentui-react-menu-7f4bdd51-64d7-41a9-94c9-993823b00f5d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: adopt custom JSX pragma", + "packageName": "@fluentui/react-menu", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-menu/package.json b/packages/react-components/react-menu/package.json index e7989e3ed2814..c805817b1ea03 100644 --- a/packages/react-components/react-menu/package.json +++ b/packages/react-components/react-menu/package.json @@ -45,6 +45,7 @@ "@fluentui/react-tabster": "^9.6.4", "@fluentui/react-theme": "^9.1.7", "@fluentui/react-utilities": "^9.7.4", + "@fluentui/react-jsx-runtime": "^9.0.0-alpha.0", "@griffel/react": "^1.5.2", "@swc/helpers": "^0.4.14" }, diff --git a/packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx b/packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx index b2fec3e80a788..9795114221466 100644 --- a/packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx +++ b/packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx @@ -1,5 +1,8 @@ -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 { MenuDividerSlots, MenuDividerState } from './MenuDivider.types'; /** @@ -7,7 +10,7 @@ import { MenuDividerSlots, MenuDividerState } from './MenuDivider.types'; * slots to children. */ export const renderMenuDivider_unstable = (state: MenuDividerState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-menu/src/components/MenuGroup/renderMenuGroup.tsx b/packages/react-components/react-menu/src/components/MenuGroup/renderMenuGroup.tsx index 2c48f57a209ce..0d8b3f998425a 100644 --- a/packages/react-components/react-menu/src/components/MenuGroup/renderMenuGroup.tsx +++ b/packages/react-components/react-menu/src/components/MenuGroup/renderMenuGroup.tsx @@ -1,5 +1,8 @@ -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 { MenuGroupContextValues, MenuGroupSlots, MenuGroupState } from './MenuGroup.types'; import { MenuGroupContextProvider } from '../../contexts/menuGroupContext'; @@ -8,7 +11,7 @@ import { MenuGroupContextProvider } from '../../contexts/menuGroupContext'; * slots to children. */ export const renderMenuGroup_unstable = (state: MenuGroupState, contextValues: MenuGroupContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx b/packages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx index d15412942219a..fee4d66a9aff6 100644 --- a/packages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx +++ b/packages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx @@ -1,5 +1,8 @@ -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 { MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader.types'; /** @@ -7,7 +10,7 @@ import { MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader.ty * slots to children. */ export const renderMenuGroupHeader_unstable = (state: MenuGroupHeaderState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; }; diff --git a/packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx b/packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx index 24ceb12bd0863..d4f743b48d552 100644 --- a/packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx +++ b/packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx @@ -1,12 +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 { MenuItemSlots, MenuItemState } from './MenuItem.types'; /** * Function that renders the final JSX of the component */ export const renderMenuItem_unstable = (state: MenuItemState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx b/packages/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx index 43f6ded91ca48..edb8753e7f1bf 100644 --- a/packages/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx +++ b/packages/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx @@ -1,11 +1,14 @@ -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 { MenuItemCheckboxState } from './MenuItemCheckbox.types'; import type { MenuItemSlots } from '../MenuItem/MenuItem.types'; /** Function that renders the final JSX of the component */ export const renderMenuItemCheckbox_unstable = (state: MenuItemCheckboxState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-menu/src/components/MenuItemRadio/renderMenuItemRadio.tsx b/packages/react-components/react-menu/src/components/MenuItemRadio/renderMenuItemRadio.tsx index 91cf42ac1db6f..2b6eb72c82302 100644 --- a/packages/react-components/react-menu/src/components/MenuItemRadio/renderMenuItemRadio.tsx +++ b/packages/react-components/react-menu/src/components/MenuItemRadio/renderMenuItemRadio.tsx @@ -1,5 +1,8 @@ -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 { MenuItemRadioState } from './MenuItemRadio.types'; import type { MenuItemSlots } from '../MenuItem/MenuItem.types'; @@ -8,7 +11,7 @@ import type { MenuItemSlots } from '../MenuItem/MenuItem.types'; * slots to children. */ export const renderMenuItemRadio_unstable = (state: MenuItemRadioState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx b/packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx index b3127613b0994..9eaf5f74ac009 100644 --- a/packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx +++ b/packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx @@ -1,5 +1,8 @@ -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 { MenuListContextValues, MenuListSlots, MenuListState } from './MenuList.types'; import { MenuListProvider } from '../../contexts/menuListContext'; @@ -7,7 +10,7 @@ import { MenuListProvider } from '../../contexts/menuListContext'; * Function that renders the final JSX of the component */ export const renderMenuList_unstable = (state: MenuListState, contextValues: MenuListContextValues) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ( diff --git a/packages/react-components/react-menu/src/components/MenuPopover/renderMenuPopover.tsx b/packages/react-components/react-menu/src/components/MenuPopover/renderMenuPopover.tsx index 6bfd0485b24a0..cb9aa66faf3f9 100644 --- a/packages/react-components/react-menu/src/components/MenuPopover/renderMenuPopover.tsx +++ b/packages/react-components/react-menu/src/components/MenuPopover/renderMenuPopover.tsx @@ -1,5 +1,8 @@ -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 { MenuPopoverSlots, MenuPopoverState } from './MenuPopover.types'; import { Portal } from '@fluentui/react-portal'; @@ -7,7 +10,7 @@ import { Portal } from '@fluentui/react-portal'; * Render the final JSX of MenuPopover */ export const renderMenuPopover_unstable = (state: MenuPopoverState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); if (state.inline) { return ; diff --git a/packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx b/packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx index 4575318928f2a..8ab8854ebb731 100644 --- a/packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx +++ b/packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx @@ -1,12 +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 { MenuSplitGroupState, MenuSplitGroupSlots } from './MenuSplitGroup.types'; /** * Render the final JSX of MenuSplitGroup */ export const renderMenuSplitGroup_unstable = (state: MenuSplitGroupState) => { - const { slots, slotProps } = getSlots(state); + const { slots, slotProps } = getSlotsNext(state); return ; };