@fluentui/react-dialog 9.6.4 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +63 -1
- package/CHANGELOG.md +28 -2
- package/dist/index.d.ts +12 -2
- package/lib/components/Dialog/renderDialog.js +1 -1
- package/lib/components/DialogActions/renderDialogActions.js +1 -1
- package/lib/components/DialogBody/renderDialogBody.js +1 -1
- package/lib/components/DialogContent/renderDialogContent.js +1 -1
- package/lib/components/DialogSurface/renderDialogSurface.js +1 -1
- package/lib/components/DialogTitle/renderDialogTitle.js +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/useFocusFirstElement.js +1 -1
- package/lib/utils/useFocusFirstElement.js.map +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.js +1 -1
- package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.js +1 -1
- package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.js +1 -1
- package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
- package/lib-commonjs/components/DialogContent/renderDialogContent.js +1 -1
- package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js +1 -1
- package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js +1 -1
- package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
- package/lib-commonjs/index.js +13 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/useFocusFirstElement.js +1 -1
- package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,69 @@
|
|
|
2
2
|
"name": "@fluentui/react-dialog",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 20 Sep 2023 14:13:56 GMT",
|
|
6
|
+
"tag": "@fluentui/react-dialog_v9.7.0",
|
|
7
|
+
"version": "9.7.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-dialog",
|
|
13
|
+
"commit": "da657356c4f4b0c3fbaa9076ef9d0dbf4e603523",
|
|
14
|
+
"comment": "feat: exports contexts"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-dialog",
|
|
19
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.9",
|
|
20
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-dialog",
|
|
25
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.8.0",
|
|
26
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-dialog",
|
|
31
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.10",
|
|
32
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-dialog",
|
|
37
|
+
"comment": "Bump @fluentui/react-portal to v9.3.15",
|
|
38
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"patch": [
|
|
42
|
+
{
|
|
43
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
44
|
+
"package": "@fluentui/react-dialog",
|
|
45
|
+
"commit": "b824db72aac6f6b849aa0e77a32a11b8c5d8c3db",
|
|
46
|
+
"comment": "chore: useFocusFirstElement warns only in development"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"date": "Thu, 14 Sep 2023 16:44:47 GMT",
|
|
53
|
+
"tag": "@fluentui/react-dialog_v9.6.5",
|
|
54
|
+
"version": "9.6.5",
|
|
55
|
+
"comments": {
|
|
56
|
+
"patch": [
|
|
57
|
+
{
|
|
58
|
+
"author": "beachball",
|
|
59
|
+
"package": "@fluentui/react-dialog",
|
|
60
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.8",
|
|
61
|
+
"commit": "bad33fa7f241bc772b5bc4c6ee624d6ff6b4a473"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"date": "Tue, 12 Sep 2023 08:51:34 GMT",
|
|
6
68
|
"tag": "@fluentui/react-dialog_v9.6.4",
|
|
7
69
|
"version": "9.6.4",
|
|
8
70
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-dialog
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 20 Sep 2023 14:13:56 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.0)
|
|
8
|
+
|
|
9
|
+
Wed, 20 Sep 2023 14:13:56 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.6.5..@fluentui/react-dialog_v9.7.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: exports contexts ([PR #29160](https://github.com/microsoft/fluentui/pull/29160) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.9 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
16
|
+
- Bump @fluentui/react-shared-contexts to v9.8.0 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.12.10 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
18
|
+
- Bump @fluentui/react-portal to v9.3.15 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- chore: useFocusFirstElement warns only in development ([PR #29190](https://github.com/microsoft/fluentui/pull/29190) by bernardo.sunderhus@gmail.com)
|
|
23
|
+
|
|
24
|
+
## [9.6.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.6.5)
|
|
25
|
+
|
|
26
|
+
Thu, 14 Sep 2023 16:44:47 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.6.4..@fluentui/react-dialog_v9.6.5)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.8 ([PR #29145](https://github.com/microsoft/fluentui/pull/29145) by beachball)
|
|
32
|
+
|
|
7
33
|
## [9.6.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.6.4)
|
|
8
34
|
|
|
9
|
-
Tue, 12 Sep 2023 08:
|
|
35
|
+
Tue, 12 Sep 2023 08:51:34 GMT
|
|
10
36
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.6.3..@fluentui/react-dialog_v9.6.4)
|
|
11
37
|
|
|
12
38
|
### 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
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { DialogProvider, DialogSurfaceProvider } from '../../contexts';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of Dialog
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DialogActions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DialogBody
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DialogContent
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
import { DialogSurfaceProvider } from '../../contexts';
|
|
4
4
|
import { Portal } from '@fluentui/react-portal';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DialogTitle
|
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
|
|
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
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialog.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialog.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { DialogProvider, DialogSurfaceProvider } from '../../contexts';\n/**\n * Render the final JSX of Dialog\n */ export const renderDialog_unstable = (state, contextValues)=>{\n const { content, trigger } = state;\n return /*#__PURE__*/ _jsx(DialogProvider, {\n value: contextValues.dialog,\n children: /*#__PURE__*/ _jsxs(DialogSurfaceProvider, {\n value: contextValues.dialogSurface,\n children: [\n trigger,\n content\n ]\n })\n });\n};\n"],"names":["renderDialog_unstable","state","contextValues","content","trigger","_jsx","DialogProvider","value","dialog","children","_jsxs","DialogSurfaceProvider","dialogSurface"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJ4B;0BACS;AAG3C,MAAMA,wBAAwB,CAACC,OAAOC;IAC7C,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGH;IAC7B,OAAO,WAAW,GAAGI,IAAAA,eAAI,EAACC,wBAAc,EAAE;QACtCC,OAAOL,cAAcM,MAAM;QAC3BC,UAAU,WAAW,GAAGC,IAAAA,gBAAK,EAACC,+BAAqB,EAAE;YACjDJ,OAAOL,cAAcU,aAAa;YAClCH,UAAU;gBACNL;gBACAD;aACH;QACL;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialogActions.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialogActions.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of DialogActions\n */ export const renderDialogActions_unstable = (state)=>{\n assertSlots(state);\n // TODO Add additional slots in the appropriate place\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderDialogActions_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,+BAA+B,CAACC;IAC7CC,IAAAA,2BAAW,EAACD;IACZ,qDAAqD;IACrD,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialogBody.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialogBody.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of DialogBody\n */ export const renderDialogBody_unstable = (state)=>{\n assertSlots(state);\n // TODO Add additional slots in the appropriate place\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderDialogBody_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,4BAA4B,CAACC;IAC1CC,IAAAA,2BAAW,EAACD;IACZ,qDAAqD;IACrD,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialogContent.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialogContent.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of DialogContent\n */ export const renderDialogContent_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.root, {});\n};\n"],"names":["renderDialogContent_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJa;gCACF;AAGjB,MAAMA,+BAA+B,CAACC;IAC7CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialogSurface.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialogSurface.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n/**\n * Render the final JSX of DialogSurface\n */ export const renderDialogSurface_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(Portal, {\n mountNode: state.mountNode,\n children: [\n state.backdrop && /*#__PURE__*/ _jsx(state.backdrop, {}),\n /*#__PURE__*/ _jsx(DialogSurfaceProvider, {\n value: contextValues.dialogSurface,\n children: /*#__PURE__*/ _jsx(state.root, {})\n })\n ]\n });\n};\n"],"names":["renderDialogSurface_unstable","state","contextValues","assertSlots","_jsxs","Portal","mountNode","children","backdrop","_jsx","DialogSurfaceProvider","value","dialogSurface","root"],"mappings":";;;;+BAMiBA;;;eAAAA;;;4BAN4B;gCACjB;0BACU;6BACf;AAGZ,MAAMA,+BAA+B,CAACC,OAAOC;IACpDC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,gBAAK,EAACC,mBAAM,EAAE;QAC/BC,WAAWL,MAAMK,SAAS;QAC1BC,UAAU;YACNN,MAAMO,QAAQ,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACR,MAAMO,QAAQ,EAAE,CAAC;YACtD,WAAW,GAAGC,IAAAA,eAAI,EAACC,+BAAqB,EAAE;gBACtCC,OAAOT,cAAcU,aAAa;gBAClCL,UAAU,WAAW,GAAGE,IAAAA,eAAI,EAACR,MAAMY,IAAI,EAAE,CAAC;YAC9C;SACH;IACL;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDialogTitle.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["renderDialogTitle.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of DialogTitle\n */ export const renderDialogTitle_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(state.root, {\n children: state.root.children\n }),\n state.action && /*#__PURE__*/ _jsx(state.action, {})\n ]\n });\n};\n"],"names":["renderDialogTitle_unstable","state","assertSlots","_jsxs","_Fragment","children","_jsx","root","action"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJmD;gCACxC;AAGjB,MAAMA,6BAA6B,CAACC;IAC3CC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACN,WAAW,GAAGC,IAAAA,eAAI,EAACL,MAAMM,IAAI,EAAE;gBAC3BF,UAAUJ,MAAMM,IAAI,CAACF,QAAQ;YACjC;YACAJ,MAAMO,MAAM,IAAI,WAAW,GAAGF,IAAAA,eAAI,EAACL,MAAMO,MAAM,EAAE,CAAC;SACrD;IACL;AACJ"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -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;;;
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "9.7.0",
|
|
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.
|
|
40
|
+
"@fluentui/react-jsx-runtime": "^9.0.9",
|
|
41
41
|
"@fluentui/keyboard-keys": "^9.0.4",
|
|
42
42
|
"@fluentui/react-context-selector": "^9.1.34",
|
|
43
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
43
|
+
"@fluentui/react-shared-contexts": "^9.8.0",
|
|
44
44
|
"@fluentui/react-aria": "^9.3.36",
|
|
45
45
|
"@fluentui/react-icons": "^2.0.207",
|
|
46
|
-
"@fluentui/react-tabster": "^9.12.
|
|
46
|
+
"@fluentui/react-tabster": "^9.12.10",
|
|
47
47
|
"@fluentui/react-theme": "^9.1.12",
|
|
48
|
-
"@fluentui/react-portal": "^9.3.
|
|
48
|
+
"@fluentui/react-portal": "^9.3.15",
|
|
49
49
|
"@griffel/react": "^1.5.14",
|
|
50
50
|
"@swc/helpers": "^0.5.1"
|
|
51
51
|
},
|