From bed143e20c0cd721b707f4e09187046e662613a5 Mon Sep 17 00:00:00 2001 From: Dmytro Kirpa Date: Sat, 22 Aug 2026 13:04:43 +0200 Subject: [PATCH] fix(react-headless-components-preview): use global focusgroup typing for MenuListState MenuListState locally intersected the base state with '{ root: { focusgroup?: string } }' to type the attribute set in useMenuList. The repo-wide 'typings/focusgroup' augmentation already adds a strongly typed 'focusgroup' to React's HTMLAttributes, so the local override was redundant, weaker (plain string), and forced the base type to be re-exported under an alias in the public API. Re-export MenuListState directly from '@fluentui/react-menu'. --- ...components-preview-menulist-focusgroup-typing.json | 7 +++++++ .../library/etc/menu.api.md | 11 +++-------- .../src/components/Menu/MenuList/MenuList.types.ts | 9 +-------- 3 files changed, 11 insertions(+), 16 deletions(-) create mode 100644 change/@fluentui-react-headless-components-preview-menulist-focusgroup-typing.json diff --git a/change/@fluentui-react-headless-components-preview-menulist-focusgroup-typing.json b/change/@fluentui-react-headless-components-preview-menulist-focusgroup-typing.json new file mode 100644 index 00000000000000..9e989e697949fc --- /dev/null +++ b/change/@fluentui-react-headless-components-preview-menulist-focusgroup-typing.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: use global focusgroup typing for MenuListState instead of a local intersection", + "packageName": "@fluentui/react-headless-components-preview", + "email": "dmytrokirpa@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-headless-components-preview/library/etc/menu.api.md b/packages/react-components/react-headless-components-preview/library/etc/menu.api.md index 29c80e887958dd..7b92a58d0ab325 100644 --- a/packages/react-components/react-headless-components-preview/library/etc/menu.api.md +++ b/packages/react-components/react-headless-components-preview/library/etc/menu.api.md @@ -35,7 +35,7 @@ import { MenuItemSwitchState } from '@fluentui/react-menu'; import type { MenuListContextValues } from '@fluentui/react-menu'; import { MenuListProps } from '@fluentui/react-menu'; import { MenuListSlots } from '@fluentui/react-menu'; -import type { MenuListState as MenuListState_2 } from '@fluentui/react-menu'; +import { MenuListState } from '@fluentui/react-menu'; import { MenuOpenChangeData } from '@fluentui/react-menu'; import { MenuOpenEvent } from '@fluentui/react-menu'; import { MenuPopoverProps } from '@fluentui/react-menu'; @@ -166,12 +166,7 @@ export { MenuListProps } export { MenuListSlots } -// @public (undocumented) -export type MenuListState = MenuListState_2 & { - root: { - focusgroup?: string; - }; -}; +export { MenuListState } export { MenuOpenChangeData } @@ -228,7 +223,7 @@ export { renderMenuItemRadio } export { renderMenuItemSwitch } // @public (undocumented) -export const renderMenuList: (state: MenuListState_2, contextValues: MenuListContextValues) => JSXElement; +export const renderMenuList: (state: MenuListState, contextValues: MenuListContextValues) => JSXElement; // @public (undocumented) export const renderMenuPopover: (state: MenuPopoverState) => JSXElement; diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Menu/MenuList/MenuList.types.ts b/packages/react-components/react-headless-components-preview/library/src/components/Menu/MenuList/MenuList.types.ts index 52088893be8602..b5556ceb0477d4 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Menu/MenuList/MenuList.types.ts +++ b/packages/react-components/react-headless-components-preview/library/src/components/Menu/MenuList/MenuList.types.ts @@ -1,14 +1,7 @@ -import type { MenuListState as MenuListBaseState } from '@fluentui/react-menu'; - export type { + MenuListState, MenuListProps, MenuListSlots, MenuCheckedValueChangeData, MenuCheckedValueChangeEvent, } from '@fluentui/react-menu'; - -export type MenuListState = MenuListBaseState & { - root: { - focusgroup?: string; - }; -};