@fluentui/react-drawer 9.1.11 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/dist/index.d.ts +16 -5
- package/lib/components/Drawer/Drawer.js +3 -1
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/renderDrawer.js +6 -2
- package/lib/components/Drawer/renderDrawer.js.map +1 -1
- package/lib/components/DrawerBody/useDrawerBody.js +49 -3
- package/lib/components/DrawerBody/useDrawerBody.js.map +1 -1
- package/lib/components/DrawerBody/useDrawerBodyStyles.styles.js +1 -1
- package/lib/components/DrawerBody/useDrawerBodyStyles.styles.js.map +1 -1
- package/lib/components/DrawerFooter/DrawerFooter.types.js.map +1 -1
- package/lib/components/DrawerFooter/useDrawerFooter.js +4 -1
- package/lib/components/DrawerFooter/useDrawerFooter.js.map +1 -1
- package/lib/components/DrawerFooter/useDrawerFooterStyles.styles.js +25 -3
- package/lib/components/DrawerFooter/useDrawerFooterStyles.styles.js.map +1 -1
- package/lib/components/DrawerHeader/DrawerHeader.types.js.map +1 -1
- package/lib/components/DrawerHeader/useDrawerHeader.js +4 -1
- package/lib/components/DrawerHeader/useDrawerHeader.js.map +1 -1
- package/lib/components/DrawerHeader/useDrawerHeaderStyles.styles.js +25 -3
- package/lib/components/DrawerHeader/useDrawerHeaderStyles.styles.js.map +1 -1
- package/lib/components/InlineDrawer/InlineDrawer.js +3 -1
- package/lib/components/InlineDrawer/InlineDrawer.js.map +1 -1
- package/lib/components/InlineDrawer/renderInlineDrawer.js +6 -2
- package/lib/components/InlineDrawer/renderInlineDrawer.js.map +1 -1
- package/lib/components/OverlayDrawer/OverlayDrawer.js +3 -1
- package/lib/components/OverlayDrawer/OverlayDrawer.js.map +1 -1
- package/lib/components/OverlayDrawer/renderOverlayDrawer.js +7 -3
- package/lib/components/OverlayDrawer/renderOverlayDrawer.js.map +1 -1
- package/lib/contexts/drawerContext.js +18 -0
- package/lib/contexts/drawerContext.js.map +1 -0
- package/lib/contexts/index.js +1 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/shared/DrawerBase.types.js.map +1 -1
- package/lib/shared/drawerSeparatorStyles.js +13 -0
- package/lib/shared/drawerSeparatorStyles.js.map +1 -0
- package/lib-commonjs/components/Drawer/Drawer.js +3 -1
- package/lib-commonjs/components/Drawer/Drawer.js.map +1 -1
- package/lib-commonjs/components/Drawer/renderDrawer.js +6 -2
- package/lib-commonjs/components/Drawer/renderDrawer.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/useDrawerBody.js +48 -2
- package/lib-commonjs/components/DrawerBody/useDrawerBody.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js +4 -4
- package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js +4 -1
- package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js +46 -3
- package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js +4 -1
- package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js +46 -3
- package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js.map +1 -1
- package/lib-commonjs/components/InlineDrawer/InlineDrawer.js +3 -1
- package/lib-commonjs/components/InlineDrawer/InlineDrawer.js.map +1 -1
- package/lib-commonjs/components/InlineDrawer/renderInlineDrawer.js +6 -2
- package/lib-commonjs/components/InlineDrawer/renderInlineDrawer.js.map +1 -1
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawer.js +3 -1
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawer.js.map +1 -1
- package/lib-commonjs/components/OverlayDrawer/renderOverlayDrawer.js +7 -3
- package/lib-commonjs/components/OverlayDrawer/renderOverlayDrawer.js.map +1 -1
- package/lib-commonjs/contexts/drawerContext.js +43 -0
- package/lib-commonjs/contexts/drawerContext.js.map +1 -0
- package/lib-commonjs/contexts/index.js +6 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/shared/drawerSeparatorStyles.js +23 -0
- package/lib-commonjs/shared/drawerSeparatorStyles.js.map +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,37 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-drawer
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 02 May 2024 11:31:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.2.0)
|
|
8
|
+
|
|
9
|
+
Thu, 02 May 2024 11:31:26 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.1.12..@fluentui/react-drawer_v9.2.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: move scroll detector to a dedicated react context ([PR #31156](https://github.com/microsoft/fluentui/pull/31156) by marcosvmmoura@gmail.com)
|
|
15
|
+
- Bump @fluentui/react-dialog to v9.10.2 ([PR #31231](https://github.com/microsoft/fluentui/pull/31231) by beachball)
|
|
16
|
+
- Bump @fluentui/react-tabster to v9.21.0 ([PR #31231](https://github.com/microsoft/fluentui/pull/31231) by beachball)
|
|
17
|
+
|
|
18
|
+
## [9.1.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.1.12)
|
|
19
|
+
|
|
20
|
+
Tue, 23 Apr 2024 08:17:49 GMT
|
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.1.11..@fluentui/react-drawer_v9.1.12)
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- Bump @fluentui/react-dialog to v9.10.1 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
26
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.36 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
27
|
+
- Bump @fluentui/react-motion-preview to v0.5.19 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
28
|
+
- Bump @fluentui/react-shared-contexts to v9.17.0 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
29
|
+
- Bump @fluentui/react-tabster to v9.20.1 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
30
|
+
- Bump @fluentui/react-utilities to v9.18.7 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
31
|
+
|
|
7
32
|
## [9.1.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.1.11)
|
|
8
33
|
|
|
9
|
-
Wed, 17 Apr 2024 21:
|
|
34
|
+
Wed, 17 Apr 2024 21:53:52 GMT
|
|
10
35
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.1.10..@fluentui/react-drawer_v9.1.11)
|
|
11
36
|
|
|
12
37
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,11 @@ export declare type DrawerBodySlots = {
|
|
|
68
68
|
*/
|
|
69
69
|
export declare type DrawerBodyState = ComponentState<DrawerBodySlots>;
|
|
70
70
|
|
|
71
|
+
declare type DrawerContextValue = {
|
|
72
|
+
scrollState: DrawerScrollState;
|
|
73
|
+
setScrollState: (scrollState: DrawerScrollState) => void;
|
|
74
|
+
};
|
|
75
|
+
|
|
71
76
|
/**
|
|
72
77
|
* DrawerFooter provides a structured footer for the drawer component.
|
|
73
78
|
*/
|
|
@@ -87,7 +92,9 @@ export declare type DrawerFooterSlots = {
|
|
|
87
92
|
/**
|
|
88
93
|
* State used in rendering DrawerFooter
|
|
89
94
|
*/
|
|
90
|
-
export declare type DrawerFooterState = ComponentState<DrawerFooterSlots
|
|
95
|
+
export declare type DrawerFooterState = ComponentState<DrawerFooterSlots> & {
|
|
96
|
+
scrollState: DrawerScrollState;
|
|
97
|
+
};
|
|
91
98
|
|
|
92
99
|
/**
|
|
93
100
|
* DrawerHeader provides a structured header for the drawer component.
|
|
@@ -132,7 +139,9 @@ export declare type DrawerHeaderSlots = {
|
|
|
132
139
|
/**
|
|
133
140
|
* State used in rendering DrawerHeader
|
|
134
141
|
*/
|
|
135
|
-
export declare type DrawerHeaderState = ComponentState<DrawerHeaderSlots
|
|
142
|
+
export declare type DrawerHeaderState = ComponentState<DrawerHeaderSlots> & {
|
|
143
|
+
scrollState: DrawerScrollState;
|
|
144
|
+
};
|
|
136
145
|
|
|
137
146
|
/**
|
|
138
147
|
* DrawerHeader provides a structured header for the drawer component.
|
|
@@ -179,6 +188,8 @@ export declare type DrawerProps = ComponentProps<DrawerSlots> & {
|
|
|
179
188
|
type?: 'inline' | 'overlay';
|
|
180
189
|
};
|
|
181
190
|
|
|
191
|
+
declare type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';
|
|
192
|
+
|
|
182
193
|
export declare type DrawerSlots = {
|
|
183
194
|
/**
|
|
184
195
|
* Root slot of the Drawer.
|
|
@@ -300,7 +311,7 @@ declare type OverlayDrawerSurfaceSlots = DialogSurfaceSlots;
|
|
|
300
311
|
/**
|
|
301
312
|
* Render the final JSX of Drawer
|
|
302
313
|
*/
|
|
303
|
-
export declare const renderDrawer_unstable: (state: DrawerState) => JSX.Element;
|
|
314
|
+
export declare const renderDrawer_unstable: (state: DrawerState, contextValue: DrawerContextValue) => JSX.Element;
|
|
304
315
|
|
|
305
316
|
/**
|
|
306
317
|
* Render the final JSX of DrawerBody
|
|
@@ -330,12 +341,12 @@ export declare const renderDrawerHeaderTitle_unstable: (state: DrawerHeaderTitle
|
|
|
330
341
|
/**
|
|
331
342
|
* Render the final JSX of InlineDrawer
|
|
332
343
|
*/
|
|
333
|
-
export declare const renderInlineDrawer_unstable: (state: InlineDrawerState) => JSX.Element | null;
|
|
344
|
+
export declare const renderInlineDrawer_unstable: (state: InlineDrawerState, contextValue: DrawerContextValue) => JSX.Element | null;
|
|
334
345
|
|
|
335
346
|
/**
|
|
336
347
|
* Render the final JSX of OverlayDrawer
|
|
337
348
|
*/
|
|
338
|
-
export declare const renderOverlayDrawer_unstable: (state: OverlayDrawerState) => JSX.Element | null;
|
|
349
|
+
export declare const renderOverlayDrawer_unstable: (state: OverlayDrawerState, contextValue: DrawerContextValue) => JSX.Element | null;
|
|
339
350
|
|
|
340
351
|
/**
|
|
341
352
|
* Create the state required to render Drawer.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
3
|
+
import { useDrawerContextValue } from '../../contexts/drawerContext';
|
|
3
4
|
import { useDrawer_unstable } from './useDrawer';
|
|
4
5
|
import { renderDrawer_unstable } from './renderDrawer';
|
|
5
6
|
import { useDrawerStyles_unstable } from './useDrawerStyles.styles';
|
|
@@ -7,8 +8,9 @@ import { useDrawerStyles_unstable } from './useDrawerStyles.styles';
|
|
|
7
8
|
* Drawer contains supplementary content and are used for complex creation, edit, or management experiences.
|
|
8
9
|
*/ export const Drawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
10
|
const state = useDrawer_unstable(props, ref);
|
|
11
|
+
const contextValue = useDrawerContextValue();
|
|
10
12
|
useDrawerStyles_unstable(state);
|
|
11
13
|
useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);
|
|
12
|
-
return renderDrawer_unstable(state);
|
|
14
|
+
return renderDrawer_unstable(state, contextValue);
|
|
13
15
|
});
|
|
14
16
|
Drawer.displayName = 'Drawer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useDrawer_unstable } from './useDrawer';\nimport { renderDrawer_unstable } from './renderDrawer';\nimport { useDrawerStyles_unstable } from './useDrawerStyles.styles';\nimport type { DrawerProps } from './Drawer.types';\n\n/**\n * Drawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const Drawer: ForwardRefComponent<DrawerProps> = React.forwardRef((props, ref) => {\n const state = useDrawer_unstable(props, ref);\n\n useDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);\n\n return renderDrawer_unstable(state);\n});\n\nDrawer.displayName = 'Drawer';\n"],"names":["React","useCustomStyleHook_unstable","useDrawer_unstable","renderDrawer_unstable","useDrawerStyles_unstable","Drawer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,2BAA2B;AAGpE;;CAEC,GACD,OAAO,MAAMC,
|
|
1
|
+
{"version":3,"sources":["Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\n\nimport { useDrawer_unstable } from './useDrawer';\nimport { renderDrawer_unstable } from './renderDrawer';\nimport { useDrawerStyles_unstable } from './useDrawerStyles.styles';\nimport type { DrawerProps } from './Drawer.types';\n\n/**\n * Drawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const Drawer: ForwardRefComponent<DrawerProps> = React.forwardRef((props, ref) => {\n const state = useDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n\n useDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);\n\n return renderDrawer_unstable(state, contextValue);\n});\n\nDrawer.displayName = 'Drawer';\n"],"names":["React","useCustomStyleHook_unstable","useDrawerContextValue","useDrawer_unstable","renderDrawer_unstable","useDrawerStyles_unstable","Drawer","forwardRef","props","ref","state","contextValue","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,qBAAqB,QAAQ,+BAA+B;AAErE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,2BAA2B;AAGpE;;CAEC,GACD,OAAO,MAAMC,uBAA2CN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,QAAQP,mBAAmBK,OAAOC;IACxC,MAAME,eAAeT;IAErBG,yBAAyBK;IACzBT,4BAA4B,4BAA4BS;IAExD,OAAON,sBAAsBM,OAAOC;AACtC,GAAG;AAEHL,OAAOM,WAAW,GAAG"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { DrawerProvider } from '../../contexts/drawerContext';
|
|
3
4
|
/**
|
|
4
5
|
* Render the final JSX of Drawer
|
|
5
|
-
*/ export const renderDrawer_unstable = (state)=>{
|
|
6
|
+
*/ export const renderDrawer_unstable = (state, contextValue)=>{
|
|
6
7
|
assertSlots(state);
|
|
7
|
-
return /*#__PURE__*/ _jsx(
|
|
8
|
+
return /*#__PURE__*/ _jsx(DrawerProvider, {
|
|
9
|
+
value: contextValue,
|
|
10
|
+
children: /*#__PURE__*/ _jsx(state.root, {})
|
|
11
|
+
});
|
|
8
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { DrawerState, DrawerSlots } from './Drawer.types';\n\n/**\n * Render the final JSX of Drawer\n */\nexport const renderDrawer_unstable = (state: DrawerState) => {\n assertSlots<DrawerSlots>(state);\n\n return <state.root
|
|
1
|
+
{"version":3,"sources":["renderDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerContextValue, DrawerProvider } from '../../contexts/drawerContext';\n\nimport type { DrawerState, DrawerSlots } from './Drawer.types';\n\n/**\n * Render the final JSX of Drawer\n */\nexport const renderDrawer_unstable = (state: DrawerState, contextValue: DrawerContextValue) => {\n assertSlots<DrawerSlots>(state);\n\n return (\n <DrawerProvider value={contextValue}>\n <state.root />\n </DrawerProvider>\n );\n};\n"],"names":["assertSlots","DrawerProvider","renderDrawer_unstable","state","contextValue","value","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAA6BC,cAAc,QAAQ,+BAA+B;AAIlF;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAoBC;IACxDJ,YAAyBG;IAEzB,qBACE,KAACF;QAAeI,OAAOD;kBACrB,cAAA,KAACD,MAAMG,IAAI;;AAGjB,EAAE"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { mergeCallbacks, slot, useAnimationFrame, useMergedRefs, useIsomorphicLayoutEffect, getIntrinsicElementProps } from '@fluentui/react-utilities';
|
|
3
|
+
import { useDrawerContext_unstable } from '../../contexts/drawerContext';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*
|
|
7
|
+
* Get the current scroll state of the DrawerBody.
|
|
8
|
+
*
|
|
9
|
+
* @param param0 - HTMLElement to check scroll state of
|
|
10
|
+
*/ const getScrollState = ({ scrollTop, scrollHeight, clientHeight })=>{
|
|
11
|
+
if (scrollHeight <= clientHeight) {
|
|
12
|
+
return 'none';
|
|
13
|
+
}
|
|
14
|
+
if (scrollTop === 0) {
|
|
15
|
+
return 'top';
|
|
16
|
+
}
|
|
17
|
+
if (scrollTop + clientHeight === scrollHeight) {
|
|
18
|
+
return 'bottom';
|
|
19
|
+
}
|
|
20
|
+
return 'middle';
|
|
21
|
+
};
|
|
3
22
|
/**
|
|
4
23
|
* Create the state required to render DrawerBody.
|
|
5
24
|
*
|
|
@@ -9,6 +28,32 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
9
28
|
* @param props - props from this instance of DrawerBody
|
|
10
29
|
* @param ref - reference to root HTMLElement of DrawerBody
|
|
11
30
|
*/ export const useDrawerBody_unstable = (props, ref)=>{
|
|
31
|
+
const { setScrollState } = useDrawerContext_unstable();
|
|
32
|
+
const scrollRef = React.useRef(null);
|
|
33
|
+
const [setAnimationFrame, cancelAnimationFrame] = useAnimationFrame();
|
|
34
|
+
const onScroll = React.useCallback(()=>{
|
|
35
|
+
cancelAnimationFrame();
|
|
36
|
+
setAnimationFrame(()=>{
|
|
37
|
+
if (!scrollRef.current) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
setScrollState(getScrollState(scrollRef.current));
|
|
41
|
+
});
|
|
42
|
+
}, [
|
|
43
|
+
cancelAnimationFrame,
|
|
44
|
+
setAnimationFrame,
|
|
45
|
+
setScrollState
|
|
46
|
+
]);
|
|
47
|
+
useIsomorphicLayoutEffect(()=>{
|
|
48
|
+
if (!scrollRef.current) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setScrollState(getScrollState(scrollRef.current));
|
|
52
|
+
return ()=>cancelAnimationFrame();
|
|
53
|
+
}, [
|
|
54
|
+
cancelAnimationFrame,
|
|
55
|
+
setScrollState
|
|
56
|
+
]);
|
|
12
57
|
return {
|
|
13
58
|
components: {
|
|
14
59
|
root: 'div'
|
|
@@ -17,8 +62,9 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
17
62
|
// FIXME:
|
|
18
63
|
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
|
|
19
64
|
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
|
|
20
|
-
ref: ref,
|
|
21
|
-
...props
|
|
65
|
+
ref: useMergedRefs(ref, scrollRef),
|
|
66
|
+
...props,
|
|
67
|
+
onScroll: mergeCallbacks(props.onScroll, onScroll)
|
|
22
68
|
}), {
|
|
23
69
|
elementType: 'div'
|
|
24
70
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerBody.ts"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["useDrawerBody.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n mergeCallbacks,\n slot,\n useAnimationFrame,\n useMergedRefs,\n useIsomorphicLayoutEffect,\n getIntrinsicElementProps,\n} from '@fluentui/react-utilities';\n\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\nimport { DrawerScrollState } from '../../shared/DrawerBase.types';\n\nimport type { DrawerBodyProps, DrawerBodyState } from './DrawerBody.types';\n\n/**\n * @internal\n *\n * Get the current scroll state of the DrawerBody.\n *\n * @param param0 - HTMLElement to check scroll state of\n */\nconst getScrollState = ({ scrollTop, scrollHeight, clientHeight }: HTMLElement): DrawerScrollState => {\n if (scrollHeight <= clientHeight) {\n return 'none';\n }\n\n if (scrollTop === 0) {\n return 'top';\n }\n\n if (scrollTop + clientHeight === scrollHeight) {\n return 'bottom';\n }\n\n return 'middle';\n};\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 */\nexport const useDrawerBody_unstable = (props: DrawerBodyProps, ref: React.Ref<HTMLElement>): DrawerBodyState => {\n const { setScrollState } = useDrawerContext_unstable();\n\n const scrollRef = React.useRef<HTMLDivElement | null>(null);\n const [setAnimationFrame, cancelAnimationFrame] = useAnimationFrame();\n\n const onScroll = React.useCallback(() => {\n cancelAnimationFrame();\n setAnimationFrame(() => {\n if (!scrollRef.current) {\n return;\n }\n\n setScrollState(getScrollState(scrollRef.current));\n });\n }, [cancelAnimationFrame, setAnimationFrame, setScrollState]);\n\n useIsomorphicLayoutEffect(() => {\n if (!scrollRef.current) {\n return;\n }\n\n setScrollState(getScrollState(scrollRef.current));\n\n return () => cancelAnimationFrame();\n }, [cancelAnimationFrame, setScrollState]);\n\n return {\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getIntrinsicElementProps<DrawerBodyProps>('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<HTMLDivElement>(ref as React.Ref<HTMLDivElement>, scrollRef),\n ...props,\n onScroll: mergeCallbacks(props.onScroll, onScroll),\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","mergeCallbacks","slot","useAnimationFrame","useMergedRefs","useIsomorphicLayoutEffect","getIntrinsicElementProps","useDrawerContext_unstable","getScrollState","scrollTop","scrollHeight","clientHeight","useDrawerBody_unstable","props","ref","setScrollState","scrollRef","useRef","setAnimationFrame","cancelAnimationFrame","onScroll","useCallback","current","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,cAAc,EACdC,IAAI,EACJC,iBAAiB,EACjBC,aAAa,EACbC,yBAAyB,EACzBC,wBAAwB,QACnB,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,+BAA+B;AAKzE;;;;;;CAMC,GACD,MAAMC,iBAAiB,CAAC,EAAEC,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAe;IAC5E,IAAID,gBAAgBC,cAAc;QAChC,OAAO;IACT;IAEA,IAAIF,cAAc,GAAG;QACnB,OAAO;IACT;IAEA,IAAIA,YAAYE,iBAAiBD,cAAc;QAC7C,OAAO;IACT;IAEA,OAAO;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAME,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,cAAc,EAAE,GAAGR;IAE3B,MAAMS,YAAYhB,MAAMiB,MAAM,CAAwB;IACtD,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGhB;IAElD,MAAMiB,WAAWpB,MAAMqB,WAAW,CAAC;QACjCF;QACAD,kBAAkB;YAChB,IAAI,CAACF,UAAUM,OAAO,EAAE;gBACtB;YACF;YAEAP,eAAeP,eAAeQ,UAAUM,OAAO;QACjD;IACF,GAAG;QAACH;QAAsBD;QAAmBH;KAAe;IAE5DV,0BAA0B;QACxB,IAAI,CAACW,UAAUM,OAAO,EAAE;YACtB;QACF;QAEAP,eAAeP,eAAeQ,UAAUM,OAAO;QAE/C,OAAO,IAAMH;IACf,GAAG;QAACA;QAAsBJ;KAAe;IAEzC,OAAO;QACLQ,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMtB,KAAKuB,MAAM,CACfnB,yBAA0C,OAAO;YAC/C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FQ,KAAKV,cAA8BU,KAAkCE;YACrE,GAAGH,KAAK;YACRO,UAAUnB,eAAeY,MAAMO,QAAQ,EAAEA;QAC3C,IACA;YAAEM,aAAa;QAAM;IAEzB;AACF,EAAE"}
|
|
@@ -6,7 +6,7 @@ export const drawerBodyClassNames = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Styles for the root slot
|
|
8
8
|
*/
|
|
9
|
-
const useStyles = /*#__PURE__*/__resetStyles("
|
|
9
|
+
const 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);}"]);
|
|
10
10
|
/**
|
|
11
11
|
* Apply styling to the DrawerBody slots based on the state
|
|
12
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","mergeClasses","tokens","drawerBodyClassNames","root","useStyles","useDrawerBodyStyles_unstable","state","styles","className"],"sources":["useDrawerBodyStyles.styles.js"],"sourcesContent":["import { 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
|
|
1
|
+
{"version":3,"names":["__resetStyles","mergeClasses","tokens","drawerBodyClassNames","root","useStyles","useDrawerBodyStyles_unstable","state","styles","className"],"sources":["useDrawerBodyStyles.styles.js"],"sourcesContent":["import { 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 const styles = useStyles();\n state.root.className = mergeClasses(drawerBodyClassNames.root, styles, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,aAAA,wSAarB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMM,4BAA4B,GAAIC,KAAK,IAAG;EACrD,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC;EAC1BE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGR,YAAY,CAACE,oBAAoB,CAACC,IAAI,EAAEI,MAAM,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC5F,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerFooter.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DrawerFooterSlots = {\n root: Slot<'footer'>;\n};\n\n/**\n * DrawerFooter Props\n */\nexport type DrawerFooterProps = ComponentProps<DrawerFooterSlots>;\n\n/**\n * State used in rendering DrawerFooter\n */\nexport type DrawerFooterState = ComponentState<DrawerFooterSlots
|
|
1
|
+
{"version":3,"sources":["DrawerFooter.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DrawerScrollState } from '../../shared/DrawerBase.types';\n\nexport type DrawerFooterSlots = {\n root: Slot<'footer'>;\n};\n\n/**\n * DrawerFooter Props\n */\nexport type DrawerFooterProps = ComponentProps<DrawerFooterSlots>;\n\n/**\n * State used in rendering DrawerFooter\n */\nexport type DrawerFooterState = ComponentState<DrawerFooterSlots> & {\n scrollState: DrawerScrollState;\n};\n"],"names":[],"mappings":"AAAA,WAiBE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
3
|
+
import { useDrawerContext_unstable } from '../../contexts/drawerContext';
|
|
3
4
|
/**
|
|
4
5
|
* Create the state required to render DrawerFooter.
|
|
5
6
|
*
|
|
@@ -9,6 +10,7 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
9
10
|
* @param props - props from this instance of DrawerFooter
|
|
10
11
|
* @param ref - reference to root HTMLElement of DrawerFooter
|
|
11
12
|
*/ export const useDrawerFooter_unstable = (props, ref)=>{
|
|
13
|
+
const { scrollState } = useDrawerContext_unstable();
|
|
12
14
|
return {
|
|
13
15
|
components: {
|
|
14
16
|
root: 'footer'
|
|
@@ -18,6 +20,7 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
18
20
|
...props
|
|
19
21
|
}), {
|
|
20
22
|
elementType: 'footer'
|
|
21
|
-
})
|
|
23
|
+
}),
|
|
24
|
+
scrollState
|
|
22
25
|
};
|
|
23
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerFooter.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { DrawerFooterProps, DrawerFooterState } from './DrawerFooter.types';\n\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 */\nexport const useDrawerFooter_unstable = (props: DrawerFooterProps, ref: React.Ref<HTMLElement>): DrawerFooterState => {\n return {\n components: {\n root: 'footer',\n },\n\n root: slot.always(\n getIntrinsicElementProps('footer', {\n ref,\n ...props,\n }),\n { elementType: 'footer' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useDrawerFooter_unstable","props","ref","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"sources":["useDrawerFooter.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { DrawerFooterProps, DrawerFooterState } from './DrawerFooter.types';\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\n\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 */\nexport const useDrawerFooter_unstable = (props: DrawerFooterProps, ref: React.Ref<HTMLElement>): DrawerFooterState => {\n const { scrollState } = useDrawerContext_unstable();\n\n return {\n components: {\n root: 'footer',\n },\n\n root: slot.always(\n getIntrinsicElementProps('footer', {\n ref,\n ...props,\n }),\n { elementType: 'footer' },\n ),\n\n scrollState,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useDrawerContext_unstable","useDrawerFooter_unstable","props","ref","scrollState","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E,SAASC,yBAAyB,QAAQ,+BAA+B;AAEzE;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EAAEC,WAAW,EAAE,GAAGJ;IAExB,OAAO;QACLK,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMP,KAAKQ,MAAM,CACfT,yBAAyB,UAAU;YACjCK;YACA,GAAGD,KAAK;QACV,IACA;YAAEM,aAAa;QAAS;QAG1BJ;IACF;AACF,EAAE"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
import { __resetStyles, mergeClasses } from '@griffel/react';
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
import { drawerSeparatorStyles } from '../../shared/drawerSeparatorStyles';
|
|
3
4
|
export const drawerFooterClassNames = {
|
|
4
5
|
root: 'fui-DrawerFooter'
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Styles for the root slot
|
|
8
9
|
*/
|
|
9
|
-
const useStyles = /*#__PURE__*/__resetStyles("
|
|
10
|
+
const 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;}"]);
|
|
11
|
+
const useDrawerFooterStyles = /*#__PURE__*/__styles({
|
|
12
|
+
separator: {
|
|
13
|
+
Bbc2r3f: "fhufbb2",
|
|
14
|
+
xx9plb: "fxf9f1y",
|
|
15
|
+
qd6xl9: ["fmlx6bj", "f1t0u0az"],
|
|
16
|
+
Byque4d: ["f1t0u0az", "fmlx6bj"],
|
|
17
|
+
ngabwx: "f1429bq1",
|
|
18
|
+
B1dvbpk: "fv3cwj",
|
|
19
|
+
B5szp9g: "f1ayei5p",
|
|
20
|
+
iukgx1: "fkgtggm",
|
|
21
|
+
Br7k87z: "f44t985",
|
|
22
|
+
rurcny: "fuzzvh5",
|
|
23
|
+
Bf8kmfk: "f14oqhab"
|
|
24
|
+
},
|
|
25
|
+
separatorVisible: {
|
|
26
|
+
ngabwx: "f3ve9t9"
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
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;}"]
|
|
30
|
+
});
|
|
10
31
|
/**
|
|
11
32
|
* Apply styling to the DrawerFooter slots based on the state
|
|
12
33
|
*/
|
|
13
34
|
export const useDrawerFooterStyles_unstable = state => {
|
|
14
35
|
const styles = useStyles();
|
|
15
|
-
|
|
36
|
+
const rootStyles = useDrawerFooterStyles();
|
|
37
|
+
state.root.className = mergeClasses(drawerFooterClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, ['middle', 'top'].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);
|
|
16
38
|
return state;
|
|
17
39
|
};
|
|
18
40
|
//# sourceMappingURL=useDrawerFooterStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","mergeClasses","tokens","drawerFooterClassNames","root","useStyles","useDrawerFooterStyles_unstable","state","styles","className"],"sources":["useDrawerFooterStyles.styles.js"],"sourcesContent":["import { makeResetStyles, 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 */ const useStyles = makeResetStyles({\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalXXL} ${tokens.spacingVerticalXXL}`,\n
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","drawerSeparatorStyles","drawerFooterClassNames","root","useStyles","useDrawerFooterStyles","separator","Bbc2r3f","xx9plb","qd6xl9","Byque4d","ngabwx","B1dvbpk","B5szp9g","iukgx1","Br7k87z","rurcny","Bf8kmfk","separatorVisible","d","useDrawerFooterStyles_unstable","state","styles","rootStyles","className","scrollState","includes"],"sources":["useDrawerFooterStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, 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 */ const useStyles = makeResetStyles({\n width: '100%',\n maxWidth: '100%',\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalXXL} ${tokens.spacingVerticalXXL}`,\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalS,\n boxSizing: 'border-box',\n position: 'relative',\n zIndex: 2\n});\nconst useDrawerFooterStyles = makeStyles({\n separator: {\n ':before': {\n ...drawerSeparatorStyles,\n top: 0\n }\n },\n separatorVisible: {\n ':before': {\n opacity: 1\n }\n }\n});\n/**\n * Apply styling to the DrawerFooter slots based on the state\n */ export 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, [\n 'middle',\n 'top'\n ].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGP,aAAA,oSAWrB,CAAC;AACF,MAAMQ,qBAAqB,gBAAGP,QAAA;EAAAQ,SAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,gBAAA;IAAAP,MAAA;EAAA;AAAA;EAAAQ,CAAA;AAAA,CAY7B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,MAAMC,MAAM,GAAGlB,SAAS,CAAC,CAAC;EAC1B,MAAMmB,UAAU,GAAGlB,qBAAqB,CAAC,CAAC;EAC1CgB,KAAK,CAAClB,IAAI,CAACqB,SAAS,GAAGzB,YAAY,CAACG,sBAAsB,CAACC,IAAI,EAAEmB,MAAM,EAAED,KAAK,CAACI,WAAW,KAAK,MAAM,IAAIF,UAAU,CAACjB,SAAS,EAAE,CAC3H,QAAQ,EACR,KAAK,CACR,CAACoB,QAAQ,CAACL,KAAK,CAACI,WAAW,CAAC,IAAIF,UAAU,CAACL,gBAAgB,EAAEG,KAAK,CAAClB,IAAI,CAACqB,SAAS,CAAC;EACnF,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DrawerHeaderSlots = {\n /**\n * The root of the DrawerHeader.\n */\n root: Slot<'header'>;\n};\n\n/**\n * DrawerHeader Props\n */\nexport type DrawerHeaderProps = ComponentProps<DrawerHeaderSlots>;\n\n/**\n * State used in rendering DrawerHeader\n */\nexport type DrawerHeaderState = ComponentState<DrawerHeaderSlots
|
|
1
|
+
{"version":3,"sources":["DrawerHeader.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport { DrawerScrollState } from '../../shared/DrawerBase.types';\n\nexport type DrawerHeaderSlots = {\n /**\n * The root of the DrawerHeader.\n */\n root: Slot<'header'>;\n};\n\n/**\n * DrawerHeader Props\n */\nexport type DrawerHeaderProps = ComponentProps<DrawerHeaderSlots>;\n\n/**\n * State used in rendering DrawerHeader\n */\nexport type DrawerHeaderState = ComponentState<DrawerHeaderSlots> & {\n scrollState: DrawerScrollState;\n};\n"],"names":[],"mappings":"AAAA,WAqBE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
3
|
+
import { useDrawerContext_unstable } from '../../contexts/drawerContext';
|
|
3
4
|
/**
|
|
4
5
|
* Create the state required to render DrawerHeader.
|
|
5
6
|
*
|
|
@@ -9,6 +10,7 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
9
10
|
* @param props - props from this instance of DrawerHeader
|
|
10
11
|
* @param ref - reference to root HTMLElement of DrawerHeader
|
|
11
12
|
*/ export const useDrawerHeader_unstable = (props, ref)=>{
|
|
13
|
+
const { scrollState } = useDrawerContext_unstable();
|
|
12
14
|
return {
|
|
13
15
|
components: {
|
|
14
16
|
root: 'header'
|
|
@@ -18,6 +20,7 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
|
|
|
18
20
|
...props
|
|
19
21
|
}), {
|
|
20
22
|
elementType: 'header'
|
|
21
|
-
})
|
|
23
|
+
}),
|
|
24
|
+
scrollState
|
|
22
25
|
};
|
|
23
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { DrawerHeaderProps, DrawerHeaderState } from './DrawerHeader.types';\n\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 */\nexport const useDrawerHeader_unstable = (props: DrawerHeaderProps, ref: React.Ref<HTMLElement>): DrawerHeaderState => {\n return {\n components: {\n root: 'header',\n },\n\n root: slot.always(\n getIntrinsicElementProps('header', {\n ref,\n ...props,\n }),\n { elementType: 'header' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useDrawerHeader_unstable","props","ref","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"sources":["useDrawerHeader.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport { useDrawerContext_unstable } from '../../contexts/drawerContext';\n\nimport type { DrawerHeaderProps, DrawerHeaderState } from './DrawerHeader.types';\n\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 */\nexport const useDrawerHeader_unstable = (props: DrawerHeaderProps, ref: React.Ref<HTMLElement>): DrawerHeaderState => {\n const { scrollState } = useDrawerContext_unstable();\n\n return {\n components: {\n root: 'header',\n },\n\n root: slot.always(\n getIntrinsicElementProps('header', {\n ref,\n ...props,\n }),\n { elementType: 'header' },\n ),\n\n scrollState,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useDrawerContext_unstable","useDrawerHeader_unstable","props","ref","scrollState","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,yBAAyB,QAAQ,+BAA+B;AAIzE;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EAAEC,WAAW,EAAE,GAAGJ;IAExB,OAAO;QACLK,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMP,KAAKQ,MAAM,CACfT,yBAAyB,UAAU;YACjCK;YACA,GAAGD,KAAK;QACV,IACA;YAAEM,aAAa;QAAS;QAG1BJ;IACF;AACF,EAAE"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
import { __resetStyles, mergeClasses } from '@griffel/react';
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
import { drawerSeparatorStyles } from '../../shared/drawerSeparatorStyles';
|
|
3
4
|
export const drawerHeaderClassNames = {
|
|
4
5
|
root: 'fui-DrawerHeader'
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Styles for the root slot
|
|
8
9
|
*/
|
|
9
|
-
const useStyles = /*#__PURE__*/__resetStyles("
|
|
10
|
+
const 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;}"]);
|
|
11
|
+
const useDrawerHeaderStyles = /*#__PURE__*/__styles({
|
|
12
|
+
separator: {
|
|
13
|
+
mpb1vu: "f1bc0r91",
|
|
14
|
+
Hdbjpj: "f11ef69",
|
|
15
|
+
cnmfks: ["f15lyva8", "f1cvlmu2"],
|
|
16
|
+
jc51t6: ["f1cvlmu2", "f15lyva8"],
|
|
17
|
+
Bmyypfa: "f9pox2d",
|
|
18
|
+
Bkbwdz4: "f1swzn7y",
|
|
19
|
+
mafdb0: "f1pb4rwf",
|
|
20
|
+
wbfbqe: "fsav6n4",
|
|
21
|
+
Jgwf15: "f1iuoiuj",
|
|
22
|
+
Bs6t6z0: "fqc6z8f",
|
|
23
|
+
Bj55yzk: "fw2wsqs"
|
|
24
|
+
},
|
|
25
|
+
separatorVisible: {
|
|
26
|
+
Bmyypfa: "frwhdur"
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
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;}"]
|
|
30
|
+
});
|
|
10
31
|
/**
|
|
11
32
|
* Apply styling to the DrawerHeader slots based on the state
|
|
12
33
|
*/
|
|
13
34
|
export const useDrawerHeaderStyles_unstable = state => {
|
|
14
35
|
const styles = useStyles();
|
|
15
|
-
|
|
36
|
+
const rootStyles = useDrawerHeaderStyles();
|
|
37
|
+
state.root.className = mergeClasses(drawerHeaderClassNames.root, styles, state.scrollState !== 'none' && rootStyles.separator, ['middle', 'bottom'].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);
|
|
16
38
|
return state;
|
|
17
39
|
};
|
|
18
40
|
//# sourceMappingURL=useDrawerHeaderStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","mergeClasses","tokens","drawerHeaderClassNames","root","useStyles","useDrawerHeaderStyles_unstable","state","styles","className"],"sources":["useDrawerHeaderStyles.styles.js"],"sourcesContent":["import { makeResetStyles, 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 */ const useStyles = makeResetStyles({\n padding: `${tokens.spacingVerticalXXL} ${tokens.spacingHorizontalXXL} ${tokens.spacingVerticalS}`,\n gap: tokens.spacingHorizontalS,\n
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","drawerSeparatorStyles","drawerHeaderClassNames","root","useStyles","useDrawerHeaderStyles","separator","mpb1vu","Hdbjpj","cnmfks","jc51t6","Bmyypfa","Bkbwdz4","mafdb0","wbfbqe","Jgwf15","Bs6t6z0","Bj55yzk","separatorVisible","d","useDrawerHeaderStyles_unstable","state","styles","rootStyles","className","scrollState","includes"],"sources":["useDrawerHeaderStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, 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 */ const useStyles = makeResetStyles({\n width: '100%',\n maxWidth: '100%',\n padding: `${tokens.spacingVerticalXXL} ${tokens.spacingHorizontalXXL} ${tokens.spacingVerticalS}`,\n gap: tokens.spacingHorizontalS,\n alignSelf: 'stretch',\n display: 'flex',\n flexDirection: 'column',\n boxSizing: 'border-box',\n position: 'relative',\n zIndex: 2\n});\nconst useDrawerHeaderStyles = makeStyles({\n separator: {\n ':after': {\n ...drawerSeparatorStyles,\n bottom: 0\n }\n },\n separatorVisible: {\n ':after': {\n opacity: 1\n }\n }\n});\n/**\n * Apply styling to the DrawerHeader slots based on the state\n */ export 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, [\n 'middle',\n 'bottom'\n ].includes(state.scrollState) && rootStyles.separatorVisible, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGP,aAAA,sRAWrB,CAAC;AACF,MAAMQ,qBAAqB,gBAAGP,QAAA;EAAAQ,SAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,gBAAA;IAAAP,OAAA;EAAA;AAAA;EAAAQ,CAAA;AAAA,CAY7B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,MAAMC,MAAM,GAAGlB,SAAS,CAAC,CAAC;EAC1B,MAAMmB,UAAU,GAAGlB,qBAAqB,CAAC,CAAC;EAC1CgB,KAAK,CAAClB,IAAI,CAACqB,SAAS,GAAGzB,YAAY,CAACG,sBAAsB,CAACC,IAAI,EAAEmB,MAAM,EAAED,KAAK,CAACI,WAAW,KAAK,MAAM,IAAIF,UAAU,CAACjB,SAAS,EAAE,CAC3H,QAAQ,EACR,QAAQ,CACX,CAACoB,QAAQ,CAACL,KAAK,CAACI,WAAW,CAAC,IAAIF,UAAU,CAACL,gBAAgB,EAAEG,KAAK,CAAClB,IAAI,CAACqB,SAAS,CAAC;EACnF,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
3
|
+
import { useDrawerContextValue } from '../../contexts/drawerContext';
|
|
3
4
|
import { useInlineDrawer_unstable } from './useInlineDrawer';
|
|
4
5
|
import { renderInlineDrawer_unstable } from './renderInlineDrawer';
|
|
5
6
|
import { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';
|
|
@@ -8,9 +9,10 @@ import { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';
|
|
|
8
9
|
* the main surface, users can still interact with other UI elements.
|
|
9
10
|
*/ export const InlineDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
10
11
|
const state = useInlineDrawer_unstable(props, ref);
|
|
12
|
+
const contextValue = useDrawerContextValue();
|
|
11
13
|
useInlineDrawerStyles_unstable(state);
|
|
12
14
|
useCustomStyleHook_unstable('useDrawerInlineStyles_unstable')(state);
|
|
13
15
|
useCustomStyleHook_unstable('useInlineDrawerStyles_unstable')(state);
|
|
14
|
-
return renderInlineDrawer_unstable(state);
|
|
16
|
+
return renderInlineDrawer_unstable(state, contextValue);
|
|
15
17
|
});
|
|
16
18
|
InlineDrawer.displayName = 'InlineDrawer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["InlineDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport type { InlineDrawerProps } from './InlineDrawer.types';\nimport { useInlineDrawer_unstable } from './useInlineDrawer';\nimport { renderInlineDrawer_unstable } from './renderInlineDrawer';\nimport { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';\n\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 */\nexport const InlineDrawer: ForwardRefComponent<InlineDrawerProps> = React.forwardRef((props, ref) => {\n const state = useInlineDrawer_unstable(props, ref);\n\n useInlineDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerInlineStyles_unstable')(state);\n useCustomStyleHook_unstable('useInlineDrawerStyles_unstable')(state);\n\n return renderInlineDrawer_unstable(state);\n});\n\nInlineDrawer.displayName = 'InlineDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useInlineDrawer_unstable","renderInlineDrawer_unstable","useInlineDrawerStyles_unstable","InlineDrawer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;
|
|
1
|
+
{"version":3,"sources":["InlineDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\n\nimport type { InlineDrawerProps } from './InlineDrawer.types';\nimport { useInlineDrawer_unstable } from './useInlineDrawer';\nimport { renderInlineDrawer_unstable } from './renderInlineDrawer';\nimport { useInlineDrawerStyles_unstable } from './useInlineDrawerStyles.styles';\n\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 */\nexport const InlineDrawer: ForwardRefComponent<InlineDrawerProps> = React.forwardRef((props, ref) => {\n const state = useInlineDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n\n useInlineDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerInlineStyles_unstable')(state);\n useCustomStyleHook_unstable('useInlineDrawerStyles_unstable')(state);\n\n return renderInlineDrawer_unstable(state, contextValue);\n});\n\nInlineDrawer.displayName = 'InlineDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useDrawerContextValue","useInlineDrawer_unstable","renderInlineDrawer_unstable","useInlineDrawerStyles_unstable","InlineDrawer","forwardRef","props","ref","state","contextValue","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,qBAAqB,QAAQ,+BAA+B;AAGrE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAEhF;;;CAGC,GACD,OAAO,MAAMC,6BAAuDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQP,yBAAyBK,OAAOC;IAC9C,MAAME,eAAeT;IAErBG,+BAA+BK;IAC/BT,4BAA4B,kCAAkCS;IAC9DT,4BAA4B,kCAAkCS;IAE9D,OAAON,4BAA4BM,OAAOC;AAC5C,GAAG;AAEHL,aAAaM,WAAW,GAAG"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { DrawerProvider } from '../../contexts/drawerContext';
|
|
3
4
|
/**
|
|
4
5
|
* Render the final JSX of InlineDrawer
|
|
5
|
-
*/ export const renderInlineDrawer_unstable = (state)=>{
|
|
6
|
+
*/ export const renderInlineDrawer_unstable = (state, contextValue)=>{
|
|
6
7
|
if (!state.motion.canRender) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
10
|
assertSlots(state);
|
|
10
|
-
return /*#__PURE__*/ _jsx(
|
|
11
|
+
return /*#__PURE__*/ _jsx(DrawerProvider, {
|
|
12
|
+
value: contextValue,
|
|
13
|
+
children: /*#__PURE__*/ _jsx(state.root, {})
|
|
14
|
+
});
|
|
11
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderInlineDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { InlineDrawerState, InlineDrawerSlots } from './InlineDrawer.types';\n\n/**\n * Render the final JSX of InlineDrawer\n */\nexport const renderInlineDrawer_unstable = (state: InlineDrawerState) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<InlineDrawerSlots>(state);\n\n return <state.root
|
|
1
|
+
{"version":3,"sources":["renderInlineDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerContextValue, DrawerProvider } from '../../contexts/drawerContext';\n\nimport type { InlineDrawerState, InlineDrawerSlots } from './InlineDrawer.types';\n\n/**\n * Render the final JSX of InlineDrawer\n */\nexport const renderInlineDrawer_unstable = (state: InlineDrawerState, contextValue: DrawerContextValue) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<InlineDrawerSlots>(state);\n\n return (\n <DrawerProvider value={contextValue}>\n <state.root />\n </DrawerProvider>\n );\n};\n"],"names":["assertSlots","DrawerProvider","renderInlineDrawer_unstable","state","contextValue","motion","canRender","value","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAA6BC,cAAc,QAAQ,+BAA+B;AAIlF;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC,OAA0BC;IACpE,IAAI,CAACD,MAAME,MAAM,CAACC,SAAS,EAAE;QAC3B,OAAO;IACT;IAEAN,YAA+BG;IAE/B,qBACE,KAACF;QAAeM,OAAOH;kBACrB,cAAA,KAACD,MAAMK,IAAI;;AAGjB,EAAE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
3
|
+
import { useDrawerContextValue } from '../../contexts/drawerContext';
|
|
3
4
|
import { useOverlayDrawer_unstable } from './useOverlayDrawer';
|
|
4
5
|
import { renderOverlayDrawer_unstable } from './renderOverlayDrawer';
|
|
5
6
|
import { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles';
|
|
@@ -7,9 +8,10 @@ import { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles
|
|
|
7
8
|
* OverlayDrawer contains supplementary content and are used for complex creation, edit, or management experiences.
|
|
8
9
|
*/ export const OverlayDrawer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
10
|
const state = useOverlayDrawer_unstable(props, ref);
|
|
11
|
+
const contextValue = useDrawerContextValue();
|
|
10
12
|
useOverlayDrawerStyles_unstable(state);
|
|
11
13
|
useCustomStyleHook_unstable('useDrawerOverlayStyles_unstable')(state);
|
|
12
14
|
useCustomStyleHook_unstable('useOverlayDrawerStyles_unstable')(state);
|
|
13
|
-
return renderOverlayDrawer_unstable(state);
|
|
15
|
+
return renderOverlayDrawer_unstable(state, contextValue);
|
|
14
16
|
});
|
|
15
17
|
OverlayDrawer.displayName = 'OverlayDrawer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["OverlayDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useOverlayDrawer_unstable } from './useOverlayDrawer';\nimport { renderOverlayDrawer_unstable } from './renderOverlayDrawer';\nimport { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles';\nimport type { OverlayDrawerProps } from './OverlayDrawer.types';\n\n/**\n * OverlayDrawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const OverlayDrawer: ForwardRefComponent<OverlayDrawerProps> = React.forwardRef((props, ref) => {\n const state = useOverlayDrawer_unstable(props, ref);\n\n useOverlayDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerOverlayStyles_unstable')(state);\n useCustomStyleHook_unstable('useOverlayDrawerStyles_unstable')(state);\n\n return renderOverlayDrawer_unstable(state);\n});\n\nOverlayDrawer.displayName = 'OverlayDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useOverlayDrawer_unstable","renderOverlayDrawer_unstable","useOverlayDrawerStyles_unstable","OverlayDrawer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAGlF;;CAEC,GACD,OAAO,MAAMC,
|
|
1
|
+
{"version":3,"sources":["OverlayDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\n\nimport { useOverlayDrawer_unstable } from './useOverlayDrawer';\nimport { renderOverlayDrawer_unstable } from './renderOverlayDrawer';\nimport { useOverlayDrawerStyles_unstable } from './useOverlayDrawerStyles.styles';\nimport type { OverlayDrawerProps } from './OverlayDrawer.types';\n\n/**\n * OverlayDrawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const OverlayDrawer: ForwardRefComponent<OverlayDrawerProps> = React.forwardRef((props, ref) => {\n const state = useOverlayDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n\n useOverlayDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerOverlayStyles_unstable')(state);\n useCustomStyleHook_unstable('useOverlayDrawerStyles_unstable')(state);\n\n return renderOverlayDrawer_unstable(state, contextValue);\n});\n\nOverlayDrawer.displayName = 'OverlayDrawer';\n"],"names":["React","useCustomStyleHook_unstable","useDrawerContextValue","useOverlayDrawer_unstable","renderOverlayDrawer_unstable","useOverlayDrawerStyles_unstable","OverlayDrawer","forwardRef","props","ref","state","contextValue","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,qBAAqB,QAAQ,+BAA+B;AAErE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAGlF;;CAEC,GACD,OAAO,MAAMC,8BAAyDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAC/C,MAAME,eAAeT;IAErBG,gCAAgCK;IAChCT,4BAA4B,mCAAmCS;IAC/DT,4BAA4B,mCAAmCS;IAE/D,OAAON,6BAA6BM,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,WAAW,GAAG"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { DrawerProvider } from '../../contexts/drawerContext';
|
|
3
4
|
/**
|
|
4
5
|
* Render the final JSX of OverlayDrawer
|
|
5
|
-
*/ export const renderOverlayDrawer_unstable = (state)=>{
|
|
6
|
+
*/ export const renderOverlayDrawer_unstable = (state, contextValue)=>{
|
|
6
7
|
if (!state.motion.canRender) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
10
|
assertSlots(state);
|
|
10
|
-
return /*#__PURE__*/ _jsx(
|
|
11
|
-
|
|
11
|
+
return /*#__PURE__*/ _jsx(DrawerProvider, {
|
|
12
|
+
value: contextValue,
|
|
13
|
+
children: /*#__PURE__*/ _jsx(state.dialog, {
|
|
14
|
+
children: /*#__PURE__*/ _jsx(state.root, {})
|
|
15
|
+
})
|
|
12
16
|
});
|
|
13
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderOverlayDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { OverlayDrawerState, OverlayDrawerInternalSlots } from './OverlayDrawer.types';\n\n/**\n * Render the final JSX of OverlayDrawer\n */\nexport const renderOverlayDrawer_unstable = (state: OverlayDrawerState) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<OverlayDrawerInternalSlots>(state);\n\n return (\n <state.dialog>\n
|
|
1
|
+
{"version":3,"sources":["renderOverlayDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerContextValue, DrawerProvider } from '../../contexts/drawerContext';\n\nimport type { OverlayDrawerState, OverlayDrawerInternalSlots } from './OverlayDrawer.types';\n\n/**\n * Render the final JSX of OverlayDrawer\n */\nexport const renderOverlayDrawer_unstable = (state: OverlayDrawerState, contextValue: DrawerContextValue) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<OverlayDrawerInternalSlots>(state);\n\n return (\n <DrawerProvider value={contextValue}>\n <state.dialog>\n <state.root />\n </state.dialog>\n </DrawerProvider>\n );\n};\n"],"names":["assertSlots","DrawerProvider","renderOverlayDrawer_unstable","state","contextValue","motion","canRender","value","dialog","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAA6BC,cAAc,QAAQ,+BAA+B;AAIlF;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC,OAA2BC;IACtE,IAAI,CAACD,MAAME,MAAM,CAACC,SAAS,EAAE;QAC3B,OAAO;IACT;IAEAN,YAAwCG;IAExC,qBACE,KAACF;QAAeM,OAAOH;kBACrB,cAAA,KAACD,MAAMK,MAAM;sBACX,cAAA,KAACL,MAAMM,IAAI;;;AAInB,EAAE"}
|