@react-spectrum/dialog 3.8.8 → 3.8.10

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 (221) hide show
  1. package/dist/AlertDialog.main.js +98 -0
  2. package/dist/AlertDialog.main.js.map +1 -0
  3. package/dist/AlertDialog.mjs +93 -0
  4. package/dist/AlertDialog.module.js +93 -0
  5. package/dist/AlertDialog.module.js.map +1 -0
  6. package/dist/Dialog.main.js +135 -0
  7. package/dist/Dialog.main.js.map +1 -0
  8. package/dist/Dialog.mjs +130 -0
  9. package/dist/Dialog.module.js +130 -0
  10. package/dist/Dialog.module.js.map +1 -0
  11. package/dist/DialogContainer.main.js +63 -0
  12. package/dist/DialogContainer.main.js.map +1 -0
  13. package/dist/DialogContainer.mjs +54 -0
  14. package/dist/DialogContainer.module.js +54 -0
  15. package/dist/DialogContainer.module.js.map +1 -0
  16. package/dist/DialogTrigger.main.js +162 -0
  17. package/dist/DialogTrigger.main.js.map +1 -0
  18. package/dist/DialogTrigger.mjs +153 -0
  19. package/dist/DialogTrigger.module.js +153 -0
  20. package/dist/DialogTrigger.module.js.map +1 -0
  21. package/dist/ar-AE.main.js +7 -0
  22. package/dist/ar-AE.main.js.map +1 -0
  23. package/dist/ar-AE.mjs +9 -0
  24. package/dist/ar-AE.module.js +9 -0
  25. package/dist/ar-AE.module.js.map +1 -0
  26. package/dist/bg-BG.main.js +7 -0
  27. package/dist/bg-BG.main.js.map +1 -0
  28. package/dist/bg-BG.mjs +9 -0
  29. package/dist/bg-BG.module.js +9 -0
  30. package/dist/bg-BG.module.js.map +1 -0
  31. package/dist/context.main.js +27 -0
  32. package/dist/context.main.js.map +1 -0
  33. package/dist/context.mjs +18 -0
  34. package/dist/context.module.js +18 -0
  35. package/dist/context.module.js.map +1 -0
  36. package/dist/cs-CZ.main.js +7 -0
  37. package/dist/cs-CZ.main.js.map +1 -0
  38. package/dist/cs-CZ.mjs +9 -0
  39. package/dist/cs-CZ.module.js +9 -0
  40. package/dist/cs-CZ.module.js.map +1 -0
  41. package/dist/da-DK.main.js +7 -0
  42. package/dist/da-DK.main.js.map +1 -0
  43. package/dist/da-DK.mjs +9 -0
  44. package/dist/da-DK.module.js +9 -0
  45. package/dist/da-DK.module.js.map +1 -0
  46. package/dist/de-DE.main.js +7 -0
  47. package/dist/de-DE.main.js.map +1 -0
  48. package/dist/de-DE.mjs +9 -0
  49. package/dist/de-DE.module.js +9 -0
  50. package/dist/de-DE.module.js.map +1 -0
  51. package/dist/dialog_vars_css.main.js +161 -0
  52. package/dist/dialog_vars_css.main.js.map +1 -0
  53. package/dist/dialog_vars_css.mjs +163 -0
  54. package/dist/dialog_vars_css.module.js +163 -0
  55. package/dist/dialog_vars_css.module.js.map +1 -0
  56. package/dist/el-GR.main.js +7 -0
  57. package/dist/el-GR.main.js.map +1 -0
  58. package/dist/el-GR.mjs +9 -0
  59. package/dist/el-GR.module.js +9 -0
  60. package/dist/el-GR.module.js.map +1 -0
  61. package/dist/en-US.main.js +7 -0
  62. package/dist/en-US.main.js.map +1 -0
  63. package/dist/en-US.mjs +9 -0
  64. package/dist/en-US.module.js +9 -0
  65. package/dist/en-US.module.js.map +1 -0
  66. package/dist/es-ES.main.js +7 -0
  67. package/dist/es-ES.main.js.map +1 -0
  68. package/dist/es-ES.mjs +9 -0
  69. package/dist/es-ES.module.js +9 -0
  70. package/dist/es-ES.module.js.map +1 -0
  71. package/dist/et-EE.main.js +7 -0
  72. package/dist/et-EE.main.js.map +1 -0
  73. package/dist/et-EE.mjs +9 -0
  74. package/dist/et-EE.module.js +9 -0
  75. package/dist/et-EE.module.js.map +1 -0
  76. package/dist/fi-FI.main.js +7 -0
  77. package/dist/fi-FI.main.js.map +1 -0
  78. package/dist/fi-FI.mjs +9 -0
  79. package/dist/fi-FI.module.js +9 -0
  80. package/dist/fi-FI.module.js.map +1 -0
  81. package/dist/fr-FR.main.js +7 -0
  82. package/dist/fr-FR.main.js.map +1 -0
  83. package/dist/fr-FR.mjs +9 -0
  84. package/dist/fr-FR.module.js +9 -0
  85. package/dist/fr-FR.module.js.map +1 -0
  86. package/dist/he-IL.main.js +7 -0
  87. package/dist/he-IL.main.js.map +1 -0
  88. package/dist/he-IL.mjs +9 -0
  89. package/dist/he-IL.module.js +9 -0
  90. package/dist/he-IL.module.js.map +1 -0
  91. package/dist/hr-HR.main.js +7 -0
  92. package/dist/hr-HR.main.js.map +1 -0
  93. package/dist/hr-HR.mjs +9 -0
  94. package/dist/hr-HR.module.js +9 -0
  95. package/dist/hr-HR.module.js.map +1 -0
  96. package/dist/hu-HU.main.js +7 -0
  97. package/dist/hu-HU.main.js.map +1 -0
  98. package/dist/hu-HU.mjs +9 -0
  99. package/dist/hu-HU.module.js +9 -0
  100. package/dist/hu-HU.module.js.map +1 -0
  101. package/dist/import.mjs +5 -862
  102. package/dist/intlStrings.main.js +108 -0
  103. package/dist/intlStrings.main.js.map +1 -0
  104. package/dist/intlStrings.mjs +110 -0
  105. package/dist/intlStrings.module.js +110 -0
  106. package/dist/intlStrings.module.js.map +1 -0
  107. package/dist/it-IT.main.js +7 -0
  108. package/dist/it-IT.main.js.map +1 -0
  109. package/dist/it-IT.mjs +9 -0
  110. package/dist/it-IT.module.js +9 -0
  111. package/dist/it-IT.module.js.map +1 -0
  112. package/dist/ja-JP.main.js +7 -0
  113. package/dist/ja-JP.main.js.map +1 -0
  114. package/dist/ja-JP.mjs +9 -0
  115. package/dist/ja-JP.module.js +9 -0
  116. package/dist/ja-JP.module.js.map +1 -0
  117. package/dist/ko-KR.main.js +7 -0
  118. package/dist/ko-KR.main.js.map +1 -0
  119. package/dist/ko-KR.mjs +9 -0
  120. package/dist/ko-KR.module.js +9 -0
  121. package/dist/ko-KR.module.js.map +1 -0
  122. package/dist/lt-LT.main.js +7 -0
  123. package/dist/lt-LT.main.js.map +1 -0
  124. package/dist/lt-LT.mjs +9 -0
  125. package/dist/lt-LT.module.js +9 -0
  126. package/dist/lt-LT.module.js.map +1 -0
  127. package/dist/lv-LV.main.js +7 -0
  128. package/dist/lv-LV.main.js.map +1 -0
  129. package/dist/lv-LV.mjs +9 -0
  130. package/dist/lv-LV.module.js +9 -0
  131. package/dist/lv-LV.module.js.map +1 -0
  132. package/dist/main.js +10 -863
  133. package/dist/main.js.map +1 -1
  134. package/dist/module.js +5 -862
  135. package/dist/module.js.map +1 -1
  136. package/dist/nb-NO.main.js +7 -0
  137. package/dist/nb-NO.main.js.map +1 -0
  138. package/dist/nb-NO.mjs +9 -0
  139. package/dist/nb-NO.module.js +9 -0
  140. package/dist/nb-NO.module.js.map +1 -0
  141. package/dist/nl-NL.main.js +7 -0
  142. package/dist/nl-NL.main.js.map +1 -0
  143. package/dist/nl-NL.mjs +9 -0
  144. package/dist/nl-NL.module.js +9 -0
  145. package/dist/nl-NL.module.js.map +1 -0
  146. package/dist/pl-PL.main.js +7 -0
  147. package/dist/pl-PL.main.js.map +1 -0
  148. package/dist/pl-PL.mjs +9 -0
  149. package/dist/pl-PL.module.js +9 -0
  150. package/dist/pl-PL.module.js.map +1 -0
  151. package/dist/pt-BR.main.js +7 -0
  152. package/dist/pt-BR.main.js.map +1 -0
  153. package/dist/pt-BR.mjs +9 -0
  154. package/dist/pt-BR.module.js +9 -0
  155. package/dist/pt-BR.module.js.map +1 -0
  156. package/dist/pt-PT.main.js +7 -0
  157. package/dist/pt-PT.main.js.map +1 -0
  158. package/dist/pt-PT.mjs +9 -0
  159. package/dist/pt-PT.module.js +9 -0
  160. package/dist/pt-PT.module.js.map +1 -0
  161. package/dist/ro-RO.main.js +7 -0
  162. package/dist/ro-RO.main.js.map +1 -0
  163. package/dist/ro-RO.mjs +9 -0
  164. package/dist/ro-RO.module.js +9 -0
  165. package/dist/ro-RO.module.js.map +1 -0
  166. package/dist/ru-RU.main.js +7 -0
  167. package/dist/ru-RU.main.js.map +1 -0
  168. package/dist/ru-RU.mjs +9 -0
  169. package/dist/ru-RU.module.js +9 -0
  170. package/dist/ru-RU.module.js.map +1 -0
  171. package/dist/sk-SK.main.js +7 -0
  172. package/dist/sk-SK.main.js.map +1 -0
  173. package/dist/sk-SK.mjs +9 -0
  174. package/dist/sk-SK.module.js +9 -0
  175. package/dist/sk-SK.module.js.map +1 -0
  176. package/dist/sl-SI.main.js +7 -0
  177. package/dist/sl-SI.main.js.map +1 -0
  178. package/dist/sl-SI.mjs +9 -0
  179. package/dist/sl-SI.module.js +9 -0
  180. package/dist/sl-SI.module.js.map +1 -0
  181. package/dist/sr-SP.main.js +7 -0
  182. package/dist/sr-SP.main.js.map +1 -0
  183. package/dist/sr-SP.mjs +9 -0
  184. package/dist/sr-SP.module.js +9 -0
  185. package/dist/sr-SP.module.js.map +1 -0
  186. package/dist/sv-SE.main.js +7 -0
  187. package/dist/sv-SE.main.js.map +1 -0
  188. package/dist/sv-SE.mjs +9 -0
  189. package/dist/sv-SE.module.js +9 -0
  190. package/dist/sv-SE.module.js.map +1 -0
  191. package/dist/tr-TR.main.js +7 -0
  192. package/dist/tr-TR.main.js.map +1 -0
  193. package/dist/tr-TR.mjs +9 -0
  194. package/dist/tr-TR.module.js +9 -0
  195. package/dist/tr-TR.module.js.map +1 -0
  196. package/dist/types.d.ts +3 -2
  197. package/dist/types.d.ts.map +1 -1
  198. package/dist/uk-UA.main.js +7 -0
  199. package/dist/uk-UA.main.js.map +1 -0
  200. package/dist/uk-UA.mjs +9 -0
  201. package/dist/uk-UA.module.js +9 -0
  202. package/dist/uk-UA.module.js.map +1 -0
  203. package/dist/useDialogContainer.main.js +34 -0
  204. package/dist/useDialogContainer.main.js.map +1 -0
  205. package/dist/useDialogContainer.mjs +29 -0
  206. package/dist/useDialogContainer.module.js +29 -0
  207. package/dist/useDialogContainer.module.js.map +1 -0
  208. package/dist/vars.6a3d7df3.css +519 -0
  209. package/dist/vars.6a3d7df3.css.map +1 -0
  210. package/dist/zh-CN.main.js +7 -0
  211. package/dist/zh-CN.main.js.map +1 -0
  212. package/dist/zh-CN.mjs +9 -0
  213. package/dist/zh-CN.module.js +9 -0
  214. package/dist/zh-CN.module.js.map +1 -0
  215. package/dist/zh-TW.main.js +7 -0
  216. package/dist/zh-TW.main.js.map +1 -0
  217. package/dist/zh-TW.mjs +9 -0
  218. package/dist/zh-TW.module.js +9 -0
  219. package/dist/zh-TW.module.js.map +1 -0
  220. package/package.json +21 -21
  221. package/dist/main.css +0 -1
