@fluentui/react-drawer 9.0.0-beta.32 → 9.0.0-beta.33
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.json +52 -1
- package/CHANGELOG.md +17 -2
- package/dist/index.d.ts +33 -9
- package/lib/components/Drawer/useDrawer.js +1 -2
- package/lib/components/Drawer/useDrawer.js.map +1 -1
- package/lib/components/DrawerInline/useDrawerInlineStyles.styles.js +1 -1
- package/lib/components/DrawerInline/useDrawerInlineStyles.styles.js.map +1 -1
- package/lib/components/DrawerOverlay/DrawerOverlay.types.js.map +1 -1
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.js +13 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.js.map +1 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.types.js +1 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.types.js.map +1 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/index.js +2 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/index.js.map +1 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/useDrawerOverlaySurfaceStyles.styles.js +29 -0
- package/lib/components/DrawerOverlay/DrawerOverlaySurface/useDrawerOverlaySurfaceStyles.styles.js.map +1 -0
- package/lib/components/DrawerOverlay/renderDrawerOverlay.js +1 -1
- package/lib/components/DrawerOverlay/renderDrawerOverlay.js.map +1 -1
- package/lib/components/DrawerOverlay/useDrawerOverlay.js +25 -24
- package/lib/components/DrawerOverlay/useDrawerOverlay.js.map +1 -1
- package/lib/components/DrawerOverlay/useDrawerOverlayStyles.styles.js +9 -38
- package/lib/components/DrawerOverlay/useDrawerOverlayStyles.styles.js.map +1 -1
- package/lib/shared/useDrawerBaseStyles.styles.js +3 -4
- package/lib/shared/useDrawerBaseStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Drawer/useDrawer.js +1 -2
- package/lib-commonjs/components/Drawer/useDrawer.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/useDrawerInlineStyles.styles.js +2 -3
- package/lib-commonjs/components/DrawerInline/useDrawerInlineStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.js +21 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.js.map +1 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.types.js +4 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/DrawerOverlaySurface.types.js.map +1 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/index.js +7 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/index.js.map +1 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/useDrawerOverlaySurfaceStyles.styles.js +46 -0
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlaySurface/useDrawerOverlaySurfaceStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DrawerOverlay/renderDrawerOverlay.js +1 -1
- package/lib-commonjs/components/DrawerOverlay/renderDrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlay.js +24 -23
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlayStyles.styles.js +18 -91
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlayStyles.styles.js.map +1 -1
- package/lib-commonjs/shared/useDrawerBaseStyles.styles.js +3 -4
- package/lib-commonjs/shared/useDrawerBaseStyles.styles.js.map +1 -1
- package/package.json +7 -6
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,58 @@
|
|
|
2
2
|
"name": "@fluentui/react-drawer",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 09 Oct 2023 20:41:55 GMT",
|
|
6
|
+
"tag": "@fluentui/react-drawer_v9.0.0-beta.33",
|
|
7
|
+
"version": "9.0.0-beta.33",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "marcosvmmoura@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-drawer",
|
|
13
|
+
"commit": "fd51d508488549b816c5d7d0d3f89b2bac2b1065",
|
|
14
|
+
"comment": "feat: make dialog slot internal to be used for composition only"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-drawer",
|
|
19
|
+
"comment": "Bump @fluentui/react-dialog to v9.7.7",
|
|
20
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-drawer",
|
|
25
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.15",
|
|
26
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-drawer",
|
|
31
|
+
"comment": "Bump @fluentui/react-motion-preview to v0.3.1",
|
|
32
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-drawer",
|
|
37
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.10.0",
|
|
38
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-drawer",
|
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.5",
|
|
44
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-drawer",
|
|
49
|
+
"comment": "Bump @fluentui/react-utilities to v9.14.2",
|
|
50
|
+
"commit": "d2196ea1ca001fbc22f38fcb258016f1df6c87e4"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Thu, 05 Oct 2023 15:25:35 GMT",
|
|
6
57
|
"tag": "@fluentui/react-drawer_v9.0.0-beta.32",
|
|
7
58
|
"version": "9.0.0-beta.32",
|
|
8
59
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-drawer
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 09 Oct 2023 20:41:55 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.33](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.0.0-beta.33)
|
|
8
|
+
|
|
9
|
+
Mon, 09 Oct 2023 20:41:55 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.0.0-beta.32..@fluentui/react-drawer_v9.0.0-beta.33)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat: make dialog slot internal to be used for composition only ([PR #29392](https://github.com/microsoft/fluentui/pull/29392) by marcosvmmoura@gmail.com)
|
|
15
|
+
- Bump @fluentui/react-dialog to v9.7.7 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.15 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
17
|
+
- Bump @fluentui/react-motion-preview to v0.3.1 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
18
|
+
- Bump @fluentui/react-shared-contexts to v9.10.0 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.13.5 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.14.2 ([PR #29364](https://github.com/microsoft/fluentui/pull/29364) by beachball)
|
|
21
|
+
|
|
7
22
|
## [9.0.0-beta.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.0.0-beta.32)
|
|
8
23
|
|
|
9
|
-
Thu, 05 Oct 2023 15:
|
|
24
|
+
Thu, 05 Oct 2023 15:25:35 GMT
|
|
10
25
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.0.0-beta.31..@fluentui/react-drawer_v9.0.0-beta.32)
|
|
11
26
|
|
|
12
27
|
### Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
5
|
-
import { DialogProps } from '@fluentui/react-dialog';
|
|
6
|
-
import {
|
|
7
|
-
import { DialogSurfaceSlots } from '@fluentui/react-dialog';
|
|
5
|
+
import type { DialogProps } from '@fluentui/react-dialog';
|
|
6
|
+
import type { DialogSurfaceSlots } from '@fluentui/react-dialog';
|
|
8
7
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
9
8
|
import { MotionShorthand } from '@fluentui/react-motion-preview';
|
|
10
9
|
import { MotionState } from '@fluentui/react-motion-preview';
|
|
@@ -198,28 +197,53 @@ export declare type DrawerInlineState = Required<ComponentState<DrawerInlineSlot
|
|
|
198
197
|
*/
|
|
199
198
|
export declare const DrawerOverlay: ForwardRefComponent<DrawerOverlayProps>;
|
|
200
199
|
|
|
201
|
-
export declare const drawerOverlayClassNames:
|
|
200
|
+
export declare const drawerOverlayClassNames: SlotClassNames<DrawerOverlaySurfaceSlots>;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* DrawerOverlay internal slots for when using with composition API
|
|
204
|
+
*/
|
|
205
|
+
declare type DrawerOverlayInternalSlots = DrawerOverlaySlots & {
|
|
206
|
+
/**
|
|
207
|
+
* Slot for the dialog component that wraps the drawer.
|
|
208
|
+
*/
|
|
209
|
+
dialog: Slot<DialogProps>;
|
|
210
|
+
};
|
|
202
211
|
|
|
203
212
|
/**
|
|
204
213
|
* DrawerOverlay Props
|
|
205
214
|
*/
|
|
206
215
|
export declare type DrawerOverlayProps = ComponentProps<DrawerOverlaySlots> & Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus' | 'defaultOpen'> & DrawerBaseProps;
|
|
207
216
|
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
/**
|
|
218
|
+
* DrawerOverlay slots
|
|
219
|
+
*/
|
|
220
|
+
export declare type DrawerOverlaySlots = {
|
|
210
221
|
/**
|
|
211
|
-
* Slot for the
|
|
222
|
+
* Slot for the root element.
|
|
212
223
|
*/
|
|
213
|
-
|
|
224
|
+
root: Slot<DrawerOverlaySurfaceProps>;
|
|
214
225
|
};
|
|
215
226
|
|
|
216
227
|
/**
|
|
217
228
|
* State used in rendering DrawerOverlay
|
|
218
229
|
*/
|
|
219
|
-
export declare type DrawerOverlayState = Omit<ComponentState<
|
|
230
|
+
export declare type DrawerOverlayState = Omit<ComponentState<DrawerOverlayInternalSlots>, 'backdrop'> & Required<DrawerBaseState & {
|
|
231
|
+
/**
|
|
232
|
+
* Motion state for the drawer backdrop.
|
|
233
|
+
*/
|
|
220
234
|
backdropMotion: MotionState<HTMLDivElement>;
|
|
221
235
|
}>;
|
|
222
236
|
|
|
237
|
+
/**
|
|
238
|
+
* DrawerOverlaySurface Props
|
|
239
|
+
*/
|
|
240
|
+
declare type DrawerOverlaySurfaceProps = ComponentProps<DrawerOverlaySurfaceSlots>;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* DrawerOverlaySurface slots
|
|
244
|
+
*/
|
|
245
|
+
declare type DrawerOverlaySurfaceSlots = DialogSurfaceSlots;
|
|
246
|
+
|
|
223
247
|
/**
|
|
224
248
|
* Drawer Props
|
|
225
249
|
*/
|
|
@@ -11,8 +11,7 @@ import { DrawerInline } from '../DrawerInline';
|
|
|
11
11
|
* @param props - props from this instance of Drawer
|
|
12
12
|
* @param ref - reference to root HTMLElement of Drawer
|
|
13
13
|
*/ export const useDrawer_unstable = (props, ref)=>{
|
|
14
|
-
const
|
|
15
|
-
const elementType = type === 'overlay' ? DrawerOverlay : DrawerInline;
|
|
14
|
+
const elementType = props.type === 'inline' ? DrawerInline : DrawerOverlay;
|
|
16
15
|
return {
|
|
17
16
|
components: {
|
|
18
17
|
root: elementType
|
|
@@ -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 { DrawerOverlay } from '../DrawerOverlay';\nimport { DrawerInline } from '../DrawerInline';\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
|
|
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 { DrawerOverlay } from '../DrawerOverlay';\nimport { DrawerInline } from '../DrawerInline';\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' ? DrawerInline : DrawerOverlay;\n\n return {\n components: {\n root: elementType,\n },\n\n root: slot.always<DrawerProps>(\n slot.resolveShorthand({\n ref,\n ...props,\n }),\n {\n elementType,\n },\n ),\n };\n};\n"],"names":["React","slot","DrawerOverlay","DrawerInline","useDrawer_unstable","props","ref","elementType","type","components","root","always","resolveShorthand"],"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,CACfV,KAAKW,gBAAgB,CAAC;YACpBN;YACA,GAAGD,KAAK;QACV,IACA;YACEE;QACF;IAEJ;AACF,EAAE"}
|
|
@@ -5,7 +5,7 @@ import { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../
|
|
|
5
5
|
export const drawerInlineClassNames = {
|
|
6
6
|
root: 'fui-DrawerInline'
|
|
7
7
|
};
|
|
8
|
-
const useDrawerResetStyles = /*#__PURE__*/__resetStyles("
|
|
8
|
+
const useDrawerResetStyles = /*#__PURE__*/__resetStyles("rlrvcho", null, [".rlrvcho{overflow-x:hidden;overflow-y: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:relative;opacity:0;transition-property:opacity,transform;will-change:opacity,transform;}"]);
|
|
9
9
|
/**
|
|
10
10
|
* Styles for the root slot
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","__resetStyles","__styles","mergeClasses","shorthands","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","drawerInlineClassNames","root","useDrawerResetStyles","separatorValues","colorNeutralBackground3","useDrawerRootStyles","separatorStart","Bekrc4i","vrafjx","h3c5rm","separatorEnd","ibv6hh","wvpqe5","zhjwy3","start","Bz10aip","end","visible","abs64n","d","useDrawerInlineStyles_unstable","state","resetStyles","baseClassNames","rootStyles","separatorClass","useMemo","separator","undefined","position","className","motion","active"],"sources":["useDrawerInlineStyles.styles.js"],"sourcesContent":["import * as React from 'react';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\nexport const drawerInlineClassNames = {\n root: 'fui-DrawerInline'\n};\nconst useDrawerResetStyles = makeResetStyles({\n ...drawerDefaultStyles,\n position: 'relative',\n opacity: 0,\n transitionProperty: 'opacity, transform',\n willChange: 'opacity, transform'\n});\n/**\n * Styles for the root slot\n */ const separatorValues = [\n '1px',\n 'solid',\n tokens.colorNeutralBackground3\n];\nconst useDrawerRootStyles = makeStyles({\n /* Separator */ separatorStart: {\n ...shorthands.borderRight(...separatorValues)\n },\n separatorEnd: {\n ...shorthands.borderLeft(...separatorValues)\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 /* Visible */ visible: {\n opacity: 1,\n transform: `translate3D(0, 0, 0)`\n }\n});\n/**\n * Apply styling to the DrawerInline slots based on the state\n */ export const useDrawerInlineStyles_unstable = (state)=>{\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n const separatorClass = React.useMemo(()=>{\n if (!state.separator) {\n return undefined;\n }\n return state.position === 'start' ? rootStyles.separatorStart : rootStyles.separatorEnd;\n }, [\n state.position,\n state.separator,\n rootStyles.separatorEnd,\n rootStyles.separatorStart\n ]);\n state.root.className = mergeClasses(drawerInlineClassNames.root, resetStyles, baseClassNames, separatorClass, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,yCAAyC;AACrH,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,gBAAGV,aAAA,+
|
|
1
|
+
{"version":3,"names":["React","__resetStyles","__styles","mergeClasses","shorthands","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","drawerInlineClassNames","root","useDrawerResetStyles","separatorValues","colorNeutralBackground3","useDrawerRootStyles","separatorStart","Bekrc4i","vrafjx","h3c5rm","separatorEnd","ibv6hh","wvpqe5","zhjwy3","start","Bz10aip","end","visible","abs64n","d","useDrawerInlineStyles_unstable","state","resetStyles","baseClassNames","rootStyles","separatorClass","useMemo","separator","undefined","position","className","motion","active"],"sources":["useDrawerInlineStyles.styles.js"],"sourcesContent":["import * as React from 'react';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\nexport const drawerInlineClassNames = {\n root: 'fui-DrawerInline'\n};\nconst useDrawerResetStyles = makeResetStyles({\n ...drawerDefaultStyles,\n position: 'relative',\n opacity: 0,\n transitionProperty: 'opacity, transform',\n willChange: 'opacity, transform'\n});\n/**\n * Styles for the root slot\n */ const separatorValues = [\n '1px',\n 'solid',\n tokens.colorNeutralBackground3\n];\nconst useDrawerRootStyles = makeStyles({\n /* Separator */ separatorStart: {\n ...shorthands.borderRight(...separatorValues)\n },\n separatorEnd: {\n ...shorthands.borderLeft(...separatorValues)\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 /* Visible */ visible: {\n opacity: 1,\n transform: `translate3D(0, 0, 0)`\n }\n});\n/**\n * Apply styling to the DrawerInline slots based on the state\n */ export const useDrawerInlineStyles_unstable = (state)=>{\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n const separatorClass = React.useMemo(()=>{\n if (!state.separator) {\n return undefined;\n }\n return state.position === 'start' ? rootStyles.separatorStart : rootStyles.separatorEnd;\n }, [\n state.position,\n state.separator,\n rootStyles.separatorEnd,\n rootStyles.separatorStart\n ]);\n state.root.className = mergeClasses(drawerInlineClassNames.root, resetStyles, baseClassNames, separatorClass, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,yCAAyC;AACrH,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,gBAAGV,aAAA,+aAM5B,CAAC;AACF;AACA;AACA;AAAI,MAAMW,eAAe,GAAG,CACxB,KAAK,EACL,OAAO,EACPP,MAAM,CAACQ,uBAAuB,CACjC;AACD,MAAMC,mBAAmB,gBAAGZ,QAAA;EAAAa,cAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;EAAA;EAAAC,GAAA;IAAAD,OAAA;EAAA;EAAAE,OAAA;IAAAC,MAAA;IAAAH,OAAA;EAAA;AAAA;EAAAI,CAAA;AAAA,CAiB3B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,MAAMC,WAAW,GAAGpB,oBAAoB,CAAC,CAAC;EAC1C,MAAMqB,cAAc,GAAGxB,uBAAuB,CAACsB,KAAK,CAAC;EACrD,MAAMG,UAAU,GAAGnB,mBAAmB,CAAC,CAAC;EACxC,MAAMoB,cAAc,GAAGlC,KAAK,CAACmC,OAAO,CAAC,MAAI;IACrC,IAAI,CAACL,KAAK,CAACM,SAAS,EAAE;MAClB,OAAOC,SAAS;IACpB;IACA,OAAOP,KAAK,CAACQ,QAAQ,KAAK,OAAO,GAAGL,UAAU,CAAClB,cAAc,GAAGkB,UAAU,CAACd,YAAY;EAC3F,CAAC,EAAE,CACCW,KAAK,CAACQ,QAAQ,EACdR,KAAK,CAACM,SAAS,EACfH,UAAU,CAACd,YAAY,EACvBc,UAAU,CAAClB,cAAc,CAC5B,CAAC;EACFe,KAAK,CAACpB,IAAI,CAAC6B,SAAS,GAAGpC,YAAY,CAACM,sBAAsB,CAACC,IAAI,EAAEqB,WAAW,EAAEC,cAAc,EAAEE,cAAc,EAAED,UAAU,CAACH,KAAK,CAACQ,QAAQ,CAAC,EAAER,KAAK,CAACU,MAAM,CAACC,MAAM,IAAIR,UAAU,CAACP,OAAO,EAAEI,KAAK,CAACpB,IAAI,CAAC6B,SAAS,CAAC;EAC1M,OAAOT,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerOverlay.types.ts"],"sourcesContent":["import { DialogProps
|
|
1
|
+
{"version":3,"sources":["DrawerOverlay.types.ts"],"sourcesContent":["import type { DialogProps } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { MotionState } from '@fluentui/react-motion-preview';\n\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\nimport { DrawerOverlaySurfaceProps } from './DrawerOverlaySurface';\n\n/**\n * DrawerOverlay slots\n */\nexport type DrawerOverlaySlots = {\n /**\n * Slot for the root element.\n */\n root: Slot<DrawerOverlaySurfaceProps>;\n};\n\n/**\n * DrawerOverlay internal slots for when using with composition API\n */\nexport type DrawerOverlayInternalSlots = DrawerOverlaySlots & {\n /**\n * Slot for the dialog component that wraps the drawer.\n */\n dialog: Slot<DialogProps>;\n};\n\n/**\n * DrawerOverlay Props\n */\nexport type DrawerOverlayProps = ComponentProps<DrawerOverlaySlots> &\n Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus' | 'defaultOpen'> &\n DrawerBaseProps;\n\n/**\n * State used in rendering DrawerOverlay\n */\nexport type DrawerOverlayState = Omit<ComponentState<DrawerOverlayInternalSlots>, 'backdrop'> &\n Required<\n DrawerBaseState & {\n /**\n * Motion state for the drawer backdrop.\n */\n backdropMotion: MotionState<HTMLDivElement>;\n }\n >;\n"],"names":[],"mappings":"AAAA,WA6CI"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDialogSurface_unstable, useDialogSurfaceContextValues_unstable, renderDialogSurface_unstable } from '@fluentui/react-dialog';
|
|
3
|
+
import { useDrawerOverlaySurfaceStyles_unstable } from './useDrawerOverlaySurfaceStyles.styles';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* DrawerOverlaySurface is a proxy for DialogSurface as is only meant to be used internally for Drawer.
|
|
7
|
+
*/ export const DrawerOverlaySurface = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const dialogSurfaceState = useDialogSurface_unstable(props, ref);
|
|
9
|
+
const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);
|
|
10
|
+
useDrawerOverlaySurfaceStyles_unstable(dialogSurfaceState);
|
|
11
|
+
return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);
|
|
12
|
+
});
|
|
13
|
+
DrawerOverlaySurface.displayName = 'DrawerOverlaySurface';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["DrawerOverlaySurface.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 { useDrawerOverlaySurfaceStyles_unstable } from './useDrawerOverlaySurfaceStyles.styles';\nimport type { DrawerOverlaySurfaceProps } from './DrawerOverlaySurface.types';\n\n/**\n * @internal\n * DrawerOverlaySurface is a proxy for DialogSurface as is only meant to be used internally for Drawer.\n */\nexport const DrawerOverlaySurface: ForwardRefComponent<DrawerOverlaySurfaceProps> = React.forwardRef((props, ref) => {\n const dialogSurfaceState = useDialogSurface_unstable(props, ref);\n const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);\n\n useDrawerOverlaySurfaceStyles_unstable(dialogSurfaceState);\n\n return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);\n});\n\nDrawerOverlaySurface.displayName = 'DrawerOverlaySurface';\n"],"names":["React","useDialogSurface_unstable","useDialogSurfaceContextValues_unstable","renderDialogSurface_unstable","useDrawerOverlaySurfaceStyles_unstable","DrawerOverlaySurface","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,0BAA0BM,OAAOC;IAC5D,MAAME,6BAA6BR,uCAAuCO;IAE1EL,uCAAuCK;IAEvC,OAAON,6BAA6BM,oBAAoBC;AAC1D,GAAG;AAEHL,qBAAqBM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["DrawerOverlaySurface.types.ts"],"sourcesContent":["import type { DialogSurfaceSlots, DialogSurfaceState } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\n\n/**\n * DrawerOverlaySurface slots\n */\nexport type DrawerOverlaySurfaceSlots = DialogSurfaceSlots;\n\n/**\n * DrawerOverlaySurface Props\n */\nexport type DrawerOverlaySurfaceProps = ComponentProps<DrawerOverlaySurfaceSlots>;\n\n/**\n * State used in rendering DrawerOverlaySurface\n */\nexport type DrawerOverlaySurfaceState = ComponentState<DrawerOverlaySurfaceSlots> & DialogSurfaceState;\n"],"names":[],"mappings":"AAAA,WAgBuG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './DrawerOverlaySurface';\nexport * from './DrawerOverlaySurface.types';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,+BAA+B"}
|
package/lib/components/DrawerOverlay/DrawerOverlaySurface/useDrawerOverlaySurfaceStyles.styles.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
export const drawerOverlaySurfaceClassNames = {
|
|
4
|
+
root: 'fui-DrawerOverlaySurface',
|
|
5
|
+
backdrop: 'fui-DrawerOverlaySurface__backdrop'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Styles for the backdrop slot
|
|
9
|
+
*/
|
|
10
|
+
const useBackdropResetStyles = /*#__PURE__*/__resetStyles("rivxbo", "r1trjn1z", [".rivxbo{top:0px;right:0px;bottom:0px;left:0px;position:fixed;background-color:rgba(0, 0, 0, 0.4);}", ".r1trjn1z{top:0px;left:0px;bottom:0px;right:0px;position:fixed;background-color:rgba(0, 0, 0, 0.4);}"]);
|
|
11
|
+
const useBackdropStyles = /*#__PURE__*/__styles({
|
|
12
|
+
nested: {
|
|
13
|
+
De3pzq: "f1c21dwh"
|
|
14
|
+
}
|
|
15
|
+
}, {
|
|
16
|
+
d: [".f1c21dwh{background-color:var(--colorTransparentBackground);}"]
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Apply styling to the DrawerOverlaySurface slots based on the state
|
|
20
|
+
*/
|
|
21
|
+
export const useDrawerOverlaySurfaceStyles_unstable = state => {
|
|
22
|
+
const backdropResetStyles = useBackdropResetStyles();
|
|
23
|
+
const backdropStyles = useBackdropStyles();
|
|
24
|
+
if (state.backdrop) {
|
|
25
|
+
state.backdrop.className = mergeClasses(backdropResetStyles, state.isNestedDialog && backdropStyles.nested, state.backdrop.className);
|
|
26
|
+
}
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useDrawerOverlaySurfaceStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","tokens","drawerOverlaySurfaceClassNames","root","backdrop","useBackdropResetStyles","useBackdropStyles","nested","De3pzq","d","useDrawerOverlaySurfaceStyles_unstable","state","backdropResetStyles","backdropStyles","className","isNestedDialog"],"sources":["useDrawerOverlaySurfaceStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerOverlaySurfaceClassNames = {\n root: 'fui-DrawerOverlaySurface',\n backdrop: 'fui-DrawerOverlaySurface__backdrop'\n};\n/**\n * Styles for the backdrop slot\n */ const useBackdropResetStyles = makeResetStyles({\n ...shorthands.inset('0px'),\n position: 'fixed',\n backgroundColor: 'rgba(0, 0, 0, 0.4)'\n});\nconst useBackdropStyles = makeStyles({\n nested: {\n backgroundColor: tokens.colorTransparentBackground\n }\n});\n/**\n * Apply styling to the DrawerOverlaySurface slots based on the state\n */ export const useDrawerOverlaySurfaceStyles_unstable = (state)=>{\n const backdropResetStyles = useBackdropResetStyles();\n const backdropStyles = useBackdropStyles();\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(backdropResetStyles, state.isNestedDialog && backdropStyles.nested, state.backdrop.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,8BAA8B,GAAG;EAC1CC,IAAI,EAAE,0BAA0B;EAChCC,QAAQ,EAAE;AACd,CAAC;AACD;AACA;AACA;AAAI,MAAMC,sBAAsB,gBAAGR,aAAA,qOAIlC,CAAC;AACF,MAAMS,iBAAiB,gBAAGR,QAAA;EAAAS,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAIzB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,sCAAsC,GAAIC,KAAK,IAAG;EAC/D,MAAMC,mBAAmB,GAAGP,sBAAsB,CAAC,CAAC;EACpD,MAAMQ,cAAc,GAAGP,iBAAiB,CAAC,CAAC;EAC1C,IAAIK,KAAK,CAACP,QAAQ,EAAE;IAChBO,KAAK,CAACP,QAAQ,CAACU,SAAS,GAAGf,YAAY,CAACa,mBAAmB,EAAED,KAAK,CAACI,cAAc,IAAIF,cAAc,CAACN,MAAM,EAAEI,KAAK,CAACP,QAAQ,CAACU,SAAS,CAAC;EACzI;EACA,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { assertSlots } from '@fluentui/react-utilities';
|
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DrawerOverlay
|
|
5
5
|
*/ export const renderDrawerOverlay_unstable = (state)=>{
|
|
6
|
-
if (!state.
|
|
6
|
+
if (!state.motion.canRender) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
assertSlots(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDrawerOverlay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { DrawerOverlayState,
|
|
1
|
+
{"version":3,"sources":["renderDrawerOverlay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport type { DrawerOverlayState, DrawerOverlayInternalSlots } from './DrawerOverlay.types';\n\n/**\n * Render the final JSX of DrawerOverlay\n */\nexport const renderDrawerOverlay_unstable = (state: DrawerOverlayState) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<DrawerOverlayInternalSlots>(state);\n\n return (\n <state.dialog>\n <state.root />\n </state.dialog>\n );\n};\n"],"names":["assertSlots","renderDrawerOverlay_unstable","state","motion","canRender","dialog","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3C,IAAI,CAACA,MAAMC,MAAM,CAACC,SAAS,EAAE;QAC3B,OAAO;IACT;IAEAJ,YAAwCE;IAExC,qBACE,KAACA,MAAMG,MAAM;kBACX,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { slot, useMergedRefs } from '@fluentui/react-utilities';
|
|
3
|
-
import { Dialog
|
|
3
|
+
import { Dialog } from '@fluentui/react-dialog';
|
|
4
4
|
import { useMotion } from '@fluentui/react-motion-preview';
|
|
5
5
|
import { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';
|
|
6
|
+
import { DrawerOverlaySurface } from './DrawerOverlaySurface';
|
|
6
7
|
/**
|
|
7
8
|
* Create the state required to render DrawerOverlay.
|
|
8
9
|
*
|
|
@@ -16,38 +17,38 @@ import { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';
|
|
|
16
17
|
const { modalType = 'modal', inertTrapFocus, defaultOpen = false, onOpenChange } = props;
|
|
17
18
|
const drawerMotion = useMotion(open);
|
|
18
19
|
const backdropMotion = useMotion(open);
|
|
19
|
-
const
|
|
20
|
+
const backdropInnerProps = slot.resolveShorthand(props.backdrop);
|
|
21
|
+
const hasCustomBackdrop = modalType !== 'non-modal' && backdropInnerProps !== null;
|
|
22
|
+
const backdropProps = {
|
|
23
|
+
...backdropInnerProps,
|
|
24
|
+
ref: useMergedRefs(backdropMotion.ref, backdropInnerProps === null || backdropInnerProps === void 0 ? void 0 : backdropInnerProps.ref)
|
|
25
|
+
};
|
|
20
26
|
const root = slot.always({
|
|
21
27
|
...props,
|
|
22
|
-
|
|
28
|
+
backdrop: hasCustomBackdrop ? backdropProps : null
|
|
23
29
|
}, {
|
|
24
|
-
elementType:
|
|
30
|
+
elementType: DrawerOverlaySurface,
|
|
25
31
|
defaultProps: {
|
|
26
|
-
|
|
27
|
-
elementType: 'div',
|
|
28
|
-
renderByDefault: hasCustomBackdrop,
|
|
29
|
-
defaultProps: {
|
|
30
|
-
ref: backdropMotion.ref
|
|
31
|
-
}
|
|
32
|
-
})
|
|
32
|
+
ref: useMergedRefs(ref, drawerMotion.ref)
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
const dialog = slot.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
const dialog = slot.always({
|
|
36
|
+
open: true,
|
|
37
|
+
defaultOpen,
|
|
38
|
+
onOpenChange,
|
|
39
|
+
inertTrapFocus,
|
|
40
|
+
modalType,
|
|
41
|
+
/*
|
|
42
|
+
* children is not needed here because we construct the children in the render function,
|
|
43
|
+
* but it's required by DialogProps
|
|
44
|
+
*/ children: null
|
|
45
|
+
}, {
|
|
46
|
+
elementType: Dialog
|
|
45
47
|
});
|
|
46
48
|
return {
|
|
47
49
|
components: {
|
|
48
|
-
root:
|
|
49
|
-
dialog: Dialog
|
|
50
|
-
backdrop: 'div'
|
|
50
|
+
root: DrawerOverlaySurface,
|
|
51
|
+
dialog: Dialog
|
|
51
52
|
},
|
|
52
53
|
root,
|
|
53
54
|
dialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerOverlay.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Dialog
|
|
1
|
+
{"version":3,"sources":["useDrawerOverlay.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { Dialog } from '@fluentui/react-dialog';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { DrawerOverlayProps, DrawerOverlayState } from './DrawerOverlay.types';\nimport { DrawerOverlaySurface } from './DrawerOverlaySurface';\n\n/**\n * Create the state required to render DrawerOverlay.\n *\n * The returned state can be modified with hooks such as useDrawerOverlayStyles_unstable,\n * before being passed to renderDrawerOverlay_unstable.\n *\n * @param props - props from this instance of DrawerOverlay\n * @param ref - reference to root HTMLDivElement of DrawerOverlay\n */\nexport const useDrawerOverlay_unstable = (\n props: DrawerOverlayProps,\n ref: React.Ref<HTMLDivElement>,\n): DrawerOverlayState => {\n const { open, size, position } = useDrawerDefaultProps(props);\n const { modalType = 'modal', inertTrapFocus, defaultOpen = false, onOpenChange } = props;\n\n const drawerMotion = useMotion<HTMLDivElement>(open);\n const backdropMotion = useMotion<HTMLDivElement>(open);\n\n const backdropInnerProps = slot.resolveShorthand(props.backdrop);\n const hasCustomBackdrop = modalType !== 'non-modal' && backdropInnerProps !== null;\n\n const backdropProps = {\n ...backdropInnerProps,\n ref: useMergedRefs(backdropMotion.ref, backdropInnerProps?.ref),\n };\n const root = slot.always(\n {\n ...props,\n backdrop: hasCustomBackdrop ? backdropProps : null,\n },\n {\n elementType: DrawerOverlaySurface,\n defaultProps: {\n ref: useMergedRefs(ref, drawerMotion.ref),\n },\n },\n );\n\n const dialog = slot.always(\n {\n open: true,\n defaultOpen,\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: Dialog,\n },\n );\n\n return {\n components: {\n root: DrawerOverlaySurface,\n dialog: Dialog,\n },\n\n root,\n dialog,\n\n size,\n position,\n motion: drawerMotion,\n backdropMotion,\n };\n};\n"],"names":["React","slot","useMergedRefs","Dialog","useMotion","useDrawerDefaultProps","DrawerOverlaySurface","useDrawerOverlay_unstable","props","ref","open","size","position","modalType","inertTrapFocus","defaultOpen","onOpenChange","drawerMotion","backdropMotion","backdropInnerProps","resolveShorthand","backdrop","hasCustomBackdrop","backdropProps","root","always","elementType","defaultProps","dialog","children","components","motion"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAChE,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,SAAS,QAAQ,iCAAiC;AAE3D,SAASC,qBAAqB,QAAQ,qCAAqC;AAE3E,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGP,sBAAsBG;IACvD,MAAM,EAAEK,YAAY,OAAO,EAAEC,cAAc,EAAEC,cAAc,KAAK,EAAEC,YAAY,EAAE,GAAGR;IAEnF,MAAMS,eAAeb,UAA0BM;IAC/C,MAAMQ,iBAAiBd,UAA0BM;IAEjD,MAAMS,qBAAqBlB,KAAKmB,gBAAgB,CAACZ,MAAMa,QAAQ;IAC/D,MAAMC,oBAAoBT,cAAc,eAAeM,uBAAuB;IAE9E,MAAMI,gBAAgB;QACpB,GAAGJ,kBAAkB;QACrBV,KAAKP,cAAcgB,eAAeT,GAAG,EAAEU,+BAAAA,yCAAAA,mBAAoBV,GAAG;IAChE;IACA,MAAMe,OAAOvB,KAAKwB,MAAM,CACtB;QACE,GAAGjB,KAAK;QACRa,UAAUC,oBAAoBC,gBAAgB;IAChD,GACA;QACEG,aAAapB;QACbqB,cAAc;YACZlB,KAAKP,cAAcO,KAAKQ,aAAaR,GAAG;QAC1C;IACF;IAGF,MAAMmB,SAAS3B,KAAKwB,MAAM,CACxB;QACEf,MAAM;QACNK;QACAC;QACAF;QACAD;QACA;;;OAGC,GACDgB,UAAU;IACZ,GACA;QACEH,aAAavB;IACf;IAGF,OAAO;QACL2B,YAAY;YACVN,MAAMlB;YACNsB,QAAQzB;QACV;QAEAqB;QACAI;QAEAjB;QACAC;QACAmB,QAAQd;QACRC;IACF;AACF,EAAE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
|
+
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
|
|
3
3
|
import { tokens } from '@fluentui/react-theme';
|
|
4
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
|
4
5
|
import { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames, useDrawerDurationStyles } from '../../shared/useDrawerBaseStyles.styles';
|
|
5
6
|
export const drawerOverlayClassNames = {
|
|
6
7
|
root: 'fui-DrawerOverlay',
|
|
@@ -9,39 +10,8 @@ export const drawerOverlayClassNames = {
|
|
|
9
10
|
/**
|
|
10
11
|
* Styles for the root slot
|
|
11
12
|
*/
|
|
13
|
+
const useDrawerResetStyles = /*#__PURE__*/__resetStyles("rspikg4", "r195rwb6", [".rspikg4{overflow-x:hidden;overflow-y: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;opacity:0;box-shadow:0px var(--colorTransparentBackground);transition-property:transform,box-shadow,opacity;will-change:transform,box-shadow,opacity;}", ".rspikg4:focus{outline-style:none;}", ".rspikg4:focus-visible{outline-style:none;}", ".rspikg4[data-fui-focus-visible]{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}", ".rspikg4[data-fui-focus-visible]::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:calc(2px * -1);right:calc(2px * -1);bottom:calc(2px * -1);left:calc(2px * -1);}", ".r195rwb6{overflow-x:hidden;overflow-y: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;opacity:0;box-shadow:0px var(--colorTransparentBackground);transition-property:transform,box-shadow,opacity;will-change:transform,box-shadow,opacity;}", ".r195rwb6:focus{outline-style:none;}", ".r195rwb6:focus-visible{outline-style:none;}", ".r195rwb6[data-fui-focus-visible]{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}", ".r195rwb6[data-fui-focus-visible]::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:calc(2px * -1);left:calc(2px * -1);bottom:calc(2px * -1);right:calc(2px * -1);}"]);
|
|
12
14
|
const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
13
|
-
root: {
|
|
14
|
-
z8tnut: "f1g0x7ka",
|
|
15
|
-
z189sj: ["fhxju0i", "f1cnd47f"],
|
|
16
|
-
Byoj8tv: "f1qch9an",
|
|
17
|
-
uwmqm3: ["f1cnd47f", "fhxju0i"],
|
|
18
|
-
B68tc82: "f1p9o1ba",
|
|
19
|
-
Bmxbyg5: "f1sil6mw",
|
|
20
|
-
Bbmb7ep: ["f1krrbdw", "f1deotkl"],
|
|
21
|
-
Beyfa6y: ["f1deotkl", "f1krrbdw"],
|
|
22
|
-
B7oj6ja: ["f10ostut", "f1ozlkrg"],
|
|
23
|
-
Btl43ni: ["f1ozlkrg", "f10ostut"],
|
|
24
|
-
B4j52fo: "fre7gi1",
|
|
25
|
-
Bekrc4i: ["f1358rze", "f1rvrf73"],
|
|
26
|
-
Bn0qgzm: "fqdk4by",
|
|
27
|
-
ibv6hh: ["f1rvrf73", "f1358rze"],
|
|
28
|
-
a9b677: "f3rx6dk",
|
|
29
|
-
B2u0y6b: "f1w39fev",
|
|
30
|
-
Bqenvij: "f11ysow2",
|
|
31
|
-
B7ck84d: "f1ewtqcl",
|
|
32
|
-
mc9l5x: "f22iagw",
|
|
33
|
-
Beiy3e4: "f1vx9l62",
|
|
34
|
-
Bt984gj: "f6jr5hl",
|
|
35
|
-
Brf1p80: "fbhxue7",
|
|
36
|
-
De3pzq: "fxugw4r",
|
|
37
|
-
qhf8xq: "f19dog8a",
|
|
38
|
-
Bhzewxz: "f15twtuk",
|
|
39
|
-
B5kzvoi: "f1yab3r1",
|
|
40
|
-
abs64n: "fk73vx1",
|
|
41
|
-
E5pizo: "fliqkoi",
|
|
42
|
-
Bmy1vo4: "f1neo61",
|
|
43
|
-
Es3by: "f1ytgekk"
|
|
44
|
-
},
|
|
45
15
|
start: {
|
|
46
16
|
Bz10aip: "f1d8gkik"
|
|
47
17
|
},
|
|
@@ -54,12 +24,12 @@ const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
|
54
24
|
E5pizo: "f10nrhrw"
|
|
55
25
|
}
|
|
56
26
|
}, {
|
|
57
|
-
d: [".
|
|
27
|
+
d: [".f1d8gkik{transform:translate3D(calc(var(--fui-Drawer--size) * -1), 0, 0);}", ".f1g0pcr8{transform:translate3D(calc(var(--fui-Drawer--size) * 1), 0, 0);}", ".f5p0z4x{opacity:1;}", ".f87uvqx{transform:translate3D(0, 0, 0);}", ".f10nrhrw{box-shadow:var(--shadow64);}"]
|
|
58
28
|
});
|
|
59
29
|
/**
|
|
60
30
|
* Styles for the backdrop slot
|
|
61
31
|
*/
|
|
62
|
-
const
|
|
32
|
+
const useBackdropStyles = /*#__PURE__*/__styles({
|
|
63
33
|
backdrop: {
|
|
64
34
|
abs64n: "fk73vx1",
|
|
65
35
|
Bmy1vo4: "f13u1uyl",
|
|
@@ -77,13 +47,14 @@ const useBackdropMotionStyles = /*#__PURE__*/__styles({
|
|
|
77
47
|
*/
|
|
78
48
|
export const useDrawerOverlayStyles_unstable = state => {
|
|
79
49
|
const baseClassNames = useDrawerBaseClassNames(state);
|
|
50
|
+
const resetStyles = useDrawerResetStyles();
|
|
80
51
|
const rootStyles = useDrawerRootStyles();
|
|
81
|
-
const
|
|
52
|
+
const backdropStyles = useBackdropStyles();
|
|
82
53
|
const durationStyles = useDrawerDurationStyles();
|
|
83
54
|
const backdrop = state.root.backdrop;
|
|
84
|
-
state.root.className = mergeClasses(drawerOverlayClassNames.root, baseClassNames,
|
|
55
|
+
state.root.className = mergeClasses(drawerOverlayClassNames.root, baseClassNames, resetStyles, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);
|
|
85
56
|
if (backdrop) {
|
|
86
|
-
backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop,
|
|
57
|
+
backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop, backdropStyles.backdrop, durationStyles[state.size], state.backdropMotion.active && backdropStyles.visible, backdrop.className);
|
|
87
58
|
}
|
|
88
59
|
return state;
|
|
89
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","__styles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","useDrawerDurationStyles","drawerOverlayClassNames","root","backdrop","
|
|
1
|
+
{"version":3,"names":["React","__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","useDrawerDurationStyles","drawerOverlayClassNames","root","backdrop","useDrawerResetStyles","useDrawerRootStyles","start","Bz10aip","end","visible","abs64n","E5pizo","d","useBackdropStyles","Bmy1vo4","Bkqvd7p","Es3by","useDrawerOverlayStyles_unstable","state","baseClassNames","resetStyles","rootStyles","backdropStyles","durationStyles","className","position","motion","active","size","backdropMotion"],"sources":["useDrawerOverlayStyles.styles.js"],"sourcesContent":["import * as React from 'react';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames, useDrawerDurationStyles } from '../../shared/useDrawerBaseStyles.styles';\nexport const drawerOverlayClassNames = {\n root: 'fui-DrawerOverlay',\n backdrop: 'fui-DrawerOverlay__backdrop'\n};\n/**\n * Styles for the root slot\n */ const useDrawerResetStyles = makeResetStyles({\n ...createFocusOutlineStyle(),\n ...drawerDefaultStyles,\n position: 'fixed',\n top: 0,\n bottom: 0,\n opacity: 0,\n boxShadow: `0px ${tokens.colorTransparentBackground}`,\n transitionProperty: 'transform, box-shadow, opacity',\n willChange: 'transform, box-shadow, opacity'\n});\nconst useDrawerRootStyles = makeStyles({\n /* Positioning */ start: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * -1), 0, 0)`\n },\n end: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * 1), 0, 0)`\n },\n /* Visible */ visible: {\n opacity: 1,\n transform: 'translate3D(0, 0, 0)',\n boxShadow: tokens.shadow64\n }\n});\n/**\n * Styles for the backdrop slot\n */ const useBackdropStyles = makeStyles({\n backdrop: {\n opacity: 0,\n transitionProperty: 'opacity',\n transitionTimingFunction: tokens.curveEasyEase,\n willChange: 'opacity'\n },\n visible: {\n opacity: 1\n }\n});\n/**\n * Apply styling to the DrawerOverlay slots based on the state\n */ export const useDrawerOverlayStyles_unstable = (state)=>{\n const baseClassNames = useDrawerBaseClassNames(state);\n const resetStyles = useDrawerResetStyles();\n const rootStyles = useDrawerRootStyles();\n const backdropStyles = useBackdropStyles();\n const durationStyles = useDrawerDurationStyles();\n const backdrop = state.root.backdrop;\n state.root.className = mergeClasses(drawerOverlayClassNames.root, baseClassNames, resetStyles, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);\n if (backdrop) {\n backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop, backdropStyles.backdrop, durationStyles[state.size], state.backdropMotion.active && backdropStyles.visible, backdrop.className);\n }\n return state;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,EAAEC,uBAAuB,QAAQ,yCAAyC;AAC9I,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,QAAQ,EAAE;AACd,CAAC;AACD;AACA;AACA;AAAI,MAAMC,oBAAoB,gBAAGZ,aAAA,68FAUhC,CAAC;AACF,MAAMa,mBAAmB,gBAAGZ,QAAA;EAAAa,KAAA;IAAAC,OAAA;EAAA;EAAAC,GAAA;IAAAD,OAAA;EAAA;EAAAE,OAAA;IAAAC,MAAA;IAAAH,OAAA;IAAAI,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAY3B,CAAC;AACF;AACA;AACA;AAAI,MAAMC,iBAAiB,gBAAGpB,QAAA;EAAAU,QAAA;IAAAO,MAAA;IAAAI,OAAA;IAAAC,OAAA;IAAAC,KAAA;EAAA;EAAAP,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,CAU7B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMK,+BAA+B,GAAIC,KAAK,IAAG;EACxD,MAAMC,cAAc,GAAGpB,uBAAuB,CAACmB,KAAK,CAAC;EACrD,MAAME,WAAW,GAAGhB,oBAAoB,CAAC,CAAC;EAC1C,MAAMiB,UAAU,GAAGhB,mBAAmB,CAAC,CAAC;EACxC,MAAMiB,cAAc,GAAGT,iBAAiB,CAAC,CAAC;EAC1C,MAAMU,cAAc,GAAGvB,uBAAuB,CAAC,CAAC;EAChD,MAAMG,QAAQ,GAAGe,KAAK,CAAChB,IAAI,CAACC,QAAQ;EACpCe,KAAK,CAAChB,IAAI,CAACsB,SAAS,GAAG9B,YAAY,CAACO,uBAAuB,CAACC,IAAI,EAAEiB,cAAc,EAAEC,WAAW,EAAEC,UAAU,CAACH,KAAK,CAACO,QAAQ,CAAC,EAAEP,KAAK,CAACQ,MAAM,CAACC,MAAM,IAAIN,UAAU,CAACZ,OAAO,EAAES,KAAK,CAAChB,IAAI,CAACsB,SAAS,CAAC;EAC3L,IAAIrB,QAAQ,EAAE;IACVA,QAAQ,CAACqB,SAAS,GAAG9B,YAAY,CAACO,uBAAuB,CAACE,QAAQ,EAAEmB,cAAc,CAACnB,QAAQ,EAAEoB,cAAc,CAACL,KAAK,CAACU,IAAI,CAAC,EAAEV,KAAK,CAACW,cAAc,CAACF,MAAM,IAAIL,cAAc,CAACb,OAAO,EAAEN,QAAQ,CAACqB,SAAS,CAAC;EACvM;EACA,OAAON,KAAK;AAChB,CAAC"}
|
|
@@ -10,19 +10,18 @@ export const drawerCSSVars = {
|
|
|
10
10
|
* Default shared styles for the Drawer component
|
|
11
11
|
*/
|
|
12
12
|
export const drawerDefaultStyles = {
|
|
13
|
-
... /*#__PURE__*/shorthands.padding(0),
|
|
14
13
|
... /*#__PURE__*/shorthands.overflow('hidden'),
|
|
15
|
-
... /*#__PURE__*/shorthands.borderRadius(0),
|
|
16
|
-
... /*#__PURE__*/shorthands.border(0),
|
|
17
14
|
width: `var(${drawerCSSVars.drawerSizeVar})`,
|
|
18
15
|
maxWidth: '100vw',
|
|
19
16
|
height: 'auto',
|
|
17
|
+
maxHeight: '100vh',
|
|
20
18
|
boxSizing: 'border-box',
|
|
21
19
|
display: 'flex',
|
|
22
20
|
flexDirection: 'column',
|
|
23
21
|
alignItems: 'flex-start',
|
|
24
22
|
justifyContent: 'flex-start',
|
|
25
|
-
backgroundColor: tokens.colorNeutralBackground1
|
|
23
|
+
backgroundColor: tokens.colorNeutralBackground1,
|
|
24
|
+
color: tokens.colorNeutralForeground1
|
|
26
25
|
};
|
|
27
26
|
/**
|
|
28
27
|
* Shared dynamic styles for the Drawer component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","drawerCSSVars","drawerSizeVar","drawerDefaultStyles","
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","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","oyh7mz","j35jbq","end","small","Bjr0ffy","medium","large","full","d","m","useDrawerDurationStyles","B3o57yi","useDrawerBaseClassNames","position","size","motion","baseStyles","durationStyles","type"],"sources":["useDrawerBaseStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } 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 ...shorthands.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 left: 0,\n right: 'auto'\n },\n end: {\n right: 0,\n left: '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 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 durationStyles = useDrawerDurationStyles();\n return mergeClasses(baseStyles[position], durationStyles[size], baseStyles[size], baseStyles.reducedMotion, motion.type === 'entering' && baseStyles.entering, motion.type === 'exiting' && baseStyles.exiting);\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,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;EACnC,iBAAGJ,UAAU,CAACK,QAAQ,CAAC,QAAQ,CAAC;EAChCC,KAAK,EAAG,OAAMJ,aAAa,CAACC,aAAc,GAAE;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,gBAAGrB,QAAA;EAAAsB,QAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAD,OAAA;EAAA;EAAAE,aAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,GAAA;IAAAD,MAAA;IAAAD,MAAA;EAAA;EAAAG,KAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAD,OAAA;EAAA;EAAAE,KAAA;IAAAF,OAAA;EAAA;EAAAG,IAAA;IAAAH,OAAA;EAAA;AAAA;EAAAI,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;AAAA,CAgC3B,CAAC;AACF,OAAO,MAAMC,uBAAuB,gBAAGtC,QAAA;EAAA+B,KAAA;IAAAQ,OAAA;EAAA;EAAAN,MAAA;IAAAM,OAAA;EAAA;EAAAL,KAAA;IAAAK,OAAA;EAAA;EAAAJ,IAAA;IAAAI,OAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,CAatC,CAAC;AACF,OAAO,MAAMI,uBAAuB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,IAAI;EAAEC;AAAO,CAAC,KAAG;EACjE,MAAMC,UAAU,GAAGvB,eAAe,CAAC,CAAC;EACpC,MAAMwB,cAAc,GAAGP,uBAAuB,CAAC,CAAC;EAChD,OAAOrC,YAAY,CAAC2C,UAAU,CAACH,QAAQ,CAAC,EAAEI,cAAc,CAACH,IAAI,CAAC,EAAEE,UAAU,CAACF,IAAI,CAAC,EAAEE,UAAU,CAACnB,aAAa,EAAEkB,MAAM,CAACG,IAAI,KAAK,UAAU,IAAIF,UAAU,CAACtB,QAAQ,EAAEqB,MAAM,CAACG,IAAI,KAAK,SAAS,IAAIF,UAAU,CAACpB,OAAO,CAAC;AACnN,CAAC"}
|