feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
Lago committed 2026-04-14 18:52:25 +00:00
1 parent 1199eff6c3
commit dfa4010406
34820 files changed
+1003810 -202

No files matched your search

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useSplitNavItem_unstable } from './useSplitNavItem';
import { renderSplitNavItem_unstable } from './renderSplitNavItem';
import { useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';
/**
* SplitNavItem component - TODO: add more docs
*/ export const SplitNavItem = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useSplitNavItem_unstable(props, ref);
useSplitNavItemStyles_unstable(state);
useCustomStyleHook_unstable('useSplitNavItemStyles_unstable')(state);
return renderSplitNavItem_unstable(state);
});
SplitNavItem.displayName = 'SplitNavItem';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/SplitNavItem.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 { useSplitNavItem_unstable } from './useSplitNavItem';\nimport { renderSplitNavItem_unstable } from './renderSplitNavItem';\nimport { useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';\nimport type { SplitNavItemProps } from './SplitNavItem.types';\n\n/**\n * SplitNavItem component - TODO: add more docs\n */\nexport const SplitNavItem: ForwardRefComponent<SplitNavItemProps> = React.forwardRef((props, ref) => {\n const state = useSplitNavItem_unstable(props, ref);\n\n useSplitNavItemStyles_unstable(state);\n useCustomStyleHook_unstable('useSplitNavItemStyles_unstable')(state);\n\n return renderSplitNavItem_unstable(state);\n});\n\nSplitNavItem.displayName = 'SplitNavItem';\n"],"names":["React","useCustomStyleHook_unstable","useSplitNavItem_unstable","renderSplitNavItem_unstable","useSplitNavItemStyles_unstable","SplitNavItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQP,yBAAyBK,OAAOC;IAE9CJ,+BAA+BK;IAC/BR,4BAA4B,kCAAkCQ;IAE9D,OAAON,4BAA4BM;AACrC,GAAG;AAEHJ,aAAaK,WAAW,GAAG"}
@@ -0,0 +1,3 @@
/**
* State used in rendering SplitNavItem
*/ export { };
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/SplitNavItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { NavItemProps } from '../NavItem/NavItem.types';\nimport { ButtonProps, MenuButtonProps, ToggleButtonProps } from '@fluentui/react-button';\nimport type { TooltipProps } from '@fluentui/react-tooltip';\nimport { NavDensity } from '../Nav/Nav.types';\nimport { NavSubItemProps } from '../NavSubItem/NavSubItem.types';\n\nexport type SplitNavItemSlots = {\n /**\n * Root of the component, wrapping the children.\n */\n root: Slot<'div'>;\n\n /**\n * The NavItem Slot.\n * Will behave as a SubNavItem if it's in an a SubGroup.\n */\n navItem?: NonNullable<Slot<NavItemProps & NavSubItemProps>>;\n\n /**\n * Basic button slot.\n */\n actionButton?: Slot<ButtonProps>;\n\n /**\n * Toggle button slot\n */\n toggleButton?: Slot<ToggleButtonProps>;\n\n /**\n * Menu button slot to stuff more things in when the other two aren't enough.\n */\n menuButton?: Slot<MenuButtonProps>;\n\n /**\n * Tooltip for the action button.\n */\n actionButtonTooltip?: Slot<TooltipProps>;\n\n /**\n * Tooltip for the toggle button.\n */\n toggleButtonTooltip?: Slot<TooltipProps>;\n\n /**\n * Tooltip for the menu button.\n */\n menuButtonTooltip?: Slot<TooltipProps>;\n};\n\n/**\n * SplitNavItem Props\n */\nexport type SplitNavItemProps = ComponentProps<SplitNavItemSlots>;\n\n/**\n * State used in rendering SplitNavItem\n */\nexport type SplitNavItemState = ComponentState<SplitNavItemSlots> & {\n /**\n * The density of the NavItem\n *\n * @default 'medium'\n */\n density: NavDensity;\n\n /**\n * A boolean that represents if the main item in the SplitNavItem is a SubNav item.\n * If false, it's a NavItem.\n */\n isSubNav: boolean;\n};\n"],"names":[],"mappings":"AAuDA;;CAEC,GACD,WAaE"}
@@ -0,0 +1,4 @@
export { SplitNavItem } from './SplitNavItem';
export { renderSplitNavItem_unstable } from './renderSplitNavItem';
export { useSplitNavItem_unstable } from './useSplitNavItem';
export { splitNavItemClassNames, useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/index.ts"],"sourcesContent":["export { SplitNavItem } from './SplitNavItem';\nexport type { SplitNavItemProps, SplitNavItemSlots, SplitNavItemState } from './SplitNavItem.types';\nexport { renderSplitNavItem_unstable } from './renderSplitNavItem';\nexport { useSplitNavItem_unstable } from './useSplitNavItem';\nexport { splitNavItemClassNames, useSplitNavItemStyles_unstable } from './useSplitNavItemStyles.styles';\n"],"names":["SplitNavItem","renderSplitNavItem_unstable","useSplitNavItem_unstable","splitNavItemClassNames","useSplitNavItemStyles_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,sBAAsB,EAAEC,8BAA8B,QAAQ,iCAAiC"}
@@ -0,0 +1,31 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import * as React from 'react';
import { assertSlots } from '@fluentui/react-utilities';
/**
* Helper function to render button slots
*
* @internal
*/ const renderButtonSlot = (Button, ButtonTooltip)=>{
if (!Button) {
return null;
}
if (ButtonTooltip) {
return /*#__PURE__*/ _jsx(ButtonTooltip, {
children: /*#__PURE__*/ _jsx(Button, {})
});
}
return /*#__PURE__*/ _jsx(Button, {});
};
/**
* Render the final JSX of SplitNavItem
*/ export const renderSplitNavItem_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.navItem && /*#__PURE__*/ _jsx(state.navItem, {}),
renderButtonSlot(state.actionButton, state.actionButtonTooltip),
renderButtonSlot(state.menuButton, state.menuButtonTooltip),
renderButtonSlot(state.toggleButton, state.toggleButtonTooltip)
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/renderSplitNavItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { SplitNavItemState, SplitNavItemSlots } from './SplitNavItem.types';\n\n/**\n * Helper function to render button slots\n *\n * @internal\n */\nconst renderButtonSlot = (Button?: React.ElementType, ButtonTooltip?: React.ElementType) => {\n if (!Button) {\n return null;\n }\n\n if (ButtonTooltip) {\n return (\n <ButtonTooltip>\n <Button />\n </ButtonTooltip>\n );\n }\n\n return <Button />;\n};\n\n/**\n * Render the final JSX of SplitNavItem\n */\nexport const renderSplitNavItem_unstable = (state: SplitNavItemState): JSXElement => {\n assertSlots<SplitNavItemSlots>(state);\n\n return (\n <state.root>\n {state.navItem && <state.navItem />}\n {renderButtonSlot(state.actionButton, state.actionButtonTooltip)}\n {renderButtonSlot(state.menuButton, state.menuButtonTooltip)}\n {renderButtonSlot(state.toggleButton, state.toggleButtonTooltip)}\n </state.root>\n );\n};\n"],"names":["React","assertSlots","renderButtonSlot","Button","ButtonTooltip","renderSplitNavItem_unstable","state","root","navItem","actionButton","actionButtonTooltip","menuButton","menuButtonTooltip","toggleButton","toggleButtonTooltip"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,QAAQ,4BAA4B;AAKxD;;;;CAIC,GACD,MAAMC,mBAAmB,CAACC,QAA4BC;IACpD,IAAI,CAACD,QAAQ;QACX,OAAO;IACT;IAEA,IAAIC,eAAe;QACjB,qBACE,KAACA;sBACC,cAAA,KAACD;;IAGP;IAEA,qBAAO,KAACA;AACV;AAEA;;CAEC,GACD,OAAO,MAAME,8BAA8B,CAACC;IAC1CL,YAA+BK;IAE/B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,OAAO,kBAAI,KAACF,MAAME,OAAO;YAC/BN,iBAAiBI,MAAMG,YAAY,EAAEH,MAAMI,mBAAmB;YAC9DR,iBAAiBI,MAAMK,UAAU,EAAEL,MAAMM,iBAAiB;YAC1DV,iBAAiBI,MAAMO,YAAY,EAAEP,MAAMQ,mBAAmB;;;AAGrE,EAAE"}
@@ -0,0 +1,102 @@
'use client';
import * as React from 'react';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { Tooltip } from '@fluentui/react-tooltip';
import { useNavContext_unstable } from '../NavContext';
import { Button, MenuButton, ToggleButton } from '@fluentui/react-button';
import { MoreHorizontalFilled, Pin20Regular } from '@fluentui/react-icons';
import { NavItem } from '../NavItem/index';
import { NavSubItem } from '../NavSubItem/NavSubItem';
import { useNavCategoryContext_unstable } from '../NavCategoryContext';
/**
* Create the state required to render SplitNavItem.
*
* The returned state can be modified with hooks such as useSplitNavItemStyles_unstable,
* before being passed to renderSplitNavItem_unstable.
*
* @param props - props from this instance of SplitNavItem
* @param ref - reference to root HTMLDivElement of SplitNavItem
*/ export const useSplitNavItem_unstable = (props, ref)=>{
const { navItem, actionButton, toggleButton, menuButton, actionButtonTooltip, toggleButtonTooltip, menuButtonTooltip, children } = props;
const { density = 'medium' } = useNavContext_unstable();
const { value: potentialParenValue } = useNavCategoryContext_unstable();
const isSubNav = potentialParenValue.length > 0 ? true : false;
const navItemShorthand = slot.always(navItem, {
defaultProps: {
children
},
elementType: isSubNav ? NavSubItem : NavItem
});
const actionButtonShorthand = slot.optional(actionButton, {
defaultProps: {
icon: /*#__PURE__*/ React.createElement(Pin20Regular, null),
size: 'small',
appearance: 'transparent'
},
elementType: Button
});
const toggleButtonShorthand = slot.optional(toggleButton, {
defaultProps: {
icon: /*#__PURE__*/ React.createElement(Pin20Regular, null),
size: 'small',
appearance: 'transparent'
},
elementType: ToggleButton
});
const menuButtonShorthand = slot.optional(menuButton, {
defaultProps: {
icon: /*#__PURE__*/ React.createElement(MoreHorizontalFilled, null),
size: 'small',
appearance: 'transparent'
},
elementType: MenuButton
});
const actionButtonTooltipShorthand = slot.optional(actionButtonTooltip, {
defaultProps: {
relationship: 'label'
},
elementType: Tooltip
});
const toggleButtonTooltipShorthand = slot.optional(toggleButtonTooltip, {
defaultProps: {
relationship: 'label'
},
elementType: Tooltip
});
const menuButtonTooltipShorthand = slot.optional(menuButtonTooltip, {
defaultProps: {
relationship: 'label'
},
elementType: Tooltip
});
return {
components: {
root: 'div',
navItem: isSubNav ? NavSubItem : NavItem,
actionButton: Button,
toggleButton: ToggleButton,
menuButton: MenuButton,
actionButtonTooltip: Tooltip,
toggleButtonTooltip: Tooltip,
menuButtonTooltip: Tooltip
},
root: slot.always(getIntrinsicElementProps('div', {
ref,
...props,
// because we're passing in children to the NavItem,
// We can be explicit about the children prop here
children: null
}), {
elementType: 'div'
}),
navItem: navItemShorthand,
actionButton: actionButtonShorthand,
toggleButton: toggleButtonShorthand,
menuButton: menuButtonShorthand,
actionButtonTooltip: actionButtonTooltipShorthand,
toggleButtonTooltip: toggleButtonTooltipShorthand,
menuButtonTooltip: menuButtonTooltipShorthand,
density,
isSubNav
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/useSplitNavItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { Tooltip } from '@fluentui/react-tooltip';\nimport type { SplitNavItemProps, SplitNavItemState } from './SplitNavItem.types';\nimport { useNavContext_unstable } from '../NavContext';\nimport { Button, MenuButton, ToggleButton } from '@fluentui/react-button';\nimport { MoreHorizontalFilled, Pin20Regular } from '@fluentui/react-icons';\nimport { NavItem } from '../NavItem/index';\nimport { NavSubItem } from '../NavSubItem/NavSubItem';\nimport { useNavCategoryContext_unstable } from '../NavCategoryContext';\n\n/**\n * Create the state required to render SplitNavItem.\n *\n * The returned state can be modified with hooks such as useSplitNavItemStyles_unstable,\n * before being passed to renderSplitNavItem_unstable.\n *\n * @param props - props from this instance of SplitNavItem\n * @param ref - reference to root HTMLDivElement of SplitNavItem\n */\nexport const useSplitNavItem_unstable = (\n props: SplitNavItemProps,\n ref: React.Ref<HTMLDivElement>,\n): SplitNavItemState => {\n const {\n navItem,\n actionButton,\n toggleButton,\n menuButton,\n actionButtonTooltip,\n toggleButtonTooltip,\n menuButtonTooltip,\n children,\n } = props;\n\n const { density = 'medium' } = useNavContext_unstable();\n\n const { value: potentialParenValue } = useNavCategoryContext_unstable();\n\n const isSubNav = potentialParenValue.length > 0 ? true : false;\n\n const navItemShorthand = slot.always(navItem, {\n defaultProps: {\n children,\n },\n elementType: isSubNav ? NavSubItem : NavItem,\n });\n\n const actionButtonShorthand = slot.optional(actionButton, {\n defaultProps: {\n icon: <Pin20Regular />,\n size: 'small',\n appearance: 'transparent',\n },\n elementType: Button,\n });\n\n const toggleButtonShorthand = slot.optional(toggleButton, {\n defaultProps: {\n icon: <Pin20Regular />,\n size: 'small',\n appearance: 'transparent',\n },\n elementType: ToggleButton,\n });\n\n const menuButtonShorthand = slot.optional(menuButton, {\n defaultProps: {\n icon: <MoreHorizontalFilled />,\n size: 'small',\n appearance: 'transparent',\n },\n elementType: MenuButton,\n });\n\n const actionButtonTooltipShorthand = slot.optional(actionButtonTooltip, {\n defaultProps: { relationship: 'label' },\n elementType: Tooltip,\n });\n\n const toggleButtonTooltipShorthand = slot.optional(toggleButtonTooltip, {\n defaultProps: { relationship: 'label' },\n elementType: Tooltip,\n });\n\n const menuButtonTooltipShorthand = slot.optional(menuButtonTooltip, {\n defaultProps: { relationship: 'label' },\n elementType: Tooltip,\n });\n\n return {\n components: {\n root: 'div',\n navItem: isSubNav ? NavSubItem : NavItem,\n actionButton: Button,\n toggleButton: ToggleButton,\n menuButton: MenuButton,\n actionButtonTooltip: Tooltip,\n toggleButtonTooltip: Tooltip,\n menuButtonTooltip: Tooltip,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n // because we're passing in children to the NavItem,\n // We can be explicit about the children prop here\n children: null,\n }),\n { elementType: 'div' },\n ),\n navItem: navItemShorthand,\n actionButton: actionButtonShorthand,\n toggleButton: toggleButtonShorthand,\n menuButton: menuButtonShorthand,\n actionButtonTooltip: actionButtonTooltipShorthand,\n toggleButtonTooltip: toggleButtonTooltipShorthand,\n menuButtonTooltip: menuButtonTooltipShorthand,\n density,\n isSubNav,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","Tooltip","useNavContext_unstable","Button","MenuButton","ToggleButton","MoreHorizontalFilled","Pin20Regular","NavItem","NavSubItem","useNavCategoryContext_unstable","useSplitNavItem_unstable","props","ref","navItem","actionButton","toggleButton","menuButton","actionButtonTooltip","toggleButtonTooltip","menuButtonTooltip","children","density","value","potentialParenValue","isSubNav","length","navItemShorthand","always","defaultProps","elementType","actionButtonShorthand","optional","icon","size","appearance","toggleButtonShorthand","menuButtonShorthand","actionButtonTooltipShorthand","relationship","toggleButtonTooltipShorthand","menuButtonTooltipShorthand","components","root"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,OAAO,QAAQ,0BAA0B;AAElD,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,MAAM,EAAEC,UAAU,EAAEC,YAAY,QAAQ,yBAAyB;AAC1E,SAASC,oBAAoB,EAAEC,YAAY,QAAQ,wBAAwB;AAC3E,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SAASC,8BAA8B,QAAQ,wBAAwB;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC;IAEA,MAAM,EACLine truncated
@@ -0,0 +1,135 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
import { motionTokens } from '@fluentui/react-motion';
import { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const splitNavItemClassNames = {
root: 'fui-SplitNavItem',
navItem: 'fui-SplitNavItem__navItem',
actionButton: 'fui-SplitNavItem__actionButton',
toggleButton: 'fui-SplitNavItem__toggleButton',
menuButton: 'fui-SplitNavItem__menuButton',
/**
* Tooltips don't have a class name prop, so this is just to satisfy the linter.
*/
actionButtonTooltip: 'fui-SplitNavItem__actionButtonTooltip',
toggleButtonTooltip: 'fui-SplitNavItem__toggleButtonTooltip',
menuButtonTooltip: 'fui-SplitNavItem__menuButtonTooltip'
};
// Don't use makeResetStyles here because the sub components call it once and
// This links says that makeResetStyles should only be called once per element
// https://griffel.js.org/react/api/make-reset-styles/#limitations
const {
actionButton,
toggleButton,
menuButton
} = splitNavItemClassNames;
const buttonHoverStyles = {
[`& .${actionButton}, & .${toggleButton}, & .${menuButton}`]: {
opacity: 1,
pointerEvents: 'auto'
}
};
/**
* Styles for the root slot
*/
const useSplitNaveItemStyles = /*#__PURE__*/__styles({
baseRoot: {
mc9l5x: "f22iagw",
i8kkvl: 0,
Belr9w4: 0,
rmohyg: "fx80lhs",
Bt984gj: "f1q9h2pe",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f19jm9xf",
fsow6f: "fgusgyc",
De3pzq: "f1ctqxl6",
B3o57yi: "fnsygzv",
Bkqvd7p: "f1e9ux7i",
Bmy1vo4: "f1xfaukr",
Jwef8y: "f11oyicx",
xwko9w: "f8z0t4e",
mcc9px: "f9ueil3",
B02v5zz: "f1g2hb8n",
i4x37a: "fpq6je",
ecr2s2: "f9fof1w"
},
baseNavItem: {
mc9l5x: "f22iagw",
B9bfxx9: "f1cxpek8",
qb2dma: "f1ub7u0d",
fsow6f: ["f1o700av", "fes3tcz"],
qhf8xq: "f10pi13n",
Brf1p80: "f1s9ku6b",
i8kkvl: 0,
Belr9w4: 0,
rmohyg: "f1u2hskj",
De3pzq: "f3rmtva"
},
baseSecondary: {
Bf4jedk: "f107v6xj",
Bnt446c: "f1y335lp",
B1hrpyx: "f12pses1",
rjzwhg: "fibmr9j",
Bt984gj: "f1s2louj"
},
baseMedium: {
rjzwhg: "fjtod8q"
},
baseLarge: {
rjzwhg: "f16gijt3"
},
hoverAction: {
abs64n: "fk73vx1",
Bkecrkj: "f1aehjj5",
Bn62ygk: 0,
Cwk7ip: 0,
B3o57yi: 0,
Bmy1vo4: 0,
Bkqvd7p: 0,
Bi2q7bf: ["fr12795", "fcl876f"],
Es3by: "f1gqqdtu"
}
}, {
d: [".f22iagw{display:flex;}", [".fx80lhs{gap:unset;}", {
p: -1
}], ".f1q9h2pe{align-items:stretch;}", [".f19jm9xf{padding:unset;}", {
p: -1
}], ".fgusgyc{text-align:unset;}", ".f1ctqxl6{background-color:var(--colorNeutralBackground4);}", ".fnsygzv{transition-duration:var(--durationFaster);}", ".f1e9ux7i{transition-timing-function:var(--curveLinear);}", ".f1xfaukr{transition-property:background;}", ".f1cxpek8{text-transform:none;}", ".f1ub7u0d{align-self:stretch;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f10pi13n{position:relative;}", ".f1s9ku6b{justify-content:start;}", [".f1u2hskj{gap:var(--spacingVerticalL);}", {
p: -1
}], ".f3rmtva{background-color:transparent;}", ".f107v6xj{min-width:28px;}", ".f1y335lp{-webkit-padding-end:12px;padding-inline-end:12px;}", ".f12pses1{-webkit-padding-start:5px;padding-inline-start:5px;}", ".fibmr9j{padding-block-start:5px;}", ".f1s2louj{align-items:start;}", ".fjtod8q{padding-block-start:9px;}", ".f16gijt3{padding-block-start:12px;}", ".fk73vx1{opacity:0;}", ".f1aehjj5{pointer-events:none;}", [".fr12795{transition:opacity 150ms cubic-bezier(0.33,0,0.67,1);}", {
p: -1
}], [".fcl876f{transition:opacity 150ms cubic-bezier(0.33, 0, 0.67, 1);}", {
p: -1
}], ".f1gqqdtu{will-change:opacity;}"],
h: [".f11oyicx:hover{background-color:var(--colorNeutralBackground4Hover);}", ".f8z0t4e:hover .fui-SplitNavItem__actionButton,.f8z0t4e:hover .fui-SplitNavItem__toggleButton,.f8z0t4e:hover .fui-SplitNavItem__menuButton{opacity:1;}", ".f9ueil3:hover .fui-SplitNavItem__actionButton,.f9ueil3:hover .fui-SplitNavItem__toggleButton,.f9ueil3:hover .fui-SplitNavItem__menuButton{pointer-events:auto;}"],
w: [".f1g2hb8n:focus-within .fui-SplitNavItem__actionButton,.f1g2hb8n:focus-within .fui-SplitNavItem__toggleButton,.f1g2hb8n:focus-within .fui-SplitNavItem__menuButton{opacity:1;}", ".fpq6je:focus-within .fui-SplitNavItem__actionButton,.fpq6je:focus-within .fui-SplitNavItem__toggleButton,.fpq6je:focus-within .fui-SplitNavItem__menuButton{pointer-events:auto;}"],
a: [".f9fof1w:active{background-color:var(--colorNeutralBackground4Pressed);}"]
});
/**
* Apply styling to the SplitNavItem slots based on the state
*/
export const useSplitNavItemStyles_unstable = state => {
'use no memo';
const splitNavItemStyles = useSplitNaveItemStyles();
const sharedRootClassNames = useRootDefaultClassName();
state.root.className = mergeClasses(splitNavItemClassNames.root, sharedRootClassNames, splitNavItemStyles.baseRoot, state.root.className);
if (state.navItem) {
state.navItem.className = mergeClasses(splitNavItemClassNames.navItem, splitNavItemStyles.baseNavItem, state.navItem.className);
}
if (state.actionButton) {
state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.actionButton.className);
}
if (state.toggleButton) {
state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.toggleButton.className);
}
if (state.menuButton) {
state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.menuButton.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","tokens","motionTokens","navItemTokens","useRootDefaultClassName","splitNavItemClassNames","root","navItem","actionButton","toggleButton","menuButton","actionButtonTooltip","toggleButtonTooltip","menuButtonTooltip","buttonHoverStyles","opacity","pointerEvents","useSplitNaveItemStyles","baseRoot","mc9l5x","i8kkvl","Belr9w4","rmohyg","Bt984gj","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","fsow6f","De3pzq","B3o57yi","Bkqvd7p","Bmy1vo4","Jwef8y","xwko9w","mcc9px","B02v5zz","i4x37a","ecr2s2","baseNavItem","B9bfxx9","qb2dma","qhf8xq","Brf1p80","baseSecondary","Bf4jedk","Bnt446c","B1hrpyx","rjzwhg","baseMedium","baseLarge","hoverAction","abs64n","Bkecrkj","Bn62ygk","Cwk7ip","Bi2q7bf","Es3by","d","p","h","w","a","useSplitNavItemStyles_unstable","state","splitNavItemStyles","sharedRootClassNames","className","density"],"sources":["useSplitNavItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { motionTokens } from '@fluentui/react-motion';\nimport { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';\nexport const splitNavItemClassNames = {\n root: 'fui-SplitNavItem',\n navItem: 'fui-SplitNavItem__navItem',\n actionButton: 'fui-SplitNavItem__actionButton',\n toggleButton: 'fui-SplitNavItem__toggleButton',\n menuButton: 'fui-SplitNavItem__menuButton',\n /**\n * Tooltips don't have a class name prop, so this is just to satisfy the linter.\n */ actionButtonTooltip: 'fui-SplitNavItem__actionButtonTooltip',\n toggleButtonTooltip: 'fui-SplitNavItem__toggleButtonTooltip',\n menuButtonTooltip: 'fui-SplitNavItem__menuButtonTooltip'\n};\n// Don't use makeResetStyles here because the sub components call it once and\n// This links says that makeResetStyles should only be called once per element\n// https://griffel.js.org/react/api/make-reset-styles/#limitations\nconst { actionButton, toggleButton, menuButton } = splitNavItemClassNames;\nconst buttonHoverStyles = {\n [`& .${actionButton}, & .${toggleButton}, & .${menuButton}`]: {\n opacity: 1,\n pointerEvents: 'auto'\n }\n};\n/**\n * Styles for the root slot\n */ const useSplitNaveItemStyles = makeStyles({\n baseRoot: {\n display: 'flex',\n gap: 'unset',\n alignItems: 'stretch',\n padding: 'unset',\n textAlign: 'unset',\n backgroundColor: navItemTokens.backgroundColor,\n ...navItemTokens.transitionTokens,\n ':hover': {\n backgroundColor: navItemTokens.backgroundColorHover,\n ...buttonHoverStyles\n },\n ':focus-within': buttonHoverStyles,\n ':active': {\n backgroundColor: navItemTokens.backgroundColorPressed\n }\n },\n baseNavItem: {\n // styles that we want to disagree with the default on\n display: 'flex',\n textTransform: 'none',\n alignSelf: 'stretch',\n textAlign: 'left',\n position: 'relative',\n justifyContent: 'start',\n gap: tokens.spacingVerticalL,\n backgroundColor: 'transparent'\n },\n baseSecondary: {\n minWidth: '28px',\n paddingInlineEnd: '12px',\n paddingInlineStart: '5px',\n paddingBlockStart: '5px',\n alignItems: 'start'\n },\n baseMedium: {\n paddingBlockStart: '9px'\n },\n baseLarge: {\n paddingBlockStart: '12px'\n },\n hoverAction: {\n opacity: 0,\n pointerEvents: 'none',\n transition: `opacity ${motionTokens.durationFast}ms ${motionTokens.curveEasyEase}`,\n willChange: 'opacity'\n }\n});\n/**\n * Apply styling to the SplitNavItem slots based on the state\n */ export const useSplitNavItemStyles_unstable = (state)=>{\n 'use no memo';\n const splitNavItemStyles = useSplitNaveItemStyles();\n const sharedRootClassNames = useRootDefaultClassName();\n state.root.className = mergeClasses(splitNavItemClassNames.root, sharedRootClassNames, splitNavItemStyles.baseRoot, state.root.className);\n if (state.navItem) {\n state.navItem.className = mergeClasses(splitNavItemClassNames.navItem, splitNavItemStyles.baseNavItem, state.navItem.className);\n }\n if (state.actionButton) {\n state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.actionButton.className);\n }\n if (state.toggleButton) {\n state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.toggleButton.className);\n }\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButtonLine truncated
@@ -0,0 +1,99 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
import { motionTokens } from '@fluentui/react-motion';
import { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';
export const splitNavItemClassNames = {
root: 'fui-SplitNavItem',
navItem: 'fui-SplitNavItem__navItem',
actionButton: 'fui-SplitNavItem__actionButton',
toggleButton: 'fui-SplitNavItem__toggleButton',
menuButton: 'fui-SplitNavItem__menuButton',
/**
* Tooltips don't have a class name prop, so this is just to satisfy the linter.
*/ actionButtonTooltip: 'fui-SplitNavItem__actionButtonTooltip',
toggleButtonTooltip: 'fui-SplitNavItem__toggleButtonTooltip',
menuButtonTooltip: 'fui-SplitNavItem__menuButtonTooltip'
};
// Don't use makeResetStyles here because the sub components call it once and
// This links says that makeResetStyles should only be called once per element
// https://griffel.js.org/react/api/make-reset-styles/#limitations
const { actionButton, toggleButton, menuButton } = splitNavItemClassNames;
const buttonHoverStyles = {
[`& .${actionButton}, & .${toggleButton}, & .${menuButton}`]: {
opacity: 1,
pointerEvents: 'auto'
}
};
/**
* Styles for the root slot
*/ const useSplitNaveItemStyles = makeStyles({
baseRoot: {
display: 'flex',
gap: 'unset',
alignItems: 'stretch',
padding: 'unset',
textAlign: 'unset',
backgroundColor: navItemTokens.backgroundColor,
...navItemTokens.transitionTokens,
':hover': {
backgroundColor: navItemTokens.backgroundColorHover,
...buttonHoverStyles
},
':focus-within': buttonHoverStyles,
':active': {
backgroundColor: navItemTokens.backgroundColorPressed
}
},
baseNavItem: {
// styles that we want to disagree with the default on
display: 'flex',
textTransform: 'none',
alignSelf: 'stretch',
textAlign: 'left',
position: 'relative',
justifyContent: 'start',
gap: tokens.spacingVerticalL,
backgroundColor: 'transparent'
},
baseSecondary: {
minWidth: '28px',
paddingInlineEnd: '12px',
paddingInlineStart: '5px',
paddingBlockStart: '5px',
alignItems: 'start'
},
baseMedium: {
paddingBlockStart: '9px'
},
baseLarge: {
paddingBlockStart: '12px'
},
hoverAction: {
opacity: 0,
pointerEvents: 'none',
transition: `opacity ${motionTokens.durationFast}ms ${motionTokens.curveEasyEase}`,
willChange: 'opacity'
}
});
/**
* Apply styling to the SplitNavItem slots based on the state
*/ export const useSplitNavItemStyles_unstable = (state)=>{
'use no memo';
const splitNavItemStyles = useSplitNaveItemStyles();
const sharedRootClassNames = useRootDefaultClassName();
state.root.className = mergeClasses(splitNavItemClassNames.root, sharedRootClassNames, splitNavItemStyles.baseRoot, state.root.className);
if (state.navItem) {
state.navItem.className = mergeClasses(splitNavItemClassNames.navItem, splitNavItemStyles.baseNavItem, state.navItem.className);
}
if (state.actionButton) {
state.actionButton.className = mergeClasses(splitNavItemClassNames.actionButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.actionButton.className);
}
if (state.toggleButton) {
state.toggleButton.className = mergeClasses(splitNavItemClassNames.toggleButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.toggleButton.className);
}
if (state.menuButton) {
state.menuButton.className = mergeClasses(splitNavItemClassNames.menuButton, splitNavItemStyles.baseSecondary, splitNavItemStyles.hoverAction, state.density === 'medium' && splitNavItemStyles.baseMedium, state.menuButton.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SplitNavItem/useSplitNavItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { motionTokens } from '@fluentui/react-motion';\n\nimport type { SplitNavItemSlots, SplitNavItemState } from './SplitNavItem.types';\nimport { navItemTokens, useRootDefaultClassName } from '../sharedNavStyles.styles';\n\nexport const splitNavItemClassNames: SlotClassNames<SplitNavItemSlots> = {\n root: 'fui-SplitNavItem',\n navItem: 'fui-SplitNavItem__navItem',\n actionButton: 'fui-SplitNavItem__actionButton',\n toggleButton: 'fui-SplitNavItem__toggleButton',\n menuButton: 'fui-SplitNavItem__menuButton',\n /**\n * Tooltips don't have a class name prop, so this is just to satisfy the linter.\n */\n actionButtonTooltip: 'fui-SplitNavItem__actionButtonTooltip',\n toggleButtonTooltip: 'fui-SplitNavItem__toggleButtonTooltip',\n menuButtonTooltip: 'fui-SplitNavItem__menuButtonTooltip',\n};\n// Don't use makeResetStyles here because the sub components call it once and\n// This links says that makeResetStyles should only be called once per element\n// https://griffel.js.org/react/api/make-reset-styles/#limitations\n\nconst { actionButton, toggleButton, menuButton } = splitNavItemClassNames;\nconst buttonHoverStyles = {\n [`& .${actionButton}, & .${toggleButton}, & .${menuButton}`]: {\n opacity: 1,\n pointerEvents: 'auto',\n },\n};\n\n/**\n * Styles for the root slot\n */\nconst useSplitNaveItemStyles = makeStyles({\n baseRoot: {\n display: 'flex',\n gap: 'unset',\n alignItems: 'stretch',\n padding: 'unset',\n textAlign: 'unset',\n backgroundColor: navItemTokens.backgroundColor,\n ...navItemTokens.transitionTokens,\n\n ':hover': {\n backgroundColor: navItemTokens.backgroundColorHover,\n ...buttonHoverStyles,\n },\n\n ':focus-within': buttonHoverStyles,\n\n ':active': {\n backgroundColor: navItemTokens.backgroundColorPressed,\n },\n },\n baseNavItem: {\n // styles that we want to disagree with the default on\n display: 'flex',\n textTransform: 'none',\n alignSelf: 'stretch',\n textAlign: 'left',\n position: 'relative',\n justifyContent: 'start',\n gap: tokens.spacingVerticalL,\n backgroundColor: 'transparent',\n },\n baseSecondary: {\n minWidth: '28px',\n paddingInlineEnd: '12px',\n paddingInlineStart: '5px',\n paddingBlockStart: '5px',\n alignItems: 'start',\n },\n baseMedium: {\n paddingBlockStart: '9px',\n },\n\n baseLarge: {\n paddingBlockStart: '12px',\n },\n\n hoverAction: {\n opacity: 0,\n pointerEvents: 'none',\n transition: `opacity ${motionTokens.durationFast}ms ${motionTokens.curveEasyEase}`,\n willChange: 'opacity',\n },\n});\n\n/**\n * Apply styling to the SplitNavItem slots based on the state\n */\nexport const useSplitNavItemStyles_unstable = (state: SplitNavItemState): SplitNavItemState => {\n 'use no memo';\n\n const splitNavItemStyles = useSplitNaveItemStyles();\n const sharedRootClassNames = useRootDefaultClassName();\n\n state.root.className = mergeClasses(\n splitNavItemClassNames.root,\n sharedRootClassNames,\n splitNavItemStyles.baseRoot,\n state.root.className,\n );\n\n if (state.navItem) {\n state.navItem.className = mergeClasses(\n splitNavItemClassNames.navItem,\n splitNavItemStyles.baseNavItem,\n state.navItem.className,\n );\n }\n\n if (state.actionButton) {\n state.actionButton.className = mergeClasses(\n splitNavItemClassNames.actionButton,\n splitNavItemStyles.baseSecondary,\n splitNavItemStyles.hoverAction,\n state.density === 'medium' && splitNavItemStyles.baseMedium,\n state.actionButton.className,\n );\n }\n\n if (state.toggleButton) {\n state.toggleButton.className = mergeClasses(\n splitNavItemClassNames.toggleButton,\n splitNavItemStyles.baseSecondary,\n splitNavItemStyles.hoverAction,\n state.density === 'medium' && splitNavItemStyles.baseMedium,\n state.toggleButton.className,\n );\n }\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(\n splitNavItemClassNames.menuButton,\n splitNavItemStyles.baseSecondary,\n splitNavItemStyles.hoverAction,\n state.density === 'medium' && splitNavItemStyles.baseMedium,\n state.menuButton.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","motionTokens","navItemTokens","useRootDefaultClassName","splitNavItemClassNames","root","navItem","actionButton","toggleButton","menuButton","actionButtonTooltip","toggleButtonTooltip","menuButtonTooltip","buttonHoverStyles","opacity","pointerEvents","useSplitNaveItemStyles","baseRoot","display","gap","alignItems","padding","textAlign","backgroundColor","transitionTLine truncated