@fluentui/react-nav 0.0.0-nightly-20250704-0407.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -118
- package/dist/index.d.ts +11 -37
- package/lib/components/AppItem/AppItem.js +9 -3
- package/lib/components/AppItem/AppItem.js.map +1 -1
- package/lib/components/AppItemStatic/AppItemStatic.js +9 -3
- package/lib/components/AppItemStatic/AppItemStatic.js.map +1 -1
- package/lib/components/Hamburger/Hamburger.js +5 -4
- package/lib/components/Hamburger/Hamburger.js.map +1 -1
- package/lib/components/Nav/Nav.js +0 -2
- package/lib/components/Nav/Nav.js.map +1 -1
- package/lib/components/NavCategory/NavCategory.js +1 -1
- package/lib/components/NavCategory/NavCategory.js.map +1 -1
- package/lib/components/NavCategory/renderNavCategory.js.map +1 -1
- package/lib/components/NavCategoryItem/NavCategoryItem.js +3 -2
- package/lib/components/NavCategoryItem/NavCategoryItem.js.map +1 -1
- package/lib/components/NavCategoryItem/NavCategoryItem.types.js.map +1 -1
- package/lib/components/NavCategoryItem/renderNavCategoryItem.js +1 -13
- package/lib/components/NavCategoryItem/renderNavCategoryItem.js.map +1 -1
- package/lib/components/NavCategoryItem/useNavCategoryItem.js +3 -37
- package/lib/components/NavCategoryItem/useNavCategoryItem.js.map +1 -1
- package/lib/components/NavCategoryItem/useNavCategoryItem.styles.js +1 -2
- package/lib/components/NavCategoryItem/useNavCategoryItem.styles.js.map +1 -1
- package/lib/components/NavDivider/NavDivider.js +5 -4
- package/lib/components/NavDivider/NavDivider.js.map +1 -1
- package/lib/components/NavDrawer/NavDrawer.js +5 -3
- package/lib/components/NavDrawer/NavDrawer.js.map +1 -1
- package/lib/components/NavDrawerBody/NavDrawerBody.js +3 -2
- package/lib/components/NavDrawerBody/NavDrawerBody.js.map +1 -1
- package/lib/components/NavDrawerFooter/NavDrawerFooter.js +3 -2
- package/lib/components/NavDrawerFooter/NavDrawerFooter.js.map +1 -1
- package/lib/components/NavDrawerHeader/NavDrawerHeader.js +5 -4
- package/lib/components/NavDrawerHeader/NavDrawerHeader.js.map +1 -1
- package/lib/components/NavItem/NavItem.js +5 -3
- package/lib/components/NavItem/NavItem.js.map +1 -1
- package/lib/components/NavSectionHeader/NavSectionHeader.js +3 -2
- package/lib/components/NavSectionHeader/NavSectionHeader.js.map +1 -1
- package/lib/components/NavSubItem/NavSubItem.js +5 -3
- package/lib/components/NavSubItem/NavSubItem.js.map +1 -1
- package/lib/components/NavSubItem/useNavSubItemStyles.styles.js +1 -2
- package/lib/components/NavSubItem/useNavSubItemStyles.styles.js.map +1 -1
- package/lib/components/NavSubItemGroup/NavSubItemGroup.js +5 -3
- package/lib/components/NavSubItemGroup/NavSubItemGroup.js.map +1 -1
- package/lib/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -1
- package/lib/components/NavSubItemGroup/renderNavSubItemGroup.js +3 -3
- package/lib/components/NavSubItemGroup/renderNavSubItemGroup.js.map +1 -1
- package/lib/components/NavSubItemGroup/useNavSubItemGroup.js +4 -50
- package/lib/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -1
- package/lib/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js +4 -11
- package/lib/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js.map +1 -1
- package/lib/components/SplitNavItem/SplitNavItem.js +8 -2
- package/lib/components/SplitNavItem/SplitNavItem.js.map +1 -1
- package/lib/components/SplitNavItem/renderSplitNavItem.js +12 -19
- package/lib/components/SplitNavItem/renderSplitNavItem.js.map +1 -1
- package/lib/components/SplitNavItem/useSplitNavItemStyles.styles.js +6 -41
- package/lib/components/SplitNavItem/useSplitNavItemStyles.styles.js.map +1 -1
- package/lib/components/useNavContextValues.js +3 -5
- package/lib/components/useNavContextValues.js.map +1 -1
- package/lib-commonjs/components/AppItem/AppItem.js +8 -2
- package/lib-commonjs/components/AppItem/AppItem.js.map +1 -1
- package/lib-commonjs/components/AppItemStatic/AppItemStatic.js +8 -2
- package/lib-commonjs/components/AppItemStatic/AppItemStatic.js.map +1 -1
- package/lib-commonjs/components/Hamburger/Hamburger.js +4 -3
- package/lib-commonjs/components/Hamburger/Hamburger.js.map +1 -1
- package/lib-commonjs/components/Nav/Nav.js +0 -2
- package/lib-commonjs/components/Nav/Nav.js.map +1 -1
- package/lib-commonjs/components/NavCategory/NavCategory.js.map +1 -1
- package/lib-commonjs/components/NavCategory/renderNavCategory.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.js +2 -2
- package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/NavCategoryItem.types.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/renderNavCategoryItem.js +1 -13
- package/lib-commonjs/components/NavCategoryItem/renderNavCategoryItem.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.js +2 -36
- package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.js.map +1 -1
- package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.styles.js +1 -2
- package/lib-commonjs/components/NavCategoryItem/useNavCategoryItem.styles.js.map +1 -1
- package/lib-commonjs/components/NavDivider/NavDivider.js +4 -3
- package/lib-commonjs/components/NavDivider/NavDivider.js.map +1 -1
- package/lib-commonjs/components/NavDrawer/NavDrawer.js +3 -2
- package/lib-commonjs/components/NavDrawer/NavDrawer.js.map +1 -1
- package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.js +3 -2
- package/lib-commonjs/components/NavDrawerBody/NavDrawerBody.js.map +1 -1
- package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.js +3 -2
- package/lib-commonjs/components/NavDrawerFooter/NavDrawerFooter.js.map +1 -1
- package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.js +5 -4
- package/lib-commonjs/components/NavDrawerHeader/NavDrawerHeader.js.map +1 -1
- package/lib-commonjs/components/NavItem/NavItem.js +3 -2
- package/lib-commonjs/components/NavItem/NavItem.js.map +1 -1
- package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.js +3 -2
- package/lib-commonjs/components/NavSectionHeader/NavSectionHeader.js.map +1 -1
- package/lib-commonjs/components/NavSubItem/NavSubItem.js +3 -2
- package/lib-commonjs/components/NavSubItem/NavSubItem.js.map +1 -1
- package/lib-commonjs/components/NavSubItem/useNavSubItemStyles.styles.js +1 -2
- package/lib-commonjs/components/NavSubItem/useNavSubItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.js +3 -2
- package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/NavSubItemGroup.types.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/renderNavSubItemGroup.js +3 -3
- package/lib-commonjs/components/NavSubItemGroup/renderNavSubItemGroup.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js +4 -50
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroup.js.map +1 -1
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js +4 -17
- package/lib-commonjs/components/NavSubItemGroup/useNavSubItemGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SplitNavItem/SplitNavItem.js +8 -2
- package/lib-commonjs/components/SplitNavItem/SplitNavItem.js.map +1 -1
- package/lib-commonjs/components/SplitNavItem/renderSplitNavItem.js +12 -20
- package/lib-commonjs/components/SplitNavItem/renderSplitNavItem.js.map +1 -1
- package/lib-commonjs/components/SplitNavItem/useSplitNavItemStyles.styles.js +5 -55
- package/lib-commonjs/components/SplitNavItem/useSplitNavItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/useNavContextValues.js +3 -5
- package/lib-commonjs/components/useNavContextValues.js.map +1 -1
- package/package.json +20 -16
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
3
2
|
import { useSplitNavItem_unstable } from './useSplitNavItem';
|
|
4
3
|
import { renderSplitNavItem_unstable } from './renderSplitNavItem';
|
|
5
4
|
import { useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';
|
|
@@ -8,7 +7,14 @@ import { useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';
|
|
|
8
7
|
*/ export const SplitNavItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
8
|
const state = useSplitNavItem_unstable(props, ref);
|
|
10
9
|
useSplitNavItemStyles_unstable(state);
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md
|
|
12
|
+
*
|
|
13
|
+
* TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),
|
|
14
|
+
* - uncomment this line
|
|
15
|
+
* - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}
|
|
16
|
+
* - verify that custom global style override works for your component
|
|
17
|
+
*/ // useCustomStyleHook_unstable('useSplitNavItemStyles_unstable')(state);
|
|
12
18
|
return renderSplitNavItem_unstable(state);
|
|
13
19
|
});
|
|
14
20
|
SplitNavItem.displayName = 'SplitNavItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SplitNavItem/SplitNavItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/SplitNavItem/SplitNavItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useSplitNavItem_unstable } from './useSplitNavItem';\nimport { renderSplitNavItem_unstable } from './renderSplitNavItem';\nimport { useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';\nimport type { SplitNavItemProps } from './SplitNavItem.types';\n\n/**\n * SplitNavItem component - TODO: add more docs\n */\nexport const SplitNavItem: ForwardRefComponent<SplitNavItemProps> = React.forwardRef((props, ref) => {\n const state = useSplitNavItem_unstable(props, ref);\n\n useSplitNavItemStyles_unstable(state);\n\n /**\n * @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md\n *\n * TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),\n * - uncomment this line\n * - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}\n * - verify that custom global style override works for your component\n */\n // useCustomStyleHook_unstable('useSplitNavItemStyles_unstable')(state);\n\n return renderSplitNavItem_unstable(state);\n});\n\nSplitNavItem.displayName = 'SplitNavItem';\n"],"names":["React","useSplitNavItem_unstable","renderSplitNavItem_unstable","useSplitNavItemStyles_unstable","SplitNavItem","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF;;CAEC,GACD,OAAO,MAAMC,6BAAuDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQP,yBAAyBK,OAAOC;IAE9CJ,+BAA+BK;IAE/B;;;;;;;GAOC,GACD,wEAAwE;IAExE,OAAON,4BAA4BM;AACrC,GAAG;AAEHJ,aAAaK,WAAW,GAAG"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*
|
|
7
|
-
* Helper function to render button slots
|
|
8
|
-
*/ const renderButtonSlot = (Button, ButtonTooltip)=>{
|
|
9
|
-
if (!Button) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
if (ButtonTooltip) {
|
|
13
|
-
return /*#__PURE__*/ _jsx(ButtonTooltip, {
|
|
14
|
-
children: /*#__PURE__*/ _jsx(Button, {})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return /*#__PURE__*/ _jsx(Button, {});
|
|
18
|
-
};
|
|
19
3
|
/**
|
|
20
4
|
* Render the final JSX of SplitNavItem
|
|
21
5
|
*/ export const renderSplitNavItem_unstable = (state)=>{
|
|
@@ -23,9 +7,18 @@ import { assertSlots } from '@fluentui/react-utilities';
|
|
|
23
7
|
return /*#__PURE__*/ _jsxs(state.root, {
|
|
24
8
|
children: [
|
|
25
9
|
state.navItem && /*#__PURE__*/ _jsx(state.navItem, {}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
state.actionButton && state.actionButtonTooltip && /*#__PURE__*/ _jsx(state.actionButtonTooltip, {
|
|
11
|
+
children: /*#__PURE__*/ _jsx(state.actionButton, {})
|
|
12
|
+
}),
|
|
13
|
+
state.actionButton && !state.actionButtonTooltip && /*#__PURE__*/ _jsx(state.actionButton, {}),
|
|
14
|
+
state.toggleButton && state.toggleButtonTooltip && /*#__PURE__*/ _jsx(state.toggleButtonTooltip, {
|
|
15
|
+
children: /*#__PURE__*/ _jsx(state.toggleButton, {})
|
|
16
|
+
}),
|
|
17
|
+
state.toggleButton && !state.toggleButtonTooltip && /*#__PURE__*/ _jsx(state.toggleButton, {}),
|
|
18
|
+
state.menuButton && state.menuButtonTooltip && /*#__PURE__*/ _jsx(state.menuButtonTooltip, {
|
|
19
|
+
children: /*#__PURE__*/ _jsx(state.menuButton, {})
|
|
20
|
+
}),
|
|
21
|
+
state.menuButton && !state.menuButtonTooltip && /*#__PURE__*/ _jsx(state.menuButton, {})
|
|
29
22
|
]
|
|
30
23
|
});
|
|
31
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SplitNavItem/renderSplitNavItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport
|
|
1
|
+
{"version":3,"sources":["../src/components/SplitNavItem/renderSplitNavItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SplitNavItemState, SplitNavItemSlots } from './SplitNavItem.types';\n\n/**\n * Render the final JSX of SplitNavItem\n */\nexport const renderSplitNavItem_unstable = (state: SplitNavItemState) => {\n assertSlots<SplitNavItemSlots>(state);\n\n return (\n <state.root>\n {state.navItem && <state.navItem />}\n {state.actionButton && state.actionButtonTooltip && (\n <state.actionButtonTooltip>\n <state.actionButton />\n </state.actionButtonTooltip>\n )}\n {state.actionButton && !state.actionButtonTooltip && <state.actionButton />}\n\n {state.toggleButton && state.toggleButtonTooltip && (\n <state.toggleButtonTooltip>\n <state.toggleButton />\n </state.toggleButtonTooltip>\n )}\n {state.toggleButton && !state.toggleButtonTooltip && <state.toggleButton />}\n\n {state.menuButton && state.menuButtonTooltip && (\n <state.menuButtonTooltip>\n <state.menuButton />\n </state.menuButtonTooltip>\n )}\n {state.menuButton && !state.menuButtonTooltip && <state.menuButton />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderSplitNavItem_unstable","state","root","navItem","actionButton","actionButtonTooltip","toggleButton","toggleButtonTooltip","menuButton","menuButtonTooltip"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1CF,YAA+BE;IAE/B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,OAAO,kBAAI,KAACF,MAAME,OAAO;YAC/BF,MAAMG,YAAY,IAAIH,MAAMI,mBAAmB,kBAC9C,KAACJ,MAAMI,mBAAmB;0BACxB,cAAA,KAACJ,MAAMG,YAAY;;YAGtBH,MAAMG,YAAY,IAAI,CAACH,MAAMI,mBAAmB,kBAAI,KAACJ,MAAMG,YAAY;YAEvEH,MAAMK,YAAY,IAAIL,MAAMM,mBAAmB,kBAC9C,KAACN,MAAMM,mBAAmB;0BACxB,cAAA,KAACN,MAAMK,YAAY;;YAGtBL,MAAMK,YAAY,IAAI,CAACL,MAAMM,mBAAmB,kBAAI,KAACN,MAAMK,YAAY;YAEvEL,MAAMO,UAAU,IAAIP,MAAMQ,iBAAiB,kBAC1C,KAACR,MAAMQ,iBAAiB;0BACtB,cAAA,KAACR,MAAMO,UAAU;;YAGpBP,MAAMO,UAAU,IAAI,CAACP,MAAMQ,iBAAiB,kBAAI,KAACR,MAAMO,UAAU;;;AAGxE,EAAE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
|
-
import { tokens } from '@fluentui/react-theme';
|
|
3
|
-
import { motionTokens } from '@fluentui/react-motion';
|
|
4
2
|
import { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';
|
|
3
|
+
import { tokens } from '@fluentui/react-theme';
|
|
5
4
|
export const splitNavItemClassNames = {
|
|
6
5
|
root: 'fui-SplitNavItem',
|
|
7
6
|
navItem: 'fui-SplitNavItem__navItem',
|
|
@@ -18,17 +17,6 @@ export const splitNavItemClassNames = {
|
|
|
18
17
|
// Don't use makeResetStyles here because the sub components call it once and
|
|
19
18
|
// This links says that makeResetStyles should only be called once per element
|
|
20
19
|
// https://griffel.js.org/react/api/make-reset-styles/#limitations
|
|
21
|
-
const {
|
|
22
|
-
actionButton,
|
|
23
|
-
toggleButton,
|
|
24
|
-
menuButton
|
|
25
|
-
} = splitNavItemClassNames;
|
|
26
|
-
const buttonHoverStyles = {
|
|
27
|
-
[`& .${actionButton}, & .${toggleButton}, & .${menuButton}`]: {
|
|
28
|
-
opacity: 1,
|
|
29
|
-
pointerEvents: 'auto'
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
20
|
/**
|
|
33
21
|
* Styles for the root slot
|
|
34
22
|
*/
|
|
@@ -50,10 +38,6 @@ const useSplitNaveItemStyles = /*#__PURE__*/__styles({
|
|
|
50
38
|
Bkqvd7p: "f1e9ux7i",
|
|
51
39
|
Bmy1vo4: "f1xfaukr",
|
|
52
40
|
Jwef8y: "f11oyicx",
|
|
53
|
-
xwko9w: "f8z0t4e",
|
|
54
|
-
mcc9px: "f9ueil3",
|
|
55
|
-
B02v5zz: "f1g2hb8n",
|
|
56
|
-
i4x37a: "fpq6je",
|
|
57
41
|
ecr2s2: "f9fof1w"
|
|
58
42
|
},
|
|
59
43
|
baseNavItem: {
|
|
@@ -77,20 +61,6 @@ const useSplitNaveItemStyles = /*#__PURE__*/__styles({
|
|
|
77
61
|
},
|
|
78
62
|
baseMedium: {
|
|
79
63
|
rjzwhg: "fjtod8q"
|
|
80
|
-
},
|
|
81
|
-
baseLarge: {
|
|
82
|
-
rjzwhg: "f16gijt3"
|
|
83
|
-
},
|
|
84
|
-
hoverAction: {
|
|
85
|
-
abs64n: "fk73vx1",
|
|
86
|
-
Bkecrkj: "f1aehjj5",
|
|
87
|
-
Bn62ygk: 0,
|
|
88
|
-
Cwk7ip: 0,
|
|
89
|
-
B3o57yi: 0,
|
|
90
|
-
Bmy1vo4: 0,
|
|
91
|
-
Bkqvd7p: 0,
|
|
92
|
-
Bi2q7bf: ["fr12795", "fcl876f"],
|
|
93
|
-
Es3by: "f1gqqdtu"
|
|
94
64
|
}
|
|
95
65
|
}, {
|
|
96
66
|
d: [".f22iagw{display:flex;}", [".fx80lhs{gap:unset;}", {
|
|
@@ -99,13 +69,8 @@ const useSplitNaveItemStyles = /*#__PURE__*/__styles({
|
|
|
99
69
|
p: -1
|
|
100
70
|
}], ".fgusgyc{text-align:unset;}", ".f1ctqxl6{background-color:var(--colorNeutralBackground4);}", ".fnsygzv{transition-duration:var(--durationFaster);}", ".f1e9ux7i{transition-timing-function:var(--curveLinear);}", ".f1xfaukr{transition-property:background;}", ".f1cxpek8{text-transform:none;}", ".f1ub7u0d{align-self:stretch;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f10pi13n{position:relative;}", ".f1s9ku6b{justify-content:start;}", [".f1u2hskj{gap:var(--spacingVerticalL);}", {
|
|
101
71
|
p: -1
|
|
102
|
-
}], ".f3rmtva{background-color:transparent;}", ".f107v6xj{min-width:28px;}", ".f1y335lp{-webkit-padding-end:12px;padding-inline-end:12px;}", ".f12pses1{-webkit-padding-start:5px;padding-inline-start:5px;}", ".fibmr9j{padding-block-start:5px;}", ".f1s2louj{align-items:start;}", ".fjtod8q{padding-block-start:9px;}",
|
|
103
|
-
|
|
104
|
-
}], [".fcl876f{transition:opacity 150ms cubic-bezier(0.33, 0, 0.67, 1);}", {
|
|
105
|
-
p: -1
|
|
106
|
-
}], ".f1gqqdtu{will-change:opacity;}"],
|
|
107
|
-
h: [".f11oyicx:hover{background-color:var(--colorNeutralBackground4Hover);}", ".f8z0t4e:hover .fui-SplitNavItem__actionButton,.f8z0t4e:hover .fui-SplitNavItem__toggleButton,.f8z0t4e:hover .fui-SplitNavItem__menuButton{opacity:1;}", ".f9ueil3:hover .fui-SplitNavItem__actionButton,.f9ueil3:hover .fui-SplitNavItem__toggleButton,.f9ueil3:hover .fui-SplitNavItem__menuButton{pointer-events:auto;}"],
|
|
108
|
-
w: [".f1g2hb8n:focus-within .fui-SplitNavItem__actionButton,.f1g2hb8n:focus-within .fui-SplitNavItem__toggleButton,.f1g2hb8n:focus-within .fui-SplitNavItem__menuButton{opacity:1;}", ".fpq6je:focus-within .fui-SplitNavItem__actionButton,.fpq6je:focus-within .fui-SplitNavItem__toggleButton,.fpq6je:focus-within .fui-SplitNavItem__menuButton{pointer-events:auto;}"],
|
|
72
|
+
}], ".f3rmtva{background-color:transparent;}", ".f107v6xj{min-width:28px;}", ".f1y335lp{-webkit-padding-end:12px;padding-inline-end:12px;}", ".f12pses1{-webkit-padding-start:5px;padding-inline-start:5px;}", ".fibmr9j{padding-block-start:5px;}", ".f1s2louj{align-items:start;}", ".fjtod8q{padding-block-start:9px;}"],
|
|
73
|
+
h: [".f11oyicx:hover{background-color:var(--colorNeutralBackground4Hover);}"],
|
|
109
74
|
a: [".f9fof1w:active{background-color:var(--colorNeutralBackground4Pressed);}"]
|
|
110
75
|
});
|
|
111
76
|
/**
|
|
@@ -121,13 +86,13 @@ export const useSplitNavItemStyles_unstable = state => {
|
|
|
121
86
|
state.navItem.className = mergeClasses(splitNavItemClassNames.navItem, splitNavItemStyles.baseNavItem, state.navItem.className);
|
|
122
87
|
}
|
|
123
88
|
if (state.actionButton) {
|
|
124
|
-
state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary,
|
|
89
|
+
state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.actionButton.className);
|
|
125
90
|
}
|
|
126
91
|
if (state.toggleButton) {
|
|
127
|
-
state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary,
|
|
92
|
+
state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.toggleButton.className);
|
|
128
93
|
}
|
|
129
94
|
if (state.menuButton) {
|
|
130
|
-
state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButton, splitNavItemStyles.baseSecondary,
|
|
95
|
+
state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.menuButton.className);
|
|
131
96
|
}
|
|
132
97
|
return state;
|
|
133
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","navItemTokens","useRootDefaultClassName","tokens","splitNavItemClassNames","root","navItem","actionButton","toggleButton","menuButton","actionButtonTooltip","toggleButtonTooltip","menuButtonTooltip","useSplitNaveItemStyles","baseRoot","mc9l5x","i8kkvl","Belr9w4","rmohyg","Bt984gj","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","fsow6f","De3pzq","B3o57yi","Bkqvd7p","Bmy1vo4","Jwef8y","ecr2s2","baseNavItem","B9bfxx9","qb2dma","qhf8xq","Brf1p80","baseSecondary","Bf4jedk","Bnt446c","B1hrpyx","rjzwhg","baseMedium","d","p","h","a","useSplitNavItemStyles_unstable","state","splitNavItemStyles","sharedRootClassNames","className","density"],"sources":["useSplitNavItemStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';\nimport { tokens } from '@fluentui/react-theme';\nexport const splitNavItemClassNames = {\n root: 'fui-SplitNavItem',\n navItem: 'fui-SplitNavItem__navItem',\n actionButton: 'fui-SplitNavItem__actionButton',\n toggleButton: 'fui-SplitNavItem__toggleButton',\n menuButton: 'fui-SplitNavItem__menuButton',\n /**\n * Tooltips don't have a class name prop, so this is just to satisfy the linter.\n */ actionButtonTooltip: 'fui-SplitNavItem__actionButtonTooltip',\n toggleButtonTooltip: 'fui-SplitNavItem__toggleButtonTooltip',\n menuButtonTooltip: 'fui-SplitNavItem__menuButtonTooltip'\n};\n// Don't use makeResetStyles here because the sub components call it once and\n// This links says that makeResetStyles should only be called once per element\n// https://griffel.js.org/react/api/make-reset-styles/#limitations\n/**\n * Styles for the root slot\n */ const useSplitNaveItemStyles = makeStyles({\n baseRoot: {\n display: 'flex',\n gap: 'unset',\n alignItems: 'stretch',\n padding: 'unset',\n textAlign: 'unset',\n backgroundColor: navItemTokens.backgroundColor,\n ...navItemTokens.transitionTokens,\n ':hover': {\n backgroundColor: navItemTokens.backgroundColorHover\n },\n ':active': {\n backgroundColor: navItemTokens.backgroundColorPressed\n }\n },\n baseNavItem: {\n // styles that we want to disagree with the default on\n display: 'flex',\n textTransform: 'none',\n alignSelf: 'stretch',\n textAlign: 'left',\n position: 'relative',\n justifyContent: 'start',\n gap: tokens.spacingVerticalL,\n backgroundColor: 'transparent'\n },\n baseSecondary: {\n minWidth: '28px',\n paddingInlineEnd: '12px',\n paddingInlineStart: '5px',\n paddingBlockStart: '5px',\n alignItems: 'start'\n },\n baseMedium: {\n paddingBlockStart: '9px'\n }\n});\n/**\n * Apply styling to the SplitNavItem slots based on the state\n */ export const useSplitNavItemStyles_unstable = (state)=>{\n 'use no memo';\n const splitNavItemStyles = useSplitNaveItemStyles();\n const sharedRootClassNames = useRootDefaultClassName();\n state.root.className = mergeClasses(splitNavItemClassNames.root, sharedRootClassNames, splitNavItemStyles.baseRoot, state.root.className);\n if (state.navItem) {\n state.navItem.className = mergeClasses(splitNavItemClassNames.navItem, splitNavItemStyles.baseNavItem, state.navItem.className);\n }\n if (state.actionButton) {\n state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.actionButton.className);\n }\n if (state.toggleButton) {\n state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.toggleButton.className);\n }\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButton, splitNavItemStyles.baseSecondary, state.density === 'medium' && splitNavItemStyles.baseMedium, state.menuButton.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,2BAA2B;AAClF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE,kBAAkB;EACxBC,OAAO,EAAE,2BAA2B;EACpCC,YAAY,EAAE,gCAAgC;EAC9CC,YAAY,EAAE,gCAAgC;EAC9CC,UAAU,EAAE,8BAA8B;EAC1C;AACJ;AACA;EAAMC,mBAAmB,EAAE,uCAAuC;EAC9DC,mBAAmB,EAAE,uCAAuC;EAC5DC,iBAAiB,EAAE;AACvB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AAAI,MAAMC,sBAAsB,gBAAGd,QAAA;EAAAe,QAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,WAAA;IAAAjB,MAAA;IAAAkB,OAAA;IAAAC,MAAA;IAAAT,MAAA;IAAAU,MAAA;IAAAC,OAAA;IAAApB,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAQ,MAAA;EAAA;EAAAW,aAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAtB,OAAA;EAAA;EAAAuB,UAAA;IAAAD,MAAA;EAAA;AAAA;EAAAE,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAqClC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,aAAa;;EACb,MAAMC,kBAAkB,GAAGpC,sBAAsB,CAAC,CAAC;EACnD,MAAMqC,oBAAoB,GAAGhD,uBAAuB,CAAC,CAAC;EACtD8C,KAAK,CAAC3C,IAAI,CAAC8C,SAAS,GAAGnD,YAAY,CAACI,sBAAsB,CAACC,IAAI,EAAE6C,oBAAoB,EAAED,kBAAkB,CAACnC,QAAQ,EAAEkC,KAAK,CAAC3C,IAAI,CAAC8C,SAAS,CAAC;EACzI,IAAIH,KAAK,CAAC1C,OAAO,EAAE;IACf0C,KAAK,CAAC1C,OAAO,CAAC6C,SAAS,GAAGnD,YAAY,CAACI,sBAAsB,CAACE,OAAO,EAAE2C,kBAAkB,CAACjB,WAAW,EAAEgB,KAAK,CAAC1C,OAAO,CAAC6C,SAAS,CAAC;EACnI;EACA,IAAIH,KAAK,CAACzC,YAAY,EAAE;IACpByC,KAAK,CAACzC,YAAY,CAAC4C,SAAS,GAAGnD,YAAY,CAACI,sBAAsB,CAACG,YAAY,EAAE0C,kBAAkB,CAACZ,aAAa,EAAEW,KAAK,CAACI,OAAO,KAAK,QAAQ,IAAIH,kBAAkB,CAACP,UAAU,EAAEM,KAAK,CAACzC,YAAY,CAAC4C,SAAS,CAAC;EACjN;EACA,IAAIH,KAAK,CAACxC,YAAY,EAAE;IACpBwC,KAAK,CAACxC,YAAY,CAAC2C,SAAS,GAAGnD,YAAY,CAACI,sBAAsB,CAACI,YAAY,EAAEyC,kBAAkB,CAACZ,aAAa,EAAEW,KAAK,CAACI,OAAO,KAAK,QAAQ,IAAIH,kBAAkB,CAACP,UAAU,EAAEM,KAAK,CAACxC,YAAY,CAAC2C,SAAS,CAAC;EACjN;EACA,IAAIH,KAAK,CAACvC,UAAU,EAAE;IAClBuC,KAAK,CAACvC,UAAU,CAAC0C,SAAS,GAAGnD,YAAY,CAACI,sBAAsB,CAACK,UAAU,EAAEwC,kBAAkB,CAACZ,aAAa,EAAEW,KAAK,CAACI,OAAO,KAAK,QAAQ,IAAIH,kBAAkB,CAACP,UAAU,EAAEM,KAAK,CAACvC,UAAU,CAAC0C,SAAS,CAAC;EAC3M;EACA,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export function useNavContextValues_unstable(state) {
|
|
3
|
-
const { selectedValue, selectedCategoryValue, onRegister, onUnregister, onSelect, getRegisteredNavItems, onRequestNavCategoryItemToggle, openCategories, multiple, density
|
|
3
|
+
const { selectedValue, selectedCategoryValue, onRegister, onUnregister, onSelect, getRegisteredNavItems, onRequestNavCategoryItemToggle, openCategories, multiple, density } = state;
|
|
4
4
|
const navContext = React.useMemo(()=>({
|
|
5
5
|
selectedValue,
|
|
6
6
|
selectedCategoryValue,
|
|
@@ -11,8 +11,7 @@ export function useNavContextValues_unstable(state) {
|
|
|
11
11
|
onRequestNavCategoryItemToggle,
|
|
12
12
|
openCategories,
|
|
13
13
|
multiple,
|
|
14
|
-
density
|
|
15
|
-
onNavItemSelect
|
|
14
|
+
density
|
|
16
15
|
}), [
|
|
17
16
|
selectedValue,
|
|
18
17
|
selectedCategoryValue,
|
|
@@ -23,8 +22,7 @@ export function useNavContextValues_unstable(state) {
|
|
|
23
22
|
onRequestNavCategoryItemToggle,
|
|
24
23
|
openCategories,
|
|
25
24
|
multiple,
|
|
26
|
-
density
|
|
27
|
-
onNavItemSelect
|
|
25
|
+
density
|
|
28
26
|
]);
|
|
29
27
|
return {
|
|
30
28
|
nav: navContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/useNavContextValues.tsx"],"sourcesContent":["import * as React from 'react';\nimport { NavContextValue, NavContextValues, NavState } from '../Nav';\n\nexport function useNavContextValues_unstable(state: NavState): NavContextValues {\n const {\n selectedValue,\n selectedCategoryValue,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n openCategories,\n multiple,\n density,\n
|
|
1
|
+
{"version":3,"sources":["../src/components/useNavContextValues.tsx"],"sourcesContent":["import * as React from 'react';\nimport { NavContextValue, NavContextValues, NavState } from '../Nav';\n\nexport function useNavContextValues_unstable(state: NavState): NavContextValues {\n const {\n selectedValue,\n selectedCategoryValue,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n openCategories,\n multiple,\n density,\n } = state;\n\n const navContext = React.useMemo<NavContextValue>(\n () => ({\n selectedValue,\n selectedCategoryValue,\n onSelect,\n onRegister,\n onUnregister,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n openCategories,\n multiple,\n density,\n }),\n [\n selectedValue,\n selectedCategoryValue,\n onSelect,\n onRegister,\n onUnregister,\n getRegisteredNavItems,\n onRequestNavCategoryItemToggle,\n openCategories,\n multiple,\n density,\n ],\n );\n\n return { nav: navContext };\n}\n"],"names":["React","useNavContextValues_unstable","state","selectedValue","selectedCategoryValue","onRegister","onUnregister","onSelect","getRegisteredNavItems","onRequestNavCategoryItemToggle","openCategories","multiple","density","navContext","useMemo","nav"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,6BAA6BC,KAAe;IAC1D,MAAM,EACJC,aAAa,EACbC,qBAAqB,EACrBC,UAAU,EACVC,YAAY,EACZC,QAAQ,EACRC,qBAAqB,EACrBC,8BAA8B,EAC9BC,cAAc,EACdC,QAAQ,EACRC,OAAO,EACR,GAAGV;IAEJ,MAAMW,aAAab,MAAMc,OAAO,CAC9B,IAAO,CAAA;YACLX;YACAC;YACAG;YACAF;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACET;QACAC;QACAG;QACAF;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;KACD;IAGH,OAAO;QAAEG,KAAKF;IAAW;AAC3B"}
|
|
@@ -10,14 +10,20 @@ Object.defineProperty(exports, "AppItem", {
|
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
14
13
|
const _useAppItem = require("./useAppItem");
|
|
15
14
|
const _renderAppItem = require("./renderAppItem");
|
|
16
15
|
const _useAppItemStylesstyles = require("./useAppItemStyles.styles");
|
|
17
16
|
const AppItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
17
|
const state = (0, _useAppItem.useAppItem_unstable)(props, ref);
|
|
19
18
|
(0, _useAppItemStylesstyles.useAppItemStyles_unstable)(state);
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md
|
|
21
|
+
*
|
|
22
|
+
* TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),
|
|
23
|
+
* - uncomment this line
|
|
24
|
+
* - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}
|
|
25
|
+
* - verify that custom global style override works for your component
|
|
26
|
+
*/ // useCustomStyleHook_unstable('useAppItemStyles_unstable')(state);
|
|
21
27
|
return (0, _renderAppItem.renderAppItem_unstable)(state);
|
|
22
28
|
});
|
|
23
29
|
AppItem.displayName = 'AppItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItem/AppItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItem/AppItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAppItem_unstable } from './useAppItem';\nimport { renderAppItem_unstable } from './renderAppItem';\nimport { useAppItemStyles_unstable } from './useAppItemStyles.styles';\nimport type { AppItemProps } from './AppItem.types';\n\n/**\n * AppItem component - TODO: add more docs\n */\nexport const AppItem: ForwardRefComponent<AppItemProps> = React.forwardRef((props, ref) => {\n const state = useAppItem_unstable(props, ref);\n\n useAppItemStyles_unstable(state);\n\n /**\n * @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md\n *\n * TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),\n * - uncomment this line\n * - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}\n * - verify that custom global style override works for your component\n */\n // useCustomStyleHook_unstable('useAppItemStyles_unstable')(state);\n\n return renderAppItem_unstable(state);\n});\n\nAppItem.displayName = 'AppItem';\n"],"names":["AppItem","React","forwardRef","props","ref","state","useAppItem_unstable","useAppItemStyles_unstable","renderAppItem_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;4BAEa;+BACG;wCACG;AAMnC,MAAMA,UAAAA,WAAAA,GAA6CC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQC,IAAAA,+BAAAA,EAAoBH,OAAOC;IAEzCG,IAAAA,iDAAAA,EAA0BF;IAE1B;;;;;;;GAOC,GACD,mEAAmE;IAEnE,OAAOG,IAAAA,qCAAAA,EAAuBH;AAChC;AAEAL,QAAQS,WAAW,GAAG"}
|
|
@@ -10,14 +10,20 @@ Object.defineProperty(exports, "AppItemStatic", {
|
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
14
13
|
const _useAppItemStatic = require("./useAppItemStatic");
|
|
15
14
|
const _renderAppItemStatic = require("./renderAppItemStatic");
|
|
16
15
|
const _useAppItemStaticStylesstyles = require("./useAppItemStaticStyles.styles");
|
|
17
16
|
const AppItemStatic = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
17
|
const state = (0, _useAppItemStatic.useAppItemStatic_unstable)(props, ref);
|
|
19
18
|
(0, _useAppItemStaticStylesstyles.useAppItemStaticStyles_unstable)(state);
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md
|
|
21
|
+
*
|
|
22
|
+
* TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),
|
|
23
|
+
* - uncomment this line
|
|
24
|
+
* - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}
|
|
25
|
+
* - verify that custom global style override works for your component
|
|
26
|
+
*/ // useCustomStyleHook_unstable('useAppItemStaticStyles_unstable')(state);
|
|
21
27
|
return (0, _renderAppItemStatic.renderAppItemStatic_unstable)(state);
|
|
22
28
|
});
|
|
23
29
|
AppItemStatic.displayName = 'AppItemStatic';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppItemStatic/AppItemStatic.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/AppItemStatic/AppItemStatic.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAppItemStatic_unstable } from './useAppItemStatic';\nimport { renderAppItemStatic_unstable } from './renderAppItemStatic';\nimport { useAppItemStaticStyles_unstable } from './useAppItemStaticStyles.styles';\nimport type { AppItemStaticProps } from './AppItemStatic.types';\n\n/**\n * AppItemStatic component - TODO: add more docs\n */\nexport const AppItemStatic: ForwardRefComponent<AppItemStaticProps> = React.forwardRef((props, ref) => {\n const state = useAppItemStatic_unstable(props, ref);\n\n useAppItemStaticStyles_unstable(state);\n\n /**\n * @see https://github.com/microsoft/fluentui/blob/master/docs/react-v9/contributing/rfcs/react-components/convergence/custom-styling.md\n *\n * TODO: 💡 once package will become stable (PR which will be part of promoting PREVIEW package to STABLE),\n * - uncomment this line\n * - update types {@link file://./../../../../../../../packages/react-components/react-shared-contexts/library/src/CustomStyleHooksContext/CustomStyleHooksContext.ts#CustomStyleHooksContextValue}\n * - verify that custom global style override works for your component\n */\n // useCustomStyleHook_unstable('useAppItemStaticStyles_unstable')(state);\n\n return renderAppItemStatic_unstable(state);\n});\n\nAppItemStatic.displayName = 'AppItemStatic';\n"],"names":["AppItemStatic","React","forwardRef","props","ref","state","useAppItemStatic_unstable","useAppItemStaticStyles_unstable","renderAppItemStatic_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;kCAEmB;qCACG;8CACG;AAMzC,MAAMA,gBAAAA,WAAAA,GAAyDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQC,IAAAA,2CAAAA,EAA0BH,OAAOC;IAE/CG,IAAAA,6DAAAA,EAAgCF;IAEhC;;;;;;;GAOC,GACD,yEAAyE;IAEzE,OAAOG,IAAAA,iDAAAA,EAA6BH;AACtC;AAEAL,cAAcS,WAAW,GAAG"}
|
|
@@ -10,14 +10,15 @@ Object.defineProperty(exports, "Hamburger", {
|
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactbutton = require("@fluentui/react-button");
|
|
14
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
13
|
const _useHamburger = require("./useHamburger");
|
|
14
|
+
const _reactbutton = require("@fluentui/react-button");
|
|
16
15
|
const _useHamburgerStylesstyles = require("./useHamburgerStyles.styles");
|
|
17
16
|
const Hamburger = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
17
|
const state = (0, _useHamburger.useHamburger_unstable)(props, ref);
|
|
19
18
|
(0, _useHamburgerStylesstyles.useHamburgerStyles_unstable)(state);
|
|
20
|
-
|
|
19
|
+
// TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts
|
|
20
|
+
// https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md
|
|
21
|
+
// useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);
|
|
21
22
|
return (0, _reactbutton.renderButton_unstable)(state);
|
|
22
23
|
});
|
|
23
24
|
Hamburger.displayName = 'Hamburger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Hamburger/Hamburger.tsx"],"sourcesContent":["import * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"sources":["../src/components/Hamburger/Hamburger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useHamburger_unstable } from './useHamburger';\nimport { renderButton_unstable } from '@fluentui/react-button';\nimport { useHamburgerStyles_unstable } from './useHamburgerStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { HamburgerProps } from './Hamburger.types';\n\n/**\n * Hamburger component - TODO: add more docs\n */\nexport const Hamburger: ForwardRefComponent<HamburgerProps> = React.forwardRef((props, ref) => {\n const state = useHamburger_unstable(props, ref);\n\n useHamburgerStyles_unstable(state);\n // TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts\n // https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md\n // useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);\n return renderButton_unstable(state);\n}) as ForwardRefComponent<HamburgerProps>;\n\nHamburger.displayName = 'Hamburger';\n"],"names":["Hamburger","React","forwardRef","props","ref","state","useHamburger_unstable","useHamburgerStyles_unstable","renderButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;8BACe;6BACA;0CACM;AAOrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,8HAA8H;IAC9H,wGAAwG;IACxG,qEAAqE;IACrE,OAAOG,IAAAA,kCAAAA,EAAsBH;AAC/B;AAEAL,UAAUS,WAAW,GAAG"}
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "Nav", {
|
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
14
13
|
const _useNav = require("./useNav");
|
|
15
14
|
const _renderNav = require("./renderNav");
|
|
16
15
|
const _useNavStylesstyles = require("./useNavStyles.styles");
|
|
@@ -19,7 +18,6 @@ const Nav = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
19
18
|
const state = (0, _useNav.useNav_unstable)(props, ref);
|
|
20
19
|
const contextValues = (0, _useNavContextValues.useNavContextValues_unstable)(state);
|
|
21
20
|
(0, _useNavStylesstyles.useNavStyles_unstable)(state);
|
|
22
|
-
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useHamburgerStyles_unstable')(state);
|
|
23
21
|
return (0, _renderNav.renderNav_unstable)(state, contextValues);
|
|
24
22
|
});
|
|
25
23
|
Nav.displayName = 'Nav';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Nav/Nav.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/Nav/Nav.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useNav_unstable } from './useNav';\nimport { renderNav_unstable } from './renderNav';\nimport { useNavStyles_unstable } from './useNavStyles.styles';\nimport { useNavContextValues_unstable } from '../useNavContextValues';\nimport type { NavProps } from './Nav.types';\n\n/**\n * Nav - A component that provides up to two levels of nesting for navigation.\n */\nexport const Nav: ForwardRefComponent<NavProps> = React.forwardRef((props, ref) => {\n const state = useNav_unstable(props, ref);\n\n const contextValues = useNavContextValues_unstable(state);\n\n useNavStyles_unstable(state);\n return renderNav_unstable(state, contextValues);\n});\n\nNav.displayName = 'Nav';\n"],"names":["Nav","React","forwardRef","props","ref","state","useNav_unstable","contextValues","useNavContextValues_unstable","useNavStyles_unstable","renderNav_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;wBAES;2BACG;oCACG;qCACO;AAMtC,MAAMA,MAAAA,WAAAA,GAAqCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzE,MAAMC,QAAQC,IAAAA,uBAAAA,EAAgBH,OAAOC;IAErC,MAAMG,gBAAgBC,IAAAA,iDAAAA,EAA6BH;IAEnDI,IAAAA,yCAAAA,EAAsBJ;IACtB,OAAOK,IAAAA,6BAAAA,EAAmBL,OAAOE;AACnC;AAEAP,IAAIW,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategory/NavCategory.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { NavCategoryProps } from './NavCategory.types';\n\nimport { useNavCategory_unstable } from './useNavCategory';\nimport { renderNavCategory_unstable } from './renderNavCategory';\nimport { useNavCategoryContextValues_unstable } from '../useNavCategoryContextValues_unstable';\n\n/**\n * NavCategory component -
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategory/NavCategory.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { NavCategoryProps } from './NavCategory.types';\n\nimport { useNavCategory_unstable } from './useNavCategory';\nimport { renderNavCategory_unstable } from './renderNavCategory';\nimport { useNavCategoryContextValues_unstable } from '../useNavCategoryContextValues_unstable';\n\n/**\n * NavCategory component - TODO: add more docs\n */\nexport const NavCategory: ForwardRefComponent<NavCategoryProps> = React.forwardRef((props, ref) => {\n const state = useNavCategory_unstable(props, ref);\n const contextValues = useNavCategoryContextValues_unstable(state);\n\n return renderNavCategory_unstable(state, contextValues);\n});\n\nNavCategory.displayName = 'NavCategory';\n"],"names":["NavCategory","React","forwardRef","props","ref","state","useNavCategory_unstable","contextValues","useNavCategoryContextValues_unstable","renderNavCategory_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;gCAKiB;mCACG;sDACU;AAK9C,MAAMA,cAAAA,WAAAA,GAAqDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBH,OAAOC;IAC7C,MAAMG,gBAAgBC,IAAAA,0EAAAA,EAAqCH;IAE3D,OAAOI,IAAAA,6CAAAA,EAA2BJ,OAAOE;AAC3C;AAEAP,YAAYU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport { NavCategoryContextValues, NavCategoryProvider } from '../NavCategoryContext';\n\nimport type { NavCategoryState } from './NavCategory.types';\n\n/**\n * Render the final JSX of NavCategory\n */\nexport const renderNavCategory_unstable = (
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport { NavCategoryContextValues, NavCategoryProvider } from '../NavCategoryContext';\n\nimport type { NavCategoryState } from './NavCategory.types';\n\n/**\n * Render the final JSX of NavCategory\n */\nexport const renderNavCategory_unstable = (state: NavCategoryState, contextValues: NavCategoryContextValues) => {\n return <NavCategoryProvider value={contextValues.categoryValue}>{state.children}</NavCategoryProvider>;\n};\n"],"names":["renderNavCategory_unstable","state","contextValues","React","createElement","NavCategoryProvider","value","categoryValue","children"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;oCACuC;AAOvD,MAAMA,6BAA6B,CAACC,OAAyBC;IAClE,OAAA,WAAA,GAAOC,OAAAC,aAAA,CAACC,uCAAAA,EAAAA;QAAoBC,OAAOJ,cAAcK,aAAa;OAAGN,MAAMO,QAAQ;AACjF"}
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "NavCategoryItem", {
|
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
14
13
|
const _useNavCategoryItem = require("./useNavCategoryItem");
|
|
15
14
|
const _renderNavCategoryItem = require("./renderNavCategoryItem");
|
|
16
15
|
const _useNavCategoryItemstyles = require("./useNavCategoryItem.styles");
|
|
@@ -19,7 +18,8 @@ const NavCategoryItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
19
18
|
const state = (0, _useNavCategoryItem.useNavCategoryItem_unstable)(props, ref);
|
|
20
19
|
const contextValues = (0, _useNavCategoryItemContextValues_unstable.useNavCategoryItemContextValues_unstable)(state);
|
|
21
20
|
(0, _useNavCategoryItemstyles.useNavCategoryItemStyles_unstable)(state);
|
|
22
|
-
|
|
21
|
+
// todo: add custom style hook
|
|
22
|
+
// useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);
|
|
23
23
|
return (0, _renderNavCategoryItem.renderNavCategoryItem_unstable)(state, contextValues);
|
|
24
24
|
});
|
|
25
25
|
NavCategoryItem.displayName = 'NavCategoryItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useNavCategoryItem_unstable } from './useNavCategoryItem';\nimport { renderNavCategoryItem_unstable } from './renderNavCategoryItem';\nimport type { NavCategoryItemProps } from './NavCategoryItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useNavCategoryItemStyles_unstable } from './useNavCategoryItem.styles';\nimport { useNavCategoryItemContextValues_unstable } from '../useNavCategoryItemContextValues_unstable';\n// import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A Nav Category Item provides provides a clickable accordion like header that exposes\n * a list of NavSubItems to take users to a new destination.\n */\nexport const NavCategoryItem: ForwardRefComponent<NavCategoryItemProps> = React.forwardRef((props, ref) => {\n const state = useNavCategoryItem_unstable(props, ref);\n const contextValues = useNavCategoryItemContextValues_unstable(state);\n\n useNavCategoryItemStyles_unstable(state);\n\n // todo: add custom style hook\n // useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);\n\n return renderNavCategoryItem_unstable(state, contextValues);\n});\n\nNavCategoryItem.displayName = 'NavCategoryItem';\n"],"names":["NavCategoryItem","React","forwardRef","props","ref","state","useNavCategoryItem_unstable","contextValues","useNavCategoryItemContextValues_unstable","useNavCategoryItemStyles_unstable","renderNavCategoryItem_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;oCACqB;uCACG;0CAGG;0DACO;AAOlD,MAAMA,kBAAAA,WAAAA,GAA6DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQC,IAAAA,+CAAAA,EAA4BH,OAAOC;IACjD,MAAMG,gBAAgBC,IAAAA,kFAAAA,EAAyCH;IAE/DI,IAAAA,2DAAAA,EAAkCJ;IAElC,8BAA8B;IAC9B,kEAAkE;IAElE,OAAOK,IAAAA,qDAAAA,EAA+BL,OAAOE;AAC/C;AAEAP,gBAAgBW,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.types.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.types.ts"],"sourcesContent":["import { NavDensity } from '../Nav/Nav.types';\nimport { NavCategoryItemContextValue } from '../NavCategoryItemContext';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type NavCategoryItemContextValues = {\n navCategoryItem: NavCategoryItemContextValue;\n};\n\nexport type NavCategoryItemSlots = {\n /**\n * The root element\n */\n root: NonNullable<Slot<'button'>>;\n\n /**\n * Icon that renders before the content.\n * Should be specific to each Category\n */\n icon?: Slot<'span'>;\n\n /**\n * Expand icon slot rendered after the content to indicate an open and closed state.\n */\n expandIcon: NonNullable<Slot<'span'>>;\n};\n\n/**\n * navCategoryItem Props\n */\nexport type NavCategoryItemProps = ComponentProps<Partial<NavCategoryItemSlots>>;\n\n/**\n * State used in rendering NavCategoryItem\n */\nexport type NavCategoryItemState = ComponentState<NavCategoryItemSlots> &\n NavCategoryItemContextValue & {\n /**\n * If this navCategoryItem is selected\n */\n selected: boolean;\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AA+BA;;CAEC"}
|
|
@@ -11,18 +11,6 @@ Object.defineProperty(exports, "renderNavCategoryItem_unstable", {
|
|
|
11
11
|
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
12
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
13
|
const _NavCategoryItemContext = require("../NavCategoryItemContext");
|
|
14
|
-
const getExpandIcon = (state)=>{
|
|
15
|
-
(0, _reactutilities.assertSlots)(state);
|
|
16
|
-
if (!state.expandIcon) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
if (!state.expandIconMotion) {
|
|
20
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIcon, {});
|
|
21
|
-
}
|
|
22
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIconMotion, {
|
|
23
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIcon, {})
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
14
|
const renderNavCategoryItem_unstable = (state, contextValues)=>{
|
|
27
15
|
(0, _reactutilities.assertSlots)(state);
|
|
28
16
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_NavCategoryItemContext.NavCategoryItemProvider, {
|
|
@@ -31,7 +19,7 @@ const renderNavCategoryItem_unstable = (state, contextValues)=>{
|
|
|
31
19
|
children: [
|
|
32
20
|
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
|
|
33
21
|
state.root.children,
|
|
34
|
-
|
|
22
|
+
state.expandIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.expandIcon, {})
|
|
35
23
|
]
|
|
36
24
|
})
|
|
37
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/NavCategoryItem/renderNavCategoryItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { NavCategoryItemState, NavCategoryItemSlots, NavCategoryItemContextValues } from './NavCategoryItem.types';\nimport { NavCategoryItemProvider } from '../NavCategoryItemContext';\n\
|
|
1
|
+
{"version":3,"sources":["../src/components/NavCategoryItem/renderNavCategoryItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { NavCategoryItemState, NavCategoryItemSlots, NavCategoryItemContextValues } from './NavCategoryItem.types';\nimport { NavCategoryItemProvider } from '../NavCategoryItemContext';\n\n/**\n * Render the final JSX of NavCategoryItem\n */\nexport const renderNavCategoryItem_unstable = (\n state: NavCategoryItemState,\n contextValues: NavCategoryItemContextValues,\n) => {\n assertSlots<NavCategoryItemSlots>(state);\n\n return (\n <NavCategoryItemProvider value={contextValues.navCategoryItem}>\n <state.root>\n {state.icon && <state.icon />}\n {state.root.children}\n {state.expandIcon && <state.expandIcon />}\n </state.root>\n </NavCategoryItemProvider>\n );\n};\n"],"names":["renderNavCategoryItem_unstable","state","contextValues","assertSlots","_jsx","NavCategoryItemProvider","value","navCategoryItem","_jsxs","root","icon","children","expandIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAE4B;wCAEY;AAKjC,MAAMA,iCAAiC,CAC5CC,OACAC;IAEAC,IAAAA,2BAAAA,EAAkCF;IAElC,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,+CAAAA,EAAAA;QAAwBC,OAAOJ,cAAcK,eAAe;kBAC3D,WAAA,GAAAC,IAAAA,gBAAA,EAACP,MAAMQ,IAAI,EAAA;;gBACRR,MAAMS,IAAI,IAAA,WAAA,GAAIN,IAAAA,eAAA,EAACH,MAAMS,IAAI,EAAA,CAAA;gBACzBT,MAAMQ,IAAI,CAACE,QAAQ;gBACnBV,MAAMW,UAAU,IAAA,WAAA,GAAIR,IAAAA,eAAA,EAACH,MAAMW,UAAU,EAAA,CAAA;;;;AAI9C"}
|
|
@@ -12,35 +12,8 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
14
|
const _reacticons = require("@fluentui/react-icons");
|
|
15
|
-
const _reactmotion = require("@fluentui/react-motion");
|
|
16
15
|
const _NavCategoryContext = require("../NavCategoryContext");
|
|
17
16
|
const _NavContext = require("../NavContext");
|
|
18
|
-
const ExpandIconMotion = (0, _reactmotion.createPresenceComponent)(()=>{
|
|
19
|
-
const keyframes = [
|
|
20
|
-
{
|
|
21
|
-
transform: 'rotate(0deg) translate3D(0, 0, 0)'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
transform: 'rotate(180deg) translate3D(0, 0, 0)'
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
const duration = _reactmotion.motionTokens.durationFast;
|
|
28
|
-
const easing = _reactmotion.motionTokens.curveEasyEase;
|
|
29
|
-
return {
|
|
30
|
-
enter: {
|
|
31
|
-
keyframes,
|
|
32
|
-
duration,
|
|
33
|
-
easing
|
|
34
|
-
},
|
|
35
|
-
exit: {
|
|
36
|
-
keyframes: [
|
|
37
|
-
...keyframes
|
|
38
|
-
].reverse(),
|
|
39
|
-
duration,
|
|
40
|
-
easing
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
17
|
const useNavCategoryItem_unstable = (props, ref)=>{
|
|
45
18
|
const { onClick, expandIcon, icon } = props;
|
|
46
19
|
const { open, value } = (0, _NavCategoryContext.useNavCategoryContext_unstable)();
|
|
@@ -62,8 +35,7 @@ const useNavCategoryItem_unstable = (props, ref)=>{
|
|
|
62
35
|
components: {
|
|
63
36
|
root: 'button',
|
|
64
37
|
icon: 'span',
|
|
65
|
-
expandIcon: 'span'
|
|
66
|
-
expandIconMotion: ExpandIconMotion
|
|
38
|
+
expandIcon: 'span'
|
|
67
39
|
},
|
|
68
40
|
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('button', {
|
|
69
41
|
ref,
|
|
@@ -76,17 +48,11 @@ const useNavCategoryItem_unstable = (props, ref)=>{
|
|
|
76
48
|
}),
|
|
77
49
|
expandIcon: _reactutilities.slot.always(expandIcon, {
|
|
78
50
|
defaultProps: {
|
|
79
|
-
children: /*#__PURE__*/ _react.createElement(_reacticons.
|
|
51
|
+
children: /*#__PURE__*/ _react.createElement(_reacticons.ChevronRight20Regular, null),
|
|
80
52
|
'aria-hidden': true
|
|
81
53
|
},
|
|
82
54
|
elementType: 'span'
|
|
83
55
|
}),
|
|
84
|
-
expandIconMotion: (0, _reactmotion.presenceMotionSlot)(props.expandIconMotion, {
|
|
85
|
-
elementType: ExpandIconMotion,
|
|
86
|
-
defaultProps: {
|
|
87
|
-
visible: open
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
56
|
icon: _reactutilities.slot.optional(icon, {
|
|
91
57
|
elementType: 'span'
|
|
92
58
|
}),
|