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,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DrawerBody", {
enumerable: true,
get: function() {
return DrawerBody;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useDrawerBody = require("./useDrawerBody");
const _renderDrawerBody = require("./renderDrawerBody");
const _useDrawerBodyStylesstyles = require("./useDrawerBodyStyles.styles");
const DrawerBody = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useDrawerBody.useDrawerBody_unstable)(props, ref);
(0, _useDrawerBodyStylesstyles.useDrawerBodyStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useDrawerBodyStyles_unstable')(state);
return (0, _renderDrawerBody.renderDrawerBody_unstable)(state);
});
DrawerBody.displayName = 'DrawerBody';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DrawerBody/DrawerBody.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 { useDrawerBody_unstable } from './useDrawerBody';\nimport { renderDrawerBody_unstable } from './renderDrawerBody';\nimport { useDrawerBodyStyles_unstable } from './useDrawerBodyStyles.styles';\nimport type { DrawerBodyProps } from './DrawerBody.types';\n\n/**\n * DrawerBody provides with a container for the main content of a Drawer.\n */\nexport const DrawerBody: ForwardRefComponent<DrawerBodyProps> = React.forwardRef((props, ref) => {\n const state = useDrawerBody_unstable(props, ref);\n\n useDrawerBodyStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerBodyStyles_unstable')(state);\n\n return renderDrawerBody_unstable(state);\n});\n\nDrawerBody.displayName = 'DrawerBody';\n"],"names":["React","useCustomStyleHook_unstable","useDrawerBody_unstable","renderDrawerBody_unstable","useDrawerBodyStyles_unstable","DrawerBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;qCAEa,kCAAkC;+BAEvC,kBAAkB;kCACf,qBAAqB;2CAClB,+BAA+B;AAMrE,MAAMK,aAAAA,WAAAA,GAAmDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,YAAQP,qCAAAA,EAAuBK,OAAOC;QAE5CJ,uDAAAA,EAA6BK;QAC7BR,gDAAAA,EAA4B,gCAAgCQ;IAE5D,WAAON,2CAAAA,EAA0BM;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
/**
* State used in rendering DrawerBody
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DrawerBody/DrawerBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DrawerBodySlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DrawerBody Props\n */\nexport type DrawerBodyProps = ComponentProps<DrawerBodySlots>;\n\n/**\n * State used in rendering DrawerBody\n */\nexport type DrawerBodyState = ComponentState<DrawerBodySlots>;\n"],"names":[],"mappings":"AAWA;;CAEC,GACD,WAA8D"}

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DrawerBody: function() {
return _DrawerBody.DrawerBody;
},
drawerBodyClassNames: function() {
return _useDrawerBodyStylesstyles.drawerBodyClassNames;
},
renderDrawerBody_unstable: function() {
return _renderDrawerBody.renderDrawerBody_unstable;
},
useDrawerBodyStyles_unstable: function() {
return _useDrawerBodyStylesstyles.useDrawerBodyStyles_unstable;
},
useDrawerBody_unstable: function() {
return _useDrawerBody.useDrawerBody_unstable;
}
});
const _DrawerBody = require("./DrawerBody");
const _renderDrawerBody = require("./renderDrawerBody");
const _useDrawerBody = require("./useDrawerBody");
const _useDrawerBodyStylesstyles = require("./useDrawerBodyStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DrawerBody/index.ts"],"sourcesContent":["export { DrawerBody } from './DrawerBody';\nexport type { DrawerBodyProps, DrawerBodySlots, DrawerBodyState } from './DrawerBody.types';\nexport { renderDrawerBody_unstable } from './renderDrawerBody';\nexport { useDrawerBody_unstable } from './useDrawerBody';\nexport { drawerBodyClassNames, useDrawerBodyStyles_unstable } from './useDrawerBodyStyles.styles';\n"],"names":["DrawerBody","renderDrawerBody_unstable","useDrawerBody_unstable","drawerBodyClassNames","useDrawerBodyStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,sBAAU;;;eAIVG,+CAAoB;;;eAFpBF,2CAAyB;;;eAEHG,uDAA4B;;;eADlDF,qCAAsB;;;4BAHJ,eAAe;kCAEA,qBAAqB;+BACxB,kBAAkB;2CACU,+BAA+B"}

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderDrawerBody_unstable", {
enumerable: true,
get: function() {
return renderDrawerBody_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderDrawerBody_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DrawerBody/renderDrawerBody.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { DrawerBodySlots, DrawerBodyState } from './DrawerBody.types';\n\n/**\n * Render the final JSX of DrawerBody\n */\nexport const renderDrawerBody_unstable = (state: DrawerBodyState): JSXElement => {\n assertSlots<DrawerBodySlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderDrawerBody_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCACrB,4BAA4B;AAQjD,MAAMC,4BAA4B,CAACC;QACxCF,2BAAAA,EAA6BE;IAE7B,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}

View File

@@ -0,0 +1,92 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useDrawerBody_unstable", {
enumerable: true,
get: function() {
return useDrawerBody_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _drawerContext = require("../../contexts/drawerContext");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
/**
* Get the current scroll state of the DrawerBody.
*
* @internal
* @param element - HTMLElement to check scroll state of
*/ const getScrollState = ({ scrollTop, scrollHeight, clientHeight })=>{
if (scrollHeight <= clientHeight) {
return 'none';
}
if (scrollTop === 0) {
return 'top';
}
if (scrollTop + clientHeight === scrollHeight) {
return 'bottom';
}
return 'middle';
};
const useDrawerBody_unstable = (props, ref)=>{
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
const { setScrollState } = (0, _drawerContext.useDrawerContext_unstable)();
const scrollRef = _react.useRef(null);
const mergedRef = (0, _reactutilities.useMergedRefs)(ref, scrollRef);
const [setScrollAnimationFrame, cancelScrollAnimationFrame] = (0, _reactutilities.useAnimationFrame)();
const [setResizeAnimationFrame, cancelResizeAnimationFrame] = (0, _reactutilities.useAnimationFrame)();
const updateScrollState = _react.useCallback(()=>{
if (!scrollRef.current) {
return;
}
setScrollState(getScrollState(scrollRef.current));
}, [
setScrollState
]);
const onScroll = _react.useCallback(()=>{
cancelScrollAnimationFrame();
setScrollAnimationFrame(updateScrollState);
}, [
cancelScrollAnimationFrame,
setScrollAnimationFrame,
updateScrollState
]);
// Update scroll state on children change
(0, _reactutilities.useIsomorphicLayoutEffect)(updateScrollState, [
props.children,
updateScrollState
]);
// Update scroll state on mount and when resize occurs
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
if (!scrollRef.current || !(win === null || win === void 0 ? void 0 : win.ResizeObserver)) {
return;
}
const observer = new win.ResizeObserver(()=>setResizeAnimationFrame(updateScrollState));
observer.observe(scrollRef.current);
return ()=>{
observer.disconnect();
cancelResizeAnimationFrame();
};
}, [
setResizeAnimationFrame,
cancelResizeAnimationFrame,
updateScrollState,
win
]);
return {
components: {
root: 'div'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
ref: mergedRef,
...props,
onScroll: (0, _reactutilities.mergeCallbacks)(props.onScroll, onScroll)
}), {
elementType: 'div'
})
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
drawerBodyClassNames: function() {
return drawerBodyClassNames;
},
useDrawerBodyStyles_unstable: function() {
return useDrawerBodyStyles_unstable;
}
});
const _react = require("@griffel/react");
const drawerBodyClassNames = {
root: 'fui-DrawerBody'
};
/**
* Styles for the root slot
*/ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("ri6rvx7", null, [
".ri6rvx7{padding:0 var(--spacingHorizontalXXL);flex:1;align-self:stretch;position:relative;z-index:1;overflow:auto;}",
".ri6rvx7:last-child{padding-bottom:calc(var(--spacingHorizontalXXL) + 1px);}",
".ri6rvx7:first-child{padding-top:calc(var(--spacingHorizontalXXL) + 1px);}"
]);
const useDrawerBodyStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(drawerBodyClassNames.root, styles, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useDrawerBodyStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerBodyClassNames = {\n root: 'fui-DrawerBody'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeResetStyles({\n padding: `0 ${tokens.spacingHorizontalXXL}`,\n flex: 1,\n alignSelf: 'stretch',\n position: 'relative',\n zIndex: 1,\n overflow: 'auto',\n ':last-child': {\n paddingBottom: `calc(${tokens.spacingHorizontalXXL} + 1px)`\n },\n ':first-child': {\n paddingTop: `calc(${tokens.spacingHorizontalXXL} + 1px)`\n }\n});\n/**\n * Apply styling to the DrawerBody slots based on the state\n */ export const useDrawerBodyStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(drawerBodyClassNames.root, styles, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","mergeClasses","tokens","drawerBodyClassNames","root","useStyles","useDrawerBodyStyles_unstable","state","styles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;wBAGqB;;;gCAqBY;;;;uBAvBC,gBAAgB;AAEvD,MAAMG,uBAAuB;IAChCC,IAAI,EAAE;AACV,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGL,oBAAA,EAAA,WAAA,MAAA;IAAA;IAAA;IAAA;CAarB,CAAC;AAGS,MAAMM,gCAAgCC,KAAK,IAAG;IACrD,aAAa;IACb,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC;IAC1BE,KAAK,CAACH,IAAI,CAACK,SAAS,OAAGR,mBAAY,EAACE,oBAAoB,CAACC,IAAI,EAAEI,MAAM,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;IAC5F,OAAOF,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,46 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
drawerBodyClassNames: function() {
return drawerBodyClassNames;
},
useDrawerBodyStyles_unstable: function() {
return useDrawerBodyStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const drawerBodyClassNames = {
root: 'fui-DrawerBody'
};
/**
* Styles for the root slot
*/ const useStyles = (0, _react.makeResetStyles)({
padding: `0 ${_reacttheme.tokens.spacingHorizontalXXL}`,
flex: 1,
alignSelf: 'stretch',
position: 'relative',
zIndex: 1,
overflow: 'auto',
':last-child': {
paddingBottom: `calc(${_reacttheme.tokens.spacingHorizontalXXL} + 1px)`
},
':first-child': {
paddingTop: `calc(${_reacttheme.tokens.spacingHorizontalXXL} + 1px)`
}
});
const useDrawerBodyStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(drawerBodyClassNames.root, styles, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DrawerBody/useDrawerBodyStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nimport type { DrawerBodySlots, DrawerBodyState } from './DrawerBody.types';\n\nexport const drawerBodyClassNames: SlotClassNames<DrawerBodySlots> = {\n root: 'fui-DrawerBody',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeResetStyles({\n padding: `0 ${tokens.spacingHorizontalXXL}`,\n flex: 1,\n alignSelf: 'stretch',\n position: 'relative',\n zIndex: 1,\n overflow: 'auto',\n\n ':last-child': {\n paddingBottom: `calc(${tokens.spacingHorizontalXXL} + 1px)`,\n },\n\n ':first-child': {\n paddingTop: `calc(${tokens.spacingHorizontalXXL} + 1px)`,\n },\n});\n\n/**\n * Apply styling to the DrawerBody slots based on the state\n */\nexport const useDrawerBodyStyles_unstable = (state: DrawerBodyState): DrawerBodyState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(drawerBodyClassNames.root, styles, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","drawerBodyClassNames","root","useStyles","padding","spacingHorizontalXXL","flex","alignSelf","position","zIndex","overflow","paddingBottom","paddingTop","useDrawerBodyStyles_unstable","state","styles","className"],"mappings":"AAAA;;;;;;;;;;;;IAQaG,oBAAAA;;;gCA2BAY;;;;uBAjCiC,iBAAiB;4BACxC,wBAAwB;AAKxC,6BAA8D;IACnEX,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYL,sBAAAA,EAAgB;IAChCM,SAAS,CAAC,EAAE,EAAEJ,kBAAAA,CAAOK,oBAAoB,EAAE;IAC3CC,MAAM;IACNC,WAAW;IACXC,UAAU;IACVC,QAAQ;IACRC,UAAU;IAEV,eAAe;QACbC,eAAe,CAAC,KAAK,EAAEX,kBAAAA,CAAOK,oBAAoB,CAAC,OAAO,CAAC;IAC7D;IAEA,gBAAgB;QACdO,YAAY,CAAC,KAAK,EAAEZ,kBAAAA,CAAOK,oBAAoB,CAAC,OAAO,CAAC;IAC1D;AACF;AAKO,MAAMQ,+BAA+B,CAACC;IAC3C;IAEA,MAAMC,SAASZ;IAEfW,MAAMZ,IAAI,CAACc,SAAS,OAAGjB,mBAAAA,EAAaE,qBAAqBC,IAAI,EAAEa,QAAQD,MAAMZ,IAAI,CAACc,SAAS;IAE3F,OAAOF;AACT,EAAE"}