@fluentui/react-dialog 9.1.16 → 9.3.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.
Files changed (134) hide show
  1. package/CHANGELOG.json +105 -1
  2. package/CHANGELOG.md +35 -2
  3. package/dist/index.d.ts +8 -0
  4. package/lib/components/Dialog/Dialog.js.map +1 -1
  5. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  6. package/lib/components/Dialog/renderDialog.js.map +1 -1
  7. package/lib/components/Dialog/useDialog.js +3 -1
  8. package/lib/components/Dialog/useDialog.js.map +1 -1
  9. package/lib/components/Dialog/useDialogContextValues.js +2 -0
  10. package/lib/components/Dialog/useDialogContextValues.js.map +1 -1
  11. package/lib/components/DialogActions/DialogActions.js +5 -0
  12. package/lib/components/DialogActions/DialogActions.js.map +1 -1
  13. package/lib/components/DialogActions/renderDialogActions.js.map +1 -1
  14. package/lib/components/DialogActions/useDialogActions.js.map +1 -1
  15. package/lib/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  16. package/lib/components/DialogBody/DialogBody.js +5 -0
  17. package/lib/components/DialogBody/DialogBody.js.map +1 -1
  18. package/lib/components/DialogBody/renderDialogBody.js.map +1 -1
  19. package/lib/components/DialogBody/useDialogBody.js.map +1 -1
  20. package/lib/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  21. package/lib/components/DialogContent/DialogContent.js +5 -0
  22. package/lib/components/DialogContent/DialogContent.js.map +1 -1
  23. package/lib/components/DialogContent/renderDialogContent.js.map +1 -1
  24. package/lib/components/DialogContent/useDialogContent.js.map +1 -1
  25. package/lib/components/DialogContent/useDialogContentStyles.js.map +1 -1
  26. package/lib/components/DialogSurface/DialogSurface.js +5 -0
  27. package/lib/components/DialogSurface/DialogSurface.js.map +1 -1
  28. package/lib/components/DialogSurface/renderDialogSurface.js.map +1 -1
  29. package/lib/components/DialogSurface/useDialogSurface.js +3 -1
  30. package/lib/components/DialogSurface/useDialogSurface.js.map +1 -1
  31. package/lib/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  32. package/lib/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  33. package/lib/components/DialogTitle/DialogTitle.js +5 -0
  34. package/lib/components/DialogTitle/DialogTitle.js.map +1 -1
  35. package/lib/components/DialogTitle/renderDialogTitle.js.map +1 -1
  36. package/lib/components/DialogTitle/useDialogTitle.js.map +1 -1
  37. package/lib/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  38. package/lib/components/DialogTrigger/DialogTrigger.js.map +1 -1
  39. package/lib/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  40. package/lib/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  41. package/lib/contexts/dialogContext.js +1 -0
  42. package/lib/contexts/dialogContext.js.map +1 -1
  43. package/lib/contexts/dialogSurfaceContext.js.map +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/utils/isEscapeKeyDown.js.map +1 -1
  46. package/lib/utils/useDisableBodyScroll.js.map +1 -1
  47. package/lib/utils/useFocusFirstElement.js.map +1 -1
  48. package/lib-amd/components/Dialog/Dialog.types.js.map +1 -1
  49. package/lib-amd/components/Dialog/useDialog.js +5 -4
  50. package/lib-amd/components/Dialog/useDialog.js.map +1 -1
  51. package/lib-amd/components/Dialog/useDialogContextValues.js +2 -1
  52. package/lib-amd/components/Dialog/useDialogContextValues.js.map +1 -1
  53. package/lib-amd/components/DialogActions/DialogActions.js +3 -1
  54. package/lib-amd/components/DialogActions/DialogActions.js.map +1 -1
  55. package/lib-amd/components/DialogBody/DialogBody.js +3 -1
  56. package/lib-amd/components/DialogBody/DialogBody.js.map +1 -1
  57. package/lib-amd/components/DialogContent/DialogContent.js +3 -1
  58. package/lib-amd/components/DialogContent/DialogContent.js.map +1 -1
  59. package/lib-amd/components/DialogSurface/DialogSurface.js +3 -1
  60. package/lib-amd/components/DialogSurface/DialogSurface.js.map +1 -1
  61. package/lib-amd/components/DialogSurface/useDialogSurface.js +5 -1
  62. package/lib-amd/components/DialogSurface/useDialogSurface.js.map +1 -1
  63. package/lib-amd/components/DialogTitle/DialogTitle.js +3 -1
  64. package/lib-amd/components/DialogTitle/DialogTitle.js.map +1 -1
  65. package/lib-amd/contexts/dialogContext.js +1 -0
  66. package/lib-amd/contexts/dialogContext.js.map +1 -1
  67. package/lib-commonjs/Dialog.js.map +1 -1
  68. package/lib-commonjs/DialogActions.js.map +1 -1
  69. package/lib-commonjs/DialogBody.js.map +1 -1
  70. package/lib-commonjs/DialogContent.js.map +1 -1
  71. package/lib-commonjs/DialogSurface.js.map +1 -1
  72. package/lib-commonjs/DialogTitle.js.map +1 -1
  73. package/lib-commonjs/DialogTrigger.js.map +1 -1
  74. package/lib-commonjs/components/Dialog/Dialog.js.map +1 -1
  75. package/lib-commonjs/components/Dialog/Dialog.types.js.map +1 -1
  76. package/lib-commonjs/components/Dialog/index.js.map +1 -1
  77. package/lib-commonjs/components/Dialog/renderDialog.js.map +1 -1
  78. package/lib-commonjs/components/Dialog/useDialog.js +3 -1
  79. package/lib-commonjs/components/Dialog/useDialog.js.map +1 -1
  80. package/lib-commonjs/components/Dialog/useDialogContextValues.js +2 -0
  81. package/lib-commonjs/components/Dialog/useDialogContextValues.js.map +1 -1
  82. package/lib-commonjs/components/DialogActions/DialogActions.js +5 -0
  83. package/lib-commonjs/components/DialogActions/DialogActions.js.map +1 -1
  84. package/lib-commonjs/components/DialogActions/DialogActions.types.js.map +1 -1
  85. package/lib-commonjs/components/DialogActions/index.js.map +1 -1
  86. package/lib-commonjs/components/DialogActions/renderDialogActions.js.map +1 -1
  87. package/lib-commonjs/components/DialogActions/useDialogActions.js.map +1 -1
  88. package/lib-commonjs/components/DialogActions/useDialogActionsStyles.js.map +1 -1
  89. package/lib-commonjs/components/DialogBody/DialogBody.js +5 -0
  90. package/lib-commonjs/components/DialogBody/DialogBody.js.map +1 -1
  91. package/lib-commonjs/components/DialogBody/DialogBody.types.js.map +1 -1
  92. package/lib-commonjs/components/DialogBody/index.js.map +1 -1
  93. package/lib-commonjs/components/DialogBody/renderDialogBody.js.map +1 -1
  94. package/lib-commonjs/components/DialogBody/useDialogBody.js.map +1 -1
  95. package/lib-commonjs/components/DialogBody/useDialogBodyStyles.js.map +1 -1
  96. package/lib-commonjs/components/DialogContent/DialogContent.js +5 -0
  97. package/lib-commonjs/components/DialogContent/DialogContent.js.map +1 -1
  98. package/lib-commonjs/components/DialogContent/DialogContent.types.js.map +1 -1
  99. package/lib-commonjs/components/DialogContent/index.js.map +1 -1
  100. package/lib-commonjs/components/DialogContent/renderDialogContent.js.map +1 -1
  101. package/lib-commonjs/components/DialogContent/useDialogContent.js.map +1 -1
  102. package/lib-commonjs/components/DialogContent/useDialogContentStyles.js.map +1 -1
  103. package/lib-commonjs/components/DialogSurface/DialogSurface.js +5 -0
  104. package/lib-commonjs/components/DialogSurface/DialogSurface.js.map +1 -1
  105. package/lib-commonjs/components/DialogSurface/DialogSurface.types.js.map +1 -1
  106. package/lib-commonjs/components/DialogSurface/index.js.map +1 -1
  107. package/lib-commonjs/components/DialogSurface/renderDialogSurface.js.map +1 -1
  108. package/lib-commonjs/components/DialogSurface/useDialogSurface.js +3 -1
  109. package/lib-commonjs/components/DialogSurface/useDialogSurface.js.map +1 -1
  110. package/lib-commonjs/components/DialogSurface/useDialogSurfaceContextValues.js.map +1 -1
  111. package/lib-commonjs/components/DialogSurface/useDialogSurfaceStyles.js.map +1 -1
  112. package/lib-commonjs/components/DialogTitle/DialogTitle.js +5 -0
  113. package/lib-commonjs/components/DialogTitle/DialogTitle.js.map +1 -1
  114. package/lib-commonjs/components/DialogTitle/DialogTitle.types.js.map +1 -1
  115. package/lib-commonjs/components/DialogTitle/index.js.map +1 -1
  116. package/lib-commonjs/components/DialogTitle/renderDialogTitle.js.map +1 -1
  117. package/lib-commonjs/components/DialogTitle/useDialogTitle.js.map +1 -1
  118. package/lib-commonjs/components/DialogTitle/useDialogTitleStyles.js.map +1 -1
  119. package/lib-commonjs/components/DialogTrigger/DialogTrigger.js.map +1 -1
  120. package/lib-commonjs/components/DialogTrigger/DialogTrigger.types.js.map +1 -1
  121. package/lib-commonjs/components/DialogTrigger/index.js.map +1 -1
  122. package/lib-commonjs/components/DialogTrigger/renderDialogTrigger.js.map +1 -1
  123. package/lib-commonjs/components/DialogTrigger/useDialogTrigger.js.map +1 -1
  124. package/lib-commonjs/contexts/constants.js.map +1 -1
  125. package/lib-commonjs/contexts/dialogContext.js +1 -0
  126. package/lib-commonjs/contexts/dialogContext.js.map +1 -1
  127. package/lib-commonjs/contexts/dialogSurfaceContext.js.map +1 -1
  128. package/lib-commonjs/contexts/index.js.map +1 -1
  129. package/lib-commonjs/index.js.map +1 -1
  130. package/lib-commonjs/utils/index.js.map +1 -1
  131. package/lib-commonjs/utils/isEscapeKeyDown.js.map +1 -1
  132. package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
  133. package/lib-commonjs/utils/useFocusFirstElement.js.map +1 -1
  134. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AAEA;;;AAGO,MAAMA,4BAA4B,GAAG,CAACC,KAAyB,EAAEC,aAAyC,KAAI;EACnH,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAqBJ,KAAK,CAAC;EAEhE,OACEK,oBAACC,qBAAM,QACJJ,KAAK,CAACK,QAAQ,IAAIF,oBAACH,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,EAC7DF,oBAACG,gCAAqB;IAACC,KAAK,EAAER,aAAa,CAACS;EAAa,GACvDL,oBAACH,KAAK,CAACS,IAAI;IAAA,GAAKR,SAAS,CAACQ;EAAI,EAAI,CACZ,CACjB;AAEb,CAAC;AAXYC,oCAA4B","names":["renderDialogSurface_unstable","state","contextValues","slots","slotProps","react_utilities_1","React","react_portal_1","backdrop","contexts_1","value","dialogSurface","root","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal>\n {slots.backdrop && <slots.backdrop {...slotProps.backdrop} />}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"]}
