@fluentui/react-dialog 9.6.5 → 9.7.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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,93 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 14 Sep 2023 16:40:23 GMT",
5
+ "date": "Wed, 20 Sep 2023 17:40:43 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.7.1",
7
+ "version": "9.7.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0",
14
+ "comment": "chore: trigger manual version bump after broken release"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-dialog",
19
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.10",
20
+ "commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-dialog",
25
+ "comment": "Bump @fluentui/react-shared-contexts to v9.8.1",
26
+ "commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-dialog",
31
+ "comment": "Bump @fluentui/react-tabster to v9.12.11",
32
+ "commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-dialog",
37
+ "comment": "Bump @fluentui/react-portal to v9.3.16",
38
+ "commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 20 Sep 2023 14:59:52 GMT",
45
+ "tag": "@fluentui/react-dialog_v9.7.0",
46
+ "version": "9.7.0",
47
+ "comments": {
48
+ "patch": [
49
+ {
50
+ "author": "bernardo.sunderhus@gmail.com",
51
+ "package": "@fluentui/react-dialog",
52
+ "commit": "b824db72aac6f6b849aa0e77a32a11b8c5d8c3db",
53
+ "comment": "chore: useFocusFirstElement warns only in development"
54
+ }
55
+ ],
56
+ "minor": [
57
+ {
58
+ "author": "bernardo.sunderhus@gmail.com",
59
+ "package": "@fluentui/react-dialog",
60
+ "commit": "da657356c4f4b0c3fbaa9076ef9d0dbf4e603523",
61
+ "comment": "feat: exports contexts"
62
+ },
63
+ {
64
+ "author": "beachball",
65
+ "package": "@fluentui/react-dialog",
66
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.9",
67
+ "commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
68
+ },
69
+ {
70
+ "author": "beachball",
71
+ "package": "@fluentui/react-dialog",
72
+ "comment": "Bump @fluentui/react-shared-contexts to v9.8.0",
73
+ "commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
74
+ },
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-dialog",
78
+ "comment": "Bump @fluentui/react-tabster to v9.12.10",
79
+ "commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
80
+ },
81
+ {
82
+ "author": "beachball",
83
+ "package": "@fluentui/react-dialog",
84
+ "comment": "Bump @fluentui/react-portal to v9.3.15",
85
+ "commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "date": "Thu, 14 Sep 2023 16:44:47 GMT",
6
92
  "tag": "@fluentui/react-dialog_v9.6.5",
7
93
  "version": "9.6.5",
8
94
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Thu, 14 Sep 2023 16:40:23 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 20 Sep 2023 17:40:43 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.1)
8
+
9
+ Wed, 20 Sep 2023 17:40:43 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.0..@fluentui/react-dialog_v9.7.1)
11
+
12
+ ### Patches
13
+
14
+ - chore: trigger manual version bump after broken release ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/react-jsx-runtime to v9.0.10 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v9.8.1 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.12.11 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
18
+ - Bump @fluentui/react-portal to v9.3.16 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
19
+
20
+ ## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.0)
21
+
22
+ Wed, 20 Sep 2023 14:59:52 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.6.5..@fluentui/react-dialog_v9.7.0)
24
+
25
+ ### Minor changes
26
+
27
+ - feat: exports contexts ([PR #29160](https://github.com/microsoft/fluentui/pull/29160) by bernardo.sunderhus@gmail.com)
28
+ - Bump @fluentui/react-jsx-runtime to v9.0.9 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
29
+ - Bump @fluentui/react-shared-contexts to v9.8.0 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
30
+ - Bump @fluentui/react-tabster to v9.12.10 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
31
+ - Bump @fluentui/react-portal to v9.3.15 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
32
+
33
+ ### Patches
34
+
35
+ - chore: useFocusFirstElement warns only in development ([PR #29190](https://github.com/microsoft/fluentui/pull/29190) by bernardo.sunderhus@gmail.com)
36
+
7
37
  ## [9.6.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.6.5)
8
38
 
9
- Thu, 14 Sep 2023 16:40:23 GMT
39
+ Thu, 14 Sep 2023 16:44:47 GMT
10
40
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.6.4..@fluentui/react-dialog_v9.6.5)
11
41
 
12
42
  ### Patches
package/dist/index.d.ts CHANGED
@@ -4,9 +4,11 @@ import { ARIAButtonResultProps } from '@fluentui/react-aria';
4
4
  import { ARIAButtonType } from '@fluentui/react-aria';
5
5
  import type { ComponentProps } from '@fluentui/react-utilities';
6
6
  import type { ComponentState } from '@fluentui/react-utilities';
7
+ import { ContextSelector } from '@fluentui/react-context-selector';
7
8
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
8
9
  import { JSXElementConstructor } from 'react';
9
10
  import type { PortalProps } from '@fluentui/react-portal';
11
+ import { Provider } from 'react';
10
12
  import * as React_2 from 'react';
11
13
  import { ReactElement } from 'react';
12
14
  import type { Slot } from '@fluentui/react-utilities';
@@ -102,7 +104,7 @@ export declare type DialogContentSlots = {
102
104
  */
103
105
  export declare type DialogContentState = ComponentState<DialogContentSlots>;
104
106
 
105
- declare type DialogContextValue = {
107
+ export declare type DialogContextValue = {
106
108
  open: boolean;
107
109
  inertTrapFocus: boolean;
108
110
  dialogTitleId?: string;
@@ -203,6 +205,8 @@ export declare type DialogProps = ComponentProps<Partial<DialogSlots>> & {
203
205
  inertTrapFocus?: boolean;
204
206
  };
205
207
 
208
+ export declare const DialogProvider: React_2.Provider<DialogContextValue | undefined> & React_2.FC<React_2.ProviderProps<DialogContextValue | undefined>>;
209
+
206
210
  export declare type DialogSlots = {};
207
211
 
208
212
  export declare type DialogState = ComponentState<DialogSlots> & DialogContextValue & {
@@ -218,7 +222,7 @@ export declare const DialogSurface: ForwardRefComponent<DialogSurfaceProps>;
218
222
 
219
223
  export declare const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots>;
220
224
 
221
- declare type DialogSurfaceContextValue = boolean;
225
+ export declare type DialogSurfaceContextValue = boolean;
222
226
 
223
227
  declare type DialogSurfaceContextValues = {
224
228
  dialogSurface: DialogSurfaceContextValue;
@@ -234,6 +238,8 @@ export declare type DialogSurfaceElement = HTMLElement;
234
238
  */
235
239
  export declare type DialogSurfaceProps = ComponentProps<DialogSurfaceSlots> & Pick<PortalProps, 'mountNode'>;
236
240
 
241
+ export declare const DialogSurfaceProvider: Provider<boolean | undefined>;
242
+
237
243
  export declare type DialogSurfaceSlots = {
238
244
  /**
239
245
  * Dimmed background of dialog.
@@ -417,6 +423,8 @@ export declare const useDialogContent_unstable: (props: DialogContentProps, ref:
417
423
  */
418
424
  export declare const useDialogContentStyles_unstable: (state: DialogContentState) => DialogContentState;
419
425
 
426
+ export declare const useDialogContext_unstable: <T>(selector: ContextSelector<DialogContextValue, T>) => T;
427
+
420
428
  /**
421
429
  * Create the state required to render DialogSurface.
422
430
  *
@@ -428,6 +436,8 @@ export declare const useDialogContentStyles_unstable: (state: DialogContentState
428
436
  */
429
437
  export declare const useDialogSurface_unstable: (props: DialogSurfaceProps, ref: React_2.Ref<DialogSurfaceElement>) => DialogSurfaceState;
430
438
 
439
+ export declare const useDialogSurfaceContext_unstable: () => boolean;
440
+
431
441
  /**
432
442
  * Apply styling to the DialogSurface slots based on the state
433
443
  */
package/lib/index.js CHANGED
@@ -5,3 +5,4 @@ export { DialogBody, dialogBodyClassNames, useDialogBody_unstable, useDialogBody
5
5
  export { DialogTitle, dialogTitleClassNames, useDialogTitle_unstable, useDialogTitleStyles_unstable, renderDialogTitle_unstable } from './DialogTitle';
6
6
  export { DialogSurface, dialogSurfaceClassNames, useDialogSurface_unstable, useDialogSurfaceStyles_unstable, renderDialogSurface_unstable } from './DialogSurface';
7
7
  export { DialogContent, dialogContentClassNames, useDialogContent_unstable, useDialogContentStyles_unstable, renderDialogContent_unstable } from './DialogContent';
8
+ export { useDialogContext_unstable, useDialogSurfaceContext_unstable, DialogProvider, DialogSurfaceProvider } from './contexts/index';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport type {\n DialogSlots,\n DialogProps,\n DialogState,\n DialogOpenChangeData,\n DialogOpenChangeEvent,\n DialogOpenChangeEventHandler,\n} from './Dialog';\n\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport type {\n DialogTriggerProps,\n DialogTriggerChildProps,\n DialogTriggerState,\n DialogTriggerAction,\n} from './DialogTrigger';\n\nexport {\n DialogActions,\n dialogActionsClassNames,\n useDialogActions_unstable,\n useDialogActionsStyles_unstable,\n renderDialogActions_unstable,\n} from './DialogActions';\nexport type {\n DialogActionsProps,\n DialogActionsSlots,\n DialogActionsState,\n DialogActionsPosition,\n} from './DialogActions';\n\nexport {\n DialogBody,\n dialogBodyClassNames,\n useDialogBody_unstable,\n useDialogBodyStyles_unstable,\n renderDialogBody_unstable,\n} from './DialogBody';\nexport type { DialogBodyProps, DialogBodySlots, DialogBodyState } from './DialogBody';\n\nexport {\n DialogTitle,\n dialogTitleClassNames,\n useDialogTitle_unstable,\n useDialogTitleStyles_unstable,\n renderDialogTitle_unstable,\n} from './DialogTitle';\nexport type { DialogTitleProps, DialogTitleSlots, DialogTitleState } from './DialogTitle';\n\nexport {\n DialogSurface,\n dialogSurfaceClassNames,\n useDialogSurface_unstable,\n useDialogSurfaceStyles_unstable,\n renderDialogSurface_unstable,\n} from './DialogSurface';\nexport type { DialogSurfaceProps, DialogSurfaceSlots, DialogSurfaceState, DialogSurfaceElement } from './DialogSurface';\n\nexport {\n DialogContent,\n dialogContentClassNames,\n useDialogContent_unstable,\n useDialogContentStyles_unstable,\n renderDialogContent_unstable,\n} from './DialogContent';\nexport type { DialogContentProps, DialogContentSlots, DialogContentState } from './DialogContent';\n"],"names":["Dialog","renderDialog_unstable","useDialog_unstable","DialogTrigger","useDialogTrigger_unstable","renderDialogTrigger_unstable","DialogActions","dialogActionsClassNames","useDialogActions_unstable","useDialogActionsStyles_unstable","renderDialogActions_unstable","DialogBody","dialogBodyClassNames","useDialogBody_unstable","useDialogBodyStyles_unstable","renderDialogBody_unstable","DialogTitle","dialogTitleClassNames","useDialogTitle_unstable","useDialogTitleStyles_unstable","renderDialogTitle_unstable","DialogSurface","dialogSurfaceClassNames","useDialogSurface_unstable","useDialogSurfaceStyles_unstable","renderDialogSurface_unstable","DialogContent","dialogContentClassNames","useDialogContent_unstable","useDialogContentStyles_unstable","renderDialogContent_unstable"],"mappings":"AAAA,SAASA,MAAM,EAAEC,qBAAqB,EAAEC,kBAAkB,QAAQ,WAAW;AAU7E,SAASC,aAAa,EAAEC,yBAAyB,EAAEC,4BAA4B,QAAQ,kBAAkB;AAQzG,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB;AAQzB,SACEC,UAAU,EACVC,oBAAoB,EACpBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,yBAAyB,QACpB,eAAe;AAGtB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB,gBAAgB;AAGvB,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB;AAGzB,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport type {\n DialogSlots,\n DialogProps,\n DialogState,\n DialogOpenChangeData,\n DialogOpenChangeEvent,\n DialogOpenChangeEventHandler,\n} from './Dialog';\n\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport type {\n DialogTriggerProps,\n DialogTriggerChildProps,\n DialogTriggerState,\n DialogTriggerAction,\n} from './DialogTrigger';\n\nexport {\n DialogActions,\n dialogActionsClassNames,\n useDialogActions_unstable,\n useDialogActionsStyles_unstable,\n renderDialogActions_unstable,\n} from './DialogActions';\nexport type {\n DialogActionsProps,\n DialogActionsSlots,\n DialogActionsState,\n DialogActionsPosition,\n} from './DialogActions';\n\nexport {\n DialogBody,\n dialogBodyClassNames,\n useDialogBody_unstable,\n useDialogBodyStyles_unstable,\n renderDialogBody_unstable,\n} from './DialogBody';\nexport type { DialogBodyProps, DialogBodySlots, DialogBodyState } from './DialogBody';\n\nexport {\n DialogTitle,\n dialogTitleClassNames,\n useDialogTitle_unstable,\n useDialogTitleStyles_unstable,\n renderDialogTitle_unstable,\n} from './DialogTitle';\nexport type { DialogTitleProps, DialogTitleSlots, DialogTitleState } from './DialogTitle';\n\nexport {\n DialogSurface,\n dialogSurfaceClassNames,\n useDialogSurface_unstable,\n useDialogSurfaceStyles_unstable,\n renderDialogSurface_unstable,\n} from './DialogSurface';\nexport type { DialogSurfaceProps, DialogSurfaceSlots, DialogSurfaceState, DialogSurfaceElement } from './DialogSurface';\n\nexport {\n DialogContent,\n dialogContentClassNames,\n useDialogContent_unstable,\n useDialogContentStyles_unstable,\n renderDialogContent_unstable,\n} from './DialogContent';\nexport type { DialogContentProps, DialogContentSlots, DialogContentState } from './DialogContent';\n\nexport {\n useDialogContext_unstable,\n useDialogSurfaceContext_unstable,\n DialogProvider,\n DialogSurfaceProvider,\n} from './contexts/index';\n\nexport type { DialogContextValue, DialogSurfaceContextValue } from './contexts/index';\n"],"names":["Dialog","renderDialog_unstable","useDialog_unstable","DialogTrigger","useDialogTrigger_unstable","renderDialogTrigger_unstable","DialogActions","dialogActionsClassNames","useDialogActions_unstable","useDialogActionsStyles_unstable","renderDialogActions_unstable","DialogBody","dialogBodyClassNames","useDialogBody_unstable","useDialogBodyStyles_unstable","renderDialogBody_unstable","DialogTitle","dialogTitleClassNames","useDialogTitle_unstable","useDialogTitleStyles_unstable","renderDialogTitle_unstable","DialogSurface","dialogSurfaceClassNames","useDialogSurface_unstable","useDialogSurfaceStyles_unstable","renderDialogSurface_unstable","DialogContent","dialogContentClassNames","useDialogContent_unstable","useDialogContentStyles_unstable","renderDialogContent_unstable","useDialogContext_unstable","useDialogSurfaceContext_unstable","DialogProvider","DialogSurfaceProvider"],"mappings":"AAAA,SAASA,MAAM,EAAEC,qBAAqB,EAAEC,kBAAkB,QAAQ,WAAW;AAU7E,SAASC,aAAa,EAAEC,yBAAyB,EAAEC,4BAA4B,QAAQ,kBAAkB;AAQzG,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB;AAQzB,SACEC,UAAU,EACVC,oBAAoB,EACpBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,yBAAyB,QACpB,eAAe;AAGtB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB,gBAAgB;AAGvB,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB;AAGzB,SACEC,aAAa,EACbC,uBAAuB,EACvBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,4BAA4B,QACvB,kBAAkB;AAGzB,SACEC,yBAAyB,EACzBC,gCAAgC,EAChCC,cAAc,EACdC,qBAAqB,QAChB,mBAAmB"}
@@ -17,7 +17,7 @@ import { useFluent_unstable } from '@fluentui/react-shared-contexts';
17
17
  } else {
18
18
  var _dialogRef_current;
19
19
  (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150
20
- if (process.env.NODE_ENV !== 'production') {
20
+ if (process.env.NODE_ENV === 'development') {
21
21
  // eslint-disable-next-line no-console
22
22
  console.warn(`@fluentui/react-dialog [useFocusFirstElement]:
23
23
  A Dialog should have at least one focusable element inside DialogSurface.
@@ -1 +1 @@
1
- {"version":3,"sources":["useFocusFirstElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(/** #__DE-INDENT__ */ `\n @fluentui/react-dialog [useFocusFirstElement]:\n A Dialog should have at least one focusable element inside DialogSurface.\n Please add at least a close button either on \\`DialogTitle\\` action slot or inside \\`DialogActions\\`\n `);\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","useEffect","element","current","focus","process","env","NODE_ENV","console","warn"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,kBAAkB,QAAQ,kCAAkC;AAIrE;;CAEC,GACD,OAAO,SAASC,qBAAqBC,IAAa,EAAEC,SAA0B;IAC5E,MAAM,EAAEC,kBAAkB,EAAE,GAAGL;IAC/B,MAAM,EAAEM,cAAc,EAAE,GAAGL;IAC3B,MAAMM,YAAYR,MAAMS,MAAM,CAAuB;IAErDT,MAAMU,SAAS,CAAC;QACd,IAAI,CAACN,MAAM;YACT;QACF;QACA,MAAMO,UAAUH,UAAUI,OAAO,IAAIN,mBAAmBE,UAAUI,OAAO;QACzE,IAAID,SAAS;YACXA,QAAQE,KAAK;QACf,OAAO;gBACLL;aAAAA,qBAAAA,UAAUI,OAAO,cAAjBJ,yCAAAA,mBAAmBK,KAAK,IAAI,qDAAqD;YACjF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,IAAI,CAAuB,CAAC;;oGAIpC,CAAC;YACH;QACF;IACF,GAAG;QAACZ;QAAoBF;QAAMC;QAAWE;KAAe;IAExD,OAAOC;AACT"}
1
+ {"version":3,"sources":["useFocusFirstElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(/** #__DE-INDENT__ */ `\n @fluentui/react-dialog [useFocusFirstElement]:\n A Dialog should have at least one focusable element inside DialogSurface.\n Please add at least a close button either on \\`DialogTitle\\` action slot or inside \\`DialogActions\\`\n `);\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","useEffect","element","current","focus","process","env","NODE_ENV","console","warn"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,kBAAkB,QAAQ,kCAAkC;AAIrE;;CAEC,GACD,OAAO,SAASC,qBAAqBC,IAAa,EAAEC,SAA0B;IAC5E,MAAM,EAAEC,kBAAkB,EAAE,GAAGL;IAC/B,MAAM,EAAEM,cAAc,EAAE,GAAGL;IAC3B,MAAMM,YAAYR,MAAMS,MAAM,CAAuB;IAErDT,MAAMU,SAAS,CAAC;QACd,IAAI,CAACN,MAAM;YACT;QACF;QACA,MAAMO,UAAUH,UAAUI,OAAO,IAAIN,mBAAmBE,UAAUI,OAAO;QACzE,IAAID,SAAS;YACXA,QAAQE,KAAK;QACf,OAAO;gBACLL;aAAAA,qBAAAA,UAAUI,OAAO,cAAjBJ,yCAAAA,mBAAmBK,KAAK,IAAI,qDAAqD;YACjF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;gBAC1C,sCAAsC;gBACtCC,QAAQC,IAAI,CAAuB,CAAC;;oGAIpC,CAAC;YACH;QACF;IACF,GAAG;QAACZ;QAAoBF;QAAMC;QAAWE;KAAe;IAExD,OAAOC;AACT"}
@@ -101,6 +101,18 @@ _export(exports, {
101
101
  },
102
102
  renderDialogContent_unstable: function() {
103
103
  return _DialogContent.renderDialogContent_unstable;
104
+ },
105
+ useDialogContext_unstable: function() {
106
+ return _index.useDialogContext_unstable;
107
+ },
108
+ useDialogSurfaceContext_unstable: function() {
109
+ return _index.useDialogSurfaceContext_unstable;
110
+ },
111
+ DialogProvider: function() {
112
+ return _index.DialogProvider;
113
+ },
114
+ DialogSurfaceProvider: function() {
115
+ return _index.DialogSurfaceProvider;
104
116
  }
105
117
  });
106
118
  const _Dialog = require("./Dialog");
@@ -110,3 +122,4 @@ const _DialogBody = require("./DialogBody");
110
122
  const _DialogTitle = require("./DialogTitle");
111
123
  const _DialogSurface = require("./DialogSurface");
112
124
  const _DialogContent = require("./DialogContent");
125
+ const _index = require("./contexts/index");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport { DialogActions, dialogActionsClassNames, useDialogActions_unstable, useDialogActionsStyles_unstable, renderDialogActions_unstable } from './DialogActions';\nexport { DialogBody, dialogBodyClassNames, useDialogBody_unstable, useDialogBodyStyles_unstable, renderDialogBody_unstable } from './DialogBody';\nexport { DialogTitle, dialogTitleClassNames, useDialogTitle_unstable, useDialogTitleStyles_unstable, renderDialogTitle_unstable } from './DialogTitle';\nexport { DialogSurface, dialogSurfaceClassNames, useDialogSurface_unstable, useDialogSurfaceStyles_unstable, renderDialogSurface_unstable } from './DialogSurface';\nexport { DialogContent, dialogContentClassNames, useDialogContent_unstable, useDialogContentStyles_unstable, renderDialogContent_unstable } from './DialogContent';\n"],"names":["Dialog","renderDialog_unstable","useDialog_unstable","DialogTrigger","useDialogTrigger_unstable","renderDialogTrigger_unstable","DialogActions","dialogActionsClassNames","useDialogActions_unstable","useDialogActionsStyles_unstable","renderDialogActions_unstable","DialogBody","dialogBodyClassNames","useDialogBody_unstable","useDialogBodyStyles_unstable","renderDialogBody_unstable","DialogTitle","dialogTitleClassNames","useDialogTitle_unstable","useDialogTitleStyles_unstable","renderDialogTitle_unstable","DialogSurface","dialogSurfaceClassNames","useDialogSurface_unstable","useDialogSurfaceStyles_unstable","renderDialogSurface_unstable","DialogContent","dialogContentClassNames","useDialogContent_unstable","useDialogContentStyles_unstable","renderDialogContent_unstable"],"mappings":";;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IAAEC,qBAAqB;eAArBA,6BAAqB;;IAAEC,kBAAkB;eAAlBA,0BAAkB;;IACjDC,aAAa;eAAbA,4BAAa;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IACtEC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAChIC,UAAU;eAAVA,sBAAU;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,yBAAyB;eAAzBA,qCAAyB;;IACjHC,WAAW;eAAXA,wBAAW;;IAAEC,qBAAqB;eAArBA,kCAAqB;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IAAEC,6BAA6B;eAA7BA,0CAA6B;;IAAEC,0BAA0B;eAA1BA,uCAA0B;;IACtHC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAChIC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;;wBANvE;+BACqB;+BAC0D;4BACf;6BACK;+BACU;+BACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { Dialog, renderDialog_unstable, useDialog_unstable } from './Dialog';\nexport { DialogTrigger, useDialogTrigger_unstable, renderDialogTrigger_unstable } from './DialogTrigger';\nexport { DialogActions, dialogActionsClassNames, useDialogActions_unstable, useDialogActionsStyles_unstable, renderDialogActions_unstable } from './DialogActions';\nexport { DialogBody, dialogBodyClassNames, useDialogBody_unstable, useDialogBodyStyles_unstable, renderDialogBody_unstable } from './DialogBody';\nexport { DialogTitle, dialogTitleClassNames, useDialogTitle_unstable, useDialogTitleStyles_unstable, renderDialogTitle_unstable } from './DialogTitle';\nexport { DialogSurface, dialogSurfaceClassNames, useDialogSurface_unstable, useDialogSurfaceStyles_unstable, renderDialogSurface_unstable } from './DialogSurface';\nexport { DialogContent, dialogContentClassNames, useDialogContent_unstable, useDialogContentStyles_unstable, renderDialogContent_unstable } from './DialogContent';\nexport { useDialogContext_unstable, useDialogSurfaceContext_unstable, DialogProvider, DialogSurfaceProvider } from './contexts/index';\n"],"names":["Dialog","renderDialog_unstable","useDialog_unstable","DialogTrigger","useDialogTrigger_unstable","renderDialogTrigger_unstable","DialogActions","dialogActionsClassNames","useDialogActions_unstable","useDialogActionsStyles_unstable","renderDialogActions_unstable","DialogBody","dialogBodyClassNames","useDialogBody_unstable","useDialogBodyStyles_unstable","renderDialogBody_unstable","DialogTitle","dialogTitleClassNames","useDialogTitle_unstable","useDialogTitleStyles_unstable","renderDialogTitle_unstable","DialogSurface","dialogSurfaceClassNames","useDialogSurface_unstable","useDialogSurfaceStyles_unstable","renderDialogSurface_unstable","DialogContent","dialogContentClassNames","useDialogContent_unstable","useDialogContentStyles_unstable","renderDialogContent_unstable","useDialogContext_unstable","useDialogSurfaceContext_unstable","DialogProvider","DialogSurfaceProvider"],"mappings":";;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IAAEC,qBAAqB;eAArBA,6BAAqB;;IAAEC,kBAAkB;eAAlBA,0BAAkB;;IACjDC,aAAa;eAAbA,4BAAa;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IACtEC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAChIC,UAAU;eAAVA,sBAAU;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,yBAAyB;eAAzBA,qCAAyB;;IACjHC,WAAW;eAAXA,wBAAW;;IAAEC,qBAAqB;eAArBA,kCAAqB;;IAAEC,uBAAuB;eAAvBA,oCAAuB;;IAAEC,6BAA6B;eAA7BA,0CAA6B;;IAAEC,0BAA0B;eAA1BA,uCAA0B;;IACtHC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAChIC,aAAa;eAAbA,4BAAa;;IAAEC,uBAAuB;eAAvBA,sCAAuB;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAAEC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,4BAA4B;eAA5BA,2CAA4B;;IAChIC,yBAAyB;eAAzBA,gCAAyB;;IAAEC,gCAAgC;eAAhCA,uCAAgC;;IAAEC,cAAc;eAAdA,qBAAc;;IAAEC,qBAAqB;eAArBA,4BAAqB;;;wBAPzC;+BACqB;+BAC0D;4BACf;6BACK;+BACU;+BACA;uBAC9B"}
@@ -26,7 +26,7 @@ function useFocusFirstElement(open, modalType) {
26
26
  } else {
27
27
  var _dialogRef_current;
28
28
  (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150
29
- if (process.env.NODE_ENV !== 'production') {
29
+ if (process.env.NODE_ENV === 'development') {
30
30
  // eslint-disable-next-line no-console
31
31
  console.warn(`@fluentui/react-dialog [useFocusFirstElement]:
32
32
  A Dialog should have at least one focusable element inside DialogSurface.
@@ -1 +1 @@
1
- {"version":3,"sources":["useFocusFirstElement.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Focus first element on content when dialog is opened,\n */ export function useFocusFirstElement(open, modalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef(null);\n React.useEffect(()=>{\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n var _dialogRef_current;\n (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`@fluentui/react-dialog [useFocusFirstElement]:\nA Dialog should have at least one focusable element inside DialogSurface.\nPlease add at least a close button either on \\`DialogTitle\\` action slot or inside \\`DialogActions\\``);\n }\n }\n }, [\n findFirstFocusable,\n open,\n modalType,\n targetDocument\n ]);\n return dialogRef;\n}\n"],"names":["useFocusFirstElement","open","modalType","findFirstFocusable","useFocusFinders","targetDocument","useFluent_unstable","dialogRef","React","useRef","useEffect","element","current","focus","_dialogRef_current","process","env","NODE_ENV","console","warn"],"mappings":";;;;+BAKoBA;;;eAAAA;;;;iEALG;8BACS;qCACG;AAGxB,SAASA,qBAAqBC,IAAI,EAAEC,SAAS;IACpD,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,IAAAA,6BAAe;IAC9C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAkB;IAC7C,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/BD,OAAME,SAAS,CAAC;QACZ,IAAI,CAACT,MAAM;YACP;QACJ;QACA,MAAMU,UAAUJ,UAAUK,OAAO,IAAIT,mBAAmBI,UAAUK,OAAO;QACzE,IAAID,SAAS;YACTA,QAAQE,KAAK;QACjB,OAAO;YACH,IAAIC;YACHA,CAAAA,qBAAqBP,UAAUK,OAAO,AAAD,MAAO,QAAQE,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBD,KAAK,IAAI,qDAAqD;YAC/K,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACvC,sCAAsC;gBACtCC,QAAQC,IAAI,CAAC,CAAC;;oGAEsE,CAAC;YACzF;QACJ;IACJ,GAAG;QACChB;QACAF;QACAC;QACAG;KACH;IACD,OAAOE;AACX"}
1
+ {"version":3,"sources":["useFocusFirstElement.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Focus first element on content when dialog is opened,\n */ export function useFocusFirstElement(open, modalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef(null);\n React.useEffect(()=>{\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n var _dialogRef_current;\n (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(`@fluentui/react-dialog [useFocusFirstElement]:\nA Dialog should have at least one focusable element inside DialogSurface.\nPlease add at least a close button either on \\`DialogTitle\\` action slot or inside \\`DialogActions\\``);\n }\n }\n }, [\n findFirstFocusable,\n open,\n modalType,\n targetDocument\n ]);\n return dialogRef;\n}\n"],"names":["useFocusFirstElement","open","modalType","findFirstFocusable","useFocusFinders","targetDocument","useFluent_unstable","dialogRef","React","useRef","useEffect","element","current","focus","_dialogRef_current","process","env","NODE_ENV","console","warn"],"mappings":";;;;+BAKoBA;;;eAAAA;;;;iEALG;8BACS;qCACG;AAGxB,SAASA,qBAAqBC,IAAI,EAAEC,SAAS;IACpD,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,IAAAA,6BAAe;IAC9C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAkB;IAC7C,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/BD,OAAME,SAAS,CAAC;QACZ,IAAI,CAACT,MAAM;YACP;QACJ;QACA,MAAMU,UAAUJ,UAAUK,OAAO,IAAIT,mBAAmBI,UAAUK,OAAO;QACzE,IAAID,SAAS;YACTA,QAAQE,KAAK;QACjB,OAAO;YACH,IAAIC;YACHA,CAAAA,qBAAqBP,UAAUK,OAAO,AAAD,MAAO,QAAQE,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBD,KAAK,IAAI,qDAAqD;YAC/K,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;gBACxC,sCAAsC;gBACtCC,QAAQC,IAAI,CAAC,CAAC;;oGAEsE,CAAC;YACzF;QACJ;IACJ,GAAG;QACChB;QACAF;QACAC;QACAG;KACH;IACD,OAAOE;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.6.5",
3
+ "version": "9.7.1",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -37,15 +37,15 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@fluentui/react-utilities": "^9.13.3",
40
- "@fluentui/react-jsx-runtime": "^9.0.8",
40
+ "@fluentui/react-jsx-runtime": "^9.0.10",
41
41
  "@fluentui/keyboard-keys": "^9.0.4",
42
42
  "@fluentui/react-context-selector": "^9.1.34",
43
- "@fluentui/react-shared-contexts": "^9.7.3",
43
+ "@fluentui/react-shared-contexts": "^9.8.1",
44
44
  "@fluentui/react-aria": "^9.3.36",
45
45
  "@fluentui/react-icons": "^2.0.207",
46
- "@fluentui/react-tabster": "^9.12.9",
46
+ "@fluentui/react-tabster": "^9.12.11",
47
47
  "@fluentui/react-theme": "^9.1.12",
48
- "@fluentui/react-portal": "^9.3.14",
48
+ "@fluentui/react-portal": "^9.3.16",
49
49
  "@griffel/react": "^1.5.14",
50
50
  "@swc/helpers": "^0.5.1"
51
51
  },