@fluentui/react-drawer 9.10.9 → 9.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/dist/index.d.ts +14 -2
  3. package/lib/components/InlineDrawer/InlineDrawer.types.js.map +1 -1
  4. package/lib/components/InlineDrawer/useInlineDrawer.js +15 -5
  5. package/lib/components/InlineDrawer/useInlineDrawer.js.map +1 -1
  6. package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.js +80 -2
  7. package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.js.map +1 -1
  8. package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.raw.js +25 -1
  9. package/lib/components/InlineDrawer/useInlineDrawerStyles.styles.raw.js.map +1 -1
  10. package/lib/components/OverlayDrawer/OverlayDrawer.types.js.map +1 -1
  11. package/lib/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.js +13 -3
  12. package/lib/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.js.map +1 -1
  13. package/lib/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.raw.js +7 -2
  14. package/lib/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.raw.js.map +1 -1
  15. package/lib/components/OverlayDrawer/useOverlayDrawer.js +6 -6
  16. package/lib/components/OverlayDrawer/useOverlayDrawer.js.map +1 -1
  17. package/lib/shared/DrawerBase.types.js.map +1 -1
  18. package/lib/shared/drawerMotions.js.map +1 -1
  19. package/lib/shared/useDrawerDefaultProps.js +3 -2
  20. package/lib/shared/useDrawerDefaultProps.js.map +1 -1
  21. package/lib-commonjs/components/InlineDrawer/InlineDrawer.types.js.map +1 -1
  22. package/lib-commonjs/components/InlineDrawer/useInlineDrawer.js +15 -5
  23. package/lib-commonjs/components/InlineDrawer/useInlineDrawer.js.map +1 -1
  24. package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.js +94 -2
  25. package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.js.map +1 -1
  26. package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.raw.js +25 -1
  27. package/lib-commonjs/components/InlineDrawer/useInlineDrawerStyles.styles.raw.js.map +1 -1
  28. package/lib-commonjs/components/OverlayDrawer/OverlayDrawer.types.js.map +1 -1
  29. package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.js +9 -3
  30. package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.js.map +1 -1
  31. package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.raw.js +7 -2
  32. package/lib-commonjs/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.raw.js.map +1 -1
  33. package/lib-commonjs/components/OverlayDrawer/useOverlayDrawer.js +6 -6
  34. package/lib-commonjs/components/OverlayDrawer/useOverlayDrawer.js.map +1 -1
  35. package/lib-commonjs/shared/DrawerBase.types.js.map +1 -1
  36. package/lib-commonjs/shared/drawerMotions.js.map +1 -1
  37. package/lib-commonjs/shared/useDrawerDefaultProps.js +3 -2
  38. package/lib-commonjs/shared/useDrawerDefaultProps.js.map +1 -1
  39. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,12 +1,41 @@
1
1
  # Change Log - @fluentui/react-drawer
2
2
 
