@react-spectrum/dialog 3.9.7 → 3.10.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 (228) hide show
  1. package/dist/import.mjs +5 -7
  2. package/dist/main.js +9 -11
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +5 -7
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +8 -0
  7. package/package.json +12 -43
  8. package/src/index.ts +8 -7
  9. package/dist/AlertDialog.main.js +0 -97
  10. package/dist/AlertDialog.main.js.map +0 -1
  11. package/dist/AlertDialog.mjs +0 -92
  12. package/dist/AlertDialog.module.js +0 -92
  13. package/dist/AlertDialog.module.js.map +0 -1
  14. package/dist/Dialog.main.js +0 -131
  15. package/dist/Dialog.main.js.map +0 -1
  16. package/dist/Dialog.mjs +0 -126
  17. package/dist/Dialog.module.js +0 -126
  18. package/dist/Dialog.module.js.map +0 -1
  19. package/dist/DialogContainer.main.js +0 -63
  20. package/dist/DialogContainer.main.js.map +0 -1
  21. package/dist/DialogContainer.mjs +0 -54
  22. package/dist/DialogContainer.module.js +0 -54
  23. package/dist/DialogContainer.module.js.map +0 -1
  24. package/dist/DialogTrigger.main.js +0 -161
  25. package/dist/DialogTrigger.main.js.map +0 -1
  26. package/dist/DialogTrigger.mjs +0 -152
  27. package/dist/DialogTrigger.module.js +0 -152
  28. package/dist/DialogTrigger.module.js.map +0 -1
  29. package/dist/ar-AE.main.js +0 -7
  30. package/dist/ar-AE.main.js.map +0 -1
  31. package/dist/ar-AE.mjs +0 -9
  32. package/dist/ar-AE.module.js +0 -9
  33. package/dist/ar-AE.module.js.map +0 -1
  34. package/dist/bg-BG.main.js +0 -7
  35. package/dist/bg-BG.main.js.map +0 -1
  36. package/dist/bg-BG.mjs +0 -9
  37. package/dist/bg-BG.module.js +0 -9
  38. package/dist/bg-BG.module.js.map +0 -1
  39. package/dist/context.main.js +0 -27
  40. package/dist/context.main.js.map +0 -1
  41. package/dist/context.mjs +0 -18
  42. package/dist/context.module.js +0 -18
  43. package/dist/context.module.js.map +0 -1
  44. package/dist/cs-CZ.main.js +0 -7
  45. package/dist/cs-CZ.main.js.map +0 -1
  46. package/dist/cs-CZ.mjs +0 -9
  47. package/dist/cs-CZ.module.js +0 -9
  48. package/dist/cs-CZ.module.js.map +0 -1
  49. package/dist/da-DK.main.js +0 -7
  50. package/dist/da-DK.main.js.map +0 -1
  51. package/dist/da-DK.mjs +0 -9
  52. package/dist/da-DK.module.js +0 -9
  53. package/dist/da-DK.module.js.map +0 -1
  54. package/dist/de-DE.main.js +0 -7
  55. package/dist/de-DE.main.js.map +0 -1
  56. package/dist/de-DE.mjs +0 -9
  57. package/dist/de-DE.module.js +0 -9
  58. package/dist/de-DE.module.js.map +0 -1
  59. package/dist/dialog.1f91a33b.css +0 -519
  60. package/dist/dialog.1f91a33b.css.map +0 -1
  61. package/dist/dialog_vars_css.main.js +0 -161
  62. package/dist/dialog_vars_css.main.js.map +0 -1
  63. package/dist/dialog_vars_css.mjs +0 -163
  64. package/dist/dialog_vars_css.module.js +0 -163
  65. package/dist/dialog_vars_css.module.js.map +0 -1
  66. package/dist/el-GR.main.js +0 -7
  67. package/dist/el-GR.main.js.map +0 -1
  68. package/dist/el-GR.mjs +0 -9
  69. package/dist/el-GR.module.js +0 -9
  70. package/dist/el-GR.module.js.map +0 -1
  71. package/dist/en-US.main.js +0 -7
  72. package/dist/en-US.main.js.map +0 -1
  73. package/dist/en-US.mjs +0 -9
  74. package/dist/en-US.module.js +0 -9
  75. package/dist/en-US.module.js.map +0 -1
  76. package/dist/es-ES.main.js +0 -7
  77. package/dist/es-ES.main.js.map +0 -1
  78. package/dist/es-ES.mjs +0 -9
  79. package/dist/es-ES.module.js +0 -9
  80. package/dist/es-ES.module.js.map +0 -1
  81. package/dist/et-EE.main.js +0 -7
  82. package/dist/et-EE.main.js.map +0 -1
  83. package/dist/et-EE.mjs +0 -9
  84. package/dist/et-EE.module.js +0 -9
  85. package/dist/et-EE.module.js.map +0 -1
  86. package/dist/fi-FI.main.js +0 -7
  87. package/dist/fi-FI.main.js.map +0 -1
  88. package/dist/fi-FI.mjs +0 -9
  89. package/dist/fi-FI.module.js +0 -9
  90. package/dist/fi-FI.module.js.map +0 -1
  91. package/dist/fr-FR.main.js +0 -7
  92. package/dist/fr-FR.main.js.map +0 -1
  93. package/dist/fr-FR.mjs +0 -9
  94. package/dist/fr-FR.module.js +0 -9
  95. package/dist/fr-FR.module.js.map +0 -1
  96. package/dist/he-IL.main.js +0 -7
  97. package/dist/he-IL.main.js.map +0 -1
  98. package/dist/he-IL.mjs +0 -9
  99. package/dist/he-IL.module.js +0 -9
  100. package/dist/he-IL.module.js.map +0 -1
  101. package/dist/hr-HR.main.js +0 -7
  102. package/dist/hr-HR.main.js.map +0 -1
  103. package/dist/hr-HR.mjs +0 -9
  104. package/dist/hr-HR.module.js +0 -9
  105. package/dist/hr-HR.module.js.map +0 -1
  106. package/dist/hu-HU.main.js +0 -7
  107. package/dist/hu-HU.main.js.map +0 -1
  108. package/dist/hu-HU.mjs +0 -9
  109. package/dist/hu-HU.module.js +0 -9
  110. package/dist/hu-HU.module.js.map +0 -1
  111. package/dist/intlStrings.main.js +0 -108
  112. package/dist/intlStrings.main.js.map +0 -1
  113. package/dist/intlStrings.mjs +0 -110
  114. package/dist/intlStrings.module.js +0 -110
  115. package/dist/intlStrings.module.js.map +0 -1
  116. package/dist/it-IT.main.js +0 -7
  117. package/dist/it-IT.main.js.map +0 -1
  118. package/dist/it-IT.mjs +0 -9
  119. package/dist/it-IT.module.js +0 -9
  120. package/dist/it-IT.module.js.map +0 -1
  121. package/dist/ja-JP.main.js +0 -7
  122. package/dist/ja-JP.main.js.map +0 -1
  123. package/dist/ja-JP.mjs +0 -9
  124. package/dist/ja-JP.module.js +0 -9
  125. package/dist/ja-JP.module.js.map +0 -1
  126. package/dist/ko-KR.main.js +0 -7
  127. package/dist/ko-KR.main.js.map +0 -1
  128. package/dist/ko-KR.mjs +0 -9
  129. package/dist/ko-KR.module.js +0 -9
  130. package/dist/ko-KR.module.js.map +0 -1
  131. package/dist/lt-LT.main.js +0 -7
  132. package/dist/lt-LT.main.js.map +0 -1
  133. package/dist/lt-LT.mjs +0 -9
  134. package/dist/lt-LT.module.js +0 -9
  135. package/dist/lt-LT.module.js.map +0 -1
  136. package/dist/lv-LV.main.js +0 -7
  137. package/dist/lv-LV.main.js.map +0 -1
  138. package/dist/lv-LV.mjs +0 -9
  139. package/dist/lv-LV.module.js +0 -9
  140. package/dist/lv-LV.module.js.map +0 -1
  141. package/dist/nb-NO.main.js +0 -7
  142. package/dist/nb-NO.main.js.map +0 -1
  143. package/dist/nb-NO.mjs +0 -9
  144. package/dist/nb-NO.module.js +0 -9
  145. package/dist/nb-NO.module.js.map +0 -1
  146. package/dist/nl-NL.main.js +0 -7
  147. package/dist/nl-NL.main.js.map +0 -1
  148. package/dist/nl-NL.mjs +0 -9
  149. package/dist/nl-NL.module.js +0 -9
  150. package/dist/nl-NL.module.js.map +0 -1
  151. package/dist/pl-PL.main.js +0 -7
  152. package/dist/pl-PL.main.js.map +0 -1
  153. package/dist/pl-PL.mjs +0 -9
  154. package/dist/pl-PL.module.js +0 -9
  155. package/dist/pl-PL.module.js.map +0 -1
  156. package/dist/pt-BR.main.js +0 -7
  157. package/dist/pt-BR.main.js.map +0 -1
  158. package/dist/pt-BR.mjs +0 -9
  159. package/dist/pt-BR.module.js +0 -9
  160. package/dist/pt-BR.module.js.map +0 -1
  161. package/dist/pt-PT.main.js +0 -7
  162. package/dist/pt-PT.main.js.map +0 -1
  163. package/dist/pt-PT.mjs +0 -9
  164. package/dist/pt-PT.module.js +0 -9
  165. package/dist/pt-PT.module.js.map +0 -1
  166. package/dist/ro-RO.main.js +0 -7
  167. package/dist/ro-RO.main.js.map +0 -1
  168. package/dist/ro-RO.mjs +0 -9
  169. package/dist/ro-RO.module.js +0 -9
  170. package/dist/ro-RO.module.js.map +0 -1
  171. package/dist/ru-RU.main.js +0 -7
  172. package/dist/ru-RU.main.js.map +0 -1
  173. package/dist/ru-RU.mjs +0 -9
  174. package/dist/ru-RU.module.js +0 -9
  175. package/dist/ru-RU.module.js.map +0 -1
  176. package/dist/sk-SK.main.js +0 -7
  177. package/dist/sk-SK.main.js.map +0 -1
  178. package/dist/sk-SK.mjs +0 -9
  179. package/dist/sk-SK.module.js +0 -9
  180. package/dist/sk-SK.module.js.map +0 -1
  181. package/dist/sl-SI.main.js +0 -7
  182. package/dist/sl-SI.main.js.map +0 -1
  183. package/dist/sl-SI.mjs +0 -9
  184. package/dist/sl-SI.module.js +0 -9
  185. package/dist/sl-SI.module.js.map +0 -1
  186. package/dist/sr-SP.main.js +0 -7
  187. package/dist/sr-SP.main.js.map +0 -1
  188. package/dist/sr-SP.mjs +0 -9
  189. package/dist/sr-SP.module.js +0 -9
  190. package/dist/sr-SP.module.js.map +0 -1
  191. package/dist/sv-SE.main.js +0 -7
  192. package/dist/sv-SE.main.js.map +0 -1
  193. package/dist/sv-SE.mjs +0 -9
  194. package/dist/sv-SE.module.js +0 -9
  195. package/dist/sv-SE.module.js.map +0 -1
  196. package/dist/tr-TR.main.js +0 -7
  197. package/dist/tr-TR.main.js.map +0 -1
  198. package/dist/tr-TR.mjs +0 -9
  199. package/dist/tr-TR.module.js +0 -9
  200. package/dist/tr-TR.module.js.map +0 -1
  201. package/dist/types.d.ts +0 -32
  202. package/dist/types.d.ts.map +0 -1
  203. package/dist/uk-UA.main.js +0 -7
  204. package/dist/uk-UA.main.js.map +0 -1
  205. package/dist/uk-UA.mjs +0 -9
  206. package/dist/uk-UA.module.js +0 -9
  207. package/dist/uk-UA.module.js.map +0 -1
  208. package/dist/useDialogContainer.main.js +0 -34
  209. package/dist/useDialogContainer.main.js.map +0 -1
  210. package/dist/useDialogContainer.mjs +0 -29
  211. package/dist/useDialogContainer.module.js +0 -29
  212. package/dist/useDialogContainer.module.js.map +0 -1
  213. package/dist/zh-CN.main.js +0 -7
  214. package/dist/zh-CN.main.js.map +0 -1
  215. package/dist/zh-CN.mjs +0 -9
  216. package/dist/zh-CN.module.js +0 -9
  217. package/dist/zh-CN.module.js.map +0 -1
  218. package/dist/zh-TW.main.js +0 -7
  219. package/dist/zh-TW.main.js.map +0 -1
  220. package/dist/zh-TW.mjs +0 -9
  221. package/dist/zh-TW.module.js +0 -9
  222. package/dist/zh-TW.module.js.map +0 -1
  223. package/src/AlertDialog.tsx +0 -115
  224. package/src/Dialog.tsx +0 -118
  225. package/src/DialogContainer.tsx +0 -79
  226. package/src/DialogTrigger.tsx +0 -207
  227. package/src/context.ts +0 -21
  228. package/src/useDialogContainer.ts +0 -33
