Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useAppItem_unstable } from './useAppItem';
import { renderAppItem_unstable } from './renderAppItem';
import { useAppItemStyles_unstable } from './useAppItemStyles.styles';
/**
* AppItem component - Application item in the navigation menu.
*/ export const AppItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useAppItem_unstable(props, ref);
useAppItemStyles_unstable(state);
useCustomStyleHook_unstable('useAppItemStyles_unstable')(state);
return renderAppItem_unstable(state);
});
AppItem.displayName = 'AppItem';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItem/AppItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\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 - Application item in the navigation menu.\n */\nexport const AppItem: ForwardRefComponent<AppItemProps> = React.forwardRef((props, ref) => {\n const state = useAppItem_unstable(props, ref);\n\n useAppItemStyles_unstable(state);\n useCustomStyleHook_unstable('useAppItemStyles_unstable')(state);\n\n return renderAppItem_unstable(state);\n});\n\nAppItem.displayName = 'AppItem';\n"],"names":["React","useCustomStyleHook_unstable","useAppItem_unstable","renderAppItem_unstable","useAppItemStyles_unstable","AppItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,4BAA4B;AAGtE;;CAEC,GACD,OAAO,MAAMC,wBAA6CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQP,oBAAoBK,OAAOC;IAEzCJ,0BAA0BK;IAC1BR,4BAA4B,6BAA6BQ;IAEzD,OAAON,uBAAuBM;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering AppItem
*/ export { };

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,4 @@
export { AppItem } from './AppItem';
export { renderAppItem_unstable } from './renderAppItem';
export { useAppItem_unstable } from './useAppItem';
export { appItemClassNames, useAppItemStyles, useAppItemStyles_unstable } from './useAppItemStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItem/index.ts"],"sourcesContent":["export { AppItem } from './AppItem';\nexport type { AppItemProps, AppItemSlots, AppItemState } from './AppItem.types';\nexport { renderAppItem_unstable } from './renderAppItem';\nexport { useAppItem_unstable } from './useAppItem';\nexport { appItemClassNames, useAppItemStyles, useAppItemStyles_unstable } from './useAppItemStyles.styles';\n"],"names":["AppItem","renderAppItem_unstable","useAppItem_unstable","appItemClassNames","useAppItemStyles","useAppItemStyles_unstable"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AAEpC,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,yBAAyB,QAAQ,4BAA4B"}

View File

@@ -0,0 +1,13 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of AppItem
*/ export const renderAppItem_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
state.root.children
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItem/renderAppItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { AppItemState, AppItemSlots } from './AppItem.types';\n\n/**\n * Render the final JSX of AppItem\n */\nexport const renderAppItem_unstable = (state: AppItemState): JSXElement => {\n assertSlots<AppItemSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.root.children}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAppItem_unstable","state","root","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrCF,YAA0BE;IAE1B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,IAAI,kBAAI,KAACF,MAAME,IAAI;YACzBF,MAAMC,IAAI,CAACE,QAAQ;;;AAG1B,EAAE"}

View File

@@ -0,0 +1,38 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { useARIAButtonProps } from '@fluentui/react-aria';
import { useNavContext_unstable } from '../NavContext';
/**
* Create the state required to render AppItem.
*
* The returned state can be modified with hooks such as useAppItemStyles_unstable,
* before being passed to renderAppItem_unstable.
*
* @param props - props from this instance of AppItem
* @param ref - reference to root HTMLDivElement of AppItem
*/ export const useAppItem_unstable = (props, ref)=>{
const { icon, as, href } = props;
const rootElementType = as || (href ? 'a' : 'button');
const { density = 'medium' } = useNavContext_unstable();
const root = slot.always(getIntrinsicElementProps(rootElementType, useARIAButtonProps(rootElementType, {
...props
})), {
elementType: rootElementType,
defaultProps: {
ref: ref,
type: rootElementType
}
});
return {
components: {
root: rootElementType,
icon: 'span'
},
root,
icon: slot.optional(icon, {
elementType: 'span'
}),
density
};
};

View File

@@ -0,0 +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, 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":["React","getIntrinsicElementProps","slot","useARIAButtonProps","useNavContext_unstable","useAppItem_unstable","props","ref","icon","as","href","rootElementType","density","root","always","elementType","defaultProps","type","components","optional"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAA8BC,kBAAkB,QAAQ,uBAAuB;AAC/E,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"}

View File

