@fluentui/react-nav 9.3.23 → 9.3.24
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.
- package/CHANGELOG.md +21 -2
- package/dist/index.d.ts +12 -12
- package/lib/components/AppItem/AppItem.types.js.map +1 -1
- package/lib/components/AppItem/useAppItem.js +0 -1
- package/lib/components/AppItem/useAppItem.js.map +1 -1
- package/lib/components/AppItemStatic/AppItemStatic.types.js.map +1 -1
- package/lib/components/AppItemStatic/useAppItemStatic.js +0 -1
- package/lib/components/AppItemStatic/useAppItemStatic.js.map +1 -1
- package/lib/components/Hamburger/Hamburger.types.js.map +1 -1
- package/lib/components/Hamburger/useHamburgerStyles.styles.raw.js.map +1 -1
- package/lib/components/Nav/Nav.types.js +3 -1
- package/lib/components/Nav/Nav.types.js.map +1 -1
- package/lib/components/Nav/useNav.js.map +1 -1
- package/lib/components/NavCategory/NavCategory.types.js +3 -1
- package/lib/components/NavCategory/NavCategory.types.js.map +1 -1
- package/lib/components/NavCategory/renderNavCategory.js.map +1 -1
- package/lib/components/NavCategory/useNavCategory.js +0 -1
- package/lib/components/NavCategory/useNavCategory.js.map +1 -1
- package/lib/components/NavCategoryContext.js.map +1 -1
- package/lib/components/NavCategoryItem/useNavCategoryItem.styles.raw.js.map +1 -1
- package/lib/components/NavCategoryItemContext.js.map +1 -1
- package/lib/components/NavContext.js.map +1 -1
- package/lib/components/NavContext.types.js +1 -1
- package/lib/components/NavContext.types.js.map +1 -1
- package/lib/components/NavDivider/useNavDivider.js +0 -1
- package/lib/components/NavDivider/useNavDivider.js.map +1 -1
- package/lib/components/NavDrawer/NavDrawer.js.map +1 -1
- package/lib/components/NavDrawer/NavDrawer.types.js.map +1 -1
- package/lib/components/NavDrawer/useNavDrawer.js +0 -1
- package/lib/components/NavDrawer/useNavDrawer.js.map +1 -1
- package/lib/components/NavDrawerBody/useNavDrawerBody.js +0 -1
- package/lib/components/NavDrawerBody/useNavDrawerBody.js.map +1 -1
- package/lib/components/NavDrawerFooter/useNavDrawerFooter.js +0 -1
- package/lib/components/NavDrawerFooter/useNavDrawerFooter.js.map +1 -1
- package/lib/components/NavDrawerHeader/useNavDrawerHeader.js +0 -1
- package/lib/components/NavDrawerHeader/useNavDrawerHeader.js.map +1 -1
- package/lib/components/NavItem/NavItem.types.js.map +1 -1
- package/lib/components/NavSectionHeader/useNavSectionHeader.js +0 -1
- package/lib/components/NavSectionHeader/useNavSectionHeader.js.map +1 -1
- package/lib/components/NavSubItem/NavSubItem.types.js.map +1 -1
- package/lib/components/NavSubItemContext.js.map +1 -1
- package/lib/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -1
- package/lib/components/NavSubItemGroup/useNavSubItemGroup.js +0 -1
- package/lib/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -1
- package/lib/components/SplitNavItem/SplitNavItem.types.js.map +1 -1
- package/lib/components/useNavCategoryContextValues_unstable.js.map +1 -1
- package/lib/components/useNavCategoryItemContextValues_unstable.js.map +1 -1
- package/lib/components/useNavContextValues.js.map +1 -1
- package/lib-commonjs/components/AppItem/AppItem.types.js.map +1 -1
- package/lib-commonjs/components/AppItem/useAppItem.js +0 -2
- package/lib-commonjs/components/AppItem/useAppItem.js.map +1 -1
- package/lib-commonjs/components/AppItemStatic/AppItemStatic.types.js.map +1 -1
- package/lib-commonjs/components/AppItemStatic/useAppItemStatic.js +0 -2
- package/lib-commonjs/components/AppItemStatic/useAppItemStatic.js.map +1 -1
- package/lib-commonjs/components/Hamburger/Hamburger.types.js.map +1 -1
- package/lib-commonjs/components/Hamburger/useHamburgerStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Nav/Nav.types.js +3 -3
- package/lib-commonjs/components/Nav/Nav.types.js.map +1 -1
- package/lib-commonjs/components/Nav/useNav.js.map +1 -1
- package/lib-commonjs/components/NavCategory/NavCategory.types.js +3 -3
- package/lib-commonjs/components/NavCategory/NavCategory.types.js.map +1 -1
- package/lib-commonjs/components/NavCategory/renderNavCategory.js.map +1 -1
- package/lib-commonjs/components/NavCategory/useNavCategory.js +0 -2
- package/lib-commonjs/components/NavCategory/useNavCategory.js.map +1 -1
- package/lib-commonjs/components/NavCategoryContext.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.styles.raw.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItemContext.js.map +1 -1
- package/lib-commonjs/components/NavContext.js.map +1 -1
- package/lib-commonjs/components/NavContext.types.js +0 -2
- package/lib-commonjs/components/NavContext.types.js.map +1 -1
- package/lib-commonjs/components/NavDivider/useNavDivider.js +0 -2
- package/lib-commonjs/components/NavDivider/useNavDivider.js.map +1 -1
- package/lib-commonjs/components/NavDrawer/NavDrawer.js.map +1 -1
- package/lib-commonjs/components/NavDrawer/NavDrawer.types.js.map +1 -1
- package/lib-commonjs/components/NavDrawer/useNavDrawer.js +0 -2
- package/lib-commonjs/components/NavDrawer/useNavDrawer.js.map +1 -1
- package/lib-commonjs/components/NavDrawerBody/useNavDrawerBody.js +0 -2
- package/lib-commonjs/components/NavDrawerBody/useNavDrawerBody.js.map +1 -1
- package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooter.js +0 -2
- package/lib-commonjs/components/NavDrawerFooter/useNavDrawerFooter.js.map +1 -1
- package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeader.js +0 -2
- package/lib-commonjs/components/NavDrawerHeader/useNavDrawerHeader.js.map +1 -1
- package/lib-commonjs/components/NavItem/NavItem.types.js.map +1 -1
- package/lib-commonjs/components/NavSectionHeader/useNavSectionHeader.js +0 -2
- package/lib-commonjs/components/NavSectionHeader/useNavSectionHeader.js.map +1 -1
- package/lib-commonjs/components/NavSubItem/NavSubItem.types.js.map +1 -1
- package/lib-commonjs/components/NavSubItemContext.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js +0 -2
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -1
- package/lib-commonjs/components/SplitNavItem/SplitNavItem.types.js.map +1 -1
- package/lib-commonjs/components/useNavCategoryContextValues_unstable.js.map +1 -1
- package/lib-commonjs/components/useNavCategoryItemContextValues_unstable.js.map +1 -1
- package/lib-commonjs/components/useNavContextValues.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-nav
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 23 Apr 2026 11:59:27 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.3.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-nav_v9.3.24)
|
|
8
|
+
|
|
9
|
+
Thu, 23 Apr 2026 11:59:27 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-nav_v9.3.23..@fluentui/react-nav_v9.3.24)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-aria to v9.17.11 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
15
|
+
- Bump @fluentui/react-button to v9.9.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
16
|
+
- Bump @fluentui/react-context-selector to v9.2.16 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
17
|
+
- Bump @fluentui/react-divider to v9.7.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
18
|
+
- Bump @fluentui/react-drawer to v9.12.0 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
19
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
20
|
+
- Bump @fluentui/react-motion to v9.15.0 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
21
|
+
- Bump @fluentui/react-motion-components-preview to v0.15.4 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
22
|
+
- Bump @fluentui/react-tabster to v9.26.14 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
23
|
+
- Bump @fluentui/react-tooltip to v9.10.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
24
|
+
- Bump @fluentui/react-utilities to v9.26.3 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
25
|
+
|
|
7
26
|
## [9.3.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-nav_v9.3.23)
|
|
8
27
|
|
|
9
|
-
Wed, 01 Apr 2026 15:
|
|
28
|
+
Wed, 01 Apr 2026 15:52:43 GMT
|
|
10
29
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-nav_v9.3.22..@fluentui/react-nav_v9.3.23)
|
|
11
30
|
|
|
12
31
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ARIAButtonSlotProps } from '@fluentui/react-aria';
|
|
2
|
-
import { ButtonProps } from '@fluentui/react-button';
|
|
3
|
-
import { ButtonSlots } from '@fluentui/react-button';
|
|
4
|
-
import { ButtonState } from '@fluentui/react-button';
|
|
5
|
-
import { ComponentProps } from '@fluentui/react-utilities';
|
|
1
|
+
import type { ARIAButtonSlotProps } from '@fluentui/react-aria';
|
|
2
|
+
import type { ButtonProps } from '@fluentui/react-button';
|
|
3
|
+
import type { ButtonSlots } from '@fluentui/react-button';
|
|
4
|
+
import type { ButtonState } from '@fluentui/react-button';
|
|
5
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
6
6
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
7
7
|
import type { DividerProps } from '@fluentui/react-divider';
|
|
8
8
|
import { DividerSlots } from '@fluentui/react-divider';
|
|
@@ -16,20 +16,20 @@ import type { DrawerFooterState } from '@fluentui/react-drawer';
|
|
|
16
16
|
import type { DrawerHeaderProps } from '@fluentui/react-drawer';
|
|
17
17
|
import type { DrawerHeaderSlots } from '@fluentui/react-drawer';
|
|
18
18
|
import type { DrawerHeaderState } from '@fluentui/react-drawer';
|
|
19
|
-
import { DrawerProps } from '@fluentui/react-drawer';
|
|
20
|
-
import { DrawerSlots } from '@fluentui/react-drawer';
|
|
21
|
-
import { DrawerState } from '@fluentui/react-drawer';
|
|
19
|
+
import type { DrawerProps } from '@fluentui/react-drawer';
|
|
20
|
+
import type { DrawerSlots } from '@fluentui/react-drawer';
|
|
21
|
+
import type { DrawerState } from '@fluentui/react-drawer';
|
|
22
22
|
import type { EventData } from '@fluentui/react-utilities';
|
|
23
|
-
import { EventHandler } from '@fluentui/react-utilities';
|
|
23
|
+
import type { EventHandler } from '@fluentui/react-utilities';
|
|
24
24
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
25
25
|
import type { InlineDrawerSlots } from '@fluentui/react-drawer';
|
|
26
26
|
import type { JSXElement } from '@fluentui/react-utilities';
|
|
27
|
-
import { MenuButtonProps } from '@fluentui/react-button';
|
|
27
|
+
import type { MenuButtonProps } from '@fluentui/react-button';
|
|
28
28
|
import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
|
|
29
29
|
import * as React_2 from 'react';
|
|
30
30
|
import type { Slot } from '@fluentui/react-utilities';
|
|
31
|
-
import { SlotClassNames } from '@fluentui/react-utilities';
|
|
32
|
-
import { ToggleButtonProps } from '@fluentui/react-button';
|
|
31
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
32
|
+
import type { ToggleButtonProps } from '@fluentui/react-button';
|
|
33
33
|
import type { TooltipProps } from '@fluentui/react-tooltip';
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItem/AppItem.types.ts"],"sourcesContent":["import { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { NavDensity } from '../Nav/Nav.types';\n\nexport type AppItemSlots = {\n /**\n * The root element of the AppItem.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * AppItem Props\n */\nexport type AppItemProps = ComponentProps<AppItemSlots> & { href?: string };\n\n/**\n * State used in rendering AppItem\n */\nexport type AppItemState = ComponentState<AppItemSlots> & {\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n};\n"],"names":[],"mappings":"AAqBA;;CAEC,GACD,WAOE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItem/AppItem.types.ts"],"sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { NavDensity } from '../Nav/Nav.types';\n\nexport type AppItemSlots = {\n /**\n * The root element of the AppItem.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * AppItem Props\n */\nexport type AppItemProps = ComponentProps<AppItemSlots> & { href?: string };\n\n/**\n * State used in rendering AppItem\n */\nexport type AppItemState = ComponentState<AppItemSlots> & {\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n};\n"],"names":[],"mappings":"AAqBA;;CAEC,GACD,WAOE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItem/useAppItem.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { AppItemProps, AppItemState } from './AppItem.types';\nimport { ARIAButtonSlotProps
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItem/useAppItem.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { AppItemProps, AppItemState } from './AppItem.types';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useNavContext_unstable } from '../NavContext';\n\n/**\n * Create the state required to render AppItem.\n *\n * The returned state can be modified with hooks such as useAppItemStyles_unstable,\n * before being passed to renderAppItem_unstable.\n *\n * @param props - props from this instance of AppItem\n * @param ref - reference to root HTMLDivElement of AppItem\n */\nexport const useAppItem_unstable = (\n props: AppItemProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): AppItemState => {\n const { icon, as, href } = props;\n const rootElementType = as || (href ? 'a' : 'button');\n\n const { density = 'medium' } = useNavContext_unstable();\n\n const root = slot.always<ARIAButtonSlotProps<'a'>>(\n getIntrinsicElementProps(\n rootElementType,\n useARIAButtonProps(rootElementType, {\n ...props,\n }),\n ),\n {\n elementType: rootElementType,\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: rootElementType,\n },\n },\n );\n\n return {\n components: {\n root: rootElementType,\n icon: 'span',\n },\n root,\n icon: slot.optional(icon, {\n elementType: 'span',\n }),\n density,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useARIAButtonProps","useNavContext_unstable","useAppItem_unstable","props","ref","icon","as","href","rootElementType","density","root","always","elementType","defaultProps","type","components","optional"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CACjCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAGJ;IAC3B,MAAMK,kBAAkBF,MAAOC,CAAAA,OAAO,MAAM,QAAO;IAEnD,MAAM,EAAEE,UAAU,QAAQ,EAAE,GAAGR;IAE/B,MAAMS,OAAOX,KAAKY,MAAM,CACtBb,yBACEU,iBACAR,mBAAmBQ,iBAAiB;QAClC,GAAGL,KAAK;IACV,KAEF;QACES,aAAaJ;QACbK,cAAc;YACZT,KAAKA;YACLU,MAAMN;QACR;IACF;IAGF,OAAO;QACLO,YAAY;YACVL,MAAMF;YACNH,MAAM;QACR;QACAK;QACAL,MAAMN,KAAKiB,QAAQ,CAACX,MAAM;YACxBO,aAAa;QACf;QACAH;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItemStatic/AppItemStatic.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { NavDensity } from '../Nav/Nav.types';\n\nexport type AppItemStaticSlots = {\n /**\n * The root element of the AppItemStatic.\n */\n root: Slot<'div'>;\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * AppItemStatic Props\n */\nexport type AppItemStaticProps = ComponentProps<AppItemStaticSlots> & {};\n\n/**\n * State used in rendering AppItemStatic\n */\nexport type AppItemStaticState = ComponentState<AppItemStaticSlots> & {\n /**\n * The density of the Nav\n *\n * @default 'medium'\n */\n density: NavDensity;\n};\n"],"names":[],"mappings":"AAmBA;;CAEC,GACD,WAOE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItemStatic/AppItemStatic.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { NavDensity } from '../Nav/Nav.types';\n\nexport type AppItemStaticSlots = {\n /**\n * The root element of the AppItemStatic.\n */\n root: Slot<'div'>;\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * AppItemStatic Props\n */\nexport type AppItemStaticProps = ComponentProps<AppItemStaticSlots> & {};\n\n/**\n * State used in rendering AppItemStatic\n */\nexport type AppItemStaticState = ComponentState<AppItemStaticSlots> & {\n /**\n * The density of the Nav\n *\n * @default 'medium'\n */\n density: NavDensity;\n};\n"],"names":[],"mappings":"AAmBA;;CAEC,GACD,WAOE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItemStatic/useAppItemStatic.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { AppItemStaticProps, AppItemStaticState } from './AppItemStatic.types';\nimport { useNavContext_unstable } from '../NavContext';\n\n/**\n * Create the state required to render AppItemStatic.\n *\n * The returned state can be modified with hooks such as useAppItemStaticStyles_unstable,\n * before being passed to renderAppItemStatic_unstable.\n *\n * @param props - props from this instance of AppItemStatic\n * @param ref - reference to root HTMLDivElement of AppItemStatic\n */\nexport const useAppItemStatic_unstable = (\n props: AppItemStaticProps,\n ref: React.Ref<HTMLDivElement>,\n): AppItemStaticState => {\n const { icon } = props;\n\n const { density = 'medium' } = useNavContext_unstable();\n return {\n components: {\n root: 'div',\n icon: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, {\n elementType: 'span',\n }),\n density,\n };\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItemStatic/useAppItemStatic.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { AppItemStaticProps, AppItemStaticState } from './AppItemStatic.types';\nimport { useNavContext_unstable } from '../NavContext';\n\n/**\n * Create the state required to render AppItemStatic.\n *\n * The returned state can be modified with hooks such as useAppItemStaticStyles_unstable,\n * before being passed to renderAppItemStatic_unstable.\n *\n * @param props - props from this instance of AppItemStatic\n * @param ref - reference to root HTMLDivElement of AppItemStatic\n */\nexport const useAppItemStatic_unstable = (\n props: AppItemStaticProps,\n ref: React.Ref<HTMLDivElement>,\n): AppItemStaticState => {\n const { icon } = props;\n\n const { density = 'medium' } = useNavContext_unstable();\n return {\n components: {\n root: 'div',\n icon: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(icon, {\n elementType: 'span',\n }),\n density,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useNavContext_unstable","useAppItemStatic_unstable","props","ref","icon","density","components","root","always","elementType","optional"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGF;IAEjB,MAAM,EAAEG,UAAU,QAAQ,EAAE,GAAGL;IAC/B,OAAO;QACLM,YAAY;YACVC,MAAM;YACNH,MAAM;QACR;QACAG,MAAMR,KAAKS,MAAM,CACfV,yBAAyB,OAAO;YAC9BK;YACA,GAAGD,KAAK;QACV,IACA;YAAEO,aAAa;QAAM;QAEvBL,MAAML,KAAKW,QAAQ,CAACN,MAAM;YACxBK,aAAa;QACf;QACAJ;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Hamburger/Hamburger.types.ts"],"sourcesContent":["import { ButtonProps, ButtonState } from '@fluentui/react-button';\n\n/**\n * Hamburger Props\n */\nexport type HamburgerProps = ButtonProps;\n\n/**\n * State used in rendering Hamburger\n */\nexport type HamburgerState = ButtonState;\n"],"names":[],"mappings":"AAOA;;CAEC,GACD,WAAyC"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Hamburger/Hamburger.types.ts"],"sourcesContent":["import type { ButtonProps, ButtonState } from '@fluentui/react-button';\n\n/**\n * Hamburger Props\n */\nexport type HamburgerProps = ButtonProps;\n\n/**\n * State used in rendering Hamburger\n */\nexport type HamburgerState = ButtonState;\n"],"names":[],"mappings":"AAOA;;CAEC,GACD,WAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Hamburger/useHamburgerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { ButtonSlots
|
|
1
|
+
{"version":3,"sources":["../src/components/Hamburger/useHamburgerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { ButtonSlots } from '@fluentui/react-button';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { HamburgerState } from './Hamburger.types';\nimport { navItemTokens } from '../sharedNavStyles.styles';\n\nexport const hamburgerClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Hamburger',\n icon: 'fui-Hamburger__icon',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n textDecorationLine: 'none',\n backgroundColor: navItemTokens.backgroundColor,\n border: 'none',\n ':hover': {\n backgroundColor: navItemTokens.backgroundColorHover,\n },\n ':active': {\n backgroundColor: navItemTokens.backgroundColorPressed,\n },\n },\n});\n\n/**\n * Apply styling to the Hamburger slots based on the state\n */\nexport const useHamburgerStyles_unstable = (state: HamburgerState): HamburgerState => {\n 'use no memo';\n\n useButtonStyles_unstable(state);\n const styles = useStyles();\n\n state.root.className = mergeClasses(hamburgerClassNames.root, styles.root, state.root.className);\n\n if (state.icon) {\n state.icon.className = mergeClasses(hamburgerClassNames.icon, state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useButtonStyles_unstable","navItemTokens","hamburgerClassNames","root","icon","useStyles","textDecorationLine","backgroundColor","border","backgroundColorHover","backgroundColorPressed","useHamburgerStyles_unstable","state","styles","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,wBAAwB,QAAQ,yBAAyB;AAGlE,SAASC,aAAa,QAAQ,4BAA4B;AAE1D,OAAO,MAAMC,sBAAmD;IAC9DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BK,MAAM;QACJG,oBAAoB;QACpBC,iBAAiBN,cAAcM,eAAe;QAC9CC,QAAQ;QACR,UAAU;YACRD,iBAAiBN,cAAcQ,oBAAoB;QACrD;QACA,WAAW;YACTF,iBAAiBN,cAAcS,sBAAsB;QACvD;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C;IAEAZ,yBAAyBY;IACzB,MAAMC,SAASR;IAEfO,MAAMT,IAAI,CAACW,SAAS,GAAGf,aAAaG,oBAAoBC,IAAI,EAAEU,OAAOV,IAAI,EAAES,MAAMT,IAAI,CAACW,SAAS;IAE/F,IAAIF,MAAMR,IAAI,EAAE;QACdQ,MAAMR,IAAI,CAACU,SAAS,GAAGf,aAAaG,oBAAoBE,IAAI,EAAEQ,MAAMR,IAAI,CAACU,SAAS;IACpF;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Nav/Nav.types.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { NavContextValue, NavItemValue } from '../NavContext.types';\n\nexport type NavSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/***\n * Indicates the vertical density of the Nav content.\n * This does not affect horizontal spacing.\n */\nexport type NavDensity = 'small' | 'medium';\n\n/**\n * Nav Props\n */\nexport type NavProps = ComponentProps<NavSlots> & {\n /**\n * The value of the navItem to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedValue?: NavItemValue;\n\n /**\n * The value of the navCategory to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedCategoryValue?: NavItemValue;\n\n /**\n * Set of categories that are opened by default.\n * Typically useful when the openCategories is uncontrolled.\n */\n defaultOpenCategories?: NavItemValue[];\n\n /**\n * Controls the open categories.\n * For use in controlled scenarios.\n */\n openCategories?: NavItemValue[];\n\n /**\n * Raised when a navItem is selected.\n * If the navItem is child of a category, the categoryValue will be provided\n */\n onNavItemSelect?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The value of the currently selected navItem.\n * Mutually exclusive with defaultSelectedValue.\n * @default undefined\n */\n selectedValue?: NavItemValue;\n\n /**\n * Indicates a category that has a selected child\n * Will show the category as selected if it is closed.\n * @default undefined\n */\n selectedCategoryValue?: NavItemValue;\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n * @default true, indicating that multiple categories can be open at the same time.\n */\n multiple?: boolean;\n\n /**\n * Callback raised when a NavCategoryItem is toggled.\n */\n onNavCategoryItemToggle?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The vertical density of the Nav and it's children\n * @default 'medium'\n */\n density?: NavDensity;\n};\n\nexport type OnNavItemSelectData = EventData<'click', React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {\n /**\n * The value of the selected navItem.\n * In the case of a category selection, this will be the value of the selected category.\n */\n value: NavItemValue;\n\n /**\n * The parent value of the selected navSubItem\n * Null if not a child of a category\n */\n categoryValue?: NavItemValue;\n};\n\n/**\n * State used in rendering Nav\n */\nexport type NavState = ComponentState<NavSlots> & NavContextValue;\n"],"names":[
|
|
1
|
+
{"version":3,"sources":["../src/components/Nav/Nav.types.ts"],"sourcesContent":["import type * as React from 'react';\n\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { NavContextValue, NavItemValue } from '../NavContext.types';\n\nexport type NavSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/***\n * Indicates the vertical density of the Nav content.\n * This does not affect horizontal spacing.\n */\nexport type NavDensity = 'small' | 'medium';\n\n/**\n * Nav Props\n */\nexport type NavProps = ComponentProps<NavSlots> & {\n /**\n * The value of the navItem to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedValue?: NavItemValue;\n\n /**\n * The value of the navCategory to be selected by default.\n * Typically useful when the selectedValue is uncontrolled.\n * Mutually exclusive with selectedValue.\n * Empty string indicates no selection.\n */\n defaultSelectedCategoryValue?: NavItemValue;\n\n /**\n * Set of categories that are opened by default.\n * Typically useful when the openCategories is uncontrolled.\n */\n defaultOpenCategories?: NavItemValue[];\n\n /**\n * Controls the open categories.\n * For use in controlled scenarios.\n */\n openCategories?: NavItemValue[];\n\n /**\n * Raised when a navItem is selected.\n * If the navItem is child of a category, the categoryValue will be provided\n */\n onNavItemSelect?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The value of the currently selected navItem.\n * Mutually exclusive with defaultSelectedValue.\n * @default undefined\n */\n selectedValue?: NavItemValue;\n\n /**\n * Indicates a category that has a selected child\n * Will show the category as selected if it is closed.\n * @default undefined\n */\n selectedCategoryValue?: NavItemValue;\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n * @default true, indicating that multiple categories can be open at the same time.\n */\n multiple?: boolean;\n\n /**\n * Callback raised when a NavCategoryItem is toggled.\n */\n onNavCategoryItemToggle?: EventHandler<OnNavItemSelectData>;\n\n /**\n * The vertical density of the Nav and it's children\n * @default 'medium'\n */\n density?: NavDensity;\n};\n\nexport type OnNavItemSelectData = EventData<'click', React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {\n /**\n * The value of the selected navItem.\n * In the case of a category selection, this will be the value of the selected category.\n */\n value: NavItemValue;\n\n /**\n * The parent value of the selected navSubItem\n * Null if not a child of a category\n */\n categoryValue?: NavItemValue;\n};\n\n/**\n * State used in rendering Nav\n */\nexport type NavState = ComponentState<NavSlots> & NavContextValue;\n"],"names":[],"mappings":"AAmGA;;CAEC,GACD,WAAkE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Nav/useNav.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useMergedRefs,\n slot,\n getIntrinsicElementProps,\n EventHandler,\n} from '@fluentui/react-utilities';\n\nimport type { NavProps, NavState, OnNavItemSelectData } from './Nav.types';\nimport type { NavItemRegisterData, NavItemValue } from '../NavContext.types';\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenCategories({\n defaultOpenCategories,\n multiple,\n}: Pick<NavProps, 'defaultOpenCategories' | 'multiple'>): NavItemValue[] | undefined {\n if (defaultOpenCategories !== undefined) {\n if (Array.isArray(defaultOpenCategories)) {\n return multiple ? defaultOpenCategories : [defaultOpenCategories[0]];\n }\n return [defaultOpenCategories];\n }\n return undefined;\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Nav supports open categories at the same time\n */\nconst updateOpenCategories = (value: NavItemValue, previousOpenItems: NavItemValue[], multiple: boolean) => {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n return previousOpenItems.filter(i => i !== value);\n } else {\n return [...previousOpenItems, value];\n }\n }\n\n return previousOpenItems[0] === value ? [] : [value];\n};\n\n/**\n * Create the state required to render Nav.\n *\n * The returned state can be modified with hooks such as useNavStyles,\n * before being passed to renderNav.\n *\n * @param props - props from this instance of Nav\n * @param ref - reference to root HTMLDivElement of Nav\n */\nexport const useNav_unstable = (props: NavProps, ref: React.Ref<HTMLDivElement>): NavState => {\n const {\n onNavItemSelect,\n onNavCategoryItemToggle,\n multiple = true,\n density = 'medium',\n openCategories: controlledOpenCategoryItems,\n selectedCategoryValue: controlledSelectedCategoryValue,\n selectedValue: controlledSelectedValue,\n defaultOpenCategories,\n defaultSelectedValue,\n defaultSelectedCategoryValue,\n } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const [openCategories, setOpenCategories] = useControllableState({\n state: controlledOpenCategoryItems,\n defaultState: initializeUncontrolledOpenCategories({ defaultOpenCategories, multiple }),\n initialState: [],\n });\n\n const [selectedCategoryValue, setSelectedCategoryValue] = useControllableState({\n state: controlledSelectedCategoryValue,\n defaultState: defaultSelectedCategoryValue,\n initialState: undefined,\n });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: controlledSelectedValue,\n defaultState: defaultSelectedValue,\n initialState: undefined,\n });\n\n // considered usePrevious, but it is sensitive to re-renders\n // this could cause the previous to move to current in the case where the navItem list re-renders.\n // these refs avoid getRegisteredNavItems changing when selectedValue changes and causing\n // renders for navItems that have not changed.\n const currentSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n\n const currentSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n\n if (currentSelectedValue.current !== selectedValue) {\n previousSelectedValue.current = currentSelectedValue.current;\n currentSelectedValue.current = selectedValue;\n }\n\n if (currentSelectedCategoryValue.current !== selectedCategoryValue) {\n previousSelectedCategoryValue.current = currentSelectedCategoryValue.current;\n currentSelectedCategoryValue.current = selectedCategoryValue;\n }\n\n // used for NavItems and NavSubItems\n const onSelect: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n setSelectedValue(data.value);\n setSelectedCategoryValue(data.categoryValue ? data.categoryValue : '');\n onNavItemSelect?.(event, data);\n });\n\n // used for NavCategoryItems\n const onRequestNavCategoryItemToggle: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n if (data.categoryValue !== undefined) {\n const nextOpenCategories = updateOpenCategories(data.categoryValue, openCategories ?? [], multiple);\n onNavCategoryItemToggle?.(event, data);\n setOpenCategories(nextOpenCategories);\n }\n });\n\n const registeredNavItems = React.useRef<Record<string, NavItemRegisterData>>({});\n\n const onRegister = React.useCallback((data: NavItemRegisterData) => {\n registeredNavItems.current[JSON.stringify(data.value)] = data;\n }, []);\n\n const onUnregister = React.useCallback((data: NavItemRegisterData) => {\n delete registeredNavItems.current[JSON.stringify(data.value)];\n }, []);\n\n const getRegisteredNavItems = React.useCallback(() => {\n return {\n selectedValue: currentSelectedValue.current,\n previousSelectedValue: previousSelectedValue.current,\n selectedCategoryValue: currentSelectedCategoryValue.current,\n previousSelectedCategoryValue: previousSelectedCategoryValue.current,\n registeredNavItems: registeredNavItems.current,\n };\n }, []);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n openCategories,\n selectedValue,\n selectedCategoryValue,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n multiple,\n density,\n tabbable: false,\n };\n};\n"],"names":["React","useControllableState","useEventCallback","useMergedRefs","slot","getIntrinsicElementProps","initializeUncontrolledOpenCategories","defaultOpenCategories","multiple","undefined","Array","isArray","updateOpenCategories","value","previousOpenItems","includes","filter","i","useNav_unstable","props","ref","onNavItemSelect","onNavCategoryItemToggle","density","openCategories","controlledOpenCategoryItems","selectedCategoryValue","controlledSelectedCategoryValue","selectedValue","controlledSelectedValue","defaultSelectedValue","defaultSelectedCategoryValue","innerRef","useRef","setOpenCategories","state","defaultState","initialState","setSelectedCategoryValue","setSelectedValue","currentSelectedValue","previousSelectedValue","currentSelectedCategoryValue","previousSelectedCategoryValue","current","onSelect","event","data","categoryValue","onRequestNavCategoryItemToggle","nextOpenCategories","registeredNavItems","onRegister","useCallback","JSON","stringify","onUnregister","getRegisteredNavItems","components","root","always","elementType","tabbable"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Nav/useNav.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { EventHandler } from '@fluentui/react-utilities';\nimport {\n useControllableState,\n useEventCallback,\n useMergedRefs,\n slot,\n getIntrinsicElementProps,\n} from '@fluentui/react-utilities';\n\nimport type { NavProps, NavState, OnNavItemSelectData } from './Nav.types';\nimport type { NavItemRegisterData, NavItemValue } from '../NavContext.types';\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenCategories({\n defaultOpenCategories,\n multiple,\n}: Pick<NavProps, 'defaultOpenCategories' | 'multiple'>): NavItemValue[] | undefined {\n if (defaultOpenCategories !== undefined) {\n if (Array.isArray(defaultOpenCategories)) {\n return multiple ? defaultOpenCategories : [defaultOpenCategories[0]];\n }\n return [defaultOpenCategories];\n }\n return undefined;\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Nav supports open categories at the same time\n */\nconst updateOpenCategories = (value: NavItemValue, previousOpenItems: NavItemValue[], multiple: boolean) => {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n return previousOpenItems.filter(i => i !== value);\n } else {\n return [...previousOpenItems, value];\n }\n }\n\n return previousOpenItems[0] === value ? [] : [value];\n};\n\n/**\n * Create the state required to render Nav.\n *\n * The returned state can be modified with hooks such as useNavStyles,\n * before being passed to renderNav.\n *\n * @param props - props from this instance of Nav\n * @param ref - reference to root HTMLDivElement of Nav\n */\nexport const useNav_unstable = (props: NavProps, ref: React.Ref<HTMLDivElement>): NavState => {\n const {\n onNavItemSelect,\n onNavCategoryItemToggle,\n multiple = true,\n density = 'medium',\n openCategories: controlledOpenCategoryItems,\n selectedCategoryValue: controlledSelectedCategoryValue,\n selectedValue: controlledSelectedValue,\n defaultOpenCategories,\n defaultSelectedValue,\n defaultSelectedCategoryValue,\n } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const [openCategories, setOpenCategories] = useControllableState({\n state: controlledOpenCategoryItems,\n defaultState: initializeUncontrolledOpenCategories({ defaultOpenCategories, multiple }),\n initialState: [],\n });\n\n const [selectedCategoryValue, setSelectedCategoryValue] = useControllableState({\n state: controlledSelectedCategoryValue,\n defaultState: defaultSelectedCategoryValue,\n initialState: undefined,\n });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: controlledSelectedValue,\n defaultState: defaultSelectedValue,\n initialState: undefined,\n });\n\n // considered usePrevious, but it is sensitive to re-renders\n // this could cause the previous to move to current in the case where the navItem list re-renders.\n // these refs avoid getRegisteredNavItems changing when selectedValue changes and causing\n // renders for navItems that have not changed.\n const currentSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedValue = React.useRef<NavItemValue | undefined>(undefined);\n\n const currentSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n const previousSelectedCategoryValue = React.useRef<NavItemValue | undefined>(undefined);\n\n if (currentSelectedValue.current !== selectedValue) {\n previousSelectedValue.current = currentSelectedValue.current;\n currentSelectedValue.current = selectedValue;\n }\n\n if (currentSelectedCategoryValue.current !== selectedCategoryValue) {\n previousSelectedCategoryValue.current = currentSelectedCategoryValue.current;\n currentSelectedCategoryValue.current = selectedCategoryValue;\n }\n\n // used for NavItems and NavSubItems\n const onSelect: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n setSelectedValue(data.value);\n setSelectedCategoryValue(data.categoryValue ? data.categoryValue : '');\n onNavItemSelect?.(event, data);\n });\n\n // used for NavCategoryItems\n const onRequestNavCategoryItemToggle: EventHandler<OnNavItemSelectData> = useEventCallback((event, data) => {\n if (data.categoryValue !== undefined) {\n const nextOpenCategories = updateOpenCategories(data.categoryValue, openCategories ?? [], multiple);\n onNavCategoryItemToggle?.(event, data);\n setOpenCategories(nextOpenCategories);\n }\n });\n\n const registeredNavItems = React.useRef<Record<string, NavItemRegisterData>>({});\n\n const onRegister = React.useCallback((data: NavItemRegisterData) => {\n registeredNavItems.current[JSON.stringify(data.value)] = data;\n }, []);\n\n const onUnregister = React.useCallback((data: NavItemRegisterData) => {\n delete registeredNavItems.current[JSON.stringify(data.value)];\n }, []);\n\n const getRegisteredNavItems = React.useCallback(() => {\n return {\n selectedValue: currentSelectedValue.current,\n previousSelectedValue: previousSelectedValue.current,\n selectedCategoryValue: currentSelectedCategoryValue.current,\n previousSelectedCategoryValue: previousSelectedCategoryValue.current,\n registeredNavItems: registeredNavItems.current,\n };\n }, []);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, innerRef) as React.Ref<HTMLDivElement>,\n ...props,\n }),\n { elementType: 'div' },\n ),\n openCategories,\n selectedValue,\n selectedCategoryValue,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n multiple,\n density,\n tabbable: false,\n };\n};\n"],"names":["React","useControllableState","useEventCallback","useMergedRefs","slot","getIntrinsicElementProps","initializeUncontrolledOpenCategories","defaultOpenCategories","multiple","undefined","Array","isArray","updateOpenCategories","value","previousOpenItems","includes","filter","i","useNav_unstable","props","ref","onNavItemSelect","onNavCategoryItemToggle","density","openCategories","controlledOpenCategoryItems","selectedCategoryValue","controlledSelectedCategoryValue","selectedValue","controlledSelectedValue","defaultSelectedValue","defaultSelectedCategoryValue","innerRef","useRef","setOpenCategories","state","defaultState","initialState","setSelectedCategoryValue","setSelectedValue","currentSelectedValue","previousSelectedValue","currentSelectedCategoryValue","previousSelectedCategoryValue","current","onSelect","event","data","categoryValue","onRequestNavCategoryItemToggle","nextOpenCategories","registeredNavItems","onRegister","useCallback","JSON","stringify","onUnregister","getRegisteredNavItems","components","root","always","elementType","tabbable"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategory/NavCategory.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { NavItemValue } from '../NavContext.types';\nimport { NavCategoryContextValue } from '../NavCategoryContext';\n\n/**\n * NavCategory Props\n */\nexport type NavCategoryProps = {\n /**\n * Required value that identifies this item inside an Nav component.\n */\n value: NavItemValue;\n\n /**\n * Children of the NavCategory\n */\n children?: React.ReactNode | null;\n};\n\n/**\n * State used in rendering NavCategory\n */\nexport type NavCategoryState = NavCategoryContextValue & Required<NavCategoryProps>;\n"],"names":[
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategory/NavCategory.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { NavItemValue } from '../NavContext.types';\nimport type { NavCategoryContextValue } from '../NavCategoryContext';\n\n/**\n * NavCategory Props\n */\nexport type NavCategoryProps = {\n /**\n * Required value that identifies this item inside an Nav component.\n */\n value: NavItemValue;\n\n /**\n * Children of the NavCategory\n */\n children?: React.ReactNode | null;\n};\n\n/**\n * State used in rendering NavCategory\n */\nexport type NavCategoryState = NavCategoryContextValue & Required<NavCategoryProps>;\n"],"names":[],"mappings":"AAmBA;;CAEC,GACD,WAAoF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { NavCategoryContextValues
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { NavCategoryContextValues } from '../NavCategoryContext';\nimport { NavCategoryProvider } from '../NavCategoryContext';\n\nimport type { NavCategoryState } from './NavCategory.types';\n\n/**\n * Render the final JSX of NavCategory\n */\nexport const renderNavCategory_unstable = (\n state: NavCategoryState,\n contextValues: NavCategoryContextValues,\n): JSXElement => {\n return <NavCategoryProvider value={contextValues.categoryValue}>{state.children}</NavCategoryProvider>;\n};\n"],"names":["React","NavCategoryProvider","renderNavCategory_unstable","state","contextValues","value","categoryValue","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,mBAAmB,QAAQ,wBAAwB;AAI5D;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,qBAAO,oBAACH;QAAoBI,OAAOD,cAAcE,aAAa;OAAGH,MAAMI,QAAQ;AACjF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategory/useNavCategory.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useNavContext_unstable } from '../NavContext';\n\nimport type { NavCategoryProps, NavCategoryState } from './NavCategory.types';\n\n/**\n * Create the state required to render NavCategory.\n *\n * The returned state can be modified with hooks such as useNavCategoryStyles_unstable,\n * before being passed to renderNavCategory_unstable.\n *\n * @param props - props from this instance of NavCategory\n * @param ref - reference to root HTMLDivElement of NavCategory\n */\nexport const useNavCategory_unstable = (props: NavCategoryProps, ref: React.Ref<HTMLDivElement>): NavCategoryState => {\n const { value, children } = props;\n\n const { openCategories } = useNavContext_unstable();\n\n const open: boolean = openCategories?.includes(value);\n\n return {\n open,\n value,\n children: children ?? null,\n };\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategory/useNavCategory.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useNavContext_unstable } from '../NavContext';\n\nimport type { NavCategoryProps, NavCategoryState } from './NavCategory.types';\n\n/**\n * Create the state required to render NavCategory.\n *\n * The returned state can be modified with hooks such as useNavCategoryStyles_unstable,\n * before being passed to renderNavCategory_unstable.\n *\n * @param props - props from this instance of NavCategory\n * @param ref - reference to root HTMLDivElement of NavCategory\n */\nexport const useNavCategory_unstable = (props: NavCategoryProps, ref: React.Ref<HTMLDivElement>): NavCategoryState => {\n const { value, children } = props;\n\n const { openCategories } = useNavContext_unstable();\n\n const open: boolean = openCategories?.includes(value);\n\n return {\n open,\n value,\n children: children ?? null,\n };\n};\n"],"names":["useNavContext_unstable","useNavCategory_unstable","props","ref","value","children","openCategories","open","includes"],"mappings":"AAAA;AAGA,SAASA,sBAAsB,QAAQ,gBAAgB;AAIvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAE5B,MAAM,EAAEI,cAAc,EAAE,GAAGN;IAE3B,MAAMO,OAAgBD,2BAAAA,qCAAAA,eAAgBE,QAAQ,CAACJ;IAE/C,OAAO;QACLG;QACAH;QACAC,UAAUA,qBAAAA,sBAAAA,WAAY;IACxB;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionItemContext\n\nexport type NavCategoryContextValues = {\n categoryValue: NavCategoryContextValue;\n};\n\nexport type NavCategoryContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryContext = React.createContext<NavCategoryContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryContextValue>;\n\nconst navCategoryContextDefaultValue: NavCategoryContextValue = {\n open: false,\n value: '',\n};\n\nexport const { Provider: NavCategoryProvider } = NavCategoryContext;\n\nexport const useNavCategoryContext_unstable = (): NavCategoryContextValue => {\n return React.useContext(NavCategoryContext) ?? navCategoryContextDefaultValue;\n};\n"],"names":["React","NavCategoryContext","createContext","undefined","navCategoryContextDefaultValue","open","value","Provider","NavCategoryProvider","useNavCategoryContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAc/B,MAAMC,qBAAqBD,MAAME,aAAa,CAC5CC;AAGF,MAAMC,iCAA0D;IAC9DC,MAAM;IACNC,OAAO;AACT;AAEA,OAAO,MAAM,EAAEC,UAAUC,mBAAmB,EAAE,GAAGP,mBAAmB;AAEpE,OAAO,MAAMQ,iCAAiC;QACrCT;IAAP,OAAOA,CAAAA,oBAAAA,MAAMU,UAAU,CAACT,iCAAjBD,+BAAAA,oBAAwCI;AACjD,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionItemContext\n\nexport type NavCategoryContextValues = {\n categoryValue: NavCategoryContextValue;\n};\n\nexport type NavCategoryContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryContext = React.createContext<NavCategoryContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryContextValue>;\n\nconst navCategoryContextDefaultValue: NavCategoryContextValue = {\n open: false,\n value: '',\n};\n\nexport const { Provider: NavCategoryProvider } = NavCategoryContext;\n\nexport const useNavCategoryContext_unstable = (): NavCategoryContextValue => {\n return React.useContext(NavCategoryContext) ?? navCategoryContextDefaultValue;\n};\n"],"names":["React","NavCategoryContext","createContext","undefined","navCategoryContextDefaultValue","open","value","Provider","NavCategoryProvider","useNavCategoryContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAc/B,MAAMC,qBAAqBD,MAAME,aAAa,CAC5CC;AAGF,MAAMC,iCAA0D;IAC9DC,MAAM;IACNC,OAAO;AACT;AAEA,OAAO,MAAM,EAAEC,UAAUC,mBAAmB,EAAE,GAAGP,mBAAmB;AAEpE,OAAO,MAAMQ,iCAAiC;QACrCT;IAAP,OAAOA,CAAAA,oBAAAA,MAAMU,UAAU,CAACT,iCAAjBD,+BAAAA,oBAAwCI;AACjD,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryItem/useNavCategoryItem.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport {\n useContentStyles,\n useIconStyles,\n useIndicatorStyles,\n useRootDefaultClassName,\n useSmallStyles,\n} from '../sharedNavStyles.styles';\n\nimport type { NavCategoryItemSlots, NavCategoryItemState } from './NavCategoryItem.types';\n\nexport const navCategoryItemClassNames: SlotClassNames<NavCategoryItemSlots> = {\n root: 'fui-NavCategoryItem',\n icon: 'fui-NavCategoryItem__icon',\n expandIcon: 'fui-NavCategoryItem__expandIcon',\n expandIconMotion: 'fui-NavCategoryItem__expandIconMotion',\n};\n\nconst useExpandIconStyles = makeStyles({\n base: {\n marginInlineStart: 'auto',\n height: '20px',\n },\n selected: typographyStyles.body1Strong,\n});\n\n/**\n * Styles for the root slot\n */\nexport const useRootStyles = makeStyles({\n base: {\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the NavCategoryItem slots based on the state\n */\nexport const useNavCategoryItemStyles_unstable = (state: NavCategoryItemState): NavCategoryItemState => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const smallStyles = useSmallStyles();\n const defaultRootClassName = useRootDefaultClassName();\n const contentStyles = useContentStyles();\n const indicatorStyles = useIndicatorStyles();\n const iconStyles = useIconStyles();\n const expandIconStyles = useExpandIconStyles();\n\n const { selected, open, density } = state;\n\n state.root.className = mergeClasses(\n navCategoryItemClassNames.root,\n defaultRootClassName,\n rootStyles.base,\n density === 'small' && smallStyles.root,\n selected && open === false && indicatorStyles.base,\n selected && open === false && contentStyles.selected,\n state.root.className,\n );\n\n state.expandIcon.className = mergeClasses(\n navCategoryItemClassNames.expandIcon,\n expandIconStyles.base,\n state.expandIcon.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n navCategoryItemClassNames.icon,\n iconStyles.base,\n selected && iconStyles.selected,\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","typographyStyles","useContentStyles","useIconStyles","useIndicatorStyles","useRootDefaultClassName","useSmallStyles","navCategoryItemClassNames","root","icon","expandIcon","expandIconMotion","useExpandIconStyles","base","marginInlineStart","height","selected","body1Strong","useRootStyles","width","useNavCategoryItemStyles_unstable","state","rootStyles","smallStyles","defaultRootClassName","contentStyles","indicatorStyles","iconStyles","expandIconStyles","open","density","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SACEC,gBAAgB,EAChBC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,EACvBC,cAAc,QACT,4BAA4B;AAInC,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,MAAM;IACNC,YAAY;IACZC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,sBAAsBb,WAAW;IACrCc,MAAM;QACJC,mBAAmB;QACnBC,QAAQ;IACV;IACAC,UAAUf,iBAAiBgB,WAAW;AACxC;AAEA;;CAEC,GACD,OAAO,MAAMC,gBAAgBnB,WAAW;IACtCc,MAAM;QACJM,OAAO;IACT;AACF,GAAG;AAEH;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD;IAEA,MAAMC,aAAaJ;IACnB,MAAMK,cAAcjB;IACpB,MAAMkB,uBAAuBnB;IAC7B,MAAMoB,gBAAgBvB;IACtB,MAAMwB,kBAAkBtB;IACxB,MAAMuB,aAAaxB;IACnB,MAAMyB,mBAAmBhB;IAEzB,MAAM,EAAEI,QAAQ,EAAEa,IAAI,EAAEC,OAAO,EAAE,GAAGT;IAEpCA,MAAMb,IAAI,CAACuB,SAAS,GAAG/B,aACrBO,0BAA0BC,IAAI,EAC9BgB,sBACAF,WAAWT,IAAI,EACfiB,YAAY,WAAWP,YAAYf,IAAI,EACvCQ,YAAYa,SAAS,SAASH,gBAAgBb,IAAI,EAClDG,YAAYa,SAAS,SAASJ,cAAcT,QAAQ,EACpDK,MAAMb,IAAI,CAACuB,SAAS;IAGtBV,MAAMX,UAAU,CAACqB,SAAS,GAAG/B,aAC3BO,0BAA0BG,UAAU,EACpCkB,iBAAiBf,IAAI,EACrBQ,MAAMX,UAAU,CAACqB,SAAS;IAG5B,IAAIV,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACsB,SAAS,GAAG/B,aACrBO,0BAA0BE,IAAI,EAC9BkB,WAAWd,IAAI,EACfG,YAAYW,WAAWX,QAAQ,EAC/BK,MAAMZ,IAAI,CAACsB,SAAS;IAExB;IAEA,OAAOV;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryItem/useNavCategoryItem.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport {\n useContentStyles,\n useIconStyles,\n useIndicatorStyles,\n useRootDefaultClassName,\n useSmallStyles,\n} from '../sharedNavStyles.styles';\n\nimport type { NavCategoryItemSlots, NavCategoryItemState } from './NavCategoryItem.types';\n\nexport const navCategoryItemClassNames: SlotClassNames<NavCategoryItemSlots> = {\n root: 'fui-NavCategoryItem',\n icon: 'fui-NavCategoryItem__icon',\n expandIcon: 'fui-NavCategoryItem__expandIcon',\n expandIconMotion: 'fui-NavCategoryItem__expandIconMotion',\n};\n\nconst useExpandIconStyles = makeStyles({\n base: {\n marginInlineStart: 'auto',\n height: '20px',\n },\n selected: typographyStyles.body1Strong,\n});\n\n/**\n * Styles for the root slot\n */\nexport const useRootStyles = makeStyles({\n base: {\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the NavCategoryItem slots based on the state\n */\nexport const useNavCategoryItemStyles_unstable = (state: NavCategoryItemState): NavCategoryItemState => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const smallStyles = useSmallStyles();\n const defaultRootClassName = useRootDefaultClassName();\n const contentStyles = useContentStyles();\n const indicatorStyles = useIndicatorStyles();\n const iconStyles = useIconStyles();\n const expandIconStyles = useExpandIconStyles();\n\n const { selected, open, density } = state;\n\n state.root.className = mergeClasses(\n navCategoryItemClassNames.root,\n defaultRootClassName,\n rootStyles.base,\n density === 'small' && smallStyles.root,\n selected && open === false && indicatorStyles.base,\n selected && open === false && contentStyles.selected,\n state.root.className,\n );\n\n state.expandIcon.className = mergeClasses(\n navCategoryItemClassNames.expandIcon,\n expandIconStyles.base,\n state.expandIcon.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n navCategoryItemClassNames.icon,\n iconStyles.base,\n selected && iconStyles.selected,\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","typographyStyles","useContentStyles","useIconStyles","useIndicatorStyles","useRootDefaultClassName","useSmallStyles","navCategoryItemClassNames","root","icon","expandIcon","expandIconMotion","useExpandIconStyles","base","marginInlineStart","height","selected","body1Strong","useRootStyles","width","useNavCategoryItemStyles_unstable","state","rootStyles","smallStyles","defaultRootClassName","contentStyles","indicatorStyles","iconStyles","expandIconStyles","open","density","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SACEC,gBAAgB,EAChBC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,EACvBC,cAAc,QACT,4BAA4B;AAInC,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,MAAM;IACNC,YAAY;IACZC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,sBAAsBb,WAAW;IACrCc,MAAM;QACJC,mBAAmB;QACnBC,QAAQ;IACV;IACAC,UAAUf,iBAAiBgB,WAAW;AACxC;AAEA;;CAEC,GACD,OAAO,MAAMC,gBAAgBnB,WAAW;IACtCc,MAAM;QACJM,OAAO;IACT;AACF,GAAG;AAEH;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD;IAEA,MAAMC,aAAaJ;IACnB,MAAMK,cAAcjB;IACpB,MAAMkB,uBAAuBnB;IAC7B,MAAMoB,gBAAgBvB;IACtB,MAAMwB,kBAAkBtB;IACxB,MAAMuB,aAAaxB;IACnB,MAAMyB,mBAAmBhB;IAEzB,MAAM,EAAEI,QAAQ,EAAEa,IAAI,EAAEC,OAAO,EAAE,GAAGT;IAEpCA,MAAMb,IAAI,CAACuB,SAAS,GAAG/B,aACrBO,0BAA0BC,IAAI,EAC9BgB,sBACAF,WAAWT,IAAI,EACfiB,YAAY,WAAWP,YAAYf,IAAI,EACvCQ,YAAYa,SAAS,SAASH,gBAAgBb,IAAI,EAClDG,YAAYa,SAAS,SAASJ,cAAcT,QAAQ,EACpDK,MAAMb,IAAI,CAACuB,SAAS;IAGtBV,MAAMX,UAAU,CAACqB,SAAS,GAAG/B,aAC3BO,0BAA0BG,UAAU,EACpCkB,iBAAiBf,IAAI,EACrBQ,MAAMX,UAAU,CAACqB,SAAS;IAG5B,IAAIV,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACsB,SAAS,GAAG/B,aACrBO,0BAA0BE,IAAI,EAC9BkB,WAAWd,IAAI,EACfG,YAAYW,WAAWX,QAAQ,EAC/BK,MAAMZ,IAAI,CAACsB,SAAS;IAExB;IAEA,OAAOV;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryItemContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionHeaderContext\n\nexport type NavCategoryItemContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryItemContext = React.createContext<NavCategoryItemContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryItemContextValue>;\n\nconst NavCategoryItemContextDefaultValues = {\n open: false,\n};\n\nexport const { Provider: NavCategoryItemProvider } = NavCategoryItemContext;\n\nexport const useNavCategoryItemContext_unstable = (): NavCategoryItemContextValue =>\n React.useContext(NavCategoryItemContext) ?? NavCategoryItemContextDefaultValues;\n"],"names":["React","NavCategoryItemContext","createContext","undefined","NavCategoryItemContextDefaultValues","open","Provider","NavCategoryItemProvider","useNavCategoryItemContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAU/B,MAAMC,yBAAyBD,MAAME,aAAa,CAChDC;AAGF,MAAMC,sCAAsC;IAC1CC,MAAM;AACR;AAEA,OAAO,MAAM,EAAEC,UAAUC,uBAAuB,EAAE,GAAGN,uBAAuB;AAE5E,OAAO,MAAMO,qCAAqC;QAChDR;WAAAA,CAAAA,oBAAAA,MAAMS,UAAU,CAACR,qCAAjBD,+BAAAA,oBAA4CI;EAAoC"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryItemContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionHeaderContext\n\nexport type NavCategoryItemContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavCategoryItemContext = React.createContext<NavCategoryItemContextValue | undefined>(\n undefined,\n) as React.Context<NavCategoryItemContextValue>;\n\nconst NavCategoryItemContextDefaultValues = {\n open: false,\n};\n\nexport const { Provider: NavCategoryItemProvider } = NavCategoryItemContext;\n\nexport const useNavCategoryItemContext_unstable = (): NavCategoryItemContextValue =>\n React.useContext(NavCategoryItemContext) ?? NavCategoryItemContextDefaultValues;\n"],"names":["React","NavCategoryItemContext","createContext","undefined","NavCategoryItemContextDefaultValues","open","Provider","NavCategoryItemProvider","useNavCategoryItemContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAU/B,MAAMC,yBAAyBD,MAAME,aAAa,CAChDC;AAGF,MAAMC,sCAAsC;IAC1CC,MAAM;AACR;AAEA,OAAO,MAAM,EAAEC,UAAUC,uBAAuB,EAAE,GAAGN,uBAAuB;AAE5E,OAAO,MAAMO,qCAAqC;QAChDR;WAAAA,CAAAA,oBAAAA,MAAMS,UAAU,CAACR,qCAAjBD,+BAAAA,oBAA4CI;EAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NavContextValue } from './NavContext.types';\n\nconst navContextDefaultValue: NavContextValue = {\n selectedValue: undefined,\n selectedCategoryValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n getRegisteredNavItems: () => {\n return {\n registeredNavItems: {},\n };\n },\n onRequestNavCategoryItemToggle() {\n /* noop */\n },\n /**\n * The list of opened panels by index\n */\n openCategories: [],\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n */\n multiple: true,\n\n /**\n * Indicates the vertical density and density of the Nav.\n */\n density: 'medium',\n\n /**\n * By default, the Nav is a single tab stop with only arrow key navigation\n */\n tabbable: false,\n};\n\nconst NavContext = React.createContext<NavContextValue | undefined>(undefined);\n\nexport const NavProvider = NavContext.Provider;\n\nexport const useNavContext_unstable = (): NavContextValue => React.useContext(NavContext) || navContextDefaultValue;\n"],"names":["React","navContextDefaultValue","selectedValue","undefined","selectedCategoryValue","onRegister","onUnregister","onSelect","getRegisteredNavItems","registeredNavItems","onRequestNavCategoryItemToggle","openCategories","multiple","density","tabbable","NavContext","createContext","NavProvider","Provider","useNavContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,yBAA0C;IAC9CC,eAAeC;IACfC,uBAAuBD;IACvBE,YAAY;IACV,QAAQ,GACV;IACAC,cAAc;IACZ,QAAQ,GACV;IACAC,UAAU;IACR,QAAQ,GACV;IACAC,uBAAuB;QACrB,OAAO;YACLC,oBAAoB,CAAC;QACvB;IACF;IACAC;IACE,QAAQ,GACV;IACA;;GAEC,GACDC,gBAAgB,EAAE;IAElB;;GAEC,GACDC,UAAU;IAEV;;GAEC,GACDC,SAAS;IAET;;GAEC,GACDC,UAAU;AACZ;AAEA,MAAMC,aAAaf,MAAMgB,aAAa,CAA8Bb;AAEpE,OAAO,MAAMc,cAAcF,WAAWG,QAAQ,CAAC;AAE/C,OAAO,MAAMC,yBAAyB,IAAuBnB,MAAMoB,UAAU,CAACL,eAAed,uBAAuB"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { NavContextValue } from './NavContext.types';\n\nconst navContextDefaultValue: NavContextValue = {\n selectedValue: undefined,\n selectedCategoryValue: undefined,\n onRegister: () => {\n /* noop */\n },\n onUnregister: () => {\n /* noop */\n },\n onSelect: () => {\n /* noop */\n },\n getRegisteredNavItems: () => {\n return {\n registeredNavItems: {},\n };\n },\n onRequestNavCategoryItemToggle() {\n /* noop */\n },\n /**\n * The list of opened panels by index\n */\n openCategories: [],\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n */\n multiple: true,\n\n /**\n * Indicates the vertical density and density of the Nav.\n */\n density: 'medium',\n\n /**\n * By default, the Nav is a single tab stop with only arrow key navigation\n */\n tabbable: false,\n};\n\nconst NavContext = React.createContext<NavContextValue | undefined>(undefined);\n\nexport const NavProvider = NavContext.Provider;\n\nexport const useNavContext_unstable = (): NavContextValue => React.useContext(NavContext) || navContextDefaultValue;\n"],"names":["React","navContextDefaultValue","selectedValue","undefined","selectedCategoryValue","onRegister","onUnregister","onSelect","getRegisteredNavItems","registeredNavItems","onRequestNavCategoryItemToggle","openCategories","multiple","density","tabbable","NavContext","createContext","NavProvider","Provider","useNavContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,yBAA0C;IAC9CC,eAAeC;IACfC,uBAAuBD;IACvBE,YAAY;IACV,QAAQ,GACV;IACAC,cAAc;IACZ,QAAQ,GACV;IACAC,UAAU;IACR,QAAQ,GACV;IACAC,uBAAuB;QACrB,OAAO;YACLC,oBAAoB,CAAC;QACvB;IACF;IACAC;IACE,QAAQ,GACV;IACA;;GAEC,GACDC,gBAAgB,EAAE;IAElB;;GAEC,GACDC,UAAU;IAEV;;GAEC,GACDC,SAAS;IAET;;GAEC,GACDC,UAAU;AACZ;AAEA,MAAMC,aAAaf,MAAMgB,aAAa,CAA8Bb;AAEpE,OAAO,MAAMc,cAAcF,WAAWG,QAAQ,CAAC;AAE/C,OAAO,MAAMC,yBAAyB,IAAuBnB,MAAMoB,UAAU,CAACL,eAAed,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavContext.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { EventHandler } from '@fluentui/react-utilities';\n\nimport type { NavProps, OnNavItemSelectData } from './Nav/Nav.types';\n\nexport type NavContextValue = Pick<\n NavProps,\n 'onNavItemSelect' | 'selectedValue' | 'selectedCategoryValue' | 'density'\n> & {\n /** A callback to allow a navItem to register itself with the navItem list. */\n onRegister: RegisterNavItemEventHandler;\n\n /** A callback to allow a navItem to unregister itself with the navItem list. */\n onUnregister: RegisterNavItemEventHandler;\n /**\n * A callback to allow a navItem to select itself when pressed.\n */\n onSelect: EventHandler<OnNavItemSelectData>;\n /**\n * Gets the registered navItem data along with current and previous selected values.\n */\n getRegisteredNavItems: () => {\n selectedValue?: NavItemValue;\n selectedCategoryValue?: NavItemValue;\n previousSelectedValue?: NavItemValue;\n registeredNavItems: Record<string, NavItemRegisterData>;\n };\n /**\n * Callback used by NavCategoryItem to request a change on it's own opened state\n * Should be used to toggle NavCategoryItem's open state\n */\n onRequestNavCategoryItemToggle: EventHandler<OnNavItemSelectData>;\n\n /**\n * The list of opened panels by index\n */\n openCategories: NavItemValue[];\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n * @default true, indicating that multiple categories can be open at the same time.\n */\n multiple: boolean;\n\n /**\n * Setting this to true enables tab AND arrow navigation.\n * @default false\n */\n tabbable: boolean;\n};\n\n/**\n * Any value that identifies a specific Item.\n */\nexport type NavItemValue = string;\n\n/**\n * Context values used in rendering navItemList.\n */\nexport type NavContextValues = {\n /**\n * The context of the navItem list available to each navItem.\n */\n nav: NavContextValue;\n};\n\nexport type NavItemRegisterData = {\n /**\n * The value of the navItem.\n */\n value: NavItemValue;\n\n /**\n * The reference to the navItem HTML element.\n */\n ref: React.RefObject<HTMLElement | null>;\n};\n\nexport type RegisterNavItemEventHandler = (data: NavItemRegisterData) => void;\n"],"names":[
|
|
1
|
+
{"version":3,"sources":["../src/components/NavContext.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { EventHandler } from '@fluentui/react-utilities';\n\nimport type { NavProps, OnNavItemSelectData } from './Nav/Nav.types';\n\nexport type NavContextValue = Pick<\n NavProps,\n 'onNavItemSelect' | 'selectedValue' | 'selectedCategoryValue' | 'density'\n> & {\n /** A callback to allow a navItem to register itself with the navItem list. */\n onRegister: RegisterNavItemEventHandler;\n\n /** A callback to allow a navItem to unregister itself with the navItem list. */\n onUnregister: RegisterNavItemEventHandler;\n /**\n * A callback to allow a navItem to select itself when pressed.\n */\n onSelect: EventHandler<OnNavItemSelectData>;\n /**\n * Gets the registered navItem data along with current and previous selected values.\n */\n getRegisteredNavItems: () => {\n selectedValue?: NavItemValue;\n selectedCategoryValue?: NavItemValue;\n previousSelectedValue?: NavItemValue;\n registeredNavItems: Record<string, NavItemRegisterData>;\n };\n /**\n * Callback used by NavCategoryItem to request a change on it's own opened state\n * Should be used to toggle NavCategoryItem's open state\n */\n onRequestNavCategoryItemToggle: EventHandler<OnNavItemSelectData>;\n\n /**\n * The list of opened panels by index\n */\n openCategories: NavItemValue[];\n\n /**\n * Indicates if Nav supports multiple open Categories at the same time.\n * @default true, indicating that multiple categories can be open at the same time.\n */\n multiple: boolean;\n\n /**\n * Setting this to true enables tab AND arrow navigation.\n * @default false\n */\n tabbable: boolean;\n};\n\n/**\n * Any value that identifies a specific Item.\n */\nexport type NavItemValue = string;\n\n/**\n * Context values used in rendering navItemList.\n */\nexport type NavContextValues = {\n /**\n * The context of the navItem list available to each navItem.\n */\n nav: NavContextValue;\n};\n\nexport type NavItemRegisterData = {\n /**\n * The value of the navItem.\n */\n value: NavItemValue;\n\n /**\n * The reference to the navItem HTML element.\n */\n ref: React.RefObject<HTMLElement | null>;\n};\n\nexport type RegisterNavItemEventHandler = (data: NavItemRegisterData) => void;\n"],"names":[],"mappings":"AA8EA,WAA8E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDivider/useNavDivider.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { NavDividerProps, NavDividerState } from './NavDivider.types';\nimport { useDivider_unstable } from '@fluentui/react-divider';\n\n/**\n * Create the state required to render NavDivider.\n *\n * The returned state can be modified with hooks such as useNavDividerStyles_unstable,\n * before being passed to renderNavDivider_unstable.\n *\n * @param props - props from this instance of NavDivider\n * @param ref - reference to root HTMLDivElement of NavDivider\n */\nexport const useNavDivider_unstable = (props: NavDividerProps, ref: React.Ref<HTMLElement>): NavDividerState => {\n return useDivider_unstable({ appearance: 'strong', ...props }, ref);\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDivider/useNavDivider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { NavDividerProps, NavDividerState } from './NavDivider.types';\nimport { useDivider_unstable } from '@fluentui/react-divider';\n\n/**\n * Create the state required to render NavDivider.\n *\n * The returned state can be modified with hooks such as useNavDividerStyles_unstable,\n * before being passed to renderNavDivider_unstable.\n *\n * @param props - props from this instance of NavDivider\n * @param ref - reference to root HTMLDivElement of NavDivider\n */\nexport const useNavDivider_unstable = (props: NavDividerProps, ref: React.Ref<HTMLElement>): NavDividerState => {\n return useDivider_unstable({ appearance: 'strong', ...props }, ref);\n};\n"],"names":["useDivider_unstable","useNavDivider_unstable","props","ref","appearance"],"mappings":"AAAA;AAIA,SAASA,mBAAmB,QAAQ,0BAA0B;AAE9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,OAAOH,oBAAoB;QAAEI,YAAY;QAAU,GAAGF,KAAK;IAAC,GAAGC;AACjE,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawer/NavDrawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\nimport { useNavDrawer_unstable } from './useNavDrawer';\nimport { renderNavDrawer_unstable } from './renderNavDrawer';\nimport { useNavDrawerStyles_unstable } from './useNavDrawerStyles.styles';\nimport { useNavContextValues_unstable } from '../useNavContextValues';\nimport { NavState } from '../Nav/Nav.types';\nimport type { NavDrawerProps } from './NavDrawer.types';\n\n/**\n * NavDrawer component - a component that provides a drawer for navigation items.\n */\nexport const NavDrawer: ForwardRefComponent<NavDrawerProps> = React.forwardRef((props, ref) => {\n const state = useNavDrawer_unstable(props, ref);\n const contextValues = useNavContextValues_unstable(state as NavState);\n\n useNavDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useNavDrawerStyles_unstable')(state);\n\n return renderNavDrawer_unstable(state, contextValues);\n});\n\nNavDrawer.displayName = 'NavDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useNavDrawer_unstable","renderNavDrawer_unstable","useNavDrawerStyles_unstable","useNavContextValues_unstable","NavDrawer","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAG9E,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAC1E,SAASC,4BAA4B,QAAQ,yBAAyB;AAItE;;CAEC,GACD,OAAO,MAAMC,0BAAiDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQR,sBAAsBM,OAAOC;IAC3C,MAAME,gBAAgBN,6BAA6BK;IAEnDN,4BAA4BM;IAC5BT,4BAA4B,+BAA+BS;IAE3D,OAAOP,yBAAyBO,OAAOC;AACzC,GAAG;AAEHL,UAAUM,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawer/NavDrawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\nimport { useNavDrawer_unstable } from './useNavDrawer';\nimport { renderNavDrawer_unstable } from './renderNavDrawer';\nimport { useNavDrawerStyles_unstable } from './useNavDrawerStyles.styles';\nimport { useNavContextValues_unstable } from '../useNavContextValues';\nimport type { NavState } from '../Nav/Nav.types';\nimport type { NavDrawerProps } from './NavDrawer.types';\n\n/**\n * NavDrawer component - a component that provides a drawer for navigation items.\n */\nexport const NavDrawer: ForwardRefComponent<NavDrawerProps> = React.forwardRef((props, ref) => {\n const state = useNavDrawer_unstable(props, ref);\n const contextValues = useNavContextValues_unstable(state as NavState);\n\n useNavDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useNavDrawerStyles_unstable')(state);\n\n return renderNavDrawer_unstable(state, contextValues);\n});\n\nNavDrawer.displayName = 'NavDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useNavDrawer_unstable","renderNavDrawer_unstable","useNavDrawerStyles_unstable","useNavContextValues_unstable","NavDrawer","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAG9E,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAC1E,SAASC,4BAA4B,QAAQ,yBAAyB;AAItE;;CAEC,GACD,OAAO,MAAMC,0BAAiDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQR,sBAAsBM,OAAOC;IAC3C,MAAME,gBAAgBN,6BAA6BK;IAEnDN,4BAA4BM;IAC5BT,4BAA4B,+BAA+BS;IAE3D,OAAOP,yBAAyBO,OAAOC;AACzC,GAAG;AAEHL,UAAUM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawer/NavDrawer.types.ts"],"sourcesContent":["import { DrawerProps, DrawerSlots, DrawerState } from '@fluentui/react-drawer';\nimport { ComponentProps } from '@fluentui/react-utilities';\nimport { NavProps } from '../Nav/Nav.types';\nimport { NavContextValue } from '../NavContext.types';\n\n/**\n * NavDrawer slots\n */\nexport type NavDrawerSlots = DrawerSlots;\n\n/**\n * NavDrawer Props\n */\nexport type NavDrawerProps = ComponentProps<NavDrawerSlots> &\n DrawerProps &\n NavProps & {\n /**\n * The component uses arrow navigation by default.\n * Setting this to true enables tab AND arrow navigation.\n * @default false\n */\n tabbable?: boolean;\n };\n\n/**\n * State used in rendering NavDrawer\n */\nexport type NavDrawerState = DrawerState &\n NavContextValue & {\n /**\n * Analagous to size from DrawerBaseProps.\n * Intended to be left unset in most cases.\n * If left unset, it defaults to 260px.\n */\n size?: 'small' | 'medium' | 'large' | 'full';\n };\n"],"names":[],"mappings":"AAwBA;;CAEC,GACD,WAQI"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawer/NavDrawer.types.ts"],"sourcesContent":["import type { DrawerProps, DrawerSlots, DrawerState } from '@fluentui/react-drawer';\nimport type { ComponentProps } from '@fluentui/react-utilities';\nimport type { NavProps } from '../Nav/Nav.types';\nimport type { NavContextValue } from '../NavContext.types';\n\n/**\n * NavDrawer slots\n */\nexport type NavDrawerSlots = DrawerSlots;\n\n/**\n * NavDrawer Props\n */\nexport type NavDrawerProps = ComponentProps<NavDrawerSlots> &\n DrawerProps &\n NavProps & {\n /**\n * The component uses arrow navigation by default.\n * Setting this to true enables tab AND arrow navigation.\n * @default false\n */\n tabbable?: boolean;\n };\n\n/**\n * State used in rendering NavDrawer\n */\nexport type NavDrawerState = DrawerState &\n NavContextValue & {\n /**\n * Analagous to size from DrawerBaseProps.\n * Intended to be left unset in most cases.\n * If left unset, it defaults to 260px.\n */\n size?: 'small' | 'medium' | 'large' | 'full';\n };\n"],"names":[],"mappings":"AAwBA;;CAEC,GACD,WAQI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawer/useNavDrawer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawer/useNavDrawer.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { DrawerProps } from '@fluentui/react-drawer';\nimport { Drawer } from '@fluentui/react-drawer';\nimport type { RefAttributes } from '@fluentui/react-utilities';\nimport { slot } from '@fluentui/react-utilities';\n\nimport { useNav_unstable } from '../Nav/useNav';\nimport type { NavDrawerProps, NavDrawerState } from './NavDrawer.types';\n\n/**\n * Create the state required to render NavDrawer.\n *\n * The returned state can be modified with hooks such as useNavDrawerStyles_unstable,\n * before being passed to renderNavDrawer_unstable.\n *\n * @param props - props from this instance of NavDrawer\n * @param ref - reference to root HTMLDivElement of NavDrawer\n */\nexport const useNavDrawer_unstable = (props: NavDrawerProps, ref: React.Ref<HTMLDivElement>): NavDrawerState => {\n const { size = undefined, tabbable = false } = props;\n\n const navState = useNav_unstable(props, ref);\n\n return {\n ...navState,\n size,\n tabbable,\n components: {\n // TODO: remove once React v18 slot API is modified\n // this is a problem with the lack of support for union types on React v18\n // ComponentState is using React.ComponentType which will try to infer propType\n // propTypes WeakValidator signature will break distributive unions making this type invalid\n root: Drawer as React.FC<DrawerProps>,\n },\n\n root: slot.always(\n { ref, role: 'navigation', ...props },\n {\n // TODO: remove once React v18 slot API is modified\n // this is a problem with the lack of support for union types on React v18\n // ComponentState is using React.ComponentType which will try to infer propType\n // propTypes WeakValidator signature will break distributive unions making this type invalid\n elementType: Drawer as React.FC<DrawerProps & RefAttributes<HTMLDivElement>>,\n },\n ),\n };\n};\n"],"names":["Drawer","slot","useNav_unstable","useNavDrawer_unstable","props","ref","size","undefined","tabbable","navState","components","root","always","role","elementType"],"mappings":"AAAA;AAIA,SAASA,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,eAAe,QAAQ,gBAAgB;AAGhD;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,OAAOC,SAAS,EAAEC,WAAW,KAAK,EAAE,GAAGJ;IAE/C,MAAMK,WAAWP,gBAAgBE,OAAOC;IAExC,OAAO;QACL,GAAGI,QAAQ;QACXH;QACAE;QACAE,YAAY;YACV,mDAAmD;YACnD,0EAA0E;YAC1E,+EAA+E;YAC/E,4FAA4F;YAC5FC,MAAMX;QACR;QAEAW,MAAMV,KAAKW,MAAM,CACf;YAAEP;YAAKQ,MAAM;YAAc,GAAGT,KAAK;QAAC,GACpC;YACE,mDAAmD;YACnD,0EAA0E;YAC1E,+EAA+E;YAC/E,4FAA4F;YAC5FU,aAAad;QACf;IAEJ;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawerBody/useNavDrawerBody.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useDrawerBody_unstable } from '@fluentui/react-drawer';\n\nimport { useNavContext_unstable } from '../NavContext';\nimport type { NavDrawerBodyProps, NavDrawerBodyState } from './NavDrawerBody.types';\n/**\n * Create the state required to render NavDrawerBody.\n *\n * The returned state can be modified with hooks such as useNavDrawerBodyStyles_unstable,\n * before being passed to renderNavDrawerBody_unstable.\n *\n * @param props - props from this instance of NavDrawerBody\n * @param ref - reference to root HTMLDivElement of NavDrawerBody\n */\nexport const useNavDrawerBody_unstable = (\n props: NavDrawerBodyProps,\n ref: React.Ref<HTMLDivElement>,\n): NavDrawerBodyState => {\n const { tabbable } = useNavContext_unstable();\n const focusAttributes = useArrowNavigationGroup({\n axis: 'vertical',\n circular: true,\n tabbable,\n });\n\n return useDrawerBody_unstable({ ...focusAttributes, ...props }, ref);\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawerBody/useNavDrawerBody.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useDrawerBody_unstable } from '@fluentui/react-drawer';\n\nimport { useNavContext_unstable } from '../NavContext';\nimport type { NavDrawerBodyProps, NavDrawerBodyState } from './NavDrawerBody.types';\n/**\n * Create the state required to render NavDrawerBody.\n *\n * The returned state can be modified with hooks such as useNavDrawerBodyStyles_unstable,\n * before being passed to renderNavDrawerBody_unstable.\n *\n * @param props - props from this instance of NavDrawerBody\n * @param ref - reference to root HTMLDivElement of NavDrawerBody\n */\nexport const useNavDrawerBody_unstable = (\n props: NavDrawerBodyProps,\n ref: React.Ref<HTMLDivElement>,\n): NavDrawerBodyState => {\n const { tabbable } = useNavContext_unstable();\n const focusAttributes = useArrowNavigationGroup({\n axis: 'vertical',\n circular: true,\n tabbable,\n });\n\n return useDrawerBody_unstable({ ...focusAttributes, ...props }, ref);\n};\n"],"names":["useArrowNavigationGroup","useDrawerBody_unstable","useNavContext_unstable","useNavDrawerBody_unstable","props","ref","tabbable","focusAttributes","axis","circular"],"mappings":"AAAA;AAGA,SAASA,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,sBAAsB,QAAQ,yBAAyB;AAEhE,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAE,GAAGJ;IACrB,MAAMK,kBAAkBP,wBAAwB;QAC9CQ,MAAM;QACNC,UAAU;QACVH;IACF;IAEA,OAAOL,uBAAuB;QAAE,GAAGM,eAAe;QAAE,GAAGH,KAAK;IAAC,GAAGC;AAClE,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawerFooter/useNavDrawerFooter.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDrawerFooter_unstable } from '@fluentui/react-drawer';\nimport type { NavDrawerFooterProps, NavDrawerFooterState } from './NavDrawerFooter.types';\n\n/**\n * Create the state required to render NavDrawerFooter.\n *\n * The returned state can be modified with hooks such as useNavDrawerFooterStyles_unstable,\n * before being passed to renderNavDrawerFooter_unstable.\n *\n * @param props - props from this instance of NavDrawerFooter\n * @param ref - reference to root HTMLDivElement of NavDrawerFooter\n */\nexport const useNavDrawerFooter_unstable = (\n props: NavDrawerFooterProps,\n ref: React.Ref<HTMLElement>,\n): NavDrawerFooterState => {\n return useDrawerFooter_unstable(props, ref);\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawerFooter/useNavDrawerFooter.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useDrawerFooter_unstable } from '@fluentui/react-drawer';\nimport type { NavDrawerFooterProps, NavDrawerFooterState } from './NavDrawerFooter.types';\n\n/**\n * Create the state required to render NavDrawerFooter.\n *\n * The returned state can be modified with hooks such as useNavDrawerFooterStyles_unstable,\n * before being passed to renderNavDrawerFooter_unstable.\n *\n * @param props - props from this instance of NavDrawerFooter\n * @param ref - reference to root HTMLDivElement of NavDrawerFooter\n */\nexport const useNavDrawerFooter_unstable = (\n props: NavDrawerFooterProps,\n ref: React.Ref<HTMLElement>,\n): NavDrawerFooterState => {\n return useDrawerFooter_unstable(props, ref);\n};\n"],"names":["useDrawerFooter_unstable","useNavDrawerFooter_unstable","props","ref"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,QAAQ,yBAAyB;AAGlE;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,OAAOH,yBAAyBE,OAAOC;AACzC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavDrawerHeader/useNavDrawerHeader.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDrawerHeader_unstable } from '@fluentui/react-drawer';\n\nimport type { NavDrawerHeaderProps, NavDrawerHeaderState } from './NavDrawerHeader.types';\n\n/**\n * Create the state required to render NavDrawerHeader.\n *\n * The returned state can be modified with hooks such as useNavDrawerHeaderStyles_unstable,\n * before being passed to renderNavDrawerHeader_unstable.\n *\n * @param props - props from this instance of NavDrawerHeader\n * @param ref - reference to root HTMLDivElement of NavDrawerHeader\n */\nexport const useNavDrawerHeader_unstable = (\n props: NavDrawerHeaderProps,\n ref: React.Ref<HTMLElement>,\n): NavDrawerHeaderState => {\n return useDrawerHeader_unstable(props, ref);\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavDrawerHeader/useNavDrawerHeader.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useDrawerHeader_unstable } from '@fluentui/react-drawer';\n\nimport type { NavDrawerHeaderProps, NavDrawerHeaderState } from './NavDrawerHeader.types';\n\n/**\n * Create the state required to render NavDrawerHeader.\n *\n * The returned state can be modified with hooks such as useNavDrawerHeaderStyles_unstable,\n * before being passed to renderNavDrawerHeader_unstable.\n *\n * @param props - props from this instance of NavDrawerHeader\n * @param ref - reference to root HTMLDivElement of NavDrawerHeader\n */\nexport const useNavDrawerHeader_unstable = (\n props: NavDrawerHeaderProps,\n ref: React.Ref<HTMLElement>,\n): NavDrawerHeaderState => {\n return useDrawerHeader_unstable(props, ref);\n};\n"],"names":["useDrawerHeader_unstable","useNavDrawerHeader_unstable","props","ref"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,QAAQ,yBAAyB;AAIlE;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,OAAOH,yBAAyBE,OAAOC;AACzC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavItem/NavItem.types.ts"],"sourcesContent":["import { NavItemValue } from '../NavContext.types';\nimport { NavDensity } from '../Nav/Nav.types';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type NavItemSlots = {\n /**\n * The root element of the NavItem.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * NavItem Props\n */\nexport type NavItemProps = ComponentProps<NavItemSlots> & {\n /**\n * Destination where the nav item points to.\n */\n href?: string;\n /**\n * The value that identifies this navCategoryItem when selected.\n */\n value: NavItemValue;\n};\n\n/**\n * State used in rendering NavItem\n */\nexport type NavItemState = ComponentState<NavItemSlots> &\n Pick<NavItemProps, 'value'> & {\n /**\n * If this navCategoryItem is selected\n */\n selected: boolean;\n\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"mappings":"AA+BA;;CAEC,GACD,WAaI"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavItem/NavItem.types.ts"],"sourcesContent":["import type { NavItemValue } from '../NavContext.types';\nimport type { NavDensity } from '../Nav/Nav.types';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type NavItemSlots = {\n /**\n * The root element of the NavItem.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders before the content.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * NavItem Props\n */\nexport type NavItemProps = ComponentProps<NavItemSlots> & {\n /**\n * Destination where the nav item points to.\n */\n href?: string;\n /**\n * The value that identifies this navCategoryItem when selected.\n */\n value: NavItemValue;\n};\n\n/**\n * State used in rendering NavItem\n */\nexport type NavItemState = ComponentState<NavItemSlots> &\n Pick<NavItemProps, 'value'> & {\n /**\n * If this navCategoryItem is selected\n */\n selected: boolean;\n\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"mappings":"AA+BA;;CAEC,GACD,WAaI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavSectionHeader/useNavSectionHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { NavSectionHeaderProps, NavSectionHeaderState } from './NavSectionHeader.types';\n\n/**\n * Create the state required to render NavSectionHeader.\n *\n * The returned state can be modified with hooks such as useNavSectionHeaderStyles_unstable,\n * before being passed to renderNavSectionHeader_unstable.\n *\n * @param props - props from this instance of NavSectionHeader\n * @param ref - reference to root HTMLDivElement of NavSectionHeader\n */\nexport const useNavSectionHeader_unstable = (\n props: NavSectionHeaderProps,\n ref: React.Ref<HTMLDivElement>,\n): NavSectionHeaderState => {\n return {\n components: {\n root: 'h3',\n },\n root: slot.always(\n getIntrinsicElementProps('h3', {\n ref,\n ...props,\n }),\n { elementType: 'h3' },\n ),\n };\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavSectionHeader/useNavSectionHeader.ts"],"sourcesContent":["import type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { NavSectionHeaderProps, NavSectionHeaderState } from './NavSectionHeader.types';\n\n/**\n * Create the state required to render NavSectionHeader.\n *\n * The returned state can be modified with hooks such as useNavSectionHeaderStyles_unstable,\n * before being passed to renderNavSectionHeader_unstable.\n *\n * @param props - props from this instance of NavSectionHeader\n * @param ref - reference to root HTMLDivElement of NavSectionHeader\n */\nexport const useNavSectionHeader_unstable = (\n props: NavSectionHeaderProps,\n ref: React.Ref<HTMLDivElement>,\n): NavSectionHeaderState => {\n return {\n components: {\n root: 'h3',\n },\n root: slot.always(\n getIntrinsicElementProps('h3', {\n ref,\n ...props,\n }),\n { elementType: 'h3' },\n ),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useNavSectionHeader_unstable","props","ref","components","root","always","elementType"],"mappings":"AACA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,+BAA+B,CAC1CC,OACAC;IAEA,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,yBAAyB,MAAM;YAC7BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAK;IAExB;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavSubItem/NavSubItem.types.ts"],"sourcesContent":["import { NavItemValue } from '../NavContext.types';\n\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { NavDensity } from '../Nav/Nav.types';\n\nexport type NavSubItemSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n};\n\n/**\n * NavSubItem Props\n */\nexport type NavSubItemProps = ComponentProps<NavSubItemSlots> & {\n href?: string;\n /**\n * The value that identifies this NavSubItem when selected.\n */\n value: NavItemValue;\n};\n\n/**\n * State used in rendering NavSubItem\n */\nexport type NavSubItemState = ComponentState<NavSubItemSlots> &\n Pick<NavSubItemProps, 'value'> & {\n /**\n * If this NavSubItem is selected\n */\n selected: boolean;\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"mappings":"AAqBA;;CAEC,GACD,WAYI"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavSubItem/NavSubItem.types.ts"],"sourcesContent":["import type { NavItemValue } from '../NavContext.types';\n\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { NavDensity } from '../Nav/Nav.types';\n\nexport type NavSubItemSlots = {\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n};\n\n/**\n * NavSubItem Props\n */\nexport type NavSubItemProps = ComponentProps<NavSubItemSlots> & {\n href?: string;\n /**\n * The value that identifies this NavSubItem when selected.\n */\n value: NavItemValue;\n};\n\n/**\n * State used in rendering NavSubItem\n */\nexport type NavSubItemState = ComponentState<NavSubItemSlots> &\n Pick<NavSubItemProps, 'value'> & {\n /**\n * If this NavSubItem is selected\n */\n selected: boolean;\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"mappings":"AAqBA;;CAEC,GACD,WAYI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavSubItemContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionItemContext\n\nexport type NavSubItemContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavSubItemContext = React.createContext<NavSubItemContextValue | undefined>(\n undefined,\n) as React.Context<NavSubItemContextValue>;\n\nconst NavSubItemContextDefaultValue: NavSubItemContextValue = {\n open: false,\n value: '',\n};\n\nexport const { Provider: NavSubItemProvider } = NavSubItemContext;\n\nexport const useNavSubItemContext_unstable = (): NavSubItemContextValue => {\n return React.useContext(NavSubItemContext) ?? NavSubItemContextDefaultValue;\n};\n"],"names":["React","NavSubItemContext","createContext","undefined","NavSubItemContextDefaultValue","open","value","Provider","NavSubItemProvider","useNavSubItemContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAU/B,MAAMC,oBAAoBD,MAAME,aAAa,CAC3CC;AAGF,MAAMC,gCAAwD;IAC5DC,MAAM;IACNC,OAAO;AACT;AAEA,OAAO,MAAM,EAAEC,UAAUC,kBAAkB,EAAE,GAAGP,kBAAkB;AAElE,OAAO,MAAMQ,gCAAgC;QACpCT;IAAP,OAAOA,CAAAA,oBAAAA,MAAMU,UAAU,CAACT,gCAAjBD,+BAAAA,oBAAuCI;AAChD,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavSubItemContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { NavItemValue } from './NavContext.types';\n\n// This context is analogous to AccordionItemContext\n\nexport type NavSubItemContextValue = {\n open: boolean;\n value: NavItemValue;\n};\n\nconst NavSubItemContext = React.createContext<NavSubItemContextValue | undefined>(\n undefined,\n) as React.Context<NavSubItemContextValue>;\n\nconst NavSubItemContextDefaultValue: NavSubItemContextValue = {\n open: false,\n value: '',\n};\n\nexport const { Provider: NavSubItemProvider } = NavSubItemContext;\n\nexport const useNavSubItemContext_unstable = (): NavSubItemContextValue => {\n return React.useContext(NavSubItemContext) ?? NavSubItemContextDefaultValue;\n};\n"],"names":["React","NavSubItemContext","createContext","undefined","NavSubItemContextDefaultValue","open","value","Provider","NavSubItemProvider","useNavSubItemContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAU/B,MAAMC,oBAAoBD,MAAME,aAAa,CAC3CC;AAGF,MAAMC,gCAAwD;IAC5DC,MAAM;IACNC,OAAO;AACT;AAEA,OAAO,MAAM,EAAEC,UAAUC,kBAAkB,EAAE,GAAGP,kBAAkB;AAElE,OAAO,MAAMQ,gCAAgC;QACpCT;IAAP,OAAOA,CAAAA,oBAAAA,MAAMU,UAAU,CAACT,gCAAjBD,+BAAAA,oBAAuCI;AAChD,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavSubItemGroup/NavSubItemGroup.types.ts"],"sourcesContent":["import type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { NavDensity } from '../Nav/Nav.types';\n\n/**\n * Context value for NavSubItemGroup\n */\nexport type NavSubItemGroupCollapseMotionParams = {\n /**\n * The number of items in the NavSubItemGroup\n */\n items?: number;\n\n /**\n * The density of the NavItem\n */\n density?: NavDensity;\n};\n\nexport type NavSubItemGroupSlots = {\n /**\n * The root element\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Collapse motion slot\n */\n collapseMotion?: Slot<PresenceMotionSlotProps<NavSubItemGroupCollapseMotionParams>>;\n};\n\n/**\n * NavSubItemGroup Props\n */\nexport type NavSubItemGroupProps = ComponentProps<NavSubItemGroupSlots>;\n\n/**\n * State used in rendering NavSubItemGroup\n */\nexport type NavSubItemGroupState = ComponentState<NavSubItemGroupSlots> & {\n /**\n * Internal open state, provided by context.\n */\n open: boolean;\n};\n"],"names":[],"mappings":"AAoCA;;CAEC,GACD,WAKE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/NavSubItemGroup/NavSubItemGroup.types.ts"],"sourcesContent":["import type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { NavDensity } from '../Nav/Nav.types';\n\n/**\n * Context value for NavSubItemGroup\n */\nexport type NavSubItemGroupCollapseMotionParams = {\n /**\n * The number of items in the NavSubItemGroup\n */\n items?: number;\n\n /**\n * The density of the NavItem\n */\n density?: NavDensity;\n};\n\nexport type NavSubItemGroupSlots = {\n /**\n * The root element\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Collapse motion slot\n */\n collapseMotion?: Slot<PresenceMotionSlotProps<NavSubItemGroupCollapseMotionParams>>;\n};\n\n/**\n * NavSubItemGroup Props\n */\nexport type NavSubItemGroupProps = ComponentProps<NavSubItemGroupSlots>;\n\n/**\n * State used in rendering NavSubItemGroup\n */\nexport type NavSubItemGroupState = ComponentState<NavSubItemGroupSlots> & {\n /**\n * Internal open state, provided by context.\n */\n open: boolean;\n};\n"],"names":[],"mappings":"AAoCA;;CAEC,GACD,WAKE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavSubItemGroup/useNavSubItemGroup.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { Collapse } from '@fluentui/react-motion-components-preview';\n\nimport type { NavSubItemGroupProps, NavSubItemGroupState } from './NavSubItemGroup.types';\nimport { useNavCategoryContext_unstable } from '../NavCategoryContext';\n\n/**\n * Create the state required to render NavSubItemGroup.\n *\n * The returned state can be modified with hooks such as useNavSubItemGroupStyles_unstable,\n * before being passed to renderNavSubItemGroup_unstable.\n *\n * @param props - props from this instance of NavSubItemGroup\n * @param ref - reference to root HTMLDivElement of NavSubItemGroup\n */\nexport const useNavSubItemGroup_unstable = (\n props: NavSubItemGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): NavSubItemGroupState => {\n const { open } = useNavCategoryContext_unstable();\n\n return {\n open,\n components: {\n root: 'div',\n collapseMotion: Collapse,\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ref,\n }),\n { elementType: 'div' },\n ),\n\n collapseMotion: presenceMotionSlot(props.collapseMotion, {\n elementType: Collapse,\n defaultProps: {\n visible: open,\n unmountOnExit: true,\n },\n }),\n };\n};\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/components/NavSubItemGroup/useNavSubItemGroup.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { Collapse } from '@fluentui/react-motion-components-preview';\n\nimport type { NavSubItemGroupProps, NavSubItemGroupState } from './NavSubItemGroup.types';\nimport { useNavCategoryContext_unstable } from '../NavCategoryContext';\n\n/**\n * Create the state required to render NavSubItemGroup.\n *\n * The returned state can be modified with hooks such as useNavSubItemGroupStyles_unstable,\n * before being passed to renderNavSubItemGroup_unstable.\n *\n * @param props - props from this instance of NavSubItemGroup\n * @param ref - reference to root HTMLDivElement of NavSubItemGroup\n */\nexport const useNavSubItemGroup_unstable = (\n props: NavSubItemGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): NavSubItemGroupState => {\n const { open } = useNavCategoryContext_unstable();\n\n return {\n open,\n components: {\n root: 'div',\n collapseMotion: Collapse,\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ref,\n }),\n { elementType: 'div' },\n ),\n\n collapseMotion: presenceMotionSlot(props.collapseMotion, {\n elementType: Collapse,\n defaultProps: {\n visible: open,\n unmountOnExit: true,\n },\n }),\n };\n};\n"],"names":["getIntrinsicElementProps","slot","presenceMotionSlot","Collapse","useNavCategoryContext_unstable","useNavSubItemGroup_unstable","props","ref","open","components","root","collapseMotion","always","elementType","defaultProps","visible","unmountOnExit"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,QAAQ,QAAQ,4CAA4C;AAGrE,SAASC,8BAA8B,QAAQ,wBAAwB;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGJ;IAEjB,OAAO;QACLI;QACAC,YAAY;YACVC,MAAM;YACNC,gBAAgBR;QAClB;QAEAO,MAAMT,KAAKW,MAAM,CACfZ,yBAAyB,OAAO;YAC9B,GAAGM,KAAK;YACRC;QACF,IACA;YAAEM,aAAa;QAAM;QAGvBF,gBAAgBT,mBAAmBI,MAAMK,cAAc,EAAE;YACvDE,aAAaV;YACbW,cAAc;gBACZC,SAASP;gBACTQ,eAAe;YACjB;QACF;IACF;AACF,EAAE"}
|