1
+ {"version":3,"names":["React","require","react_utilities_1","contexts_1","react_portal_1","renderDialogSurface_unstable","state","contextValues","slots","slotProps","getSlots","createElement","Portal","backdrop","DialogSurfaceProvider","value","dialogSurface","root","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogSurface/renderDialogSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogSurfaceState, DialogSurfaceSlots, DialogSurfaceContextValues } from './DialogSurface.types';\nimport { DialogSurfaceProvider } from '../../contexts';\nimport { Portal } from '@fluentui/react-portal';\n\n/**\n * Render the final JSX of DialogSurface\n */\nexport const renderDialogSurface_unstable = (state: DialogSurfaceState, contextValues: DialogSurfaceContextValues) => {\n const { slots, slotProps } = getSlots<DialogSurfaceSlots>(state);\n\n return (\n <Portal>\n {slots.backdrop && <slots.backdrop {...slotProps.backdrop} />}\n <DialogSurfaceProvider value={contextValues.dialogSurface}>\n <slots.root {...slotProps.root} />\n </DialogSurfaceProvider>\n </Portal>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA,MAAAE,UAAA,gBAAAF,OAAA;AACA,MAAAG,cAAA,gBAAAH,OAAA;AAEA;;;AAGO,MAAMI,4BAA4B,GAAGA,CAACC,KAAyB,EAAEC,aAAyC,KAAI;EACnH,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGP,iBAAA,CAAAQ,QAAQ,CAAqBJ,KAAK,CAAC;EAEhE,OACEN,KAAA,CAAAW,aAAA,CAACP,cAAA,CAAAQ,MAAM,QACJJ,KAAK,CAACK,QAAQ,IAAIb,KAAA,CAAAW,aAAA,CAACH,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,EAC7Db,KAAA,CAAAW,aAAA,CAACR,UAAA,CAAAW,qBAAqB;IAACC,KAAK,EAAER,aAAa,CAACS;EAAa,GACvDhB,KAAA,CAAAW,aAAA,CAACH,KAAK,CAACS,IAAI;IAAA,GAAKR,SAAS,CAACQ;EAAI,EAAI,CACZ,CACjB;AAEb,CAAC;AAXYC,OAAA,CAAAb,4BAA4B,GAAAA,4BAAA"}
@@ -23,6 +23,7 @@ const useDialogSurface_unstable = (props, ref) => {
23
23
  as
24
24
  } = props;
25
25
  const modalType = contexts_1.useDialogContext_unstable(ctx => ctx.modalType);
26
+ const inertTrapFocus = contexts_1.useDialogContext_unstable(ctx => ctx.inertTrapFocus);
26
27
  const dialogRef = contexts_1.useDialogContext_unstable(ctx => ctx.dialogRef);
27
28
  const open = contexts_1.useDialogContext_unstable(ctx => ctx.open);
28
29
  const requestOpenChange = contexts_1.useDialogContext_unstable(ctx => ctx.requestOpenChange);
@@ -57,7 +58,8 @@ const useDialogSurface_unstable = (props, ref) => {
57
58
  const {
58
59
  modalAttributes
59
60
  } = react_tabster_1.useModalAttributes({
60
- trapFocus: modalType !== 'non-modal'
61
+ trapFocus: modalType !== 'non-modal',
62
+ legacyTrapFocus: !inertTrapFocus
61
63
  });
62
64
  return {
63
65
  components: {
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAaA;AAC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AM;IAAEC;EAAe,CAAE,GAAGC,kCAAkB,CAAC;IAAEC,SAAS,EAAEpB,SAAS,KAAK;EAAW,CAAE,CAAC;EAExF,OAAO;IACLqB,UAAU,EAAE;MACVvB,QAAQ,EAAE,KAAK;MACfwB,IAAI,EAAE;KACP;IACDxB,QAAQ,EAAEW,kCAAgB,CAACX,QAAQ,EAAE;MACnCyB,QAAQ,EAAEnB,IAAI,IAAIJ,SAAS,KAAK,WAAW;MAC3CwB,YAAY,EAAE;QACZ,aAAa,EAAE,MAAM;QACrBb,OAAO,EAAEH;;KAEZ,CAAC;IACFc,IAAI,EAAEb,uCAAqB,CAACV,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI,KAAK,EAAE;MACvC0B,QAAQ,EAAE,CAAC,CAAC;MACZ,YAAY,EAAEzB,SAAS,KAAK,WAAW;MACvC0B,IAAI,EAAE1B,SAAS,KAAK,OAAO,GAAG,aAAa,GAAG,QAAQ;MACtD,iBAAiB,EAAEJ,KAAK,CAAC,YAAY,CAAC,GAAG+B,SAAS,GAAGrB,aAAa;MAClE,GAAGV,KAAK;MACR,GAAGsB,eAAe;MAClBH,SAAS,EAAED,aAAa;MACxBjB,GAAG,EAAEY,+BAAa,CAACZ,GAAG,EAAEM,SAAS;KAClC;GACF;AACH,CAAC;AAhEYyB,iCAAyB","names":["useDialogSurface_unstable","props","ref","backdrop","as","modalType","contexts_1","ctx","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","react_utilities_1","event","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","utils_1","stopPropagation","modalAttributes","react_tabster_1","trapFocus","components","root","required","defaultProps","tabIndex","role","undefined","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/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 {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\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 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<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\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 { modalAttributes } = useModalAttributes({ trapFocus: modalType !== 'non-modal' });\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"]}
1
+ {"version":3,"names":["react_utilities_1","require","contexts_1","utils_1","react_tabster_1","useDialogSurface_unstable","props","ref","backdrop","as","modalType","useDialogContext_unstable","ctx","inertTrapFocus","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","useEventCallback","event","isResolvedShorthand","_b","_a","onClick","call","isDefaultPrevented","type","handleKeyDown","onKeyDown","isEscapeKeyDismiss","stopPropagation","modalAttributes","useModalAttributes","trapFocus","legacyTrapFocus","components","root","resolveShorthand","required","defaultProps","getNativeElementProps","tabIndex","role","undefined","useMergedRefs","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogSurface/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 {\n DialogSurfaceElement,\n DialogSurfaceElementIntersection,\n DialogSurfaceProps,\n DialogSurfaceState,\n} from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { isEscapeKeyDismiss } from '../../utils';\nimport { useModalAttributes } from '@fluentui/react-tabster';\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 inertTrapFocus = useDialogContext_unstable(ctx => ctx.inertTrapFocus);\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<DialogSurfaceElementIntersection>) => {\n props.onKeyDown?.(event);\n\n if (isEscapeKeyDismiss(event, modalType)) {\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 { modalAttributes } = useModalAttributes({\n trapFocus: modalType !== 'non-modal',\n legacyTrapFocus: !inertTrapFocus,\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"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AAaA,MAAAC,UAAA,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MAClBH,SAAS,EAAED,aAAa;MACxBtB,GAAG,EAAEP,iBAAA,CAAA8C,aAAa,CAACvC,GAAG,EAAEO,SAAS;KAClC;GACF;AACH,CAAC;AApEYiC,OAAA,CAAA1C,yBAAyB,GAAAA,yBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAGA,SAAgBA,sCAAsC,CAACC,KAAyB;EAC9E,MAAMC,aAAa,GAA8B,IAAI;EAErD,OAAO;IAAEA;EAAa,CAAE;AAC1B;AAJAC","names":["useDialogSurfaceContextValues_unstable","state","dialogSurface","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"sourcesContent":["import type { DialogSurfaceContextValues, DialogSurfaceState } from './DialogSurface.types';\nimport type { DialogSurfaceContextValue } from '../../contexts';\n\nexport function useDialogSurfaceContextValues_unstable(state: DialogSurfaceState): DialogSurfaceContextValues {\n const dialogSurface: DialogSurfaceContextValue = true;\n\n return { dialogSurface };\n}\n"]}
1
+ {"version":3,"names":["useDialogSurfaceContextValues_unstable","state","dialogSurface","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceContextValues.ts"],"sourcesContent":["import type { DialogSurfaceContextValues, DialogSurfaceState } from './DialogSurface.types';\nimport type { DialogSurfaceContextValue } from '../../contexts';\n\nexport function useDialogSurfaceContextValues_unstable(state: DialogSurfaceState): DialogSurfaceContextValues {\n const dialogSurface: DialogSurfaceContextValue = true;\n\n return { dialogSurface };\n}\n"],"mappings":";;;;;;AAGA,SAAgBA,sCAAsCA,CAACC,KAAyB;EAC9E,MAAMC,aAAa,GAA8B,IAAI;EAErD,OAAO;IAAEA;EAAa,CAAE;AAC1B;AAJAC,OAAA,CAAAH,sCAAA,GAAAA,sCAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AAQaA,+BAAuB,GAAuC;EACzEC,IAAI,EAAE,mBAAmB;EAC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AAM,CAACO,oBAAoB,EAC7CR,KAAK,CAACJ,QAAQ,CAACS,SAAS,CACzB;;EAEH,OAAOL,KAAK;AACd,CAAC;AApBYN,uCAA+B","names":["exports","root","backdrop","useStyles","react_1","useDialogSurfaceStyles_unstable","state","styles","isNestedDialog","contexts_1","ctx","className","focusOutline","nestedNativeDialogBackdrop","nestedDialogBackdrop"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport {\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n useDialogContext_unstable,\n} from '../../contexts';\nimport type { DialogSurfaceSlots, DialogSurfaceState } from './DialogSurface.types';\n\nexport const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots> = {\n root: 'fui-DialogSurface',\n backdrop: 'fui-DialogSurface__backdrop',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n focusOutline: createFocusOutlineStyle(),\n root: {\n display: 'block',\n userSelect: 'unset',\n visibility: 'unset',\n ...shorthands.inset(0),\n ...shorthands.padding(0),\n ...shorthands.padding(SURFACE_PADDING),\n ...shorthands.margin('auto'),\n ...shorthands.borderStyle('none'),\n ...shorthands.overflow('unset'),\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n position: 'fixed',\n width: '100%',\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n boxShadow: tokens.shadow64,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n ...shorthands.border(SURFACE_BORDER_WIDTH, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(tokens.borderRadiusXLarge),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n },\n },\n backdrop: {\n position: 'fixed',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n ...shorthands.inset('0px'),\n },\n nestedDialogBackdrop: {\n backgroundColor: 'transparent',\n },\n nestedNativeDialogBackdrop: {\n '&::backdrop': {\n backgroundColor: 'transparent',\n },\n },\n});\n\n/**\n * Apply styling to the DialogSurface slots based on the state\n */\nexport const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n const styles = useStyles();\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n\n state.root.className = mergeClasses(\n dialogSurfaceClassNames.root,\n styles.root,\n styles.focusOutline,\n isNestedDialog && styles.nestedNativeDialogBackdrop,\n state.root.className,\n );\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(\n dialogSurfaceClassNames.backdrop,\n styles.backdrop,\n isNestedDialog && styles.nestedDialogBackdrop,\n state.backdrop.className,\n );\n }\n return state;\n};\n"]}
1
+ {"version":3,"names":["react_1","require","react_theme_1","react_tabster_1","contexts_1","exports","dialogSurfaceClassNames","root","backdrop","useStyles","__styles","focusOutline","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","mc9l5x","famaaq","Bcdw1i0","Bhzewxz","j35jbq","B5kzvoi","oyh7mz","z8tnut","z189sj","Byoj8tv","uwmqm3","B6of3ja","t21cq0","jrapky","Frg6f3","icvyot","vrafjx","oivjwe","wvpqe5","B68tc82","Bmxbyg5","fshzfu","qhf8xq","a9b677","Bqenvij","B2u0y6b","Bxyxcbc","B7ck84d","E5pizo","De3pzq","sj55zd","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B5xtmjs","nestedDialogBackdrop","nestedNativeDialogBackdrop","f","i","d","m","useDialogSurfaceStyles_unstable","state","styles","isNestedDialog","useDialogContext_unstable","ctx","className","mergeClasses"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogSurface/useDialogSurfaceStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport {\n MEDIA_QUERY_BREAKPOINT_SELECTOR,\n SURFACE_BORDER_WIDTH,\n SURFACE_PADDING,\n useDialogContext_unstable,\n} from '../../contexts';\nimport type { DialogSurfaceSlots, DialogSurfaceState } from './DialogSurface.types';\n\nexport const dialogSurfaceClassNames: SlotClassNames<DialogSurfaceSlots> = {\n root: 'fui-DialogSurface',\n backdrop: 'fui-DialogSurface__backdrop',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n focusOutline: createFocusOutlineStyle(),\n root: {\n display: 'block',\n userSelect: 'unset',\n visibility: 'unset',\n ...shorthands.inset(0),\n ...shorthands.padding(0),\n ...shorthands.padding(SURFACE_PADDING),\n ...shorthands.margin('auto'),\n ...shorthands.borderStyle('none'),\n ...shorthands.overflow('unset'),\n '&::backdrop': {\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n },\n position: 'fixed',\n width: '100%',\n height: 'fit-content',\n maxWidth: '600px',\n maxHeight: '100vh',\n boxSizing: 'border-box',\n boxShadow: tokens.shadow64,\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n ...shorthands.border(SURFACE_BORDER_WIDTH, 'solid', tokens.colorTransparentStroke),\n ...shorthands.borderRadius(tokens.borderRadiusXLarge),\n [MEDIA_QUERY_BREAKPOINT_SELECTOR]: {\n maxWidth: '100vw',\n },\n },\n backdrop: {\n position: 'fixed',\n backgroundColor: 'rgba(0, 0, 0, 0.4)',\n ...shorthands.inset('0px'),\n },\n nestedDialogBackdrop: {\n backgroundColor: 'transparent',\n },\n nestedNativeDialogBackdrop: {\n '&::backdrop': {\n backgroundColor: 'transparent',\n },\n },\n});\n\n/**\n * Apply styling to the DialogSurface slots based on the state\n */\nexport const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): DialogSurfaceState => {\n const styles = useStyles();\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n\n state.root.className = mergeClasses(\n dialogSurfaceClassNames.root,\n styles.root,\n styles.focusOutline,\n isNestedDialog && styles.nestedNativeDialogBackdrop,\n state.root.className,\n );\n if (state.backdrop) {\n state.backdrop.className = mergeClasses(\n dialogSurfaceClassNames.backdrop,\n styles.backdrop,\n isNestedDialog && styles.nestedDialogBackdrop,\n state.backdrop.className,\n );\n }\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAEA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,UAAA,gBAAAH,OAAA;AAQaI,OAAA,CAAAC,uBAAuB,GAAuC;EACzEC,IAAI,EAAE,mBAAmB;EACzBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGT,OAAA,CAAAU,QAAU;EAAAC,YAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IA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,OAAA,CAAAmG,YAAY,CACjC9F,OAAA,CAAAC,uBAAuB,CAACC,IAAI,EAC5BuF,MAAM,CAACvF,IAAI,EACXuF,MAAM,CAACnF,YAAY,EACnBoF,cAAc,IAAID,MAAM,CAACP,0BAA0B,EACnDM,KAAK,CAACtF,IAAI,CAAC2F,SAAS,CACrB;EACD,IAAIL,KAAK,CAACrF,QAAQ,EAAE;IAClBqF,KAAK,CAACrF,QAAQ,CAAC0F,SAAS,GAAGlG,OAAA,CAAAmG,YAAY,CACrC9F,OAAA,CAAAC,uBAAuB,CAACE,QAAQ,EAChCsF,MAAM,CAACtF,QAAQ,EACfuF,cAAc,IAAID,MAAM,CAACR,oBAAoB,EAC7CO,KAAK,CAACrF,QAAQ,CAAC0F,SAAS,CACzB;;EAEH,OAAOL,KAAK;AACd,CAAC;AApBYxF,OAAA,CAAAuF,+BAA+B,GAAAA,+BAAA"}
@@ -8,6 +8,7 @@ const React = /*#__PURE__*/require("react");
8
8
  const useDialogTitle_1 = /*#__PURE__*/require("./useDialogTitle");
9
9
  const renderDialogTitle_1 = /*#__PURE__*/require("./renderDialogTitle");
10
10
  const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
11
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
11
12
  /**
12
13
  * The `DialogTitle` component expects to have a title/header
13
14
  * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.
@@ -15,6 +16,10 @@ const useDialogTitleStyles_1 = /*#__PURE__*/require("./useDialogTitleStyles");
15
16
  exports.DialogTitle = /*#__PURE__*/React.forwardRef((props, ref) => {
16
17
  const state = useDialogTitle_1.useDialogTitle_unstable(props, ref);
17
18
  useDialogTitleStyles_1.useDialogTitleStyles_unstable(state);
19
+ const {
20
+ useDialogTitleStyles_unstable: useCustomStyles
21
+ } = react_shared_contexts_1.useCustomStyleHooks_unstable();
22
+ useCustomStyles(state);
18
23
  return renderDialogTitle_1.renderDialogTitle_unstable(state);
19
24
  });
20
25
  exports.DialogTitle.displayName = 'DialogTitle';
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;;AAIaA,mBAAW,gBAA0CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGC,wCAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDG,oDAA6B,CAACF,KAAK,CAAC;EACpC,OAAOG,8CAA0B,CAACH,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,mBAAW,CAACS,WAAW,GAAG,aAAa","names":["exports","React","forwardRef","props","ref","state","useDialogTitle_1","useDialogTitleStyles_1","renderDialogTitle_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDialogTitle_unstable } from './useDialogTitle';\nimport { renderDialogTitle_unstable } from './renderDialogTitle';\nimport { useDialogTitleStyles_unstable } from './useDialogTitleStyles';\nimport type { DialogTitleProps } from './DialogTitle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `DialogTitle` component expects to have a title/header\n * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.\n */\nexport const DialogTitle: ForwardRefComponent<DialogTitleProps> = React.forwardRef((props, ref) => {\n const state = useDialogTitle_unstable(props, ref);\n\n useDialogTitleStyles_unstable(state);\n return renderDialogTitle_unstable(state);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n"]}
1
+ {"version":3,"names":["React","require","useDialogTitle_1","renderDialogTitle_1","useDialogTitleStyles_1","react_shared_contexts_1","exports","DialogTitle","forwardRef","props","ref","state","useDialogTitle_unstable","useDialogTitleStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderDialogTitle_unstable","displayName"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDialogTitle_unstable } from './useDialogTitle';\nimport { renderDialogTitle_unstable } from './renderDialogTitle';\nimport { useDialogTitleStyles_unstable } from './useDialogTitleStyles';\nimport type { DialogTitleProps } from './DialogTitle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * The `DialogTitle` component expects to have a title/header\n * and when `Dialog` is `non-modal` a close (X icon) button is provided through `action` slot by default.\n */\nexport const DialogTitle: ForwardRefComponent<DialogTitleProps> = React.forwardRef((props, ref) => {\n const state = useDialogTitle_unstable(props, ref);\n\n useDialogTitleStyles_unstable(state);\n\n const { useDialogTitleStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderDialogTitle_unstable(state);\n});\n\nDialogTitle.displayName = 'DialogTitle';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,gBAAA,gBAAAD,OAAA;AACA,MAAAE,mBAAA,gBAAAF,OAAA;AACA,MAAAG,sBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;;AAIaK,OAAA,CAAAC,WAAW,gBAA0CP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGT,gBAAA,CAAAU,uBAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDN,sBAAA,CAAAS,6BAA6B,CAACF,KAAK,CAAC;EAEpC,MAAM;IAAEE,6BAA6B,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACzFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,mBAAA,CAAAa,0BAA0B,CAACL,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFL,OAAA,CAAAC,WAAW,CAACU,WAAW,GAAG,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/DialogTitle.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DialogTitleSlots = {\n /**\n * By default this is a div, but can be a heading.\n */\n root: Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;\n /**\n * By default a Dialog with modalType='non-modal' will have a close button action\n */\n action?: Slot<'div'>;\n};\n\n/**\n * DialogTitle Props\n */\nexport type DialogTitleProps = ComponentProps<DialogTitleSlots>;\n\n/**\n * State used in rendering DialogTitle\n */\nexport type DialogTitleState = ComponentState<DialogTitleSlots>;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/index.ts"],"sourcesContent":["export * from './DialogTitle';\nexport * from './DialogTitle.types';\nexport * from './renderDialogTitle';\nexport * from './useDialogTitle';\nexport * from './useDialogTitleStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAmBH,KAAK,CAAC;EAE9D,OACEI,0CACEA,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAAGH,SAAS,CAACG,IAAI,CAACC,QAAQ,CAAc,EACrEL,KAAK,CAACM,MAAM,IAAIH,oBAACH,KAAK,CAACM,MAAM;IAAA,GAAKL,SAAS,CAACK;EAAM,EAAI,CACtD;AAEP,CAAC;AATYC,kCAA0B","names":["renderDialogTitle_unstable","state","slots","slotProps","react_utilities_1","React","root","children","action","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';\n\n/**\n * Render the final JSX of DialogTitle\n */\nexport const renderDialogTitle_unstable = (state: DialogTitleState) => {\n const { slots, slotProps } = getSlots<DialogTitleSlots>(state);\n\n return (\n <>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n {slots.action && <slots.action {...slotProps.action} />}\n </>\n );\n};\n"]}
1
+ {"version":3,"names":["React","require","react_utilities_1","renderDialogTitle_unstable","state","slots","slotProps","getSlots","createElement","Fragment","root","children","action","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/renderDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DialogTitleState, DialogTitleSlots } from './DialogTitle.types';\n\n/**\n * Render the final JSX of DialogTitle\n */\nexport const renderDialogTitle_unstable = (state: DialogTitleState) => {\n const { slots, slotProps } = getSlots<DialogTitleSlots>(state);\n\n return (\n <>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n {slots.action && <slots.action {...slot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AEW,kCAAgB,CAACX,MAAM,EAAE;MAC/BY,QAAQ,EAAEX,SAAS,KAAK,WAAW;MACnCY,YAAY,EAAE;QACZC,QAAQ,EACNC,oBAACC,6BAAa;UAACC,wBAAwB;UAACjB,MAAM,EAAC;QAAO,GACpDe;UACEG,SAAS,EAAEd,cAAc,CAACe,MAAM;UAAA,cAErB;QAAO,GAElBJ,oBAACK,8BAAgB,OAAG,CACb;;KAIhB;GACF;AACH,CAAC;AAhCYC,+BAAuB","names":["useDialogTitle_unstable","props","ref","as","action","modalType","dialogContext_1","ctx","internalStyles","useDialogTitleStyles_1","components","root","react_utilities_1","id","dialogTitleId","react_utilities_2","required","defaultProps","children","React","DialogTrigger_1","disableButtonEnhancement","className","button","react_icons_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\nimport { Dismiss24Regular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { DialogTrigger } from '../DialogTrigger/DialogTrigger';\nimport { useDialogTitleInternalStyles } from './useDialogTitleStyles';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,\n * before being passed to renderDialogTitle_unstable.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLElement of DialogTitle\n */\nexport const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLElement>): DialogTitleState => {\n const { as, action } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const internalStyles = useDialogTitleInternalStyles();\n\n return {\n components: {\n root: 'div',\n action: 'div',\n },\n root: getNativeElementProps(as ?? 'div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogTitleId),\n ...props,\n }),\n action: resolveShorthand(action, {\n required: modalType === 'non-modal',\n defaultProps: {\n children: (\n <DialogTrigger disableButtonEnhancement action=\"close\">\n <button\n className={internalStyles.button}\n // TODO: find a better way to add internal labels\n aria-label=\"close\"\n >\n <Dismiss24Regular />\n </button>\n </DialogTrigger>\n ),\n },\n }),\n };\n};\n"]}
1
+ {"version":3,"names":["React","require","react_utilities_1","dialogContext_1","react_icons_1","react_utilities_2","DialogTrigger_1","useDialogTitleStyles_1","useDialogTitle_unstable","props","ref","as","action","modalType","useDialogContext_unstable","ctx","internalStyles","useDialogTitleInternalStyles","components","root","getNativeElementProps","id","dialogTitleId","resolveShorthand","required","defaultProps","children","createElement","DialogTrigger","disableButtonEnhancement","className","button","Dismiss24Regular","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\nimport { useDialogContext_unstable } from '../../contexts/dialogContext';\nimport { Dismiss24Regular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { DialogTrigger } from '../DialogTrigger/DialogTrigger';\nimport { useDialogTitleInternalStyles } from './useDialogTitleStyles';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * The returned state can be modified with hooks such as useDialogTitleStyles_unstable,\n * before being passed to renderDialogTitle_unstable.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLElement of DialogTitle\n */\nexport const useDialogTitle_unstable = (props: DialogTitleProps, ref: React.Ref<HTMLElement>): DialogTitleState => {\n const { as, action } = props;\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const internalStyles = useDialogTitleInternalStyles();\n\n return {\n components: {\n root: 'div',\n action: 'div',\n },\n root: getNativeElementProps(as ?? 'div', {\n ref,\n id: useDialogContext_unstable(ctx => ctx.dialogTitleId),\n ...props,\n }),\n action: resolveShorthand(action, {\n required: modalType === 'non-modal',\n defaultProps: {\n children: (\n <DialogTrigger disableButtonEnhancement action=\"close\">\n <button\n className={internalStyles.button}\n // TODO: find a better way to add internal labels\n aria-label=\"close\"\n >\n <Dismiss24Regular />\n </button>\n </DialogTrigger>\n ),\n },\n }),\n };\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,aAAA,gBAAAH,OAAA;AACA,MAAAI,iBAAA,gBAAAJ,OAAA;AACA,MAAAK,eAAA,gBAAAL,OAAA;AACA,MAAAM,sBAAA,gBAAAN,OAAA;AAEA;;;;;;;;;AASO,MAAMO,uBAAuB,GAAGA,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;EAChH,MAAM;IAAEC,EAAE;IAAEC;EAAM,CAAE,GAAGH,KAAK;EAC5B,MAAMI,SAAS,GAAGV,eAAA,CAAAW,yBAAyB,CAACC,GAAG,IAAIA,GAAG,CAACF,SAAS,CAAC;EACjE,MAAMG,cAAc,GAAGT,sBAAA,CAAAU,4BAA4B,EAAE;EAErD,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXP,MAAM,EAAE;KACT;IACDO,IAAI,EAAEjB,iBAAA,CAAAkB,qBAAqB,CAACT,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI,KAAK,EAAE;MACvCD,GAAG;MACHW,EAAE,EAAElB,eAAA,CAAAW,yBAAyB,CAACC,GAAG,IAAIA,GAAG,CAACO,aAAa,CAAC;MACvD,GAAGb;KACJ,CAAC;IACFG,MAAM,EAAEP,iBAAA,CAAAkB,gBAAgB,CAACX,MAAM,EAAE;MAC/BY,QAAQ,EAAEX,SAAS,KAAK,WAAW;MACnCY,YAAY,EAAE;QACZC,QAAQ,EACN1B,KAAA,CAAA2B,aAAA,CAACrB,eAAA,CAAAsB,aAAa;UAACC,wBAAwB;UAACjB,MAAM,EAAC;QA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AACL,IAAI,CAACO,SAAS,CACrB;EACD,IAAIF,KAAK,CAACJ,MAAM,EAAE;IAChBI,KAAK,CAACJ,MAAM,CAACM,SAAS,GAAGJ,oBAAY,CAACJ,6BAAqB,CAACE,MAAM,EAAEK,MAAM,CAACL,MAAM,EAAEI,KAAK,CAACJ,MAAM,CAACM,SAAS,CAAC;;EAE5G,OAAOF,KAAK;AACd,CAAC;AAZYN,qCAA6B","names":["exports","root","action","useStyles","react_1","useDialogTitleStyles_unstable","state","styles","className","rootWithoutCloseButton"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n cursor: 'pointer',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"]}
1
+ {"version":3,"names":["react_1","require","react_theme_1","constants_1","react_tabster_1","exports","dialogTitleClassNames","root","action","useStyles","__styles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Ijaq50","Br312pm","nk6f5a","Bw0ie65","rootWithoutCloseButton","d","useDialogTitleInternalStyles","button","qhf8xq","B7ck84d","De3pzq","sj55zd","Bceei9c","B68tc82","Bmxbyg5","z8tnut","z189sj","Byoj8tv","uwmqm3","icvyot","vrafjx","oivjwe","wvpqe5","Bv0vk6g","fsow6f","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","f","i","useDialogTitleStyles_unstable","state","styles","className","mergeClasses"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTitle/useDialogTitleStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { DialogTitleSlots, DialogTitleState } from './DialogTitle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\nimport { TITLE_ACTION_GRID_AREA, TITLE_GRID_AREA } from '../../contexts/constants';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\n\nexport const dialogTitleClassNames: SlotClassNames<DialogTitleSlots> = {\n root: 'fui-DialogTitle',\n action: 'fui-DialogTitle__action',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.subtitle1,\n ...shorthands.gridArea(TITLE_GRID_AREA),\n },\n rootWithoutCloseButton: {\n ...shorthands.gridArea(TITLE_GRID_AREA, TITLE_GRID_AREA, TITLE_ACTION_GRID_AREA, TITLE_ACTION_GRID_AREA),\n },\n action: {\n ...shorthands.gridArea(TITLE_ACTION_GRID_AREA),\n },\n});\n\n/**\n * Styles to be applied on internal elements used by default action on non-modal Dialog\n * @internal\n */\nexport const useDialogTitleInternalStyles = makeStyles({\n button: {\n position: 'relative',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n cursor: 'pointer',\n lineHeight: 0,\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n ...createFocusOutlineStyle(),\n },\n});\n\n/**\n * Apply styling to the DialogTitle slots based on the state\n */\nexport const useDialogTitleStyles_unstable = (state: DialogTitleState): DialogTitleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n dialogTitleClassNames.root,\n styles.root,\n !state.action && styles.rootWithoutCloseButton,\n state.root.className,\n );\n if (state.action) {\n state.action.className = mergeClasses(dialogTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAGA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,WAAA,gBAAAF,OAAA;AACA,MAAAG,eAAA,gBAAAH,OAAA;AAEaI,OAAA,CAAAC,qBAAqB,GAAqC;EACrEC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE;CACT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AMC,MAAM,GAAGjE,SAAS,EAAE;EAC1BgE,KAAK,CAAClE,IAAI,CAACoE,SAAS,GAAG3E,OAAA,CAAA4E,YAAY,CACjCvE,OAAA,CAAAC,qBAAqB,CAACC,IAAI,EAC1BmE,MAAM,CAACnE,IAAI,EACX,CAACkE,KAAK,CAACjE,MAAM,IAAIkE,MAAM,CAACvD,sBAAsB,EAC9CsD,KAAK,CAAClE,IAAI,CAACoE,SAAS,CACrB;EACD,IAAIF,KAAK,CAACjE,MAAM,EAAE;IAChBiE,KAAK,CAACjE,MAAM,CAACmE,SAAS,GAAG3E,OAAA,CAAA4E,YAAY,CAACvE,OAAA,CAAAC,qBAAqB,CAACE,MAAM,EAAEkE,MAAM,CAAClE,MAAM,EAAEiE,KAAK,CAACjE,MAAM,CAACmE,SAAS,CAAC;;EAE5G,OAAOF,KAAK;AACd,CAAC;AAZYpE,OAAA,CAAAmE,6BAA6B,GAAAA,6BAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AACA;AAIA;;;;;;;;;;AAUO,MAAMA,aAAa,GAAiCC,KAAK,IAAG;EACjE,MAAMC,KAAK,GAAGC,4CAAyB,CAACF,KAAK,CAAC;EAE9C,OAAOG,kDAA4B,CAACF,KAAK,CAAC;AAC5C,CAAC;AAJYG,qBAAa;AAM1BA,qBAAa,CAACC,WAAW,GAAG,eAAe;AAC3C;AACCD,qBAAwC,CAACE,wBAAwB,GAAG,IAAI","names":["DialogTrigger","props","state","useDialogTrigger_1","renderDialogTrigger_1","exports","displayName","isFluentTriggerComponent"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(DialogTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"]}
1
+ {"version":3,"names":["useDialogTrigger_1","require","renderDialogTrigger_1","DialogTrigger","props","state","useDialogTrigger_unstable","renderDialogTrigger_unstable","exports","displayName","isFluentTriggerComponent"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDialogTrigger_unstable } from './useDialogTrigger';\nimport { renderDialogTrigger_unstable } from './renderDialogTrigger';\nimport type { DialogTriggerProps } from './DialogTrigger.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will open or close a `Dialog`.\n * This component should only accept one child.\n *\n * In case the trigger is used outside `Dialog` component\n * it'll still provide basic ARIA related attributes\n * to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,\n * in that case the user must provide a `controlled state`\n */\nexport const DialogTrigger: React.FC<DialogTriggerProps> = props => {\n const state = useDialogTrigger_unstable(props);\n\n return renderDialogTrigger_unstable(state);\n};\n\nDialogTrigger.displayName = 'DialogTrigger';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(DialogTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"mappings":";;;;;;AACA,MAAAA,kBAAA,gBAAAC,OAAA;AACA,MAAAC,qBAAA,gBAAAD,OAAA;AAIA;;;;;;;;;;AAUO,MAAME,aAAa,GAAiCC,KAAK,IAAG;EACjE,MAAMC,KAAK,GAAGL,kBAAA,CAAAM,yBAAyB,CAACF,KAAK,CAAC;EAE9C,OAAOF,qBAAA,CAAAK,4BAA4B,CAACF,KAAK,CAAC;AAC5C,CAAC;AAJYG,OAAA,CAAAL,aAAa,GAAAA,aAAA;AAM1BK,OAAA,CAAAL,aAAa,CAACM,WAAW,GAAG,eAAe;AAC3C;AACCD,OAAA,CAAAL,aAAwC,CAACO,wBAAwB,GAAG,IAAI"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.types.ts"],"sourcesContent":["import { ARIAButtonResultProps, ARIAButtonType } from '@fluentui/react-aria';\nimport type { TriggerProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type DialogTriggerAction = 'open' | 'close';\n\nexport type DialogTriggerProps = TriggerProps<DialogTriggerChildProps> & {\n /**\n * Explicitly declare if the trigger is responsible for opening or\n * closing a Dialog visibility state.\n *\n * If `DialogTrigger` is outside `DialogSurface` then it'll be `open` by default\n *\n * If `DialogTrigger` is inside `DialogSurface` then it'll be `close` by default\n */\n action?: DialogTriggerAction;\n /**\n * Disables internal trigger mechanism that ensures a child provided will be a compliant ARIA button.\n * @default false\n */\n disableButtonEnhancement?: boolean;\n};\n\n/**\n * Props that are passed to the child of the DialogTrigger when cloned to ensure correct behaviour for the Dialog\n */\nexport type DialogTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<\n Type,\n Props & {\n 'aria-haspopup'?: 'dialog';\n }\n>;\n\nexport type DialogTriggerState = {\n children: React.ReactElement | null;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTrigger/index.ts"],"sourcesContent":["export * from './DialogTrigger';\nexport * from './DialogTrigger.types';\nexport * from './renderDialogTrigger';\nexport * from './useDialogTrigger';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,2BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,2BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,wBAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;;;;;AAKO,MAAMA,4BAA4B,GAAIC,KAAyB,IAAKA,KAAK,CAACC,QAAQ;AAA5EC,oCAA4B","names":["renderDialogTrigger_unstable","state","children","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"]}
1
+ {"version":3,"names":["renderDialogTrigger_unstable","state","children","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTrigger/renderDialogTrigger.tsx"],"sourcesContent":["import type { DialogTriggerState } from './DialogTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderDialogTrigger_unstable = (state: DialogTriggerState) => state.children;\n"],"mappings":";;;;;;AAEA;;;;;AAKO,MAAMA,4BAA4B,GAAIC,KAAyB,IAAKA,KAAK,CAACC,QAAQ;AAA5EC,OAAA,CAAAH,4BAA4B,GAAAA,4BAAA"}
@@ -1 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AI,MAAK,GAAG,GAAGX,KAAK,CAACW,IAAI,GAAG,KAAK,EACpE;IACE,GAAGC,iBAAiB;IACpBD,IAAI,EAAE;GACP,CACF;EAED,OAAO;IACLd,QAAQ,EAAEI,6CAA2B,CACnCJ,QAAQ,EACRC,wBAAwB,GAAGc,iBAAiB,GAAGE,2BAA2B;GAE7E;AACH,CAAC;AA/CYE,iCAAyB","names":["useDialogTrigger_unstable","props","isInsideSurfaceDialog","contexts_1","children","disableButtonEnhancement","action","child","react_utilities_1","requestOpenChange","ctx","open","triggerAttributes","react_tabster_1","handleClick","event","onClick","isDefaultPrevented","type","triggerChildProps","ref","ariaButtonTriggerChildProps","react_aria_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const open = useDialogContext_unstable(ctx => ctx.open);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n 'aria-expanded': open,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"]}
1
+ {"version":3,"names":["react_tabster_1","require","react_utilities_1","contexts_1","react_aria_1","useDialogTrigger_unstable","props","isInsideSurfaceDialog","useDialogSurfaceContext_unstable","children","disableButtonEnhancement","action","child","getTriggerChild","requestOpenChange","useDialogContext_unstable","ctx","open","triggerAttributes","useModalAttributes","handleClick","useEventCallback","event","_b","_a","onClick","call","isDefaultPrevented","type","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","exports"],"sources":["../src/packages/react-components/react-dialog/src/components/DialogTrigger/useDialogTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const open = useDialogContext_unstable(ctx => ctx.open);\n\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n 'aria-expanded': open,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"mappings":";;;;;;AACA,MAAAA,eAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA,MAAAE,UAAA,gBAAAF,OAAA;AACA,MAAAG,YAAA,gBAAAH,OAAA;AAEA;;;;;;AAMO,MAAMI,yBAAyB,GAAIC,KAAyB,IAAwB;EACzF,MAAMC,qBAAqB,GAAGJ,UAAA,CAAAK,gCAAgC,EAAE;EAEhE,MAAM;IAAEC,QAAQ;IAAEC,wBAAwB,GAAG,KAAK;IAAEC,MAAM,GAAGJ,qBAAqB,GAAG,OAAO,GAAG;EAAM,CAAE,GAAGD,KAAK;EAE/G,MAAMM,KAAK,GAAGV,iBAAA,CAAAW,eAAe,CAACJ,QAAQ,CAAC;EAEvC,MAAMK,iBAAiB,GAAGX,UAAA,CAAAY,yBAAyB,CAACC,GAAG,IAAIA,GAAG,CAACF,iBAAiB,CAAC;EACjF,MAAMG,IAAI,GAAGd,UAAA,CAAAY,yBAAyB,CAACC,GAAG,IAAIA,GAAG,CAACC,IAAI,CAAC;EAEvD,MAAM;IAAEC;EAAiB,CAAE,GAA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AAe,GAAG,MAAM;AACxBA,kBAAU,GAAG,KAAK;AAClBA,4BAAoB,GAAG,KAAK;AAE5BA,+BAAuB,GAAG,eAAe;AACzCA,6BAAqB,GAAG,aAAa;AACrCA,uBAAe,GAAG,OAAO;AACzBA,8BAAsB,GAAG,cAAc;AACvCA,yBAAiB,GAAG,MAAM","names":["exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/contexts/constants.ts"],"sourcesContent":["export const MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\n\nexport const ACTIONS_START_GRID_AREA = 'actions-start';\nexport const ACTIONS_END_GRID_AREA = 'actions-end';\nexport const TITLE_GRID_AREA = 'title';\nexport const TITLE_ACTION_GRID_AREA = 'close-button';\nexport const CONTENT_GRID_AREA = 'body';\n"]}
1
+ {"version":3,"names":["exports","MEDIA_QUERY_BREAKPOINT_SELECTOR","SURFACE_PADDING","DIALOG_GAP","SURFACE_BORDER_WIDTH","ACTIONS_START_GRID_AREA","ACTIONS_END_GRID_AREA","TITLE_GRID_AREA","TITLE_ACTION_GRID_AREA","CONTENT_GRID_AREA"],"sources":["../src/packages/react-components/react-dialog/src/contexts/constants.ts"],"sourcesContent":["export const MEDIA_QUERY_BREAKPOINT_SELECTOR = '@media screen and (max-width: 480px)';\nexport const SURFACE_PADDING = '24px';\nexport const DIALOG_GAP = '8px';\nexport const SURFACE_BORDER_WIDTH = '1px';\n\nexport const ACTIONS_START_GRID_AREA = 'actions-start';\nexport const ACTIONS_END_GRID_AREA = 'actions-end';\nexport const TITLE_GRID_AREA = 'title';\nexport const TITLE_ACTION_GRID_AREA = 'close-button';\nexport const CONTENT_GRID_AREA = 'body';\n"],"mappings":";;;;;;AAAaA,OAAA,CAAAC,+BAA+B,GAAG,sCAAsC;AACxED,OAAA,CAAAE,eAAe,GAAG,MAAM;AACxBF,OAAA,CAAAG,UAAU,GAAG,KAAK;AAClBH,OAAA,CAAAI,oBAAoB,GAAG,KAAK;AAE5BJ,OAAA,CAAAK,uBAAuB,GAAG,eAAe;AACzCL,OAAA,CAAAM,qBAAqB,GAAG,aAAa;AACrCN,OAAA,CAAAO,eAAe,GAAG,OAAO;AACzBP,OAAA,CAAAQ,sBAAsB,GAAG,cAAc;AACvCR,OAAA,CAAAS,iBAAiB,GAAG,MAAM"}
@@ -7,6 +7,7 @@ exports.useDialogContext_unstable = exports.DialogProvider = exports.DialogConte
7
7
  const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
8
8
  const defaultContextValue = {
9
9
  open: false,
10
+ inertTrapFocus: false,
10
11
  modalType: 'modal',
11
12
  isNestedDialog: false,
12
13
  dialogRef: {
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAiBA,MAAMA,mBAAmB,GAAuB;EAC9CC,IAAI,EAAE,KAAK;EACXC,SAAS,EAAE,OAAO;EAClBC,cAAc,EAAE,KAAK;EACrBC,SAAS,EAAE;IAAEC,OAAO,EAAE;EAAI,CAAE;EAC5BC,iBAAiB;IACf;EAAA;CAEH;AAED;AACaC,qBAAa,gBAA4CC,sCAAa,CACjFC,SAAS,CACV;AAEYF,sBAAc,GAAGA,qBAAa,CAACG,QAAQ;AAC7C,MAAMC,yBAAyB,GAAOC,QAAgD,IAC3FJ,2CAAkB,CAACD,qBAAa,EAAE,CAACM,GAAG,GAAGb,mBAAmB,KAAKY,QAAQ,CAACC,GAAG,CAAC,CAAC;AADpEN,iCAAyB","names":["defaultContextValue","open","modalType","isNestedDialog","dialogRef","current","requestOpenChange","exports","react_context_selector_1","undefined","Provider","useDialogContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"]}
1
+ {"version":3,"names":["react_context_selector_1","require","defaultContextValue","open","inertTrapFocus","modalType","isNestedDialog","dialogRef","current","requestOpenChange","exports","DialogContext","createContext","undefined","DialogProvider","Provider","useDialogContext_unstable","selector","useContextSelector","ctx"],"sources":["../src/packages/react-components/react-dialog/src/contexts/dialogContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport { DialogSurfaceElement } from '../DialogSurface';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { DialogModalType, DialogOpenChangeData } from '../Dialog';\n\nexport type DialogContextValue = {\n open: boolean;\n inertTrapFocus: boolean;\n dialogTitleId?: string;\n isNestedDialog: boolean;\n dialogRef: React.Ref<DialogSurfaceElement>;\n modalType: DialogModalType;\n /**\n * Requests dialog main component to update it's internal open state\n */\n requestOpenChange: (data: DialogOpenChangeData) => void;\n};\n\nconst defaultContextValue: DialogContextValue = {\n open: false,\n inertTrapFocus: false,\n modalType: 'modal',\n isNestedDialog: false,\n dialogRef: { current: null },\n requestOpenChange() {\n /* noop */\n },\n};\n\n// Contexts should default to undefined\nexport const DialogContext: Context<DialogContextValue | undefined> = createContext<DialogContextValue | undefined>(\n undefined,\n);\n\nexport const DialogProvider = DialogContext.Provider;\nexport const useDialogContext_unstable = <T>(selector: ContextSelector<DialogContextValue, T>): T =>\n useContextSelector(DialogContext, (ctx = defaultContextValue) => selector(ctx));\n"],"mappings":";;;;;;AACA,MAAAA,wBAAA,gBAAAC,OAAA;AAkBA,MAAMC,mBAAmB,GAAuB;EAC9CC,IAAI,EAAE,KAAK;EACXC,cAAc,EAAE,KAAK;EACrBC,SAAS,EAAE,OAAO;EAClBC,cAAc,EAAE,KAAK;EACrBC,SAAS,EAAE;IAAEC,OAAO,EAAE;EAAI,CAAE;EAC5BC,iBAAiBA,CAAA;IACf;EAAA;CAEH;AAED;AACaC,OAAA,CAAAC,aAAa,gBAA4CX,wBAAA,CAAAY,aAAa,CACjFC,SAAS,CACV;AAEYH,OAAA,CAAAI,cAAc,GAAGJ,OAAA,CAAAC,aAAa,CAACI,QAAQ;AAC7C,MAAMC,yBAAyB,GAAOC,QAAgD,IAC3FjB,wBAAA,CAAAkB,kBAAkB,CAACR,OAAA,CAAAC,aAAa,EAAE,CAACQ,GAAG,GAAGjB,mBAAmB,KAAKe,QAAQ,CAACE,GAAG,CAAC,CAAC;AADpET,OAAA,CAAAM,yBAAyB,GAAAA,yBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAIA,MAAMA,mBAAmB,GAA8B,KAAK;AAE/CC,4BAAoB,gBAAGC,qBAAa,CAAwCC,SAAS,CAAC;AAEtFF,6BAAqB,GAAGA,4BAAoB,CAACG,QAAQ;AAE3D,MAAMC,gCAAgC,GAAG,MAAK;EAAA;EAAC,+BAAU,CAACJ,4BAAoB,CAAC,mCAAID,mBAAmB;AAAA;AAAhGC,wCAAgC","names":["defaultContextValue","exports","react_1","undefined","Provider","useDialogSurfaceContext_unstable"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = () => useContext(DialogSurfaceContext) ?? defaultContextValue;\n"]}
1
+ {"version":3,"names":["react_1","require","defaultContextValue","exports","DialogSurfaceContext","createContext","undefined","DialogSurfaceProvider","Provider","useDialogSurfaceContext_unstable","_a","useContext"],"sources":["../src/packages/react-components/react-dialog/src/contexts/dialogSurfaceContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type DialogSurfaceContextValue = boolean;\n\nconst defaultContextValue: DialogSurfaceContextValue = false;\n\nexport const DialogSurfaceContext = createContext<DialogSurfaceContextValue | undefined>(undefined);\n\nexport const DialogSurfaceProvider = DialogSurfaceContext.Provider;\n\nexport const useDialogSurfaceContext_unstable = () => useContext(DialogSurfaceContext) ?? defaultContextValue;\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAIA,MAAMC,mBAAmB,GAA8B,KAAK;AAE/CC,OAAA,CAAAC,oBAAoB,gBAAGJ,OAAA,CAAAK,aAAa,CAAwCC,SAAS,CAAC;AAEtFH,OAAA,CAAAI,qBAAqB,GAAGJ,OAAA,CAAAC,oBAAoB,CAACI,QAAQ;AAE3D,MAAMC,gCAAgC,GAAGA,CAAA,KAAK;EAAA,IAAAC,EAAA;EAAC,QAAAA,EAAA,GAAAV,OAAA,CAAAW,UAAU,CAACR,OAAA,CAAAC,oBAAoB,CAAC,cAAAM,EAAA,cAAAA,EAAA,GAAIR,mBAAmB;AAAA;AAAhGC,OAAA,CAAAM,gCAAgC,GAAAA,gCAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/contexts/index.ts"],"sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/contexts/index.ts"],"sourcesContent":["export * from './constants';\nexport * from './dialogContext';\nexport * from './dialogSurfaceContext';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,iBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,qBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,sBAAM;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,qCAAqB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kCAAkB;EAAA;AAAA;AAU1D;AAASF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gDAAyB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mDAA4B;EAAA;AAAA;AAQ/E;AACEF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,gDAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,sDAA+B;EAAA;AAAA;AAC/BF;EAAAC;EAAAC;IAAA,mDAA4B;EAAA;AAAA;AAS9B;AACEF;EAAAC;EAAAC;IAAA,8BAAU;EAAA;AAAA;AACVF;EAAAC;EAAAC;IAAA,wCAAoB;EAAA;AAAA;AACpBF;EAAAC;EAAAC;IAAA,0CAAsB;EAAA;AAAA;AACtBF;EAAAC;EAAAC;IAAA,gDAA4B;EAAA;AAAA;AAC5BF;EAAAC;EAAAC;IAAA,6CAAyB;EAAA;AAAA;AAI3B;AACEF;EAAAC;EAAAC;IAAA,gCAAW;EAAA;AAAA;AACXF;EAAAC;EAAAC;IAAA,0CAAqB;EAAA;AAAA;AACrBF;EAAAC;EAAAC;IAAA,4CAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,kDAA6B;EAAA;AAAA;AAC7BF;EAAAC;EAAAC;IAAA,+CAA0B;EAAA;AAAA;AAI5B;AACEF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,gDAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,sDAA+B;EAAA;AAAA;AAC/BF;EAAAC;EAAAC;IAAA,mDAA4B;EAAA;AAAA;AAI9B;AACEF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,gDAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,sDAA+B;EAAA;AAAA;AAC/BF;EAAAC;EAAAC;IAAA,mDAA4B;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/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"]}
1
+ {"version":3,"names":["Dialog_1","require","Object","defineProperty","exports","enumerable","get","Dialog","renderDialog_unstable","useDialog_unstable","DialogTrigger_1","DialogTrigger","useDialogTrigger_unstable","renderDialogTrigger_unstable","DialogActions_1","DialogActions","dialogActionsClassNames","useDialogActions_unstable","useDialogActionsStyles_unstable","renderDialogActions_unstable","DialogBody_1","DialogBody","dialogBodyClassNames","useDialogBody_unstable","useDialogBodyStyles_unstable","renderDialogBody_unstable","DialogTitle_1","DialogTitle","dialogTitleClassNames","useDialogTitle_unstable","useDialogTitleStyles_unstable","renderDialogTitle_unstable","DialogSurface_1","DialogSurface","dialogSurfaceClassNames","useDialogSurface_unstable","useDialogSurfaceStyles_unstable","renderDialogSurface_unstable","DialogContent_1","DialogContent","dialogContentClassNames","useDialogContent_unstable","useDialogContentStyles_unstable","renderDialogContent_unstable"],"sources":["../src/packages/react-components/react-dialog/src/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"],"mappings":";;;;;;AAAA,IAAAA,QAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAA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AA;AACvBtC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAgC,eAAA,CAAAG,yBAAyB;EAAA;AAAA;AACzBvC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAgC,eAAA,CAAAI,+BAA+B;EAAA;AAAA;AAC/BxC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAgC,eAAA,CAAAK,4BAA4B;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/utils/index.ts"],"sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-dialog/src/utils/index.ts"],"sourcesContent":["export * from './isEscapeKeyDown';\nexport * from './useDisableBodyScroll';\nexport * from './useFocusFirstElement';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,uBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAIA;;;AAGA,SAAgBA,kBAAkB,CAChCC,KAAgD,EAChDC,SAA0B;EAE1B,OAAOD,KAAK,CAACE,GAAG,KAAKC,sBAAM,IAAIF,SAAS,KAAK,OAAO,IAAI,CAACD,KAAK,CAACI,kBAAkB,EAAE;AACrF;AALAC","names":["isEscapeKeyDismiss","event","modalType","key","keyboard_keys_1","isDefaultPrevented","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\n\n/**\n * Checks if keydown event is a proper Escape key dismiss\n */\nexport function isEscapeKeyDismiss(\n event: React.KeyboardEvent<DialogSurfaceElement>,\n modalType: DialogModalType,\n): boolean {\n return event.key === Escape && modalType !== 'alert' && !event.isDefaultPrevented();\n}\n"]}
1
+ {"version":3,"names":["keyboard_keys_1","require","isEscapeKeyDismiss","event","modalType","key","Escape","isDefaultPrevented","exports"],"sources":["../src/packages/react-components/react-dialog/src/utils/isEscapeKeyDown.ts"],"sourcesContent":["import * as React from 'react';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { DialogModalType } from '../components/Dialog/Dialog.types';\nimport { DialogSurfaceElement } from '../DialogSurface';\n\n/**\n * Checks if keydown event is a proper Escape key dismiss\n */\nexport function isEscapeKeyDismiss(\n event: React.KeyboardEvent<DialogSurfaceElement>,\n modalType: DialogModalType,\n): boolean {\n return event.key === Escape && modalType !== 'alert' && !event.isDefaultPrevented();\n}\n"],"mappings":";;;;;;AACA,MAAAA,eAAA,gBAAAC,OAAA;AAIA;;;AAGA,SAAgBC,kBAAkBA,CAChCC,KAAgD,EAChDC,SAA0B;EAE1B,OAAOD,KAAK,CAACE,GAAG,KAAKL,eAAA,CAAAM,MAAM,IAAIF,SAAS,KAAK,OAAO,IAAI,CAACD,KAAK,CAACI,kBAAkB,EAAE;AACrF;AALAC,OAAA,CAAAN,kBAAA,GAAAA,kBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AAEA,MAAMA,wBAAwB,GAAG,8BAAuC;AAUxE;;;AAGA,SAAgBC,oBAAoB;EAClC,MAAM;IAAEC;EAAc,CAAE,GAAGC,0CAAkB,EAAE;EAC/C,OAAOC,mBAAW,CAAC,MAAK;IACtB,IAAIF,cAAc,EAAE;MAClB,OAAOG,aAAa,CAACH,cAAc,CAACI,IAAI,CAAC;;EAE7C,CAAC,EAAE,CAACJ,cAAc,CAAC,CAAC;AACtB;AAPAK;AASA;;;;;AAKA,SAAgBF,aAAa,CAACG,MAAmB;;EAC/C,MAAM;IAAEC;EAAW,CAAE,GAAGD,MAAM,CAACE,aAAa,CAACC,eAAe;EAC5D,MAAMC,UAAU,GAAG,kBAAM,CAACF,aAAa,CAACG,WAAW,0CAAED,UAAU,mCAAI,CAAC;EACpEE,4BAA4B,CAACN,MAAM,CAAC;EACpC,IAAIA,MAAM,CAACR,wBAAwB,CAAC,CAACe,KAAK,KAAK,CAAC,EAAE;IAChDP,MAAM,CAACQ,KAAK,CAACC,QAAQ,GAAG,QAAQ;IAChCT,MAAM,CAACQ,KAAK,CAACE,YAAY,GAAG,GAAGN,UAAU,GAAGH,WAAW,IAAI;;EAE7DD,MAAM,CAACR,wBAAwB,CAAC,CAACe,KAAK,EAAE;EACxC,OAAO,MAAK;IACVP,MAAM,CAACR,wBAAwB,CAAC,CAACe,KAAK,EAAE;IACxC,IAAIP,MAAM,CAACR,wBAAwB,CAAC,CAACe,KAAK,KAAK,CAAC,EAAE;MAChDP,MAAM,CAACQ,KAAK,CAACC,QAAQ,GAAGT,MAAM,CAACR,wBAAwB,CAAC,CAACmB,qBAAqB;MAC9EX,MAAM,CAACQ,KAAK,CAACE,YAAY,GAAGV,MAAM,CAACR,wBAAwB,CAAC,CAACoB,yBAAyB;;EAE1F,CAAC;AACH;AAhBAb;AAkBA,SAASO,4BAA4B,CAACO,OAAoB;;;EACxD,YAACA,OAAsC,EAACrB,wBAAwB,uCAAxBA,wBAAwB,IAAM;IACpEe,KAAK,EAAE,CAAC;IACRI,qBAAqB,EAAEE,OAAO,CAACL,KAAK,CAACC,QAAQ;IAC7CG,yBAAyB,EAAEC,OAAO,CAACL,KAAK,CAACE;GAC1C;AACH","names":["disableScrollElementProp","useDisableBodyScroll","targetDocument","react_shared_contexts_1","react_1","disableScroll","body","exports","target","clientWidth","ownerDocument","documentElement","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/utils/useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"]}
1
+ {"version":3,"names":["react_shared_contexts_1","require","react_1","disableScrollElementProp","useDisableBodyScroll","targetDocument","useFluent_unstable","useCallback","disableScroll","body","exports","target","clientWidth","ownerDocument","documentElement","innerWidth","_b","_a","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element"],"sources":["../src/packages/react-components/react-dialog/src/utils/useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"],"mappings":";;;;;;AAAA,MAAAA,uBAAA,gBAAAC,OAAA;AACA,MAAAC,OAAA,gBA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,IAAI,CACV,CACE,mGAAmG,EACnG,kGAAkG,CACnG,CAACC,IAAI,CAAC,IAAI,CAAC,CACb;;;EAGP,CAAC,EAAE,CAAClB,kBAAkB,EAAEF,IAAI,EAAEC,SAAS,EAAEG,cAAc,CAAC,CAAC;EAEzD,OAAOE,SAAS;AAClB;AA7BAe","names":["useFocusFirstElement","open","modalType","findFirstFocusable","react_tabster_1","targetDocument","react_shared_contexts_1","dialogRef","React","useRef","triggerRef","useEffect","current","focus","activeElement","element","process","env","NODE_ENV","console","warn","join","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-dialog/src/utils/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 const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\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(\n [\n '@fluentui/react-dialog: 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 ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"]}
1
+ {"version":3,"names":["React","require","react_tabster_1","react_shared_contexts_1","useFocusFirstElement","open","modalType","findFirstFocusable","useFocusFinders","targetDocument","useFluent_unstable","dialogRef","useRef","triggerRef","useEffect","_a","current","focus","activeElement","element","_b","process","env","NODE_ENV","console","warn","join","exports"],"sources":["../src/packages/react-components/react-dialog/src/utils/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 const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\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(\n [\n '@fluentui/react-dialog: 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 ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,eAAA,gBAAAD,OAAA;AACA,MAAAE,uBAAA,gBAAAF,OAAA;AAIA;;;AAGA,SAAgBG,oBAAoBA,CAACC,IAAa,EAAEC,SAA0B;EAC5E,MAAM;IAAEC;EAAkB,CAAE,GAAGL,eAAA,CAAAM,eAAe,EAAE;EAChD,MAAM;IAAEC;EAAc,CAAE,GAAGN,uBAAA,CAAAO,kBAAkB,EAAE;EAC/C,MAAMC,SAAS,GAAGX,KAAK,CAACY,MAAM,CAAuB,IAAI,CAAC;EAC1D,MAAMC,UAAU,GAAGb,KAAK,CAACY,MAAM,EAAe;EAE9CZ,KAAK,CAACc,SAAS,CAAC,MAAK;;IACnB,IAAI,CAACT,IAAI,EAAE;MACT,OAAO,CAAAU,EAAA,GAAAF,UAAU,CAACG,OAAO,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,KAAK,EAAE;;IAEpCJ,UAAU,CAACG,OAAO,GAAGP,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAES,aAAwC;IAC7E,MAAMC,OAAO,GAAGR,SAAS,CAACK,OAAO,IAAIT,kBAAkB,CAACI,SAAS,CAACK,OAAO,CAAC;IAC1E,IAAIG,OAAO,EAAE;MACXA,OAAO,CAACF,KAAK,EAAE;KAChB,MAAM;MACL,CAAAG,EAAA,GAAAT,SAAS,CAACK,OAAO,cAAAI,EAAA,uBAAAA,EAAA,CAAEH,KAAK,EAAE,CAAC,CAAC;MAC5B,IAAII,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACzC;QACAC,OAAO,CAACC,IAAI,CACV,CACE,mGAAmG,EACnG,kGAAkG,CACnG,CAACC,IAAI,CAAC,IAAI,CAAC,CACb;;;EAGP,CAAC,EAAE,CAACnB,kBAAkB,EAAEF,IAAI,EAAEC,SAAS,EAAEG,cAAc,CAAC,CAAC;EAEzD,OAAOE,SAAS;AAClB;AA7BAgB,OAAA,CAAAvB,oBAAA,GAAAA,oBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.1.16",
3
+ "version": "9.3.0",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@griffel/react": "^1.5.2",
39
- "@fluentui/react-utilities": "^9.6.0",
39
+ "@fluentui/react-utilities": "^9.6.2",
40
40
  "@fluentui/keyboard-keys": "^9.0.1",
41
- "@fluentui/react-context-selector": "^9.1.10",
42
- "@fluentui/react-shared-contexts": "^9.2.0",
43
- "@fluentui/react-aria": "^9.3.10",
41
+ "@fluentui/react-context-selector": "^9.1.12",
42
+ "@fluentui/react-shared-contexts": "^9.3.0",
43
+ "@fluentui/react-aria": "^9.3.12",
44
44
  "@fluentui/react-icons": "^2.0.175",
45
- "@fluentui/react-tabster": "^9.5.3",
45
+ "@fluentui/react-tabster": "^9.5.5",
46
46
  "@fluentui/react-theme": "^9.1.5",
47
- "@fluentui/react-portal": "^9.1.9",
47
+ "@fluentui/react-portal": "^9.1.11",
48
48
  "tslib": "^2.1.0"
49
49
  },
50
50
  "peerDependencies": {