@fluentui/react-drawer 9.1.12 → 9.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/index.d.ts +16 -5
  3. package/lib/components/Drawer/Drawer.js +3 -1
  4. package/lib/components/Drawer/Drawer.js.map +1 -1
  5. package/lib/components/Drawer/renderDrawer.js +6 -2
  6. package/lib/components/Drawer/renderDrawer.js.map +1 -1
  7. package/lib/components/DrawerBody/useDrawerBody.js +49 -3
  8. package/lib/components/DrawerBody/useDrawerBody.js.map +1 -1
  9. package/lib/components/DrawerBody/useDrawerBodyStyles.styles.js +1 -1
  10. package/lib/components/DrawerBody/useDrawerBodyStyles.styles.js.map +1 -1
  11. package/lib/components/DrawerFooter/DrawerFooter.types.js.map +1 -1
  12. package/lib/components/DrawerFooter/useDrawerFooter.js +4 -1
  13. package/lib/components/DrawerFooter/useDrawerFooter.js.map +1 -1
  14. package/lib/components/DrawerFooter/useDrawerFooterStyles.styles.js +25 -3
  15. package/lib/components/DrawerFooter/useDrawerFooterStyles.styles.js.map +1 -1
  16. package/lib/components/DrawerHeader/DrawerHeader.types.js.map +1 -1
  17. package/lib/components/DrawerHeader/useDrawerHeader.js +4 -1
  18. package/lib/components/DrawerHeader/useDrawerHeader.js.map +1 -1
  19. package/lib/components/DrawerHeader/useDrawerHeaderStyles.styles.js +25 -3
  20. package/lib/components/DrawerHeader/useDrawerHeaderStyles.styles.js.map +1 -1
  21. package/lib/components/InlineDrawer/InlineDrawer.js +3 -1
  22. package/lib/components/InlineDrawer/InlineDrawer.js.map +1 -1
  23. package/lib/components/InlineDrawer/renderInlineDrawer.js +6 -2
  24. package/lib/components/InlineDrawer/renderInlineDrawer.js.map +1 -1
  25. package/lib/components/OverlayDrawer/OverlayDrawer.js +3 -1
  26. package/lib/components/OverlayDrawer/OverlayDrawer.js.map +1 -1
  27. package/lib/components/OverlayDrawer/renderOverlayDrawer.js +7 -3
  28. package/lib/components/OverlayDrawer/renderOverlayDrawer.js.map +1 -1
  29. package/lib/contexts/drawerContext.js +18 -0
  30. package/lib/contexts/drawerContext.js.map +1 -0
  31. package/lib/contexts/index.js +1 -0
  32. package/lib/contexts/index.js.map +1 -0
  33. package/lib/shared/DrawerBase.types.js.map +1 -1
  34. package/lib/shared/drawerSeparatorStyles.js +13 -0
  35. package/lib/shared/drawerSeparatorStyles.js.map +1 -0
  36. package/lib-commonjs/components/Drawer/Drawer.js +3 -1
  37. package/lib-commonjs/components/Drawer/Drawer.js.map +1 -1
  38. package/lib-commonjs/components/Drawer/renderDrawer.js +6 -2
  39. package/lib-commonjs/components/Drawer/renderDrawer.js.map +1 -1
  40. package/lib-commonjs/components/DrawerBody/useDrawerBody.js +48 -2
  41. package/lib-commonjs/components/DrawerBody/useDrawerBody.js.map +1 -1
  42. package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js +4 -4
  43. package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js.map +1 -1
  44. package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js +4 -1
  45. package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js.map +1 -1
  46. package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js +46 -3
  47. package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js.map +1 -1
  48. package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js +4 -1
  49. package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js.map +1 -1
  50. package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js +46 -3
  51. package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js.map +1 -1
  52. package/lib-commonjs/components/InlineDrawer/InlineDrawer.js +3 -1
  53. package/lib-commonjs/components/InlineDrawer/InlineDrawer.js.map +1 -1
  54. package/lib-commonjs/components/InlineDrawer/renderInlineDrawer.js +6 -2
  55. package/lib-commonjs/components/InlineDrawer/renderInlineDrawer.js.map +1 -1
  56. package/lib-commonjs/components/OverlayDrawer/OverlayDrawer.js +3 -1
  57. package/lib-commonjs/components/OverlayDrawer/OverlayDrawer.js.map +1 -1
  58. package/lib-commonjs/components/OverlayDrawer/renderOverlayDrawer.js +7 -3
  59. package/lib-commonjs/components/OverlayDrawer/renderOverlayDrawer.js.map +1 -1
  60. package/lib-commonjs/contexts/drawerContext.js +43 -0
  61. package/lib-commonjs/contexts/drawerContext.js.map +1 -0
  62. package/lib-commonjs/contexts/index.js +6 -0
  63. package/lib-commonjs/contexts/index.js.map +1 -0
  64. package/lib-commonjs/shared/drawerSeparatorStyles.js +23 -0
  65. package/lib-commonjs/shared/drawerSeparatorStyles.js.map +1 -0
  66. package/package.json +7 -7
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ const defaultContextValue = {
3
+ scrollState: 'none',
4
+ setScrollState: ()=>({})
5
+ };
6
+ export const drawerContext = React.createContext(undefined);
7
+ export const DrawerProvider = drawerContext.Provider;
8
+ export const useDrawerContext_unstable = ()=>{
9
+ var _React_useContext;
10
+ return (_React_useContext = React.useContext(drawerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : defaultContextValue;
11
+ };
12
+ export const useDrawerContextValue = ()=>{
13
+ const [scrollState, setScrollState] = React.useState('none');
14
+ return {
15
+ setScrollState,
16
+ scrollState
17
+ };
18
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["drawerContext.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { DrawerScrollState } from '../shared/DrawerBase.types';\n\nexport type DrawerContextValue = {\n scrollState: DrawerScrollState;\n setScrollState: (scrollState: DrawerScrollState) => void;\n};\n\nconst defaultContextValue: DrawerContextValue = {\n scrollState: 'none',\n setScrollState: () => ({}),\n};\n\nexport const drawerContext = React.createContext<DrawerContextValue | undefined>(undefined);\nexport const DrawerProvider = drawerContext.Provider;\nexport const useDrawerContext_unstable = () => React.useContext(drawerContext) ?? defaultContextValue;\n\nexport const useDrawerContextValue = (): DrawerContextValue => {\n const [scrollState, setScrollState] = React.useState<DrawerScrollState>('none');\n\n return {\n setScrollState,\n scrollState,\n };\n};\n"],"names":["React","defaultContextValue","scrollState","setScrollState","drawerContext","createContext","undefined","DrawerProvider","Provider","useDrawerContext_unstable","useContext","useDrawerContextValue","useState"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAS/B,MAAMC,sBAA0C;IAC9CC,aAAa;IACbC,gBAAgB,IAAO,CAAA,CAAC,CAAA;AAC1B;AAEA,OAAO,MAAMC,gBAAgBJ,MAAMK,aAAa,CAAiCC,WAAW;AAC5F,OAAO,MAAMC,iBAAiBH,cAAcI,QAAQ,CAAC;AACrD,OAAO,MAAMC,4BAA4B;QAAMT;WAAAA,CAAAA,oBAAAA,MAAMU,UAAU,CAACN,4BAAjBJ,+BAAAA,oBAAmCC;AAAkB,EAAE;AAEtG,OAAO,MAAMU,wBAAwB;IACnC,MAAM,CAACT,aAAaC,eAAe,GAAGH,MAAMY,QAAQ,CAAoB;IAExE,OAAO;QACLT;QACAD;IACF;AACF,EAAE"}
@@ -0,0 +1 @@
1
+ export * from './drawerContext';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './drawerContext';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerBase.types.ts"],"sourcesContent":["import * as React from 'react';\n\ntype MotionType = 'entering' | 'entered' | 'idle' | 'exiting' | 'exited' | 'unmounted';\n\ntype MotionState<Element extends HTMLElement = HTMLElement> = {\n /**\n * Ref to the element.\n */\n ref: React.Ref<Element>;\n\n /**\n * Current state of the element.\n *\n * - `unmounted` - The element is not yet rendered or can be safely removed from the DOM.\n * - `entering` - The element is performing enter animation.\n * - `entered` - The element has finished enter animation.\n * - `idle` - The element is currently not animating, but rendered on screen.\n * - `exiting` - The element is performing exit animation.\n * - `exited` - The element has finished exit animation.\n */\n type: MotionType;\n\n /**\n * Indicates whether the component can be rendered.\n * Useful to render the element before animating it or to remove it from the DOM after exit animation.\n */\n canRender: boolean;\n\n /**\n * Indicates whether the component is ready to receive a CSS transition className.\n * Useful to apply CSS transitions when the element is mounted and ready to be animated.\n */\n active: boolean;\n};\n\nexport type DrawerBaseProps = {\n /**\n * Position of the drawer.\n *\n * Note: 'bottom' does not supports size, but it supports customized height.\n *\n * @default 'start'\n */\n position?: 'start' | 'end' | 'bottom';\n\n /**\n * Size of the drawer.\n *\n * - 'small' - Drawer is 320px wide.\n * - 'medium' - Drawer is 592px wide.\n * - 'large' - Drawer is 940px wide.\n * - 'full' - Drawer is 100vw wide.\n *\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large' | 'full';\n\n /**\n * Controls the open state of the Drawer\n *\n * @default false\n */\n open?: boolean;\n};\n\nexport type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {\n motion: MotionState<HTMLDivElement>;\n};\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["DrawerBase.types.ts"],"sourcesContent":["import * as React from 'react';\n\ntype MotionType = 'entering' | 'entered' | 'idle' | 'exiting' | 'exited' | 'unmounted';\n\ntype MotionState<Element extends HTMLElement = HTMLElement> = {\n /**\n * Ref to the element.\n */\n ref: React.Ref<Element>;\n\n /**\n * Current state of the element.\n *\n * - `unmounted` - The element is not yet rendered or can be safely removed from the DOM.\n * - `entering` - The element is performing enter animation.\n * - `entered` - The element has finished enter animation.\n * - `idle` - The element is currently not animating, but rendered on screen.\n * - `exiting` - The element is performing exit animation.\n * - `exited` - The element has finished exit animation.\n */\n type: MotionType;\n\n /**\n * Indicates whether the component can be rendered.\n * Useful to render the element before animating it or to remove it from the DOM after exit animation.\n */\n canRender: boolean;\n\n /**\n * Indicates whether the component is ready to receive a CSS transition className.\n * Useful to apply CSS transitions when the element is mounted and ready to be animated.\n */\n active: boolean;\n};\n\nexport type DrawerBaseProps = {\n /**\n * Position of the drawer.\n *\n * Note: 'bottom' does not supports size, but it supports customized height.\n *\n * @default 'start'\n */\n position?: 'start' | 'end' | 'bottom';\n\n /**\n * Size of the drawer.\n *\n * - 'small' - Drawer is 320px wide.\n * - 'medium' - Drawer is 592px wide.\n * - 'large' - Drawer is 940px wide.\n * - 'full' - Drawer is 100vw wide.\n *\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large' | 'full';\n\n /**\n * Controls the open state of the Drawer\n *\n * @default false\n */\n open?: boolean;\n};\n\nexport type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {\n motion: MotionState<HTMLDivElement>;\n};\n\nexport type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,13 @@
1
+ import { tokens } from '@fluentui/react-theme';
2
+ export const drawerSeparatorStyles = {
3
+ height: '1px',
4
+ position: 'absolute',
5
+ right: 0,
6
+ left: 0,
7
+ opacity: 0,
8
+ backgroundColor: tokens.colorNeutralStroke1,
9
+ transitionDuration: tokens.durationNormal,
10
+ transitionProperty: 'opacity',
11
+ transitionTimingFunction: tokens.curveEasyEase,
12
+ content: '""'
13
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["drawerSeparatorStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { GriffelStyle } from '@griffel/react';\n\nexport const drawerSeparatorStyles: GriffelStyle = {\n height: '1px',\n position: 'absolute',\n right: 0,\n left: 0,\n opacity: 0,\n backgroundColor: tokens.colorNeutralStroke1,\n transitionDuration: tokens.durationNormal,\n transitionProperty: 'opacity',\n transitionTimingFunction: tokens.curveEasyEase,\n content: '\"\"',\n};\n"],"names":["tokens","drawerSeparatorStyles","height","position","right","left","opacity","backgroundColor","colorNeutralStroke1","transitionDuration","durationNormal","transitionProperty","transitionTimingFunction","curveEasyEase","content"],"mappings":"AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAG/C,OAAO,MAAMC,wBAAsC;IACjDC,QAAQ;IACRC,UAAU;IACVC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,iBAAiBP,OAAOQ,mBAAmB;IAC3CC,oBAAoBT,OAAOU,cAAc;IACzCC,oBAAoB;IACpBC,0BAA0BZ,OAAOa,aAAa;IAC9CC,SAAS;AACX,EAAE"}
@@ -11,13 +11,15 @@ Object.defineProperty(exports, "Drawer", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
14
+ const _drawerContext = require("../../contexts/drawerContext");
14
15
  const _useDrawer = require("./useDrawer");
15
16
  const _renderDrawer = require("./renderDrawer");
16
17
  const _useDrawerStylesstyles = require("./useDrawerStyles.styles");
17
18
  const Drawer = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
19
  const state = (0, _useDrawer.useDrawer_unstable)(props, ref);
20
+ const contextValue = (0, _drawerContext.useDrawerContextValue)();
19
21
  (0, _useDrawerStylesstyles.useDrawerStyles_unstable)(state);
20
22
  (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useDrawerStyles_unstable')(state);
21
- return (0, _renderDrawer.renderDrawer_unstable)(state);
23
+ return (0, _renderDrawer.renderDrawer_unstable)(state, contextValue);
22
24
  });
23
25
  Drawer.displayName = 'Drawer';
@@ -1 +1 @@
1
- {"version":3,"sources":["Drawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useDrawer_unstable } from './useDrawer';\nimport { renderDrawer_unstable } from './renderDrawer';\nimport { useDrawerStyles_unstable } from './useDrawerStyles.styles';\n/**\n * Drawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */ export const Drawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useDrawer_unstable(props, ref);\n useDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);\n return renderDrawer_unstable(state);\n});\nDrawer.displayName = 'Drawer';\n"],"names":["Drawer","React","forwardRef","props","ref","state","useDrawer_unstable","useDrawerStyles_unstable","useCustomStyleHook_unstable","renderDrawer_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;qCACqB;2BACT;8BACG;uCACG;AAG9B,MAAMA,SAAS,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7D,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,+CAAwB,EAACF;IACzBG,IAAAA,gDAA2B,EAAC,4BAA4BH;IACxD,OAAOI,IAAAA,mCAAqB,EAACJ;AACjC;AACAL,OAAOU,WAAW,GAAG"}
1
+ {"version":3,"sources":["Drawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\nimport { useDrawer_unstable } from './useDrawer';\nimport { renderDrawer_unstable } from './renderDrawer';\nimport { useDrawerStyles_unstable } from './useDrawerStyles.styles';\n/**\n * Drawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */ export const Drawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n useDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);\n return renderDrawer_unstable(state, contextValue);\n});\nDrawer.displayName = 'Drawer';\n"],"names":["Drawer","React","forwardRef","props","ref","state","useDrawer_unstable","contextValue","useDrawerContextValue","useDrawerStyles_unstable","useCustomStyleHook_unstable","renderDrawer_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;qCACqB;+BACN;2BACH;8BACG;uCACG;AAG9B,MAAMA,SAAS,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7D,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxC,MAAMG,eAAeC,IAAAA,oCAAqB;IAC1CC,IAAAA,+CAAwB,EAACJ;IACzBK,IAAAA,gDAA2B,EAAC,4BAA4BL;IACxD,OAAOM,IAAAA,mCAAqB,EAACN,OAAOE;AACxC;AACAP,OAAOY,WAAW,GAAG"}
@@ -10,7 +10,11 @@ Object.defineProperty(exports, "renderDrawer_unstable", {
10
10
  });
11
11
  const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
- const renderDrawer_unstable = (state)=>{
13
+ const _drawerContext = require("../../contexts/drawerContext");
14
+ const renderDrawer_unstable = (state, contextValue)=>{
14
15
  (0, _reactutilities.assertSlots)(state);
15
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
16
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_drawerContext.DrawerProvider, {
17
+ value: contextValue,
18
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
19
+ });
16
20
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Drawer\n */ export const renderDrawer_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderDrawer_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,wBAAwB,CAACC;IACtCC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
1
+ {"version":3,"sources":["renderDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerProvider } from '../../contexts/drawerContext';\n/**\n * Render the final JSX of Drawer\n */ export const renderDrawer_unstable = (state, contextValue)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(DrawerProvider, {\n value: contextValue,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderDrawer_unstable","state","contextValue","assertSlots","_jsx","DrawerProvider","value","children","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;+BACG;AAGpB,MAAMA,wBAAwB,CAACC,OAAOC;IAC7CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,6BAAc,EAAE;QACtCC,OAAOJ;QACPK,UAAU,WAAW,GAAGH,IAAAA,eAAI,EAACH,MAAMO,IAAI,EAAE,CAAC;IAC9C;AACJ"}
@@ -11,7 +11,52 @@ Object.defineProperty(exports, "useDrawerBody_unstable", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
+ const _drawerContext = require("../../contexts/drawerContext");
15
+ /**
16
+ * @internal
17
+ *
18
+ * Get the current scroll state of the DrawerBody.
19
+ *
20
+ * @param param0 - HTMLElement to check scroll state of
21
+ */ const getScrollState = ({ scrollTop, scrollHeight, clientHeight })=>{
22
+ if (scrollHeight <= clientHeight) {
23
+ return 'none';
24
+ }
25
+ if (scrollTop === 0) {
26
+ return 'top';
27
+ }
28
+ if (scrollTop + clientHeight === scrollHeight) {
29
+ return 'bottom';
30
+ }
31
+ return 'middle';
32
+ };
14
33
  const useDrawerBody_unstable = (props, ref)=>{
34
+ const { setScrollState } = (0, _drawerContext.useDrawerContext_unstable)();
35
+ const scrollRef = _react.useRef(null);
36
+ const [setAnimationFrame, cancelAnimationFrame] = (0, _reactutilities.useAnimationFrame)();
37
+ const onScroll = _react.useCallback(()=>{
38
+ cancelAnimationFrame();
39
+ setAnimationFrame(()=>{
40
+ if (!scrollRef.current) {
41
+ return;
42
+ }
43
+ setScrollState(getScrollState(scrollRef.current));
44
+ });
45
+ }, [
46
+ cancelAnimationFrame,
47
+ setAnimationFrame,
48
+ setScrollState
49
+ ]);
50
+ (0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
51
+ if (!scrollRef.current) {
52
+ return;
53
+ }
54
+ setScrollState(getScrollState(scrollRef.current));
55
+ return ()=>cancelAnimationFrame();
56
+ }, [
57
+ cancelAnimationFrame,
58
+ setScrollState
59
+ ]);
15
60
  return {
16
61
  components: {
17
62
  root: 'div'
@@ -20,8 +65,9 @@ const useDrawerBody_unstable = (props, ref)=>{
20
65
  // FIXME:
21
66
  // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
22
67
  // but since it would be a breaking change to fix it, we are casting ref to it's proper type
23
- ref: ref,
24
- ...props
68
+ ref: (0, _reactutilities.useMergedRefs)(ref, scrollRef),
69
+ ...props,
70
+ onScroll: (0, _reactutilities.mergeCallbacks)(props.onScroll, onScroll)
25
71
  }), {
26
72
  elementType: 'div'
27
73
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerBody.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render DrawerBody.\n *\n * The returned state can be modified with hooks such as useDrawerBodyStyles_unstable,\n * before being passed to renderDrawerBody_unstable.\n *\n * @param props - props from this instance of DrawerBody\n * @param ref - reference to root HTMLElement of DrawerBody\n */ export const useDrawerBody_unstable = (props, ref)=>{\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useDrawerBody_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;gCACwB;AASpC,MAAMA,yBAAyB,CAACC,OAAOC;IAC9C,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FL,KAAKA;YACL,GAAGD,KAAK;QACZ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDrawerBody.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, slot, useAnimationFrame, useMergedRefs, useIsomorphicLayoutEffect, getIntrinsicElementProps } from '@fluentui/react-utilities';\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\n/**\n * @internal\n *\n * Get the current scroll state of the DrawerBody.\n *\n * @param param0 - HTMLElement to check scroll state of\n */ const getScrollState = ({ scrollTop, scrollHeight, clientHeight })=>{\n if (scrollHeight <= clientHeight) {\n return 'none';\n }\n if (scrollTop === 0) {\n return 'top';\n }\n if (scrollTop + clientHeight === scrollHeight) {\n return 'bottom';\n }\n return 'middle';\n};\n/**\n * Create the state required to render DrawerBody.\n *\n * The returned state can be modified with hooks such as useDrawerBodyStyles_unstable,\n * before being passed to renderDrawerBody_unstable.\n *\n * @param props - props from this instance of DrawerBody\n * @param ref - reference to root HTMLElement of DrawerBody\n */ export const useDrawerBody_unstable = (props, ref)=>{\n const { setScrollState } = useDrawerContext_unstable();\n const scrollRef = React.useRef(null);\n const [setAnimationFrame, cancelAnimationFrame] = useAnimationFrame();\n const onScroll = React.useCallback(()=>{\n cancelAnimationFrame();\n setAnimationFrame(()=>{\n if (!scrollRef.current) {\n return;\n }\n setScrollState(getScrollState(scrollRef.current));\n });\n }, [\n cancelAnimationFrame,\n setAnimationFrame,\n setScrollState\n ]);\n useIsomorphicLayoutEffect(()=>{\n if (!scrollRef.current) {\n return;\n }\n setScrollState(getScrollState(scrollRef.current));\n return ()=>cancelAnimationFrame();\n }, [\n cancelAnimationFrame,\n setScrollState\n ]);\n return {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, scrollRef),\n ...props,\n onScroll: mergeCallbacks(props.onScroll, onScroll)\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useDrawerBody_unstable","getScrollState","scrollTop","scrollHeight","clientHeight","props","ref","setScrollState","useDrawerContext_unstable","scrollRef","React","useRef","setAnimationFrame","cancelAnimationFrame","useAnimationFrame","onScroll","useCallback","current","useIsomorphicLayoutEffect","components","root","slot","always","getIntrinsicElementProps","useMergedRefs","mergeCallbacks","elementType"],"mappings":";;;;+BA6BiBA;;;eAAAA;;;;iEA7BM;gCACqG;+BAClF;AAC1C;;;;;;CAMC,GAAG,MAAMC,iBAAiB,CAAC,EAAEC,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAE;IACjE,IAAID,gBAAgBC,cAAc;QAC9B,OAAO;IACX;IACA,IAAIF,cAAc,GAAG;QACjB,OAAO;IACX;IACA,IAAIA,YAAYE,iBAAiBD,cAAc;QAC3C,OAAO;IACX;IACA,OAAO;AACX;AASW,MAAMH,yBAAyB,CAACK,OAAOC;IAC9C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,wCAAyB;IACpD,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/B,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGC,IAAAA,iCAAiB;IACnE,MAAMC,WAAWL,OAAMM,WAAW,CAAC;QAC/BH;QACAD,kBAAkB;YACd,IAAI,CAACH,UAAUQ,OAAO,EAAE;gBACpB;YACJ;YACAV,eAAeN,eAAeQ,UAAUQ,OAAO;QACnD;IACJ,GAAG;QACCJ;QACAD;QACAL;KACH;IACDW,IAAAA,yCAAyB,EAAC;QACtB,IAAI,CAACT,UAAUQ,OAAO,EAAE;YACpB;QACJ;QACAV,eAAeN,eAAeQ,UAAUQ,OAAO;QAC/C,OAAO,IAAIJ;IACf,GAAG;QACCA;QACAN;KACH;IACD,OAAO;QACHY,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FjB,KAAKkB,IAAAA,6BAAa,EAAClB,KAAKG;YACxB,GAAGJ,KAAK;YACRU,UAAUU,IAAAA,8BAAc,EAACpB,MAAMU,QAAQ,EAAEA;QAC7C,IAAI;YACAW,aAAa;QACjB;IACJ;AACJ"}
@@ -22,10 +22,10 @@ const drawerBodyClassNames = {
22
22
  };
23
23
  /**
24
24
  * Styles for the root slot
25
- */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r1boqb07", null, [
26
- ".r1boqb07{margin:-1px 0;padding:1px var(--spacingHorizontalXXL);overflow:auto;flex:1;align-self:stretch;background-image:linear-gradient(to top, var(--colorNeutralBackground1), var(--colorNeutralBackground1)),linear-gradient(to top, var(--colorNeutralBackground1), var(--colorNeutralBackground1)),linear-gradient(to top, var(--colorNeutralStroke1), var(--colorNeutralBackground1)),linear-gradient(to bottom, var(--colorNeutralStroke1), var(--colorNeutralBackground1));-webkit-background-position:bottom center,top center,bottom center,top center;background-position:bottom center,top center,bottom center,top center;background-repeat:no-repeat;background-color:var(--colorNeutralBackground1);background-size:100% 2px,100% 2px,100% 1px,100% 1px;background-attachment:local,local,scroll,scroll;}",
27
- ".r1boqb07:last-child{padding-bottom:calc(var(--spacingHorizontalXXL) + 1px);}",
28
- ".r1boqb07:first-child{padding-top:calc(var(--spacingHorizontalXXL) + 1px);}"
25
+ */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("ri6rvx7", null, [
26
+ ".ri6rvx7{padding:0 var(--spacingHorizontalXXL);flex:1;align-self:stretch;position:relative;z-index:1;overflow:auto;}",
27
+ ".ri6rvx7:last-child{padding-bottom:calc(var(--spacingHorizontalXXL) + 1px);}",
28
+ ".ri6rvx7:first-child{padding-top:calc(var(--spacingHorizontalXXL) + 1px);}"
29
29
  ]);
30
30
  const useDrawerBodyStyles_unstable = (state)=>{
31
31
  const styles = useStyles();
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerBodyStyles.styles.js"],"sourcesContent":["import { __resetStyles, 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 */\nconst useStyles = /*#__PURE__*/__resetStyles(\"r1boqb07\", null, [\".r1boqb07{margin:-1px 0;padding:1px var(--spacingHorizontalXXL);overflow:auto;flex:1;align-self:stretch;background-image:linear-gradient(to top, var(--colorNeutralBackground1), var(--colorNeutralBackground1)),linear-gradient(to top, var(--colorNeutralBackground1), var(--colorNeutralBackground1)),linear-gradient(to top, var(--colorNeutralStroke1), var(--colorNeutralBackground1)),linear-gradient(to bottom, var(--colorNeutralStroke1), var(--colorNeutralBackground1));-webkit-background-position:bottom center,top center,bottom center,top center;background-position:bottom center,top center,bottom center,top center;background-repeat:no-repeat;background-color:var(--colorNeutralBackground1);background-size:100% 2px,100% 2px,100% 1px,100% 1px;background-attachment:local,local,scroll,scroll;}\", \".r1boqb07:last-child{padding-bottom:calc(var(--spacingHorizontalXXL) + 1px);}\", \".r1boqb07:first-child{padding-top:calc(var(--spacingHorizontalXXL) + 1px);}\"]);\n/**\n * Apply styling to the DrawerBody slots based on the state\n */\nexport const useDrawerBodyStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(drawerBodyClassNames.root, styles, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerBodyStyles.styles.js.map"],"names":["drawerBodyClassNames","useDrawerBodyStyles_unstable","root","useStyles","__resetStyles","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAUAC,4BAA4B;eAA5BA;;;uBAZ+B;AAErC,MAAMD,uBAAuB;IAClCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,MAAM;IAAC;IAA6xB;IAAiF;CAA8E;AAIr/B,MAAMH,+BAA+BI,CAAAA;IAC1C,MAAMC,SAASH;IACfE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,qBAAqBE,IAAI,EAAEI,QAAQD,MAAMH,IAAI,CAACK,SAAS;IAC3F,OAAOF;AACT,GACA,sDAAsD"}
1
+ {"version":3,"sources":["useDrawerBodyStyles.styles.js"],"sourcesContent":["import { __resetStyles, 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 */\nconst useStyles = /*#__PURE__*/__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);}\"]);\n/**\n * Apply styling to the DrawerBody slots based on the state\n */\nexport const useDrawerBodyStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(drawerBodyClassNames.root, styles, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerBodyStyles.styles.js.map"],"names":["drawerBodyClassNames","useDrawerBodyStyles_unstable","root","useStyles","__resetStyles","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAUAC,4BAA4B;eAA5BA;;;uBAZ+B;AAErC,MAAMD,uBAAuB;IAClCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;IAAwH;IAAgF;CAA6E;AAI7U,MAAMH,+BAA+BI,CAAAA;IAC1C,MAAMC,SAASH;IACfE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,qBAAqBE,IAAI,EAAEI,QAAQD,MAAMH,IAAI,CAACK,SAAS;IAC3F,OAAOF;AACT,GACA,sDAAsD"}
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "useDrawerFooter_unstable", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
+ const _drawerContext = require("../../contexts/drawerContext");
14
15
  const useDrawerFooter_unstable = (props, ref)=>{
16
+ const { scrollState } = (0, _drawerContext.useDrawerContext_unstable)();
15
17
  return {
16
18
  components: {
17
19
  root: 'footer'
@@ -21,6 +23,7 @@ const useDrawerFooter_unstable = (props, ref)=>{
21
23
  ...props
22
24
  }), {
23
25
  elementType: 'footer'
24
- })
26
+ }),
27
+ scrollState
25
28
  };
26
29
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerFooter.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render DrawerFooter.\n *\n * The returned state can be modified with hooks such as useDrawerFooterStyles_unstable,\n * before being passed to renderDrawerFooter_unstable.\n *\n * @param props - props from this instance of DrawerFooter\n * @param ref - reference to root HTMLElement of DrawerFooter\n */ export const useDrawerFooter_unstable = (props, ref)=>{\n return {\n components: {\n root: 'footer'\n },\n root: slot.always(getIntrinsicElementProps('footer', {\n ref,\n ...props\n }), {\n elementType: 'footer'\n })\n };\n};\n"],"names":["useDrawerFooter_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;gCACwB;AASpC,MAAMA,2BAA2B,CAACC,OAAOC;IAChD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,UAAU;YACjDL;YACA,GAAGD,KAAK;QACZ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDrawerFooter.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\n/**\n * Create the state required to render DrawerFooter.\n *\n * The returned state can be modified with hooks such as useDrawerFooterStyles_unstable,\n * before being passed to renderDrawerFooter_unstable.\n *\n * @param props - props from this instance of DrawerFooter\n * @param ref - reference to root HTMLElement of DrawerFooter\n */ export const useDrawerFooter_unstable = (props, ref)=>{\n const { scrollState } = useDrawerContext_unstable();\n return {\n components: {\n root: 'footer'\n },\n root: slot.always(getIntrinsicElementProps('footer', {\n ref,\n ...props\n }), {\n elementType: 'footer'\n }),\n scrollState\n };\n};\n"],"names":["useDrawerFooter_unstable","props","ref","scrollState","useDrawerContext_unstable","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAWiBA;;;eAAAA;;;;iEAXM;gCACwB;+BACL;AAS/B,MAAMA,2BAA2B,CAACC,OAAOC;IAChD,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,wCAAyB;IACjD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,UAAU;YACjDP;YACA,GAAGD,KAAK;QACZ,IAAI;YACAS,aAAa;QACjB;QACAP;IACJ;AACJ"}
@@ -22,11 +22,54 @@ const drawerFooterClassNames = {
22
22
  };
23
23
  /**
24
24
  * Styles for the root slot
25
- */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r41rrse", null, [
26
- ".r41rrse{padding:var(--spacingVerticalL) var(--spacingHorizontalXXL) var(--spacingVerticalXXL);width:100%;max-width:100%;display:flex;justify-content:flex-start;align-items:center;column-gap:var(--spacingHorizontalS);box-sizing:border-box;}"
25
+ */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r1snvl2j", null, [
26
+ ".r1snvl2j{width:100%;max-width:100%;padding:var(--spacingVerticalL) var(--spacingHorizontalXXL) var(--spacingVerticalXXL);display:flex;justify-content:flex-start;align-items:center;column-gap:var(--spacingHorizontalS);box-sizing:border-box;position:relative;z-index:2;}"
27
27
  ]);
28
+ const useDrawerFooterStyles = /*#__PURE__*/ (0, _react.__styles)({
29
+ separator: {
30
+ Bbc2r3f: "fhufbb2",
31
+ xx9plb: "fxf9f1y",
32
+ qd6xl9: [
33
+ "fmlx6bj",
34
+ "f1t0u0az"
35
+ ],
36
+ Byque4d: [
37
+ "f1t0u0az",
38
+ "fmlx6bj"
39
+ ],
40
+ ngabwx: "f1429bq1",
41
+ B1dvbpk: "fv3cwj",
42
+ B5szp9g: "f1ayei5p",
43
+ iukgx1: "fkgtggm",
44
+ Br7k87z: "f44t985",
45
+ rurcny: "fuzzvh5",
46
+ Bf8kmfk: "f14oqhab"
47
+ },
48
+ separatorVisible: {
49
+ ngabwx: "f3ve9t9"
50
+ }
51
+ }, {
52
+ d: [
53
+ ".fhufbb2:before{height:1px;}",
54
+ ".fxf9f1y:before{position:absolute;}",
55
+ ".fmlx6bj:before{right:0;}",
56
+ ".f1t0u0az:before{left:0;}",
57
+ ".f1429bq1:before{opacity:0;}",
58
+ ".fv3cwj:before{background-color:var(--colorNeutralStroke1);}",
59
+ ".f1ayei5p:before{transition-duration:var(--durationNormal);}",
60
+ ".fkgtggm:before{transition-property:opacity;}",
61
+ ".f44t985:before{transition-timing-function:var(--curveEasyEase);}",
62
+ ".fuzzvh5:before{content:\"\";}",
63
+ ".f14oqhab:before{top:0;}",
64
+ ".f3ve9t9:before{opacity:1;}"
65
+ ]
66
+ });
28
67
  const useDrawerFooterStyles_unstable = (state)=>{
29
68
  const styles = useStyles();
30
- state.root.className = (0, _react.mergeClasses)(drawerFooterClassNames.root, styles, state.root.className);
69
+ const rootStyles = useDrawerFooterStyles();
70
+ state.root.className = (0, _react.mergeClasses)(drawerFooterClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, [
71
+ 'middle',
72
+ 'top'
73
+ ].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);
31
74
  return state;
32
75
  }; //# sourceMappingURL=useDrawerFooterStyles.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerFooterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerFooterClassNames = {\n root: 'fui-DrawerFooter'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__resetStyles(\"r41rrse\", null, [\".r41rrse{padding:var(--spacingVerticalL) var(--spacingHorizontalXXL) var(--spacingVerticalXXL);width:100%;max-width:100%;display:flex;justify-content:flex-start;align-items:center;column-gap:var(--spacingHorizontalS);box-sizing:border-box;}\"]);\n/**\n * Apply styling to the DrawerFooter slots based on the state\n */\nexport const useDrawerFooterStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(drawerFooterClassNames.root, styles, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerFooterStyles.styles.js.map"],"names":["drawerFooterClassNames","useDrawerFooterStyles_unstable","root","useStyles","__resetStyles","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,sBAAsB;eAAtBA;;IAUAC,8BAA8B;eAA9BA;;;uBAZ+B;AAErC,MAAMD,yBAAyB;IACpCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAmP;AAI3S,MAAMH,iCAAiCI,CAAAA;IAC5C,MAAMC,SAASH;IACfE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,uBAAuBE,IAAI,EAAEI,QAAQD,MAAMH,IAAI,CAACK,SAAS;IAC7F,OAAOF;AACT,GACA,wDAAwD"}
1
+ {"version":3,"sources":["useDrawerFooterStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerSeparatorStyles } from '../../shared/drawerSeparatorStyles';\nexport const drawerFooterClassNames = {\n root: 'fui-DrawerFooter'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__resetStyles(\"r1snvl2j\", null, [\".r1snvl2j{width:100%;max-width:100%;padding:var(--spacingVerticalL) var(--spacingHorizontalXXL) var(--spacingVerticalXXL);display:flex;justify-content:flex-start;align-items:center;column-gap:var(--spacingHorizontalS);box-sizing:border-box;position:relative;z-index:2;}\"]);\nconst useDrawerFooterStyles = /*#__PURE__*/__styles({\n separator: {\n Bbc2r3f: \"fhufbb2\",\n xx9plb: \"fxf9f1y\",\n qd6xl9: [\"fmlx6bj\", \"f1t0u0az\"],\n Byque4d: [\"f1t0u0az\", \"fmlx6bj\"],\n ngabwx: \"f1429bq1\",\n B1dvbpk: \"fv3cwj\",\n B5szp9g: \"f1ayei5p\",\n iukgx1: \"fkgtggm\",\n Br7k87z: \"f44t985\",\n rurcny: \"fuzzvh5\",\n Bf8kmfk: \"f14oqhab\"\n },\n separatorVisible: {\n ngabwx: \"f3ve9t9\"\n }\n}, {\n d: [\".fhufbb2:before{height:1px;}\", \".fxf9f1y:before{position:absolute;}\", \".fmlx6bj:before{right:0;}\", \".f1t0u0az:before{left:0;}\", \".f1429bq1:before{opacity:0;}\", \".fv3cwj:before{background-color:var(--colorNeutralStroke1);}\", \".f1ayei5p:before{transition-duration:var(--durationNormal);}\", \".fkgtggm:before{transition-property:opacity;}\", \".f44t985:before{transition-timing-function:var(--curveEasyEase);}\", \".fuzzvh5:before{content:\\\"\\\";}\", \".f14oqhab:before{top:0;}\", \".f3ve9t9:before{opacity:1;}\"]\n});\n/**\n * Apply styling to the DrawerFooter slots based on the state\n */\nexport const useDrawerFooterStyles_unstable = state => {\n const styles = useStyles();\n const rootStyles = useDrawerFooterStyles();\n state.root.className = mergeClasses(drawerFooterClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, ['middle', 'top'].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerFooterStyles.styles.js.map"],"names":["drawerFooterClassNames","useDrawerFooterStyles_unstable","root","useStyles","__resetStyles","useDrawerFooterStyles","__styles","separator","Bbc2r3f","xx9plb","qd6xl9","Byque4d","ngabwx","B1dvbpk","B5szp9g","iukgx1","Br7k87z","rurcny","Bf8kmfk","separatorVisible","d","state","styles","rootStyles","className","mergeClasses","scrollState","includes"],"mappings":";;;;;;;;;;;IAGaA,sBAAsB;eAAtBA;;IA8BAC,8BAA8B;eAA9BA;;;uBAjCyC;AAG/C,MAAMD,yBAAyB;IACpCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,MAAM;IAAC;CAAgR;AAChV,MAAMC,wBAAwB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IAClDC,WAAW;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAW;QAC/BC,SAAS;YAAC;YAAY;SAAU;QAChCC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,SAAS;IACX;IACAC,kBAAkB;QAChBP,QAAQ;IACV;AACF,GAAG;IACDQ,GAAG;QAAC;QAAgC;QAAuC;QAA6B;QAA6B;QAAgC;QAAgE;QAAgE;QAAiD;QAAqE;QAAkC;QAA4B;KAA8B;AACzf;AAIO,MAAMnB,iCAAiCoB,CAAAA;IAC5C,MAAMC,SAASnB;IACf,MAAMoB,aAAalB;IACnBgB,MAAMnB,IAAI,CAACsB,SAAS,GAAGC,IAAAA,mBAAY,EAACzB,uBAAuBE,IAAI,EAAEoB,QAAQD,MAAMK,WAAW,KAAK,UAAUH,WAAWhB,SAAS,EAAE;QAAC;QAAU;KAAM,CAACoB,QAAQ,CAACN,MAAMK,WAAW,KAAKH,WAAWJ,gBAAgB,EAAEE,MAAMnB,IAAI,CAACsB,SAAS;IACjO,OAAOH;AACT,GACA,wDAAwD"}
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "useDrawerHeader_unstable", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
+ const _drawerContext = require("../../contexts/drawerContext");
14
15
  const useDrawerHeader_unstable = (props, ref)=>{
16
+ const { scrollState } = (0, _drawerContext.useDrawerContext_unstable)();
15
17
  return {
16
18
  components: {
17
19
  root: 'header'
@@ -21,6 +23,7 @@ const useDrawerHeader_unstable = (props, ref)=>{
21
23
  ...props
22
24
  }), {
23
25
  elementType: 'header'
24
- })
26
+ }),
27
+ scrollState
25
28
  };
26
29
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render DrawerHeader.\n *\n * The returned state can be modified with hooks such as useDrawerHeaderStyles_unstable,\n * before being passed to renderDrawerHeader_unstable.\n *\n * @param props - props from this instance of DrawerHeader\n * @param ref - reference to root HTMLElement of DrawerHeader\n */ export const useDrawerHeader_unstable = (props, ref)=>{\n return {\n components: {\n root: 'header'\n },\n root: slot.always(getIntrinsicElementProps('header', {\n ref,\n ...props\n }), {\n elementType: 'header'\n })\n };\n};\n"],"names":["useDrawerHeader_unstable","props","ref","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;gCACwB;AASpC,MAAMA,2BAA2B,CAACC,OAAOC;IAChD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,UAAU;YACjDL;YACA,GAAGD,KAAK;QACZ,IAAI;YACAO,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDrawerHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\n/**\n * Create the state required to render DrawerHeader.\n *\n * The returned state can be modified with hooks such as useDrawerHeaderStyles_unstable,\n * before being passed to renderDrawerHeader_unstable.\n *\n * @param props - props from this instance of DrawerHeader\n * @param ref - reference to root HTMLElement of DrawerHeader\n */ export const useDrawerHeader_unstable = (props, ref)=>{\n const { scrollState } = useDrawerContext_unstable();\n return {\n components: {\n root: 'header'\n },\n root: slot.always(getIntrinsicElementProps('header', {\n ref,\n ...props\n }), {\n elementType: 'header'\n }),\n scrollState\n };\n};\n"],"names":["useDrawerHeader_unstable","props","ref","scrollState","useDrawerContext_unstable","components","root","slot","always","getIntrinsicElementProps","elementType"],"mappings":";;;;+BAWiBA;;;eAAAA;;;;iEAXM;gCACwB;+BACL;AAS/B,MAAMA,2BAA2B,CAACC,OAAOC;IAChD,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,wCAAyB;IACjD,OAAO;QACHC,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,UAAU;YACjDP;YACA,GAAGD,KAAK;QACZ,IAAI;YACAS,aAAa;QACjB;QACAP;IACJ;AACJ"}
@@ -22,11 +22,54 @@ const drawerHeaderClassNames = {
22
22
  };
23
23
  /**
24
24
  * Styles for the root slot
25
- */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r11m9gl0", null, [
26
- ".r11m9gl0{padding:var(--spacingVerticalXXL) var(--spacingHorizontalXXL) var(--spacingVerticalS);gap:var(--spacingHorizontalS);width:100%;max-width:100%;align-self:stretch;display:flex;flex-direction:column;box-sizing:border-box;}"
25
+ */ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r3ovn4i", null, [
26
+ ".r3ovn4i{width:100%;max-width:100%;padding:var(--spacingVerticalXXL) var(--spacingHorizontalXXL) var(--spacingVerticalS);gap:var(--spacingHorizontalS);align-self:stretch;display:flex;flex-direction:column;box-sizing:border-box;position:relative;z-index:2;}"
27
27
  ]);
28
+ const useDrawerHeaderStyles = /*#__PURE__*/ (0, _react.__styles)({
29
+ separator: {
30
+ mpb1vu: "f1bc0r91",
31
+ Hdbjpj: "f11ef69",
32
+ cnmfks: [
33
+ "f15lyva8",
34
+ "f1cvlmu2"
35
+ ],
36
+ jc51t6: [
37
+ "f1cvlmu2",
38
+ "f15lyva8"
39
+ ],
40
+ Bmyypfa: "f9pox2d",
41
+ Bkbwdz4: "f1swzn7y",
42
+ mafdb0: "f1pb4rwf",
43
+ wbfbqe: "fsav6n4",
44
+ Jgwf15: "f1iuoiuj",
45
+ Bs6t6z0: "fqc6z8f",
46
+ Bj55yzk: "fw2wsqs"
47
+ },
48
+ separatorVisible: {
49
+ Bmyypfa: "frwhdur"
50
+ }
51
+ }, {
52
+ d: [
53
+ ".f1bc0r91:after{height:1px;}",
54
+ ".f11ef69:after{position:absolute;}",
55
+ ".f15lyva8:after{right:0;}",
56
+ ".f1cvlmu2:after{left:0;}",
57
+ ".f9pox2d:after{opacity:0;}",
58
+ ".f1swzn7y:after{background-color:var(--colorNeutralStroke1);}",
59
+ ".f1pb4rwf:after{transition-duration:var(--durationNormal);}",
60
+ ".fsav6n4:after{transition-property:opacity;}",
61
+ ".f1iuoiuj:after{transition-timing-function:var(--curveEasyEase);}",
62
+ ".fqc6z8f:after{content:\"\";}",
63
+ ".fw2wsqs:after{bottom:0;}",
64
+ ".frwhdur:after{opacity:1;}"
65
+ ]
66
+ });
28
67
  const useDrawerHeaderStyles_unstable = (state)=>{
29
68
  const styles = useStyles();
30
- state.root.className = (0, _react.mergeClasses)(drawerHeaderClassNames.root, styles, state.root.className);
69
+ const rootStyles = useDrawerHeaderStyles();
70
+ state.root.className = (0, _react.mergeClasses)(drawerHeaderClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, [
71
+ 'middle',
72
+ 'bottom'
73
+ ].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);
31
74
  return state;
32
75
  }; //# sourceMappingURL=useDrawerHeaderStyles.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerHeaderStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerHeaderClassNames = {\n root: 'fui-DrawerHeader'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__resetStyles(\"r11m9gl0\", null, [\".r11m9gl0{padding:var(--spacingVerticalXXL) var(--spacingHorizontalXXL) var(--spacingVerticalS);gap:var(--spacingHorizontalS);width:100%;max-width:100%;align-self:stretch;display:flex;flex-direction:column;box-sizing:border-box;}\"]);\n/**\n * Apply styling to the DrawerHeader slots based on the state\n */\nexport const useDrawerHeaderStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(drawerHeaderClassNames.root, styles, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerHeaderStyles.styles.js.map"],"names":["drawerHeaderClassNames","useDrawerHeaderStyles_unstable","root","useStyles","__resetStyles","state","styles","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,sBAAsB;eAAtBA;;IAUAC,8BAA8B;eAA9BA;;;uBAZ+B;AAErC,MAAMD,yBAAyB;IACpCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,MAAM;IAAC;CAAwO;AAIjS,MAAMH,iCAAiCI,CAAAA;IAC5C,MAAMC,SAASH;IACfE,MAAMH,IAAI,CAACK,SAAS,GAAGC,IAAAA,mBAAY,EAACR,uBAAuBE,IAAI,EAAEI,QAAQD,MAAMH,IAAI,CAACK,SAAS;IAC7F,OAAOF;AACT,GACA,wDAAwD"}
1
+ {"version":3,"sources":["useDrawerHeaderStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerSeparatorStyles } from '../../shared/drawerSeparatorStyles';\nexport const drawerHeaderClassNames = {\n root: 'fui-DrawerHeader'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__resetStyles(\"r3ovn4i\", null, [\".r3ovn4i{width:100%;max-width:100%;padding:var(--spacingVerticalXXL) var(--spacingHorizontalXXL) var(--spacingVerticalS);gap:var(--spacingHorizontalS);align-self:stretch;display:flex;flex-direction:column;box-sizing:border-box;position:relative;z-index:2;}\"]);\nconst useDrawerHeaderStyles = /*#__PURE__*/__styles({\n separator: {\n mpb1vu: \"f1bc0r91\",\n Hdbjpj: \"f11ef69\",\n cnmfks: [\"f15lyva8\", \"f1cvlmu2\"],\n jc51t6: [\"f1cvlmu2\", \"f15lyva8\"],\n Bmyypfa: \"f9pox2d\",\n Bkbwdz4: \"f1swzn7y\",\n mafdb0: \"f1pb4rwf\",\n wbfbqe: \"fsav6n4\",\n Jgwf15: \"f1iuoiuj\",\n Bs6t6z0: \"fqc6z8f\",\n Bj55yzk: \"fw2wsqs\"\n },\n separatorVisible: {\n Bmyypfa: \"frwhdur\"\n }\n}, {\n d: [\".f1bc0r91:after{height:1px;}\", \".f11ef69:after{position:absolute;}\", \".f15lyva8:after{right:0;}\", \".f1cvlmu2:after{left:0;}\", \".f9pox2d:after{opacity:0;}\", \".f1swzn7y:after{background-color:var(--colorNeutralStroke1);}\", \".f1pb4rwf:after{transition-duration:var(--durationNormal);}\", \".fsav6n4:after{transition-property:opacity;}\", \".f1iuoiuj:after{transition-timing-function:var(--curveEasyEase);}\", \".fqc6z8f:after{content:\\\"\\\";}\", \".fw2wsqs:after{bottom:0;}\", \".frwhdur:after{opacity:1;}\"]\n});\n/**\n * Apply styling to the DrawerHeader slots based on the state\n */\nexport const useDrawerHeaderStyles_unstable = state => {\n const styles = useStyles();\n const rootStyles = useDrawerHeaderStyles();\n state.root.className = mergeClasses(drawerHeaderClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, ['middle', 'bottom'].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);\n return state;\n};\n//# sourceMappingURL=useDrawerHeaderStyles.styles.js.map"],"names":["drawerHeaderClassNames","useDrawerHeaderStyles_unstable","root","useStyles","__resetStyles","useDrawerHeaderStyles","__styles","separator","mpb1vu","Hdbjpj","cnmfks","jc51t6","Bmyypfa","Bkbwdz4","mafdb0","wbfbqe","Jgwf15","Bs6t6z0","Bj55yzk","separatorVisible","d","state","styles","rootStyles","className","mergeClasses","scrollState","includes"],"mappings":";;;;;;;;;;;IAGaA,sBAAsB;eAAtBA;;IA8BAC,8BAA8B;eAA9BA;;;uBAjCyC;AAG/C,MAAMD,yBAAyB;IACpCE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAmQ;AAClU,MAAMC,wBAAwB,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IAClDC,WAAW;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;QACTC,SAAS;QACTC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,SAAS;IACX;IACAC,kBAAkB;QAChBP,SAAS;IACX;AACF,GAAG;IACDQ,GAAG;QAAC;QAAgC;QAAsC;QAA6B;QAA4B;QAA8B;QAAiE;QAA+D;QAAgD;QAAqE;QAAiC;QAA6B;KAA6B;AACnf;AAIO,MAAMnB,iCAAiCoB,CAAAA;IAC5C,MAAMC,SAASnB;IACf,MAAMoB,aAAalB;IACnBgB,MAAMnB,IAAI,CAACsB,SAAS,GAAGC,IAAAA,mBAAY,EAACzB,uBAAuBE,IAAI,EAAEoB,QAAQD,MAAMK,WAAW,KAAK,UAAUH,WAAWhB,SAAS,EAAE;QAAC;QAAU;KAAS,CAACoB,QAAQ,CAACN,MAAMK,WAAW,KAAKH,WAAWJ,gBAAgB,EAAEE,MAAMnB,IAAI,CAACsB,SAAS;IACpO,OAAOH;AACT,GACA,wDAAwD"}
@@ -11,14 +11,16 @@ Object.defineProperty(exports, "InlineDrawer", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
14
+ const _drawerContext = require("../../contexts/drawerContext");
14
15
  const _useInlineDrawer = require("./useInlineDrawer");
15
16
  const _renderInlineDrawer = require("./renderInlineDrawer");
16
17
  const _useInlineDrawerStylesstyles = require("./useInlineDrawerStyles.styles");
17
18
  const InlineDrawer = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
19
  const state = (0, _useInlineDrawer.useInlineDrawer_unstable)(props, ref);
20
+ const contextValue = (0, _drawerContext.useDrawerContextValue)();
19
21
  (0, _useInlineDrawerStylesstyles.useInlineDrawerStyles_unstable)(state);
20
22
  (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useDrawerInlineStyles_unstable')(state);
21
23
  (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useInlineDrawerStyles_unstable')(state);
22
- return (0, _renderInlineDrawer.renderInlineDrawer_unstable)(state);
24
+ return (0, _renderInlineDrawer.renderInlineDrawer_unstable)(state, contextValue);
23
25
  });
24
26
  InlineDrawer.displayName = 'InlineDrawer';
@@ -1 +1 @@
1
- {"version":3,"sources":["InlineDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useInlineDrawer_unstable } from './useInlineDrawer';\nimport { renderInlineDrawer_unstable } from './renderInlineDrawer';\nimport { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';\n/**\n * InlineDrawer is often used for navigation that is not dismissible. As it is on the same level as\n * the main surface, users can still interact with other UI elements.\n */ export const InlineDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useInlineDrawer_unstable(props, ref);\n useInlineDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerInlineStyles_unstable')(state);\n useCustomStyleHook_unstable('useInlineDrawerStyles_unstable')(state);\n return renderInlineDrawer_unstable(state);\n});\nInlineDrawer.displayName = 'InlineDrawer';\n"],"names":["InlineDrawer","React","forwardRef","props","ref","state","useInlineDrawer_unstable","useInlineDrawerStyles_unstable","useCustomStyleHook_unstable","renderInlineDrawer_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;qCACqB;iCACH;oCACG;6CACG;AAIpC,MAAMA,eAAe,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACnE,MAAMC,QAAQC,IAAAA,yCAAwB,EAACH,OAAOC;IAC9CG,IAAAA,2DAA8B,EAACF;IAC/BG,IAAAA,gDAA2B,EAAC,kCAAkCH;IAC9DG,IAAAA,gDAA2B,EAAC,kCAAkCH;IAC9D,OAAOI,IAAAA,+CAA2B,EAACJ;AACvC;AACAL,aAAaU,WAAW,GAAG"}
1
+ {"version":3,"sources":["InlineDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\nimport { useInlineDrawer_unstable } from './useInlineDrawer';\nimport { renderInlineDrawer_unstable } from './renderInlineDrawer';\nimport { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';\n/**\n * InlineDrawer is often used for navigation that is not dismissible. As it is on the same level as\n * the main surface, users can still interact with other UI elements.\n */ export const InlineDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useInlineDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n useInlineDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerInlineStyles_unstable')(state);\n useCustomStyleHook_unstable('useInlineDrawerStyles_unstable')(state);\n return renderInlineDrawer_unstable(state, contextValue);\n});\nInlineDrawer.displayName = 'InlineDrawer';\n"],"names":["InlineDrawer","React","forwardRef","props","ref","state","useInlineDrawer_unstable","contextValue","useDrawerContextValue","useInlineDrawerStyles_unstable","useCustomStyleHook_unstable","renderInlineDrawer_unstable","displayName"],"mappings":";;;;+BASiBA;;;eAAAA;;;;iEATM;qCACqB;+BACN;iCACG;oCACG;6CACG;AAIpC,MAAMA,eAAe,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACnE,MAAMC,QAAQC,IAAAA,yCAAwB,EAACH,OAAOC;IAC9C,MAAMG,eAAeC,IAAAA,oCAAqB;IAC1CC,IAAAA,2DAA8B,EAACJ;IAC/BK,IAAAA,gDAA2B,EAAC,kCAAkCL;IAC9DK,IAAAA,gDAA2B,EAAC,kCAAkCL;IAC9D,OAAOM,IAAAA,+CAA2B,EAACN,OAAOE;AAC9C;AACAP,aAAaY,WAAW,GAAG"}
@@ -10,10 +10,14 @@ Object.defineProperty(exports, "renderInlineDrawer_unstable", {
10
10
  });
11
11
  const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
- const renderInlineDrawer_unstable = (state)=>{
13
+ const _drawerContext = require("../../contexts/drawerContext");
14
+ const renderInlineDrawer_unstable = (state, contextValue)=>{
14
15
  if (!state.motion.canRender) {
15
16
  return null;
16
17
  }
17
18
  (0, _reactutilities.assertSlots)(state);
18
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
19
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_drawerContext.DrawerProvider, {
20
+ value: contextValue,
21
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
22
+ });
19
23
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderInlineDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of InlineDrawer\n */ export const renderInlineDrawer_unstable = (state)=>{\n if (!state.motion.canRender) {\n return null;\n }\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderInlineDrawer_unstable","state","motion","canRender","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,8BAA8B,CAACC;IAC5C,IAAI,CAACA,MAAMC,MAAM,CAACC,SAAS,EAAE;QACzB,OAAO;IACX;IACAC,IAAAA,2BAAW,EAACH;IACZ,OAAO,WAAW,GAAGI,IAAAA,eAAI,EAACJ,MAAMK,IAAI,EAAE,CAAC;AAC3C"}
1
+ {"version":3,"sources":["renderInlineDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerProvider } from '../../contexts/drawerContext';\n/**\n * Render the final JSX of InlineDrawer\n */ export const renderInlineDrawer_unstable = (state, contextValue)=>{\n if (!state.motion.canRender) {\n return null;\n }\n assertSlots(state);\n return /*#__PURE__*/ _jsx(DrawerProvider, {\n value: contextValue,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderInlineDrawer_unstable","state","contextValue","motion","canRender","assertSlots","_jsx","DrawerProvider","value","children","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;+BACG;AAGpB,MAAMA,8BAA8B,CAACC,OAAOC;IACnD,IAAI,CAACD,MAAME,MAAM,CAACC,SAAS,EAAE;QACzB,OAAO;IACX;IACAC,IAAAA,2BAAW,EAACJ;IACZ,OAAO,WAAW,GAAGK,IAAAA,eAAI,EAACC,6BAAc,EAAE;QACtCC,OAAON;QACPO,UAAU,WAAW,GAAGH,IAAAA,eAAI,EAACL,MAAMS,IAAI,EAAE,CAAC;IAC9C;AACJ"}
@@ -11,14 +11,16 @@ Object.defineProperty(exports, "OverlayDrawer", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
14
+ const _drawerContext = require("../../contexts/drawerContext");
14
15
  const _useOverlayDrawer = require("./useOverlayDrawer");
15
16
  const _renderOverlayDrawer = require("./renderOverlayDrawer");
16
17
  const _useOverlayDrawerStylesstyles = require("./useOverlayDrawerStyles.styles");
17
18
  const OverlayDrawer = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
18
19
  const state = (0, _useOverlayDrawer.useOverlayDrawer_unstable)(props, ref);
20
+ const contextValue = (0, _drawerContext.useDrawerContextValue)();
19
21
  (0, _useOverlayDrawerStylesstyles.useOverlayDrawerStyles_unstable)(state);
20
22
  (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useDrawerOverlayStyles_unstable')(state);
21
23
  (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useOverlayDrawerStyles_unstable')(state);
22
- return (0, _renderOverlayDrawer.renderOverlayDrawer_unstable)(state);
24
+ return (0, _renderOverlayDrawer.renderOverlayDrawer_unstable)(state, contextValue);
23
25
  });
24
26
  OverlayDrawer.displayName = 'OverlayDrawer';
@@ -1 +1 @@
1
- {"version":3,"sources":["OverlayDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useOverlayDrawer_unstable } from './useOverlayDrawer';\nimport { renderOverlayDrawer_unstable } from './renderOverlayDrawer';\nimport { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles';\n/**\n * OverlayDrawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */ export const OverlayDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useOverlayDrawer_unstable(props, ref);\n useOverlayDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerOverlayStyles_unstable')(state);\n useCustomStyleHook_unstable('useOverlayDrawerStyles_unstable')(state);\n return renderOverlayDrawer_unstable(state);\n});\nOverlayDrawer.displayName = 'OverlayDrawer';\n"],"names":["OverlayDrawer","React","forwardRef","props","ref","state","useOverlayDrawer_unstable","useOverlayDrawerStyles_unstable","useCustomStyleHook_unstable","renderOverlayDrawer_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;qCACqB;kCACF;qCACG;8CACG;AAGrC,MAAMA,gBAAgB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACpE,MAAMC,QAAQC,IAAAA,2CAAyB,EAACH,OAAOC;IAC/CG,IAAAA,6DAA+B,EAACF;IAChCG,IAAAA,gDAA2B,EAAC,mCAAmCH;IAC/DG,IAAAA,gDAA2B,EAAC,mCAAmCH;IAC/D,OAAOI,IAAAA,iDAA4B,EAACJ;AACxC;AACAL,cAAcU,WAAW,GAAG"}
1
+ {"version":3,"sources":["OverlayDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\nimport { useOverlayDrawer_unstable } from './useOverlayDrawer';\nimport { renderOverlayDrawer_unstable } from './renderOverlayDrawer';\nimport { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles';\n/**\n * OverlayDrawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */ export const OverlayDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useOverlayDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n useOverlayDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerOverlayStyles_unstable')(state);\n useCustomStyleHook_unstable('useOverlayDrawerStyles_unstable')(state);\n return renderOverlayDrawer_unstable(state, contextValue);\n});\nOverlayDrawer.displayName = 'OverlayDrawer';\n"],"names":["OverlayDrawer","React","forwardRef","props","ref","state","useOverlayDrawer_unstable","contextValue","useDrawerContextValue","useOverlayDrawerStyles_unstable","useCustomStyleHook_unstable","renderOverlayDrawer_unstable","displayName"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;qCACqB;+BACN;kCACI;qCACG;8CACG;AAGrC,MAAMA,gBAAgB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACpE,MAAMC,QAAQC,IAAAA,2CAAyB,EAACH,OAAOC;IAC/C,MAAMG,eAAeC,IAAAA,oCAAqB;IAC1CC,IAAAA,6DAA+B,EAACJ;IAChCK,IAAAA,gDAA2B,EAAC,mCAAmCL;IAC/DK,IAAAA,gDAA2B,EAAC,mCAAmCL;IAC/D,OAAOM,IAAAA,iDAA4B,EAACN,OAAOE;AAC/C;AACAP,cAAcY,WAAW,GAAG"}
@@ -10,12 +10,16 @@ Object.defineProperty(exports, "renderOverlayDrawer_unstable", {
10
10
  });
11
11
  const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
- const renderOverlayDrawer_unstable = (state)=>{
13
+ const _drawerContext = require("../../contexts/drawerContext");
14
+ const renderOverlayDrawer_unstable = (state, contextValue)=>{
14
15
  if (!state.motion.canRender) {
15
16
  return null;
16
17
  }
17
18
  (0, _reactutilities.assertSlots)(state);
18
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dialog, {
19
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
19
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_drawerContext.DrawerProvider, {
20
+ value: contextValue,
21
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dialog, {
22
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
23
+ })
20
24
  });
21
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderOverlayDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of OverlayDrawer\n */ export const renderOverlayDrawer_unstable = (state)=>{\n if (!state.motion.canRender) {\n return null;\n }\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.dialog, {\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderOverlayDrawer_unstable","state","motion","canRender","assertSlots","_jsx","dialog","children","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,+BAA+B,CAACC;IAC7C,IAAI,CAACA,MAAMC,MAAM,CAACC,SAAS,EAAE;QACzB,OAAO;IACX;IACAC,IAAAA,2BAAW,EAACH;IACZ,OAAO,WAAW,GAAGI,IAAAA,eAAI,EAACJ,MAAMK,MAAM,EAAE;QACpCC,UAAU,WAAW,GAAGF,IAAAA,eAAI,EAACJ,MAAMO,IAAI,EAAE,CAAC;IAC9C;AACJ"}
1
+ {"version":3,"sources":["renderOverlayDrawer.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerProvider } from '../../contexts/drawerContext';\n/**\n * Render the final JSX of OverlayDrawer\n */ export const renderOverlayDrawer_unstable = (state, contextValue)=>{\n if (!state.motion.canRender) {\n return null;\n }\n assertSlots(state);\n return /*#__PURE__*/ _jsx(DrawerProvider, {\n value: contextValue,\n children: /*#__PURE__*/ _jsx(state.dialog, {\n children: /*#__PURE__*/ _jsx(state.root, {})\n })\n });\n};\n"],"names":["renderOverlayDrawer_unstable","state","contextValue","motion","canRender","assertSlots","_jsx","DrawerProvider","value","children","dialog","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;+BACG;AAGpB,MAAMA,+BAA+B,CAACC,OAAOC;IACpD,IAAI,CAACD,MAAME,MAAM,CAACC,SAAS,EAAE;QACzB,OAAO;IACX;IACAC,IAAAA,2BAAW,EAACJ;IACZ,OAAO,WAAW,GAAGK,IAAAA,eAAI,EAACC,6BAAc,EAAE;QACtCC,OAAON;QACPO,UAAU,WAAW,GAAGH,IAAAA,eAAI,EAACL,MAAMS,MAAM,EAAE;YACvCD,UAAU,WAAW,GAAGH,IAAAA,eAAI,EAACL,MAAMU,IAAI,EAAE,CAAC;QAC9C;IACJ;AACJ"}