@@ -0,0 +1,81 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
import { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const appItemClassNames = {
root: 'fui-AppItem',
icon: 'fui-AppItem__icon'
};
/**
* Styles for the root slot
*/
export const useAppItemStyles = /*#__PURE__*/__styles({
root: {
Bokbzmb: "f1x6gvzo",
Jyy4pa: "f1djyvue",
B1u1w3b: "feysv1g",
a9b677: "f1jd6clc",
Bt984gj: "f122n59",
i8kkvl: 0,
Belr9w4: 0,
rmohyg: "f1ga9sj3",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: ["f1fdqhks", "fnlwq4f"],
Bahqtrf: "fk6fouc",
Be2twd7: "fod5ikn",
Bhrd7zp: "fl43uef",
Bg96gwp: "faaz57k"
},
small: {
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: ["f1m1l4b8", "f1yxbtnt"],
i8kkvl: 0,
Belr9w4: 0,
rmohyg: "f1let0xu"
},
absentIconRootAdjustment: {
B1hrpyx: "ft8721j"
}
}, {
d: [[".feysv1g{margin-inline:4px;}", {
p: -1
}], ".f1jd6clc{width:revert;}", ".f122n59{align-items:center;}", [".f1ga9sj3{gap:10px;}", {
p: -1
}], ".f1djyvue{-webkit-margin-start:-6px;margin-inline-start:-6px;}", ".f1x6gvzo{-webkit-margin-end:0px;margin-inline-end:0px;}", [".f1fdqhks{padding:var(--spacingVerticalS) var(--spacingHorizontalS) var(--spacingVerticalS) var(--spacingHorizontalMNudge);}", {
p: -1
}], [".fnlwq4f{padding:var(--spacingVerticalS) var(--spacingHorizontalMNudge) var(--spacingVerticalS) var(--spacingHorizontalS);}", {
p: -1
}], ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".faaz57k{line-height:var(--lineHeightBase400);}", [".f1m1l4b8{padding:var(--spacingVerticalS) var(--spacingHorizontalS) var(--spacingVerticalS) 14px;}", {
p: -1
}], [".f1yxbtnt{padding:var(--spacingVerticalS) 14px var(--spacingVerticalS) var(--spacingHorizontalS);}", {
p: -1
}], [".f1let0xu{gap:14px;}", {
p: -1
}], ".ft8721j{-webkit-padding-start:16px;padding-inline-start:16px;}"]
});
/**
* Apply styling to the AppItem slots based on the state
*/
export const useAppItemStyles_unstable = state => {
'use no memo';
const rootDefaultClassName = useRootDefaultClassName();
const iconStyles = useIconStyles();
const appItemSpecificStyles = useAppItemStyles();
const {
density,
icon
} = state;
state.root.className = mergeClasses(rootDefaultClassName, appItemClassNames.root, appItemSpecificStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(appItemClassNames.icon, iconStyles.base, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","useIconStyles","useRootDefaultClassName","appItemClassNames","root","icon","useAppItemStyles","Bokbzmb","Jyy4pa","B1u1w3b","a9b677","Bt984gj","i8kkvl","Belr9w4","rmohyg","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","small","absentIconRootAdjustment","B1hrpyx","d","p","useAppItemStyles_unstable","state","rootDefaultClassName","iconStyles","appItemSpecificStyles","density","className","base"],"sources":["useAppItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';\nexport const appItemClassNames = {\n root: 'fui-AppItem',\n icon: 'fui-AppItem__icon'\n};\n/**\n * Styles for the root slot\n */ export const useAppItemStyles = makeStyles({\n root: {\n marginInline: '4px',\n width: 'revert',\n alignItems: 'center',\n gap: '10px',\n marginInlineStart: '-6px',\n marginInlineEnd: '0px',\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} ${tokens.spacingHorizontalMNudge}`,\n ...typographyStyles.subtitle2\n },\n small: {\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} 14px`,\n gap: '14px'\n },\n absentIconRootAdjustment: {\n paddingInlineStart: '16px'\n }\n});\n/**\n * Apply styling to the AppItem slots based on the state\n */ export const useAppItemStyles_unstable = (state)=>{\n 'use no memo';\n const rootDefaultClassName = useRootDefaultClassName();\n const iconStyles = useIconStyles();\n const appItemSpecificStyles = useAppItemStyles();\n const { density, icon } = state;\n state.root.className = mergeClasses(rootDefaultClassName, appItemClassNames.root, appItemSpecificStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(appItemClassNames.icon, iconStyles.base, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,2BAA2B;AAClF,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE,aAAa;EACnBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,gBAAgB,gBAAGT,QAAA;EAAAO,IAAA;IAAAG,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAT,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAP,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAW,wBAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAkBnC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,yBAAyB,GAAIC,KAAK,IAAG;EAClD,aAAa;;EACb,MAAMC,oBAAoB,GAAG7B,uBAAuB,CAAC,CAAC;EACtD,MAAM8B,UAAU,GAAG/B,aAAa,CAAC,CAAC;EAClC,MAAMgC,qBAAqB,GAAG3B,gBAAgB,CAAC,CAAC;EAChD,MAAM;IAAE4B,OAAO;IAAE7B;EAAK,CAAC,GAAGyB,KAAK;EAC/BA,KAAK,CAAC1B,IAAI,CAAC+B,SAAS,GAAGrC,YAAY,CAACiC,oBAAoB,EAAE5B,iBAAiB,CAACC,IAAI,EAAE6B,qBAAqB,CAAC7B,IAAI,EAAE8B,OAAO,KAAK,OAAO,IAAID,qBAAqB,CAACT,KAAK,EAAE,CAACnB,IAAI,IAAI4B,qBAAqB,CAACR,wBAAwB,EAAEK,KAAK,CAAC1B,IAAI,CAAC+B,SAAS,CAAC;EAChP,IAAIL,KAAK,CAACzB,IAAI,EAAE;IACZyB,KAAK,CAACzB,IAAI,CAAC8B,SAAS,GAAGrC,YAAY,CAACK,iBAAiB,CAACE,IAAI,EAAE2B,UAAU,CAACI,IAAI,EAAEN,KAAK,CAACzB,IAAI,CAAC8B,SAAS,CAAC;EACtG;EACA,OAAOL,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,43 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
import { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const appItemClassNames = {
root: 'fui-AppItem',
icon: 'fui-AppItem__icon'
};
/**
* Styles for the root slot
*/ export const useAppItemStyles = makeStyles({
root: {
marginInline: '4px',
width: 'revert',
alignItems: 'center',
gap: '10px',
marginInlineStart: '-6px',
marginInlineEnd: '0px',
padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} ${tokens.spacingHorizontalMNudge}`,
...typographyStyles.subtitle2
},
small: {
padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} 14px`,
gap: '14px'
},
absentIconRootAdjustment: {
paddingInlineStart: '16px'
}
});
/**
* Apply styling to the AppItem slots based on the state
*/ export const useAppItemStyles_unstable = (state)=>{
'use no memo';
const rootDefaultClassName = useRootDefaultClassName();
const iconStyles = useIconStyles();
const appItemSpecificStyles = useAppItemStyles();
const { density, icon } = state;
state.root.className = mergeClasses(rootDefaultClassName, appItemClassNames.root, appItemSpecificStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(appItemClassNames.icon, iconStyles.base, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItem/useAppItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { AppItemSlots, AppItemState } from './AppItem.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';\n\nexport const appItemClassNames: SlotClassNames<AppItemSlots> = {\n root: 'fui-AppItem',\n icon: 'fui-AppItem__icon',\n};\n\n/**\n * Styles for the root slot\n */\nexport const useAppItemStyles = makeStyles({\n root: {\n marginInline: '4px',\n width: 'revert',\n alignItems: 'center',\n gap: '10px',\n marginInlineStart: '-6px',\n marginInlineEnd: '0px',\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} ${tokens.spacingHorizontalMNudge}`,\n ...typographyStyles.subtitle2,\n },\n small: {\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalS} 14px`,\n gap: '14px',\n },\n absentIconRootAdjustment: {\n paddingInlineStart: '16px',\n },\n});\n\n/**\n * Apply styling to the AppItem slots based on the state\n */\nexport const useAppItemStyles_unstable = (state: AppItemState): AppItemState => {\n 'use no memo';\n\n const rootDefaultClassName = useRootDefaultClassName();\n const iconStyles = useIconStyles();\n const appItemSpecificStyles = useAppItemStyles();\n\n const { density, icon } = state;\n\n state.root.className = mergeClasses(\n rootDefaultClassName,\n appItemClassNames.root,\n appItemSpecificStyles.root,\n density === 'small' && appItemSpecificStyles.small,\n !icon && appItemSpecificStyles.absentIconRootAdjustment,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(appItemClassNames.icon, iconStyles.base, state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","useIconStyles","useRootDefaultClassName","appItemClassNames","root","icon","useAppItemStyles","marginInline","width","alignItems","gap","marginInlineStart","marginInlineEnd","padding","spacingVerticalS","spacingHorizontalS","spacingHorizontalMNudge","subtitle2","small","absentIconRootAdjustment","paddingInlineStart","useAppItemStyles_unstable","state","rootDefaultClassName","iconStyles","appItemSpecificStyles","density","className","base"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,4BAA4B;AAEnF,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,mBAAmBT,WAAW;IACzCO,MAAM;QACJG,cAAc;QACdC,OAAO;QACPC,YAAY;QACZC,KAAK;QACLC,mBAAmB;QACnBC,iBAAiB;QACjBC,SAAS,GAAGd,OAAOe,gBAAgB,CAAC,CAAC,EAAEf,OAAOgB,kBAAkB,CAAC,CAAC,EAAEhB,OAAOe,gBAAgB,CAAC,CAAC,EAAEf,OAAOiB,uBAAuB,EAAE;QAC/H,GAAGhB,iBAAiBiB,SAAS;IAC/B;IACAC,OAAO;QACLL,SAAS,GAAGd,OAAOe,gBAAgB,CAAC,CAAC,EAAEf,OAAOgB,kBAAkB,CAAC,CAAC,EAAEhB,OAAOe,gBAAgB,CAAC,KAAK,CAAC;QAClGJ,KAAK;IACP;IACAS,0BAA0B;QACxBC,oBAAoB;IACtB;AACF,GAAG;AAEH;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxC;IAEA,MAAMC,uBAAuBrB;IAC7B,MAAMsB,aAAavB;IACnB,MAAMwB,wBAAwBnB;IAE9B,MAAM,EAAEoB,OAAO,EAAErB,IAAI,EAAE,GAAGiB;IAE1BA,MAAMlB,IAAI,CAACuB,SAAS,GAAG7B,aACrByB,sBACApB,kBAAkBC,IAAI,EACtBqB,sBAAsBrB,IAAI,EAC1BsB,YAAY,WAAWD,sBAAsBP,KAAK,EAClD,CAACb,QAAQoB,sBAAsBN,wBAAwB,EACvDG,MAAMlB,IAAI,CAACuB,SAAS;IAGtB,IAAIL,MAAMjB,IAAI,EAAE;QACdiB,MAAMjB,IAAI,CAACsB,SAAS,GAAG7B,aAAaK,kBAAkBE,IAAI,EAAEmB,WAAWI,IAAI,EAAEN,MAAMjB,IAAI,CAACsB,SAAS;IACnG;IAEA,OAAOL;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useAppItemStatic_unstable } from './useAppItemStatic';
import { renderAppItemStatic_unstable } from './renderAppItemStatic';
import { useAppItemStaticStyles_unstable } from './useAppItemStaticStyles.styles';
/**
* AppItemStatic component - Static application item in the navigation menu.
*/ export const AppItemStatic = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useAppItemStatic_unstable(props, ref);
useAppItemStaticStyles_unstable(state);
useCustomStyleHook_unstable('useAppItemStaticStyles_unstable')(state);
return renderAppItemStatic_unstable(state);
});
AppItemStatic.displayName = 'AppItemStatic';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItemStatic/AppItemStatic.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\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 - Static application item in the navigation menu.\n */\nexport const AppItemStatic: ForwardRefComponent<AppItemStaticProps> = React.forwardRef((props, ref) => {\n const state = useAppItemStatic_unstable(props, ref);\n\n useAppItemStaticStyles_unstable(state);\n useCustomStyleHook_unstable('useAppItemStaticStyles_unstable')(state);\n\n return renderAppItemStatic_unstable(state);\n});\n\nAppItemStatic.displayName = 'AppItemStatic';\n"],"names":["React","useCustomStyleHook_unstable","useAppItemStatic_unstable","renderAppItemStatic_unstable","useAppItemStaticStyles_unstable","AppItemStatic","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAGlF;;CAEC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAE/CJ,gCAAgCK;IAChCR,4BAA4B,mCAAmCQ;IAE/D,OAAON,6BAA6BM;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering AppItemStatic
*/ export { };

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,4 @@
export { AppItemStatic } from './AppItemStatic';
export { renderAppItemStatic_unstable } from './renderAppItemStatic';
export { useAppItemStatic_unstable } from './useAppItemStatic';
export { appItemStaticClassNames, useAppItemStaticStyles_unstable } from './useAppItemStaticStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItemStatic/index.ts"],"sourcesContent":["export { AppItemStatic } from './AppItemStatic';\nexport type { AppItemStaticProps, AppItemStaticSlots, AppItemStaticState } from './AppItemStatic.types';\nexport { renderAppItemStatic_unstable } from './renderAppItemStatic';\nexport { useAppItemStatic_unstable } from './useAppItemStatic';\nexport { appItemStaticClassNames, useAppItemStaticStyles_unstable } from './useAppItemStaticStyles.styles';\n"],"names":["AppItemStatic","renderAppItemStatic_unstable","useAppItemStatic_unstable","appItemStaticClassNames","useAppItemStaticStyles_unstable"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,uBAAuB,EAAEC,+BAA+B,QAAQ,kCAAkC"}

View File

@@ -0,0 +1,13 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of AppItemStatic
*/ export const renderAppItemStatic_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
state.root.children
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItemStatic/renderAppItemStatic.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { AppItemStaticState, AppItemStaticSlots } from './AppItemStatic.types';\n\n/**\n * Render the final JSX of AppItemStatic\n */\nexport const renderAppItemStatic_unstable = (state: AppItemStaticState): JSXElement => {\n assertSlots<AppItemStaticSlots>(state);\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {state.root.children}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAppItemStatic_unstable","state","root","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAEhC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,IAAI,kBAAI,KAACF,MAAME,IAAI;YACzBF,MAAMC,IAAI,CAACE,QAAQ;;;AAG1B,EAAE"}

View File

@@ -0,0 +1,32 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { useNavContext_unstable } from '../NavContext';
/**
* Create the state required to render AppItemStatic.
*
* The returned state can be modified with hooks such as useAppItemStaticStyles_unstable,
* before being passed to renderAppItemStatic_unstable.
*
* @param props - props from this instance of AppItemStatic
* @param ref - reference to root HTMLDivElement of AppItemStatic
*/ export const useAppItemStatic_unstable = (props, ref)=>{
const { icon } = props;
const { density = 'medium' } = useNavContext_unstable();
return {
components: {
root: 'div',
icon: 'span'
},
root: slot.always(getIntrinsicElementProps('div', {
ref,
...props
}), {
elementType: 'div'
}),
icon: slot.optional(icon, {
elementType: 'span'
}),
density
};
};

View File

@@ -0,0 +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":["React","getIntrinsicElementProps","slot","useNavContext_unstable","useAppItemStatic_unstable","props","ref","icon","density","components","root","always","elementType","optional"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,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"}

View File

@@ -0,0 +1,40 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { useAppItemStyles } from '../AppItem/useAppItemStyles.styles';
import { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const appItemStaticClassNames = {
root: 'fui-AppItemStatic',
icon: 'fui-AppItemStatic__icon'
};
const useAppItemStaticStyles = /*#__PURE__*/__styles({
root: {
Bceei9c: "f158kwzp",
Jwef8y: "fmaajru",
ecr2s2: "f11z5bqc"
}
}, {
d: [".f158kwzp{cursor:default;}"],
h: [".fmaajru:hover{background-color:unset;}"],
a: [".f11z5bqc:active{background-color:unset;}"]
});
/**
* Apply styling to the AppItemStatic slots based on the state
*/
export const useAppItemStaticStyles_unstable = state => {
'use no memo';
const rootDefaultClassName = useRootDefaultClassName();
const iconStyles = useIconStyles();
const appItemSpecificStyles = useAppItemStyles();
const appItemStaticStyles = useAppItemStaticStyles();
const {
density,
icon
} = state;
state.root.className = mergeClasses(rootDefaultClassName, appItemStaticClassNames.root, appItemSpecificStyles.root, appItemStaticStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(appItemStaticClassNames.icon, iconStyles.base, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","useAppItemStyles","useIconStyles","useRootDefaultClassName","appItemStaticClassNames","root","icon","useAppItemStaticStyles","Bceei9c","Jwef8y","ecr2s2","d","h","a","useAppItemStaticStyles_unstable","state","rootDefaultClassName","iconStyles","appItemSpecificStyles","appItemStaticStyles","density","className","small","absentIconRootAdjustment","base"],"sources":["useAppItemStaticStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useAppItemStyles } from '../AppItem/useAppItemStyles.styles';\nimport { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';\nexport const appItemStaticClassNames = {\n root: 'fui-AppItemStatic',\n icon: 'fui-AppItemStatic__icon'\n};\nconst useAppItemStaticStyles = makeStyles({\n root: {\n cursor: 'default',\n ':hover': {\n backgroundColor: 'unset'\n },\n ':active': {\n backgroundColor: 'unset'\n }\n }\n});\n/**\n * Apply styling to the AppItemStatic slots based on the state\n */ export const useAppItemStaticStyles_unstable = (state)=>{\n 'use no memo';\n const rootDefaultClassName = useRootDefaultClassName();\n const iconStyles = useIconStyles();\n const appItemSpecificStyles = useAppItemStyles();\n const appItemStaticStyles = useAppItemStaticStyles();\n const { density, icon } = state;\n state.root.className = mergeClasses(rootDefaultClassName, appItemStaticClassNames.root, appItemSpecificStyles.root, appItemStaticStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(appItemStaticClassNames.icon, iconStyles.base, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,2BAA2B;AAClF,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,sBAAsB,gBAAGR,QAAA;EAAAM,IAAA;IAAAG,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAU9B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,+BAA+B,GAAIC,KAAK,IAAG;EACxD,aAAa;;EACb,MAAMC,oBAAoB,GAAGb,uBAAuB,CAAC,CAAC;EACtD,MAAMc,UAAU,GAAGf,aAAa,CAAC,CAAC;EAClC,MAAMgB,qBAAqB,GAAGjB,gBAAgB,CAAC,CAAC;EAChD,MAAMkB,mBAAmB,GAAGZ,sBAAsB,CAAC,CAAC;EACpD,MAAM;IAAEa,OAAO;IAAEd;EAAK,CAAC,GAAGS,KAAK;EAC/BA,KAAK,CAACV,IAAI,CAACgB,SAAS,GAAGrB,YAAY,CAACgB,oBAAoB,EAAEZ,uBAAuB,CAACC,IAAI,EAAEa,qBAAqB,CAACb,IAAI,EAAEc,mBAAmB,CAACd,IAAI,EAAEe,OAAO,KAAK,OAAO,IAAIF,qBAAqB,CAACI,KAAK,EAAE,CAAChB,IAAI,IAAIY,qBAAqB,CAACK,wBAAwB,EAAER,KAAK,CAACV,IAAI,CAACgB,SAAS,CAAC;EAChR,IAAIN,KAAK,CAACT,IAAI,EAAE;IACZS,KAAK,CAACT,IAAI,CAACe,SAAS,GAAGrB,YAAY,CAACI,uBAAuB,CAACE,IAAI,EAAEW,UAAU,CAACO,IAAI,EAAET,KAAK,CAACT,IAAI,CAACe,SAAS,CAAC;EAC5G;EACA,OAAON,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,34 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { useAppItemStyles } from '../AppItem/useAppItemStyles.styles';
import { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const appItemStaticClassNames = {
root: 'fui-AppItemStatic',
icon: 'fui-AppItemStatic__icon'
};
const useAppItemStaticStyles = makeStyles({
root: {
cursor: 'default',
':hover': {
backgroundColor: 'unset'
},
':active': {
backgroundColor: 'unset'
}
}
});
/**
* Apply styling to the AppItemStatic slots based on the state
*/ export const useAppItemStaticStyles_unstable = (state)=>{
'use no memo';
const rootDefaultClassName = useRootDefaultClassName();
const iconStyles = useIconStyles();
const appItemSpecificStyles = useAppItemStyles();
const appItemStaticStyles = useAppItemStaticStyles();
const { density, icon } = state;
state.root.className = mergeClasses(rootDefaultClassName, appItemStaticClassNames.root, appItemSpecificStyles.root, appItemStaticStyles.root, density === 'small' && appItemSpecificStyles.small, !icon && appItemSpecificStyles.absentIconRootAdjustment, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(appItemStaticClassNames.icon, iconStyles.base, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/AppItemStatic/useAppItemStaticStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { AppItemStaticSlots, AppItemStaticState } from './AppItemStatic.types';\nimport { useAppItemStyles } from '../AppItem/useAppItemStyles.styles';\nimport { useIconStyles, useRootDefaultClassName } from '../sharedNavStyles.styles';\n\nexport const appItemStaticClassNames: SlotClassNames<AppItemStaticSlots> = {\n root: 'fui-AppItemStatic',\n icon: 'fui-AppItemStatic__icon',\n};\n\nconst useAppItemStaticStyles = makeStyles({\n root: {\n cursor: 'default',\n ':hover': {\n backgroundColor: 'unset',\n },\n ':active': {\n backgroundColor: 'unset',\n },\n },\n});\n\n/**\n * Apply styling to the AppItemStatic slots based on the state\n */\nexport const useAppItemStaticStyles_unstable = (state: AppItemStaticState): AppItemStaticState => {\n 'use no memo';\n\n const rootDefaultClassName = useRootDefaultClassName();\n const iconStyles = useIconStyles();\n const appItemSpecificStyles = useAppItemStyles();\n const appItemStaticStyles = useAppItemStaticStyles();\n\n const { density, icon } = state;\n\n state.root.className = mergeClasses(\n rootDefaultClassName,\n appItemStaticClassNames.root,\n appItemSpecificStyles.root,\n appItemStaticStyles.root,\n density === 'small' && appItemSpecificStyles.small,\n !icon && appItemSpecificStyles.absentIconRootAdjustment,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(appItemStaticClassNames.icon, iconStyles.base, state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useAppItemStyles","useIconStyles","useRootDefaultClassName","appItemStaticClassNames","root","icon","useAppItemStaticStyles","cursor","backgroundColor","useAppItemStaticStyles_unstable","state","rootDefaultClassName","iconStyles","appItemSpecificStyles","appItemStaticStyles","density","className","small","absentIconRootAdjustment","base"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,4BAA4B;AAEnF,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,MAAMC,yBAAyBR,WAAW;IACxCM,MAAM;QACJG,QAAQ;QACR,UAAU;YACRC,iBAAiB;QACnB;QACA,WAAW;YACTA,iBAAiB;QACnB;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAMC,uBAAuBT;IAC7B,MAAMU,aAAaX;IACnB,MAAMY,wBAAwBb;IAC9B,MAAMc,sBAAsBR;IAE5B,MAAM,EAAES,OAAO,EAAEV,IAAI,EAAE,GAAGK;IAE1BA,MAAMN,IAAI,CAACY,SAAS,GAAGjB,aACrBY,sBACAR,wBAAwBC,IAAI,EAC5BS,sBAAsBT,IAAI,EAC1BU,oBAAoBV,IAAI,EACxBW,YAAY,WAAWF,sBAAsBI,KAAK,EAClD,CAACZ,QAAQQ,sBAAsBK,wBAAwB,EACvDR,MAAMN,IAAI,CAACY,SAAS;IAGtB,IAAIN,MAAML,IAAI,EAAE;QACdK,MAAML,IAAI,CAACW,SAAS,GAAGjB,aAAaI,wBAAwBE,IAAI,EAAEO,WAAWO,IAAI,EAAET,MAAML,IAAI,CAACW,SAAS;IACzG;IAEA,OAAON;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { renderButton_unstable } from '@fluentui/react-button';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useHamburger_unstable } from './useHamburger';
import { useHamburgerStyles_unstable } from './useHamburgerStyles.styles';
/**
* Hamburger component - a button that toggles a menu or navigation drawer.
*/ export const Hamburger = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useHamburger_unstable(props, ref);
useHamburgerStyles_unstable(state);
useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);
return renderButton_unstable(state);
});
Hamburger.displayName = 'Hamburger';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Hamburger/Hamburger.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable } from '@fluentui/react-button';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useHamburger_unstable } from './useHamburger';\nimport { useHamburgerStyles_unstable } from './useHamburgerStyles.styles';\nimport type { HamburgerProps } from './Hamburger.types';\n\n/**\n * Hamburger component - a button that toggles a menu or navigation drawer.\n */\nexport const Hamburger: ForwardRefComponent<HamburgerProps> = React.forwardRef((props, ref) => {\n const state = useHamburger_unstable(props, ref);\n\n useHamburgerStyles_unstable(state);\n useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);\n\n return renderButton_unstable(state);\n}) as ForwardRefComponent<HamburgerProps>;\n\nHamburger.displayName = 'Hamburger';\n"],"names":["React","renderButton_unstable","useCustomStyleHook_unstable","useHamburger_unstable","useHamburgerStyles_unstable","Hamburger","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,2BAA2B,QAAQ,8BAA8B;AAG1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQN,sBAAsBI,OAAOC;IAE3CJ,4BAA4BK;IAC5BP,4BAA4B,+BAA+BO;IAE3D,OAAOR,sBAAsBQ;AAC/B,GAA0C;AAE1CJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering Hamburger
*/ export { };

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,3 @@
export { Hamburger } from './Hamburger';
export { useHamburger_unstable } from './useHamburger';
export { hamburgerClassNames, useHamburgerStyles_unstable } from './useHamburgerStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Hamburger/index.ts"],"sourcesContent":["export { Hamburger } from './Hamburger';\nexport type { HamburgerProps, HamburgerState } from './Hamburger.types';\nexport { useHamburger_unstable } from './useHamburger';\nexport { hamburgerClassNames, useHamburgerStyles_unstable } from './useHamburgerStyles.styles';\n"],"names":["Hamburger","useHamburger_unstable","hamburgerClassNames","useHamburgerStyles_unstable"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,8BAA8B"}

View File

@@ -0,0 +1,16 @@
'use client';
import * as React from 'react';
import { useButton_unstable } from '@fluentui/react-button';
import { Navigation20Filled } from '@fluentui/react-icons';
/**
* Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns
* processed state.
* @param props - User provided props to the Button component.
* @param ref - User provided ref to be passed to the Button component.
*/ export const useHamburger_unstable = (props, ref)=>{
return useButton_unstable({
icon: /*#__PURE__*/ React.createElement(Navigation20Filled, null),
appearance: 'transparent',
...props
}, ref);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Hamburger/useHamburger.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useButton_unstable } from '@fluentui/react-button';\nimport { Navigation20Filled } from '@fluentui/react-icons';\nimport type { HamburgerProps, HamburgerState } from './Hamburger.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useHamburger_unstable = (\n props: HamburgerProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): HamburgerState => {\n return useButton_unstable({ icon: <Navigation20Filled />, appearance: 'transparent', ...props }, ref);\n};\n"],"names":["React","useButton_unstable","Navigation20Filled","useHamburger_unstable","props","ref","icon","appearance"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,kBAAkB,QAAQ,wBAAwB;AAG3D;;;;;CAKC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,OACAC;IAEA,OAAOJ,mBAAmB;QAAEK,oBAAM,oBAACJ;QAAuBK,YAAY;QAAe,GAAGH,KAAK;IAAC,GAAGC;AACnG,EAAE"}

View File

@@ -0,0 +1,57 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { useButtonStyles_unstable } from '@fluentui/react-button';
import { navItemTokens } from '../sharedNavStyles.styles';
export const hamburgerClassNames = {
root: 'fui-Hamburger',
icon: 'fui-Hamburger__icon'
};
/**
* Styles for the root slot
*/
const useStyles = /*#__PURE__*/__styles({
root: {
w71qe1: "f1iuv45f",
De3pzq: "f1ctqxl6",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f3bhgqh",
Jwef8y: "f11oyicx",
ecr2s2: "f9fof1w"
}
}, {
d: [".f1iuv45f{text-decoration-line:none;}", ".f1ctqxl6{background-color:var(--colorNeutralBackground4);}", [".f3bhgqh{border:none;}", {
p: -2
}]],
h: [".f11oyicx:hover{background-color:var(--colorNeutralBackground4Hover);}"],
a: [".f9fof1w:active{background-color:var(--colorNeutralBackground4Pressed);}"]
});
/**
* Apply styling to the Hamburger slots based on the state
*/
export const useHamburgerStyles_unstable = state => {
'use no memo';
useButtonStyles_unstable(state);
const styles = useStyles();
state.root.className = mergeClasses(hamburgerClassNames.root, styles.root, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(hamburgerClassNames.icon, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","useButtonStyles_unstable","navItemTokens","hamburgerClassNames","root","icon","useStyles","w71qe1","De3pzq","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Jwef8y","ecr2s2","d","p","h","a","useHamburgerStyles_unstable","state","styles","className"],"sources":["useHamburgerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport { navItemTokens } from '../sharedNavStyles.styles';\nexport const hamburgerClassNames = {\n root: 'fui-Hamburger',\n icon: 'fui-Hamburger__icon'\n};\n/**\n * Styles for the root slot\n */ const 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 * Apply styling to the Hamburger slots based on the state\n */ export const useHamburgerStyles_unstable = (state)=>{\n 'use no memo';\n useButtonStyles_unstable(state);\n const styles = useStyles();\n state.root.className = mergeClasses(hamburgerClassNames.root, styles.root, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(hamburgerClassNames.icon, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,aAAa,QAAQ,2BAA2B;AACzD,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGP,QAAA;EAAAK,IAAA;IAAAG,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAYrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,2BAA2B,GAAIC,KAAK,IAAG;EACpD,aAAa;;EACbhC,wBAAwB,CAACgC,KAAK,CAAC;EAC/B,MAAMC,MAAM,GAAG5B,SAAS,CAAC,CAAC;EAC1B2B,KAAK,CAAC7B,IAAI,CAAC+B,SAAS,GAAGnC,YAAY,CAACG,mBAAmB,CAACC,IAAI,EAAE8B,MAAM,CAAC9B,IAAI,EAAE6B,KAAK,CAAC7B,IAAI,CAAC+B,SAAS,CAAC;EAChG,IAAIF,KAAK,CAAC5B,IAAI,EAAE;IACZ4B,KAAK,CAAC5B,IAAI,CAAC8B,SAAS,GAAGnC,YAAY,CAACG,mBAAmB,CAACE,IAAI,EAAE4B,KAAK,CAAC5B,IAAI,CAAC8B,SAAS,CAAC;EACvF;EACA,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,35 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { useButtonStyles_unstable } from '@fluentui/react-button';
import { navItemTokens } from '../sharedNavStyles.styles';
export const hamburgerClassNames = {
root: 'fui-Hamburger',
icon: 'fui-Hamburger__icon'
};
/**
* Styles for the root slot
*/ const useStyles = makeStyles({
root: {
textDecorationLine: 'none',
backgroundColor: navItemTokens.backgroundColor,
border: 'none',
':hover': {
backgroundColor: navItemTokens.backgroundColorHover
},
':active': {
backgroundColor: navItemTokens.backgroundColorPressed
}
}
});
/**
* Apply styling to the Hamburger slots based on the state
*/ export const useHamburgerStyles_unstable = (state)=>{
'use no memo';
useButtonStyles_unstable(state);
const styles = useStyles();
state.root.className = mergeClasses(hamburgerClassNames.root, styles.root, state.root.className);
if (state.icon) {
state.icon.className = mergeClasses(hamburgerClassNames.icon, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Hamburger/useHamburgerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { ButtonSlots, 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;AAC1D,SAAsBC,wBAAwB,QAAQ,yBAAyB;AAG/E,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"}

View File

@@ -0,0 +1,17 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useNav_unstable } from './useNav';
import { renderNav_unstable } from './renderNav';
import { useNavStyles_unstable } from './useNavStyles.styles';
import { useNavContextValues_unstable } from '../useNavContextValues';
/**
* Nav - A component that provides up to two levels of nesting for navigation.
*/ export const Nav = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useNav_unstable(props, ref);
const contextValues = useNavContextValues_unstable(state);
useNavStyles_unstable(state);
useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);
return renderNav_unstable(state, contextValues);
});
Nav.displayName = 'Nav';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Nav/Nav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\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 useCustomStyleHook_unstable('useHamburgerStyles_unstable')(state);\n\n return renderNav_unstable(state, contextValues);\n});\n\nNav.displayName = 'Nav';\n"],"names":["React","useCustomStyleHook_unstable","useNav_unstable","renderNav_unstable","useNavStyles_unstable","useNavContextValues_unstable","Nav","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAASC,4BAA4B,QAAQ,yBAAyB;AAGtE;;CAEC,GACD,OAAO,MAAMC,oBAAqCN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACzE,MAAMC,QAAQR,gBAAgBM,OAAOC;IAErC,MAAME,gBAAgBN,6BAA6BK;IAEnDN,sBAAsBM;IACtBT,4BAA4B,+BAA+BS;IAE3D,OAAOP,mBAAmBO,OAAOC;AACnC,GAAG;AAEHL,IAAIM,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +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":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,4 @@
export { Nav } from './Nav';
export { renderNav_unstable } from './renderNav';
export { useNav_unstable } from './useNav';
export { useNavStyles_unstable, navClassNames } from './useNavStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Nav/index.ts"],"sourcesContent":["export { Nav } from './Nav';\nexport type { NavSlots, NavProps, OnNavItemSelectData, NavState, NavDensity } from './Nav.types';\nexport { renderNav_unstable } from './renderNav';\nexport { useNav_unstable } from './useNav';\nexport { useNavStyles_unstable, navClassNames } from './useNavStyles.styles';\n"],"names":["Nav","renderNav_unstable","useNav_unstable","useNavStyles_unstable","navClassNames"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAE5B,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,wBAAwB"}

View File

@@ -0,0 +1,10 @@
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { NavProvider } from '../NavContext';
export const renderNav_unstable = (state, contextValues)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(NavProvider, {
value: contextValues.nav,
children: /*#__PURE__*/ _jsx(state.root, {})
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Nav/renderNav.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { NavProvider } from '../NavContext';\nimport type { NavState, NavSlots } from './Nav.types';\nimport type { NavContextValues } from '../NavContext.types';\n\nexport const renderNav_unstable = (state: NavState, contextValues: NavContextValues): JSXElement => {\n assertSlots<NavSlots>(state);\n\n return (\n <NavProvider value={contextValues.nav}>\n <state.root />\n </NavProvider>\n );\n};\n"],"names":["assertSlots","NavProvider","renderNav_unstable","state","contextValues","value","nav","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,WAAW,QAAQ,gBAAgB;AAI5C,OAAO,MAAMC,qBAAqB,CAACC,OAAiBC;IAClDJ,YAAsBG;IAEtB,qBACE,KAACF;QAAYI,OAAOD,cAAcE,GAAG;kBACnC,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}

View File

@@ -0,0 +1,136 @@
'use client';
import * as React from 'react';
import { useControllableState, useEventCallback, useMergedRefs, slot, getIntrinsicElementProps } from '@fluentui/react-utilities';
/**
* Initial value for the uncontrolled case of the list of open indexes
*/ function initializeUncontrolledOpenCategories({ defaultOpenCategories, multiple }) {
if (defaultOpenCategories !== undefined) {
if (Array.isArray(defaultOpenCategories)) {
return multiple ? defaultOpenCategories : [
defaultOpenCategories[0]
];
}
return [
defaultOpenCategories
];
}
return undefined;
}
/**
* Updates the list of open indexes based on an index that changes
* @param value - the index that will change
* @param previousOpenItems - list of current open indexes
* @param multiple - if Nav supports open categories at the same time
*/ const updateOpenCategories = (value, previousOpenItems, multiple)=>{
if (multiple) {
if (previousOpenItems.includes(value)) {
return previousOpenItems.filter((i)=>i !== value);
} else {
return [
...previousOpenItems,
value
];
}
}
return previousOpenItems[0] === value ? [] : [
value
];
};
/**
* Create the state required to render Nav.
*
* The returned state can be modified with hooks such as useNavStyles,
* before being passed to renderNav.
*
* @param props - props from this instance of Nav
* @param ref - reference to root HTMLDivElement of Nav
*/ export const useNav_unstable = (props, ref)=>{
const { onNavItemSelect, onNavCategoryItemToggle, multiple = true, density = 'medium', openCategories: controlledOpenCategoryItems, selectedCategoryValue: controlledSelectedCategoryValue, selectedValue: controlledSelectedValue, defaultOpenCategories, defaultSelectedValue, defaultSelectedCategoryValue } = props;
const innerRef = React.useRef(null);
const [openCategories, setOpenCategories] = useControllableState({
state: controlledOpenCategoryItems,
defaultState: initializeUncontrolledOpenCategories({
defaultOpenCategories,
multiple
}),
initialState: []
});
const [selectedCategoryValue, setSelectedCategoryValue] = useControllableState({
state: controlledSelectedCategoryValue,
defaultState: defaultSelectedCategoryValue,
initialState: undefined
});
const [selectedValue, setSelectedValue] = useControllableState({
state: controlledSelectedValue,
defaultState: defaultSelectedValue,
initialState: undefined
});
// considered usePrevious, but it is sensitive to re-renders
// this could cause the previous to move to current in the case where the navItem list re-renders.
// these refs avoid getRegisteredNavItems changing when selectedValue changes and causing
// renders for navItems that have not changed.
const currentSelectedValue = React.useRef(undefined);
const previousSelectedValue = React.useRef(undefined);
const currentSelectedCategoryValue = React.useRef(undefined);
const previousSelectedCategoryValue = React.useRef(undefined);
if (currentSelectedValue.current !== selectedValue) {
previousSelectedValue.current = currentSelectedValue.current;
currentSelectedValue.current = selectedValue;
}
if (currentSelectedCategoryValue.current !== selectedCategoryValue) {
previousSelectedCategoryValue.current = currentSelectedCategoryValue.current;
currentSelectedCategoryValue.current = selectedCategoryValue;
}
// used for NavItems and NavSubItems
const onSelect = useEventCallback((event, data)=>{
setSelectedValue(data.value);
setSelectedCategoryValue(data.categoryValue ? data.categoryValue : '');
onNavItemSelect === null || onNavItemSelect === void 0 ? void 0 : onNavItemSelect(event, data);
});
// used for NavCategoryItems
const onRequestNavCategoryItemToggle = useEventCallback((event, data)=>{
if (data.categoryValue !== undefined) {
const nextOpenCategories = updateOpenCategories(data.categoryValue, openCategories !== null && openCategories !== void 0 ? openCategories : [], multiple);
onNavCategoryItemToggle === null || onNavCategoryItemToggle === void 0 ? void 0 : onNavCategoryItemToggle(event, data);
setOpenCategories(nextOpenCategories);
}
});
const registeredNavItems = React.useRef({});
const onRegister = React.useCallback((data)=>{
registeredNavItems.current[JSON.stringify(data.value)] = data;
}, []);
const onUnregister = React.useCallback((data)=>{
delete registeredNavItems.current[JSON.stringify(data.value)];
}, []);
const getRegisteredNavItems = React.useCallback(()=>{
return {
selectedValue: currentSelectedValue.current,
previousSelectedValue: previousSelectedValue.current,
selectedCategoryValue: currentSelectedCategoryValue.current,
previousSelectedCategoryValue: previousSelectedCategoryValue.current,
registeredNavItems: registeredNavItems.current
};
}, []);
return {
components: {
root: 'div'
},
root: slot.always(getIntrinsicElementProps('div', {
ref: useMergedRefs(ref, innerRef),
...props
}), {
elementType: 'div'
}),
openCategories,
selectedValue,
selectedCategoryValue,
onRegister,
onUnregister,
onSelect,
getRegisteredNavItems,
onRequestNavCategoryItemToggle,
multiple,
density,
tabbable: false
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,29 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
export const navClassNames = {
root: 'fui-Nav'
};
/**
* Styles for the root slot
*/
const useStyles = /*#__PURE__*/__styles({
root: {
mc9l5x: "f22iagw",
Beiy3e4: "f1vx9l62"
}
}, {
d: [".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}"]
});
/**
* Apply styling to the Nav slots based on the state
*/
export const useNavStyles_unstable = state => {
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);
// TODO Add class names to slots, for example:
// state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","navClassNames","root","useStyles","mc9l5x","Beiy3e4","d","useNavStyles_unstable","state","styles","className"],"sources":["useNavStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nexport const navClassNames = {\n root: 'fui-Nav'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\n/**\n * Apply styling to the Nav slots based on the state\n */ export const useNavStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,aAAa,GAAG;EACzBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAKrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,qBAAqB,GAAIC,KAAK,IAAG;EAC9C,aAAa;;EACb,MAAMC,MAAM,GAAGN,SAAS,CAAC,CAAC;EAC1BK,KAAK,CAACN,IAAI,CAACQ,SAAS,GAAGV,YAAY,CAACC,aAAa,CAACC,IAAI,EAAEO,MAAM,CAACP,IAAI,EAAEM,KAAK,CAACN,IAAI,CAACQ,SAAS,CAAC;EAC1F;EACA;EACA,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,23 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
export const navClassNames = {
root: 'fui-Nav'
};
/**
* Styles for the root slot
*/ const useStyles = makeStyles({
root: {
display: 'flex',
flexDirection: 'column'
}
});
/**
* Apply styling to the Nav slots based on the state
*/ export const useNavStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);
// TODO Add class names to slots, for example:
// state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Nav/useNavStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { NavSlots, NavState } from './Nav.types';\n\nexport const navClassNames: SlotClassNames<NavSlots> = {\n root: 'fui-Nav',\n // TODO: add class names for all slots on NavSlots.\n // Should be of the form `<slotName>: 'fui-Nav__<slotName>`\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the Nav slots based on the state\n */\nexport const useNavStyles_unstable = (state: NavState): NavState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(navClassNames.root, styles.root, state.root.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","navClassNames","root","useStyles","display","flexDirection","useNavStyles_unstable","state","styles","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI1D,OAAO,MAAMC,gBAA0C;IACrDC,MAAM;AAGR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYJ,WAAW;IAC3BG,MAAM;QACJE,SAAS;QACTC,eAAe;IACjB;AAGF;AAEA;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpC;IAEA,MAAMC,SAASL;IACfI,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,cAAcC,IAAI,EAAEM,OAAON,IAAI,EAAEK,MAAML,IAAI,CAACO,SAAS;IAEzF,8CAA8C;IAC9C,gFAAgF;IAEhF,OAAOF;AACT,EAAE"}

View File

@@ -0,0 +1,13 @@
'use client';
import * as React from 'react';
import { useNavCategory_unstable } from './useNavCategory';
import { renderNavCategory_unstable } from './renderNavCategory';
import { useNavCategoryContextValues_unstable } from '../useNavCategoryContextValues_unstable';
/**
* NavCategory component - a category in the navigation menu that can contain multiple items.
*/ export const NavCategory = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useNavCategory_unstable(props, ref);
const contextValues = useNavCategoryContextValues_unstable(state);
return renderNavCategory_unstable(state, contextValues);
});
NavCategory.displayName = 'NavCategory';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategory/NavCategory.tsx"],"sourcesContent":["'use client';\n\nimport * 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 - a category in the navigation menu that can contain multiple items.\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":["React","useNavCategory_unstable","renderNavCategory_unstable","useNavCategoryContextValues_unstable","NavCategory","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAK/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,oCAAoC,QAAQ,0CAA0C;AAE/F;;CAEC,GACD,OAAO,MAAMC,4BAAqDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQP,wBAAwBK,OAAOC;IAC7C,MAAME,gBAAgBN,qCAAqCK;IAE3D,OAAON,2BAA2BM,OAAOC;AAC3C,GAAG;AAEHL,YAAYM,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +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":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,3 @@
export { NavCategory } from './NavCategory';
export { renderNavCategory_unstable } from './renderNavCategory';
export { useNavCategory_unstable } from './useNavCategory';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategory/index.ts"],"sourcesContent":["export { NavCategory } from './NavCategory';\nexport type { NavCategoryProps, NavCategoryState } from './NavCategory.types';\nexport { renderNavCategory_unstable } from './renderNavCategory';\nexport { useNavCategory_unstable } from './useNavCategory';\n"],"names":["NavCategory","renderNavCategory_unstable","useNavCategory_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB"}

View File

@@ -0,0 +1,9 @@
import * as React from 'react';
import { NavCategoryProvider } from '../NavCategoryContext';
/**
* Render the final JSX of NavCategory
*/ export const renderNavCategory_unstable = (state, contextValues)=>{
return /*#__PURE__*/ React.createElement(NavCategoryProvider, {
value: contextValues.categoryValue
}, state.children);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategory/renderNavCategory.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\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 = (\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;AAE/B,SAAmCC,mBAAmB,QAAQ,wBAAwB;AAItF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,qBAAO,oBAACH;QAAoBI,OAAOD,cAAcE,aAAa;OAAGH,MAAMI,QAAQ;AACjF,EAAE"}

View File

@@ -0,0 +1,21 @@
'use client';
import * as React from 'react';
import { useNavContext_unstable } from '../NavContext';
/**
* Create the state required to render NavCategory.
*
* The returned state can be modified with hooks such as useNavCategoryStyles_unstable,
* before being passed to renderNavCategory_unstable.
*
* @param props - props from this instance of NavCategory
* @param ref - reference to root HTMLDivElement of NavCategory
*/ export const useNavCategory_unstable = (props, ref)=>{
const { value, children } = props;
const { openCategories } = useNavContext_unstable();
const open = openCategories === null || openCategories === void 0 ? void 0 : openCategories.includes(value);
return {
open,
value,
children: children !== null && children !== void 0 ? children : null
};
};

View File

@@ -0,0 +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":["React","useNavContext_unstable","useNavCategory_unstable","props","ref","value","children","openCategories","open","includes"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,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"}

View File

@@ -0,0 +1,12 @@
'use client';
import * as React from 'react';
const NavCategoryContext = React.createContext(undefined);
const navCategoryContextDefaultValue = {
open: false,
value: ''
};
export const { Provider: NavCategoryProvider } = NavCategoryContext;
export const useNavCategoryContext_unstable = ()=>{
var _React_useContext;
return (_React_useContext = React.useContext(NavCategoryContext)) !== null && _React_useContext !== void 0 ? _React_useContext : navCategoryContextDefaultValue;
};

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,18 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useNavCategoryItem_unstable } from './useNavCategoryItem';
import { renderNavCategoryItem_unstable } from './renderNavCategoryItem';
import { useNavCategoryItemStyles_unstable } from './useNavCategoryItem.styles';
import { useNavCategoryItemContextValues_unstable } from '../useNavCategoryItemContextValues_unstable';
/**
* A Nav Category Item provides provides a clickable accordion like header that exposes
* a list of NavSubItems to take users to a new destination.
*/ export const NavCategoryItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useNavCategoryItem_unstable(props, ref);
const contextValues = useNavCategoryItemContextValues_unstable(state);
useNavCategoryItemStyles_unstable(state);
useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);
return renderNavCategoryItem_unstable(state, contextValues);
});
NavCategoryItem.displayName = 'NavCategoryItem';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useNavCategoryItem_unstable } from './useNavCategoryItem';\nimport { renderNavCategoryItem_unstable } from './renderNavCategoryItem';\nimport type { NavCategoryItemProps } from './NavCategoryItem.types';\nimport { useNavCategoryItemStyles_unstable } from './useNavCategoryItem.styles';\nimport { useNavCategoryItemContextValues_unstable } from '../useNavCategoryItemContextValues_unstable';\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 useCustomStyleHook_unstable('useNavCategoryItemStyles')(state);\n\n return renderNavCategoryItem_unstable(state, contextValues);\n});\n\nNavCategoryItem.displayName = 'NavCategoryItem';\n"],"names":["React","useCustomStyleHook_unstable","useNavCategoryItem_unstable","renderNavCategoryItem_unstable","useNavCategoryItemStyles_unstable","useNavCategoryItemContextValues_unstable","NavCategoryItem","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AAEzE,SAASC,iCAAiC,QAAQ,8BAA8B;AAChF,SAASC,wCAAwC,QAAQ,8CAA8C;AAEvG;;;CAGC,GACD,OAAO,MAAMC,gCAA6DN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQR,4BAA4BM,OAAOC;IACjD,MAAME,gBAAgBN,yCAAyCK;IAE/DN,kCAAkCM;IAClCT,4BAA4B,4BAA4BS;IAExD,OAAOP,+BAA+BO,OAAOC;AAC/C,GAAG;AAEHL,gBAAgBM,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering NavCategoryItem
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategoryItem/NavCategoryItem.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';\nimport type { NavCategoryItemContextValue } from '../NavCategoryItemContext';\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 * Expand icon motion slot.\n */\n expandIconMotion?: Slot<PresenceMotionSlotProps>;\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":[],"mappings":"AAqCA;;CAEC,GACD,WAYI"}

View File

@@ -0,0 +1,4 @@
export { NavCategoryItem } from './NavCategoryItem';
export { renderNavCategoryItem_unstable } from './renderNavCategoryItem';
export { useNavCategoryItem_unstable } from './useNavCategoryItem';
export { useNavCategoryItemStyles_unstable, navCategoryItemClassNames } from './useNavCategoryItem.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavCategoryItem/index.ts"],"sourcesContent":["export { NavCategoryItem } from './NavCategoryItem';\nexport type { NavCategoryItemSlots, NavCategoryItemProps, NavCategoryItemState } from './NavCategoryItem.types';\nexport { renderNavCategoryItem_unstable } from './renderNavCategoryItem';\nexport { useNavCategoryItem_unstable } from './useNavCategoryItem';\nexport { useNavCategoryItemStyles_unstable, navCategoryItemClassNames } from './useNavCategoryItem.styles';\n"],"names":["NavCategoryItem","renderNavCategoryItem_unstable","useNavCategoryItem_unstable","useNavCategoryItemStyles_unstable","navCategoryItemClassNames"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,iCAAiC,EAAEC,yBAAyB,QAAQ,8BAA8B"}

View File

@@ -0,0 +1,30 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { NavCategoryItemProvider } from '../NavCategoryItemContext';
const getExpandIcon = (state)=>{
assertSlots(state);
if (!state.expandIcon) {
return null;
}
if (!state.expandIconMotion) {
return /*#__PURE__*/ _jsx(state.expandIcon, {});
}
return /*#__PURE__*/ _jsx(state.expandIconMotion, {
children: /*#__PURE__*/ _jsx(state.expandIcon, {})
});
};
/**
* Render the final JSX of NavCategoryItem
*/ export const renderNavCategoryItem_unstable = (state, contextValues)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(NavCategoryItemProvider, {
value: contextValues.navCategoryItem,
children: /*#__PURE__*/ _jsxs(state.root, {
children: [
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
state.root.children,
getExpandIcon(state)
]
})
});
};

View File

@@ -0,0 +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 { JSXElement } from '@fluentui/react-utilities';\nimport type { NavCategoryItemState, NavCategoryItemSlots, NavCategoryItemContextValues } from './NavCategoryItem.types';\nimport { NavCategoryItemProvider } from '../NavCategoryItemContext';\n\nconst getExpandIcon = (state: NavCategoryItemState) => {\n assertSlots<NavCategoryItemSlots>(state);\n\n if (!state.expandIcon) {\n return null;\n }\n\n if (!state.expandIconMotion) {\n return <state.expandIcon />;\n }\n\n return (\n <state.expandIconMotion>\n <state.expandIcon />\n </state.expandIconMotion>\n );\n};\n\n/**\n * Render the final JSX of NavCategoryItem\n */\nexport const renderNavCategoryItem_unstable = (\n state: NavCategoryItemState,\n contextValues: NavCategoryItemContextValues,\n): JSXElement => {\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 {getExpandIcon(state)}\n </state.root>\n </NavCategoryItemProvider>\n );\n};\n"],"names":["assertSlots","NavCategoryItemProvider","getExpandIcon","state","expandIcon","expandIconMotion","renderNavCategoryItem_unstable","contextValues","value","navCategoryItem","root","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,MAAMC,gBAAgB,CAACC;IACrBH,YAAkCG;IAElC,IAAI,CAACA,MAAMC,UAAU,EAAE;QACrB,OAAO;IACT;IAEA,IAAI,CAACD,MAAME,gBAAgB,EAAE;QAC3B,qBAAO,KAACF,MAAMC,UAAU;IAC1B;IAEA,qBACE,KAACD,MAAME,gBAAgB;kBACrB,cAAA,KAACF,MAAMC,UAAU;;AAGvB;AAEA;;CAEC,GACD,OAAO,MAAME,iCAAiC,CAC5CH,OACAI;IAEAP,YAAkCG;IAElC,qBACE,KAACF;QAAwBO,OAAOD,cAAcE,eAAe;kBAC3D,cAAA,MAACN,MAAMO,IAAI;;gBACRP,MAAMQ,IAAI,kBAAI,KAACR,MAAMQ,IAAI;gBACzBR,MAAMO,IAAI,CAACE,QAAQ;gBACnBV,cAAcC;;;;AAIvB,EAAE"}

View File

@@ -0,0 +1,75 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';
import { ChevronDown20Regular } from '@fluentui/react-icons';
import { createPresenceComponentVariant, motionTokens, presenceMotionSlot } from '@fluentui/react-motion';
import { useNavCategoryContext_unstable } from '../NavCategoryContext';
import { useNavContext_unstable } from '../NavContext';
import { Rotate } from '@fluentui/react-motion-components-preview';
const ExpandIconMotion = createPresenceComponentVariant(Rotate, {
duration: motionTokens.durationFast,
easing: motionTokens.curveEasyEase,
animateOpacity: false,
outAngle: 0,
inAngle: 180
});
/**
* Create the state required to render NavCategoryItem.
*
* The returned state can be modified with hooks such as useNavCategoryItemStyles,
* before being passed to renderNavCategoryItem.
*
* @param props - props from this instance of NavCategoryItem
* @param ref - reference to root HTMLButtonElement of NavCategoryItem
*/ export const useNavCategoryItem_unstable = (props, ref)=>{
const { onClick, expandIcon, icon } = props;
const { open, value } = useNavCategoryContext_unstable();
const { onRequestNavCategoryItemToggle, selectedCategoryValue, density = 'medium' } = useNavContext_unstable();
const onNavCategoryItemClick = useEventCallback(mergeCallbacks(onClick, (event)=>onRequestNavCategoryItemToggle(event, {
type: 'click',
event,
value: '',
categoryValue: value
})));
// don't fill the icon when it's open
const selected = selectedCategoryValue === value && !open;
// there's more than 2 possible values for aria-current, but this is the only one that's used in this component
const validAriaCurrent = selected && !open ? 'page' : 'false';
return {
open,
value,
selected,
components: {
root: 'button',
icon: 'span',
expandIcon: 'span',
expandIconMotion: ExpandIconMotion
},
root: slot.always(getIntrinsicElementProps('button', {
ref,
'aria-current': validAriaCurrent,
'aria-expanded': open,
...props,
onClick: onNavCategoryItemClick
}), {
elementType: 'button'
}),
expandIcon: slot.always(expandIcon, {
defaultProps: {
children: /*#__PURE__*/ React.createElement(ChevronDown20Regular, null),
'aria-hidden': true
},
elementType: 'span'
}),
expandIconMotion: presenceMotionSlot(props.expandIconMotion, {
elementType: ExpandIconMotion,
defaultProps: {
visible: open
}
}),
icon: slot.optional(icon, {
elementType: 'span'
}),
density
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,60 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { typographyStyles } from '@fluentui/react-theme';
import { useContentStyles, useIconStyles, useIndicatorStyles, useRootDefaultClassName, useSmallStyles } from '../sharedNavStyles.styles';
export const navCategoryItemClassNames = {
root: 'fui-NavCategoryItem',
icon: 'fui-NavCategoryItem__icon',
expandIcon: 'fui-NavCategoryItem__expandIcon',
expandIconMotion: 'fui-NavCategoryItem__expandIconMotion'
};
const useExpandIconStyles = /*#__PURE__*/__styles({
base: {
Jyy4pa: "f1lfeew",
Bqenvij: "fjamq6b"
},
selected: {
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "fl43uef",
Bg96gwp: "f1i3iumi"
}
}, {
d: [".f1lfeew{-webkit-margin-start:auto;margin-inline-start:auto;}", ".fjamq6b{height:20px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
});
/**
* Styles for the root slot
*/
export const useRootStyles = /*#__PURE__*/__styles({
base: {
a9b677: "fly5x3f"
}
}, {
d: [".fly5x3f{width:100%;}"]
});
/**
* Apply styling to the NavCategoryItem slots based on the state
*/
export const useNavCategoryItemStyles_unstable = state => {
'use no memo';
const rootStyles = useRootStyles();
const smallStyles = useSmallStyles();
const defaultRootClassName = useRootDefaultClassName();
const contentStyles = useContentStyles();
const indicatorStyles = useIndicatorStyles();
const iconStyles = useIconStyles();
const expandIconStyles = useExpandIconStyles();
const {
selected,
open,
density
} = state;
state.root.className = mergeClasses(navCategoryItemClassNames.root, defaultRootClassName, rootStyles.base, density === 'small' && smallStyles.root, selected && open === false && indicatorStyles.base, selected && open === false && contentStyles.selected, state.root.className);
state.expandIcon.className = mergeClasses(navCategoryItemClassNames.expandIcon, expandIconStyles.base, state.expandIcon.className);
if (state.icon) {
state.icon.className = mergeClasses(navCategoryItemClassNames.icon, iconStyles.base, selected && iconStyles.selected, state.icon.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","typographyStyles","useContentStyles","useIconStyles","useIndicatorStyles","useRootDefaultClassName","useSmallStyles","navCategoryItemClassNames","root","icon","expandIcon","expandIconMotion","useExpandIconStyles","base","Jyy4pa","Bqenvij","selected","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","useRootStyles","a9b677","useNavCategoryItemStyles_unstable","state","rootStyles","smallStyles","defaultRootClassName","contentStyles","indicatorStyles","iconStyles","expandIconStyles","open","density","className"],"sources":["useNavCategoryItem.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { useContentStyles, useIconStyles, useIndicatorStyles, useRootDefaultClassName, useSmallStyles } from '../sharedNavStyles.styles';\nexport const navCategoryItemClassNames = {\n root: 'fui-NavCategoryItem',\n icon: 'fui-NavCategoryItem__icon',\n expandIcon: 'fui-NavCategoryItem__expandIcon',\n expandIconMotion: 'fui-NavCategoryItem__expandIconMotion'\n};\nconst useExpandIconStyles = makeStyles({\n base: {\n marginInlineStart: 'auto',\n height: '20px'\n },\n selected: typographyStyles.body1Strong\n});\n/**\n * Styles for the root slot\n */ export const useRootStyles = makeStyles({\n base: {\n width: '100%'\n }\n});\n/**\n * Apply styling to the NavCategoryItem slots based on the state\n */ export const useNavCategoryItemStyles_unstable = (state)=>{\n 'use no memo';\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 const { selected, open, density } = state;\n state.root.className = mergeClasses(navCategoryItemClassNames.root, defaultRootClassName, rootStyles.base, density === 'small' && smallStyles.root, selected && open === false && indicatorStyles.base, selected && open === false && contentStyles.selected, state.root.className);\n state.expandIcon.className = mergeClasses(navCategoryItemClassNames.expandIcon, expandIconStyles.base, state.expandIcon.className);\n if (state.icon) {\n state.icon.className = mergeClasses(navCategoryItemClassNames.icon, iconStyles.base, selected && iconStyles.selected, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,uBAAuB,EAAEC,cAAc,QAAQ,2BAA2B;AACxI,OAAO,MAAMC,yBAAyB,GAAG;EACrCC,IAAI,EAAE,qBAAqB;EAC3BC,IAAI,EAAE,2BAA2B;EACjCC,UAAU,EAAE,iCAAiC;EAC7CC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,mBAAmB,gBAAGb,QAAA;EAAAc,IAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAM3B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,aAAa,gBAAGvB,QAAA;EAAAc,IAAA;IAAAU,MAAA;EAAA;AAAA;EAAAF,CAAA;AAAA,CAIhC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMG,iCAAiC,GAAIC,KAAK,IAAG;EAC1D,aAAa;;EACb,MAAMC,UAAU,GAAGJ,aAAa,CAAC,CAAC;EAClC,MAAMK,WAAW,GAAGrB,cAAc,CAAC,CAAC;EACpC,MAAMsB,oBAAoB,GAAGvB,uBAAuB,CAAC,CAAC;EACtD,MAAMwB,aAAa,GAAG3B,gBAAgB,CAAC,CAAC;EACxC,MAAM4B,eAAe,GAAG1B,kBAAkB,CAAC,CAAC;EAC5C,MAAM2B,UAAU,GAAG5B,aAAa,CAAC,CAAC;EAClC,MAAM6B,gBAAgB,GAAGpB,mBAAmB,CAAC,CAAC;EAC9C,MAAM;IAAEI,QAAQ;IAAEiB,IAAI;IAAEC;EAAQ,CAAC,GAAGT,KAAK;EACzCA,KAAK,CAACjB,IAAI,CAAC2B,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACC,IAAI,EAAEoB,oBAAoB,EAAEF,UAAU,CAACb,IAAI,EAAEqB,OAAO,KAAK,OAAO,IAAIP,WAAW,CAACnB,IAAI,EAAEQ,QAAQ,IAAIiB,IAAI,KAAK,KAAK,IAAIH,eAAe,CAACjB,IAAI,EAAEG,QAAQ,IAAIiB,IAAI,KAAK,KAAK,IAAIJ,aAAa,CAACb,QAAQ,EAAES,KAAK,CAACjB,IAAI,CAAC2B,SAAS,CAAC;EACnRV,KAAK,CAACf,UAAU,CAACyB,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACG,UAAU,EAAEsB,gBAAgB,CAACnB,IAAI,EAAEY,KAAK,CAACf,UAAU,CAACyB,SAAS,CAAC;EAClI,IAAIV,KAAK,CAAChB,IAAI,EAAE;IACZgB,KAAK,CAAChB,IAAI,CAAC0B,SAAS,GAAGnC,YAAY,CAACO,yBAAyB,CAACE,IAAI,EAAEsB,UAAU,CAAClB,IAAI,EAAEG,QAAQ,IAAIe,UAAU,CAACf,QAAQ,EAAES,KAAK,CAAChB,IAAI,CAAC0B,SAAS,CAAC;EAC/I;EACA,OAAOV,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,43 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { typographyStyles } from '@fluentui/react-theme';
import { useContentStyles, useIconStyles, useIndicatorStyles, useRootDefaultClassName, useSmallStyles } from '../sharedNavStyles.styles';
export const navCategoryItemClassNames = {
root: 'fui-NavCategoryItem',
icon: 'fui-NavCategoryItem__icon',
expandIcon: 'fui-NavCategoryItem__expandIcon',
expandIconMotion: 'fui-NavCategoryItem__expandIconMotion'
};
const useExpandIconStyles = makeStyles({
base: {
marginInlineStart: 'auto',
height: '20px'
},
selected: typographyStyles.body1Strong
});
/**
* Styles for the root slot
*/ export const useRootStyles = makeStyles({
base: {
width: '100%'
}
});
/**
* Apply styling to the NavCategoryItem slots based on the state
*/ export const useNavCategoryItemStyles_unstable = (state)=>{
'use no memo';
const rootStyles = useRootStyles();
const smallStyles = useSmallStyles();
const defaultRootClassName = useRootDefaultClassName();
const contentStyles = useContentStyles();
const indicatorStyles = useIndicatorStyles();
const iconStyles = useIconStyles();
const expandIconStyles = useExpandIconStyles();
const { selected, open, density } = state;
state.root.className = mergeClasses(navCategoryItemClassNames.root, defaultRootClassName, rootStyles.base, density === 'small' && smallStyles.root, selected && open === false && indicatorStyles.base, selected && open === false && contentStyles.selected, state.root.className);
state.expandIcon.className = mergeClasses(navCategoryItemClassNames.expandIcon, expandIconStyles.base, state.expandIcon.className);
if (state.icon) {
state.icon.className = mergeClasses(navCategoryItemClassNames.icon, iconStyles.base, selected && iconStyles.selected, state.icon.className);
}
return state;
};

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,11 @@
'use client';
import * as React from 'react';
const NavCategoryItemContext = React.createContext(undefined);
const NavCategoryItemContextDefaultValues = {
open: false
};
export const { Provider: NavCategoryItemProvider } = NavCategoryItemContext;
export const useNavCategoryItemContext_unstable = ()=>{
var _React_useContext;
return (_React_useContext = React.useContext(NavCategoryItemContext)) !== null && _React_useContext !== void 0 ? _React_useContext : NavCategoryItemContextDefaultValues;
};

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1,34 @@
'use client';
import * as React from 'react';
const navContextDefaultValue = {
selectedValue: undefined,
selectedCategoryValue: undefined,
onRegister: ()=>{
/* noop */ },
onUnregister: ()=>{
/* noop */ },
onSelect: ()=>{
/* noop */ },
getRegisteredNavItems: ()=>{
return {
registeredNavItems: {}
};
},
onRequestNavCategoryItemToggle () {
/* noop */ },
/**
* The list of opened panels by index
*/ openCategories: [],
/**
* Indicates if Nav supports multiple open Categories at the same time.
*/ multiple: true,
/**
* Indicates the vertical density and density of the Nav.
*/ density: 'medium',
/**
* By default, the Nav is a single tab stop with only arrow key navigation
*/ tabbable: false
};
const NavContext = React.createContext(undefined);
export const NavProvider = NavContext.Provider;
export const useNavContext_unstable = ()=>React.useContext(NavContext) || navContextDefaultValue;

View File

@@ -0,0 +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"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +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":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { renderDivider_unstable } from '@fluentui/react-divider';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useNavDivider_unstable } from './useNavDivider';
import { useNavDividerStyles_unstable } from './useNavDividerStyles.styles';
/**
* NavDivider component - a divider used within navigation components to separate items.
*/ export const NavDivider = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useNavDivider_unstable(props, ref);
useNavDividerStyles_unstable(state);
useCustomStyleHook_unstable('useNavDividerStyles_unstable')(state);
return renderDivider_unstable(state);
});
NavDivider.displayName = 'NavDivider';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavDivider/NavDivider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { renderDivider_unstable } from '@fluentui/react-divider';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useNavDivider_unstable } from './useNavDivider';\nimport { useNavDividerStyles_unstable } from './useNavDividerStyles.styles';\nimport type { NavDividerProps } from './NavDivider.types';\n\n/**\n * NavDivider component - a divider used within navigation components to separate items.\n */\nexport const NavDivider: ForwardRefComponent<NavDividerProps> = React.forwardRef((props, ref) => {\n const state = useNavDivider_unstable(props, ref);\n\n useNavDividerStyles_unstable(state);\n useCustomStyleHook_unstable('useNavDividerStyles_unstable')(state);\n\n return renderDivider_unstable(state);\n});\n\nNavDivider.displayName = 'NavDivider';\n"],"names":["React","renderDivider_unstable","useCustomStyleHook_unstable","useNavDivider_unstable","useNavDividerStyles_unstable","NavDivider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,4BAA4B,QAAQ,+BAA+B;AAG5E;;CAEC,GACD,OAAO,MAAMC,2BAAmDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQN,uBAAuBI,OAAOC;IAE5CJ,6BAA6BK;IAC7BP,4BAA4B,gCAAgCO;IAE5D,OAAOR,uBAAuBQ;AAChC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering NavDivider
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavDivider/NavDivider.types.ts"],"sourcesContent":["import type { DividerProps, DividerState } from '@fluentui/react-divider';\n\n/**\n * NavDivider Props\n */\nexport type NavDividerProps = DividerProps;\n\n/**\n * State used in rendering NavDivider\n */\nexport type NavDividerState = DividerState;\n"],"names":[],"mappings":"AAOA;;CAEC,GACD,WAA2C"}

View File

@@ -0,0 +1,3 @@
export { NavDivider } from './NavDivider';
export { useNavDivider_unstable } from './useNavDivider';
export { navDividerClassNames, useNavDividerStyles_unstable } from './useNavDividerStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavDivider/index.ts"],"sourcesContent":["export { NavDivider } from './NavDivider';\nexport type { NavDividerProps, NavDividerState } from './NavDivider.types';\nexport { useNavDivider_unstable } from './useNavDivider';\nexport { navDividerClassNames, useNavDividerStyles_unstable } from './useNavDividerStyles.styles';\n"],"names":["NavDivider","useNavDivider_unstable","navDividerClassNames","useNavDividerStyles_unstable"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAE1C,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,oBAAoB,EAAEC,4BAA4B,QAAQ,+BAA+B"}

View File

@@ -0,0 +1,17 @@
'use client';
import * as React from 'react';
import { useDivider_unstable } from '@fluentui/react-divider';
/**
* Create the state required to render NavDivider.
*
* The returned state can be modified with hooks such as useNavDividerStyles_unstable,
* before being passed to renderNavDivider_unstable.
*
* @param props - props from this instance of NavDivider
* @param ref - reference to root HTMLDivElement of NavDivider
*/ export const useNavDivider_unstable = (props, ref)=>{
return useDivider_unstable({
appearance: 'strong',
...props
}, ref);
};

View File

@@ -0,0 +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":["React","useDivider_unstable","useNavDivider_unstable","props","ref","appearance"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,OAAOH,oBAAoB;QAAEI,YAAY;QAAU,GAAGF,KAAK;IAAC,GAAGC;AACjE,EAAE"}

View File

@@ -0,0 +1,29 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { useDividerStyles_unstable } from '@fluentui/react-divider';
export const navDividerClassNames = {
root: 'fui-NavDivider',
wrapper: 'fui-NavDivider__wrapper'
};
const useStyles = /*#__PURE__*/__styles({
root: {
Bh6795r: "f1jhi6b8",
B6of3ja: "fvjh0tl",
jrapky: "fd1gkq"
}
}, {
d: [".f1jhi6b8{flex-grow:0;}", ".fvjh0tl{margin-top:4px;}", ".fd1gkq{margin-bottom:4px;}"]
});
/**
* Apply styling to the NavDivider slots based on the state
*/
export const useNavDividerStyles_unstable = state => {
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(navDividerClassNames.root, styles.root, state.root.className);
state.wrapper.className = mergeClasses(navDividerClassNames.wrapper, state.wrapper.className);
useDividerStyles_unstable(state);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","useDividerStyles_unstable","navDividerClassNames","root","wrapper","useStyles","Bh6795r","B6of3ja","jrapky","d","useNavDividerStyles_unstable","state","styles","className"],"sources":["useNavDividerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useDividerStyles_unstable } from '@fluentui/react-divider';\nexport const navDividerClassNames = {\n root: 'fui-NavDivider',\n wrapper: 'fui-NavDivider__wrapper'\n};\nconst useStyles = makeStyles({\n root: {\n flexGrow: 0,\n marginTop: '4px',\n marginBottom: '4px'\n }\n});\n/**\n * Apply styling to the NavDivider slots based on the state\n */ export const useNavDividerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(navDividerClassNames.root, styles.root, state.root.className);\n state.wrapper.className = mergeClasses(navDividerClassNames.wrapper, state.wrapper.className);\n useDividerStyles_unstable(state);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,gBAAgB;EACtBC,OAAO,EAAE;AACb,CAAC;AACD,MAAMC,SAAS,gBAAGN,QAAA;EAAAI,IAAA;IAAAG,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAMjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,4BAA4B,GAAIC,KAAK,IAAG;EACrD,aAAa;;EACb,MAAMC,MAAM,GAAGP,SAAS,CAAC,CAAC;EAC1BM,KAAK,CAACR,IAAI,CAACU,SAAS,GAAGb,YAAY,CAACE,oBAAoB,CAACC,IAAI,EAAES,MAAM,CAACT,IAAI,EAAEQ,KAAK,CAACR,IAAI,CAACU,SAAS,CAAC;EACjGF,KAAK,CAACP,OAAO,CAACS,SAAS,GAAGb,YAAY,CAACE,oBAAoB,CAACE,OAAO,EAAEO,KAAK,CAACP,OAAO,CAACS,SAAS,CAAC;EAC7FZ,yBAAyB,CAACU,KAAK,CAAC;EAChC,OAAOA,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,24 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { useDividerStyles_unstable } from '@fluentui/react-divider';
export const navDividerClassNames = {
root: 'fui-NavDivider',
wrapper: 'fui-NavDivider__wrapper'
};
const useStyles = makeStyles({
root: {
flexGrow: 0,
marginTop: '4px',
marginBottom: '4px'
}
});
/**
* Apply styling to the NavDivider slots based on the state
*/ export const useNavDividerStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(navDividerClassNames.root, styles.root, state.root.className);
state.wrapper.className = mergeClasses(navDividerClassNames.wrapper, state.wrapper.className);
useDividerStyles_unstable(state);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/NavDivider/useNavDividerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useDividerStyles_unstable, type DividerSlots } from '@fluentui/react-divider';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { NavDividerState } from './NavDivider.types';\n\nexport const navDividerClassNames: SlotClassNames<DividerSlots> = {\n root: 'fui-NavDivider',\n wrapper: 'fui-NavDivider__wrapper',\n};\n\nconst useStyles = makeStyles({\n root: {\n flexGrow: 0,\n marginTop: '4px',\n marginBottom: '4px',\n },\n});\n\n/**\n * Apply styling to the NavDivider slots based on the state\n */\nexport const useNavDividerStyles_unstable = (state: NavDividerState): NavDividerState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(navDividerClassNames.root, styles.root, state.root.className);\n state.wrapper.className = mergeClasses(navDividerClassNames.wrapper, state.wrapper.className);\n\n useDividerStyles_unstable(state);\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useDividerStyles_unstable","navDividerClassNames","root","wrapper","useStyles","flexGrow","marginTop","marginBottom","useNavDividerStyles_unstable","state","styles","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,yBAAyB,QAA2B,0BAA0B;AAIvF,OAAO,MAAMC,uBAAqD;IAChEC,MAAM;IACNC,SAAS;AACX,EAAE;AAEF,MAAMC,YAAYN,WAAW;IAC3BI,MAAM;QACJG,UAAU;QACVC,WAAW;QACXC,cAAc;IAChB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3C;IAEA,MAAMC,SAASN;IAEfK,MAAMP,IAAI,CAACS,SAAS,GAAGZ,aAAaE,qBAAqBC,IAAI,EAAEQ,OAAOR,IAAI,EAAEO,MAAMP,IAAI,CAACS,SAAS;IAChGF,MAAMN,OAAO,CAACQ,SAAS,GAAGZ,aAAaE,qBAAqBE,OAAO,EAAEM,MAAMN,OAAO,CAACQ,SAAS;IAE5FX,0BAA0BS;IAC1B,OAAOA;AACT,EAAE"}

View File

@@ -0,0 +1,17 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useNavDrawer_unstable } from './useNavDrawer';
import { renderNavDrawer_unstable } from './renderNavDrawer';
import { useNavDrawerStyles_unstable } from './useNavDrawerStyles.styles';
import { useNavContextValues_unstable } from '../useNavContextValues';
/**
* NavDrawer component - a component that provides a drawer for navigation items.
*/ export const NavDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useNavDrawer_unstable(props, ref);
const contextValues = useNavContextValues_unstable(state);
useNavDrawerStyles_unstable(state);
useCustomStyleHook_unstable('useNavDrawerStyles_unstable')(state);
return renderNavDrawer_unstable(state, contextValues);
});
NavDrawer.displayName = 'NavDrawer';

View File

@@ -0,0 +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"}

Some files were not shown because too many files have changed in this diff Show More