package/dist/import.mjs CHANGED
@@ -1,8 +1,7 @@
1
- import {AlertDialog as $2a8395160fff9af3$export$de466dd8317b0b75} from "./AlertDialog.mjs";
2
- import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.mjs";
3
- import {DialogTrigger as $c412c5ea680c1e4f$export$2e1e1122cf0cba88} from "./DialogTrigger.mjs";
4
- import {DialogContainer as $2a9f0ad39ddaa8d9$export$547754aada6e339f} from "./DialogContainer.mjs";
5
- import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from "./useDialogContainer.mjs";
1
+ import {AlertDialog as $5c1ddb3f52d41297$re_export$AlertDialog} from "@adobe/react-spectrum/AlertDialog";
2
+ import {Dialog as $5c1ddb3f52d41297$re_export$Dialog} from "@adobe/react-spectrum/Dialog";
3
+ import {DialogTrigger as $5c1ddb3f52d41297$re_export$DialogTrigger} from "@adobe/react-spectrum/DialogTrigger";
4
+ import {DialogContainer as $5c1ddb3f52d41297$re_export$DialogContainer, useDialogContainer as $5c1ddb3f52d41297$re_export$useDialogContainer} from "@adobe/react-spectrum/DialogContainer";
6
5
 
7
6
  /*
8
7
  * Copyright 2020 Adobe. All rights reserved.
@@ -21,6 +20,5 @@ import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from ".
21
20
 
22
21
 
23
22
 
24
-
25
- export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog, $99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog, $c412c5ea680c1e4f$export$2e1e1122cf0cba88 as DialogTrigger, $2a9f0ad39ddaa8d9$export$547754aada6e339f as DialogContainer, $faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
23
+ export {$5c1ddb3f52d41297$re_export$AlertDialog as AlertDialog, $5c1ddb3f52d41297$re_export$Dialog as Dialog, $5c1ddb3f52d41297$re_export$DialogTrigger as DialogTrigger, $5c1ddb3f52d41297$re_export$DialogContainer as DialogContainer, $5c1ddb3f52d41297$re_export$useDialogContainer as useDialogContainer};
26
24
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,19 +1,18 @@
1
- var $66f8653ff750aa27$exports = require("./AlertDialog.main.js");
2
- var $a57fc2323bf98a33$exports = require("./Dialog.main.js");
3
- var $46e54a192dc519c9$exports = require("./DialogTrigger.main.js");
4
- var $1b7050825e0eb5b6$exports = require("./DialogContainer.main.js");
5
- var $1f05ce3abe26c4cc$exports = require("./useDialogContainer.main.js");
1
+ var $bn5lc$adobereactspectrumAlertDialog = require("@adobe/react-spectrum/AlertDialog");
2
+ var $bn5lc$adobereactspectrumDialog = require("@adobe/react-spectrum/Dialog");
3
+ var $bn5lc$adobereactspectrumDialogTrigger = require("@adobe/react-spectrum/DialogTrigger");
4
+ var $bn5lc$adobereactspectrumDialogContainer = require("@adobe/react-spectrum/DialogContainer");
6
5
 
7
6
 
8
7
  function $parcel$export(e, n, v, s) {
9
8
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
9
  }
11
10
 
12
- $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$exports.AlertDialog);
13
- $parcel$export(module.exports, "Dialog", () => $a57fc2323bf98a33$exports.Dialog);
14
- $parcel$export(module.exports, "DialogTrigger", () => $46e54a192dc519c9$exports.DialogTrigger);
15
- $parcel$export(module.exports, "DialogContainer", () => $1b7050825e0eb5b6$exports.DialogContainer);
16
- $parcel$export(module.exports, "useDialogContainer", () => $1f05ce3abe26c4cc$exports.useDialogContainer);
11
+ $parcel$export(module.exports, "AlertDialog", function () { return $bn5lc$adobereactspectrumAlertDialog.AlertDialog; });
12
+ $parcel$export(module.exports, "Dialog", function () { return $bn5lc$adobereactspectrumDialog.Dialog; });
13
+ $parcel$export(module.exports, "DialogTrigger", function () { return $bn5lc$adobereactspectrumDialogTrigger.DialogTrigger; });
14
+ $parcel$export(module.exports, "DialogContainer", function () { return $bn5lc$adobereactspectrumDialogContainer.DialogContainer; });
15
+ $parcel$export(module.exports, "useDialogContainer", function () { return $bn5lc$adobereactspectrumDialogContainer.useDialogContainer; });
17
16
  /*
18
17
  * Copyright 2020 Adobe. All rights reserved.
19
18
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -31,5 +30,4 @@ $parcel$export(module.exports, "useDialogContainer", () => $1f05ce3abe26c4cc$exp
31
30
 
32
31
 
33
32
 
34
-
35
33
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from './AlertDialog';\nexport {Dialog} from './Dialog';\nexport {DialogTrigger} from './DialogTrigger';\nexport {DialogContainer} from './DialogContainer';\nexport {useDialogContainer} from './useDialogContainer';\n\nexport type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nexport type {DialogContainerValue} from './useDialogContainer';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from '@adobe/react-spectrum/AlertDialog';\n\nexport {Dialog} from '@adobe/react-spectrum/Dialog';\nexport {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';\nexport {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';\nexport type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';\nexport type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,8 +1,7 @@
1
- import {AlertDialog as $2a8395160fff9af3$export$de466dd8317b0b75} from "./AlertDialog.module.js";
2
- import {Dialog as $99cd51dc4eb569f7$export$3ddf2d174ce01153} from "./Dialog.module.js";
3
- import {DialogTrigger as $c412c5ea680c1e4f$export$2e1e1122cf0cba88} from "./DialogTrigger.module.js";
4
- import {DialogContainer as $2a9f0ad39ddaa8d9$export$547754aada6e339f} from "./DialogContainer.module.js";
5
- import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from "./useDialogContainer.module.js";
1
+ import {AlertDialog as $5c1ddb3f52d41297$re_export$AlertDialog} from "@adobe/react-spectrum/AlertDialog";
2
+ import {Dialog as $5c1ddb3f52d41297$re_export$Dialog} from "@adobe/react-spectrum/Dialog";
3
+ import {DialogTrigger as $5c1ddb3f52d41297$re_export$DialogTrigger} from "@adobe/react-spectrum/DialogTrigger";
4
+ import {DialogContainer as $5c1ddb3f52d41297$re_export$DialogContainer, useDialogContainer as $5c1ddb3f52d41297$re_export$useDialogContainer} from "@adobe/react-spectrum/DialogContainer";
6
5
 
7
6
  /*
8
7
  * Copyright 2020 Adobe. All rights reserved.
@@ -21,6 +20,5 @@ import {useDialogContainer as $faffee7da30e8f89$export$a2f2d8fa6720dab1} from ".
21
20
 
22
21
 
23
22
 
24
-
25
- export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog, $99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog, $c412c5ea680c1e4f$export$2e1e1122cf0cba88 as DialogTrigger, $2a9f0ad39ddaa8d9$export$547754aada6e339f as DialogContainer, $faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
23
+ export {$5c1ddb3f52d41297$re_export$AlertDialog as AlertDialog, $5c1ddb3f52d41297$re_export$Dialog as Dialog, $5c1ddb3f52d41297$re_export$DialogTrigger as DialogTrigger, $5c1ddb3f52d41297$re_export$DialogContainer as DialogContainer, $5c1ddb3f52d41297$re_export$useDialogContainer as useDialogContainer};
26
24
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from './AlertDialog';\nexport {Dialog} from './Dialog';\nexport {DialogTrigger} from './DialogTrigger';\nexport {DialogContainer} from './DialogContainer';\nexport {useDialogContainer} from './useDialogContainer';\n\nexport type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';\nexport type {DialogContainerValue} from './useDialogContainer';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/dialog/src/index.ts"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {AlertDialog} from '@adobe/react-spectrum/AlertDialog';\n\nexport {Dialog} from '@adobe/react-spectrum/Dialog';\nexport {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';\nexport {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';\nexport type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';\nexport type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';\nexport type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,8 @@
1
+ export { AlertDialog } from '@adobe/react-spectrum/AlertDialog';
2
+ export { Dialog } from '@adobe/react-spectrum/Dialog';
3
+ export { DialogTrigger } from '@adobe/react-spectrum/DialogTrigger';
4
+ export { DialogContainer, useDialogContainer } from '@adobe/react-spectrum/DialogContainer';
5
+ export type { SpectrumAlertDialogProps } from '@adobe/react-spectrum/AlertDialog';
6
+ export type { SpectrumDialogProps } from '@adobe/react-spectrum/Dialog';
7
+ export type { SpectrumDialogContainerProps, DialogContainerValue } from '@adobe/react-spectrum/DialogContainer';
8
+ export type { SpectrumDialogTriggerProps, SpectrumDialogClose } from '@adobe/react-spectrum/DialogTrigger';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/dialog",
3
- "version": "3.9.7",
3
+ "version": "3.10.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,53 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/dialog": "^3.5.34",
44
- "@react-aria/i18n": "^3.12.16",
45
- "@react-aria/interactions": "^3.27.1",
46
- "@react-aria/overlays": "^3.31.2",
47
- "@react-aria/utils": "^3.33.1",
48
- "@react-spectrum/button": "^3.17.7",
49
- "@react-spectrum/buttongroup": "^3.6.29",
50
- "@react-spectrum/divider": "^3.5.30",
51
- "@react-spectrum/layout": "^3.6.22",
52
- "@react-spectrum/overlays": "^5.9.3",
53
- "@react-spectrum/text": "^3.5.25",
54
- "@react-spectrum/utils": "^3.12.12",
55
- "@react-spectrum/view": "^3.6.26",
56
- "@react-stately/overlays": "^3.6.23",
57
- "@react-types/button": "^3.15.1",
58
- "@react-types/dialog": "^3.5.24",
59
- "@react-types/shared": "^3.33.1",
60
- "@spectrum-icons/ui": "^3.6.23",
34
+ "@adobe/react-spectrum": "3.47.0",
61
35
  "@swc/helpers": "^0.5.0"
62
36
  },
63
- "devDependencies": {
64
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
65
- "@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
66
- },
67
37
  "peerDependencies": {
68
- "@react-spectrum/provider": "^3.0.0",
69
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
70
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
71
40
  },
72
41
  "publishConfig": {
73
42
  "access": "public"
74
43
  },
75
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
76
45
  }
package/src/index.ts CHANGED
@@ -12,11 +12,12 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {AlertDialog} from './AlertDialog';
16
- export {Dialog} from './Dialog';
17
- export {DialogTrigger} from './DialogTrigger';
18
- export {DialogContainer} from './DialogContainer';
19
- export {useDialogContainer} from './useDialogContainer';
15
+ export {AlertDialog} from '@adobe/react-spectrum/AlertDialog';
20
16
 
21
- export type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';
22
- export type {DialogContainerValue} from './useDialogContainer';
17
+ export {Dialog} from '@adobe/react-spectrum/Dialog';
18
+ export {DialogTrigger} from '@adobe/react-spectrum/DialogTrigger';
19
+ export {DialogContainer, useDialogContainer} from '@adobe/react-spectrum/DialogContainer';
20
+ export type {SpectrumAlertDialogProps} from '@adobe/react-spectrum/AlertDialog';
21
+ export type {SpectrumDialogProps} from '@adobe/react-spectrum/Dialog';
22
+ export type {SpectrumDialogContainerProps, DialogContainerValue} from '@adobe/react-spectrum/DialogContainer';
23
+ export type {SpectrumDialogTriggerProps, SpectrumDialogClose} from '@adobe/react-spectrum/DialogTrigger';
@@ -1,97 +0,0 @@
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("./dialog.1f91a33b.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
- const $66f8653ff750aa27$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $cXXKy$react.forwardRef)(function AlertDialog(props, ref) {
52
- let { onClose: onClose = ()=>{} } = (0, $cXXKy$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
53
- 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;
54
- let { styleProps: styleProps } = (0, $cXXKy$reactspectrumutils.useStyleProps)(otherProps);
55
- let stringFormatter = (0, $cXXKy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), '@react-spectrum/dialog');
56
- let confirmVariant = 'primary';
57
- if (variant) {
58
- if (variant === 'confirmation') confirmVariant = 'cta';
59
- else if (variant === 'destructive') confirmVariant = 'negative';
60
- }
61
- return /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $a57fc2323bf98a33$exports.Dialog), {
62
- UNSAFE_style: styleProps.style,
63
- UNSAFE_className: (0, $cXXKy$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), {
64
- [`spectrum-Dialog--${variant}`]: variant
65
- }, styleProps.className),
66
- isHidden: styleProps.hidden,
67
- size: "M",
68
- role: "alertdialog",
69
- ref: ref,
70
- ...(0, $cXXKy$reactariautils.filterDOMProps)(props)
71
- }, /*#__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))), {
72
- slot: "typeIcon",
73
- "aria-label": stringFormatter.format('alert')
74
- }), /*#__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), {
75
- align: "end"
76
- }, cancelLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
77
- variant: "secondary",
78
- onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onCancel()),
79
- autoFocus: autoFocusButton === 'cancel',
80
- "data-testid": "rsp-AlertDialog-cancelButton"
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
- "data-testid": "rsp-AlertDialog-secondaryButton"
87
- }, secondaryActionLabel), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
88
- variant: confirmVariant,
89
- onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onPrimaryAction()),
90
- isDisabled: isPrimaryActionDisabled,
91
- autoFocus: autoFocusButton === 'primary',
92
- "data-testid": "rsp-AlertDialog-confirmButton"
93
- }, primaryActionLabel)));
94
- });
95
-
96
-
97
- //# sourceMappingURL=AlertDialog.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwBM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAW;IACrG,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,SAAS,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;QACJ,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;qBACzB,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;QAC/B,eAAY;OACX,cAGJ,sCACC,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX,qCAGL,0DAAC,CAAA,GAAA,iCAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,2BAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX;AAKX","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, filterDOMProps} 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 */\nexport const AlertDialog = forwardRef(function 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 {...filterDOMProps(props)}>\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 data-testid=\"rsp-AlertDialog-cancelButton\">\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 data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.main.js.map"}
@@ -1,92 +0,0 @@
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 "./dialog.1f91a33b.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 {filterDOMProps as $7TaMJ$filterDOMProps, 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, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} 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
- const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
46
- let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
47
- 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;
48
- let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
49
- let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
50
- let confirmVariant = 'primary';
51
- if (variant) {
52
- if (variant === 'confirmation') confirmVariant = 'cta';
53
- else if (variant === 'destructive') confirmVariant = 'negative';
54
- }
55
- return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
56
- UNSAFE_style: styleProps.style,
57
- UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
58
- [`spectrum-Dialog--${variant}`]: variant
59
- }, styleProps.className),
60
- isHidden: styleProps.hidden,
61
- size: "M",
62
- role: "alertdialog",
63
- ref: ref,
64
- ...(0, $7TaMJ$filterDOMProps)(props)
65
- }, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
66
- slot: "typeIcon",
67
- "aria-label": stringFormatter.format('alert')
68
- }), /*#__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), {
69
- align: "end"
70
- }, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
71
- variant: "secondary",
72
- onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
73
- autoFocus: autoFocusButton === 'cancel',
74
- "data-testid": "rsp-AlertDialog-cancelButton"
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
- "data-testid": "rsp-AlertDialog-secondaryButton"
81
- }, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
82
- variant: confirmVariant,
83
- onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
84
- isDisabled: isPrimaryActionDisabled,
85
- autoFocus: autoFocusButton === 'primary',
86
- "data-testid": "rsp-AlertDialog-confirmButton"
87
- }, primaryActionLabel)));
88
- });
89
-
90
-
91
- export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
92
- //# sourceMappingURL=AlertDialog.module.js.map
@@ -1,92 +0,0 @@
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 "./dialog.1f91a33b.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 {filterDOMProps as $7TaMJ$filterDOMProps, 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, {forwardRef as $7TaMJ$forwardRef, useContext as $7TaMJ$useContext} 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
- const $2a8395160fff9af3$export$de466dd8317b0b75 = /*#__PURE__*/ (0, $7TaMJ$forwardRef)(function AlertDialog(props, ref) {
46
- let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
47
- 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;
48
- let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
49
- let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
50
- let confirmVariant = 'primary';
51
- if (variant) {
52
- if (variant === 'confirmation') confirmVariant = 'cta';
53
- else if (variant === 'destructive') confirmVariant = 'negative';
54
- }
55
- return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
56
- UNSAFE_style: styleProps.style,
57
- UNSAFE_className: (0, $7TaMJ$classNames)((0, ($parcel$interopDefault($7TaMJ$dialog_vars_cssmodulejs))), {
58
- [`spectrum-Dialog--${variant}`]: variant
59
- }, styleProps.className),
60
- isHidden: styleProps.hidden,
61
- size: "M",
62
- role: "alertdialog",
63
- ref: ref,
64
- ...(0, $7TaMJ$filterDOMProps)(props)
65
- }, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
66
- slot: "typeIcon",
67
- "aria-label": stringFormatter.format('alert')
68
- }), /*#__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), {
69
- align: "end"
70
- }, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
71
- variant: "secondary",
72
- onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
73
- autoFocus: autoFocusButton === 'cancel',
74
- "data-testid": "rsp-AlertDialog-cancelButton"
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
- "data-testid": "rsp-AlertDialog-secondaryButton"
81
- }, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
82
- variant: confirmVariant,
83
- onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
84
- isDisabled: isPrimaryActionDisabled,
85
- autoFocus: autoFocusButton === 'primary',
86
- "data-testid": "rsp-AlertDialog-confirmButton"
87
- }, primaryActionLabel)));
88
- });
89
-
90
-
91
- export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
92
- //# sourceMappingURL=AlertDialog.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAwBM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAW;IACrG,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,SAAS,CAAC,EAAE;QAAO,GAAG,WAAW,SAAS;QACrG,UAAU,WAAW,MAAM;QAC3B,MAAK;QACL,MAAK;QACL,KAAK;QACJ,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;qBACzB,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;QAC/B,eAAY;OACX,cAGJ,sCACC,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAQ;QACR,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX,qCAGL,gCAAC,CAAA,GAAA,aAAK;QACJ,SAAS;QACT,SAAS,IAAM,CAAA,GAAA,YAAI,EAAE,WAAW;QAChC,YAAY;QACZ,WAAW,oBAAoB;QAC/B,eAAY;OACX;AAKX","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, filterDOMProps} 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 */\nexport const AlertDialog = forwardRef(function 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 {...filterDOMProps(props)}>\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 data-testid=\"rsp-AlertDialog-cancelButton\">\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 data-testid=\"rsp-AlertDialog-secondaryButton\">\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={confirmVariant}\n onPress={() => chain(onClose(), onPrimaryAction())}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n data-testid=\"rsp-AlertDialog-confirmButton\">\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.module.js.map"}