-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(react-headless-components-preview): add Menu component and stories #36110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mainframev
wants to merge
14
commits into
microsoft:master
Choose a base branch
from
mainframev:feat/headless-menu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
78bc78a
test(react-menu): add hook-level regression tests for useMenuItem, us…
mainframev 0e93d9e
feat(react-menu): add base hooks for Menu, MenuList and export them
mainframev 7ce0965
chore: update change file
mainframev e4f57be
fixup! feat(react-menu): add base hooks for Menu, MenuList and export…
mainframev 0cd0725
feat(react-headless-components-preview): add Menu component
mainframev 9b91eec
feat(headless): add Menu component
mainframev 4d333d1
fixup! fixup! feat(react-menu): add base hooks for Menu, MenuList and…
mainframev 1c90b0d
fixup! feat(headless): use useMenuTriggerBase_unstable, trim verbose …
mainframev c9a6f25
fixup! consolidate MenuVariants tests into Menu.test.tsx
mainframev c4a6a59
fixup! align Menu story visuals with v9: tighter surface, taller item…
mainframev a45ecba
chore: format
mainframev 6d91075
chore: update api.md
mainframev aa45966
fix: tests
mainframev 206e1f5
fixup! feat(headless): add Menu component
mainframev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-headless-components-preview-d14be094-ae2a-4f19-9dcb-1b6c49a089cb.json
This file contains hidden or 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": "minor", | ||
| "comment": "feat: add Menu component (Menu, MenuTrigger, MenuList, MenuItem, MenuPopover, MenuDivider) — wraps v9 useMenu*Base_unstable hooks; uses native popover='auto' for top-layer rendering instead of Portal", | ||
| "packageName": "@fluentui/react-headless-components-preview", | ||
| "email": "viktorgenaev@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-menu-d76677a3-6018-4f05-a403-e59905ec8e5f.json
This file contains hidden or 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": "minor", | ||
| "comment": "feat: expose react-menu base hooks", | ||
| "packageName": "@fluentui/react-menu", | ||
| "email": "vgenaev@gmail.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or 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
282 changes: 282 additions & 0 deletions
282
...ages/react-components/react-headless-components-preview/library/etc/menu.api.md
This file contains hidden or 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,282 @@ | ||
| ## API Report File for "@fluentui/react-headless-components-preview" | ||
|
|
||
| > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
|
||
| ```ts | ||
|
|
||
| import type { ARIAButtonElement } from '@fluentui/react-aria'; | ||
| import type { ForwardRefComponent } from '@fluentui/react-utilities'; | ||
| import { JSXElement } from '@fluentui/react-utilities'; | ||
| import type { MenuBaseProps } from '@fluentui/react-menu'; | ||
| import type { MenuBaseState } from '@fluentui/react-menu'; | ||
| import type { MenuContextValue } from '@fluentui/react-menu'; | ||
| import { MenuDividerProps } from '@fluentui/react-menu'; | ||
| import { MenuDividerSlots } from '@fluentui/react-menu'; | ||
| import { MenuDividerState } from '@fluentui/react-menu'; | ||
| import { MenuGroupContextValues } from '@fluentui/react-menu'; | ||
| import { MenuGroupHeaderProps } from '@fluentui/react-menu'; | ||
| import { MenuGroupHeaderSlots } from '@fluentui/react-menu'; | ||
| import { MenuGroupHeaderState } from '@fluentui/react-menu'; | ||
| import { MenuGroupProps } from '@fluentui/react-menu'; | ||
| import { MenuGroupSlots } from '@fluentui/react-menu'; | ||
| import { MenuGroupState } from '@fluentui/react-menu'; | ||
| import { MenuItemCheckboxProps } from '@fluentui/react-menu'; | ||
| import { MenuItemCheckboxState } from '@fluentui/react-menu'; | ||
| import { MenuItemLinkProps } from '@fluentui/react-menu'; | ||
| import { MenuItemLinkSlots } from '@fluentui/react-menu'; | ||
| import { MenuItemLinkState } from '@fluentui/react-menu'; | ||
| import { MenuItemProps } from '@fluentui/react-menu'; | ||
| import { MenuItemRadioBaseProps as MenuItemRadioProps } from '@fluentui/react-menu'; | ||
| import { MenuItemRadioBaseState as MenuItemRadioState } from '@fluentui/react-menu'; | ||
| import { MenuItemRadioState as MenuItemRadioState_2 } from '@fluentui/react-menu'; | ||
| import { MenuItemSlots } from '@fluentui/react-menu'; | ||
| import { MenuItemState } from '@fluentui/react-menu'; | ||
| import { MenuItemSwitchProps } from '@fluentui/react-menu'; | ||
| import { MenuItemSwitchSlots } from '@fluentui/react-menu'; | ||
| import { MenuItemSwitchState } from '@fluentui/react-menu'; | ||
| import { MenuListContextValues } from '@fluentui/react-menu'; | ||
| import type { MenuListProps as MenuListProps_2 } from '@fluentui/react-menu'; | ||
| import type { MenuListSlots } from '@fluentui/react-menu'; | ||
| import { MenuListState as MenuListState_2 } from '@fluentui/react-menu'; | ||
| import type { MenuOpenChangeData } from '@fluentui/react-menu'; | ||
| import type { MenuOpenEvent } from '@fluentui/react-menu'; | ||
| import { MenuPopoverProps } from '@fluentui/react-menu'; | ||
| import { MenuPopoverSlots } from '@fluentui/react-menu'; | ||
| import { MenuPopoverState } from '@fluentui/react-menu'; | ||
| import { MenuSplitGroupProps } from '@fluentui/react-menu'; | ||
| import { MenuSplitGroupSlots } from '@fluentui/react-menu'; | ||
| import { MenuSplitGroupState } from '@fluentui/react-menu'; | ||
| import { MenuTriggerChildProps } from '@fluentui/react-menu'; | ||
| import { MenuTriggerProps } from '@fluentui/react-menu'; | ||
| import { MenuTriggerState } from '@fluentui/react-menu'; | ||
| import type { PositioningShorthand } from '@fluentui/react-positioning'; | ||
| import * as React_2 from 'react'; | ||
| import { useMenuContext_unstable as useMenuContext } from '@fluentui/react-menu'; | ||
|
|
||
| // @public | ||
| export const Menu: React_2.FC<MenuProps>; | ||
|
|
||
| export { MenuContextValue } | ||
|
|
||
| // @public (undocumented) | ||
| export type MenuContextValues = { | ||
| menu: MenuContextValue; | ||
| }; | ||
|
|
||
| // @public | ||
| export const MenuDivider: ForwardRefComponent<MenuDividerProps>; | ||
|
|
||
| export { MenuDividerProps } | ||
|
|
||
| export { MenuDividerSlots } | ||
|
|
||
| export { MenuDividerState } | ||
|
|
||
| // @public | ||
| export const MenuGroup: ForwardRefComponent<MenuGroupProps>; | ||
|
|
||
| export { MenuGroupContextValues } | ||
|
|
||
| // @public | ||
| export const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>; | ||
|
|
||
| export { MenuGroupHeaderProps } | ||
|
|
||
| export { MenuGroupHeaderSlots } | ||
|
|
||
| export { MenuGroupHeaderState } | ||
|
|
||
| export { MenuGroupProps } | ||
|
|
||
| export { MenuGroupSlots } | ||
|
|
||
| export { MenuGroupState } | ||
|
|
||
| // @public | ||
| export const MenuItem: ForwardRefComponent<MenuItemProps>; | ||
|
|
||
| // @public | ||
| export const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>; | ||
|
|
||
| export { MenuItemCheckboxProps } | ||
|
|
||
| export { MenuItemCheckboxState } | ||
|
|
||
| // @public | ||
| export const MenuItemLink: ForwardRefComponent<MenuItemLinkProps>; | ||
|
|
||
| export { MenuItemLinkProps } | ||
|
|
||
| export { MenuItemLinkSlots } | ||
|
|
||
| export { MenuItemLinkState } | ||
|
|
||
| export { MenuItemProps } | ||
|
|
||
| // @public | ||
| export const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>; | ||
|
|
||
| export { MenuItemRadioProps } | ||
|
|
||
| export { MenuItemRadioState } | ||
|
|
||
| export { MenuItemSlots } | ||
|
|
||
| export { MenuItemState } | ||
|
|
||
| // @public | ||
| export const MenuItemSwitch: ForwardRefComponent<MenuItemSwitchProps>; | ||
|
|
||
| export { MenuItemSwitchProps } | ||
|
|
||
| export { MenuItemSwitchSlots } | ||
|
|
||
| export { MenuItemSwitchState } | ||
|
|
||
| // @public | ||
| export const MenuList: ForwardRefComponent<MenuListProps>; | ||
|
|
||
| // @public (undocumented) | ||
| export type MenuListProps = MenuListProps_2; | ||
|
|
||
| export { MenuListSlots } | ||
|
|
||
| // @public (undocumented) | ||
| export type MenuListState = MenuListState_2 & { | ||
| root: { | ||
| focusgroup?: string; | ||
| }; | ||
| }; | ||
|
|
||
| export { MenuOpenChangeData } | ||
|
|
||
| export { MenuOpenEvent } | ||
|
|
||
| // @public | ||
| export const MenuPopover: ForwardRefComponent<MenuPopoverProps>; | ||
|
|
||
| export { MenuPopoverProps } | ||
|
|
||
| export { MenuPopoverSlots } | ||
|
|
||
| export { MenuPopoverState } | ||
|
|
||
| // @public | ||
| export type MenuProps = Omit<MenuBaseProps, 'positioning'> & { | ||
| positioning?: PositioningShorthand; | ||
| }; | ||
|
|
||
| // @public | ||
| export const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>; | ||
|
|
||
| export { MenuSplitGroupProps } | ||
|
|
||
| export { MenuSplitGroupSlots } | ||
|
|
||
| export { MenuSplitGroupState } | ||
|
|
||
| // @public (undocumented) | ||
| export type MenuState = MenuBaseState; | ||
|
|
||
| // @public | ||
| export const MenuTrigger: React_2.FC<MenuTriggerProps>; | ||
|
|
||
| export { MenuTriggerChildProps } | ||
|
|
||
| export { MenuTriggerProps } | ||
|
|
||
| export { MenuTriggerState } | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenu: (state: MenuState, contextValues: MenuContextValues) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuDivider: (state: MenuDividerState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuGroup: (state: MenuGroupState, contextValues: MenuGroupContextValues) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuGroupHeader: (state: MenuGroupHeaderState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuItem: (state: MenuItemState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuItemCheckbox: (state: MenuItemCheckboxState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuItemLink: (state: MenuItemLinkState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuItemRadio: (state: MenuItemRadioState_2) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuItemSwitch: (state: MenuItemSwitchState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuList: (state: MenuListState_2, contextValues: MenuListContextValues) => JSXElement; | ||
|
|
||
| // @public | ||
| export const renderMenuPopover: (state: MenuPopoverState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const renderMenuSplitGroup: (state: MenuSplitGroupState, contexts?: { | ||
| menuSplitGroup: { | ||
| setMultiline: (multiline: boolean) => void; | ||
| }; | ||
| }) => JSXElement; | ||
|
|
||
| // @public | ||
| export const renderMenuTrigger: (state: MenuTriggerState) => JSXElement; | ||
|
|
||
| // @public (undocumented) | ||
| export const useMenu: (props: MenuProps) => MenuState; | ||
|
|
||
| export { useMenuContext } | ||
|
|
||
| // @public (undocumented) | ||
| export const useMenuContextValues: (state: MenuState) => MenuContextValues; | ||
|
|
||
| // @public | ||
| export const useMenuDivider: (props: MenuDividerProps, ref: React_2.Ref<HTMLElement>) => MenuDividerState; | ||
|
|
||
| // @public | ||
| export const useMenuGroup: (props: MenuGroupProps, ref: React_2.Ref<HTMLElement>) => MenuGroupState; | ||
|
|
||
| // @public (undocumented) | ||
| export const useMenuGroupContextValues: (state: MenuGroupState) => MenuGroupContextValues; | ||
|
|
||
| // @public | ||
| export const useMenuGroupHeader: (props: MenuGroupHeaderProps, ref: React_2.Ref<HTMLElement>) => MenuGroupHeaderState; | ||
|
|
||
| // @public | ||
| export const useMenuItem: (props: MenuItemProps, ref: React_2.Ref<ARIAButtonElement<"div">>) => MenuItemState; | ||
|
|
||
| // @public | ||
| export const useMenuItemCheckbox: (props: MenuItemCheckboxProps, ref: React_2.Ref<ARIAButtonElement<"div">>) => MenuItemCheckboxState; | ||
|
|
||
| // @public | ||
| export const useMenuItemLink: (props: MenuItemLinkProps, ref: React_2.Ref<HTMLAnchorElement>) => MenuItemLinkState; | ||
|
|
||
| // @public | ||
| export const useMenuItemRadio: (props: MenuItemRadioProps, ref: React_2.Ref<ARIAButtonElement<"div">>) => MenuItemRadioState; | ||
|
|
||
| // @public | ||
| export const useMenuItemSwitch: (props: MenuItemSwitchProps, ref: React_2.Ref<HTMLDivElement>) => MenuItemSwitchState; | ||
|
|
||
| // @public | ||
| export const useMenuList: (props: MenuListProps, ref: React_2.Ref<HTMLElement>) => MenuListState; | ||
|
|
||
| // @public | ||
| export const useMenuPopover: (props: MenuPopoverProps, ref: React_2.Ref<HTMLElement>) => MenuPopoverState; | ||
|
|
||
| // @public | ||
| export const useMenuSplitGroup: (props: MenuSplitGroupProps, ref: React_2.Ref<HTMLElement>) => MenuSplitGroupState; | ||
|
|
||
| // @public | ||
| export const useMenuTrigger: (props: MenuTriggerProps) => MenuTriggerState; | ||
|
|
||
| // (No @packageDocumentation comment for this package) | ||
|
|
||
| ``` |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Charts-DonutChart 3 screenshots
vr-tests-react-components/Positioning 2 screenshots
vr-tests-react-components/ProgressBar converged 3 screenshots
vr-tests-react-components/TagPicker 2 screenshots
There were 2 duplicate changes discarded. Check the build logs for more information.