@fluentui/react-drawer 9.3.2 → 9.5.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 +102 -72
- package/dist/index.d.ts +19 -16
- package/lib/components/Drawer/Drawer.types.js.map +1 -1
- package/lib/components/Drawer/useDrawer.js +2 -2
- package/lib/components/Drawer/useDrawer.js.map +1 -1
- package/lib/components/InlineDrawer/InlineDrawer.types.js.map +1 -1
- package/lib/components/InlineDrawer/useInlineDrawer.js.map +1 -1
- package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.js +25 -12
- package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.js.map +1 -1
- package/lib/components/OverlayDrawer/OverlayDrawer.types.js.map +1 -1
- package/lib/components/OverlayDrawer/OverlayDrawerDialog.js +22 -0
- package/lib/components/OverlayDrawer/OverlayDrawerDialog.js.map +1 -0
- package/lib/components/OverlayDrawer/OverlayDrawerSurface/OverlayDrawerSurface.js +9 -1
- package/lib/components/OverlayDrawer/OverlayDrawerSurface/OverlayDrawerSurface.js.map +1 -1
- package/lib/components/OverlayDrawer/OverlayDrawerSurface/OverlayDrawerSurface.types.js.map +1 -1
- package/lib/components/OverlayDrawer/useOverlayDrawer.js +10 -10
- package/lib/components/OverlayDrawer/useOverlayDrawer.js.map +1 -1
- package/lib/components/OverlayDrawer/useOverlayDrawerStyles.styles.js +3 -3
- package/lib/shared/DrawerBase.types.js.map +1 -1
- package/lib/shared/useDrawerBaseStyles.styles.js +18 -8
- package/lib/shared/useDrawerBaseStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Drawer/useDrawer.js +2 -2
- package/lib-commonjs/components/Drawer/useDrawer.js.map +1 -1
- package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.js +47 -39
- package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawerDialog.js +28 -0
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawerDialog.js.map +1 -0
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/OverlayDrawerSurface.js +9 -1
- package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/OverlayDrawerSurface.js.map +1 -1
- package/lib-commonjs/components/OverlayDrawer/useOverlayDrawer.js +9 -9
- package/lib-commonjs/components/OverlayDrawer/useOverlayDrawer.js.map +1 -1
- package/lib-commonjs/components/OverlayDrawer/useOverlayDrawerStyles.styles.js +13 -13
- package/lib-commonjs/components/OverlayDrawer/useOverlayDrawerStyles.styles.js.map +1 -1
- package/lib-commonjs/shared/useDrawerBaseStyles.styles.js +36 -28
- package/lib-commonjs/shared/useDrawerBaseStyles.styles.js.map +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ declare type DrawerBaseProps = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
declare type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {
|
|
47
|
-
motion: MotionState<
|
|
47
|
+
motion: MotionState<HTMLElement>;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -186,18 +186,13 @@ export declare type DrawerProps = ComponentProps<DrawerSlots> & {
|
|
|
186
186
|
* @default overlay
|
|
187
187
|
*/
|
|
188
188
|
type?: 'inline' | 'overlay';
|
|
189
|
-
};
|
|
189
|
+
} & (OverlayDrawerProps | InlineDrawerProps);
|
|
190
190
|
|
|
191
191
|
export declare const DrawerProvider: React_2.Provider<DrawerContextValue | undefined>;
|
|
192
192
|
|
|
193
193
|
declare type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';
|
|
194
194
|
|
|
195
|
-
export declare type DrawerSlots =
|
|
196
|
-
/**
|
|
197
|
-
* Root slot of the Drawer.
|
|
198
|
-
*/
|
|
199
|
-
root: Slot<OverlayDrawerProps | InlineDrawerProps>;
|
|
200
|
-
};
|
|
195
|
+
export declare type DrawerSlots = OverlayDrawerSlots | InlineDrawerSlots;
|
|
201
196
|
|
|
202
197
|
/**
|
|
203
198
|
* State used in rendering Drawer
|
|
@@ -225,7 +220,7 @@ export declare type InlineDrawerProps = ComponentProps<InlineDrawerSlots> & Draw
|
|
|
225
220
|
};
|
|
226
221
|
|
|
227
222
|
export declare type InlineDrawerSlots = {
|
|
228
|
-
root: Slot<'div'>;
|
|
223
|
+
root: Slot<'div', 'aside'>;
|
|
229
224
|
};
|
|
230
225
|
|
|
231
226
|
/**
|
|
@@ -283,7 +278,13 @@ declare type OverlayDrawerInternalSlots = OverlayDrawerSlots & {
|
|
|
283
278
|
/**
|
|
284
279
|
* OverlayDrawer Props
|
|
285
280
|
*/
|
|
286
|
-
export declare type OverlayDrawerProps = ComponentProps<OverlayDrawerSlots> & Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'
|
|
281
|
+
export declare type OverlayDrawerProps = ComponentProps<OverlayDrawerSlots> & Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'> & DrawerBaseProps & {
|
|
282
|
+
/**
|
|
283
|
+
* @deprecated OverlayDrawer can work only as a controlled component
|
|
284
|
+
* and does not support uncontrolled mode i.e. defaultOpen prop
|
|
285
|
+
*/
|
|
286
|
+
defaultOpen?: boolean;
|
|
287
|
+
};
|
|
287
288
|
|
|
288
289
|
/**
|
|
289
290
|
* OverlayDrawer slots
|
|
@@ -298,17 +299,19 @@ export declare type OverlayDrawerSlots = {
|
|
|
298
299
|
/**
|
|
299
300
|
* State used in rendering OverlayDrawer
|
|
300
301
|
*/
|
|
301
|
-
export declare type OverlayDrawerState =
|
|
302
|
+
export declare type OverlayDrawerState = ComponentState<OverlayDrawerInternalSlots> & Required<DrawerBaseState>;
|
|
302
303
|
|
|
303
304
|
/**
|
|
304
305
|
* OverlayDrawerSurface Props
|
|
305
306
|
*/
|
|
306
|
-
declare type OverlayDrawerSurfaceProps = DialogSurfaceProps
|
|
307
|
+
declare type OverlayDrawerSurfaceProps = ComponentProps<OverlayDrawerSurfaceSlots> & Pick<DialogSurfaceProps, 'mountNode'>;
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
* OverlayDrawerSurface slots
|
|
310
311
|
*/
|
|
311
|
-
declare type OverlayDrawerSurfaceSlots = DialogSurfaceSlots
|
|
312
|
+
declare type OverlayDrawerSurfaceSlots = Pick<DialogSurfaceSlots, 'backdrop'> & {
|
|
313
|
+
root: Slot<'div', 'aside'>;
|
|
314
|
+
};
|
|
312
315
|
|
|
313
316
|
/**
|
|
314
317
|
* Render the final JSX of Drawer
|
|
@@ -459,7 +462,7 @@ export declare const useDrawerStyles_unstable: (state: DrawerState) => DrawerSta
|
|
|
459
462
|
* @param props - props from this instance of InlineDrawer
|
|
460
463
|
* @param ref - reference to root HTMLElement of InlineDrawer
|
|
461
464
|
*/
|
|
462
|
-
export declare const useInlineDrawer_unstable: (props: InlineDrawerProps, ref: React_2.Ref<
|
|
465
|
+
export declare const useInlineDrawer_unstable: (props: InlineDrawerProps, ref: React_2.Ref<HTMLElement>) => InlineDrawerState;
|
|
463
466
|
|
|
464
467
|
/**
|
|
465
468
|
* Apply styling to the InlineDrawer slots based on the state
|
|
@@ -473,9 +476,9 @@ export declare const useInlineDrawerStyles_unstable: (state: InlineDrawerState)
|
|
|
473
476
|
* before being passed to renderOverlayDrawer_unstable.
|
|
474
477
|
*
|
|
475
478
|
* @param props - props from this instance of OverlayDrawer
|
|
476
|
-
* @param ref - reference to root
|
|
479
|
+
* @param ref - reference to root HTMLElement of OverlayDrawer
|
|
477
480
|
*/
|
|
478
|
-
export declare const useOverlayDrawer_unstable: (props: OverlayDrawerProps, ref: React_2.Ref<
|
|
481
|
+
export declare const useOverlayDrawer_unstable: (props: OverlayDrawerProps, ref: React_2.Ref<HTMLElement>) => OverlayDrawerState;
|
|
479
482
|
|
|
480
483
|
/**
|
|
481
484
|
* Apply styling to the OverlayDrawer slots based on the state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Drawer.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState
|
|
1
|
+
{"version":3,"sources":["Drawer.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\n\nimport type { OverlayDrawerProps, OverlayDrawerSlots } from '../OverlayDrawer';\nimport type { InlineDrawerProps, InlineDrawerSlots } from '../InlineDrawer';\n\nexport type DrawerSlots = OverlayDrawerSlots | InlineDrawerSlots;\n\n/**\n * Drawer Props\n */\nexport type DrawerProps = ComponentProps<DrawerSlots> & {\n /**\n * Type of the drawer.\n *\n * - 'overlay' - Drawer is hidden by default and can be opened by clicking on the trigger.\n * - 'inline' - Drawer is stacked with the content\n *\n * @default overlay\n */\n type?: 'inline' | 'overlay';\n} & (OverlayDrawerProps | InlineDrawerProps);\n\n/**\n * State used in rendering Drawer\n */\nexport type DrawerState = ComponentState<DrawerSlots>;\n"],"names":[],"mappings":"AAAA,WAyBsD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\n\nimport type { DrawerProps, DrawerState } from './Drawer.types';\nimport { OverlayDrawer } from '../OverlayDrawer';\nimport { InlineDrawer } from '../InlineDrawer';\n\n/**\n * Create the state required to render Drawer.\n *\n * The returned state can be modified with hooks such as useDrawerStyles_unstable,\n * before being passed to renderDrawer_unstable.\n *\n * @param props - props from this instance of Drawer\n * @param ref - reference to root HTMLElement of Drawer\n */\nexport const useDrawer_unstable = (props: DrawerProps, ref: React.Ref<HTMLElement>): DrawerState => {\n const elementType = props.type === 'inline' ? InlineDrawer : OverlayDrawer;\n\n return {\n components: {\n root: elementType,\n },\n\n root: slot.always
|
|
1
|
+
{"version":3,"sources":["useDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\n\nimport type { DrawerProps, DrawerState } from './Drawer.types';\nimport { OverlayDrawer } from '../OverlayDrawer';\nimport { InlineDrawer } from '../InlineDrawer';\n\n/**\n * Create the state required to render Drawer.\n *\n * The returned state can be modified with hooks such as useDrawerStyles_unstable,\n * before being passed to renderDrawer_unstable.\n *\n * @param props - props from this instance of Drawer\n * @param ref - reference to root HTMLElement of Drawer\n */\nexport const useDrawer_unstable = (props: DrawerProps, ref: React.Ref<HTMLElement>): DrawerState => {\n const elementType = props.type === 'inline' ? InlineDrawer : OverlayDrawer;\n\n return {\n components: {\n root: elementType,\n },\n\n root: slot.always(\n {\n ref,\n ...props,\n },\n {\n elementType,\n },\n ),\n };\n};\n"],"names":["React","slot","OverlayDrawer","InlineDrawer","useDrawer_unstable","props","ref","elementType","type","components","root","always"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AAGjD,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,YAAY,QAAQ,kBAAkB;AAE/C;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAqB,CAACC,OAAoBC;IACrD,MAAMC,cAAcF,MAAMG,IAAI,KAAK,WAAWL,eAAeD;IAE7D,OAAO;QACLO,YAAY;YACVC,MAAMH;QACR;QAEAG,MAAMT,KAAKU,MAAM,CACf;YACEL;YACA,GAAGD,KAAK;QACV,GACA;YACEE;QACF;IAEJ;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["InlineDrawer.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\n\nexport type InlineDrawerSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * InlineDrawer Props\n */\nexport type InlineDrawerProps = ComponentProps<InlineDrawerSlots> &\n DrawerBaseProps & {\n /**\n * Whether the drawer has a separator line.\n *\n * @default false\n */\n separator?: boolean;\n };\n\n/**\n * State used in rendering InlineDrawer\n */\nexport type InlineDrawerState = Required<\n ComponentState<InlineDrawerSlots> & DrawerBaseState & Pick<InlineDrawerProps, 'separator'>\n>;\n"],"names":[],"mappings":"AAAA,WA0BE"}
|
|
1
|
+
{"version":3,"sources":["InlineDrawer.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\n\nexport type InlineDrawerSlots = {\n root: Slot<'div', 'aside'>;\n};\n\n/**\n * InlineDrawer Props\n */\nexport type InlineDrawerProps = ComponentProps<InlineDrawerSlots> &\n DrawerBaseProps & {\n /**\n * Whether the drawer has a separator line.\n *\n * @default false\n */\n separator?: boolean;\n };\n\n/**\n * State used in rendering InlineDrawer\n */\nexport type InlineDrawerState = Required<\n ComponentState<InlineDrawerSlots> & DrawerBaseState & Pick<InlineDrawerProps, 'separator'>\n>;\n"],"names":[],"mappings":"AAAA,WA0BE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useInlineDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\nimport type { InlineDrawerProps, InlineDrawerState } from './InlineDrawer.types';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\n\n/**\n * Create the state required to render InlineDrawer.\n *\n * The returned state can be modified with hooks such as useInlineDrawerStyles_unstable,\n * before being passed to renderInlineDrawer_unstable.\n *\n * @param props - props from this instance of InlineDrawer\n * @param ref - reference to root HTMLElement of InlineDrawer\n */\nexport const useInlineDrawer_unstable = (
|
|
1
|
+
{"version":3,"sources":["useInlineDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\nimport type { InlineDrawerProps, InlineDrawerState } from './InlineDrawer.types';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\n\n/**\n * Create the state required to render InlineDrawer.\n *\n * The returned state can be modified with hooks such as useInlineDrawerStyles_unstable,\n * before being passed to renderInlineDrawer_unstable.\n *\n * @param props - props from this instance of InlineDrawer\n * @param ref - reference to root HTMLElement of InlineDrawer\n */\nexport const useInlineDrawer_unstable = (props: InlineDrawerProps, ref: React.Ref<HTMLElement>): InlineDrawerState => {\n const { size, position, open } = useDrawerDefaultProps(props);\n const { separator = false } = props;\n\n const motion = useMotion<HTMLElement>(open);\n\n return {\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ref: useMergedRefs(ref, motion.ref),\n }),\n { elementType: 'div' },\n ),\n\n size,\n position,\n separator,\n motion,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useMergedRefs","useMotion","useDrawerDefaultProps","useInlineDrawer_unstable","props","ref","size","position","open","separator","motion","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAC1F,SAASC,SAAS,QAAQ,iCAAiC;AAG3D,SAASC,qBAAqB,QAAQ,qCAAqC;AAE3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGN,sBAAsBE;IACvD,MAAM,EAAEK,YAAY,KAAK,EAAE,GAAGL;IAE9B,MAAMM,SAAST,UAAuBO;IAEtC,OAAO;QACLG,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMb,KAAKc,MAAM,CACff,yBAAyB,OAAO;YAC9B,GAAGM,KAAK;YACRC,KAAKL,cAAcK,KAAKK,OAAOL,GAAG;QACpC,IACA;YAAES,aAAa;QAAM;QAGvBR;QACAC;QACAE;QACAC;IACF;AACF,EAAE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __resetStyles, __styles, mergeClasses
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
3
|
import { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';
|
|
4
4
|
import { useMotionClassNames } from '@fluentui/react-motion-preview';
|
|
@@ -9,22 +9,25 @@ const useDrawerResetStyles = /*#__PURE__*/__resetStyles("rkjj3x6", null, [".rkjj
|
|
|
9
9
|
/**
|
|
10
10
|
* Styles for the root slot
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const borderValue = `1px solid ${tokens.colorNeutralBackground3}`;
|
|
13
13
|
const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
14
14
|
separatorStart: {
|
|
15
|
-
|
|
16
|
-
vrafjx:
|
|
17
|
-
|
|
15
|
+
h3c5rm: 0,
|
|
16
|
+
vrafjx: 0,
|
|
17
|
+
Bekrc4i: 0,
|
|
18
|
+
u1mtju: ["f1cxmi7i", "f1j970fk"]
|
|
18
19
|
},
|
|
19
20
|
separatorEnd: {
|
|
20
|
-
|
|
21
|
-
wvpqe5:
|
|
22
|
-
|
|
21
|
+
zhjwy3: 0,
|
|
22
|
+
wvpqe5: 0,
|
|
23
|
+
ibv6hh: 0,
|
|
24
|
+
B4g9neb: ["f1j970fk", "f1cxmi7i"]
|
|
23
25
|
},
|
|
24
26
|
separatorBottom: {
|
|
25
|
-
|
|
26
|
-
icvyot:
|
|
27
|
-
|
|
27
|
+
g2u3we: 0,
|
|
28
|
+
icvyot: 0,
|
|
29
|
+
B4j52fo: 0,
|
|
30
|
+
i8vvqc: "f1n3kblk"
|
|
28
31
|
},
|
|
29
32
|
start: {
|
|
30
33
|
Bz10aip: "f1d8gkik"
|
|
@@ -38,7 +41,17 @@ const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
|
38
41
|
Bqenvij: "fub80nq"
|
|
39
42
|
}
|
|
40
43
|
}, {
|
|
41
|
-
d: [".
|
|
44
|
+
d: [[".f1cxmi7i{border-right:1px solid var(--colorNeutralBackground3);}", {
|
|
45
|
+
p: -1
|
|
46
|
+
}], [".f1j970fk{border-left:1px solid var(--colorNeutralBackground3);}", {
|
|
47
|
+
p: -1
|
|
48
|
+
}], [".f1j970fk{border-left:1px solid var(--colorNeutralBackground3);}", {
|
|
49
|
+
p: -1
|
|
50
|
+
}], [".f1cxmi7i{border-right:1px solid var(--colorNeutralBackground3);}", {
|
|
51
|
+
p: -1
|
|
52
|
+
}], [".f1n3kblk{border-top:1px solid var(--colorNeutralBackground3);}", {
|
|
53
|
+
p: -1
|
|
54
|
+
}], ".f1d8gkik{transform:translate3D(calc(var(--fui-Drawer--size) * -1), 0, 0);}", ".f1h1g6jt{transform:translate3D(var(--fui-Drawer--size), 0, 0);}", ".f1rdfgt8{transform:translate3D(0, var(--fui-Drawer--size), 0);}", ".fly5x3f{width:100%;}", ".fub80nq{height:var(--fui-Drawer--size);}"]
|
|
42
55
|
});
|
|
43
56
|
const useDrawerMotionStyles = /*#__PURE__*/__styles({
|
|
44
57
|
"default": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","useMotionClassNames","inlineDrawerClassNames","root","useDrawerResetStyles","borderValue","colorNeutralBackground3","useDrawerRootStyles","separatorStart","h3c5rm","vrafjx","Bekrc4i","u1mtju","separatorEnd","zhjwy3","wvpqe5","ibv6hh","B4g9neb","separatorBottom","g2u3we","icvyot","B4j52fo","i8vvqc","start","Bz10aip","end","bottom","a9b677","Bqenvij","d","p","useDrawerMotionStyles","abs64n","Bmy1vo4","Es3by","enter","getSeparatorClass","state","classNames","separator","undefined","position","useInlineDrawerStyles_unstable","resetStyles","baseClassNames","rootStyles","motionClassNames","motion","className"],"sources":["useInlineDrawerStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\nimport { useMotionClassNames } from '@fluentui/react-motion-preview';\nexport const inlineDrawerClassNames = {\n root: 'fui-InlineDrawer'\n};\nconst useDrawerResetStyles = makeResetStyles({\n ...drawerDefaultStyles,\n position: 'relative'\n});\n/**\n * Styles for the root slot\n */ const borderValue = `1px solid ${tokens.colorNeutralBackground3}`;\nconst useDrawerRootStyles = makeStyles({\n /* Separator */ separatorStart: {\n borderRight: borderValue\n },\n separatorEnd: {\n borderLeft: borderValue\n },\n separatorBottom: {\n borderTop: borderValue\n },\n /* Positioning */ start: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * -1), 0, 0)`\n },\n end: {\n transform: `translate3D(var(${drawerCSSVars.drawerSizeVar}), 0, 0)`\n },\n bottom: {\n transform: `translate3D(0, var(${drawerCSSVars.drawerSizeVar}), 0)`,\n width: '100%',\n height: `var(${drawerCSSVars.drawerSizeVar})`\n }\n});\nconst useDrawerMotionStyles = makeStyles({\n default: {\n opacity: 0,\n transitionProperty: 'opacity, transform',\n willChange: 'opacity, transform'\n },\n enter: {\n opacity: 1,\n transform: 'translate3D(0, 0, 0)'\n }\n});\nfunction getSeparatorClass(state, classNames) {\n if (!state.separator) {\n return undefined;\n }\n switch(state.position){\n case 'start':\n return classNames.separatorStart;\n case 'end':\n return classNames.separatorEnd;\n case 'bottom':\n return classNames.separatorBottom;\n default:\n return undefined;\n }\n}\n/**\n * Apply styling to the InlineDrawer slots based on the state\n */ export const useInlineDrawerStyles_unstable = (state)=>{\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n const motionClassNames = useMotionClassNames(state.motion, useDrawerMotionStyles());\n state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], motionClassNames, 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,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,yCAAyC;AACrH,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,gBAAGV,aAAA,6UAG5B,CAAC;AACF;AACA;AACA;AAAI,MAAMW,WAAW,GAAG,aAAaR,MAAM,CAACS,uBAAuB,EAAE;AACrE,MAAMC,mBAAmB,gBAAGZ,QAAA;EAAAa,cAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,eAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;EAAA;EAAAC,GAAA;IAAAD,OAAA;EAAA;EAAAE,MAAA;IAAAF,OAAA;IAAAG,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAqB3B,CAAC;AACF,MAAMC,qBAAqB,gBAAGpC,QAAA;EAAA;IAAAqC,MAAA;IAAAC,OAAA;IAAAC,KAAA;EAAA;EAAAC,KAAA;IAAAH,MAAA;IAAAR,OAAA;EAAA;AAAA;EAAAK,CAAA;AAAA,CAU7B,CAAC;AACF,SAASO,iBAAiBA,CAACC,KAAK,EAAEC,UAAU,EAAE;EAC1C,IAAI,CAACD,KAAK,CAACE,SAAS,EAAE;IAClB,OAAOC,SAAS;EACpB;EACA,QAAOH,KAAK,CAACI,QAAQ;IACjB,KAAK,OAAO;MACR,OAAOH,UAAU,CAAC9B,cAAc;IACpC,KAAK,KAAK;MACN,OAAO8B,UAAU,CAACzB,YAAY;IAClC,KAAK,QAAQ;MACT,OAAOyB,UAAU,CAACpB,eAAe;IACrC;MACI,OAAOsB,SAAS;EACxB;AACJ;AACA;AACA;AACA;AAAI,OAAO,MAAME,8BAA8B,GAAIL,KAAK,IAAG;EACvD,MAAMM,WAAW,GAAGvC,oBAAoB,CAAC,CAAC;EAC1C,MAAMwC,cAAc,GAAG5C,uBAAuB,CAACqC,KAAK,CAAC;EACrD,MAAMQ,UAAU,GAAGtC,mBAAmB,CAAC,CAAC;EACxC,MAAMuC,gBAAgB,GAAG7C,mBAAmB,CAACoC,KAAK,CAACU,MAAM,EAAEhB,qBAAqB,CAAC,CAAC,CAAC;EACnFM,KAAK,CAAClC,IAAI,CAAC6C,SAAS,GAAGpD,YAAY,CAACM,sBAAsB,CAACC,IAAI,EAAEwC,WAAW,EAAEC,cAAc,EAAER,iBAAiB,CAACC,KAAK,EAAEQ,UAAU,CAAC,EAAEA,UAAU,CAACR,KAAK,CAACI,QAAQ,CAAC,EAAEK,gBAAgB,EAAET,KAAK,CAAClC,IAAI,CAAC6C,SAAS,CAAC;EACvM,OAAOX,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["OverlayDrawer.types.ts"],"sourcesContent":["import type { DialogProps } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\nimport { OverlayDrawerSurfaceProps } from './OverlayDrawerSurface';\n\n/**\n * OverlayDrawer slots\n */\nexport type OverlayDrawerSlots = {\n /**\n * Slot for the root element.\n */\n root: Slot<OverlayDrawerSurfaceProps>;\n};\n\n/**\n * OverlayDrawer internal slots for when using with composition API\n */\nexport type OverlayDrawerInternalSlots = OverlayDrawerSlots & {\n /**\n * Slot for the dialog component that wraps the drawer.\n */\n dialog: Slot<DialogProps>;\n};\n\n/**\n * OverlayDrawer Props\n */\nexport type OverlayDrawerProps = ComponentProps<OverlayDrawerSlots> &\n Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'
|
|
1
|
+
{"version":3,"sources":["OverlayDrawer.types.ts"],"sourcesContent":["import type { DialogProps } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\nimport { OverlayDrawerSurfaceProps } from './OverlayDrawerSurface';\n\n/**\n * OverlayDrawer slots\n */\nexport type OverlayDrawerSlots = {\n /**\n * Slot for the root element.\n */\n root: Slot<OverlayDrawerSurfaceProps>;\n};\n\n/**\n * OverlayDrawer internal slots for when using with composition API\n */\nexport type OverlayDrawerInternalSlots = OverlayDrawerSlots & {\n /**\n * Slot for the dialog component that wraps the drawer.\n */\n dialog: Slot<DialogProps>;\n};\n\n/**\n * OverlayDrawer Props\n */\nexport type OverlayDrawerProps = ComponentProps<OverlayDrawerSlots> &\n Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'> &\n DrawerBaseProps & {\n /**\n * @deprecated OverlayDrawer can work only as a controlled component\n * and does not support uncontrolled mode i.e. defaultOpen prop\n */\n defaultOpen?: boolean;\n };\n\n/**\n * State used in rendering OverlayDrawer\n */\nexport type OverlayDrawerState = ComponentState<OverlayDrawerInternalSlots> & Required<DrawerBaseState>;\n"],"names":[],"mappings":"AAAA,WA0CwG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DialogProvider, DialogSurfaceProvider, useDialog_unstable, useDialogContextValues_unstable } from '@fluentui/react-dialog';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4
|
+
const renderOverlayDrawerDialog_unstable = (state, contextValues)=>{
|
|
5
|
+
const { content, trigger } = state;
|
|
6
|
+
return /*#__PURE__*/ React.createElement(DialogProvider, {
|
|
7
|
+
value: contextValues.dialog
|
|
8
|
+
}, /*#__PURE__*/ React.createElement(DialogSurfaceProvider, {
|
|
9
|
+
value: contextValues.dialogSurface
|
|
10
|
+
}, trigger, content));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Temporary component to render Dialog without built-in motion as Drawer has own motion implementation.
|
|
14
|
+
*
|
|
15
|
+
* @todo Remove after https://github.com/microsoft/fluentui/issues/30700.
|
|
16
|
+
* @internal
|
|
17
|
+
*/ export const OverlayDrawerDialog = /*#__PURE__*/ React.memo((props)=>{
|
|
18
|
+
const state = useDialog_unstable(props);
|
|
19
|
+
const contextValues = useDialogContextValues_unstable(state);
|
|
20
|
+
return renderOverlayDrawerDialog_unstable(state, contextValues);
|
|
21
|
+
});
|
|
22
|
+
OverlayDrawerDialog.displayName = 'OverlayDrawerDialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["OverlayDrawerDialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n type DialogContextValues,\n type DialogProps,\n DialogProvider,\n type DialogState,\n DialogSurfaceProvider,\n useDialog_unstable,\n useDialogContextValues_unstable,\n} from '@fluentui/react-dialog';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst renderOverlayDrawerDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n const { content, trigger } = state;\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {trigger}\n {content}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n\n/**\n * Temporary component to render Dialog without built-in motion as Drawer has own motion implementation.\n *\n * @todo Remove after https://github.com/microsoft/fluentui/issues/30700.\n * @internal\n */\nexport const OverlayDrawerDialog: React.FC<DialogProps> = React.memo(props => {\n const state = useDialog_unstable(props);\n const contextValues = useDialogContextValues_unstable(state);\n\n return renderOverlayDrawerDialog_unstable(state, contextValues);\n});\n\nOverlayDrawerDialog.displayName = 'OverlayDrawerDialog';\n"],"names":["React","DialogProvider","DialogSurfaceProvider","useDialog_unstable","useDialogContextValues_unstable","renderOverlayDrawerDialog_unstable","state","contextValues","content","trigger","value","dialog","dialogSurface","OverlayDrawerDialog","memo","props","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAGEC,cAAc,EAEdC,qBAAqB,EACrBC,kBAAkB,EAClBC,+BAA+B,QAC1B,yBAAyB;AAEhC,gEAAgE;AAChE,MAAMC,qCAAqC,CAACC,OAAoBC;IAC9D,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGH;IAE7B,qBACE,oBAACL;QAAeS,OAAOH,cAAcI,MAAM;qBACzC,oBAACT;QAAsBQ,OAAOH,cAAcK,aAAa;OACtDH,SACAD;AAIT;AAEA;;;;;CAKC,GACD,OAAO,MAAMK,oCAA6Cb,MAAMc,IAAI,CAACC,CAAAA;IACnE,MAAMT,QAAQH,mBAAmBY;IACjC,MAAMR,gBAAgBH,gCAAgCE;IAEtD,OAAOD,mCAAmCC,OAAOC;AACnD,GAAG;AAEHM,oBAAoBG,WAAW,GAAG"}
|
|
@@ -5,7 +5,15 @@ import { useOverlayDrawerSurfaceStyles_unstable } from './useOverlayDrawerSurfac
|
|
|
5
5
|
* @internal
|
|
6
6
|
* OverlayDrawerSurface is a proxy for DialogSurface as is only meant to be used internally for Drawer.
|
|
7
7
|
*/ export const OverlayDrawerSurface = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
-
const dialogSurfaceState = useDialogSurface_unstable(
|
|
8
|
+
const dialogSurfaceState = useDialogSurface_unstable({
|
|
9
|
+
...props,
|
|
10
|
+
/**
|
|
11
|
+
* Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.
|
|
12
|
+
* We need to cast the ref to a `div` element type to not break Dialog's ref type.
|
|
13
|
+
*
|
|
14
|
+
* FIXME: Evaluate the possibility to remove this cast when Dialog is refactored to accept `aside` elements.
|
|
15
|
+
*/ as: props.as
|
|
16
|
+
}, ref);
|
|
9
17
|
const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);
|
|
10
18
|
useOverlayDrawerSurfaceStyles_unstable(dialogSurfaceState);
|
|
11
19
|
return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["OverlayDrawerSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {\n useDialogSurface_unstable,\n useDialogSurfaceContextValues_unstable,\n renderDialogSurface_unstable,\n} from '@fluentui/react-dialog';\n\nimport { useOverlayDrawerSurfaceStyles_unstable } from './useOverlayDrawerSurfaceStyles.styles';\nimport type { OverlayDrawerSurfaceProps } from './OverlayDrawerSurface.types';\n\n/**\n * @internal\n * OverlayDrawerSurface is a proxy for DialogSurface as is only meant to be used internally for Drawer.\n */\nexport const OverlayDrawerSurface: ForwardRefComponent<OverlayDrawerSurfaceProps> = React.forwardRef((props, ref) => {\n const dialogSurfaceState = useDialogSurface_unstable(props, ref);\n const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);\n\n useOverlayDrawerSurfaceStyles_unstable(dialogSurfaceState);\n\n return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);\n});\n\nOverlayDrawerSurface.displayName = 'OverlayDrawerSurface';\n"],"names":["React","useDialogSurface_unstable","useDialogSurfaceContextValues_unstable","renderDialogSurface_unstable","useOverlayDrawerSurfaceStyles_unstable","OverlayDrawerSurface","forwardRef","props","ref","dialogSurfaceState","dialogSurfaceContextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SACEC,yBAAyB,EACzBC,sCAAsC,EACtCC,4BAA4B,QACvB,yBAAyB;AAEhC,SAASC,sCAAsC,QAAQ,yCAAyC;AAGhG;;;CAGC,GACD,OAAO,MAAMC,qCAAuEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3G,MAAMC,qBAAqBR,
|
|
1
|
+
{"version":3,"sources":["OverlayDrawerSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {\n useDialogSurface_unstable,\n useDialogSurfaceContextValues_unstable,\n renderDialogSurface_unstable,\n} from '@fluentui/react-dialog';\n\nimport { useOverlayDrawerSurfaceStyles_unstable } from './useOverlayDrawerSurfaceStyles.styles';\nimport type { OverlayDrawerSurfaceProps } from './OverlayDrawerSurface.types';\n\n/**\n * @internal\n * OverlayDrawerSurface is a proxy for DialogSurface as is only meant to be used internally for Drawer.\n */\nexport const OverlayDrawerSurface: ForwardRefComponent<OverlayDrawerSurfaceProps> = React.forwardRef((props, ref) => {\n const dialogSurfaceState = useDialogSurface_unstable(\n {\n ...props,\n /**\n * Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.\n * We need to cast the ref to a `div` element type to not break Dialog's ref type.\n *\n * FIXME: Evaluate the possibility to remove this cast when Dialog is refactored to accept `aside` elements.\n */\n as: props.as as 'div',\n },\n ref,\n );\n const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);\n\n useOverlayDrawerSurfaceStyles_unstable(dialogSurfaceState);\n\n return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);\n});\n\nOverlayDrawerSurface.displayName = 'OverlayDrawerSurface';\n"],"names":["React","useDialogSurface_unstable","useDialogSurfaceContextValues_unstable","renderDialogSurface_unstable","useOverlayDrawerSurfaceStyles_unstable","OverlayDrawerSurface","forwardRef","props","ref","dialogSurfaceState","as","dialogSurfaceContextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SACEC,yBAAyB,EACzBC,sCAAsC,EACtCC,4BAA4B,QACvB,yBAAyB;AAEhC,SAASC,sCAAsC,QAAQ,yCAAyC;AAGhG;;;CAGC,GACD,OAAO,MAAMC,qCAAuEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3G,MAAMC,qBAAqBR,0BACzB;QACE,GAAGM,KAAK;QACR;;;;;OAKC,GACDG,IAAIH,MAAMG,EAAE;IACd,GACAF;IAEF,MAAMG,6BAA6BT,uCAAuCO;IAE1EL,uCAAuCK;IAEvC,OAAON,6BAA6BM,oBAAoBE;AAC1D,GAAG;AAEHN,qBAAqBO,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["OverlayDrawerSurface.types.ts"],"sourcesContent":["import type { DialogSurfaceProps, DialogSurfaceSlots
|
|
1
|
+
{"version":3,"sources":["OverlayDrawerSurface.types.ts"],"sourcesContent":["import type { DialogSurfaceProps, DialogSurfaceSlots } from '@fluentui/react-dialog';\nimport type { ComponentProps, Slot } from '@fluentui/react-utilities';\n\n/**\n * OverlayDrawerSurface slots\n */\nexport type OverlayDrawerSurfaceSlots = Pick<DialogSurfaceSlots, 'backdrop'> & {\n root: Slot<'div', 'aside'>;\n};\n\n/**\n * OverlayDrawerSurface Props\n */\nexport type OverlayDrawerSurfaceProps = ComponentProps<OverlayDrawerSurfaceSlots> &\n Pick<DialogSurfaceProps, 'mountNode'>;\n"],"names":[],"mappings":"AAAA,WAcwC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { slot, useMergedRefs } from '@fluentui/react-utilities';
|
|
3
|
-
import { Dialog } from '@fluentui/react-dialog';
|
|
4
3
|
import { useMotion } from '@fluentui/react-motion-preview';
|
|
5
4
|
import { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';
|
|
5
|
+
import { OverlayDrawerDialog } from './OverlayDrawerDialog';
|
|
6
6
|
import { OverlayDrawerSurface } from './OverlayDrawerSurface';
|
|
7
7
|
/**
|
|
8
8
|
* Create the state required to render OverlayDrawer.
|
|
@@ -11,27 +11,27 @@ import { OverlayDrawerSurface } from './OverlayDrawerSurface';
|
|
|
11
11
|
* before being passed to renderOverlayDrawer_unstable.
|
|
12
12
|
*
|
|
13
13
|
* @param props - props from this instance of OverlayDrawer
|
|
14
|
-
* @param ref - reference to root
|
|
14
|
+
* @param ref - reference to root HTMLElement of OverlayDrawer
|
|
15
15
|
*/ export const useOverlayDrawer_unstable = (props, ref)=>{
|
|
16
16
|
const { open, size, position } = useDrawerDefaultProps(props);
|
|
17
|
-
const { modalType = 'modal', inertTrapFocus,
|
|
17
|
+
const { modalType = 'modal', inertTrapFocus, onOpenChange } = props;
|
|
18
18
|
const motion = useMotion(open);
|
|
19
19
|
const backdropProps = slot.resolveShorthand(props.backdrop);
|
|
20
20
|
const hasCustomBackdrop = modalType !== 'non-modal' && backdropProps !== null;
|
|
21
21
|
const root = slot.always({
|
|
22
22
|
...props,
|
|
23
|
+
ref: useMergedRefs(ref, motion.ref),
|
|
23
24
|
backdrop: hasCustomBackdrop ? {
|
|
24
25
|
...backdropProps
|
|
25
26
|
} : null
|
|
26
27
|
}, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.
|
|
30
|
+
* We need to cast the ref to a `div` element type to not break Dialog's ref type.
|
|
31
|
+
*/ elementType: OverlayDrawerSurface
|
|
31
32
|
});
|
|
32
33
|
const dialog = slot.always({
|
|
33
34
|
open,
|
|
34
|
-
defaultOpen,
|
|
35
35
|
onOpenChange,
|
|
36
36
|
inertTrapFocus,
|
|
37
37
|
modalType,
|
|
@@ -40,12 +40,12 @@ import { OverlayDrawerSurface } from './OverlayDrawerSurface';
|
|
|
40
40
|
* but it's required by DialogProps
|
|
41
41
|
*/ children: null
|
|
42
42
|
}, {
|
|
43
|
-
elementType:
|
|
43
|
+
elementType: OverlayDrawerDialog
|
|
44
44
|
});
|
|
45
45
|
return {
|
|
46
46
|
components: {
|
|
47
47
|
root: OverlayDrawerSurface,
|
|
48
|
-
dialog:
|
|
48
|
+
dialog: OverlayDrawerDialog
|
|
49
49
|
},
|
|
50
50
|
root,
|
|
51
51
|
dialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useOverlayDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport {
|
|
1
|
+
{"version":3,"sources":["useOverlayDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { OverlayDrawerProps, OverlayDrawerState } from './OverlayDrawer.types';\nimport { OverlayDrawerDialog } from './OverlayDrawerDialog';\nimport { OverlayDrawerSurface } from './OverlayDrawerSurface';\n\n/**\n * Create the state required to render OverlayDrawer.\n *\n * The returned state can be modified with hooks such as useOverlayDrawerStyles_unstable,\n * before being passed to renderOverlayDrawer_unstable.\n *\n * @param props - props from this instance of OverlayDrawer\n * @param ref - reference to root HTMLElement of OverlayDrawer\n */\nexport const useOverlayDrawer_unstable = (\n props: OverlayDrawerProps,\n ref: React.Ref<HTMLElement>,\n): OverlayDrawerState => {\n const { open, size, position } = useDrawerDefaultProps(props);\n const { modalType = 'modal', inertTrapFocus, onOpenChange } = props;\n\n const motion = useMotion<HTMLElement>(open);\n\n const backdropProps = slot.resolveShorthand(props.backdrop);\n const hasCustomBackdrop = modalType !== 'non-modal' && backdropProps !== null;\n\n const root = slot.always(\n {\n ...props,\n ref: useMergedRefs(ref, motion.ref),\n backdrop: hasCustomBackdrop ? { ...backdropProps } : null,\n },\n {\n /**\n * Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.\n * We need to cast the ref to a `div` element type to not break Dialog's ref type.\n */\n elementType: OverlayDrawerSurface as unknown as 'div',\n },\n );\n\n const dialog = slot.always(\n {\n open,\n onOpenChange,\n inertTrapFocus,\n modalType,\n /**\n * children is not needed here because we construct the children in the render function,\n * but it's required by DialogProps\n */\n children: null as unknown as JSX.Element,\n },\n {\n elementType: OverlayDrawerDialog,\n },\n );\n\n return {\n components: {\n root: OverlayDrawerSurface,\n dialog: OverlayDrawerDialog,\n },\n\n root,\n dialog,\n\n size,\n position,\n motion,\n };\n};\n"],"names":["React","slot","useMergedRefs","useMotion","useDrawerDefaultProps","OverlayDrawerDialog","OverlayDrawerSurface","useOverlayDrawer_unstable","props","ref","open","size","position","modalType","inertTrapFocus","onOpenChange","motion","backdropProps","resolveShorthand","backdrop","hasCustomBackdrop","root","always","elementType","dialog","children","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAChE,SAASC,SAAS,QAAQ,iCAAiC;AAE3D,SAASC,qBAAqB,QAAQ,qCAAqC;AAE3E,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGR,sBAAsBI;IACvD,MAAM,EAAEK,YAAY,OAAO,EAAEC,cAAc,EAAEC,YAAY,EAAE,GAAGP;IAE9D,MAAMQ,SAASb,UAAuBO;IAEtC,MAAMO,gBAAgBhB,KAAKiB,gBAAgB,CAACV,MAAMW,QAAQ;IAC1D,MAAMC,oBAAoBP,cAAc,eAAeI,kBAAkB;IAEzE,MAAMI,OAAOpB,KAAKqB,MAAM,CACtB;QACE,GAAGd,KAAK;QACRC,KAAKP,cAAcO,KAAKO,OAAOP,GAAG;QAClCU,UAAUC,oBAAoB;YAAE,GAAGH,aAAa;QAAC,IAAI;IACvD,GACA;QACE;;;OAGC,GACDM,aAAajB;IACf;IAGF,MAAMkB,SAASvB,KAAKqB,MAAM,CACxB;QACEZ;QACAK;QACAD;QACAD;QACA;;;OAGC,GACDY,UAAU;IACZ,GACA;QACEF,aAAalB;IACf;IAGF,OAAO;QACLqB,YAAY;YACVL,MAAMf;YACNkB,QAAQnB;QACV;QAEAgB;QACAG;QAEAb;QACAC;QACAI;IACF;AACF,EAAE"}
|
|
@@ -11,9 +11,9 @@ export const overlayDrawerClassNames = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Styles for the root slot
|
|
13
13
|
*/
|
|
14
|
-
const useDrawerResetStyles = /*#__PURE__*/__resetStyles("
|
|
15
|
-
r: [".
|
|
16
|
-
s: ["@media (forced-colors: active){.
|
|
14
|
+
const useDrawerResetStyles = /*#__PURE__*/__resetStyles("r7dfyj8", "rmx02j7", {
|
|
15
|
+
r: [".r7dfyj8{overflow:hidden;width:var(--fui-Drawer--size);max-width:100vw;height:auto;max-height:100vh;box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);position:fixed;top:0;bottom:0;}", ".r7dfyj8:focus{outline-style:none;}", ".r7dfyj8:focus-visible{outline-style:none;}", ".r7dfyj8[data-fui-focus-visible]{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}", ".r7dfyj8[data-fui-focus-visible]::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border:2px solid var(--colorStrokeFocus2);border-radius:var(--borderRadiusMedium);top:calc(2px * -1);right:calc(2px * -1);bottom:calc(2px * -1);left:calc(2px * -1);}", ".rmx02j7{overflow:hidden;width:var(--fui-Drawer--size);max-width:100vw;height:auto;max-height:100vh;box-sizing:border-box;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);position:fixed;top:0;bottom:0;}", ".rmx02j7:focus{outline-style:none;}", ".rmx02j7:focus-visible{outline-style:none;}", ".rmx02j7[data-fui-focus-visible]{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}", ".rmx02j7[data-fui-focus-visible]::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border:2px solid var(--colorStrokeFocus2);border-radius:var(--borderRadiusMedium);top:calc(2px * -1);left:calc(2px * -1);bottom:calc(2px * -1);right:calc(2px * -1);}"],
|
|
16
|
+
s: ["@media (forced-colors: active){.r7dfyj8[data-fui-focus-visible]::after{border-top-color:Highlight;border-right-color:Highlight;border-bottom-color:Highlight;border-left-color:Highlight;}}", "@media (forced-colors: active){.rmx02j7[data-fui-focus-visible]::after{border-top-color:Highlight;border-left-color:Highlight;border-bottom-color:Highlight;border-right-color:Highlight;}}"]
|
|
17
17
|
});
|
|
18
18
|
const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
19
19
|
start: {
|
|
@@ -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<
|
|
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<HTMLElement>;\n};\n\nexport type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __styles, mergeClasses
|
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
3
|
/**
|
|
4
4
|
* CSS variable names used internally for uniform styling in Drawer.
|
|
@@ -37,16 +37,18 @@ const useDrawerStyles = /*#__PURE__*/__styles({
|
|
|
37
37
|
Hwfdqs: "f5e8c63"
|
|
38
38
|
},
|
|
39
39
|
start: {
|
|
40
|
-
|
|
41
|
-
vrafjx:
|
|
42
|
-
|
|
40
|
+
h3c5rm: 0,
|
|
41
|
+
vrafjx: 0,
|
|
42
|
+
Bekrc4i: 0,
|
|
43
|
+
u1mtju: ["f1xteiwb", "fsqykmd"],
|
|
43
44
|
oyh7mz: ["f1vgc2s3", "f1e31b4d"],
|
|
44
45
|
j35jbq: ["fvfyk4", "frppm18"]
|
|
45
46
|
},
|
|
46
47
|
end: {
|
|
47
|
-
|
|
48
|
-
wvpqe5:
|
|
49
|
-
|
|
48
|
+
zhjwy3: 0,
|
|
49
|
+
wvpqe5: 0,
|
|
50
|
+
ibv6hh: 0,
|
|
51
|
+
B4g9neb: ["fsqykmd", "f1xteiwb"],
|
|
50
52
|
j35jbq: ["f1e31b4d", "f1vgc2s3"],
|
|
51
53
|
oyh7mz: ["frppm18", "fvfyk4"]
|
|
52
54
|
},
|
|
@@ -67,7 +69,15 @@ const useDrawerStyles = /*#__PURE__*/__styles({
|
|
|
67
69
|
Bjr0ffy: "fsdmzs6"
|
|
68
70
|
}
|
|
69
71
|
}, {
|
|
70
|
-
d: [".f18ad807{transition-timing-function:var(--curveDecelerateMid);}", ".f1mfizis{transition-timing-function:var(--curveAccelerateMin);}", ".
|
|
72
|
+
d: [".f18ad807{transition-timing-function:var(--curveDecelerateMid);}", ".f1mfizis{transition-timing-function:var(--curveAccelerateMin);}", [".f1xteiwb{border-right:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
73
|
+
p: -1
|
|
74
|
+
}], [".fsqykmd{border-left:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
75
|
+
p: -1
|
|
76
|
+
}], ".f1vgc2s3{left:0;}", ".f1e31b4d{right:0;}", ".fvfyk4{right:auto;}", ".frppm18{left:auto;}", [".fsqykmd{border-left:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
77
|
+
p: -1
|
|
78
|
+
}], [".f1xteiwb{border-right:var(--strokeWidthThin) solid var(--colorTransparentStroke);}", {
|
|
79
|
+
p: -1
|
|
80
|
+
}], ".f1yab3r1{bottom:0;}", ".f198g47y{top:auto;}", ".f1exhnwo{--fui-Drawer--size:320px;}", ".fqofjzu{--fui-Drawer--size:592px;}", ".fce6y3m{--fui-Drawer--size:940px;}", ".fsdmzs6{--fui-Drawer--size:100vw;}"],
|
|
71
81
|
m: [["@media screen and (prefers-reduced-motion: reduce){.f5e8c63{transition-duration:0.001ms;}}", {
|
|
72
82
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
73
83
|
}]]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tokens","drawerCSSVars","drawerSizeVar","drawerDefaultStyles","overflow","width","maxWidth","height","maxHeight","boxSizing","display","flexDirection","alignItems","justifyContent","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground1","useDrawerStyles","entering","Bkqvd7p","exiting","reducedMotion","Hwfdqs","start","h3c5rm","vrafjx","Bekrc4i","u1mtju","oyh7mz","j35jbq","end","zhjwy3","wvpqe5","ibv6hh","B4g9neb","bottom","B5kzvoi","Bhzewxz","small","Bjr0ffy","medium","large","full","d","p","m","useDrawerBottomBaseStyles","useDrawerDurationStyles","B3o57yi","useDrawerBaseClassNames","position","size","motion","baseStyles","bottomBaseStyles","durationStyles","type"],"sources":["useDrawerBaseStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * CSS variable names used internally for uniform styling in Drawer.\n */ export const drawerCSSVars = {\n drawerSizeVar: '--fui-Drawer--size'\n};\n/**\n * Default shared styles for the Drawer component\n */ export const drawerDefaultStyles = {\n overflow: 'hidden',\n width: `var(${drawerCSSVars.drawerSizeVar})`,\n maxWidth: '100vw',\n height: 'auto',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1\n};\n/**\n * Shared dynamic styles for the Drawer component\n */ const useDrawerStyles = makeStyles({\n /* Motion */ entering: {\n transitionTimingFunction: tokens.curveDecelerateMid\n },\n exiting: {\n transitionTimingFunction: tokens.curveAccelerateMin\n },\n reducedMotion: {\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.001ms'\n }\n },\n /* Positioning */ start: {\n borderRight: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n left: 0,\n right: 'auto'\n },\n end: {\n borderLeft: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n right: 0,\n left: 'auto'\n },\n bottom: {\n bottom: 0,\n top: 'auto'\n },\n /* Sizes */ small: {\n [drawerCSSVars.drawerSizeVar]: '320px'\n },\n medium: {\n [drawerCSSVars.drawerSizeVar]: '592px'\n },\n large: {\n [drawerCSSVars.drawerSizeVar]: '940px'\n },\n full: {\n [drawerCSSVars.drawerSizeVar]: '100vw'\n }\n});\nexport const useDrawerBottomBaseStyles = makeStyles({\n /* Sizes for position bottom */ small: {\n [drawerCSSVars.drawerSizeVar]: '320px'\n },\n medium: {\n [drawerCSSVars.drawerSizeVar]: '592px'\n },\n large: {\n [drawerCSSVars.drawerSizeVar]: '940px'\n },\n full: {\n [drawerCSSVars.drawerSizeVar]: '100vh'\n }\n});\nexport const useDrawerDurationStyles = makeStyles({\n small: {\n transitionDuration: tokens.durationGentle\n },\n medium: {\n transitionDuration: tokens.durationSlow\n },\n large: {\n transitionDuration: tokens.durationSlower\n },\n full: {\n transitionDuration: tokens.durationUltraSlow\n }\n});\nexport const useDrawerBaseClassNames = ({ position, size, motion })=>{\n const baseStyles = useDrawerStyles();\n const bottomBaseStyles = useDrawerBottomBaseStyles();\n const durationStyles = useDrawerDurationStyles();\n return mergeClasses(baseStyles[position], position === 'bottom' && bottomBaseStyles[size], durationStyles[size], position !== 'bottom' && baseStyles[size], baseStyles.reducedMotion, motion.type === 'entering' && baseStyles.entering, motion.type === 'exiting' && baseStyles.exiting);\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C;AACA;AACA;AAAI,OAAO,MAAMC,aAAa,GAAG;EAC7BC,aAAa,EAAE;AACnB,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,mBAAmB,GAAG;EACnCC,QAAQ,EAAE,QAAQ;EAClBC,KAAK,EAAE,OAAOJ,aAAa,CAACC,aAAa,GAAG;EAC5CI,QAAQ,EAAE,OAAO;EACjBC,MAAM,EAAE,MAAM;EACdC,SAAS,EAAE,OAAO;EAClBC,SAAS,EAAE,YAAY;EACvBC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,UAAU,EAAE,YAAY;EACxBC,cAAc,EAAE,YAAY;EAC5BC,eAAe,EAAEd,MAAM,CAACe,uBAAuB;EAC/CC,KAAK,EAAEhB,MAAM,CAACiB;AAClB,CAAC;AACD;AACA;AACA;AAAI,MAAMC,eAAe,gBAAGpB,QAAA;EAAAqB,QAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAD,OAAA;EAAA;EAAAE,aAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,GAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAL,MAAA;IAAAD,MAAA;EAAA;EAAAO,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAD,OAAA;EAAA;EAAAE,KAAA;IAAAF,OAAA;EAAA;EAAAG,IAAA;IAAAH,OAAA;EAAA;AAAA;EAAAI,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;AAAA,CAsC3B,CAAC;AACF,OAAO,MAAMC,yBAAyB,gBAAGjD,QAAA;EAAAyC,KAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAD,OAAA;EAAA;EAAAE,KAAA;IAAAF,OAAA;EAAA;EAAAG,IAAA;IAAAH,OAAA;EAAA;AAAA;EAAAI,CAAA;AAAA,CAaxC,CAAC;AACF,OAAO,MAAMI,uBAAuB,gBAAGlD,QAAA;EAAAyC,KAAA;IAAAU,OAAA;EAAA;EAAAR,MAAA;IAAAQ,OAAA;EAAA;EAAAP,KAAA;IAAAO,OAAA;EAAA;EAAAN,IAAA;IAAAM,OAAA;EAAA;AAAA;EAAAL,CAAA;AAAA,CAatC,CAAC;AACF,OAAO,MAAMM,uBAAuB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,IAAI;EAAEC;AAAO,CAAC,KAAG;EACjE,MAAMC,UAAU,GAAGpC,eAAe,CAAC,CAAC;EACpC,MAAMqC,gBAAgB,GAAGR,yBAAyB,CAAC,CAAC;EACpD,MAAMS,cAAc,GAAGR,uBAAuB,CAAC,CAAC;EAChD,OAAOjD,YAAY,CAACuD,UAAU,CAACH,QAAQ,CAAC,EAAEA,QAAQ,KAAK,QAAQ,IAAII,gBAAgB,CAACH,IAAI,CAAC,EAAEI,cAAc,CAACJ,IAAI,CAAC,EAAED,QAAQ,KAAK,QAAQ,IAAIG,UAAU,CAACF,IAAI,CAAC,EAAEE,UAAU,CAAChC,aAAa,EAAE+B,MAAM,CAACI,IAAI,KAAK,UAAU,IAAIH,UAAU,CAACnC,QAAQ,EAAEkC,MAAM,CAACI,IAAI,KAAK,SAAS,IAAIH,UAAU,CAACjC,OAAO,CAAC;AAC7R,CAAC","ignoreList":[]}
|
|
@@ -19,10 +19,10 @@ const useDrawer_unstable = (props, ref)=>{
|
|
|
19
19
|
components: {
|
|
20
20
|
root: elementType
|
|
21
21
|
},
|
|
22
|
-
root: _reactutilities.slot.always(
|
|
22
|
+
root: _reactutilities.slot.always({
|
|
23
23
|
ref,
|
|
24
24
|
...props
|
|
25
|
-
}
|
|
25
|
+
}, {
|
|
26
26
|
elementType
|
|
27
27
|
})
|
|
28
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { OverlayDrawer } from '../OverlayDrawer';\nimport { InlineDrawer } from '../InlineDrawer';\n/**\n * Create the state required to render Drawer.\n *\n * The returned state can be modified with hooks such as useDrawerStyles_unstable,\n * before being passed to renderDrawer_unstable.\n *\n * @param props - props from this instance of Drawer\n * @param ref - reference to root HTMLElement of Drawer\n */ export const useDrawer_unstable = (props, ref)=>{\n const elementType = props.type === 'inline' ? InlineDrawer : OverlayDrawer;\n return {\n components: {\n root: elementType\n },\n root: slot.always(
|
|
1
|
+
{"version":3,"sources":["useDrawer.js"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { OverlayDrawer } from '../OverlayDrawer';\nimport { InlineDrawer } from '../InlineDrawer';\n/**\n * Create the state required to render Drawer.\n *\n * The returned state can be modified with hooks such as useDrawerStyles_unstable,\n * before being passed to renderDrawer_unstable.\n *\n * @param props - props from this instance of Drawer\n * @param ref - reference to root HTMLElement of Drawer\n */ export const useDrawer_unstable = (props, ref)=>{\n const elementType = props.type === 'inline' ? InlineDrawer : OverlayDrawer;\n return {\n components: {\n root: elementType\n },\n root: slot.always({\n ref,\n ...props\n }, {\n elementType\n })\n };\n};\n"],"names":["useDrawer_unstable","props","ref","elementType","type","InlineDrawer","OverlayDrawer","components","root","slot","always"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCACF;+BACS;8BACD;AASlB,MAAMA,qBAAqB,CAACC,OAAOC;IAC1C,MAAMC,cAAcF,MAAMG,IAAI,KAAK,WAAWC,0BAAY,GAAGC,4BAAa;IAC1E,OAAO;QACHC,YAAY;YACRC,MAAML;QACV;QACAK,MAAMC,oBAAI,CAACC,MAAM,CAAC;YACdR;YACA,GAAGD,KAAK;QACZ,GAAG;YACCE;QACJ;IACJ;AACJ"}
|