@fluentui/react-dialog 9.5.15 → 9.5.17

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,84 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 03 Jul 2023 13:32:38 GMT",
5
+ "date": "Thu, 20 Jul 2023 18:24:19 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.5.17",
7
+ "version": "9.5.17",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "olfedias@microsoft.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "5a4b16715e8e929f11d8113f710e578ca73acaa6",
14
+ "comment": "chore: migrate to monosize"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "bernardo.sunderhus@gmail.com",
20
+ "package": "@fluentui/react-dialog",
21
+ "commit": "21d69b7169d7c3e8be35085d8b42c0663828b8ae",
22
+ "comment": "bugfix: moves handleBackdropClick from defaultProps to an override "
23
+ },
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-dialog",
27
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.12",
28
+ "commit": "5a4b16715e8e929f11d8113f710e578ca73acaa6"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-dialog",
33
+ "comment": "Bump @fluentui/react-aria to v9.3.27",
34
+ "commit": "5a4b16715e8e929f11d8113f710e578ca73acaa6"
35
+ },
36
+ {
37
+ "author": "beachball",
38
+ "package": "@fluentui/react-dialog",
39
+ "comment": "Bump @fluentui/react-portal to v9.3.2",
40
+ "commit": "5a4b16715e8e929f11d8113f710e578ca73acaa6"
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ {
46
+ "date": "Thu, 13 Jul 2023 21:25:40 GMT",
47
+ "tag": "@fluentui/react-dialog_v9.5.16",
48
+ "version": "9.5.16",
49
+ "comments": {
50
+ "none": [
51
+ {
52
+ "author": "martinhochel@microsoft.com",
53
+ "package": "@fluentui/react-dialog",
54
+ "commit": "8a9e1018f2abb2c7608c49d32acf44e93c43cba6",
55
+ "comment": "chore: update devDependencies to use * for inner workspace dependencies"
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "date": "Tue, 11 Jul 2023 18:46:36 GMT",
62
+ "tag": "@fluentui/react-dialog_v9.5.16",
63
+ "version": "9.5.16",
64
+ "comments": {
65
+ "patch": [
66
+ {
67
+ "author": "beachball",
68
+ "package": "@fluentui/react-dialog",
69
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.11",
70
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
71
+ },
72
+ {
73
+ "author": "beachball",
74
+ "package": "@fluentui/react-dialog",
75
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0",
76
+ "commit": "f958e7e175264e289a6ecdc5b108e826f6b34e74"
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ "date": "Mon, 03 Jul 2023 13:34:28 GMT",
6
83
  "tag": "@fluentui/react-dialog_v9.5.15",
7
84
  "version": "9.5.15",
8
85
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Mon, 03 Jul 2023 13:32:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 20 Jul 2023 18:24:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.17)
8
+
9
+ Thu, 20 Jul 2023 18:24:19 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.16..@fluentui/react-dialog_v9.5.17)
11
+
12
+ ### Patches
13
+
14
+ - bugfix: moves handleBackdropClick from defaultProps to an override ([PR #28579](https://github.com/microsoft/fluentui/pull/28579) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.12 ([PR #26826](https://github.com/microsoft/fluentui/pull/26826) by beachball)
16
+ - Bump @fluentui/react-aria to v9.3.27 ([PR #26826](https://github.com/microsoft/fluentui/pull/26826) by beachball)
17
+ - Bump @fluentui/react-portal to v9.3.2 ([PR #26826](https://github.com/microsoft/fluentui/pull/26826) by beachball)
18
+
19
+ ## [9.5.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.16)
20
+
21
+ Tue, 11 Jul 2023 18:46:36 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.15..@fluentui/react-dialog_v9.5.16)
23
+
24
+ ### Patches
25
+
26
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.11 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
27
+ - Bump @fluentui/react-conformance-griffel to v9.0.0 ([PR #28491](https://github.com/microsoft/fluentui/pull/28491) by beachball)
28
+
7
29
  ## [9.5.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.15)
8
30
 
9
- Mon, 03 Jul 2023 13:32:38 GMT
31
+ Mon, 03 Jul 2023 13:34:28 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.14..@fluentui/react-dialog_v9.5.15)
11
33
 
12
34
  ### Patches
@@ -11,7 +11,6 @@ import { Escape } from '@fluentui/keyboard-keys';
11
11
  * @param props - props from this instance of DialogSurface
12
12
  * @param ref - reference to root HTMLElement of DialogSurface
13
13
  */ export const useDialogSurface_unstable = (props, ref)=>{
14
- const { backdrop , as } = props;
15
14
  const modalType = useDialogContext_unstable((ctx)=>ctx.modalType);
16
15
  const modalAttributes = useDialogContext_unstable((ctx)=>ctx.modalAttributes);
17
16
  const dialogRef = useDialogContext_unstable((ctx)=>ctx.dialogRef);
@@ -45,19 +44,23 @@ import { Escape } from '@fluentui/keyboard-keys';
45
44
  event.stopPropagation();
46
45
  }
47
46
  });
47
+ const backdrop = resolveShorthand(props.backdrop, {
48
+ required: open && modalType !== 'non-modal',
49
+ defaultProps: {
50
+ 'aria-hidden': 'true'
51
+ }
52
+ });
53
+ if (backdrop) {
54
+ backdrop.onClick = handledBackdropClick;
55
+ }
56
+ var _props_as;
48
57
  return {
49
58
  components: {
50
59
  backdrop: 'div',
51
60
  root: 'div'
52
61
  },
53
- backdrop: resolveShorthand(backdrop, {
54
- required: open && modalType !== 'non-modal',
55
- defaultProps: {
56
- 'aria-hidden': 'true',
57
- onClick: handledBackdropClick
58
- }
59
- }),
60
- root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {
62
+ backdrop,
63
+ root: getNativeElementProps((_props_as = props.as) !== null && _props_as !== void 0 ? _props_as : 'div', {
61
64
  tabIndex: -1,
62
65
  'aria-modal': modalType !== 'non-modal',
63
66
  role: modalType === 'alert' ? 'alertdialog' : 'dialog',
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const { backdrop, as } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n return {\n components: {\n backdrop: 'div',\n root: 'div',\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick,\n },\n }),\n root: getNativeElementProps(as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"names":["React","getNativeElementProps","resolveShorthand","useEventCallback","useMergedRefs","isResolvedShorthand","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","backdrop","as","modalType","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","stopPropagation","components","root","required","defaultProps","tabIndex","role","undefined"],"mappings":"AAAA,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AAME,kBAAkB,IAAI;YACvDN,kBAAkB;gBAChBI;gBACAL,MAAM,KAAK;gBACXQ,MAAM;YACR;YACA,qFAAqF;YACrF,gDAAgD;YAChDH,MAAMO,eAAe;QACvB,CAAC;IACH;IAEA,OAAO;QACLC,YAAY;YACVnB,UAAU;YACVoB,MAAM;QACR;QACApB,UAAUT,iBAAiBS,UAAU;YACnCqB,UAAUf,QAAQJ,cAAc;YAChCoB,cAAc;gBACZ,eAAe;gBACfV,SAASF;YACX;QACF;QACAU,MAAM9B,sBAAsBW,eAAAA,gBAAAA,KAAM,KAAK,EAAE;YACvCsB,UAAU,CAAC;YACX,cAAcrB,cAAc;YAC5BsB,MAAMtB,cAAc,UAAU,gBAAgB,QAAQ;YACtD,mBAAmBJ,KAAK,CAAC,aAAa,GAAG2B,YAAYjB,aAAa;YAClE,GAAGV,KAAK;YACR,GAAGM,eAAe;YAClBY,WAAWD;YACXhB,KAAKN,cAAcM,KAAKM;QAC1B;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getNativeElementProps,\n resolveShorthand,\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const backdrop = resolveShorthand(props.backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n });\n\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n\n return {\n components: {\n backdrop: 'div',\n root: 'div',\n },\n backdrop,\n root: getNativeElementProps(props.as ?? 'div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef),\n }),\n };\n};\n"],"names":["React","getNativeElementProps","resolveShorthand","useEventCallback","useMergedRefs","isResolvedShorthand","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","modalType","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","backdrop","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","stopPropagation","required","defaultProps","components","root","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,kBAAkB;gBAChBI;gBACAL,MAAM,KAAK;gBACXS,MAAM;YACR;YACA,qFAAqF;YACrF,gDAAgD;YAChDJ,MAAMQ,eAAe;QACvB,CAAC;IACH;IAEA,MAAMP,WAAWnB,iBAAiBO,MAAMY,QAAQ,EAAE;QAChDQ,UAAUd,QAAQJ,cAAc;QAChCmB,cAAc;YACZ,eAAe;QACjB;IACF;IAEA,IAAIT,UAAU;QACZA,SAASC,OAAO,GAAGH;IACrB,CAAC;QAQ6BV;IAN9B,OAAO;QACLsB,YAAY;YACVV,UAAU;YACVW,MAAM;QACR;QACAX;QACAW,MAAM/B,sBAAsBQ,CAAAA,YAAAA,MAAMwB,EAAE,cAARxB,uBAAAA,YAAY,KAAK,EAAE;YAC7CyB,UAAU,CAAC;YACX,cAAcvB,cAAc;YAC5BwB,MAAMxB,cAAc,UAAU,gBAAgB,QAAQ;YACtD,mBAAmBF,KAAK,CAAC,aAAa,GAAG2B,YAAYnB,aAAa;YAClE,GAAGR,KAAK;YACR,GAAGI,eAAe;YAClBa,WAAWD;YACXf,KAAKN,cAAcM,KAAKI;QAC1B;IACF;AACF,EAAE"}
@@ -12,7 +12,6 @@ const _reactUtilities = require("@fluentui/react-utilities");
12
12
  const _contexts = require("../../contexts");
13
13
  const _keyboardKeys = require("@fluentui/keyboard-keys");
14
14
  const useDialogSurface_unstable = (props, ref)=>{
15
- const { backdrop , as } = props;
16
15
  const modalType = (0, _contexts.useDialogContext_unstable)((ctx)=>ctx.modalType);
17
16
  const modalAttributes = (0, _contexts.useDialogContext_unstable)((ctx)=>ctx.modalAttributes);
18
17
  const dialogRef = (0, _contexts.useDialogContext_unstable)((ctx)=>ctx.dialogRef);
@@ -46,19 +45,23 @@ const useDialogSurface_unstable = (props, ref)=>{
46
45
  event.stopPropagation();
47
46
  }
48
47
  });
48
+ const backdrop = (0, _reactUtilities.resolveShorthand)(props.backdrop, {
49
+ required: open && modalType !== 'non-modal',
50
+ defaultProps: {
51
+ 'aria-hidden': 'true'
52
+ }
53
+ });
54
+ if (backdrop) {
55
+ backdrop.onClick = handledBackdropClick;
56
+ }
57
+ var _props_as;
49
58
  return {
50
59
  components: {
51
60
  backdrop: 'div',
52
61
  root: 'div'
53
62
  },
54
- backdrop: (0, _reactUtilities.resolveShorthand)(backdrop, {
55
- required: open && modalType !== 'non-modal',
56
- defaultProps: {
57
- 'aria-hidden': 'true',
58
- onClick: handledBackdropClick
59
- }
60
- }),
61
- root: (0, _reactUtilities.getNativeElementProps)(as !== null && as !== void 0 ? as : 'div', {
63
+ backdrop,
64
+ root: (0, _reactUtilities.getNativeElementProps)((_props_as = props.as) !== null && _props_as !== void 0 ? _props_as : 'div', {
62
65
  tabIndex: -1,
63
66
  'aria-modal': modalType !== 'non-modal',
64
67
  role: modalType === 'alert' ? 'alertdialog' : 'dialog',
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs, isResolvedShorthand } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */ export const useDialogSurface_unstable = (props, ref)=>{\n const { backdrop , as } = props;\n const modalType = useDialogContext_unstable((ctx)=>ctx.modalType);\n const modalAttributes = useDialogContext_unstable((ctx)=>ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable((ctx)=>ctx.dialogRef);\n const open = useDialogContext_unstable((ctx)=>ctx.open);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable((ctx)=>ctx.dialogTitleId);\n const handledBackdropClick = useEventCallback((event)=>{\n if (isResolvedShorthand(props.backdrop)) {\n var _props_backdrop, _props_backdrop_onClick;\n (_props_backdrop_onClick = (_props_backdrop = props.backdrop).onClick) === null || _props_backdrop_onClick === void 0 ? void 0 : _props_backdrop_onClick.call(_props_backdrop, event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick'\n });\n }\n });\n const handleKeyDown = useEventCallback((event)=>{\n var _props_onKeyDown;\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, event);\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown'\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n return {\n components: {\n backdrop: 'div',\n root: 'div'\n },\n backdrop: resolveShorthand(backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n onClick: handledBackdropClick\n }\n }),\n root: getNativeElementProps(as !== null && as !== void 0 ? as : 'div', {\n tabIndex: -1,\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef)\n })\n };\n};\n"],"names":["useDialogSurface_unstable","props","ref","backdrop","as","modalType","useDialogContext_unstable","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","useEventCallback","event","isResolvedShorthand","_props_backdrop","_props_backdrop_onClick","onClick","call","isDefaultPrevented","type","handleKeyDown","_props_onKeyDown","onKeyDown","key","Escape","stopPropagation","components","root","resolveShorthand","required","defaultProps","getNativeElementProps","tabIndex","role","undefined","useMergedRefs"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACuF;0BACpE;8BACnB;AASZ,MAAMA,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IAAI;YACrDX,kBAAkB;gBACdK;gBACAN,MAAM,KAAK;gBACXa,MAAM;YACV;YACA,qFAAqF;YACrF,gDAAgD;YAChDP,MAAMa,eAAe;QACzB,CAAC;IACL;IACA,OAAO;QACHC,YAAY;YACR3B,UAAU;YACV4B,MAAM;QACV;QACA5B,UAAU6B,IAAAA,gCAAgB,EAAC7B,UAAU;YACjC8B,UAAUvB,QAAQL,cAAc;YAChC6B,cAAc;gBACV,eAAe;gBACfd,SAASN;YACb;QACJ;QACAiB,MAAMI,IAAAA,qCAAqB,EAAC/B,OAAO,IAAI,IAAIA,OAAO,KAAK,IAAIA,KAAK,KAAK,EAAE;YACnEgC,UAAU,CAAC;YACX,cAAc/B,cAAc;YAC5BgC,MAAMhC,cAAc,UAAU,gBAAgB,QAAQ;YACtD,mBAAmBJ,KAAK,CAAC,aAAa,GAAGqC,YAAY1B,aAAa;YAClE,GAAGX,KAAK;YACR,GAAGO,eAAe;YAClBkB,WAAWF;YACXtB,KAAKqC,IAAAA,6BAAa,EAACrC,KAAKO;QAC5B;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDialogSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs, isResolvedShorthand } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */ export const useDialogSurface_unstable = (props, ref)=>{\n const modalType = useDialogContext_unstable((ctx)=>ctx.modalType);\n const modalAttributes = useDialogContext_unstable((ctx)=>ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable((ctx)=>ctx.dialogRef);\n const open = useDialogContext_unstable((ctx)=>ctx.open);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable((ctx)=>ctx.dialogTitleId);\n const handledBackdropClick = useEventCallback((event)=>{\n if (isResolvedShorthand(props.backdrop)) {\n var _props_backdrop, _props_backdrop_onClick;\n (_props_backdrop_onClick = (_props_backdrop = props.backdrop).onClick) === null || _props_backdrop_onClick === void 0 ? void 0 : _props_backdrop_onClick.call(_props_backdrop, event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick'\n });\n }\n });\n const handleKeyDown = useEventCallback((event)=>{\n var _props_onKeyDown;\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, event);\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown'\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n const backdrop = resolveShorthand(props.backdrop, {\n required: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true'\n }\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n var _props_as;\n return {\n components: {\n backdrop: 'div',\n root: 'div'\n },\n backdrop,\n root: getNativeElementProps((_props_as = props.as) !== null && _props_as !== void 0 ? _props_as : 'div', {\n tabIndex: -1,\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n ref: useMergedRefs(ref, dialogRef)\n })\n };\n};\n"],"names":["useDialogSurface_unstable","props","ref","modalType","useDialogContext_unstable","ctx","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","useEventCallback","event","isResolvedShorthand","backdrop","_props_backdrop","_props_backdrop_onClick","onClick","call","isDefaultPrevented","type","handleKeyDown","_props_onKeyDown","onKeyDown","key","Escape","stopPropagation","resolveShorthand","required","defaultProps","_props_as","components","root","getNativeElementProps","as","tabIndex","role","undefined","useMergedRefs"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACuF;0BACpE;8BACnB;AASZ,MAAMA,4BAA4B,CAACC,OAAOC,MAAM;IACvD,MAAMC,YAAYC,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIF,SAAS;IAChE,MAAMG,kBAAkBF,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIC,eAAe;IAC5E,MAAMC,YAAYH,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIE,SAAS;IAChE,MAAMC,OAAOJ,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIG,IAAI;IACtD,MAAMC,oBAAoBL,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAII,iBAAiB;IAChF,MAAMC,gBAAgBN,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIM,aAAa;IACxE,MAAMC,uBAAuBC,IAAAA,gCAAgB,EAAC,CAACC,QAAQ;QACnD,IAAIC,IAAAA,mCAAmB,EAACd,MAAMe,QAAQ,GAAG;YACrC,IAAIC,iBAAiBC;YACpBA,CAAAA,0BAA0B,AAACD,CAAAA,kBAAkBhB,MAAMe,QAAQ,AAAD,EAAGG,OAAO,AAAD,MAAO,IAAI,IAAID,4BAA4B,KAAK,IAAI,KAAK,IAAIA,wBAAwBE,IAAI,CAACH,iBAAiBH,MAAM;QACzL,CAAC;QACD,IAAIX,cAAc,WAAW,CAACW,MAAMO,kBAAkB,IAAI;YACtDZ,kBAAkB;gBACdK;gBACAN,MAAM,KAAK;gBACXc,MAAM;YACV;QACJ,CAAC;IACL;IACA,MAAMC,gBAAgBV,IAAAA,gCAAgB,EAAC,CAACC,QAAQ;QAC5C,IAAIU;QACHA,CAAAA,mBAAmBvB,MAAMwB,SAAS,AAAD,MAAO,IAAI,IAAID,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBJ,IAAI,CAACnB,OAAOa,MAAM;QAC3H,IAAIA,MAAMY,GAAG,KAAKC,oBAAM,IAAI,CAACb,MAAMO,kBAAkB,IAAI;YACrDZ,kBAAkB;gBACdK;gBACAN,MAAM,KAAK;gBACXc,MAAM;YACV;YACA,qFAAqF;YACrF,gDAAgD;YAChDR,MAAMc,eAAe;QACzB,CAAC;IACL;IACA,MAAMZ,WAAWa,IAAAA,gCAAgB,EAAC5B,MAAMe,QAAQ,EAAE;QAC9Cc,UAAUtB,QAAQL,cAAc;QAChC4B,cAAc;YACV,eAAe;QACnB;IACJ;IACA,IAAIf,UAAU;QACVA,SAASG,OAAO,GAAGP;IACvB,CAAC;IACD,IAAIoB;IACJ,OAAO;QACHC,YAAY;YACRjB,UAAU;YACVkB,MAAM;QACV;QACAlB;QACAkB,MAAMC,IAAAA,qCAAqB,EAAC,AAACH,CAAAA,YAAY/B,MAAMmC,EAAE,AAAD,MAAO,IAAI,IAAIJ,cAAc,KAAK,IAAIA,YAAY,KAAK,EAAE;YACrGK,UAAU,CAAC;YACX,cAAclC,cAAc;YAC5BmC,MAAMnC,cAAc,UAAU,gBAAgB,QAAQ;YACtD,mBAAmBF,KAAK,CAAC,aAAa,GAAGsC,YAAY7B,aAAa;YAClE,GAAGT,KAAK;YACR,GAAGK,eAAe;YAClBmB,WAAWF;YACXrB,KAAKsC,IAAAA,6BAAa,EAACtC,KAAKK;QAC5B;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.5.15",
3
+ "version": "9.5.17",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -15,7 +15,7 @@
15
15
  "build": "just-scripts build",
16
16
  "clean": "just-scripts clean",
17
17
  "code-style": "just-scripts code-style",
18
- "bundle-size": "bundle-size measure",
18
+ "bundle-size": "monosize measure",
19
19
  "just": "just-scripts",
20
20
  "lint": "just-scripts lint",
21
21
  "start": "yarn storybook",
@@ -30,22 +30,22 @@
30
30
  "devDependencies": {
31
31
  "@fluentui/eslint-plugin": "*",
32
32
  "@fluentui/react-conformance": "*",
33
- "@fluentui/react-conformance-griffel": "9.0.0-beta.23",
33
+ "@fluentui/react-conformance-griffel": "*",
34
34
  "@fluentui/scripts-api-extractor": "*",
35
35
  "@fluentui/scripts-cypress": "*",
36
36
  "@fluentui/scripts-tasks": "*"
37
37
  },
38
38
  "dependencies": {
39
39
  "@fluentui/react-utilities": "^9.10.1",
40
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.10",
40
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.12",
41
41
  "@fluentui/keyboard-keys": "^9.0.3",
42
42
  "@fluentui/react-context-selector": "^9.1.26",
43
43
  "@fluentui/react-shared-contexts": "^9.6.0",
44
- "@fluentui/react-aria": "^9.3.26",
44
+ "@fluentui/react-aria": "^9.3.27",
45
45
  "@fluentui/react-icons": "^2.0.203",
46
46
  "@fluentui/react-tabster": "^9.10.0",
47
47
  "@fluentui/react-theme": "^9.1.9",
48
- "@fluentui/react-portal": "^9.3.1",
48
+ "@fluentui/react-portal": "^9.3.2",
49
49
  "@griffel/react": "^1.5.7",
50
50
  "@swc/helpers": "^0.4.14"
51
51
  },