@@ -0,0 +1,98 @@
1
+ var $a57fc2323bf98a33$exports = require("./Dialog.main.js");
2
+ var $0eb909ad2388d989$exports = require("./context.main.js");
3
+ var $7827d180f5c8b41b$exports = require("./intlStrings.main.js");
4
+ require("./vars.6a3d7df3.css");
5
+ var $a74c0984b1adb651$exports = require("./dialog_vars_css.main.js");
6
+ var $cXXKy$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
7
+ var $cXXKy$reactspectrumbutton = require("@react-spectrum/button");
8
+ var $cXXKy$reactspectrumbuttongroup = require("@react-spectrum/buttongroup");
9
+ var $cXXKy$reactariautils = require("@react-aria/utils");
10
+ var $cXXKy$reactspectrumutils = require("@react-spectrum/utils");
11
+ var $cXXKy$reactspectrumview = require("@react-spectrum/view");
12
+ var $cXXKy$reactspectrumdivider = require("@react-spectrum/divider");
13
+ var $cXXKy$reactspectrumtext = require("@react-spectrum/text");
14
+ var $cXXKy$react = require("react");
15
+ var $cXXKy$reactariai18n = require("@react-aria/i18n");
16
+
17
+
18
+ function $parcel$interopDefault(a) {
19
+ return a && a.__esModule ? a.default : a;
20
+ }
21
+
22
+ function $parcel$export(e, n, v, s) {
23
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
+ }
25
+
26
+ $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de466dd8317b0b75);
27
+ /*
28
+ * Copyright 2020 Adobe. All rights reserved.
29
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
30
+ * you may not use this file except in compliance with the License. You may obtain a copy
31
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
32
+ *
33
+ * Unless required by applicable law or agreed to in writing, software distributed under
34
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
35
+ * OF ANY KIND, either express or implied. See the License for the specific language
36
+ * governing permissions and limitations under the License.
37
+ */
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+ /**
52
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
53
+ */ function $66f8653ff750aa27$var$AlertDialog(props, ref) {
54
+ let { onClose: onClose = ()=>{} } = (0, $cXXKy$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
55
+ let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
56
+ let { styleProps: styleProps } = (0, $cXXKy$reactspectrumutils.useStyleProps)(otherProps);
57
+ let stringFormatter = (0, $cXXKy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), "@react-spectrum/dialog");
58
+ let confirmVariant = "primary";
59
+ if (variant) {
60
+ if (variant === "confirmation") confirmVariant = "cta";
61
+ else if (variant === "destructive") confirmVariant = "negative";
62
+ }
63
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $a57fc2323bf98a33$exports.Dialog), {
64
+ UNSAFE_style: styleProps.style,
65
+ UNSAFE_className: (0, $cXXKy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), {
66
+ [`spectrum-Dialog--${variant}`]: variant
67
+ }, styleProps.className),
68
+ isHidden: styleProps.hidden,
69
+ size: "M",
70
+ role: "alertdialog",
71
+ ref: ref
72
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumtext.Heading), null, title), (variant === "error" || variant === "warning") && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, ($parcel$interopDefault($cXXKy$spectrumiconsuiAlertMedium))), {
73
+ slot: "typeIcon",
74
+ "aria-label": stringFormatter.format("alert")
75
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumdivider.Divider), null), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumview.Content), null, children), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbuttongroup.ButtonGroup), {
76
+ align: "end"
77
+ }, cancelLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
78
+ variant: "secondary",
79
+ onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onCancel()),
80
+ autoFocus: autoFocusButton === "cancel"
81
+ }, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
82
+ variant: "secondary",
83
+ onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onSecondaryAction()),
84
+ isDisabled: isSecondaryActionDisabled,
85
+ autoFocus: autoFocusButton === "secondary"
86
+ }, secondaryActionLabel), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
87
+ variant: confirmVariant,
88
+ onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onPrimaryAction()),
89
+ isDisabled: isPrimaryActionDisabled,
90
+ autoFocus: autoFocusButton === "primary"
91
+ }, primaryActionLabel)));
92
+ }
93
+ /**
94
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
95
+ */ let $66f8653ff750aa27$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $cXXKy$react.forwardRef)($66f8653ff750aa27$var$AlertDialog);
96
+
97
+
98
+ //# sourceMappingURL=AlertDialog.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,0DAAC,CAAA,GAAA,gCAAK;QACJ,cAAc,WAAW,KAAK;QAC9B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;qBACL,0DAAC,CAAA,GAAA,gCAAM,SAAG,QACT,AAAC,CAAA,YAAY,WAAW,YAAY,SAAQ,mBAC3C,0DAAC,CAAA,GAAA,2DAAU;QACT,MAAK;QACL,cAAY,gBAAgB,MAAM,CAAC;sBAEvC,0DAAC,CAAA,GAAA,mCAAM,wBACP,0DAAC,CAAA,GAAA,gCAAM,SAAG,yBACV,0DAAC,CAAA,GAAA,2CAAU;QAAE,OAAM;OAChB,6BACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;OAC9B,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/dialog/src/AlertDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nfunction AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
@@ -0,0 +1,93 @@
1
+ import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.mjs";
2
+ import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
3
+ import $7TaMJ$intlStringsmodulejs from "./intlStrings.mjs";
4
+ import "./vars.6a3d7df3.css";
5
+ import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.mjs";
6
+ import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
7
+ import {Button as $7TaMJ$Button} from "@react-spectrum/button";
8
+ import {ButtonGroup as $7TaMJ$ButtonGroup} from "@react-spectrum/buttongroup";
9
+ import {chain as $7TaMJ$chain} from "@react-aria/utils";
10
+ import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames} from "@react-spectrum/utils";
11
+ import {Content as $7TaMJ$Content} from "@react-spectrum/view";
12
+ import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
13
+ import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
14
+ import $7TaMJ$react, {useContext as $7TaMJ$useContext, forwardRef as $7TaMJ$forwardRef} from "react";
15
+ import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
16
+
17
+
18
+ function $parcel$interopDefault(a) {
19
+ return a && a.__esModule ? a.default : a;
20
+ }
21
+ /*
22
+ * Copyright 2020 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ /**
46
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
47
+ */ function $2a8395160fff9af3$var$AlertDialog(props, ref) {
48
+ let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
+ let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
50
+ let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
51
+ let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), "@react-spectrum/dialog");
52
+ let confirmVariant = "primary";
53
+ if (variant) {
54
+ if (variant === "confirmation") confirmVariant = "cta";
55
+ else if (variant === "destructive") confirmVariant = "negative";
56
+ }
57
+ return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
58
+ UNSAFE_style: styleProps.style,
59
+ UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
60
+ [`spectrum-Dialog--${variant}`]: variant
61
+ }, styleProps.className),
62
+ isHidden: styleProps.hidden,
63
+ size: "M",
64
+ role: "alertdialog",
65
+ ref: ref
66
+ }, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === "error" || variant === "warning") && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
67
+ slot: "typeIcon",
68
+ "aria-label": stringFormatter.format("alert")
69
+ }), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
70
+ align: "end"
71
+ }, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
72
+ variant: "secondary",
73
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
74
+ autoFocus: autoFocusButton === "cancel"
75
+ }, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
76
+ variant: "secondary",
77
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
78
+ isDisabled: isSecondaryActionDisabled,
79
+ autoFocus: autoFocusButton === "secondary"
80
+ }, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
81
+ variant: confirmVariant,
82
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
83
+ isDisabled: isPrimaryActionDisabled,
84
+ autoFocus: autoFocusButton === "primary"
85
+ }, primaryActionLabel)));
86
+ }
87
+ /**
88
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
89
+ */ let $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)($2a8395160fff9af3$var$AlertDialog);
90
+
91
+
92
+ export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
93
+ //# sourceMappingURL=AlertDialog.mjs.map
@@ -0,0 +1,93 @@
1
+ import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.module.js";
2
+ import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.module.js";
3
+ import $7TaMJ$intlStringsmodulejs from "./intlStrings.module.js";
4
+ import "./vars.6a3d7df3.css";
5
+ import $7TaMJ$dialog_vars_cssmodulejs from "./dialog_vars_css.module.js";
6
+ import $7TaMJ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
7
+ import {Button as $7TaMJ$Button} from "@react-spectrum/button";
8
+ import {ButtonGroup as $7TaMJ$ButtonGroup} from "@react-spectrum/buttongroup";
9
+ import {chain as $7TaMJ$chain} from "@react-aria/utils";
10
+ import {useStyleProps as $7TaMJ$useStyleProps, classNames as $7TaMJ$classNames} from "@react-spectrum/utils";
11
+ import {Content as $7TaMJ$Content} from "@react-spectrum/view";
12
+ import {Divider as $7TaMJ$Divider} from "@react-spectrum/divider";
13
+ import {Heading as $7TaMJ$Heading} from "@react-spectrum/text";
14
+ import $7TaMJ$react, {useContext as $7TaMJ$useContext, forwardRef as $7TaMJ$forwardRef} from "react";
15
+ import {useLocalizedStringFormatter as $7TaMJ$useLocalizedStringFormatter} from "@react-aria/i18n";
16
+
17
+
18
+ function $parcel$interopDefault(a) {
19
+ return a && a.__esModule ? a.default : a;
20
+ }
21
+ /*
22
+ * Copyright 2020 Adobe. All rights reserved.
23
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
+ * you may not use this file except in compliance with the License. You may obtain a copy
25
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
+ *
27
+ * Unless required by applicable law or agreed to in writing, software distributed under
28
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
+ * OF ANY KIND, either express or implied. See the License for the specific language
30
+ * governing permissions and limitations under the License.
31
+ */
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ /**
46
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
47
+ */ function $2a8395160fff9af3$var$AlertDialog(props, ref) {
48
+ let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
+ let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
50
+ let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
51
+ let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), "@react-spectrum/dialog");
52
+ let confirmVariant = "primary";
53
+ if (variant) {
54
+ if (variant === "confirmation") confirmVariant = "cta";
55
+ else if (variant === "destructive") confirmVariant = "negative";
56
+ }
57
+ return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
58
+ UNSAFE_style: styleProps.style,
59
+ UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
60
+ [`spectrum-Dialog--${variant}`]: variant
61
+ }, styleProps.className),
62
+ isHidden: styleProps.hidden,
63
+ size: "M",
64
+ role: "alertdialog",
65
+ ref: ref
66
+ }, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === "error" || variant === "warning") && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
67
+ slot: "typeIcon",
68
+ "aria-label": stringFormatter.format("alert")
69
+ }), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
70
+ align: "end"
71
+ }, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
72
+ variant: "secondary",
73
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
74
+ autoFocus: autoFocusButton === "cancel"
75
+ }, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
76
+ variant: "secondary",
77
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
78
+ isDisabled: isSecondaryActionDisabled,
79
+ autoFocus: autoFocusButton === "secondary"
80
+ }, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
81
+ variant: confirmVariant,
82
+ onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
83
+ isDisabled: isPrimaryActionDisabled,
84
+ autoFocus: autoFocusButton === "primary"
85
+ }, primaryActionLabel)));
86
+ }
87
+ /**
88
+ * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
89
+ */ let $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)($2a8395160fff9af3$var$AlertDialog);
90
+
91
+
92
+ export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
93
+ //# sourceMappingURL=AlertDialog.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqBD;;CAEC,GACD,SAAS,kCAAY,KAA+B,EAAE,GAAW;IAC/D,IAAI,WACF,UAAU,KAAO,GAClB,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY,MAAM,CAAC;IAElC,IAAI,WACF,OAAO,YACP,QAAQ,sBACR,kBAAkB,wBAClB,oBAAoB,eACpB,WAAW,mBACX,eAAe,SACf,KAAK,2BACL,uBAAuB,6BACvB,yBAAyB,YACzB,WAAW,KAAO,oBAClB,kBAAkB,KAAO,sBACzB,oBAAoB,KAAO,GAC3B,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,iBAAiD;IACrD,IAAI,SAAS;QACX,IAAI,YAAY,gBACd,iBAAiB;aACZ,IAAI,YAAY,eACrB,iBAAiB;IAErB;IAEA,qBACE,gCAAC,CAAA,GAAA,yCAAK;QACJ,cAAc,WAAW,KAAK;QAC9B,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;qBACL,gCAAC,CAAA,GAAA,cAAM,SAAG,QACT,AAAC,CAAA,YAAY,WAAW,YAAY,SAAQ,mBAC3C,gCAAC,CAAA,GAAA,iCAAU;QACT,MAAK;QACL,cAAY,gBAAgB,MAAM,CAAC;sBAEvC,gCAAC,CAAA,GAAA,cAAM,wBACP,gCAAC,CAAA,GAAA,cAAM,SAAG,yBACV,gCAAC,CAAA,GAAA,kBAAU;QAAE,OAAM;OAChB,6BACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,WAAW,oBAAoB;OAC9B,cAGJ,sCACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B,qCAGL,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;OAC9B;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/dialog/src/AlertDialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {Button} from '@react-spectrum/button';\nimport {ButtonGroup} from '@react-spectrum/buttongroup';\nimport {chain} from '@react-aria/utils';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog} from './Dialog';\nimport {DialogContext, DialogContextValue} from './context';\nimport {Divider} from '@react-spectrum/divider';\nimport {DOMRef} from '@react-types/shared';\nimport {Heading} from '@react-spectrum/text';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {forwardRef, useContext} from 'react';\nimport {SpectrumAlertDialogProps} from '@react-types/dialog';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nfunction AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {\n let {\n onClose = () => {}\n } = useContext(DialogContext) || {} as DialogContextValue;\n\n let {\n variant,\n children,\n primaryActionLabel,\n secondaryActionLabel,\n cancelLabel,\n autoFocusButton,\n title,\n isPrimaryActionDisabled,\n isSecondaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n\n let confirmVariant: SpectrumButtonProps['variant'] = 'primary';\n if (variant) {\n if (variant === 'confirmation') {\n confirmVariant = 'cta';\n } else if (variant === 'destructive') {\n confirmVariant = 'negative';\n }\n }\n\n return (\n <Dialog\n UNSAFE_style={styleProps.style}\n UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}\n isHidden={styleProps.hidden}\n size=\"M\"\n role=\"alertdialog\"\n ref={ref}>\n <Heading>{title}</Heading>\n {(variant === 'error' || variant === 'warning') &&\n <AlertMedium\n slot=\"typeIcon\"\n aria-label={stringFormatter.format('alert')} />\n }\n <Divider />\n <Content>{children}</Content>\n <ButtonGroup align=\"end\">\n {cancelLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onCancel())}\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n variant=\"secondary\"\n onPress={() => chain(onClose(), onSecondaryAction())}\n isDisabled={isSecondaryActionDisabled}\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n}\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nlet _AlertDialog = forwardRef(AlertDialog);\nexport {_AlertDialog as AlertDialog};\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}
@@ -0,0 +1,135 @@
1
+ var $0eb909ad2388d989$exports = require("./context.main.js");
2
+ var $7827d180f5c8b41b$exports = require("./intlStrings.main.js");
3
+ require("./vars.6a3d7df3.css");
4
+ var $a74c0984b1adb651$exports = require("./dialog_vars_css.main.js");
5
+ var $1DWg7$reactspectrumbutton = require("@react-spectrum/button");
6
+ var $1DWg7$reactspectrumutils = require("@react-spectrum/utils");
7
+ var $1DWg7$spectrumiconsuiCrossLarge = require("@spectrum-icons/ui/CrossLarge");
8
+ var $1DWg7$reactspectrumlayout = require("@react-spectrum/layout");
9
+ var $1DWg7$reactariautils = require("@react-aria/utils");
10
+ var $1DWg7$react = require("react");
11
+ var $1DWg7$reactariadialog = require("@react-aria/dialog");
12
+ var $1DWg7$reactariai18n = require("@react-aria/i18n");
13
+
14
+
15
+ function $parcel$interopDefault(a) {
16
+ return a && a.__esModule ? a.default : a;
17
+ }
18
+
19
+ function $parcel$export(e, n, v, s) {
20
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
+ }
22
+
23
+ $parcel$export(module.exports, "Dialog", () => $a57fc2323bf98a33$export$3ddf2d174ce01153);
24
+ /*
25
+ * Copyright 2020 Adobe. All rights reserved.
26
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
+ * you may not use this file except in compliance with the License. You may obtain a copy
28
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
+ *
30
+ * Unless required by applicable law or agreed to in writing, software distributed under
31
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
+ * OF ANY KIND, either express or implied. See the License for the specific language
33
+ * governing permissions and limitations under the License.
34
+ */
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ let $a57fc2323bf98a33$var$sizeMap = {
46
+ S: "small",
47
+ M: "medium",
48
+ L: "large",
49
+ fullscreen: "fullscreen",
50
+ fullscreenTakeover: "fullscreenTakeover"
51
+ };
52
+ function $a57fc2323bf98a33$var$Dialog(props, ref) {
53
+ props = (0, $1DWg7$reactspectrumutils.useSlotProps)(props, "dialog");
54
+ let { type: type = "modal", ...contextProps } = (0, $1DWg7$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
55
+ let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
56
+ let stringFormatter = (0, $1DWg7$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), "@react-spectrum/dialog");
57
+ let { styleProps: styleProps } = (0, $1DWg7$reactspectrumutils.useStyleProps)(otherProps);
58
+ size = type === "popover" ? size || "S" : size || "L";
59
+ let domRef = (0, $1DWg7$reactspectrumutils.useDOMRef)(ref);
60
+ let gridRef = (0, $1DWg7$react.useRef)(null);
61
+ let sizeVariant = $a57fc2323bf98a33$var$sizeMap[type] || $a57fc2323bf98a33$var$sizeMap[size];
62
+ let { dialogProps: dialogProps, titleProps: titleProps } = (0, $1DWg7$reactariadialog.useDialog)((0, $1DWg7$reactariautils.mergeProps)(contextProps, props), domRef);
63
+ let hasHeader = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-header"]}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
64
+ let hasHeading = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-heading"]}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
65
+ let hasFooter = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-footer"]}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
66
+ let hasTypeIcon = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-typeIcon"]}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
67
+ let slots = (0, $1DWg7$react.useMemo)(()=>({
68
+ hero: {
69
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-hero"]
70
+ },
71
+ heading: {
72
+ UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), "spectrum-Dialog-heading", {
73
+ "spectrum-Dialog-heading--noHeader": !hasHeader,
74
+ "spectrum-Dialog-heading--noTypeIcon": !hasTypeIcon
75
+ }),
76
+ level: 2,
77
+ ...titleProps
78
+ },
79
+ header: {
80
+ UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), "spectrum-Dialog-header", {
81
+ "spectrum-Dialog-header--noHeading": !hasHeading,
82
+ "spectrum-Dialog-header--noTypeIcon": !hasTypeIcon
83
+ })
84
+ },
85
+ typeIcon: {
86
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-typeIcon"]
87
+ },
88
+ divider: {
89
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-divider"],
90
+ size: "M"
91
+ },
92
+ content: {
93
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-content"]
94
+ },
95
+ footer: {
96
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-footer"]
97
+ },
98
+ buttonGroup: {
99
+ UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), "spectrum-Dialog-buttonGroup", {
100
+ "spectrum-Dialog-buttonGroup--noFooter": !hasFooter
101
+ }),
102
+ align: "end"
103
+ }
104
+ }), [
105
+ hasFooter,
106
+ hasHeader,
107
+ titleProps
108
+ ]);
109
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement("section", {
110
+ ...styleProps,
111
+ ...dialogProps,
112
+ className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), "spectrum-Dialog", {
113
+ [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
114
+ "spectrum-Dialog--dismissable": isDismissable
115
+ }, styleProps.className),
116
+ ref: domRef
117
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumlayout.Grid), {
118
+ ref: gridRef,
119
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-grid"]
120
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumutils.SlotProvider), {
121
+ slots: slots
122
+ }, children), isDismissable && /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumbutton.ActionButton), {
123
+ UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))["spectrum-Dialog-closeButton"],
124
+ isQuiet: true,
125
+ "aria-label": stringFormatter.format("dismiss"),
126
+ onPress: onDismiss
127
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, ($parcel$interopDefault($1DWg7$spectrumiconsuiCrossLarge))), null))));
128
+ }
129
+ /**
130
+ * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
131
+ * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
132
+ */ let $a57fc2323bf98a33$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).forwardRef($a57fc2323bf98a33$var$Dialog);
133
+
134
+
135
+ //# sourceMappingURL=Dialog.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"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","sources":["packages/@react-spectrum/dialog/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {\n classNames,\n SlotProvider,\n unwrapDOMRef,\n useDOMRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DialogContext, DialogContextValue} from './context';\nimport {DOMRef} from '@react-types/shared';\nimport {Grid} from '@react-spectrum/layout';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useContext, useMemo, useRef} from 'react';\nimport {SpectrumDialogProps} from '@react-types/dialog';\nimport styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';\nimport {useDialog} from '@react-aria/dialog';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nlet sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nfunction Dialog(props: SpectrumDialogProps, ref: DOMRef) {\n props = useSlotProps(props, 'dialog');\n let {\n type = 'modal',\n ...contextProps\n } = useContext(DialogContext) || {} as DialogContextValue;\n let {\n children,\n isDismissable = contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n size,\n ...otherProps\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');\n let {styleProps} = useStyleProps(otherProps);\n\n size = type === 'popover' ? (size || 'S') : (size || 'L');\n\n let domRef = useDOMRef(ref);\n let gridRef = useRef(null);\n let sizeVariant = sizeMap[type] || sizeMap[size];\n let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);\n\n let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));\n let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));\n let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));\n let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));\n\n let slots = useMemo(() => ({\n hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},\n heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},\n header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},\n typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},\n divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},\n content: {UNSAFE_className: styles['spectrum-Dialog-content']},\n footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},\n buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [hasFooter, hasHeader, titleProps]);\n\n return (\n <section\n {...styleProps}\n {...dialogProps}\n className={classNames(\n styles,\n 'spectrum-Dialog',\n {\n [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,\n 'spectrum-Dialog--dismissable': isDismissable\n },\n styleProps.className\n )}\n ref={domRef}>\n <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>\n <SlotProvider slots={slots}>\n {children}\n </SlotProvider>\n {isDismissable &&\n <ActionButton\n UNSAFE_className={styles['spectrum-Dialog-closeButton']}\n isQuiet\n aria-label={stringFormatter.format('dismiss')}\n onPress={onDismiss}>\n <CrossLarge />\n </ActionButton>\n }\n </Grid>\n </section>\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = React.forwardRef(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.main.js.map"}
@@ -0,0 +1,130 @@
1
+ import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
2
+ import $3e38X$intlStringsmodulejs from "./intlStrings.mjs";
3
+ import "./vars.6a3d7df3.css";
4
+ import $3e38X$dialog_vars_cssmodulejs from "./dialog_vars_css.mjs";
5
+ import {ActionButton as $3e38X$ActionButton} from "@react-spectrum/button";
6
+ import {useSlotProps as $3e38X$useSlotProps, useStyleProps as $3e38X$useStyleProps, useDOMRef as $3e38X$useDOMRef, useHasChild as $3e38X$useHasChild, unwrapDOMRef as $3e38X$unwrapDOMRef, classNames as $3e38X$classNames, SlotProvider as $3e38X$SlotProvider} from "@react-spectrum/utils";
7
+ import $3e38X$spectrumiconsuiCrossLarge from "@spectrum-icons/ui/CrossLarge";
8
+ import {Grid as $3e38X$Grid} from "@react-spectrum/layout";
9
+ import {mergeProps as $3e38X$mergeProps} from "@react-aria/utils";
10
+ import $3e38X$react, {useContext as $3e38X$useContext, useRef as $3e38X$useRef, useMemo as $3e38X$useMemo} from "react";
11
+ import {useDialog as $3e38X$useDialog} from "@react-aria/dialog";
12
+ import {useLocalizedStringFormatter as $3e38X$useLocalizedStringFormatter} from "@react-aria/i18n";
13
+
14
+
15
+ function $parcel$interopDefault(a) {
16
+ return a && a.__esModule ? a.default : a;
17
+ }
18
+ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ let $99cd51dc4eb569f7$var$sizeMap = {
40
+ S: "small",
41
+ M: "medium",
42
+ L: "large",
43
+ fullscreen: "fullscreen",
44
+ fullscreenTakeover: "fullscreenTakeover"
45
+ };
46
+ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
47
+ props = (0, $3e38X$useSlotProps)(props, "dialog");
48
+ let { type: type = "modal", ...contextProps } = (0, $3e38X$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
49
+ let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
50
+ let stringFormatter = (0, $3e38X$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3e38X$intlStringsmodulejs))), "@react-spectrum/dialog");
51
+ let { styleProps: styleProps } = (0, $3e38X$useStyleProps)(otherProps);
52
+ size = type === "popover" ? size || "S" : size || "L";
53
+ let domRef = (0, $3e38X$useDOMRef)(ref);
54
+ let gridRef = (0, $3e38X$useRef)(null);
55
+ let sizeVariant = $99cd51dc4eb569f7$var$sizeMap[type] || $99cd51dc4eb569f7$var$sizeMap[size];
56
+ let { dialogProps: dialogProps, titleProps: titleProps } = (0, $3e38X$useDialog)((0, $3e38X$mergeProps)(contextProps, props), domRef);
57
+ let hasHeader = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-header"]}`, (0, $3e38X$unwrapDOMRef)(gridRef));
58
+ let hasHeading = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-heading"]}`, (0, $3e38X$unwrapDOMRef)(gridRef));
59
+ let hasFooter = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-footer"]}`, (0, $3e38X$unwrapDOMRef)(gridRef));
60
+ let hasTypeIcon = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-typeIcon"]}`, (0, $3e38X$unwrapDOMRef)(gridRef));
61
+ let slots = (0, $3e38X$useMemo)(()=>({
62
+ hero: {
63
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-hero"]
64
+ },
65
+ heading: {
66
+ UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), "spectrum-Dialog-heading", {
67
+ "spectrum-Dialog-heading--noHeader": !hasHeader,
68
+ "spectrum-Dialog-heading--noTypeIcon": !hasTypeIcon
69
+ }),
70
+ level: 2,
71
+ ...titleProps
72
+ },
73
+ header: {
74
+ UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), "spectrum-Dialog-header", {
75
+ "spectrum-Dialog-header--noHeading": !hasHeading,
76
+ "spectrum-Dialog-header--noTypeIcon": !hasTypeIcon
77
+ })
78
+ },
79
+ typeIcon: {
80
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-typeIcon"]
81
+ },
82
+ divider: {
83
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-divider"],
84
+ size: "M"
85
+ },
86
+ content: {
87
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-content"]
88
+ },
89
+ footer: {
90
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-footer"]
91
+ },
92
+ buttonGroup: {
93
+ UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), "spectrum-Dialog-buttonGroup", {
94
+ "spectrum-Dialog-buttonGroup--noFooter": !hasFooter
95
+ }),
96
+ align: "end"
97
+ }
98
+ }), [
99
+ hasFooter,
100
+ hasHeader,
101
+ titleProps
102
+ ]);
103
+ return /*#__PURE__*/ (0, $3e38X$react).createElement("section", {
104
+ ...styleProps,
105
+ ...dialogProps,
106
+ className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), "spectrum-Dialog", {
107
+ [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
108
+ "spectrum-Dialog--dismissable": isDismissable
109
+ }, styleProps.className),
110
+ ref: domRef
111
+ }, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$Grid), {
112
+ ref: gridRef,
113
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-grid"]
114
+ }, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$SlotProvider), {
115
+ slots: slots
116
+ }, children), isDismissable && /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$ActionButton), {
117
+ UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))["spectrum-Dialog-closeButton"],
118
+ isQuiet: true,
119
+ "aria-label": stringFormatter.format("dismiss"),
120
+ onPress: onDismiss
121
+ }, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$spectrumiconsuiCrossLarge), null))));
122
+ }
123
+ /**
124
+ * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
125
+ * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
126
+ */ let $99cd51dc4eb569f7$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $3e38X$react).forwardRef($99cd51dc4eb569f7$var$Dialog);
127
+
128
+
129
+ export {$99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog};
130
+ //# sourceMappingURL=Dialog.mjs.map