@fluentui/react-dialog 9.11.11 → 9.11.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,37 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Thu, 15 Aug 2024 13:46:54 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 10 Sep 2024 10:15:06 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.11.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.11.13)
8
+
9
+ Tue, 10 Sep 2024 10:15:06 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.11.12..@fluentui/react-dialog_v9.11.13)
11
+
12
+ ### Patches
13
+
14
+ - chore: follow up on assertSlots fixes ([PR #32323](https://github.com/microsoft/fluentui/pull/32323) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-utilities to v9.18.14 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.43 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
17
+ - Bump @fluentui/react-context-selector to v9.1.66 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
18
+ - Bump @fluentui/react-motion to v9.5.1 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
19
+ - Bump @fluentui/react-aria to v9.13.5 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
20
+ - Bump @fluentui/react-tabster to v9.22.6 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
21
+ - Bump @fluentui/react-portal to v9.4.34 ([PR #32494](https://github.com/microsoft/fluentui/pull/32494) by beachball)
22
+
23
+ ## [9.11.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.11.12)
24
+
25
+ Fri, 16 Aug 2024 10:24:17 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.11.11..@fluentui/react-dialog_v9.11.12)
27
+
28
+ ### Patches
29
+
30
+ - Bump @fluentui/react-motion to v9.5.0 ([PR #32316](https://github.com/microsoft/fluentui/pull/32316) by beachball)
31
+
7
32
  ## [9.11.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.11.11)
8
33
 
9
- Thu, 15 Aug 2024 13:46:54 GMT
34
+ Thu, 15 Aug 2024 13:49:46 GMT
10
35
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.11.10..@fluentui/react-dialog_v9.11.11)
11
36
 
12
37
  ### Patches
package/dist/index.d.ts CHANGED
@@ -212,7 +212,7 @@ export declare type DialogSlots = {
212
212
  surfaceMotion: Slot<PresenceMotionSlotProps>;
213
213
  };
214
214
 
215
- export declare type DialogState = ComponentState<DialogSlots> & DialogContextValue & {
215
+ export declare type DialogState = ComponentState<InternalDialogSlots> & DialogContextValue & {
216
216
  content: React_2.ReactNode;
217
217
  trigger: React_2.ReactNode;
218
218
  };
@@ -341,6 +341,10 @@ export declare type DialogTriggerState = {
341
341
  children: React_2.ReactElement | null;
342
342
  };
343
343
 
344
+ declare type InternalDialogSlots = {
345
+ surfaceMotion: NonNullable<Slot<PresenceMotionSlotProps>>;
346
+ };
347
+
344
348
  /**
345
349
  * Render the final JSX of Dialog
346
350
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {\n surfaceMotion: Slot<PresenceMotionSlotProps>;\n};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"rangeMappings":"","mappings":"AAuGA,WAII"}
1
+ {"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {\n surfaceMotion: Slot<PresenceMotionSlotProps>;\n};\n\nexport type InternalDialogSlots = {\n // motion slots cannot be nullable\n surfaceMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<InternalDialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"rangeMappings":"","mappings":"AA4GA,WAII"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDialog.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { MotionRefForwarder } from '../MotionRefForwarder';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues, DialogSlots } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n assertSlots<DialogSlots>(state);\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {state.trigger}\n {state.content && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <DialogSurface/> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.content as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"names":["assertSlots","React","MotionRefForwarder","DialogProvider","DialogSurfaceProvider","renderDialog_unstable","state","contextValues","value","dialog","dialogSurface","trigger","content","surfaceMotion"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,YAAYC,WAAW,QAAQ;AAE/B,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,iBAAiB;AAGvE;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAoBC;IACxDP,YAAyBM;IAEzB,qBACE,KAACH;QAAeK,OAAOD,cAAcE,MAAM;kBACzC,cAAA,MAACL;YAAsBI,OAAOD,cAAcG,aAAa;;gBACtDJ,MAAMK,OAAO;gBACbL,MAAMM,OAAO,kBACZ,KAACN,MAAMO,aAAa;8BAClB,cAAA,KAACX;kCAGEI,MAAMM,OAAO;;;;;;AAO5B,EAAE"}
1
+ {"version":3,"sources":["renderDialog.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { MotionRefForwarder } from '../MotionRefForwarder';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues, InternalDialogSlots } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n assertSlots<InternalDialogSlots>(state);\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {state.trigger}\n {state.content && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <DialogSurface/> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.content as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"names":["assertSlots","React","MotionRefForwarder","DialogProvider","DialogSurfaceProvider","renderDialog_unstable","state","contextValues","value","dialog","dialogSurface","trigger","content","surfaceMotion"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,YAAYC,WAAW,QAAQ;AAE/B,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,iBAAiB;AAGvE;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAoBC;IACxDP,YAAiCM;IAEjC,qBACE,KAACH;QAAeK,OAAOD,cAAcE,MAAM;kBACzC,cAAA,MAACL;YAAsBI,OAAOD,cAAcG,aAAa;;gBACtDJ,MAAMK,OAAO;gBACbL,MAAMM,OAAO,kBACZ,KAACN,MAAMO,aAAa;8BAClB,cAAA,KAACX;kCAGEI,MAAMM,OAAO;;;;;;AAO5B,EAAE"}
@@ -9,7 +9,9 @@ import { DialogSurfaceProvider } from '../../contexts';
9
9
  return /*#__PURE__*/ _jsxs(Portal, {
10
10
  mountNode: state.mountNode,
11
11
  children: [
12
- state.backdrop && /*#__PURE__*/ _jsx(state.backdropMotion, {
12
+ state.backdrop && // TODO: state.backdropMotion is non nullable, but assertSlots asserts it as nullable
13
+ // FIXME: this should be resolved by properly splitting props and state slots declaration
14
+ state.backdropMotion && /*#__PURE__*/ _jsx(state.backdropMotion, {
13
15
  children: /*#__PURE__*/ _jsx(state.backdrop, {})
14
16
  }),
15
17
  /*#__PURE__*/ _jsx(DialogSurfaceProvider, {
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDialogSurface.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport { DialogSurfaceProvider } from '../../contexts';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n assertSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal mountNode={state.mountNode}>\n {state.backdrop && (\n <state.backdropMotion>\n <state.backdrop />\n </state.backdropMotion>\n )}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <state.root />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"names":["Portal","assertSlots","DialogSurfaceProvider","renderDialogSurface_unstable","state","contextValues","mountNode","backdrop","backdropMotion","value","dialogSurface","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,qBAAqB,QAAQ,iBAAiB;AAGvD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC,OAA2BC;IACtEJ,YAAgCG;IAEhC,qBACE,MAACJ;QAAOM,WAAWF,MAAME,SAAS;;YAC/BF,MAAMG,QAAQ,kBACb,KAACH,MAAMI,cAAc;0BACnB,cAAA,KAACJ,MAAMG,QAAQ;;0BAGnB,KAACL;gBAAsBO,OAAOJ,cAAcK,aAAa;0BACvD,cAAA,KAACN,MAAMO,IAAI;;;;AAInB,EAAE"}
1
+ {"version":3,"sources":["renderDialogSurface.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport { DialogSurfaceProvider } from '../../contexts';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n assertSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal mountNode={state.mountNode}>\n {state.backdrop &&\n // TODO: state.backdropMotion is non nullable, but assertSlots asserts it as nullable\n // FIXME: this should be resolved by properly splitting props and state slots declaration\n state.backdropMotion && (\n <state.backdropMotion>\n <state.backdrop />\n </state.backdropMotion>\n )}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <state.root />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"names":["Portal","assertSlots","DialogSurfaceProvider","renderDialogSurface_unstable","state","contextValues","mountNode","backdrop","backdropMotion","value","dialogSurface","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,qBAAqB,QAAQ,iBAAiB;AAGvD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC,OAA2BC;IACtEJ,YAAgCG;IAEhC,qBACE,MAACJ;QAAOM,WAAWF,MAAME,SAAS;;YAC/BF,MAAMG,QAAQ,IACb,qFAAqF;YACrF,yFAAyF;YACzFH,MAAMI,cAAc,kBAClB,KAACJ,MAAMI,cAAc;0BACnB,cAAA,KAACJ,MAAMG,QAAQ;;0BAGrB,KAACL;gBAAsBO,OAAOJ,cAAcK,aAAa;0BACvD,cAAA,KAACN,MAAMO,IAAI;;;;AAInB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {\n surfaceMotion: Slot<PresenceMotionSlotProps>;\n};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<DialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"rangeMappings":"","mappings":""}
1
+ {"version":3,"sources":["Dialog.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nimport type { DialogContextValue, DialogSurfaceContextValue } from '../../contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface/DialogSurface.types';\n\nexport type DialogSlots = {\n surfaceMotion: Slot<PresenceMotionSlotProps>;\n};\n\nexport type InternalDialogSlots = {\n // motion slots cannot be nullable\n surfaceMotion: NonNullable<Slot<PresenceMotionSlotProps>>;\n};\n\nexport type DialogOpenChangeEvent = DialogOpenChangeData['event'];\n\nexport type DialogOpenChangeData =\n | {\n type: 'escapeKeyDown';\n open: boolean;\n event: React.KeyboardEvent<DialogSurfaceElement>;\n }\n | {\n type: 'backdropClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n }\n | {\n type: 'triggerClick';\n open: boolean;\n event: React.MouseEvent<DialogSurfaceElement>;\n };\n\nexport type DialogModalType = 'modal' | 'non-modal' | 'alert';\n\n/**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\nexport type DialogOpenChangeEventHandler = (event: DialogOpenChangeEvent, data: DialogOpenChangeData) => void;\n\nexport type DialogContextValues = {\n dialog: DialogContextValue;\n /**\n * dialogSurface context is provided by Dialog as false\n * to ensure components inside Dialog but outside DialogSurface will consume this as false\n */\n dialogSurface: DialogSurfaceContextValue;\n};\n\nexport type DialogProps = ComponentProps<Partial<DialogSlots>> & {\n /**\n * Dialog variations.\n *\n * `modal`: When this type of dialog is open, the rest of the page is dimmed out and cannot be interacted with.\n * The tab sequence is kept within the dialog and moving the focus outside\n * the dialog will imply closing it. This is the default type of the component.\n *\n * `non-modal`: When a non-modal dialog is open, the rest of the page is not dimmed out\n * and users can interact with the rest of the page.\n * This also implies that the tab focus can move outside the dialog when it reaches the last focusable element.\n *\n * `alert`: is a special type of modal dialogs that interrupts the user's workflow\n * to communicate an important message or ask for a decision.\n * Unlike a typical modal dialog, the user must take an action through the options given to dismiss the dialog,\n * and it cannot be dismissed through the dimmed background.\n *\n * @default modal\n */\n modalType?: DialogModalType;\n /**\n * Controls the open state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Default value for the uncontrolled open state of the dialog.\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback fired when the component changes value from open state.\n *\n * @param event - a React's Synthetic event or a KeyboardEvent in case of `documentEscapeKeyDown`\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: DialogOpenChangeEventHandler;\n /**\n * Can contain two children including {@link DialogTrigger} and {@link DialogSurface}.\n * Alternatively can only contain {@link DialogSurface} if using trigger outside dialog, or controlling state.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * Enables standard behavior according to the [HTML dialog spec](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)\n * where the focus trap involves setting outside elements inert.\n *\n * @default false\n */\n inertTrapFocus?: boolean;\n};\n\nexport type DialogState = ComponentState<InternalDialogSlots> &\n DialogContextValue & {\n content: React.ReactNode;\n trigger: React.ReactNode;\n };\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDialog.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { MotionRefForwarder } from '../MotionRefForwarder';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues, DialogSlots } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n assertSlots<DialogSlots>(state);\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {state.trigger}\n {state.content && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <DialogSurface/> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.content as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"names":["renderDialog_unstable","state","contextValues","assertSlots","_jsx","DialogProvider","value","dialog","_jsxs","DialogSurfaceProvider","dialogSurface","trigger","content","surfaceMotion","MotionRefForwarder"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;4BAZb;gCAE4B;iEACL;oCAEY;0BACmB;AAM/C,MAAMA,wBAAwB,CAACC,OAAoBC;IACxDC,IAAAA,2BAAAA,EAAyBF;IAEzB,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,wBAAAA,EAAAA;QAAeC,OAAOJ,cAAcK,MAAM;kBACzC,WAAA,GAAAC,IAAAA,gBAAA,EAACC,+BAAAA,EAAAA;YAAsBH,OAAOJ,cAAcQ,aAAa;;gBACtDT,MAAMU,OAAO;gBACbV,MAAMW,OAAO,IAAA,WAAA,GACZR,IAAAA,eAAA,EAACH,MAAMY,aAAa,EAAA;8BAClB,WAAA,GAAAT,IAAAA,eAAA,EAACU,sCAAAA,EAAAA;kCAGEb,MAAMW,OAAO;;;;;;AAO5B"}
1
+ {"version":3,"sources":["renderDialog.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { MotionRefForwarder } from '../MotionRefForwarder';\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\nimport type { DialogState, DialogContextValues, InternalDialogSlots } from './Dialog.types';\n\n/**\n * Render the final JSX of Dialog\n */\nexport const renderDialog_unstable = (state: DialogState, contextValues: DialogContextValues) => {\n assertSlots<InternalDialogSlots>(state);\n\n return (\n <DialogProvider value={contextValues.dialog}>\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n {state.trigger}\n {state.content && (\n <state.surfaceMotion>\n <MotionRefForwarder>\n {/* Casting here as content should be equivalent to <DialogSurface/> */}\n {/* FIXME: content should not be ReactNode it should be ReactElement instead. */}\n {state.content as React.ReactElement}\n </MotionRefForwarder>\n </state.surfaceMotion>\n )}\n </DialogSurfaceProvider>\n </DialogProvider>\n );\n};\n"],"names":["renderDialog_unstable","state","contextValues","assertSlots","_jsx","DialogProvider","value","dialog","_jsxs","DialogSurfaceProvider","dialogSurface","trigger","content","surfaceMotion","MotionRefForwarder"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;4BAZb;gCAE4B;iEACL;oCAEY;0BACmB;AAM/C,MAAMA,wBAAwB,CAACC,OAAoBC;IACxDC,IAAAA,2BAAAA,EAAiCF;IAEjC,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,wBAAAA,EAAAA;QAAeC,OAAOJ,cAAcK,MAAM;kBACzC,WAAA,GAAAC,IAAAA,gBAAA,EAACC,+BAAAA,EAAAA;YAAsBH,OAAOJ,cAAcQ,aAAa;;gBACtDT,MAAMU,OAAO;gBACbV,MAAMW,OAAO,IAAA,WAAA,GACZR,IAAAA,eAAA,EAACH,MAAMY,aAAa,EAAA;8BAClB,WAAA,GAAAT,IAAAA,eAAA,EAACU,sCAAAA,EAAAA;kCAGEb,MAAMW,OAAO;;;;;;AAO5B"}
@@ -17,7 +17,9 @@ const renderDialogSurface_unstable = (state, contextValues)=>{
17
17
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactportal.Portal, {
18
18
  mountNode: state.mountNode,
19
19
  children: [
20
- state.backdrop && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.backdropMotion, {
20
+ state.backdrop && // TODO: state.backdropMotion is non nullable, but assertSlots asserts it as nullable
21
+ // FIXME: this should be resolved by properly splitting props and state slots declaration
22
+ state.backdropMotion && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.backdropMotion, {
21
23
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.backdrop, {})
22
24
  }),
23
25
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_contexts.DialogSurfaceProvider, {
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDialogSurface.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport { DialogSurfaceProvider } from '../../contexts';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n assertSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal mountNode={state.mountNode}>\n {state.backdrop && (\n <state.backdropMotion>\n <state.backdrop />\n </state.backdropMotion>\n )}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <state.root />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"names":["renderDialogSurface_unstable","state","contextValues","assertSlots","_jsxs","Portal","mountNode","backdrop","_jsx","backdropMotion","DialogSurfaceProvider","value","dialogSurface","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;4BAXb;6BAEuB;gCACK;0BAEU;AAM/B,MAAMA,+BAA+B,CAACC,OAA2BC;IACtEC,IAAAA,2BAAAA,EAAgCF;IAEhC,OAAA,WAAA,GACEG,IAAAA,gBAAA,EAACC,mBAAAA,EAAAA;QAAOC,WAAWL,MAAMK,SAAS;;YAC/BL,MAAMM,QAAQ,IAAA,WAAA,GACbC,IAAAA,eAAA,EAACP,MAAMQ,cAAc,EAAA;0BACnB,WAAA,GAAAD,IAAAA,eAAA,EAACP,MAAMM,QAAQ,EAAA,CAAA;;0BAGnBC,IAAAA,eAAA,EAACE,+BAAAA,EAAAA;gBAAsBC,OAAOT,cAAcU,aAAa;0BACvD,WAAA,GAAAJ,IAAAA,eAAA,EAACP,MAAMY,IAAI,EAAA,CAAA;;;;AAInB"}
1
+ {"version":3,"sources":["renderDialogSurface.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\n\nimport { DialogSurfaceProvider } from '../../contexts';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n assertSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal mountNode={state.mountNode}>\n {state.backdrop &&\n // TODO: state.backdropMotion is non nullable, but assertSlots asserts it as nullable\n // FIXME: this should be resolved by properly splitting props and state slots declaration\n state.backdropMotion && (\n <state.backdropMotion>\n <state.backdrop />\n </state.backdropMotion>\n )}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <state.root />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"names":["renderDialogSurface_unstable","state","contextValues","assertSlots","_jsxs","Portal","mountNode","backdrop","backdropMotion","_jsx","DialogSurfaceProvider","value","dialogSurface","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;4BAXb;6BAEuB;gCACK;0BAEU;AAM/B,MAAMA,+BAA+B,CAACC,OAA2BC;IACtEC,IAAAA,2BAAAA,EAAgCF;IAEhC,OAAA,WAAA,GACEG,IAAAA,gBAAA,EAACC,mBAAAA,EAAAA;QAAOC,WAAWL,MAAMK,SAAS;;YAC/BL,MAAMM,QAAQ,IACb,qFAAqF;YACrF,yFAAyF;YACzFN,MAAMO,cAAc,IAAA,WAAA,GAClBC,IAAAA,eAAA,EAACR,MAAMO,cAAc,EAAA;0BACnB,WAAA,GAAAC,IAAAA,eAAA,EAACR,MAAMM,QAAQ,EAAA,CAAA;;0BAGrBE,IAAAA,eAAA,EAACC,+BAAAA,EAAAA;gBAAsBC,OAAOT,cAAcU,aAAa;0BACvD,WAAA,GAAAH,IAAAA,eAAA,EAACR,MAAMY,IAAI,EAAA,CAAA;;;;AAInB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.11.11",
3
+ "version": "9.11.13",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -40,17 +40,17 @@
40
40
  "@fluentui/scripts-tasks": "*"
41
41
  },
42
42
  "dependencies": {
43
- "@fluentui/react-utilities": "^9.18.13",
44
- "@fluentui/react-jsx-runtime": "^9.0.42",
43
+ "@fluentui/react-utilities": "^9.18.14",
44
+ "@fluentui/react-jsx-runtime": "^9.0.43",
45
45
  "@fluentui/keyboard-keys": "^9.0.7",
46
- "@fluentui/react-context-selector": "^9.1.65",
47
- "@fluentui/react-motion": "^9.4.0",
46
+ "@fluentui/react-context-selector": "^9.1.66",
47
+ "@fluentui/react-motion": "^9.5.1",
48
48
  "@fluentui/react-shared-contexts": "^9.20.0",
49
- "@fluentui/react-aria": "^9.13.4",
49
+ "@fluentui/react-aria": "^9.13.5",
50
50
  "@fluentui/react-icons": "^2.0.245",
51
- "@fluentui/react-tabster": "^9.22.5",
51
+ "@fluentui/react-tabster": "^9.22.6",
52
52
  "@fluentui/react-theme": "^9.1.19",
53
- "@fluentui/react-portal": "^9.4.33",
53
+ "@fluentui/react-portal": "^9.4.34",
54
54
  "@griffel/react": "^1.5.22",
55
55
  "@swc/helpers": "^0.5.1"
56
56
  },