-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(react-menu): adopt custom JSX pragma (#27544)
- Loading branch information
1 parent
0dfc7e1
commit 2dd9874
Showing
11 changed files
with
62 additions
and
27 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-menu-7f4bdd51-64d7-41a9-94c9-993823b00f5d.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "chore: adopt custom JSX pragma", | ||
"packageName": "@fluentui/react-menu", | ||
"email": "bernardo.sunderhus@gmail.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +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 { MenuDividerSlots, MenuDividerState } from './MenuDivider.types'; | ||
|
||
/** | ||
* Redefine the render function to add slots. Reuse the menudivider structure but add | ||
* slots to children. | ||
*/ | ||
export const renderMenuDivider_unstable = (state: MenuDividerState) => { | ||
const { slots, slotProps } = getSlots<MenuDividerSlots>(state); | ||
const { slots, slotProps } = getSlotsNext<MenuDividerSlots>(state); | ||
|
||
return <slots.root {...slotProps.root} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
...ages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +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 { MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader.types'; | ||
|
||
/** | ||
* Redefine the render function to add slots. Reuse the menugroupheader structure but add | ||
* slots to children. | ||
*/ | ||
export const renderMenuGroupHeader_unstable = (state: MenuGroupHeaderState) => { | ||
const { slots, slotProps } = getSlots<MenuGroupHeaderSlots>(state); | ||
const { slots, slotProps } = getSlotsNext<MenuGroupHeaderSlots>(state); | ||
|
||
return <slots.root {...slotProps.root} />; | ||
}; |
9 changes: 6 additions & 3 deletions
9
packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
...es/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
packages/react-components/react-menu/src/components/MenuPopover/renderMenuPopover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
packages/react-components/react-menu/src/components/MenuSplitGroup/renderMenuSplitGroup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<MenuSplitGroupSlots>(state); | ||
const { slots, slotProps } = getSlotsNext<MenuSplitGroupSlots>(state); | ||
|
||
return <slots.root {...slotProps.root} />; | ||
}; |