@mortenbrudvik/waveui 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +142 -32
  2. package/dist/components/data-display/InfoButton.cjs +1 -1
  3. package/dist/components/data-display/InfoButton.cjs.map +1 -1
  4. package/dist/components/data-display/InfoButton.mjs +90 -82
  5. package/dist/components/data-display/InfoButton.mjs.map +1 -1
  6. package/dist/components/data-display/InfoLabel.cjs +1 -1
  7. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  8. package/dist/components/data-display/InfoLabel.mjs +19 -18
  9. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  10. package/dist/components/feedback/MessageBarGroup.cjs +2 -0
  11. package/dist/components/feedback/MessageBarGroup.cjs.map +1 -0
  12. package/dist/components/feedback/MessageBarGroup.mjs +63 -0
  13. package/dist/components/feedback/MessageBarGroup.mjs.map +1 -0
  14. package/dist/components/feedback/ProgressBar.cjs +1 -1
  15. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  16. package/dist/components/feedback/ProgressBar.mjs +41 -39
  17. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  18. package/dist/components/feedback/Toaster.cjs +1 -1
  19. package/dist/components/feedback/Toaster.cjs.map +1 -1
  20. package/dist/components/feedback/Toaster.mjs +222 -216
  21. package/dist/components/feedback/Toaster.mjs.map +1 -1
  22. package/dist/components/layout/Accordion.cjs +1 -1
  23. package/dist/components/layout/Accordion.cjs.map +1 -1
  24. package/dist/components/layout/Accordion.mjs +124 -109
  25. package/dist/components/layout/Accordion.mjs.map +1 -1
  26. package/dist/components/layout/Carousel.cjs +1 -1
  27. package/dist/components/layout/Carousel.cjs.map +1 -1
  28. package/dist/components/layout/Carousel.mjs +207 -193
  29. package/dist/components/layout/Carousel.mjs.map +1 -1
  30. package/dist/components/layout/TabList.cjs +1 -1
  31. package/dist/components/layout/TabList.cjs.map +1 -1
  32. package/dist/components/layout/TabList.mjs +149 -108
  33. package/dist/components/layout/TabList.mjs.map +1 -1
  34. package/dist/components/layout/Tree.cjs.map +1 -1
  35. package/dist/components/layout/Tree.context.cjs +1 -1
  36. package/dist/components/layout/Tree.context.cjs.map +1 -1
  37. package/dist/components/layout/Tree.context.mjs +2 -1
  38. package/dist/components/layout/Tree.context.mjs.map +1 -1
  39. package/dist/components/layout/Tree.core.cjs +1 -1
  40. package/dist/components/layout/Tree.core.cjs.map +1 -1
  41. package/dist/components/layout/Tree.core.mjs +178 -165
  42. package/dist/components/layout/Tree.core.mjs.map +1 -1
  43. package/dist/components/layout/Tree.mjs.map +1 -1
  44. package/dist/components/navigation/Menu.popover.cjs +1 -1
  45. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  46. package/dist/components/navigation/Menu.popover.mjs +154 -168
  47. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  48. package/dist/components/navigation/Nav.cjs +1 -1
  49. package/dist/components/navigation/Nav.cjs.map +1 -1
  50. package/dist/components/navigation/Nav.mjs +156 -136
  51. package/dist/components/navigation/Nav.mjs.map +1 -1
  52. package/dist/components/navigation/NavDrawer.cjs +1 -1
  53. package/dist/components/navigation/NavDrawer.cjs.map +1 -1
  54. package/dist/components/navigation/NavDrawer.mjs +48 -45
  55. package/dist/components/navigation/NavDrawer.mjs.map +1 -1
  56. package/dist/components/overlays/Dialog.cjs +1 -1
  57. package/dist/components/overlays/Dialog.cjs.map +1 -1
  58. package/dist/components/overlays/Dialog.mjs +128 -122
  59. package/dist/components/overlays/Dialog.mjs.map +1 -1
  60. package/dist/components/overlays/Dialog.slots.cjs +1 -1
  61. package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
  62. package/dist/components/overlays/Dialog.slots.mjs +12 -12
  63. package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
  64. package/dist/components/overlays/Drawer.cjs.map +1 -1
  65. package/dist/components/overlays/Drawer.mjs.map +1 -1
  66. package/dist/components/overlays/Drawer.panel.cjs +1 -1
  67. package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
  68. package/dist/components/overlays/Drawer.panel.mjs +97 -81
  69. package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
  70. package/dist/components/overlays/Drawer.root.cjs +1 -1
  71. package/dist/components/overlays/Drawer.root.cjs.map +1 -1
  72. package/dist/components/overlays/Drawer.root.mjs +34 -31
  73. package/dist/components/overlays/Drawer.root.mjs.map +1 -1
  74. package/dist/components/overlays/Popover.cjs +1 -1
  75. package/dist/components/overlays/Popover.cjs.map +1 -1
  76. package/dist/components/overlays/Popover.mjs +231 -216
  77. package/dist/components/overlays/Popover.mjs.map +1 -1
  78. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  79. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  80. package/dist/components/overlays/TeachingPopover.parts.cjs +1 -1
  81. package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -1
  82. package/dist/components/overlays/TeachingPopover.parts.mjs +202 -173
  83. package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -1
  84. package/dist/components/overlays/TeachingPopover.root.cjs +1 -1
  85. package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -1
  86. package/dist/components/overlays/TeachingPopover.root.mjs +108 -99
  87. package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -1
  88. package/dist/components/overlays/Tooltip.cjs +1 -1
  89. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  90. package/dist/components/overlays/Tooltip.mjs +66 -61
  91. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  92. package/dist/components/provider/WaveProvider.cjs +1 -1
  93. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  94. package/dist/components/provider/WaveProvider.mjs +26 -23
  95. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  96. package/dist/hooks/useCollapsePresence.cjs +2 -0
  97. package/dist/hooks/useCollapsePresence.cjs.map +1 -0
  98. package/dist/hooks/useCollapsePresence.mjs +21 -0
  99. package/dist/hooks/useCollapsePresence.mjs.map +1 -0
  100. package/dist/hooks/useFocusBeforeClose.cjs +2 -0
  101. package/dist/hooks/useFocusBeforeClose.cjs.map +1 -0
  102. package/dist/hooks/useFocusBeforeClose.mjs +33 -0
  103. package/dist/hooks/useFocusBeforeClose.mjs.map +1 -0
  104. package/dist/hooks/useMotion.cjs +2 -0
  105. package/dist/hooks/useMotion.cjs.map +1 -0
  106. package/dist/hooks/useMotion.mjs +14 -0
  107. package/dist/hooks/useMotion.mjs.map +1 -0
  108. package/dist/hooks/usePresenceGroup.cjs +2 -0
  109. package/dist/hooks/usePresenceGroup.cjs.map +1 -0
  110. package/dist/hooks/usePresenceGroup.mjs +68 -0
  111. package/dist/hooks/usePresenceGroup.mjs.map +1 -0
  112. package/dist/index.cjs +1 -1
  113. package/dist/index.d.cts +721 -131
  114. package/dist/index.d.ts +721 -131
  115. package/dist/index.mjs +136 -135
  116. package/dist/lib/classNames.cjs +1 -1
  117. package/dist/lib/classNames.cjs.map +1 -1
  118. package/dist/lib/classNames.mjs +101 -90
  119. package/dist/lib/classNames.mjs.map +1 -1
  120. package/dist/lib/motion.cjs +2 -0
  121. package/dist/lib/motion.cjs.map +1 -0
  122. package/dist/lib/motion.mjs +43 -0
  123. package/dist/lib/motion.mjs.map +1 -0
  124. package/dist/styles.css +1 -1
  125. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Nav.cjs","names":["slotRendersContent","renderSlot","cn","focusRingInset","disabledStyles","_Fragment","materialiseSlotContent","useNavContext","React","NavRovingContext","useId","containsValue","navCategoryClassNames","ChevronDownIcon","NavCategoryValueContext","markNavPart","navItemClassNames","navSubItemClassNames","NavRoot","NavSectionHeader","NavDivider","NavAppItem","NavAppItemStatic","require_runtime","require_cn","require_dev","require_slot","require_classNames","require_useId","require_styles","require_icons","require_Nav_context","require_Nav_parts","require_Nav_root","react","react_jsx_runtime","iconClasses","renderIcon","icon","className","itemClasses","subItemClasses","rowClasses","rowHoverClasses","actionsClasses","categoryButtonClasses","opensElsewhere","event","link","target","renderNavEntry","rest","props","isSelected","context","value","isLink","href","rovingProps","roving","hasActions","actions","itemId","generatedId","idProps","handleClick","disabled","onClick","content","withIcon","stable","children","entryClassName","classes","listItemClassName","actionsGroup","buttonRest","NavCategory","currentValue","listId","isOpen","openCategories","holdsCurrentChild","holdsShownCurrent","categoryStore","containsCurrent","currentCategory","listRef","buttonLabel","label","items","parts","isText","part","toggleCategory","NavItem","NavSubItem","Nav"],"sources":["../../../src/components/navigation/Nav.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport {\n navCategoryClassNames,\n navItemClassNames,\n navSubItemClassNames,\n} from '../../lib/classNames';\nimport type { Slot } from '../../lib/types';\nimport { materialiseSlotContent, renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnDeprecated } from '../../lib/dev';\nimport { ChevronDownIcon } from '../../lib/icons';\nimport { disabledStyles, focusRingInset } from '../../lib/styles';\nimport { useId } from '../../hooks/useId';\nimport {\n NavCategoryValueContext,\n NavRovingContext,\n containsValue,\n markNavPart,\n useNavContext,\n useNavListChildCheck,\n useNavValue,\n useRecordCategory,\n type NavContextValue,\n type NavRovingContextValue,\n type NoAnchorOnlyAttributes,\n} from './Nav.context';\nimport { NavAppItem, NavAppItemStatic, NavDivider, NavSectionHeader } from './Nav.parts';\nimport { NavRoot } from './Nav.root';\n\n/*\n * The Nav compound: the item types, styles and rendering of Nav.Item and Nav.SubItem, Nav.Category,\n * the `Object.assign` with its JSDoc, the flat names and the type re-exports. Nothing imports this\n * module but the barrel: the root (`Nav.root.tsx`) and the contexts (`Nav.context.ts`) recognise\n * the parts by the markers set next to each `displayName` below; the structural parts live in\n * `Nav.parts.tsx`.\n */\n\nexport type { NavProps } from './Nav.root';\nexport type {\n NavSectionHeaderProps,\n NavDividerProps,\n NavAppItemOwnProps,\n NavAppItemAnchorProps,\n NavAppItemButtonProps,\n NavAppItemProps,\n NavAppItemDynamicProps,\n NavAppItemStaticProps,\n} from './Nav.parts';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Properties for the NavCategory sub-component. */\nexport interface NavCategoryProps extends React.HTMLAttributes<HTMLLIElement> {\n /**\n * Value identifying this category (used by `openCategories`), unique among the categories of\n * the Nav (a duplicate warns in development).\n */\n value: string;\n /**\n * Label of the category's toggle button (any content). Without it, the text children are used\n * as the label — deprecated: pass the label here and only the sub-items as children.\n */\n label?: React.ReactNode;\n /**\n * Icon displayed before the category label. Rendered with `aria-hidden=\"true\"`. A falsy icon\n * (`''`, `0`) or a list of nothing renders no icon box.\n */\n icon?: Slot<'span'>;\n /**\n * The category's sub-items (`Nav.SubItem`), and `Nav.SectionHeader` and `Nav.Divider`, rendered\n * in its list while it is open.\n */\n children?: React.ReactNode;\n /** Ref to the category's `<li>` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\n/**\n * The props of Nav.Item that every branch shares ({@link NavItemAnchorProps},\n * {@link NavItemButtonProps}, {@link NavItemDynamicProps}).\n */\nexport interface NavItemOwnProps {\n /**\n * Value identifying this nav item, unique among the items and sub-items of the Nav (a duplicate\n * warns in development).\n */\n value: string;\n /**\n * Icon displayed before the item label. Rendered with `aria-hidden=\"true\"`. A falsy icon (`''`,\n * `0`) or a list of nothing renders no icon box.\n */\n icon?: Slot<'span'>;\n /**\n * Whether the item is disabled: a native `disabled` button, or an `aria-disabled` link without\n * `href`. Activating a disabled item never selects it; a disabled item whose value is the\n * current `value` still shows as current (`aria-current=\"page\"` and the selected look), because\n * the current value belongs to the app.\n */\n disabled?: boolean;\n /** Label content. */\n children?: React.ReactNode;\n /**\n * Controls beside the item in its row (Fluent's SplitNavItem): a ToggleButton that pins the\n * page, a MenuButton with more commands, each with its own name (a Tooltip with\n * `relationship=\"label\"` names an icon-only one). They render after the item's link or button,\n * never inside it, in a group named by the item; each is a Tab stop after the item, and a click\n * or key on one never selects the item. They are drawn while the row is hovered or has focus,\n * while one of them is pressed or has its popup open, and always in forced colours and on touch\n * screens; otherwise they are transparent and still focusable. They stay enabled when the item\n * is `disabled`. With actions, the selected background and indicator are drawn on the row (the\n * item's list item, `.wave-nav-item__list-item`), so a `className` on the item no longer covers\n * them. Content that renders nothing renders no group. Fluent's `actionButton`, `toggleButton`\n * and `menuButton` slots and their tooltips are your own controls here.\n */\n actions?: React.ReactNode;\n}\n\n/**\n * Nav.Item rendered as a link (`href` given): anchor attributes, and handlers typed on\n * `HTMLAnchorElement`. 0.4 typed every item's handlers on `HTMLButtonElement`, so with a string\n * `href` an unannotated 0.4 handler that reads a button-only member (such as\n * `e.currentTarget.form`) no longer compiles; a handler already typed as\n * `React.MouseEventHandler<HTMLButtonElement>` still does (React handler types are bivariant).\n */\nexport interface NavItemAnchorProps\n extends\n NavItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof NavItemOwnProps> {\n /**\n * URL to navigate to; renders an `<a>`. Required in this branch, so `href` discriminates the\n * union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /** Ref to the `<a>` element. */\n ref?: React.Ref<HTMLAnchorElement>;\n}\n\n/** Nav.Item rendered as a button (no `href`): button attributes (a `rel` is not rendered). */\nexport interface NavItemButtonProps\n extends\n NavItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof NavItemOwnProps> {\n /** Button items have no `href`. */\n href?: undefined;\n /** Ref to the `<button>` element. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Properties for the NavItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends NavItemButtonProps`) or intersect (`type X = NavItemProps & { … }`).\n * `React.ComponentProps<typeof Nav.Item>` resolves to the last overload,\n * {@link NavItemDynamicProps}.\n */\nexport type NavItemProps = NavItemAnchorProps | NavItemButtonProps;\n\n/**\n * Nav.Item with an `href` known only at run time (`string | undefined`): a link when it is a\n * string, a button otherwise. Resolved after the button and link signatures.\n *\n * Only the attributes both elements share are accepted (no `target`, `download`, `type`, `form`,\n * …), and handlers receive events of either element (`HTMLAnchorElement | HTMLButtonElement`).\n * 0.4 typed them as button events (`HTMLAttributes<HTMLButtonElement>`), so an unannotated 0.4\n * handler that reads a button-only member (such as `e.currentTarget.form`) no longer compiles here;\n * narrow `e.currentTarget` first. (A string `href` types handlers on `HTMLAnchorElement`, see\n * {@link NavItemAnchorProps}; no `href` keeps `HTMLButtonElement`.)\n */\nexport interface NavItemDynamicProps\n extends\n NavItemOwnProps,\n Omit<React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, keyof NavItemOwnProps> {\n /** URL to navigate to; renders an `<a>` when defined, a `<button>` otherwise. */\n href?: string;\n /** Ref to the rendered `<a>` or `<button>` element. */\n ref?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;\n}\n\n/**\n * The props of Nav.SubItem that every branch shares: those of {@link NavItemOwnProps} without\n * `icon`.\n */\nexport type NavSubItemOwnProps = Omit<NavItemOwnProps, 'icon'>;\n\n/**\n * Nav.SubItem rendered as a link (`href` given): anchor attributes, and handlers typed on\n * `HTMLAnchorElement` (0.4: `HTMLButtonElement`); see {@link NavItemAnchorProps}.\n */\nexport interface NavSubItemAnchorProps\n extends\n NavSubItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof NavSubItemOwnProps> {\n /**\n * URL to navigate to; renders an `<a>`. Required in this branch, so `href` discriminates the\n * union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /** Ref to the `<a>` element. */\n ref?: React.Ref<HTMLAnchorElement>;\n}\n\n/** Nav.SubItem rendered as a button (no `href`): button attributes (a `rel` is not rendered). */\nexport interface NavSubItemButtonProps\n extends\n NavSubItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof NavSubItemOwnProps> {\n /** Button sub-items have no `href`. */\n href?: undefined;\n /** Ref to the `<button>` element. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Properties for the NavSubItem sub-component: link props with `href`, button props without.\n * A union type like {@link NavItemProps} (extend a branch or intersect; `React.ComponentProps`\n * resolves to {@link NavSubItemDynamicProps}).\n */\nexport type NavSubItemProps = NavSubItemAnchorProps | NavSubItemButtonProps;\n\n/**\n * Nav.SubItem with an `href` known only at run time (`string | undefined`): a link when it is a\n * string, a button otherwise. Only the attributes both elements share are accepted, and handlers\n * receive events of either element (0.4 typed them as button events); see\n * {@link NavItemDynamicProps}.\n */\nexport interface NavSubItemDynamicProps\n extends\n NavSubItemOwnProps,\n Omit<React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, keyof NavSubItemOwnProps> {\n /** URL to navigate to; renders an `<a>` when defined, a `<button>` otherwise. */\n href?: string;\n /** Ref to the rendered `<a>` or `<button>` element. */\n ref?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;\n}\n\n/** The props both entry kinds share at runtime (the union narrowed by `href`). */\ntype NavEntryProps = NavItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof NavItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst iconClasses = 'flex h-5 w-5 shrink-0 items-center justify-center';\n\n/**\n * The `icon` slot of Nav.Item and Nav.Category, or `null` when it renders nothing. A falsy icon\n * (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in 0.4 and as in\n * Avatar, and so is a collection whose items render nothing, so no empty 20px box is rendered\n * before the label. The check does not consume a generator: renderSlot still renders its items.\n */\nfunction renderIcon(\n icon: Slot<'span'> | undefined,\n className: string | undefined,\n): React.ReactElement | null {\n return icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(className, iconClasses), { 'aria-hidden': true })\n : null;\n}\n\nconst itemClasses = {\n base: cn(\n 'flex w-full items-center gap-2 px-4 py-2 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none',\n focusRingInset,\n disabledStyles,\n ),\n selected: 'bg-subtle-selected text-primary font-semibold border-s-2 border-s-primary',\n idle: 'text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover',\n // With actions, the selected background and indicator move to the row (D121).\n selectedInRow: 'text-primary font-semibold',\n rowSelected: 'bg-subtle-selected border-s-2 border-s-primary',\n};\n\nconst subItemClasses = {\n base: cn(\n 'flex w-full items-center ps-11 pe-4 py-1.5 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none',\n focusRingInset,\n disabledStyles,\n ),\n selected: 'text-primary font-semibold',\n idle: 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover',\n // Sub-items have no selected background: a sub-item row gets only the hover.\n selectedInRow: 'text-primary font-semibold',\n rowSelected: undefined,\n};\n\n/** The classes an entry's link or button and its row share. */\ninterface NavEntryClasses {\n base: string;\n selected: string;\n idle: string;\n selectedInRow: string;\n rowSelected: string | undefined;\n}\n\n/**\n * The row of an entry with actions (D121): the list item lays out the link or button and the\n * actions side by side and carries the selected look, or the hover of an enabled entry. A list\n * item cannot be disabled, so its hover needs no gate.\n */\nconst rowClasses =\n 'group/nav-row flex items-center transition-colors motion-reduce:transition-none';\nconst rowHoverClasses = 'hover:bg-subtle-hover';\n\n/**\n * The actions element (D120). Each direct child is transparent until the row is hovered or has\n * focus inside it, and is always drawn in forced colours and on devices without hover; a child\n * that is or holds a pressed toggle or an expanded trigger stays drawn (the first pair covers an\n * action wrapped in a Tooltip's span, the second a bare one). Opacity keeps every action\n * focusable, so Shift+Tab and a focus return reach it. No motion.\n */\nconst actionsClasses = cn(\n 'flex shrink-0 items-center gap-1 pe-2',\n '*:opacity-0 group-hover/nav-row:*:opacity-100 group-focus-within/nav-row:*:opacity-100',\n 'forced-colors:*:opacity-100 [@media(hover:none)]:*:opacity-100',\n '*:has-[[aria-pressed=true]]:opacity-100 *:has-[[aria-expanded=true]]:opacity-100',\n '[&>[aria-pressed=true]]:opacity-100 [&>[aria-expanded=true]]:opacity-100',\n);\n\nconst categoryButtonClasses = cn(\n 'flex w-full items-center gap-2 px-4 py-2 text-body-1 font-semibold text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover transition-colors motion-reduce:transition-none',\n // A closed category that contains the current page shows the selected look of an item.\n 'data-[contains-current]:bg-subtle-selected data-[contains-current]:text-primary data-[contains-current]:border-s-2 data-[contains-current]:border-s-primary',\n focusRingInset,\n);\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Whether a click on a link opens it somewhere other than the current page, checked as routers\n * do: a modifier key (a new tab or window, a download), a mouse button other than the main one, a\n * `target` other than `_self`, or a `download` link. Only when the default is not prevented does\n * the browser actually open it there.\n */\nfunction opensElsewhere(event: React.MouseEvent<HTMLElement>): boolean {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return true;\n }\n const link = event.currentTarget;\n const target = link.getAttribute('target');\n return (!!target && target.toLowerCase() !== '_self') || link.hasAttribute('download');\n}\n\n/** The stable classes of an entry, written literally by Nav.Item and Nav.SubItem. */\ninterface NavEntryClassNames {\n root: string;\n listItem: string;\n actions: string;\n icon?: string;\n content?: string;\n}\n\n/**\n * Shared rendering of Nav.Item and Nav.SubItem (link or button). Inside an arrow-key body\n * (`roving` provided) the link or button also carries `data-roving-value={value}`, after the\n * consumer's attributes; in a plain Nav nothing is added. With `actions` that render content, the\n * list item becomes the row (D121) and holds the link or button, then the actions in a group named\n * by it through `generatedId` (unless the consumer gave an `id`), siblings, never nested (D119).\n */\nfunction renderNavEntry(\n props: NavEntryProps,\n context: NavContextValue,\n roving: NavRovingContextValue | null,\n classes: NavEntryClasses,\n stable: NavEntryClassNames,\n withIcon: boolean,\n generatedId: string,\n): React.ReactElement {\n const {\n value,\n icon,\n disabled = false,\n href,\n className,\n children,\n onClick,\n actions,\n ref,\n ...rest\n } = props;\n const isSelected = context.value === value;\n const isLink = href !== undefined;\n const rovingProps = roving ? { 'data-roving-value': value } : undefined;\n // No empty group (`actions={cond && <Button />}` with `cond` false); the id is rendered only\n // while the group points at it, so an item without actions keeps its 0.10 HTML.\n const hasActions = slotRendersContent(actions);\n const itemId = rest.id ?? generatedId;\n const idProps = hasActions ? { id: itemId } : undefined;\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n // A link is still selected when the consumer prevents its default (client-side routing:\n // `preventDefault()` + `router.push(href)`, whatever the modifier keys: the browser then opens\n // nothing elsewhere), but not when the browser opens it elsewhere (the current page does not\n // change); a button honours `preventDefault()` (C-COMPOSE).\n if (isLink ? !event.defaultPrevented && opensElsewhere(event) : event.defaultPrevented) return;\n context.select(value);\n };\n\n const content = (\n <>\n {withIcon && renderIcon(icon, stable.icon)}\n {withIcon ? (\n <span className={cn(stable.content, 'flex-1 text-start')}>{children}</span>\n ) : (\n children\n )}\n </>\n );\n\n const entryClassName = cn(\n stable.root,\n classes.base,\n isSelected ? (hasActions ? classes.selectedInRow : classes.selected) : classes.idle,\n hasActions && 'min-w-0 flex-1',\n className,\n );\n\n const listItemClassName = hasActions\n ? cn(\n stable.listItem,\n rowClasses,\n isSelected && classes.rowSelected ? classes.rowSelected : !disabled && rowHoverClasses,\n )\n : stable.listItem;\n\n const actionsGroup = hasActions ? (\n <span\n role=\"group\"\n aria-labelledby={itemId}\n data-wave-nav-actions=\"\"\n className={cn(stable.actions, actionsClasses)}\n >\n {materialiseSlotContent(actions)}\n </span>\n ) : null;\n\n if (isLink) {\n return (\n <li className={listItemClassName}>\n <a\n {...(rest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n {...idProps}\n {...rovingProps}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={disabled ? undefined : href}\n role={disabled ? 'link' : rest.role}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n aria-current={isSelected ? 'page' : undefined}\n onClick={handleClick}\n className={entryClassName}\n >\n {content}\n </a>\n {actionsGroup}\n </li>\n );\n }\n\n // `rel` only belongs on a link: a button item drops it (React types it on every element).\n const { rel, ...buttonRest } = rest;\n return (\n <li className={listItemClassName}>\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n {...idProps}\n {...rovingProps}\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={disabled}\n aria-current={isSelected ? 'page' : undefined}\n onClick={handleClick}\n className={entryClassName}\n >\n {content}\n </button>\n {actionsGroup}\n </li>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Nav.Category\n// ---------------------------------------------------------------------------\n\n/**\n * A collapsible group of sub-items. Its toggle button shows `label` and reports `aria-expanded`\n * (and `aria-controls` while open); the sub-items render in a nested list while it is open.\n * Open state lives on `Nav` (`openCategories`/`defaultOpenCategories`).\n *\n * A closed category that contains the current item marks its toggle button with\n * `aria-current=\"true\"` (the button is not the page's link, so not `\"page\"`),\n * `data-contains-current` and the selected look of `Nav.Item`. It contains the current item when\n * a `Nav.SubItem` with the current value is among its children (through Fragments and wrapper\n * elements, also in the server HTML), when the current sub-item was last shown in it (and has not\n * moved among another category's children since), or when it is the Nav's `currentCategory`. An\n * open category is not marked: its sub-item shows the current page.\n *\n * Also exported as `NavCategory` (import the flat name from React Server Components).\n */\nconst NavCategory = ({\n value,\n label,\n icon,\n className,\n children,\n ref,\n ...rest\n}: NavCategoryProps) => {\n const context = useNavContext('Nav.Category');\n const roving = React.useContext(NavRovingContext);\n const {\n value: currentValue,\n openCategories,\n toggleCategory,\n currentCategory,\n categoryStore,\n } = context;\n useNavValue(context, 'category', value);\n const listId = useId('wave-nav-category');\n const isOpen = openCategories.includes(value);\n\n // The current sub-item is among the children of this closed category (also on the server).\n const holdsCurrentChild = !isOpen && currentValue !== '' && containsValue(children, currentValue);\n // The current sub-item was last shown in this category (none on the server).\n const holdsShownCurrent = React.useSyncExternalStore(\n categoryStore.subscribe,\n () => currentValue !== '' && categoryStore.get(currentValue) === value,\n () => false,\n );\n // Children that hold the current sub-item make this the category the Nav remembers for it, so a\n // category it was shown in before it moved here is no longer marked. The entry is forgotten when\n // they stop holding it (an open category records through its mounted sub-item instead).\n React.useLayoutEffect(() => {\n if (!holdsCurrentChild) return;\n categoryStore.record(currentValue, value);\n return () => categoryStore.forget(currentValue, value);\n }, [categoryStore, holdsCurrentChild, currentValue, value]);\n const containsCurrent =\n !isOpen && (currentCategory === value || holdsShownCurrent || holdsCurrentChild);\n // Inside an arrow-key body: whether this is a closed category that holds the current page (the\n // body's first Tab stop), before paint; nothing is reported in a plain Nav.\n React.useLayoutEffect(() => {\n if (!roving) return;\n roving.reportCurrentCategory(value, containsCurrent);\n return () => roving.reportCurrentCategory(value, false);\n }, [roving, value, containsCurrent]);\n // Development only: every child of the open list is an <li> (`Nav.Category:list-child`).\n const listRef = React.useRef<HTMLUListElement>(null);\n useNavListChildCheck(listRef, 'Nav.Category', 'sub-items');\n\n let buttonLabel: React.ReactNode = label;\n let items: React.ReactNode = children;\n if (label === undefined) {\n // Deprecated 0.4 path: the text children are the label, the other children the sub-items.\n warnDeprecated(\n 'Nav.Category',\n 'text children as the label',\n 'label',\n 'Pass the category label in `label` and only the sub-items as children.',\n );\n const parts = React.Children.toArray(children);\n const isText = (part: unknown) => typeof part === 'string' || typeof part === 'number';\n buttonLabel = parts.filter(isText).join('');\n items = parts.filter((part) => !isText(part));\n }\n\n return (\n <li ref={ref} {...rest} className={cn(navCategoryClassNames.root, className)}>\n <button\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? listId : undefined}\n aria-current={containsCurrent ? true : undefined}\n data-contains-current={containsCurrent ? '' : undefined}\n data-roving-value={roving ? `wave-nav-category:${value}` : undefined}\n onClick={() => toggleCategory(value)}\n className={cn(navCategoryClassNames.button, categoryButtonClasses)}\n >\n {renderIcon(icon, navCategoryClassNames.icon)}\n <span className={cn(navCategoryClassNames.label, 'flex-1 text-start')}>{buttonLabel}</span>\n <ChevronDownIcon\n className={cn(\n navCategoryClassNames.expandIcon,\n 'shrink-0 transition-transform motion-reduce:transition-none',\n isOpen && 'rotate-180',\n )}\n />\n </button>\n {isOpen && (\n <NavCategoryValueContext.Provider value={value}>\n <ul\n ref={listRef}\n id={listId}\n className={cn(navCategoryClassNames.list, 'm-0 list-none p-0')}\n >\n {items}\n </ul>\n </NavCategoryValueContext.Provider>\n )}\n </li>\n );\n};\nNavCategory.displayName = 'NavCategory';\nmarkNavPart(NavCategory, 'category');\n\n// ---------------------------------------------------------------------------\n// Nav.Item / Nav.SubItem\n// ---------------------------------------------------------------------------\n\n/**\n * A top-level navigation entry: a link when `href` is given (anchor props), a button otherwise\n * (button props). Clicking selects it (`aria-current=\"page\"`); activating a disabled entry never\n * selects it (a disabled entry whose value is the current value still shows as current).\n *\n * A click that opens a link somewhere other than the current page selects nothing (the consumer's\n * `onClick` still runs, and the browser opens the link): Ctrl/Cmd/Shift/Alt-click, a mouse button\n * other than the main one, a `target` other than `_self`, or a `download` link. When the consumer's\n * `onClick` calls `preventDefault()` (client-side routing), the browser opens nothing, so the item\n * is selected whatever the keys, button or `target`.\n *\n * `actions` puts your own controls (a pin toggle, a menu button) beside the item in its row, in a\n * group named by the item; they never select it.\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link NavItemDynamicProps}: events of either element).\n *\n * Also exported as `NavItem` (import the flat name from React Server Components).\n */\nfunction NavItem(props: NavItemButtonProps): React.ReactElement;\nfunction NavItem(props: NavItemAnchorProps): React.ReactElement;\nfunction NavItem(props: NavItemDynamicProps): React.ReactElement;\nfunction NavItem(props: NavItemProps | NavItemDynamicProps): React.ReactElement {\n const context = useNavContext('Nav.Item');\n useNavValue(context, 'item', props.value);\n useRecordCategory(context, props.value);\n const roving = React.useContext(NavRovingContext);\n // Called always, rendered only while the item's actions render (D119).\n const generatedId = useId('wave-nav-item');\n return renderNavEntry(\n props as NavEntryProps,\n context,\n roving,\n itemClasses,\n {\n root: navItemClassNames.root,\n listItem: navItemClassNames.listItem,\n actions: navItemClassNames.actions,\n icon: navItemClassNames.icon,\n content: navItemClassNames.content,\n },\n true,\n generatedId,\n );\n}\nNavItem.displayName = 'NavItem';\nmarkNavPart(NavItem, 'entry');\n\n/**\n * An indented entry inside a `Nav.Category`: a link when `href` is given, a button otherwise.\n * Selected like `Nav.Item` (a click that the browser opens somewhere else selects nothing; one\n * whose default your `onClick` prevents is selected), and typed by overloads like `Nav.Item`\n * (button, link, then {@link NavSubItemDynamicProps}). Takes `actions` like `Nav.Item`.\n *\n * Also exported as `NavSubItem` (import the flat name from React Server Components).\n */\nfunction NavSubItem(props: NavSubItemButtonProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemAnchorProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemDynamicProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemProps | NavSubItemDynamicProps): React.ReactElement {\n const context = useNavContext('Nav.SubItem');\n useNavValue(context, 'item', props.value);\n useRecordCategory(context, props.value);\n const roving = React.useContext(NavRovingContext);\n // Called always, rendered only while the sub-item's actions render (D119).\n const generatedId = useId('wave-nav-item');\n return renderNavEntry(\n props as NavEntryProps,\n context,\n roving,\n subItemClasses,\n {\n root: navSubItemClassNames.root,\n listItem: navSubItemClassNames.listItem,\n actions: navSubItemClassNames.actions,\n },\n false,\n generatedId,\n );\n}\nNavSubItem.displayName = 'NavSubItem';\nmarkNavPart(NavSubItem, 'entry');\n\n/**\n * A vertical side navigation (`<nav>` landmark, default name \"Navigation\") with items, links and\n * collapsible categories.\n *\n * - **Selection**: `value`/`defaultValue`/`onValueChange` (`onValueChange` fires only when the\n * value changes). The deprecated `selectedValue`/`defaultSelectedValue`/`onNavItemSelect` still\n * work; `onNavItemSelect` keeps firing on every activation, re-selection included. A click that\n * opens a link in another tab or window (or downloads it) selects nothing, unless the item's\n * `onClick` prevents the default (client-side routing: then nothing opens elsewhere).\n * - **Categories**: `openCategories`/`defaultOpenCategories`/`onOpenCategoriesChange`. Without\n * `defaultOpenCategories`, the categories containing the selected item (`value` or\n * `defaultValue`) start open. A closed category that contains the selected item marks its toggle\n * (`aria-current=\"true\"`, `data-contains-current`, the selected look); pass `currentCategory`\n * for sub-items your own component renders inside a closed category.\n * - **Values** are unique: among the items and sub-items, and among the categories (a duplicate\n * warns in development).\n * - **Structure**: every child of the Nav, and of a category, is a part or your own `<li>`; a\n * development warning names anything else (a `<div>`, text, the wrapper of a Tooltip around an\n * item). `Nav.SectionHeader` is a heading between groups of items (`<h3>` unless\n * `headingLevel`, which stands for the `as` of Fluent's NavSectionHeader), and `Nav.Divider` a\n * line between groups, hidden from assistive technology (Fluent's NavDivider is a separator).\n * - **App identity**: `Nav.AppItem` shows the app's name and logo at the top, as a link with\n * `href` or a button; it is never selected. `Nav.AppItemStatic` shows them as plain text.\n * - **Item actions**: `actions` on `Nav.Item` and `Nav.SubItem` (Fluent's SplitNavItem) puts your\n * own controls beside the item, in a group named by it; each is a Tab stop after the item, and\n * none selects it. They are drawn while the row is hovered or has focus, while one is pressed or\n * has its menu open, and always on touch screens and in forced colours. With actions, a selected\n * item's background and indicator are drawn on its row (`.wave-nav-item__list-item`).\n *\n * Sub-components are also exported under flat names (`NavCategory`, `NavItem`, `NavSubItem`,\n * `NavSectionHeader`, `NavDivider`, `NavAppItem`, `NavAppItemStatic`): React Server Components\n * import those, because dotted access (`Nav.Item`) needs a client file.\n */\nexport const Nav = /* @__PURE__ */ Object.assign(NavRoot, {\n Category: NavCategory,\n Item: NavItem,\n SubItem: NavSubItem,\n SectionHeader: NavSectionHeader,\n Divider: NavDivider,\n AppItem: NavAppItem,\n AppItemStatic: NavAppItemStatic,\n});\n\nexport {\n NavCategory,\n NavItem,\n NavSubItem,\n NavSectionHeader,\n NavDivider,\n NavAppItem,\n NavAppItemStatic,\n};\n"],"mappings":"idA0PA,IAAMoC,EAAc,oDAQpB,SAASC,EACP,EACA,EAC2B,CAC3B,OAAOC,GAAQtC,EAAA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,SAAU2D,EACV,KAAMkB,EACN,QAASC,EACT,cAAe7E,EAAAA,iBACf,QAASC,EAAAA,WACT,QAASC,EAAAA,WACT,cAAeC,EAAAA,gBACjB,CAAC"}
1
+ {"version":3,"file":"Nav.cjs","names":["slotRendersContent","renderSlot","cn","focusRingInset","disabledStyles","_Fragment","navActionsReveal","materialiseSlotContent","useNavContext","React","NavRovingContext","useId","containsValue","useCollapsePresence","unwrapButtonGlyph","useMotionClasses","expandIconMotion","expandIconRecipe","ChevronDownIcon","navCategoryClassNames","NavCategoryValueContext","markNavPart","useMotionPreference","navItemClassNames","navSubItemClassNames","NavRoot","NavSectionHeader","NavDivider","NavAppItem","NavAppItemStatic","require_runtime","require_cn","require_dev","require_slot","require_classNames","require_useId","require_styles","require_Button_slots","require_icons","require_motion","require_useMotion","require_useCollapsePresence","require_Nav_context","require_Nav_parts","require_Nav_root","react","react_jsx_runtime","iconClasses","renderIcon","icon","className","itemClasses","subItemClasses","rowClasses","rowHoverClasses","actionsClasses","categoryButtonClasses","opensElsewhere","event","link","target","renderNavEntry","rest","props","isSelected","context","value","isLink","href","rovingProps","roving","hasActions","actions","itemId","generatedId","idProps","handleClick","disabled","onClick","content","withIcon","stable","children","entryClassName","classes","listItemClassName","actionsGroup","motionPreference","buttonRest","NavCategory","expandIconMotion$1","currentValue","listId","isOpen","openCategories","holdsCurrentChild","holdsShownCurrent","categoryStore","containsCurrent","currentCategory","listRef","buttonRef","isListMounted","collapseRef","collapsePresenceProps","collapseClassName","expandGlyph","expandIconButton","expandIcon","expandIconMotionClassName","expandIconElement","buttonLabel","label","items","parts","isText","part","toggleCategory","NavItem","NavSubItem","Nav"],"sources":["../../../src/components/navigation/Nav.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport {\n navCategoryClassNames,\n navItemClassNames,\n navSubItemClassNames,\n} from '../../lib/classNames';\nimport type { MotionPreference, MotionSlot, Slot } from '../../lib/types';\nimport { materialiseSlotContent, renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnDeprecated, warnOnce } from '../../lib/dev';\nimport { ChevronDownIcon } from '../../lib/icons';\n// Aliased: `expandIconMotion` is also Nav.Category's prop.\nimport {\n expandIconMotion as expandIconRecipe,\n navActionsRevealMotion as navActionsReveal,\n} from '../../lib/motion';\nimport { disabledStyles, focusRingInset } from '../../lib/styles';\nimport { useCollapsePresence } from '../../hooks/useCollapsePresence';\nimport { useId } from '../../hooks/useId';\nimport { useMotionClasses, useMotionPreference } from '../../hooks/useMotion';\nimport { unwrapButtonGlyph } from '../button/Button.slots';\nimport {\n NavCategoryValueContext,\n NavRovingContext,\n containsValue,\n markNavPart,\n useNavContext,\n useNavListChildCheck,\n useNavValue,\n useRecordCategory,\n type NavContextValue,\n type NavRovingContextValue,\n type NoAnchorOnlyAttributes,\n} from './Nav.context';\nimport { NavAppItem, NavAppItemStatic, NavDivider, NavSectionHeader } from './Nav.parts';\nimport { NavRoot } from './Nav.root';\n\n/*\n * The Nav compound: the item types, styles and rendering of Nav.Item and Nav.SubItem, Nav.Category,\n * the `Object.assign` with its JSDoc, the flat names and the type re-exports. Nothing imports this\n * module but the barrel: the root (`Nav.root.tsx`) and the contexts (`Nav.context.ts`) recognise\n * the parts by the markers set next to each `displayName` below; the structural parts live in\n * `Nav.parts.tsx`.\n */\n\nexport type { NavProps } from './Nav.root';\nexport type {\n NavSectionHeaderProps,\n NavDividerProps,\n NavAppItemOwnProps,\n NavAppItemAnchorProps,\n NavAppItemButtonProps,\n NavAppItemProps,\n NavAppItemDynamicProps,\n NavAppItemStaticProps,\n} from './Nav.parts';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Properties for the NavCategory sub-component. */\nexport interface NavCategoryProps extends React.HTMLAttributes<HTMLLIElement> {\n /**\n * Value identifying this category (used by `openCategories`), unique among the categories of\n * the Nav (a duplicate warns in development).\n */\n value: string;\n /**\n * Label of the category's toggle button (any content). Without it, the text children are used\n * as the label — deprecated: pass the label here and only the sub-items as children.\n */\n label?: React.ReactNode;\n /**\n * Icon displayed before the category label. Rendered with `aria-hidden=\"true\"`. A falsy icon\n * (`''`, `0`) or a list of nothing renders no icon box.\n */\n icon?: Slot<'span'>;\n /**\n * Replaces the expand chevron at the end of the toggle button (decorative, `aria-hidden`).\n * `null`/`undefined` keep the chevron, which turns while the category is open; `false`, or\n * anything that renders nothing, hides it (`aria-expanded` still reports the state). Your glyph\n * renders as given in a span with the expand icon's class and is not turned, so a glyph that\n * shows the state itself works (a plus or a minus, picked from your `openCategories`). It is\n * rendered inside the toggle button: a `<button>` or `Button` passed here (or a slot object\n * whose `as` is one) is not nested (its children become the glyph and its props are dropped,\n * with a development warning).\n */\n expandIcon?: Slot<'span'>;\n /**\n * Replaces the motion of the expand icon (Fluent's `NavCategoryItem expandIconMotion`): by\n * default the chevron's half turn as the category opens and closes is animated over the fast\n * duration (150 ms) with the easy-ease curve, both ways, and so is any transform of the span\n * around your own `expandIcon`. The turn itself is not motion: `null` turns the animation off\n * and the chevron still turns, at once; a class string or `{ className }` replaces it with\n * plain transition classes and a reduced-motion counterpart (the icon has no presence phases).\n * A `WaveProvider` with `motion=\"none\"` turns the default off, and a value here still applies\n * under it.\n * @default the animated turn described above\n */\n expandIconMotion?: MotionSlot | null;\n /**\n * Replaces the collapse of the category's list (Fluent's `NavSubItemGroup collapseMotion`), on\n * the element around its `<ul>`: by default the space the list takes opens from nothing and\n * closes back to it, with a fade, over the normal duration (200 ms) with the max easy-ease\n * curve, both ways. `null` turns it off (the list appears and disappears at once); a class\n * string or `{ className }` replaces it, written as `MotionSlot` describes. A `WaveProvider`\n * with `motion=\"none\"` turns the default off, and a value here still applies under it.\n * @default the collapse described above\n */\n motion?: MotionSlot | null;\n /**\n * The category's sub-items (`Nav.SubItem`), and `Nav.SectionHeader` and `Nav.Divider`, rendered\n * in its list while it is open (and while the list collapses after a close).\n */\n children?: React.ReactNode;\n /** Ref to the category's `<li>` element. */\n ref?: React.Ref<HTMLLIElement>;\n}\n\n/**\n * The props of Nav.Item that every branch shares ({@link NavItemAnchorProps},\n * {@link NavItemButtonProps}, {@link NavItemDynamicProps}).\n */\nexport interface NavItemOwnProps {\n /**\n * Value identifying this nav item, unique among the items and sub-items of the Nav (a duplicate\n * warns in development).\n */\n value: string;\n /**\n * Icon displayed before the item label. Rendered with `aria-hidden=\"true\"`. A falsy icon (`''`,\n * `0`) or a list of nothing renders no icon box.\n */\n icon?: Slot<'span'>;\n /**\n * Whether the item is disabled: a native `disabled` button, or an `aria-disabled` link without\n * `href`. Activating a disabled item never selects it; a disabled item whose value is the\n * current `value` still shows as current (`aria-current=\"page\"` and the selected look), because\n * the current value belongs to the app.\n */\n disabled?: boolean;\n /** Label content. */\n children?: React.ReactNode;\n /**\n * Controls beside the item in its row (Fluent's SplitNavItem): a ToggleButton that pins the\n * page, a MenuButton with more commands, each with its own name (a Tooltip with\n * `relationship=\"label\"` names an icon-only one). They render after the item's link or button,\n * never inside it, in a group named by the item; each is a Tab stop after the item, and a click\n * or key on one never selects the item. They are drawn while the row is hovered or has focus,\n * while one of them is pressed or has its popup open, and always in forced colours and on touch\n * screens; otherwise they are transparent and still focusable. They fade in and out over 150 ms\n * (at once under reduced motion or a `WaveProvider` with `motion=\"none\"`); the fade sets the\n * transition of each direct child of the group, so a transition of your own on one is replaced.\n * They stay enabled when the item is `disabled`. With actions, the selected background and\n * indicator are drawn on the row (the item's list item, `.wave-nav-item__list-item`), so a\n * `className` on the item no longer covers them. Content that renders nothing renders no group.\n * Fluent's `actionButton`, `toggleButton` and `menuButton` slots and their tooltips are your own\n * controls here.\n */\n actions?: React.ReactNode;\n}\n\n/**\n * Nav.Item rendered as a link (`href` given): anchor attributes, and handlers typed on\n * `HTMLAnchorElement`. 0.4 typed every item's handlers on `HTMLButtonElement`, so with a string\n * `href` an unannotated 0.4 handler that reads a button-only member (such as\n * `e.currentTarget.form`) no longer compiles; a handler already typed as\n * `React.MouseEventHandler<HTMLButtonElement>` still does (React handler types are bivariant).\n */\nexport interface NavItemAnchorProps\n extends\n NavItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof NavItemOwnProps> {\n /**\n * URL to navigate to; renders an `<a>`. Required in this branch, so `href` discriminates the\n * union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /** Ref to the `<a>` element. */\n ref?: React.Ref<HTMLAnchorElement>;\n}\n\n/** Nav.Item rendered as a button (no `href`): button attributes (a `rel` is not rendered). */\nexport interface NavItemButtonProps\n extends\n NavItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof NavItemOwnProps> {\n /** Button items have no `href`. */\n href?: undefined;\n /** Ref to the `<button>` element. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Properties for the NavItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends NavItemButtonProps`) or intersect (`type X = NavItemProps & { … }`).\n * `React.ComponentProps<typeof Nav.Item>` resolves to the last overload,\n * {@link NavItemDynamicProps}.\n */\nexport type NavItemProps = NavItemAnchorProps | NavItemButtonProps;\n\n/**\n * Nav.Item with an `href` known only at run time (`string | undefined`): a link when it is a\n * string, a button otherwise. Resolved after the button and link signatures.\n *\n * Only the attributes both elements share are accepted (no `target`, `download`, `type`, `form`,\n * …), and handlers receive events of either element (`HTMLAnchorElement | HTMLButtonElement`).\n * 0.4 typed them as button events (`HTMLAttributes<HTMLButtonElement>`), so an unannotated 0.4\n * handler that reads a button-only member (such as `e.currentTarget.form`) no longer compiles here;\n * narrow `e.currentTarget` first. (A string `href` types handlers on `HTMLAnchorElement`, see\n * {@link NavItemAnchorProps}; no `href` keeps `HTMLButtonElement`.)\n */\nexport interface NavItemDynamicProps\n extends\n NavItemOwnProps,\n Omit<React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, keyof NavItemOwnProps> {\n /** URL to navigate to; renders an `<a>` when defined, a `<button>` otherwise. */\n href?: string;\n /** Ref to the rendered `<a>` or `<button>` element. */\n ref?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;\n}\n\n/**\n * The props of Nav.SubItem that every branch shares: those of {@link NavItemOwnProps} without\n * `icon`.\n */\nexport type NavSubItemOwnProps = Omit<NavItemOwnProps, 'icon'>;\n\n/**\n * Nav.SubItem rendered as a link (`href` given): anchor attributes, and handlers typed on\n * `HTMLAnchorElement` (0.4: `HTMLButtonElement`); see {@link NavItemAnchorProps}.\n */\nexport interface NavSubItemAnchorProps\n extends\n NavSubItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof NavSubItemOwnProps> {\n /**\n * URL to navigate to; renders an `<a>`. Required in this branch, so `href` discriminates the\n * union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /** Ref to the `<a>` element. */\n ref?: React.Ref<HTMLAnchorElement>;\n}\n\n/** Nav.SubItem rendered as a button (no `href`): button attributes (a `rel` is not rendered). */\nexport interface NavSubItemButtonProps\n extends\n NavSubItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof NavSubItemOwnProps> {\n /** Button sub-items have no `href`. */\n href?: undefined;\n /** Ref to the `<button>` element. */\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n/**\n * Properties for the NavSubItem sub-component: link props with `href`, button props without.\n * A union type like {@link NavItemProps} (extend a branch or intersect; `React.ComponentProps`\n * resolves to {@link NavSubItemDynamicProps}).\n */\nexport type NavSubItemProps = NavSubItemAnchorProps | NavSubItemButtonProps;\n\n/**\n * Nav.SubItem with an `href` known only at run time (`string | undefined`): a link when it is a\n * string, a button otherwise. Only the attributes both elements share are accepted, and handlers\n * receive events of either element (0.4 typed them as button events); see\n * {@link NavItemDynamicProps}.\n */\nexport interface NavSubItemDynamicProps\n extends\n NavSubItemOwnProps,\n Omit<React.HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, keyof NavSubItemOwnProps> {\n /** URL to navigate to; renders an `<a>` when defined, a `<button>` otherwise. */\n href?: string;\n /** Ref to the rendered `<a>` or `<button>` element. */\n ref?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;\n}\n\n/** The props both entry kinds share at runtime (the union narrowed by `href`). */\ntype NavEntryProps = NavItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof NavItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst iconClasses = 'flex h-5 w-5 shrink-0 items-center justify-center';\n\n/**\n * The `icon` slot of Nav.Item and Nav.Category, or `null` when it renders nothing. A falsy icon\n * (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in 0.4 and as in\n * Avatar, and so is a collection whose items render nothing, so no empty 20px box is rendered\n * before the label. The check does not consume a generator: renderSlot still renders its items.\n */\nfunction renderIcon(\n icon: Slot<'span'> | undefined,\n className: string | undefined,\n): React.ReactElement | null {\n return icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(className, iconClasses), { 'aria-hidden': true })\n : null;\n}\n\nconst itemClasses = {\n base: cn(\n 'flex w-full items-center gap-2 px-4 py-2 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none',\n focusRingInset,\n disabledStyles,\n ),\n selected: 'bg-subtle-selected text-primary font-semibold border-s-2 border-s-primary',\n idle: 'text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover',\n // With actions, the selected background and indicator move to the row (D121).\n selectedInRow: 'text-primary font-semibold',\n rowSelected: 'bg-subtle-selected border-s-2 border-s-primary',\n};\n\nconst subItemClasses = {\n base: cn(\n 'flex w-full items-center ps-11 pe-4 py-1.5 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none',\n focusRingInset,\n disabledStyles,\n ),\n selected: 'text-primary font-semibold',\n idle: 'text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover',\n // Sub-items have no selected background: a sub-item row gets only the hover.\n selectedInRow: 'text-primary font-semibold',\n rowSelected: undefined,\n};\n\n/** The classes an entry's link or button and its row share. */\ninterface NavEntryClasses {\n base: string;\n selected: string;\n idle: string;\n selectedInRow: string;\n rowSelected: string | undefined;\n}\n\n/**\n * The row of an entry with actions (D121): the list item lays out the link or button and the\n * actions side by side and carries the selected look, or the hover of an enabled entry. A list\n * item cannot be disabled, so its hover needs no gate.\n */\nconst rowClasses =\n 'group/nav-row flex items-center transition-colors motion-reduce:transition-none';\nconst rowHoverClasses = 'hover:bg-subtle-hover';\n\n/**\n * The actions element (D120). Each direct child is transparent until the row is hovered or has\n * focus inside it, and is always drawn in forced colours and on devices without hover; a child\n * that is or holds a pressed toggle or an expanded trigger stays drawn (the first pair covers an\n * action wrapped in a Tooltip's span, the second a bare one). Opacity keeps every action\n * focusable, so Shift+Tab and a focus return reach it. The reveal fades: `renderNavEntry` adds\n * the actions' reveal motion of `lib/motion` to these classes unless the provider's motion is\n * `'none'` (it has no slot: it is not a presence motion).\n */\nconst actionsClasses = cn(\n 'flex shrink-0 items-center gap-1 pe-2',\n '*:opacity-0 group-hover/nav-row:*:opacity-100 group-focus-within/nav-row:*:opacity-100',\n 'forced-colors:*:opacity-100 [@media(hover:none)]:*:opacity-100',\n '*:has-[[aria-pressed=true]]:opacity-100 *:has-[[aria-expanded=true]]:opacity-100',\n '[&>[aria-pressed=true]]:opacity-100 [&>[aria-expanded=true]]:opacity-100',\n);\n\nconst categoryButtonClasses = cn(\n 'flex w-full items-center gap-2 px-4 py-2 text-body-1 font-semibold text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover transition-colors motion-reduce:transition-none',\n // A closed category that contains the current page shows the selected look of an item.\n 'data-[contains-current]:bg-subtle-selected data-[contains-current]:text-primary data-[contains-current]:border-s-2 data-[contains-current]:border-s-primary',\n focusRingInset,\n);\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Whether a click on a link opens it somewhere other than the current page, checked as routers\n * do: a modifier key (a new tab or window, a download), a mouse button other than the main one, a\n * `target` other than `_self`, or a `download` link. Only when the default is not prevented does\n * the browser actually open it there.\n */\nfunction opensElsewhere(event: React.MouseEvent<HTMLElement>): boolean {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return true;\n }\n const link = event.currentTarget;\n const target = link.getAttribute('target');\n return (!!target && target.toLowerCase() !== '_self') || link.hasAttribute('download');\n}\n\n/** The stable classes of an entry, written literally by Nav.Item and Nav.SubItem. */\ninterface NavEntryClassNames {\n root: string;\n listItem: string;\n actions: string;\n icon?: string;\n content?: string;\n}\n\n/**\n * Shared rendering of Nav.Item and Nav.SubItem (link or button). Inside an arrow-key body\n * (`roving` provided) the link or button also carries `data-roving-value={value}`, after the\n * consumer's attributes; in a plain Nav nothing is added. With `actions` that render content, the\n * list item becomes the row (D121) and holds the link or button, then the actions in a group named\n * by it through `generatedId` (unless the consumer gave an `id`), siblings, never nested (D119);\n * the group's reveal fades unless `motionPreference` is `'none'`.\n */\nfunction renderNavEntry(\n props: NavEntryProps,\n context: NavContextValue,\n roving: NavRovingContextValue | null,\n classes: NavEntryClasses,\n stable: NavEntryClassNames,\n withIcon: boolean,\n generatedId: string,\n motionPreference: MotionPreference,\n): React.ReactElement {\n const {\n value,\n icon,\n disabled = false,\n href,\n className,\n children,\n onClick,\n actions,\n ref,\n ...rest\n } = props;\n const isSelected = context.value === value;\n const isLink = href !== undefined;\n const rovingProps = roving ? { 'data-roving-value': value } : undefined;\n // No empty group (`actions={cond && <Button />}` with `cond` false); the id is rendered only\n // while the group points at it, so an item without actions keeps its 0.10 HTML.\n const hasActions = slotRendersContent(actions);\n const itemId = rest.id ?? generatedId;\n const idProps = hasActions ? { id: itemId } : undefined;\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n // A link is still selected when the consumer prevents its default (client-side routing:\n // `preventDefault()` + `router.push(href)`, whatever the modifier keys: the browser then opens\n // nothing elsewhere), but not when the browser opens it elsewhere (the current page does not\n // change); a button honours `preventDefault()` (C-COMPOSE).\n if (isLink ? !event.defaultPrevented && opensElsewhere(event) : event.defaultPrevented) return;\n context.select(value);\n };\n\n const content = (\n <>\n {withIcon && renderIcon(icon, stable.icon)}\n {withIcon ? (\n <span className={cn(stable.content, 'flex-1 text-start')}>{children}</span>\n ) : (\n children\n )}\n </>\n );\n\n const entryClassName = cn(\n stable.root,\n classes.base,\n isSelected ? (hasActions ? classes.selectedInRow : classes.selected) : classes.idle,\n hasActions && 'min-w-0 flex-1',\n className,\n );\n\n const listItemClassName = hasActions\n ? cn(\n stable.listItem,\n rowClasses,\n isSelected && classes.rowSelected ? classes.rowSelected : !disabled && rowHoverClasses,\n )\n : stable.listItem;\n\n const actionsGroup = hasActions ? (\n <span\n role=\"group\"\n aria-labelledby={itemId}\n data-wave-nav-actions=\"\"\n className={cn(\n stable.actions,\n actionsClasses,\n motionPreference === 'none' ? undefined : navActionsReveal,\n )}\n >\n {materialiseSlotContent(actions)}\n </span>\n ) : null;\n\n if (isLink) {\n return (\n <li className={listItemClassName}>\n <a\n {...(rest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n {...idProps}\n {...rovingProps}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={disabled ? undefined : href}\n role={disabled ? 'link' : rest.role}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n aria-current={isSelected ? 'page' : undefined}\n onClick={handleClick}\n className={entryClassName}\n >\n {content}\n </a>\n {actionsGroup}\n </li>\n );\n }\n\n // `rel` only belongs on a link: a button item drops it (React types it on every element).\n const { rel, ...buttonRest } = rest;\n return (\n <li className={listItemClassName}>\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n {...idProps}\n {...rovingProps}\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={disabled}\n aria-current={isSelected ? 'page' : undefined}\n onClick={handleClick}\n className={entryClassName}\n >\n {content}\n </button>\n {actionsGroup}\n </li>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Nav.Category\n// ---------------------------------------------------------------------------\n\n/**\n * A collapsible group of sub-items. Its toggle button shows `label` and reports `aria-expanded`\n * (and `aria-controls` while open); the sub-items render in a nested list while it is open and\n * while the list collapses after a close. Open state lives on `Nav`\n * (`openCategories`/`defaultOpenCategories`).\n *\n * The list renders as the only child of a collapse element (its stable class\n * `wave-nav-category__collapse`), which opens and closes the list's space (`motion`) and has no\n * box of its own while the category is open, so the list lays out in the category as before. A\n * category open by default appears without motion. After a close the list stays in the document\n * until the collapse ends, `inert` (its items leave the Tab order and an arrow-key body's arrow\n * keys at once), while the toggle button already reports the category closed, without\n * `aria-controls`; opening the category again during the collapse keeps the same list. Focus\n * inside the list when the category closes moves to the toggle button. The expand chevron turns\n * while the category is open (`expandIcon` replaces it, `expandIconMotion` animates its turn).\n *\n * A closed category that contains the current item marks its toggle button with\n * `aria-current=\"true\"` (the button is not the page's link, so not `\"page\"`),\n * `data-contains-current` and the selected look of `Nav.Item`. It contains the current item when\n * a `Nav.SubItem` with the current value is among its children (through Fragments and wrapper\n * elements, also in the server HTML), when the current sub-item was last shown in it (and has not\n * moved among another category's children since), or when it is the Nav's `currentCategory`. An\n * open category is not marked: its sub-item shows the current page.\n *\n * Also exported as `NavCategory` (import the flat name from React Server Components).\n */\nconst NavCategory = ({\n value,\n label,\n icon,\n expandIcon,\n expandIconMotion,\n motion,\n className,\n children,\n ref,\n ...rest\n}: NavCategoryProps) => {\n const context = useNavContext('Nav.Category');\n const roving = React.useContext(NavRovingContext);\n const {\n value: currentValue,\n openCategories,\n toggleCategory,\n currentCategory,\n categoryStore,\n } = context;\n useNavValue(context, 'category', value);\n const listId = useId('wave-nav-category');\n const isOpen = openCategories.includes(value);\n\n // The current sub-item is among the children of this closed category (also on the server).\n const holdsCurrentChild = !isOpen && currentValue !== '' && containsValue(children, currentValue);\n // The current sub-item was last shown in this category (none on the server).\n const holdsShownCurrent = React.useSyncExternalStore(\n categoryStore.subscribe,\n () => currentValue !== '' && categoryStore.get(currentValue) === value,\n () => false,\n );\n // Children that hold the current sub-item make this the category the Nav remembers for it, so a\n // category it was shown in before it moved here is no longer marked. The entry is forgotten when\n // they stop holding it (an open category records through its mounted sub-item instead).\n React.useLayoutEffect(() => {\n if (!holdsCurrentChild) return;\n categoryStore.record(currentValue, value);\n return () => categoryStore.forget(currentValue, value);\n }, [categoryStore, holdsCurrentChild, currentValue, value]);\n const containsCurrent =\n !isOpen && (currentCategory === value || holdsShownCurrent || holdsCurrentChild);\n // Inside an arrow-key body: whether this is a closed category that holds the current page (the\n // body's first Tab stop), before paint; nothing is reported in a plain Nav.\n React.useLayoutEffect(() => {\n if (!roving) return;\n roving.reportCurrentCategory(value, containsCurrent);\n return () => roving.reportCurrentCategory(value, false);\n }, [roving, value, containsCurrent]);\n // Development only: every child of the open list is an <li> (`Nav.Category:list-child`).\n const listRef = React.useRef<HTMLUListElement>(null);\n useNavListChildCheck(listRef, 'Nav.Category', 'sub-items');\n\n // The list renders in a collapse element (the presence element) while the category is open\n // and, after a close, until that element's motion ends; focus inside the list at the close\n // moves to the toggle button.\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const {\n isMounted: isListMounted,\n wrapperRef: collapseRef,\n presenceProps: collapsePresenceProps,\n className: collapseClassName,\n } = useCollapsePresence(isOpen, {\n motion,\n partRef: listRef,\n getTrigger: () => buttonRef.current,\n });\n\n // The optional-indicator slot rule (C-SLOTS): `null`/`undefined` keep the chevron, which turns\n // while open; `false` or content that renders nothing hides it; a custom glyph is rendered as\n // given in its span and never turned. `expandIconMotion` animates the transform of either. The\n // glyph sits inside the toggle button, so a button passed as the glyph is unwrapped (its\n // children are the glyph, its props are dropped), never nested.\n const { glyph: expandGlyph, button: expandIconButton } = unwrapButtonGlyph(expandIcon);\n React.useEffect(() => {\n if (expandIconButton) {\n warnOnce(\n 'Nav.Category:expandIcon-button',\n `Nav.Category: \\`expandIcon\\` received ${expandIconButton}; its children render as the ` +\n 'glyph of the toggle button and its props were dropped (buttons cannot be nested). ' +\n 'Pass icon content instead, e.g. `expandIcon={<MyIcon />}`.',\n );\n }\n }, [expandIconButton]);\n const expandIconMotionClassName = useMotionClasses(expandIconMotion, expandIconRecipe);\n let expandIconElement: React.ReactNode = null;\n if (expandGlyph === undefined || expandGlyph === null) {\n expandIconElement = (\n <ChevronDownIcon\n className={cn(\n navCategoryClassNames.expandIcon,\n 'shrink-0',\n expandIconMotionClassName,\n isOpen && 'rotate-180',\n )}\n />\n );\n } else if (slotRendersContent(expandGlyph)) {\n expandIconElement = renderSlot(\n expandGlyph,\n 'span',\n cn(navCategoryClassNames.expandIcon, 'inline-flex shrink-0', expandIconMotionClassName),\n { 'aria-hidden': true },\n );\n }\n\n let buttonLabel: React.ReactNode = label;\n let items: React.ReactNode = children;\n if (label === undefined) {\n // Deprecated 0.4 path: the text children are the label, the other children the sub-items.\n warnDeprecated(\n 'Nav.Category',\n 'text children as the label',\n 'label',\n 'Pass the category label in `label` and only the sub-items as children.',\n );\n const parts = React.Children.toArray(children);\n const isText = (part: unknown) => typeof part === 'string' || typeof part === 'number';\n buttonLabel = parts.filter(isText).join('');\n items = parts.filter((part) => !isText(part));\n }\n\n return (\n <li ref={ref} {...rest} className={cn(navCategoryClassNames.root, className)}>\n <button\n ref={buttonRef}\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? listId : undefined}\n aria-current={containsCurrent ? true : undefined}\n data-contains-current={containsCurrent ? '' : undefined}\n data-roving-value={roving ? `wave-nav-category:${value}` : undefined}\n onClick={() => toggleCategory(value)}\n className={cn(navCategoryClassNames.button, categoryButtonClasses)}\n >\n {renderIcon(icon, navCategoryClassNames.icon)}\n <span className={cn(navCategoryClassNames.label, 'flex-1 text-start')}>{buttonLabel}</span>\n {expandIconElement}\n </button>\n {isListMounted && (\n <NavCategoryValueContext.Provider value={value}>\n <div\n ref={collapseRef}\n {...collapsePresenceProps}\n className={cn(navCategoryClassNames.collapse, collapseClassName)}\n >\n <ul\n ref={listRef}\n id={listId}\n className={cn(navCategoryClassNames.list, 'm-0 list-none p-0')}\n >\n {items}\n </ul>\n </div>\n </NavCategoryValueContext.Provider>\n )}\n </li>\n );\n};\nNavCategory.displayName = 'NavCategory';\nmarkNavPart(NavCategory, 'category');\n\n// ---------------------------------------------------------------------------\n// Nav.Item / Nav.SubItem\n// ---------------------------------------------------------------------------\n\n/**\n * A top-level navigation entry: a link when `href` is given (anchor props), a button otherwise\n * (button props). Clicking selects it (`aria-current=\"page\"`); activating a disabled entry never\n * selects it (a disabled entry whose value is the current value still shows as current).\n *\n * A click that opens a link somewhere other than the current page selects nothing (the consumer's\n * `onClick` still runs, and the browser opens the link): Ctrl/Cmd/Shift/Alt-click, a mouse button\n * other than the main one, a `target` other than `_self`, or a `download` link. When the consumer's\n * `onClick` calls `preventDefault()` (client-side routing), the browser opens nothing, so the item\n * is selected whatever the keys, button or `target`.\n *\n * `actions` puts your own controls (a pin toggle, a menu button) beside the item in its row, in a\n * group named by the item; they never select it.\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link NavItemDynamicProps}: events of either element).\n *\n * Also exported as `NavItem` (import the flat name from React Server Components).\n */\nfunction NavItem(props: NavItemButtonProps): React.ReactElement;\nfunction NavItem(props: NavItemAnchorProps): React.ReactElement;\nfunction NavItem(props: NavItemDynamicProps): React.ReactElement;\nfunction NavItem(props: NavItemProps | NavItemDynamicProps): React.ReactElement {\n const context = useNavContext('Nav.Item');\n useNavValue(context, 'item', props.value);\n useRecordCategory(context, props.value);\n const roving = React.useContext(NavRovingContext);\n // Called always, rendered only while the item's actions render (D119).\n const generatedId = useId('wave-nav-item');\n const motionPreference = useMotionPreference();\n return renderNavEntry(\n props as NavEntryProps,\n context,\n roving,\n itemClasses,\n {\n root: navItemClassNames.root,\n listItem: navItemClassNames.listItem,\n actions: navItemClassNames.actions,\n icon: navItemClassNames.icon,\n content: navItemClassNames.content,\n },\n true,\n generatedId,\n motionPreference,\n );\n}\nNavItem.displayName = 'NavItem';\nmarkNavPart(NavItem, 'entry');\n\n/**\n * An indented entry inside a `Nav.Category`: a link when `href` is given, a button otherwise.\n * Selected like `Nav.Item` (a click that the browser opens somewhere else selects nothing; one\n * whose default your `onClick` prevents is selected), and typed by overloads like `Nav.Item`\n * (button, link, then {@link NavSubItemDynamicProps}). Takes `actions` like `Nav.Item`.\n *\n * Also exported as `NavSubItem` (import the flat name from React Server Components).\n */\nfunction NavSubItem(props: NavSubItemButtonProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemAnchorProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemDynamicProps): React.ReactElement;\nfunction NavSubItem(props: NavSubItemProps | NavSubItemDynamicProps): React.ReactElement {\n const context = useNavContext('Nav.SubItem');\n useNavValue(context, 'item', props.value);\n useRecordCategory(context, props.value);\n const roving = React.useContext(NavRovingContext);\n // Called always, rendered only while the sub-item's actions render (D119).\n const generatedId = useId('wave-nav-item');\n const motionPreference = useMotionPreference();\n return renderNavEntry(\n props as NavEntryProps,\n context,\n roving,\n subItemClasses,\n {\n root: navSubItemClassNames.root,\n listItem: navSubItemClassNames.listItem,\n actions: navSubItemClassNames.actions,\n },\n false,\n generatedId,\n motionPreference,\n );\n}\nNavSubItem.displayName = 'NavSubItem';\nmarkNavPart(NavSubItem, 'entry');\n\n/**\n * A vertical side navigation (`<nav>` landmark, default name \"Navigation\") with items, links and\n * collapsible categories.\n *\n * - **Selection**: `value`/`defaultValue`/`onValueChange` (`onValueChange` fires only when the\n * value changes). The deprecated `selectedValue`/`defaultSelectedValue`/`onNavItemSelect` still\n * work; `onNavItemSelect` keeps firing on every activation, re-selection included. A click that\n * opens a link in another tab or window (or downloads it) selects nothing, unless the item's\n * `onClick` prevents the default (client-side routing: then nothing opens elsewhere).\n * - **Categories**: `openCategories`/`defaultOpenCategories`/`onOpenCategoriesChange`. Without\n * `defaultOpenCategories`, the categories containing the selected item (`value` or\n * `defaultValue`) start open. A closed category that contains the selected item marks its toggle\n * (`aria-current=\"true\"`, `data-contains-current`, the selected look); pass `currentCategory`\n * for sub-items your own component renders inside a closed category.\n * - **Values** are unique: among the items and sub-items, and among the categories (a duplicate\n * warns in development).\n * - **Structure**: every child of the Nav, and of a category, is a part or your own `<li>`; a\n * development warning names anything else (a `<div>`, text, the wrapper of a Tooltip around an\n * item). `Nav.SectionHeader` is a heading between groups of items (`<h3>` unless\n * `headingLevel`, which stands for the `as` of Fluent's NavSectionHeader), and `Nav.Divider` a\n * line between groups, hidden from assistive technology (Fluent's NavDivider is a separator).\n * - **App identity**: `Nav.AppItem` shows the app's name and logo at the top, as a link with\n * `href` or a button; it is never selected. `Nav.AppItemStatic` shows them as plain text.\n * - **Item actions**: `actions` on `Nav.Item` and `Nav.SubItem` (Fluent's SplitNavItem) puts your\n * own controls beside the item, in a group named by it; each is a Tab stop after the item, and\n * none selects it. They fade in while the row is hovered or has focus, while one is pressed or\n * has its menu open, and are always drawn on touch screens and in forced colours. With actions, a\n * selected item's background and indicator are drawn on its row (`.wave-nav-item__list-item`).\n * - **Motion**: a category's list opens and closes its space with a short collapse and fade\n * (`motion` on `Nav.Category`), its chevron's turn is animated (`expandIconMotion`) and item\n * actions fade in. None of these defaults runs under reduced motion, and a `WaveProvider` with\n * `motion=\"none\"` turns them off, while a category's own `motion` or `expandIconMotion` value\n * still applies. Focus inside a list that closes moves to its category's toggle button.\n *\n * Sub-components are also exported under flat names (`NavCategory`, `NavItem`, `NavSubItem`,\n * `NavSectionHeader`, `NavDivider`, `NavAppItem`, `NavAppItemStatic`): React Server Components\n * import those, because dotted access (`Nav.Item`) needs a client file.\n */\nexport const Nav = /* @__PURE__ */ Object.assign(NavRoot, {\n Category: NavCategory,\n Item: NavItem,\n SubItem: NavSubItem,\n SectionHeader: NavSectionHeader,\n Divider: NavDivider,\n AppItem: NavAppItem,\n AppItemStatic: NavAppItemStatic,\n});\n\nexport {\n NavCategory,\n NavItem,\n NavSubItem,\n NavSectionHeader,\n NavDivider,\n NavAppItem,\n NavAppItemStatic,\n};\n"],"mappings":"mnBAsSA,IAAM+C,EAAc,oDAQpB,SAASC,EACP,EACA,EAC2B,CAC3B,OAAOC,GAAQjD,EAAAA,mBAAmBiD,CAAI,EAClChD,EAAAA,WAAWgD,EAAM,OAAQ/C,EAAAA,GAAGgD,EAAWH,CAAW,EAAG,CAAE,cAAe,EAAK,CAAC,EAC5E,IACN,CAEA,IAAMI,EAAc,CAClB,KAAMjD,EAAAA,GACJ,+HACAC,EAAAA,eACAC,EAAAA,cACF,EACA,SAAU,4EACV,KAAM,uEAEN,cAAe,6BACf,YAAa,gDACf,EAEMgD,EAAiB,CACrB,KAAMlD,EAAAA,GACJ,iIACAC,EAAAA,eACAC,EAAAA,cACF,EACA,SAAU,6BACV,KAAM,kIAEN,cAAe,6BACf,YAAa,IAAA,EACf,EAgBMiD,EACJ,kFACIC,EAAkB,wBAWlBC,EAAiBrD,EAAAA,GACrB,wCACA,yFACA,iEACA,mFACA,0EACF,EAEMsD,EAAwBtD,EAAAA,GAC5B,0LAEA,8JACAC,EAAAA,cACF,EAYA,SAASsD,EAAe,EAA+C,CACrE,GAAIC,EAAM,SAAW,GAAKA,EAAM,SAAWA,EAAM,SAAWA,EAAM,UAAYA,EAAM,OAClF,MAAO,GAET,IAAMC,EAAOD,EAAM,cACbE,EAASD,EAAK,aAAa,QAAQ,EACzC,MAAQ,CAAC,CAACC,GAAUA,EAAO,YAAY,IAAM,SAAYD,EAAK,aAAa,UAAU,CACvF,CAmBA,SAASE,EACP,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACoB,CACpB,GAAM,CACJ,QACA,OACA,WAAW,GACX,OACA,YACA,WACA,UACA,UACA,MACA,GAAGC,GACDC,EACEC,EAAaC,EAAQ,QAAUC,EAC/BC,EAASC,IAAS,IAAA,GAClBC,EAAcC,EAAS,CA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,WACT,QAASC,EAAAA,WACT,cAAeC,EAAAA,gBACjB,CAAC"}
@@ -1,184 +1,204 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/cn.mjs";
3
- import { warnDeprecated as t } from "../../lib/dev.mjs";
4
- import { materialiseSlotContent as n, renderSlot as r, slotRendersContent as i } from "../../lib/slot.mjs";
5
- import { navCategoryClassNames as a, navItemClassNames as o, navSubItemClassNames as s } from "../../lib/classNames.mjs";
6
- import { useId as c } from "../../hooks/useId.mjs";
7
- import { disabledStyles as l, focusRingInset as u } from "../../lib/styles.mjs";
8
- import { ChevronDownIcon as d } from "../../lib/icons.mjs";
9
- import { NavCategoryValueContext as f, NavRovingContext as p, containsValue as m, markNavPart as h, useNavContext as g, useNavListChildCheck as _, useNavValue as v, useRecordCategory as y } from "./Nav.context.mjs";
10
- import { NavAppItem as b, NavAppItemStatic as x, NavDivider as S, NavSectionHeader as C } from "./Nav.parts.mjs";
11
- import { NavRoot as w } from "./Nav.root.mjs";
12
- import * as T from "react";
13
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
3
+ import { warnDeprecated as t, warnOnce as n } from "../../lib/dev.mjs";
4
+ import { materialiseSlotContent as r, renderSlot as i, slotRendersContent as a } from "../../lib/slot.mjs";
5
+ import { navCategoryClassNames as o, navItemClassNames as s, navSubItemClassNames as c } from "../../lib/classNames.mjs";
6
+ import { useId as l } from "../../hooks/useId.mjs";
7
+ import { disabledStyles as u, focusRingInset as d } from "../../lib/styles.mjs";
8
+ import { unwrapButtonGlyph as f } from "../button/Button.slots.mjs";
9
+ import { ChevronDownIcon as p } from "../../lib/icons.mjs";
10
+ import { expandIconMotion as m, navActionsRevealMotion as h } from "../../lib/motion.mjs";
11
+ import { useMotionClasses as g, useMotionPreference as _ } from "../../hooks/useMotion.mjs";
12
+ import { useCollapsePresence as v } from "../../hooks/useCollapsePresence.mjs";
13
+ import { NavCategoryValueContext as y, NavRovingContext as b, containsValue as x, markNavPart as S, useNavContext as C, useNavListChildCheck as w, useNavValue as T, useRecordCategory as E } from "./Nav.context.mjs";
14
+ import { NavAppItem as D, NavAppItemStatic as O, NavDivider as k, NavSectionHeader as A } from "./Nav.parts.mjs";
15
+ import { NavRoot as j } from "./Nav.root.mjs";
16
+ import * as M from "react";
17
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
14
18
  //#region src/components/navigation/Nav.tsx
15
- var k = "flex h-5 w-5 shrink-0 items-center justify-center";
16
- function A(t, n) {
17
- return t && i(t) ? r(t, "span", e(n, k), { "aria-hidden": !0 }) : null;
19
+ var I = "flex h-5 w-5 shrink-0 items-center justify-center";
20
+ function L(t, n) {
21
+ return t && a(t) ? i(t, "span", e(n, I), { "aria-hidden": !0 }) : null;
18
22
  }
19
- var j = {
20
- base: e("flex w-full items-center gap-2 px-4 py-2 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none", u, l),
23
+ var R = {
24
+ base: e("flex w-full items-center gap-2 px-4 py-2 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none", d, u),
21
25
  selected: "bg-subtle-selected text-primary font-semibold border-s-2 border-s-primary",
22
26
  idle: "text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover",
23
27
  selectedInRow: "text-primary font-semibold",
24
28
  rowSelected: "bg-subtle-selected border-s-2 border-s-primary"
25
- }, M = {
26
- base: e("flex w-full items-center ps-11 pe-4 py-1.5 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none", u, l),
29
+ }, z = {
30
+ base: e("flex w-full items-center ps-11 pe-4 py-1.5 text-body-1 text-start no-underline transition-colors motion-reduce:transition-none", d, u),
27
31
  selected: "text-primary font-semibold",
28
32
  idle: "text-muted-foreground not-disabled:not-aria-disabled:hover:text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover",
29
33
  selectedInRow: "text-primary font-semibold",
30
34
  rowSelected: void 0
31
- }, N = "group/nav-row flex items-center transition-colors motion-reduce:transition-none", P = "hover:bg-subtle-hover", F = e("flex shrink-0 items-center gap-1 pe-2", "*:opacity-0 group-hover/nav-row:*:opacity-100 group-focus-within/nav-row:*:opacity-100", "forced-colors:*:opacity-100 [@media(hover:none)]:*:opacity-100", "*:has-[[aria-pressed=true]]:opacity-100 *:has-[[aria-expanded=true]]:opacity-100", "[&>[aria-pressed=true]]:opacity-100 [&>[aria-expanded=true]]:opacity-100"), I = e("flex w-full items-center gap-2 px-4 py-2 text-body-1 font-semibold text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover transition-colors motion-reduce:transition-none", "data-[contains-current]:bg-subtle-selected data-[contains-current]:text-primary data-[contains-current]:border-s-2 data-[contains-current]:border-s-primary", u);
32
- function L(e) {
35
+ }, B = "group/nav-row flex items-center transition-colors motion-reduce:transition-none", V = "hover:bg-subtle-hover", H = e("flex shrink-0 items-center gap-1 pe-2", "*:opacity-0 group-hover/nav-row:*:opacity-100 group-focus-within/nav-row:*:opacity-100", "forced-colors:*:opacity-100 [@media(hover:none)]:*:opacity-100", "*:has-[[aria-pressed=true]]:opacity-100 *:has-[[aria-expanded=true]]:opacity-100", "[&>[aria-pressed=true]]:opacity-100 [&>[aria-expanded=true]]:opacity-100"), ee = e("flex w-full items-center gap-2 px-4 py-2 text-body-1 font-semibold text-foreground not-disabled:not-aria-disabled:hover:bg-subtle-hover transition-colors motion-reduce:transition-none", "data-[contains-current]:bg-subtle-selected data-[contains-current]:text-primary data-[contains-current]:border-s-2 data-[contains-current]:border-s-primary", d);
36
+ function U(e) {
33
37
  if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return !0;
34
38
  let t = e.currentTarget, n = t.getAttribute("target");
35
39
  return !!n && n.toLowerCase() !== "_self" || t.hasAttribute("download");
36
40
  }
37
- function R(t, r, a, o, s, c, l) {
38
- let { value: u, icon: d, disabled: f = !1, href: p, className: m, children: h, onClick: g, actions: _, ref: v, ...y } = t, b = r.value === u, x = p !== void 0, S = a ? { "data-roving-value": u } : void 0, C = i(_), w = y.id ?? l, T = C ? { id: w } : void 0, k = (e) => {
39
- if (f) {
41
+ function W(t, n, i, o, s, c, l, u) {
42
+ let { value: d, icon: f, disabled: p = !1, href: m, className: g, children: _, onClick: v, actions: y, ref: b, ...x } = t, S = n.value === d, C = m !== void 0, w = i ? { "data-roving-value": d } : void 0, T = a(y), E = x.id ?? l, D = T ? { id: E } : void 0, O = (e) => {
43
+ if (p) {
40
44
  e.preventDefault();
41
45
  return;
42
46
  }
43
- g?.(e), !(x ? !e.defaultPrevented && L(e) : e.defaultPrevented) && r.select(u);
44
- }, j = /* @__PURE__ */ O(E, { children: [c && A(d, s.icon), c ? /* @__PURE__ */ D("span", {
47
+ v?.(e), !(C ? !e.defaultPrevented && U(e) : e.defaultPrevented) && n.select(d);
48
+ }, k = /* @__PURE__ */ F(N, { children: [c && L(f, s.icon), c ? /* @__PURE__ */ P("span", {
45
49
  className: e(s.content, "flex-1 text-start"),
46
- children: h
47
- }) : h] }), M = e(s.root, o.base, b ? C ? o.selectedInRow : o.selected : o.idle, C && "min-w-0 flex-1", m), I = C ? e(s.listItem, N, b && o.rowSelected ? o.rowSelected : !f && P) : s.listItem, R = C ? /* @__PURE__ */ D("span", {
50
+ children: _
51
+ }) : _] }), A = e(s.root, o.base, S ? T ? o.selectedInRow : o.selected : o.idle, T && "min-w-0 flex-1", g), j = T ? e(s.listItem, B, S && o.rowSelected ? o.rowSelected : !p && V) : s.listItem, M = T ? /* @__PURE__ */ P("span", {
48
52
  role: "group",
49
- "aria-labelledby": w,
53
+ "aria-labelledby": E,
50
54
  "data-wave-nav-actions": "",
51
- className: e(s.actions, F),
52
- children: n(_)
55
+ className: e(s.actions, H, u === "none" ? void 0 : h),
56
+ children: r(y)
53
57
  }) : null;
54
- if (x) return /* @__PURE__ */ O("li", {
55
- className: I,
56
- children: [/* @__PURE__ */ D("a", {
57
- ...y,
58
- ...T,
59
- ...S,
60
- ref: v,
61
- href: f ? void 0 : p,
62
- role: f ? "link" : y.role,
63
- "aria-disabled": f ? !0 : y["aria-disabled"],
64
- "aria-current": b ? "page" : void 0,
65
- onClick: k,
66
- className: M,
67
- children: j
68
- }), R]
58
+ if (C) return /* @__PURE__ */ F("li", {
59
+ className: j,
60
+ children: [/* @__PURE__ */ P("a", {
61
+ ...x,
62
+ ...D,
63
+ ...w,
64
+ ref: b,
65
+ href: p ? void 0 : m,
66
+ role: p ? "link" : x.role,
67
+ "aria-disabled": p ? !0 : x["aria-disabled"],
68
+ "aria-current": S ? "page" : void 0,
69
+ onClick: O,
70
+ className: A,
71
+ children: k
72
+ }), M]
69
73
  });
70
- let { rel: z, ...B } = y;
71
- return /* @__PURE__ */ O("li", {
72
- className: I,
73
- children: [/* @__PURE__ */ D("button", {
74
+ let { rel: I, ...R } = x;
75
+ return /* @__PURE__ */ F("li", {
76
+ className: j,
77
+ children: [/* @__PURE__ */ P("button", {
74
78
  type: "button",
75
- ...B,
76
- ...T,
77
- ...S,
78
- ref: v,
79
- disabled: f,
80
- "aria-current": b ? "page" : void 0,
81
- onClick: k,
82
- className: M,
83
- children: j
84
- }), R]
79
+ ...R,
80
+ ...D,
81
+ ...w,
82
+ ref: b,
83
+ disabled: p,
84
+ "aria-current": S ? "page" : void 0,
85
+ onClick: O,
86
+ className: A,
87
+ children: k
88
+ }), M]
85
89
  });
86
90
  }
87
- var z = ({ value: n, label: r, icon: i, className: o, children: s, ref: l, ...u }) => {
88
- let h = g("Nav.Category"), y = T.useContext(p), { value: b, openCategories: x, toggleCategory: S, currentCategory: C, categoryStore: w } = h;
89
- v(h, "category", n);
90
- let E = c("wave-nav-category"), k = x.includes(n), j = !k && b !== "" && m(s, b), M = T.useSyncExternalStore(w.subscribe, () => b !== "" && w.get(b) === n, () => !1);
91
- T.useLayoutEffect(() => {
92
- if (j) return w.record(b, n), () => w.forget(b, n);
91
+ var G = ({ value: r, label: s, icon: c, expandIcon: u, expandIconMotion: d, motion: h, className: _, children: S, ref: E, ...D }) => {
92
+ let O = C("Nav.Category"), k = M.useContext(b), { value: A, openCategories: j, toggleCategory: N, currentCategory: I, categoryStore: R } = O;
93
+ T(O, "category", r);
94
+ let z = l("wave-nav-category"), B = j.includes(r), V = !B && A !== "" && x(S, A), H = M.useSyncExternalStore(R.subscribe, () => A !== "" && R.get(A) === r, () => !1);
95
+ M.useLayoutEffect(() => {
96
+ if (V) return R.record(A, r), () => R.forget(A, r);
93
97
  }, [
94
- w,
95
- j,
96
- b,
97
- n
98
+ R,
99
+ V,
100
+ A,
101
+ r
98
102
  ]);
99
- let N = !k && (C === n || M || j);
100
- T.useLayoutEffect(() => {
101
- if (y) return y.reportCurrentCategory(n, N), () => y.reportCurrentCategory(n, !1);
103
+ let U = !B && (I === r || H || V);
104
+ M.useLayoutEffect(() => {
105
+ if (k) return k.reportCurrentCategory(r, U), () => k.reportCurrentCategory(r, !1);
102
106
  }, [
103
- y,
104
- n,
105
- N
107
+ k,
108
+ r,
109
+ U
106
110
  ]);
107
- let P = T.useRef(null);
108
- _(P, "Nav.Category", "sub-items");
109
- let F = r, L = s;
110
- if (r === void 0) {
111
+ let W = M.useRef(null);
112
+ w(W, "Nav.Category", "sub-items");
113
+ let G = M.useRef(null), { isMounted: K, wrapperRef: q, presenceProps: J, className: te } = v(B, {
114
+ motion: h,
115
+ partRef: W,
116
+ getTrigger: () => G.current
117
+ }), { glyph: Y, button: X } = f(u);
118
+ M.useEffect(() => {
119
+ X && n("Nav.Category:expandIcon-button", `Nav.Category: \`expandIcon\` received ${X}; its children render as the glyph of the toggle button and its props were dropped (buttons cannot be nested). Pass icon content instead, e.g. \`expandIcon={<MyIcon />}\`.`);
120
+ }, [X]);
121
+ let Z = g(d, m), Q = null;
122
+ Y == null ? Q = /* @__PURE__ */ P(p, { className: e(o.expandIcon, "shrink-0", Z, B && "rotate-180") }) : a(Y) && (Q = i(Y, "span", e(o.expandIcon, "inline-flex shrink-0", Z), { "aria-hidden": !0 }));
123
+ let $ = s, ne = S;
124
+ if (s === void 0) {
111
125
  t("Nav.Category", "text children as the label", "label", "Pass the category label in `label` and only the sub-items as children.");
112
- let e = T.Children.toArray(s), n = (e) => typeof e == "string" || typeof e == "number";
113
- F = e.filter(n).join(""), L = e.filter((e) => !n(e));
126
+ let e = M.Children.toArray(S), n = (e) => typeof e == "string" || typeof e == "number";
127
+ $ = e.filter(n).join(""), ne = e.filter((e) => !n(e));
114
128
  }
115
- return /* @__PURE__ */ O("li", {
116
- ref: l,
117
- ...u,
118
- className: e(a.root, o),
119
- children: [/* @__PURE__ */ O("button", {
129
+ return /* @__PURE__ */ F("li", {
130
+ ref: E,
131
+ ...D,
132
+ className: e(o.root, _),
133
+ children: [/* @__PURE__ */ F("button", {
134
+ ref: G,
120
135
  type: "button",
121
- "aria-expanded": k,
122
- "aria-controls": k ? E : void 0,
123
- "aria-current": N ? !0 : void 0,
124
- "data-contains-current": N ? "" : void 0,
125
- "data-roving-value": y ? `wave-nav-category:${n}` : void 0,
126
- onClick: () => S(n),
127
- className: e(a.button, I),
136
+ "aria-expanded": B,
137
+ "aria-controls": B ? z : void 0,
138
+ "aria-current": U ? !0 : void 0,
139
+ "data-contains-current": U ? "" : void 0,
140
+ "data-roving-value": k ? `wave-nav-category:${r}` : void 0,
141
+ onClick: () => N(r),
142
+ className: e(o.button, ee),
128
143
  children: [
129
- A(i, a.icon),
130
- /* @__PURE__ */ D("span", {
131
- className: e(a.label, "flex-1 text-start"),
132
- children: F
144
+ L(c, o.icon),
145
+ /* @__PURE__ */ P("span", {
146
+ className: e(o.label, "flex-1 text-start"),
147
+ children: $
133
148
  }),
134
- /* @__PURE__ */ D(d, { className: e(a.expandIcon, "shrink-0 transition-transform motion-reduce:transition-none", k && "rotate-180") })
149
+ Q
135
150
  ]
136
- }), k && /* @__PURE__ */ D(f.Provider, {
137
- value: n,
138
- children: /* @__PURE__ */ D("ul", {
139
- ref: P,
140
- id: E,
141
- className: e(a.list, "m-0 list-none p-0"),
142
- children: L
151
+ }), K && /* @__PURE__ */ P(y.Provider, {
152
+ value: r,
153
+ children: /* @__PURE__ */ P("div", {
154
+ ref: q,
155
+ ...J,
156
+ className: e(o.collapse, te),
157
+ children: /* @__PURE__ */ P("ul", {
158
+ ref: W,
159
+ id: z,
160
+ className: e(o.list, "m-0 list-none p-0"),
161
+ children: ne
162
+ })
143
163
  })
144
164
  })]
145
165
  });
146
166
  };
147
- z.displayName = "NavCategory", h(z, "category");
148
- function B(e) {
149
- let t = g("Nav.Item");
150
- v(t, "item", e.value), y(t, e.value);
151
- let n = T.useContext(p), r = c("wave-nav-item");
152
- return R(e, t, n, j, {
153
- root: o.root,
154
- listItem: o.listItem,
155
- actions: o.actions,
156
- icon: o.icon,
157
- content: o.content
158
- }, !0, r);
159
- }
160
- B.displayName = "NavItem", h(B, "entry");
161
- function V(e) {
162
- let t = g("Nav.SubItem");
163
- v(t, "item", e.value), y(t, e.value);
164
- let n = T.useContext(p), r = c("wave-nav-item");
165
- return R(e, t, n, M, {
167
+ G.displayName = "NavCategory", S(G, "category");
168
+ function K(e) {
169
+ let t = C("Nav.Item");
170
+ T(t, "item", e.value), E(t, e.value);
171
+ let n = M.useContext(b), r = l("wave-nav-item"), i = _();
172
+ return W(e, t, n, R, {
166
173
  root: s.root,
167
174
  listItem: s.listItem,
168
- actions: s.actions
169
- }, !1, r);
175
+ actions: s.actions,
176
+ icon: s.icon,
177
+ content: s.content
178
+ }, !0, r, i);
179
+ }
180
+ K.displayName = "NavItem", S(K, "entry");
181
+ function q(e) {
182
+ let t = C("Nav.SubItem");
183
+ T(t, "item", e.value), E(t, e.value);
184
+ let n = M.useContext(b), r = l("wave-nav-item"), i = _();
185
+ return W(e, t, n, z, {
186
+ root: c.root,
187
+ listItem: c.listItem,
188
+ actions: c.actions
189
+ }, !1, r, i);
170
190
  }
171
- V.displayName = "NavSubItem", h(V, "entry");
172
- var H = /* @__PURE__ */ Object.assign(w, {
173
- Category: z,
174
- Item: B,
175
- SubItem: V,
176
- SectionHeader: C,
177
- Divider: S,
178
- AppItem: b,
179
- AppItemStatic: x
191
+ q.displayName = "NavSubItem", S(q, "entry");
192
+ var J = /* @__PURE__ */ Object.assign(j, {
193
+ Category: G,
194
+ Item: K,
195
+ SubItem: q,
196
+ SectionHeader: A,
197
+ Divider: k,
198
+ AppItem: D,
199
+ AppItemStatic: O
180
200
  });
181
201
  //#endregion
182
- export { H as Nav, b as NavAppItem, x as NavAppItemStatic, z as NavCategory, S as NavDivider, B as NavItem, C as NavSectionHeader, V as NavSubItem };
202
+ export { J as Nav, D as NavAppItem, O as NavAppItemStatic, G as NavCategory, k as NavDivider, K as NavItem, A as NavSectionHeader, q as NavSubItem };
183
203
 
184
204
  //# sourceMappingURL=Nav.mjs.map