3
- This log was last generated on Tue, 11 Nov 2025 19:13:30 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 17 Dec 2025 18:06:04 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.11.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.11.1)
8
+
9
+ Wed, 17 Dec 2025 18:06:04 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.11.0..@fluentui/react-drawer_v9.11.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-dialog to v9.16.5 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.3.4 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
16
+ - Bump @fluentui/react-motion to v9.11.5 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
17
+ - Bump @fluentui/react-portal to v9.8.9 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
18
+ - Bump @fluentui/react-motion-components-preview to v0.14.2 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.26.11 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
20
+ - Bump @fluentui/react-utilities to v9.26.0 ([PR #35582](https://github.com/microsoft/fluentui/pull/35582) by beachball)
21
+
22
+ ## [9.11.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.11.0)
23
+
24
+ Fri, 05 Dec 2025 22:38:31 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.10.9..@fluentui/react-drawer_v9.11.0)
26
+
27
+ ### Minor changes
28
+
29
+ - feat: add support to keep Drawer mounted on clos ([PR #35212](https://github.com/microsoft/fluentui/pull/35212) by marcosvmmoura@gmail.com)
30
+ - Bump @fluentui/react-dialog to v9.16.4 ([PR #35537](https://github.com/microsoft/fluentui/pull/35537) by beachball)
31
+
32
+ ### Patches
33
+
34
+ - fix: use transition animation instead of margin ([PR #35523](https://github.com/microsoft/fluentui/pull/35523) by marcosvmmoura@gmail.com)
35
+
7
36
  ## [9.10.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-drawer_v9.10.9)
8
37
 
9
- Tue, 11 Nov 2025 19:13:30 GMT
38
+ Tue, 11 Nov 2025 19:18:22 GMT
10
39
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-drawer_v9.10.8..@fluentui/react-drawer_v9.10.9)
11
40
 
12
41
  ### Patches
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import type { DialogSurfaceProps } from '@fluentui/react-dialog';
5
5
  import type { DialogSurfaceSlots } from '@fluentui/react-dialog';
6
6
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
7
7
  import type { JSXElement } from '@fluentui/react-utilities';
8
+ import type { PresenceDirection } from '@fluentui/react-motion';
8
9
  import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
9
10
  import { ProviderContextValue_unstable } from '@fluentui/react-shared-contexts';
10
11
  import * as React_2 from 'react';
@@ -42,6 +43,14 @@ declare type DrawerBaseProps = {
42
43
  * @default false
43
44
  */
44
45
  open?: boolean;
46
+ /**
47
+ * Decides whether the drawer should be removed from the DOM tree when it is closed.
48
+ * This can be useful when dealing with components that may contain state that should not
49
+ * be reset when the drawer is closed.
50
+ *
51
+ * @default true
52
+ */
53
+ unmountOnClose?: boolean;
45
54
  };
46
55
 
47
56
  declare type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {
@@ -50,6 +59,7 @@ declare type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size
50
59
  */
51
60
  motion: MotionState<HTMLElement>;
52
61
  open?: boolean;
62
+ unmountOnClose?: boolean;
53
63
  };
54
64
 
55
65
  /**
@@ -234,7 +244,9 @@ export declare type InlineDrawerSlots = {
234
244
  /**
235
245
  * State used in rendering InlineDrawer
236
246
  */
237
- export declare type InlineDrawerState = Required<ComponentState<NonNullable<InlineDrawerSlots>> & DrawerBaseState & Pick<InlineDrawerProps, 'separator'>>;
247
+ export declare type InlineDrawerState = Required<ComponentState<NonNullable<InlineDrawerSlots>> & DrawerBaseState & Pick<InlineDrawerProps, 'separator'> & {
248
+ animationDirection: PresenceDirection;
249
+ }>;
238
250
 
239
251
  declare type MotionState<Element extends HTMLElement = HTMLElement> = {
240
252
  /**
@@ -317,7 +329,7 @@ export declare type OverlayDrawerSlots = {
317
329
  /**
318
330
  * State used in rendering OverlayDrawer
319
331
  */
320
- export declare type OverlayDrawerState = ComponentState<OverlayDrawerInternalSlots> & Required<DrawerBaseState> & Pick<OverlayDrawerProps, 'mountNode'> & {
332
+ export declare type OverlayDrawerState = ComponentState<OverlayDrawerInternalSlots> & Required<DrawerBaseState> & Pick<OverlayDrawerProps, 'mountNode' | 'unmountOnClose'> & {
321
333
  hasMountNodeElement: boolean;
322
334
  };
323
335
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InlineDrawer/InlineDrawer.types.ts"],"sourcesContent":["import type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerMotionParams } from '../../shared/drawerMotions';\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\n\nexport type SurfaceMotionSlotProps = PresenceMotionSlotProps<DrawerMotionParams>;\n\nexport type InlineDrawerSlots = {\n root: Slot<'div', 'aside'>;\n surfaceMotion?: Slot<SurfaceMotionSlotProps>;\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<NonNullable<InlineDrawerSlots>> & DrawerBaseState & Pick<InlineDrawerProps, 'separator'>\n>;\n"],"names":[],"mappings":"AA0BA;;CAEC,GACD,WAEE"}
1
+ {"version":3,"sources":["../src/components/InlineDrawer/InlineDrawer.types.ts"],"sourcesContent":["import type { PresenceDirection, PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerMotionParams } from '../../shared/drawerMotions';\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\n\nexport type SurfaceMotionSlotProps = PresenceMotionSlotProps<DrawerMotionParams>;\n\nexport type InlineDrawerSlots = {\n root: Slot<'div', 'aside'>;\n surfaceMotion?: Slot<SurfaceMotionSlotProps>;\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<NonNullable<InlineDrawerSlots>> &\n DrawerBaseState &\n Pick<InlineDrawerProps, 'separator'> & {\n animationDirection: PresenceDirection;\n }\n>;\n"],"names":[],"mappings":"AA0BA;;CAEC,GACD,WAME"}
@@ -20,10 +20,11 @@ const STATIC_MOTION = {
20
20
  * @param props - props from this instance of InlineDrawer
21
21
  * @param ref - reference to root HTMLElement of InlineDrawer
22
22
  */ export const useInlineDrawer_unstable = (props, ref)=>{
23
- const { size, position, open } = useDrawerDefaultProps(props);
23
+ const { size, position, open, unmountOnClose } = useDrawerDefaultProps(props);
24
24
  const { separator = false, surfaceMotion } = props;
25
25
  const { dir } = useFluent();
26
- const state = {
26
+ const [animationDirection, setAnimationDirection] = React.useState(open ? 'enter' : 'exit');
27
+ return {
27
28
  components: {
28
29
  root: 'div',
29
30
  // casting from internal type that has required properties
@@ -33,7 +34,8 @@ const STATIC_MOTION = {
33
34
  },
34
35
  root: slot.always(getIntrinsicElementProps('div', {
35
36
  ...props,
36
- ref
37
+ ref,
38
+ 'aria-hidden': !unmountOnClose && !open ? true : undefined
37
39
  }), {
38
40
  elementType: 'div'
39
41
  }),
@@ -41,6 +43,8 @@ const STATIC_MOTION = {
41
43
  position,
42
44
  size,
43
45
  separator,
46
+ unmountOnClose,
47
+ animationDirection,
44
48
  surfaceMotion: presenceMotionSlot(surfaceMotion, {
45
49
  elementType: InlineDrawerMotion,
46
50
  defaultProps: {
@@ -48,11 +52,17 @@ const STATIC_MOTION = {
48
52
  size,
49
53
  dir,
50
54
  visible: open,
51
- unmountOnExit: true
55
+ appear: unmountOnClose,
56
+ unmountOnExit: unmountOnClose,
57
+ onMotionFinish: (_, { direction })=>setAnimationDirection(direction),
58
+ onMotionStart: (_, { direction })=>{
59
+ if (direction === 'enter') {
60
+ setAnimationDirection('enter');
61
+ }
62
+ }
52
63
  }
53
64
  }),
54
65
  // Deprecated props
55
66
  motion: STATIC_MOTION
56
67
  };
57
- return state;
58
68
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InlineDrawer/useInlineDrawer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nimport { type DrawerMotionParams, InlineDrawerMotion } from '../../shared/drawerMotions';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { InlineDrawerProps, InlineDrawerState, SurfaceMotionSlotProps } from './InlineDrawer.types';\n\nconst STATIC_MOTION = {\n active: true,\n canRender: true,\n ref: React.createRef<HTMLDivElement>(),\n type: 'idle' as const,\n};\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, surfaceMotion } = props;\n const { dir } = useFluent();\n\n const state: InlineDrawerState = {\n components: {\n root: 'div',\n // casting from internal type that has required properties\n // to external type that only has optional properties\n // converting to unknown first as both Function component signatures are not compatible\n surfaceMotion: InlineDrawerMotion as unknown as React.FC<SurfaceMotionSlotProps>,\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ref,\n }),\n { elementType: 'div' },\n ),\n\n open,\n position,\n size,\n separator,\n surfaceMotion: presenceMotionSlot<DrawerMotionParams>(surfaceMotion, {\n elementType: InlineDrawerMotion,\n defaultProps: {\n position,\n size,\n dir,\n visible: open,\n unmountOnExit: true,\n },\n }),\n\n // Deprecated props\n motion: STATIC_MOTION,\n };\n\n return state;\n};\n"],"names":["React","presenceMotionSlot","getIntrinsicElementProps","slot","useFluent_unstable","useFluent","InlineDrawerMotion","useDrawerDefaultProps","STATIC_MOTION","active","canRender","ref","createRef","type","useInlineDrawer_unstable","props","size","position","open","separator","surfaceMotion","dir","state","components","root","always","elementType","defaultProps","visible","unmountOnExit","motion"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAAkCC,kBAAkB,QAAQ,6BAA6B;AACzF,SAASC,qBAAqB,QAAQ,qCAAqC;AAG3E,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,WAAW;IACXC,KAAKX,MAAMY,SAAS;IACpBC,MAAM;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BJ;IACjE,MAAM,EAAEK,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGX,sBAAsBQ;IACvD,MAAM,EAAEI,YAAY,KAAK,EAAEC,aAAa,EAAE,GAAGL;IAC7C,MAAM,EAAEM,GAAG,EAAE,GAAGhB;IAEhB,MAAMiB,QAA2B;QAC/BC,YAAY;YACVC,MAAM;YACN,0DAA0D;YAC1D,qDAAqD;YACrD,uFAAuF;YACvFJ,eAAed;QACjB;QAEAkB,MAAMrB,KAAKsB,MAAM,CACfvB,yBAAyB,OAAO;YAC9B,GAAGa,KAAK;YACRJ;QACF,IACA;YAAEe,aAAa;QAAM;QAGvBR;QACAD;QACAD;QACAG;QACAC,eAAenB,mBAAuCmB,eAAe;YACnEM,aAAapB;YACbqB,cAAc;gBACZV;gBACAD;gBACAK;gBACAO,SAASV;gBACTW,eAAe;YACjB;QACF;QAEA,mBAAmB;QACnBC,QAAQtB;IACV;IAEA,OAAOc;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/InlineDrawer/useInlineDrawer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { PresenceDirection, presenceMotionSlot } from '@fluentui/react-motion';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nimport { type DrawerMotionParams, InlineDrawerMotion } from '../../shared/drawerMotions';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { InlineDrawerProps, InlineDrawerState, SurfaceMotionSlotProps } from './InlineDrawer.types';\n\nconst STATIC_MOTION = {\n active: true,\n canRender: true,\n ref: React.createRef<HTMLDivElement>(),\n type: 'idle' as const,\n};\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, unmountOnClose } = useDrawerDefaultProps(props);\n const { separator = false, surfaceMotion } = props;\n const { dir } = useFluent();\n const [animationDirection, setAnimationDirection] = React.useState<PresenceDirection>(open ? 'enter' : 'exit');\n\n return {\n components: {\n root: 'div',\n // casting from internal type that has required properties\n // to external type that only has optional properties\n // converting to unknown first as both Function component signatures are not compatible\n surfaceMotion: InlineDrawerMotion as unknown as React.FC<SurfaceMotionSlotProps>,\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ...props,\n ref,\n 'aria-hidden': !unmountOnClose && !open ? true : undefined,\n }),\n { elementType: 'div' },\n ),\n\n open,\n position,\n size,\n separator,\n unmountOnClose,\n animationDirection,\n surfaceMotion: presenceMotionSlot<DrawerMotionParams>(surfaceMotion, {\n elementType: InlineDrawerMotion,\n defaultProps: {\n position,\n size,\n dir,\n visible: open,\n appear: unmountOnClose,\n unmountOnExit: unmountOnClose,\n onMotionFinish: (_, { direction }) => setAnimationDirection(direction),\n onMotionStart: (_, { direction }) => {\n if (direction === 'enter') {\n setAnimationDirection('enter');\n }\n },\n },\n }),\n\n // Deprecated props\n motion: STATIC_MOTION,\n } satisfies InlineDrawerState;\n};\n"],"names":["React","presenceMotionSlot","getIntrinsicElementProps","slot","useFluent_unstable","useFluent","InlineDrawerMotion","useDrawerDefaultProps","STATIC_MOTION","active","canRender","ref","createRef","type","useInlineDrawer_unstable","props","size","position","open","unmountOnClose","separator","surfaceMotion","dir","animationDirection","setAnimationDirection","useState","components","root","always","undefined","elementType","defaultProps","visible","appear","unmountOnExit","onMotionFinish","_","direction","onMotionStart","motion"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAA4BC,kBAAkB,QAAQ,yBAAyB;AAC/E,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAAkCC,kBAAkB,QAAQ,6BAA6B;AACzF,SAASC,qBAAqB,QAAQ,qCAAqC;AAG3E,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,WAAW;IACXC,KAAKX,MAAMY,SAAS;IACpBC,MAAM;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BJ;IACjE,MAAM,EAAEK,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,cAAc,EAAE,GAAGZ,sBAAsBQ;IACvE,MAAM,EAAEK,YAAY,KAAK,EAAEC,aAAa,EAAE,GAAGN;IAC7C,MAAM,EAAEO,GAAG,EAAE,GAAGjB;IAChB,MAAM,CAACkB,oBAAoBC,sBAAsB,GAAGxB,MAAMyB,QAAQ,CAAoBP,OAAO,UAAU;IAEvG,OAAO;QACLQ,YAAY;YACVC,MAAM;YACN,0DAA0D;YAC1D,qDAAqD;YACrD,uFAAuF;YACvFN,eAAef;QACjB;QAEAqB,MAAMxB,KAAKyB,MAAM,CACf1B,yBAAyB,OAAO;YAC9B,GAAGa,KAAK;YACRJ;YACA,eAAe,CAACQ,kBAAkB,CAACD,OAAO,OAAOW;QACnD,IACA;YAAEC,aAAa;QAAM;QAGvBZ;QACAD;QACAD;QACAI;QACAD;QACAI;QACAF,eAAepB,mBAAuCoB,eAAe;YACnES,aAAaxB;YACbyB,cAAc;gBACZd;gBACAD;gBACAM;gBACAU,SAASd;gBACTe,QAAQd;gBACRe,eAAef;gBACfgB,gBAAgB,CAACC,GAAG,EAAEC,SAAS,EAAE,GAAKb,sBAAsBa;gBAC5DC,eAAe,CAACF,GAAG,EAAEC,SAAS,EAAE;oBAC9B,IAAIA,cAAc,SAAS;wBACzBb,sBAAsB;oBACxB;gBACF;YACF;QACF;QAEA,mBAAmB;QACnBe,QAAQ/B;IACV;AACF,EAAE"}
@@ -35,6 +35,66 @@ const useDrawerRootStyles = /*#__PURE__*/__styles({
35
35
  bottom: {
36
36
  a9b677: "fly5x3f",
37
37
  Bqenvij: "fub80nq"
38
+ },
39
+ animationExitStart: {
40
+ a9b677: "f3tsq5r",
41
+ Bgfg5da: 0,
42
+ B9xav0g: 0,
43
+ oivjwe: 0,
44
+ Bn0qgzm: 0,
45
+ B4g9neb: 0,
46
+ zhjwy3: 0,
47
+ wvpqe5: 0,
48
+ ibv6hh: 0,
49
+ u1mtju: 0,
50
+ h3c5rm: 0,
51
+ vrafjx: 0,
52
+ Bekrc4i: 0,
53
+ i8vvqc: 0,
54
+ g2u3we: 0,
55
+ icvyot: 0,
56
+ B4j52fo: 0,
57
+ irswps: "f3bhgqh"
58
+ },
59
+ animationExitEnd: {
60
+ a9b677: "f3tsq5r",
61
+ Bgfg5da: 0,
62
+ B9xav0g: 0,
63
+ oivjwe: 0,
64
+ Bn0qgzm: 0,
65
+ B4g9neb: 0,
66
+ zhjwy3: 0,
67
+ wvpqe5: 0,
68
+ ibv6hh: 0,
69
+ u1mtju: 0,
70
+ h3c5rm: 0,
71
+ vrafjx: 0,
72
+ Bekrc4i: 0,
73
+ i8vvqc: 0,
74
+ g2u3we: 0,
75
+ icvyot: 0,
76
+ B4j52fo: 0,
77
+ irswps: "f3bhgqh"
78
+ },
79
+ animationExitBottom: {
80
+ Bqenvij: "fniina8",
81
+ Bgfg5da: 0,
82
+ B9xav0g: 0,
83
+ oivjwe: 0,
84
+ Bn0qgzm: 0,
85
+ B4g9neb: 0,
86
+ zhjwy3: 0,
87
+ wvpqe5: 0,
88
+ ibv6hh: 0,
89
+ u1mtju: 0,
90
+ h3c5rm: 0,
91
+ vrafjx: 0,
92
+ Bekrc4i: 0,
93
+ i8vvqc: 0,
94
+ g2u3we: 0,
95
+ icvyot: 0,
96
+ B4j52fo: 0,
97
+ irswps: "f3bhgqh"
38
98
  }
39
99
  }, {
40
100
  d: [[".f1cxmi7i{border-right:1px solid var(--colorNeutralBackground3);}", {
@@ -47,7 +107,13 @@ const useDrawerRootStyles = /*#__PURE__*/__styles({
47
107
  p: -1
48
108
  }], [".f1n3kblk{border-top:1px solid var(--colorNeutralBackground3);}", {
49
109
  p: -1
50
- }], ".fly5x3f{width:100%;}", ".fub80nq{height:var(--fui-Drawer--size);}"]
110
+ }], ".fly5x3f{width:100%;}", ".fub80nq{height:var(--fui-Drawer--size);}", ".f3tsq5r{width:0;}", [".f3bhgqh{border:none;}", {
111
+ p: -2
112
+ }], [".f3bhgqh{border:none;}", {
113
+ p: -2
114
+ }], ".fniina8{height:0;}", [".f3bhgqh{border:none;}", {
115
+ p: -2
116
+ }]]
51
117
  });
52
118
  function getSeparatorClass(state, classNames) {
53
119
  if (!state.separator) {
@@ -64,6 +130,18 @@ function getSeparatorClass(state, classNames) {
64
130
  return undefined;
65
131
  }
66
132
  }
133
+ function getAnimationExitClass(state, classNames) {
134
+ switch (state.position) {
135
+ case 'start':
136
+ return classNames.animationExitStart;
137
+ case 'end':
138
+ return classNames.animationExitEnd;
139
+ case 'bottom':
140
+ return classNames.animationExitBottom;
141
+ default:
142
+ return undefined;
143
+ }
144
+ }
67
145
  /**
68
146
  * Apply styling to the InlineDrawer slots based on the state
69
147
  */
@@ -73,6 +151,6 @@ export const useInlineDrawerStyles_unstable = state => {
73
151
  const resetStyles = useDrawerResetStyles();
74
152
  const baseClassNames = useDrawerBaseClassNames(state);
75
153
  const rootStyles = useDrawerRootStyles();
76
- state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.root.className);
154
+ state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.animationDirection === 'exit' && getAnimationExitClass(state, rootStyles), state.root.className);
77
155
  return state;
78
156
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","inlineDrawerClassNames","root","useDrawerResetStyles","borderValue","colorNeutralBackground3","useDrawerRootStyles","separatorStart","h3c5rm","vrafjx","Bekrc4i","u1mtju","separatorEnd","zhjwy3","wvpqe5","ibv6hh","B4g9neb","separatorBottom","g2u3we","icvyot","B4j52fo","i8vvqc","start","end","bottom","a9b677","Bqenvij","d","p","getSeparatorClass","state","classNames","separator","undefined","position","useInlineDrawerStyles_unstable","resetStyles","baseClassNames","rootStyles","className"],"sources":["useInlineDrawerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\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 end: {},\n bottom: {\n width: '100%',\n height: `var(${drawerCSSVars.drawerSizeVar})`\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 'use no memo';\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,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,gBAAGT,aAAA,6UAG5B,CAAC;AACF;AACA;AACA;AAAI,MAAMU,WAAW,GAAG,aAAaP,MAAM,CAACQ,uBAAuB,EAAE;AACrE,MAAMC,mBAAmB,gBAAGX,QAAA;EAAAY,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;EAAAC,GAAA;EAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAgB3B,CAAC;AACF,SAASC,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,CAACxB,cAAc;IACpC,KAAK,KAAK;MACN,OAAOwB,UAAU,CAACnB,YAAY;IAClC,KAAK,QAAQ;MACT,OAAOmB,UAAU,CAACd,eAAe;IACrC;MACI,OAAOgB,SAAS;EACxB;AACJ;AACA;AACA;AACA;AAAI,OAAO,MAAME,8BAA8B,GAAIL,KAAK,IAAG;EACvD,aAAa;;EACb,MAAMM,WAAW,GAAGjC,oBAAoB,CAAC,CAAC;EAC1C,MAAMkC,cAAc,GAAGrC,uBAAuB,CAAC8B,KAAK,CAAC;EACrD,MAAMQ,UAAU,GAAGhC,mBAAmB,CAAC,CAAC;EACxCwB,KAAK,CAAC5B,IAAI,CAACqC,SAAS,GAAG3C,YAAY,CAACK,sBAAsB,CAACC,IAAI,EAAEkC,WAAW,EAAEC,cAAc,EAAER,iBAAiB,CAACC,KAAK,EAAEQ,UAAU,CAAC,EAAEA,UAAU,CAACR,KAAK,CAACI,QAAQ,CAAC,EAAEJ,KAAK,CAAC5B,IAAI,CAACqC,SAAS,CAAC;EACrL,OAAOT,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","inlineDrawerClassNames","root","useDrawerResetStyles","borderValue","colorNeutralBackground3","useDrawerRootStyles","separatorStart","h3c5rm","vrafjx","Bekrc4i","u1mtju","separatorEnd","zhjwy3","wvpqe5","ibv6hh","B4g9neb","separatorBottom","g2u3we","icvyot","B4j52fo","i8vvqc","start","end","bottom","a9b677","Bqenvij","animationExitStart","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","irswps","animationExitEnd","animationExitBottom","d","p","getSeparatorClass","state","classNames","separator","undefined","position","getAnimationExitClass","useInlineDrawerStyles_unstable","resetStyles","baseClassNames","rootStyles","className","animationDirection"],"sources":["useInlineDrawerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\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 end: {},\n bottom: {\n width: '100%',\n height: `var(${drawerCSSVars.drawerSizeVar})`\n },\n /* Animation exit states */ animationExitStart: {\n width: '0',\n border: 'none'\n },\n animationExitEnd: {\n width: '0',\n border: 'none'\n },\n animationExitBottom: {\n height: '0',\n border: 'none'\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}\nfunction getAnimationExitClass(state, classNames) {\n switch(state.position){\n case 'start':\n return classNames.animationExitStart;\n case 'end':\n return classNames.animationExitEnd;\n case 'bottom':\n return classNames.animationExitBottom;\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 'use no memo';\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.animationDirection === 'exit' && getAnimationExitClass(state, rootStyles), state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,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,gBAAGT,aAAA,6UAG5B,CAAC;AACF;AACA;AACA;AAAI,MAAMU,WAAW,GAAG,aAAaP,MAAM,CAACQ,uBAAuB,EAAE;AACrE,MAAMC,mBAAmB,gBAAGX,QAAA;EAAAY,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;EAAAC,GAAA;EAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,kBAAA;IAAAF,MAAA;IAAAG,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAf,OAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAJ,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAW,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAY,MAAA;EAAA;EAAAC,gBAAA;IAAAR,MAAA;IAAAG,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAf,OAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAJ,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAW,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAY,MAAA;EAAA;EAAAE,mBAAA;IAAAR,OAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAf,OAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAJ,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAW,MAAA;IAAAH,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAY,MAAA;EAAA;AAAA;EAAAG,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CA4B3B,CAAC;AACF,SAASC,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,CAAChC,cAAc;IACpC,KAAK,KAAK;MACN,OAAOgC,UAAU,CAAC3B,YAAY;IAClC,KAAK,QAAQ;MACT,OAAO2B,UAAU,CAACtB,eAAe;IACrC;MACI,OAAOwB,SAAS;EACxB;AACJ;AACA,SAASE,qBAAqBA,CAACL,KAAK,EAAEC,UAAU,EAAE;EAC9C,QAAOD,KAAK,CAACI,QAAQ;IACjB,KAAK,OAAO;MACR,OAAOH,UAAU,CAACZ,kBAAkB;IACxC,KAAK,KAAK;MACN,OAAOY,UAAU,CAACN,gBAAgB;IACtC,KAAK,QAAQ;MACT,OAAOM,UAAU,CAACL,mBAAmB;IACzC;MACI,OAAOO,SAAS;EACxB;AACJ;AACA;AACA;AACA;AAAI,OAAO,MAAMG,8BAA8B,GAAIN,KAAK,IAAG;EACvD,aAAa;;EACb,MAAMO,WAAW,GAAG1C,oBAAoB,CAAC,CAAC;EAC1C,MAAM2C,cAAc,GAAG9C,uBAAuB,CAACsC,KAAK,CAAC;EACrD,MAAMS,UAAU,GAAGzC,mBAAmB,CAAC,CAAC;EACxCgC,KAAK,CAACpC,IAAI,CAAC8C,SAAS,GAAGpD,YAAY,CAACK,sBAAsB,CAACC,IAAI,EAAE2C,WAAW,EAAEC,cAAc,EAAET,iBAAiB,CAACC,KAAK,EAAES,UAAU,CAAC,EAAEA,UAAU,CAACT,KAAK,CAACI,QAAQ,CAAC,EAAEJ,KAAK,CAACW,kBAAkB,KAAK,MAAM,IAAIN,qBAAqB,CAACL,KAAK,EAAES,UAAU,CAAC,EAAET,KAAK,CAACpC,IAAI,CAAC8C,SAAS,CAAC;EACtQ,OAAOV,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -27,6 +27,18 @@ const useDrawerRootStyles = makeStyles({
27
27
  bottom: {
28
28
  width: '100%',
29
29
  height: `var(${drawerCSSVars.drawerSizeVar})`
30
+ },
31
+ /* Animation exit states */ animationExitStart: {
32
+ width: '0',
33
+ border: 'none'
34
+ },
35
+ animationExitEnd: {
36
+ width: '0',
37
+ border: 'none'
38
+ },
39
+ animationExitBottom: {
40
+ height: '0',
41
+ border: 'none'
30
42
  }
31
43
  });
32
44
  function getSeparatorClass(state, classNames) {
@@ -44,6 +56,18 @@ function getSeparatorClass(state, classNames) {
44
56
  return undefined;
45
57
  }
46
58
  }
59
+ function getAnimationExitClass(state, classNames) {
60
+ switch(state.position){
61
+ case 'start':
62
+ return classNames.animationExitStart;
63
+ case 'end':
64
+ return classNames.animationExitEnd;
65
+ case 'bottom':
66
+ return classNames.animationExitBottom;
67
+ default:
68
+ return undefined;
69
+ }
70
+ }
47
71
  /**
48
72
  * Apply styling to the InlineDrawer slots based on the state
49
73
  */ export const useInlineDrawerStyles_unstable = (state)=>{
@@ -51,6 +75,6 @@ function getSeparatorClass(state, classNames) {
51
75
  const resetStyles = useDrawerResetStyles();
52
76
  const baseClassNames = useDrawerBaseClassNames(state);
53
77
  const rootStyles = useDrawerRootStyles();
54
- state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.root.className);
78
+ state.root.className = mergeClasses(inlineDrawerClassNames.root, resetStyles, baseClassNames, getSeparatorClass(state, rootStyles), rootStyles[state.position], state.animationDirection === 'exit' && getAnimationExitClass(state, rootStyles), state.root.className);
55
79
  return state;
56
80
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InlineDrawer/useInlineDrawerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nimport type { InlineDrawerSlots, InlineDrawerState } from './InlineDrawer.types';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\n\nexport const inlineDrawerClassNames: SlotClassNames<Omit<InlineDrawerSlots, 'surfaceMotion'>> = {\n root: 'fui-InlineDrawer',\n};\n\nconst useDrawerResetStyles = makeResetStyles({\n ...drawerDefaultStyles,\n position: 'relative',\n});\n\n/**\n * Styles for the root slot\n */\nconst borderValue = `1px solid ${tokens.colorNeutralBackground3}`;\nconst useDrawerRootStyles = makeStyles({\n /* Separator */\n separatorStart: { borderRight: borderValue },\n separatorEnd: { borderLeft: borderValue },\n separatorBottom: { borderTop: borderValue },\n\n /* Positioning */\n start: {},\n end: {},\n bottom: {\n width: '100%',\n height: `var(${drawerCSSVars.drawerSizeVar})`,\n },\n});\n\nfunction getSeparatorClass(state: InlineDrawerState, classNames: ReturnType<typeof useDrawerRootStyles>) {\n if (!state.separator) {\n return undefined;\n }\n\n switch (state.position) {\n case 'start':\n return classNames.separatorStart;\n\n case 'end':\n return classNames.separatorEnd;\n\n case 'bottom':\n return classNames.separatorBottom;\n\n default:\n return undefined;\n }\n}\n\n/**\n * Apply styling to the InlineDrawer slots based on the state\n */\nexport const useInlineDrawerStyles_unstable = (state: InlineDrawerState): InlineDrawerState => {\n 'use no memo';\n\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n\n state.root.className = mergeClasses(\n inlineDrawerClassNames.root,\n resetStyles,\n baseClassNames,\n getSeparatorClass(state, rootStyles),\n rootStyles[state.position],\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","inlineDrawerClassNames","root","useDrawerResetStyles","position","borderValue","colorNeutralBackground3","useDrawerRootStyles","separatorStart","borderRight","separatorEnd","borderLeft","separatorBottom","borderTop","start","end","bottom","width","height","drawerSizeVar","getSeparatorClass","state","classNames","separator","undefined","useInlineDrawerStyles_unstable","resetStyles","baseClassNames","rootStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE3E,SAASC,MAAM,QAAQ,wBAAwB;AAG/C,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,0CAA0C;AAEtH,OAAO,MAAMC,yBAAmF;IAC9FC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3C,GAAGK,mBAAmB;IACtBK,UAAU;AACZ;AAEA;;CAEC,GACD,MAAMC,cAAc,CAAC,UAAU,EAAER,OAAOS,uBAAuB,EAAE;AACjE,MAAMC,sBAAsBZ,WAAW;IACrC,aAAa,GACba,gBAAgB;QAAEC,aAAaJ;IAAY;IAC3CK,cAAc;QAAEC,YAAYN;IAAY;IACxCO,iBAAiB;QAAEC,WAAWR;IAAY;IAE1C,eAAe,GACfS,OAAO,CAAC;IACRC,KAAK,CAAC;IACNC,QAAQ;QACNC,OAAO;QACPC,QAAQ,CAAC,IAAI,EAAEpB,cAAcqB,aAAa,CAAC,CAAC,CAAC;IAC/C;AACF;AAEA,SAASC,kBAAkBC,KAAwB,EAAEC,UAAkD;IACrG,IAAI,CAACD,MAAME,SAAS,EAAE;QACpB,OAAOC;IACT;IAEA,OAAQH,MAAMjB,QAAQ;QACpB,KAAK;YACH,OAAOkB,WAAWd,cAAc;QAElC,KAAK;YACH,OAAOc,WAAWZ,YAAY;QAEhC,KAAK;YACH,OAAOY,WAAWV,eAAe;QAEnC;YACE,OAAOY;IACX;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACJ;IAC7C;IAEA,MAAMK,cAAcvB;IACpB,MAAMwB,iBAAiB3B,wBAAwBqB;IAC/C,MAAMO,aAAarB;IAEnBc,MAAMnB,IAAI,CAAC2B,SAAS,GAAGjC,aACrBK,uBAAuBC,IAAI,EAC3BwB,aACAC,gBACAP,kBAAkBC,OAAOO,aACzBA,UAAU,CAACP,MAAMjB,QAAQ,CAAC,EAC1BiB,MAAMnB,IAAI,CAAC2B,SAAS;IAGtB,OAAOR;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/InlineDrawer/useInlineDrawerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nimport type { InlineDrawerSlots, InlineDrawerState } from './InlineDrawer.types';\nimport { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles';\n\nexport const inlineDrawerClassNames: SlotClassNames<Omit<InlineDrawerSlots, 'surfaceMotion'>> = {\n root: 'fui-InlineDrawer',\n};\n\nconst useDrawerResetStyles = makeResetStyles({\n ...drawerDefaultStyles,\n position: 'relative',\n});\n\n/**\n * Styles for the root slot\n */\nconst borderValue = `1px solid ${tokens.colorNeutralBackground3}`;\nconst useDrawerRootStyles = makeStyles({\n /* Separator */\n separatorStart: { borderRight: borderValue },\n separatorEnd: { borderLeft: borderValue },\n separatorBottom: { borderTop: borderValue },\n\n /* Positioning */\n start: {},\n end: {},\n bottom: {\n width: '100%',\n height: `var(${drawerCSSVars.drawerSizeVar})`,\n },\n\n /* Animation exit states */\n animationExitStart: {\n width: '0',\n border: 'none',\n },\n animationExitEnd: {\n width: '0',\n border: 'none',\n },\n animationExitBottom: {\n height: '0',\n border: 'none',\n },\n});\n\nfunction getSeparatorClass(state: InlineDrawerState, classNames: ReturnType<typeof useDrawerRootStyles>) {\n if (!state.separator) {\n return undefined;\n }\n\n switch (state.position) {\n case 'start':\n return classNames.separatorStart;\n\n case 'end':\n return classNames.separatorEnd;\n\n case 'bottom':\n return classNames.separatorBottom;\n\n default:\n return undefined;\n }\n}\n\nfunction getAnimationExitClass(state: InlineDrawerState, classNames: ReturnType<typeof useDrawerRootStyles>) {\n switch (state.position) {\n case 'start':\n return classNames.animationExitStart;\n\n case 'end':\n return classNames.animationExitEnd;\n\n case 'bottom':\n return classNames.animationExitBottom;\n\n default:\n return undefined;\n }\n}\n\n/**\n * Apply styling to the InlineDrawer slots based on the state\n */\nexport const useInlineDrawerStyles_unstable = (state: InlineDrawerState): InlineDrawerState => {\n 'use no memo';\n\n const resetStyles = useDrawerResetStyles();\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n\n state.root.className = mergeClasses(\n inlineDrawerClassNames.root,\n resetStyles,\n baseClassNames,\n getSeparatorClass(state, rootStyles),\n rootStyles[state.position],\n state.animationDirection === 'exit' && getAnimationExitClass(state, rootStyles),\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","drawerCSSVars","drawerDefaultStyles","useDrawerBaseClassNames","inlineDrawerClassNames","root","useDrawerResetStyles","position","borderValue","colorNeutralBackground3","useDrawerRootStyles","separatorStart","borderRight","separatorEnd","borderLeft","separatorBottom","borderTop","start","end","bottom","width","height","drawerSizeVar","animationExitStart","border","animationExitEnd","animationExitBottom","getSeparatorClass","state","classNames","separator","undefined","getAnimationExitClass","useInlineDrawerStyles_unstable","resetStyles","baseClassNames","rootStyles","className","animationDirection"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE3E,SAASC,MAAM,QAAQ,wBAAwB;AAG/C,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,uBAAuB,QAAQ,0CAA0C;AAEtH,OAAO,MAAMC,yBAAmF;IAC9FC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3C,GAAGK,mBAAmB;IACtBK,UAAU;AACZ;AAEA;;CAEC,GACD,MAAMC,cAAc,CAAC,UAAU,EAAER,OAAOS,uBAAuB,EAAE;AACjE,MAAMC,sBAAsBZ,WAAW;IACrC,aAAa,GACba,gBAAgB;QAAEC,aAAaJ;IAAY;IAC3CK,cAAc;QAAEC,YAAYN;IAAY;IACxCO,iBAAiB;QAAEC,WAAWR;IAAY;IAE1C,eAAe,GACfS,OAAO,CAAC;IACRC,KAAK,CAAC;IACNC,QAAQ;QACNC,OAAO;QACPC,QAAQ,CAAC,IAAI,EAAEpB,cAAcqB,aAAa,CAAC,CAAC,CAAC;IAC/C;IAEA,yBAAyB,GACzBC,oBAAoB;QAClBH,OAAO;QACPI,QAAQ;IACV;IACAC,kBAAkB;QAChBL,OAAO;QACPI,QAAQ;IACV;IACAE,qBAAqB;QACnBL,QAAQ;QACRG,QAAQ;IACV;AACF;AAEA,SAASG,kBAAkBC,KAAwB,EAAEC,UAAkD;IACrG,IAAI,CAACD,MAAME,SAAS,EAAE;QACpB,OAAOC;IACT;IAEA,OAAQH,MAAMrB,QAAQ;QACpB,KAAK;YACH,OAAOsB,WAAWlB,cAAc;QAElC,KAAK;YACH,OAAOkB,WAAWhB,YAAY;QAEhC,KAAK;YACH,OAAOgB,WAAWd,eAAe;QAEnC;YACE,OAAOgB;IACX;AACF;AAEA,SAASC,sBAAsBJ,KAAwB,EAAEC,UAAkD;IACzG,OAAQD,MAAMrB,QAAQ;QACpB,KAAK;YACH,OAAOsB,WAAWN,kBAAkB;QAEtC,KAAK;YACH,OAAOM,WAAWJ,gBAAgB;QAEpC,KAAK;YACH,OAAOI,WAAWH,mBAAmB;QAEvC;YACE,OAAOK;IACX;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,iCAAiC,CAACL;IAC7C;IAEA,MAAMM,cAAc5B;IACpB,MAAM6B,iBAAiBhC,wBAAwByB;IAC/C,MAAMQ,aAAa1B;IAEnBkB,MAAMvB,IAAI,CAACgC,SAAS,GAAGtC,aACrBK,uBAAuBC,IAAI,EAC3B6B,aACAC,gBACAR,kBAAkBC,OAAOQ,aACzBA,UAAU,CAACR,MAAMrB,QAAQ,CAAC,EAC1BqB,MAAMU,kBAAkB,KAAK,UAAUN,sBAAsBJ,OAAOQ,aACpER,MAAMvB,IAAI,CAACgC,SAAS;IAGtB,OAAOT;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverlayDrawer/OverlayDrawer.types.ts"],"sourcesContent":["import type { DialogProps } from '@fluentui/react-dialog';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerMotionParams, OverlayDrawerSurfaceMotionParams } from '../../shared/drawerMotions';\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\nimport type { 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 * For more information refer to the [Motion docs page](https://react.fluentui.dev/?path=/docs/motion-motion-slot--docs).\n *\n */\n backdropMotion?: Slot<PresenceMotionSlotProps<OverlayDrawerSurfaceMotionParams>>;\n /**\n * For more information refer to the [Motion docs page](https://react.fluentui.dev/?path=/docs/motion-motion-slot--docs).\n *\n */\n surfaceMotion?: Slot<PresenceMotionSlotProps<DrawerMotionParams>>;\n};\n\n/**\n * OverlayDrawer internal slots for when using with composition API\n */\nexport type OverlayDrawerInternalSlots = Pick<OverlayDrawerSlots, 'root'> & {\n /**\n * Slot for the dialog component that wraps the drawer.\n */\n dialog: NonNullable<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> &\n Required<DrawerBaseState> &\n Pick<OverlayDrawerProps, 'mountNode'> & {\n hasMountNodeElement: boolean;\n };\n"],"names":[],"mappings":"AAmDA;;CAEC,GACD,WAII"}
1
+ {"version":3,"sources":["../src/components/OverlayDrawer/OverlayDrawer.types.ts"],"sourcesContent":["import type { DialogProps } from '@fluentui/react-dialog';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DrawerMotionParams, OverlayDrawerSurfaceMotionParams } from '../../shared/drawerMotions';\nimport type { DrawerBaseProps, DrawerBaseState } from '../../shared/DrawerBase.types';\nimport type { 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 * For more information refer to the [Motion docs page](https://react.fluentui.dev/?path=/docs/motion-motion-slot--docs).\n *\n */\n backdropMotion?: Slot<PresenceMotionSlotProps<OverlayDrawerSurfaceMotionParams>>;\n /**\n * For more information refer to the [Motion docs page](https://react.fluentui.dev/?path=/docs/motion-motion-slot--docs).\n *\n */\n surfaceMotion?: Slot<PresenceMotionSlotProps<DrawerMotionParams>>;\n};\n\n/**\n * OverlayDrawer internal slots for when using with composition API\n */\nexport type OverlayDrawerInternalSlots = Pick<OverlayDrawerSlots, 'root'> & {\n /**\n * Slot for the dialog component that wraps the drawer.\n */\n dialog: NonNullable<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> &\n Required<DrawerBaseState> &\n Pick<OverlayDrawerProps, 'mountNode' | 'unmountOnClose'> & {\n hasMountNodeElement: boolean;\n };\n"],"names":[],"mappings":"AAmDA;;CAEC,GACD,WAII"}
@@ -9,9 +9,12 @@ const useBackdropResetStyles = /*#__PURE__*/__resetStyles("rl76ifk", null, [".rl
9
9
  const useBackdropStyles = /*#__PURE__*/__styles({
10
10
  nested: {
11
11
  De3pzq: "f1c21dwh"
12
+ },
13
+ drawerHidden: {
14
+ Bkecrkj: "f1aehjj5"
12
15
  }
13
16
  }, {
14
- d: [".f1c21dwh{background-color:var(--colorTransparentBackground);}"]
17
+ d: [".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1aehjj5{pointer-events:none;}"]
15
18
  });
16
19
  /**
17
20
  * Apply styling to the OverlayDrawerSurface slots based on the state
@@ -19,10 +22,17 @@ const useBackdropStyles = /*#__PURE__*/__styles({
19
22
  export const useOverlayDrawerSurfaceStyles_unstable = state => {
20
23
  'use no memo';
21
24
 
25
+ const {
26
+ isNestedDialog,
27
+ backdrop,
28
+ open,
29
+ unmountOnClose
30
+ } = state;
22
31
  const backdropResetStyles = useBackdropResetStyles();
23
32
  const backdropStyles = useBackdropStyles();
24
- if (state.backdrop) {
25
- state.backdrop.className = mergeClasses(backdropResetStyles, state.isNestedDialog && backdropStyles.nested, state.backdrop.className);
33
+ const mountedAndClosed = !unmountOnClose && !open;
34
+ if (backdrop) {
35
+ backdrop.className = mergeClasses(backdropResetStyles, isNestedDialog && backdropStyles.nested, mountedAndClosed && backdropStyles.drawerHidden, backdrop.className);
26
36
  }
27
37
  return state;
28
38
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","useBackdropResetStyles","useBackdropStyles","nested","De3pzq","d","useOverlayDrawerSurfaceStyles_unstable","state","backdropResetStyles","backdropStyles","backdrop","className","isNestedDialog"],"sources":["useOverlayDrawerSurfaceStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * Styles for the backdrop slot\n */ const useBackdropResetStyles = makeResetStyles({\n inset: '0px',\n position: 'fixed',\n backgroundColor: tokens.colorBackgroundOverlay\n});\nconst useBackdropStyles = makeStyles({\n nested: {\n backgroundColor: tokens.colorTransparentBackground\n }\n});\n/**\n * Apply styling to the OverlayDrawerSurface slots based on the state\n */ export const useOverlayDrawerSurfaceStyles_unstable = (state)=>{\n 'use no memo';\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,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C;AACA;AACA;AAAI,MAAMC,sBAAsB,gBAAGJ,aAAA,wGAIlC,CAAC;AACF,MAAMK,iBAAiB,gBAAGJ,QAAA;EAAAK,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAIzB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,sCAAsC,GAAIC,KAAK,IAAG;EAC/D,aAAa;;EACb,MAAMC,mBAAmB,GAAGP,sBAAsB,CAAC,CAAC;EACpD,MAAMQ,cAAc,GAAGP,iBAAiB,CAAC,CAAC;EAC1C,IAAIK,KAAK,CAACG,QAAQ,EAAE;IAChBH,KAAK,CAACG,QAAQ,CAACC,SAAS,GAAGZ,YAAY,CAACS,mBAAmB,EAAED,KAAK,CAACK,cAAc,IAAIH,cAAc,CAACN,MAAM,EAAEI,KAAK,CAACG,QAAQ,CAACC,SAAS,CAAC;EACzI;EACA,OAAOJ,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","useBackdropResetStyles","useBackdropStyles","nested","De3pzq","drawerHidden","Bkecrkj","d","useOverlayDrawerSurfaceStyles_unstable","state","isNestedDialog","backdrop","open","unmountOnClose","backdropResetStyles","backdropStyles","mountedAndClosed","className"],"sources":["useOverlayDrawerSurfaceStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * Styles for the backdrop slot\n */ const useBackdropResetStyles = makeResetStyles({\n inset: '0px',\n position: 'fixed',\n backgroundColor: tokens.colorBackgroundOverlay\n});\nconst useBackdropStyles = makeStyles({\n nested: {\n backgroundColor: tokens.colorTransparentBackground\n },\n drawerHidden: {\n pointerEvents: 'none'\n }\n});\n/**\n * Apply styling to the OverlayDrawerSurface slots based on the state\n */ export const useOverlayDrawerSurfaceStyles_unstable = (state)=>{\n 'use no memo';\n const { isNestedDialog, backdrop, open, unmountOnClose } = state;\n const backdropResetStyles = useBackdropResetStyles();\n const backdropStyles = useBackdropStyles();\n const mountedAndClosed = !unmountOnClose && !open;\n if (backdrop) {\n backdrop.className = mergeClasses(backdropResetStyles, isNestedDialog && backdropStyles.nested, mountedAndClosed && backdropStyles.drawerHidden, backdrop.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C;AACA;AACA;AAAI,MAAMC,sBAAsB,gBAAGJ,aAAA,wGAIlC,CAAC;AACF,MAAMK,iBAAiB,gBAAGJ,QAAA;EAAAK,MAAA;IAAAC,MAAA;EAAA;EAAAC,YAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOzB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,sCAAsC,GAAIC,KAAK,IAAG;EAC/D,aAAa;;EACb,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC,IAAI;IAAEC;EAAe,CAAC,GAAGJ,KAAK;EAChE,MAAMK,mBAAmB,GAAGb,sBAAsB,CAAC,CAAC;EACpD,MAAMc,cAAc,GAAGb,iBAAiB,CAAC,CAAC;EAC1C,MAAMc,gBAAgB,GAAG,CAACH,cAAc,IAAI,CAACD,IAAI;EACjD,IAAID,QAAQ,EAAE;IACVA,QAAQ,CAACM,SAAS,GAAGlB,YAAY,CAACe,mBAAmB,EAAEJ,cAAc,IAAIK,cAAc,CAACZ,MAAM,EAAEa,gBAAgB,IAAID,cAAc,CAACV,YAAY,EAAEM,QAAQ,CAACM,SAAS,CAAC;EACxK;EACA,OAAOR,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -11,16 +11,21 @@ import { tokens } from '@fluentui/react-theme';
11
11
  const useBackdropStyles = makeStyles({
12
12
  nested: {
13
13
  backgroundColor: tokens.colorTransparentBackground
14
+ },
15
+ drawerHidden: {
16
+ pointerEvents: 'none'
14
17
  }
15
18
  });
16
19
  /**
17
20
  * Apply styling to the OverlayDrawerSurface slots based on the state
18
21
  */ export const useOverlayDrawerSurfaceStyles_unstable = (state)=>{
19
22
  'use no memo';
23
+ const { isNestedDialog, backdrop, open, unmountOnClose } = state;
20
24
  const backdropResetStyles = useBackdropResetStyles();
21
25
  const backdropStyles = useBackdropStyles();
22
- if (state.backdrop) {
23
- state.backdrop.className = mergeClasses(backdropResetStyles, state.isNestedDialog && backdropStyles.nested, state.backdrop.className);
26
+ const mountedAndClosed = !unmountOnClose && !open;
27
+ if (backdrop) {
28
+ backdrop.className = mergeClasses(backdropResetStyles, isNestedDialog && backdropStyles.nested, mountedAndClosed && backdropStyles.drawerHidden, backdrop.className);
24
29
  }
25
30
  return state;
26
31
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { DialogSurfaceState } from '@fluentui/react-dialog';\n\n/**\n * Styles for the backdrop slot\n */\nconst useBackdropResetStyles = makeResetStyles({\n inset: '0px',\n position: 'fixed',\n backgroundColor: tokens.colorBackgroundOverlay,\n});\n\nconst useBackdropStyles = makeStyles({\n nested: {\n backgroundColor: tokens.colorTransparentBackground,\n },\n});\n\n/**\n * Apply styling to the OverlayDrawerSurface slots based on the state\n */\nexport const useOverlayDrawerSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n 'use no memo';\n\n const backdropResetStyles = useBackdropResetStyles();\n const backdropStyles = useBackdropStyles();\n\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(\n backdropResetStyles,\n state.isNestedDialog && backdropStyles.nested,\n state.backdrop.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","useBackdropResetStyles","inset","position","backgroundColor","colorBackgroundOverlay","useBackdropStyles","nested","colorTransparentBackground","useOverlayDrawerSurfaceStyles_unstable","state","backdropResetStyles","backdropStyles","backdrop","className","isNestedDialog"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC3E,SAASC,MAAM,QAAQ,wBAAwB;AAG/C;;CAEC,GACD,MAAMC,yBAAyBJ,gBAAgB;IAC7CK,OAAO;IACPC,UAAU;IACVC,iBAAiBJ,OAAOK,sBAAsB;AAChD;AAEA,MAAMC,oBAAoBR,WAAW;IACnCS,QAAQ;QACNH,iBAAiBJ,OAAOQ,0BAA0B;IACpD;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,yCAAyC,CAACC;IACrD;IAEA,MAAMC,sBAAsBV;IAC5B,MAAMW,iBAAiBN;IAEvB,IAAII,MAAMG,QAAQ,EAAE;QAClBH,MAAMG,QAAQ,CAACC,SAAS,GAAGf,aACzBY,qBACAD,MAAMK,cAAc,IAAIH,eAAeL,MAAM,EAC7CG,MAAMG,QAAQ,CAACC,SAAS;IAE5B;IAEA,OAAOJ;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/OverlayDrawer/OverlayDrawerSurface/useOverlayDrawerSurfaceStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { DialogSurfaceState } from '@fluentui/react-dialog';\n\n/**\n * Styles for the backdrop slot\n */\nconst useBackdropResetStyles = makeResetStyles({\n inset: '0px',\n position: 'fixed',\n backgroundColor: tokens.colorBackgroundOverlay,\n});\n\nconst useBackdropStyles = makeStyles({\n nested: {\n backgroundColor: tokens.colorTransparentBackground,\n },\n\n drawerHidden: {\n pointerEvents: 'none',\n },\n});\n\n/**\n * Apply styling to the OverlayDrawerSurface slots based on the state\n */\nexport const useOverlayDrawerSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n 'use no memo';\n\n const { isNestedDialog, backdrop, open, unmountOnClose } = state;\n\n const backdropResetStyles = useBackdropResetStyles();\n const backdropStyles = useBackdropStyles();\n\n const mountedAndClosed = !unmountOnClose && !open;\n\n if (backdrop) {\n backdrop.className = mergeClasses(\n backdropResetStyles,\n isNestedDialog && backdropStyles.nested,\n mountedAndClosed && backdropStyles.drawerHidden,\n backdrop.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","useBackdropResetStyles","inset","position","backgroundColor","colorBackgroundOverlay","useBackdropStyles","nested","colorTransparentBackground","drawerHidden","pointerEvents","useOverlayDrawerSurfaceStyles_unstable","state","isNestedDialog","backdrop","open","unmountOnClose","backdropResetStyles","backdropStyles","mountedAndClosed","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC3E,SAASC,MAAM,QAAQ,wBAAwB;AAG/C;;CAEC,GACD,MAAMC,yBAAyBJ,gBAAgB;IAC7CK,OAAO;IACPC,UAAU;IACVC,iBAAiBJ,OAAOK,sBAAsB;AAChD;AAEA,MAAMC,oBAAoBR,WAAW;IACnCS,QAAQ;QACNH,iBAAiBJ,OAAOQ,0BAA0B;IACpD;IAEAC,cAAc;QACZC,eAAe;IACjB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,yCAAyC,CAACC;IACrD;IAEA,MAAM,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,cAAc,EAAE,GAAGJ;IAE3D,MAAMK,sBAAsBhB;IAC5B,MAAMiB,iBAAiBZ;IAEvB,MAAMa,mBAAmB,CAACH,kBAAkB,CAACD;IAE7C,IAAID,UAAU;QACZA,SAASM,SAAS,GAAGrB,aACnBkB,qBACAJ,kBAAkBK,eAAeX,MAAM,EACvCY,oBAAoBD,eAAeT,YAAY,EAC/CK,SAASM,SAAS;IAEtB;IAEA,OAAOR;AACT,EAAE"}
@@ -23,8 +23,8 @@ const STATIC_MOTION = {
23
23
  * @param props - props from this instance of OverlayDrawer
24
24
  * @param ref - reference to root HTMLElement of OverlayDrawer
25
25
  */ export const useOverlayDrawer_unstable = (props, ref)=>{
26
- const { open, size, position } = useDrawerDefaultProps(props);
27
- const { backdropMotion, modalType = 'modal', inertTrapFocus, onOpenChange, surfaceMotion, mountNode } = props;
26
+ const { open, size, position, unmountOnClose } = useDrawerDefaultProps(props);
27
+ const { modalType = 'modal', inertTrapFocus, onOpenChange, backdropMotion, surfaceMotion, mountNode } = props;
28
28
  const { dir, targetDocument } = useFluent();
29
29
  const { element: mountNodeElement } = toMountNodeProps(mountNode);
30
30
  const hasMountNodeElement = Boolean(mountNodeElement && (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.body) !== mountNodeElement);
@@ -33,6 +33,7 @@ const STATIC_MOTION = {
33
33
  const root = slot.always({
34
34
  ...props,
35
35
  ref,
36
+ unmountOnClose,
36
37
  backdrop: hasCustomBackdrop ? {
37
38
  ...backdropProps
38
39
  } : null,
@@ -40,16 +41,14 @@ const STATIC_MOTION = {
40
41
  size
41
42
  })
42
43
  }, {
43
- /**
44
- * Drawer accepts a `div` or `aside` element type, but Dialog only accepts a `div` element type.
45
- * We need to cast the ref to a `div` element type to not break Dialog's ref type.
46
- */ elementType: OverlayDrawerSurface
44
+ elementType: OverlayDrawerSurface
47
45
  });
48
46
  const dialog = slot.always({
49
47
  open,
50
48
  onOpenChange,
51
49
  inertTrapFocus,
52
50
  modalType,
51
+ unmountOnClose,
53
52
  surfaceMotion: mergePresenceSlots(surfaceMotion, OverlayDrawerMotion, {
54
53
  position,
55
54
  size,
@@ -73,6 +72,7 @@ const STATIC_MOTION = {
73
72
  size,
74
73
  position,
75
74
  hasMountNodeElement,
75
+ unmountOnClose,
76
76
  // Deprecated props
77
77
  mountNode,
78
78
  motion: STATIC_MOTION
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/OverlayDrawer/useOverlayDrawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog } from '@fluentui/react-dialog';\nimport { slot } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { toMountNodeProps } from '@fluentui/react-portal';\n\nimport { OverlayDrawerMotion, OverlaySurfaceBackdropMotion } from '../../shared/drawerMotions';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { OverlayDrawerProps, OverlayDrawerState } from './OverlayDrawer.types';\nimport { OverlayDrawerSurface } from './OverlayDrawerSurface';\nimport { mergePresenceSlots } from '../../shared/drawerMotionUtils';\n\nconst STATIC_MOTION = {\n active: true,\n canRender: true,\n ref: React.createRef<HTMLDivElement>(),\n type: 'idle' as const,\n};\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 { backdropMotion, modalType = 'modal', inertTrapFocus, onOpenChange, surfaceMotion, mountNode } = props;\n const { dir, targetDocument } = useFluent();\n const { element: mountNodeElement } = toMountNodeProps(mountNode);\n const hasMountNodeElement = Boolean(mountNodeElement && targetDocument?.body !== mountNodeElement);\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,\n backdrop: hasCustomBackdrop ? { ...backdropProps } : null,\n backdropMotion: mergePresenceSlots(backdropMotion, OverlaySurfaceBackdropMotion, { size }),\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 surfaceMotion: mergePresenceSlots(surfaceMotion, OverlayDrawerMotion, { position, size, dir }),\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 JSXElement,\n },\n {\n elementType: Dialog,\n },\n );\n\n return {\n components: {\n root: OverlayDrawerSurface,\n dialog: Dialog,\n },\n\n root,\n dialog,\n\n open,\n size,\n position,\n hasMountNodeElement,\n\n // Deprecated props\n mountNode,\n motion: STATIC_MOTION,\n };\n};\n"],"names":["React","Dialog","slot","useFluent_unstable","useFluent","toMountNodeProps","OverlayDrawerMotion","OverlaySurfaceBackdropMotion","useDrawerDefaultProps","OverlayDrawerSurface","mergePresenceSlots","STATIC_MOTION","active","canRender","ref","createRef","type","useOverlayDrawer_unstable","props","open","size","position","backdropMotion","modalType","inertTrapFocus","onOpenChange","surfaceMotion","mountNode","dir","targetDocument","element","mountNodeElement","hasMountNodeElement","Boolean","body","backdropProps","resolveShorthand","backdrop","hasCustomBackdrop","root","always","elementType","dialog","children","components","motion"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,mBAAmB,EAAEC,4BAA4B,QAAQ,6BAA6B;AAC/F,SAASC,qBAAqB,QAAQ,qCAAqC;AAE3E,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,WAAW;IACXC,mBAAKd,MAAMe,SAAS;IACpBC,MAAM;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAJ;IAEA,MAAM,EAAEK,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGb,sBAAsBU;IACvD,MAAM,EAAEI,cAAc,EAAEC,YAAY,OAAO,EAAEC,cAAc,EAAEC,YAAY,EAAEC,aAAa,EAAEC,SAAS,EAAE,GAAGT;IACxG,MAAM,EAAEU,GAAG,EAAEC,cAAc,EAAE,GAAGzB;IAChC,MAAM,EAAE0B,SAASC,gBAAgB,EAAE,GAAG1B,iBAAiBsB;IACvD,MAAMK,sBAAsBC,QAAQF,oBAAoBF,CAAAA,2BAAAA,qCAAAA,eAAgBK,IAAI,MAAKH;IAEjF,MAAMI,gBAAgBjC,KAAKkC,gBAAgB,CAAClB,MAAMmB,QAAQ;IAC1D,MAAMC,oBAAoBf,cAAc,eAAeY,kBAAkB;IAEzE,MAAMI,OAAOrC,KAAKsC,MAAM,CACtB;QACE,GAAGtB,KAAK;QACRJ;QACAuB,UAAUC,oBAAoB;YAAE,GAAGH,aAAa;QAAC,IAAI;QACrDb,gBAAgBZ,mBAAmBY,gBAAgBf,8BAA8B;YAAEa;QAAK;IAC1F,GACA;QACE;;;OAGC,GACDqB,aAAahC;IACf;IAGF,MAAMiC,SAASxC,KAAKsC,MAAM,CACxB;QACErB;QACAM;QACAD;QACAD;QACAG,eAAehB,mBAAmBgB,eAAepB,qBAAqB;YAAEe;YAAUD;YAAMQ;QAAI;QAC5F;;;OAGC,GACDe,UAAU;IACZ,GACA;QACEF,aAAaxC;IACf;IAGF,OAAO;QACL2C,YAAY;YACVL,MAAM9B;YACNiC,QAAQzC;QACV;QAEAsC;QACAG;QAEAvB;QACAC;QACAC;QACAW;QAEA,mBAAmB;QACnBL;QACAkB,QAAQlC;IACV;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/OverlayDrawer/useOverlayDrawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog } from '@fluentui/react-dialog';\nimport { slot } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { toMountNodeProps } from '@fluentui/react-portal';\n\nimport { OverlayDrawerMotion, OverlaySurfaceBackdropMotion } from '../../shared/drawerMotions';\nimport { useDrawerDefaultProps } from '../../shared/useDrawerDefaultProps';\nimport type { OverlayDrawerProps, OverlayDrawerState } from './OverlayDrawer.types';\nimport { OverlayDrawerSurface } from './OverlayDrawerSurface';\nimport { mergePresenceSlots } from '../../shared/drawerMotionUtils';\n\nconst STATIC_MOTION = {\n active: true,\n canRender: true,\n ref: React.createRef<HTMLDivElement>(),\n type: 'idle' as const,\n};\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, unmountOnClose } = useDrawerDefaultProps(props);\n const { modalType = 'modal', inertTrapFocus, onOpenChange, backdropMotion, surfaceMotion, mountNode } = props;\n const { dir, targetDocument } = useFluent();\n const { element: mountNodeElement } = toMountNodeProps(mountNode);\n const hasMountNodeElement = Boolean(mountNodeElement && targetDocument?.body !== mountNodeElement);\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,\n unmountOnClose,\n backdrop: hasCustomBackdrop ? { ...backdropProps } : null,\n backdropMotion: mergePresenceSlots(backdropMotion, OverlaySurfaceBackdropMotion, { size }),\n },\n {\n elementType: OverlayDrawerSurface,\n },\n );\n\n const dialog = slot.always(\n {\n open,\n onOpenChange,\n inertTrapFocus,\n modalType,\n unmountOnClose,\n surfaceMotion: mergePresenceSlots(surfaceMotion, OverlayDrawerMotion, { position, size, dir }),\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 JSXElement,\n },\n {\n elementType: Dialog,\n },\n );\n\n return {\n components: {\n root: OverlayDrawerSurface,\n dialog: Dialog,\n },\n\n root,\n dialog,\n\n open,\n size,\n position,\n hasMountNodeElement,\n unmountOnClose,\n\n // Deprecated props\n mountNode,\n motion: STATIC_MOTION,\n };\n};\n"],"names":["React","Dialog","slot","useFluent_unstable","useFluent","toMountNodeProps","OverlayDrawerMotion","OverlaySurfaceBackdropMotion","useDrawerDefaultProps","OverlayDrawerSurface","mergePresenceSlots","STATIC_MOTION","active","canRender","ref","createRef","type","useOverlayDrawer_unstable","props","open","size","position","unmountOnClose","modalType","inertTrapFocus","onOpenChange","backdropMotion","surfaceMotion","mountNode","dir","targetDocument","element","mountNodeElement","hasMountNodeElement","Boolean","body","backdropProps","resolveShorthand","backdrop","hasCustomBackdrop","root","always","elementType","dialog","children","components","motion"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,mBAAmB,EAAEC,4BAA4B,QAAQ,6BAA6B;AAC/F,SAASC,qBAAqB,QAAQ,qCAAqC;AAE3E,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,WAAW;IACXC,mBAAKd,MAAMe,SAAS;IACpBC,MAAM;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAJ;IAEA,MAAM,EAAEK,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,cAAc,EAAE,GAAGd,sBAAsBU;IACvE,MAAM,EAAEK,YAAY,OAAO,EAAEC,cAAc,EAAEC,YAAY,EAAEC,cAAc,EAAEC,aAAa,EAAEC,SAAS,EAAE,GAAGV;IACxG,MAAM,EAAEW,GAAG,EAAEC,cAAc,EAAE,GAAG1B;IAChC,MAAM,EAAE2B,SAASC,gBAAgB,EAAE,GAAG3B,iBAAiBuB;IACvD,MAAMK,sBAAsBC,QAAQF,oBAAoBF,CAAAA,2BAAAA,qCAAAA,eAAgBK,IAAI,MAAKH;IAEjF,MAAMI,gBAAgBlC,KAAKmC,gBAAgB,CAACnB,MAAMoB,QAAQ;IAC1D,MAAMC,oBAAoBhB,cAAc,eAAea,kBAAkB;IAEzE,MAAMI,OAAOtC,KAAKuC,MAAM,CACtB;QACE,GAAGvB,KAAK;QACRJ;QACAQ;QACAgB,UAAUC,oBAAoB;YAAE,GAAGH,aAAa;QAAC,IAAI;QACrDV,gBAAgBhB,mBAAmBgB,gBAAgBnB,8BAA8B;YAAEa;QAAK;IAC1F,GACA;QACEsB,aAAajC;IACf;IAGF,MAAMkC,SAASzC,KAAKuC,MAAM,CACxB;QACEtB;QACAM;QACAD;QACAD;QACAD;QACAK,eAAejB,mBAAmBiB,eAAerB,qBAAqB;YAAEe;YAAUD;YAAMS;QAAI;QAC5F;;;OAGC,GACDe,UAAU;IACZ,GACA;QACEF,aAAazC;IACf;IAGF,OAAO;QACL4C,YAAY;YACVL,MAAM/B;YACNkC,QAAQ1C;QACV;QAEAuC;QACAG;QAEAxB;QACAC;QACAC;QACAY;QACAX;QAEA,mBAAmB;QACnBM;QACAkB,QAAQnC;IACV;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shared/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 /**\n * @deprecated Passed values will be static.\n */\n motion: MotionState<HTMLElement>;\n\n open?: boolean;\n};\n\nexport type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/shared/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 /**\n * Decides whether the drawer should be removed from the DOM tree when it is closed.\n * This can be useful when dealing with components that may contain state that should not\n * be reset when the drawer is closed.\n *\n * @default true\n */\n unmountOnClose?: boolean;\n};\n\nexport type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {\n /**\n * @deprecated Passed values will be static.\n */\n motion: MotionState<HTMLElement>;\n\n open?: boolean;\n\n unmountOnClose?: boolean;\n};\n\nexport type DrawerScrollState = 'none' | 'top' | 'middle' | 'bottom';\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}