@react-spectrum/dialog 3.9.6 → 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/types.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import React, { JSX } from "react";
2
- import { SpectrumDialogProps, SpectrumAlertDialogProps, SpectrumDialogTriggerProps, SpectrumDialogContainerProps } from "@react-types/dialog";
3
- import { DOMRefValue } from "@react-types/shared";
4
- /**
5
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
6
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
7
- */
8
- export const Dialog: React.ForwardRefExoticComponent<SpectrumDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
9
- /**
10
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
11
- */
12
- export const AlertDialog: React.ForwardRefExoticComponent<SpectrumAlertDialogProps & React.RefAttributes<DOMRefValue<HTMLElement>>>;
13
- /**
14
- * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's
15
- * open state with the trigger's press state. Additionally, it allows you to customize the type and
16
- * positioning of the Dialog.
17
- */
18
- export let DialogTrigger: (props: SpectrumDialogTriggerProps) => JSX.Element;
19
- /**
20
- * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding
21
- * it in a modal. Useful in cases where there is no trigger element
22
- * or when the trigger unmounts while the dialog is open.
23
- */
24
- export function DialogContainer(props: SpectrumDialogContainerProps): JSX.Element;
25
- export interface DialogContainerValue {
26
- type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover';
27
- dismiss(): void;
28
- }
29
- export function useDialogContainer(): DialogContainerValue;
30
- export type { SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps } from '@react-types/dialog';
31
-
32
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AC2CA;;;GAGG;AACH,OAAO,MAAM,4GAsEX,CAAC;ACtFH;;GAEG;AACH,OAAO,MAAM,sHAgFX,CAAC;ACqBH;;;;GAIG;AAGH,OAAA,IAAI,eAAkC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,OAAO,CAAC;AC5HzF;;;;GAIG;AACH,gCAAgC,KAAK,EAAE,4BAA4B,GAAG,IAAI,OAAO,CAuDhF;AC/DD;IACE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,oBAAoB,CAAC;IACzE,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,sCAAsC,oBAAoB,CAYzD;ACZD,YAAY,EAAC,wBAAwB,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,0BAA0B,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/context.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/Dialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/AlertDialog.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogTrigger.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/DialogContainer.tsx","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/useDialogContainer.ts","packages/@react-spectrum/dialog/src/packages/@react-spectrum/dialog/src/index.ts","packages/@react-spectrum/dialog/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\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":"types.d.ts.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "alert": `\u{421}\u{438}\u{433}\u{43D}\u{430}\u{43B} \u{442}\u{440}\u{438}\u{432}\u{43E}\u{433}\u{438}`,
3
- "dismiss": `\u{421}\u{43A}\u{430}\u{441}\u{443}\u{432}\u{430}\u{442}\u{438}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=uk-UA.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,4FAAc,CAAC;IAC3C,WAAW,CAAC,+DAAS,CAAC;AACxB","sources":["packages/@react-spectrum/dialog/intl/uk-UA.json"],"sourcesContent":["{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
package/dist/uk-UA.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $2fa80cee796b989c$exports = {};
2
- $2fa80cee796b989c$exports = {
3
- "alert": `\u{421}\u{438}\u{433}\u{43D}\u{430}\u{43B} \u{442}\u{440}\u{438}\u{432}\u{43E}\u{433}\u{438}`,
4
- "dismiss": `\u{421}\u{43A}\u{430}\u{441}\u{443}\u{432}\u{430}\u{442}\u{438}`
5
- };
6
-
7
-
8
- export {$2fa80cee796b989c$exports as default};
9
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1,9 +0,0 @@
1
- var $2fa80cee796b989c$exports = {};
2
- $2fa80cee796b989c$exports = {
3
- "alert": `\u{421}\u{438}\u{433}\u{43D}\u{430}\u{43B} \u{442}\u{440}\u{438}\u{432}\u{43E}\u{433}\u{438}`,
4
- "dismiss": `\u{421}\u{43A}\u{430}\u{441}\u{443}\u{432}\u{430}\u{442}\u{438}`
5
- };
6
-
7
-
8
- export {$2fa80cee796b989c$exports as default};
9
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,4FAAc,CAAC;IAC3C,WAAW,CAAC,+DAAS,CAAC;AACxB","sources":["packages/@react-spectrum/dialog/intl/uk-UA.json"],"sourcesContent":["{\n \"alert\": \"Сигнал тривоги\",\n \"dismiss\": \"Скасувати\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
@@ -1,34 +0,0 @@
1
- var $0eb909ad2388d989$exports = require("./context.main.js");
2
- var $9DI8Y$react = require("react");
3
-
4
-
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
-
9
- $parcel$export(module.exports, "useDialogContainer", () => $1f05ce3abe26c4cc$export$a2f2d8fa6720dab1);
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
- function $1f05ce3abe26c4cc$export$a2f2d8fa6720dab1() {
23
- let context = (0, $9DI8Y$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext));
24
- if (!context) throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');
25
- return {
26
- type: context.type,
27
- dismiss () {
28
- context === null || context === void 0 ? void 0 : context.onClose();
29
- }
30
- };
31
- }
32
-
33
-
34
- //# sourceMappingURL=useDialogContainer.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAUM,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL,MAAM,QAAQ,IAAI;QAClB;YACE,oBAAA,8BAAA,QAAS,OAAO;QAClB;IACF;AACF","sources":["packages/@react-spectrum/dialog/src/useDialogContainer.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\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context?.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"useDialogContainer.main.js.map"}
@@ -1,29 +0,0 @@
1
- import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.mjs";
2
- import {useContext as $8u5hv$useContext} from "react";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- function $faffee7da30e8f89$export$a2f2d8fa6720dab1() {
17
- let context = (0, $8u5hv$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c));
18
- if (!context) throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');
19
- return {
20
- type: context.type,
21
- dismiss () {
22
- context === null || context === void 0 ? void 0 : context.onClose();
23
- }
24
- };
25
- }
26
-
27
-
28
- export {$faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
29
- //# sourceMappingURL=useDialogContainer.module.js.map
@@ -1,29 +0,0 @@
1
- import {DialogContext as $97b119e05830ea0d$export$8b93a07348a7730c} from "./context.module.js";
2
- import {useContext as $8u5hv$useContext} from "react";
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
-
16
- function $faffee7da30e8f89$export$a2f2d8fa6720dab1() {
17
- let context = (0, $8u5hv$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c));
18
- if (!context) throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');
19
- return {
20
- type: context.type,
21
- dismiss () {
22
- context === null || context === void 0 ? void 0 : context.onClose();
23
- }
24
- };
25
- }
26
-
27
-
28
- export {$faffee7da30e8f89$export$a2f2d8fa6720dab1 as useDialogContainer};
29
- //# sourceMappingURL=useDialogContainer.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAUM,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL,MAAM,QAAQ,IAAI;QAClB;YACE,oBAAA,8BAAA,QAAS,OAAO;QAClB;IACF;AACF","sources":["packages/@react-spectrum/dialog/src/useDialogContainer.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\nimport {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n let context = useContext(DialogContext);\n if (!context) {\n throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n }\n\n return {\n type: context.type,\n dismiss() {\n context?.onClose();\n }\n };\n}\n"],"names":[],"version":3,"file":"useDialogContainer.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "alert": `\u{8B66}\u{62A5}`,
3
- "dismiss": `\u{53D6}\u{6D88}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=zh-CN.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,WAAW,CAAC,gBAAE,CAAC;AACjB","sources":["packages/@react-spectrum/dialog/intl/zh-CN.json"],"sourcesContent":["{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $ecd80835333d83cc$exports = {};
2
- $ecd80835333d83cc$exports = {
3
- "alert": `\u{8B66}\u{62A5}`,
4
- "dismiss": `\u{53D6}\u{6D88}`
5
- };
6
-
7
-
8
- export {$ecd80835333d83cc$exports as default};
9
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1,9 +0,0 @@
1
- var $ecd80835333d83cc$exports = {};
2
- $ecd80835333d83cc$exports = {
3
- "alert": `\u{8B66}\u{62A5}`,
4
- "dismiss": `\u{53D6}\u{6D88}`
5
- };
6
-
7
-
8
- export {$ecd80835333d83cc$exports as default};
9
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,WAAW,CAAC,gBAAE,CAAC;AACjB","sources":["packages/@react-spectrum/dialog/intl/zh-CN.json"],"sourcesContent":["{\n \"alert\": \"警报\",\n \"dismiss\": \"取消\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "alert": `\u{8B66}\u{793A}`,
3
- "dismiss": `\u{95DC}\u{9589}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=zh-TW.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,WAAW,CAAC,gBAAE,CAAC;AACjB","sources":["packages/@react-spectrum/dialog/intl/zh-TW.json"],"sourcesContent":["{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
package/dist/zh-TW.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $03712eabbcfd201c$exports = {};
2
- $03712eabbcfd201c$exports = {
3
- "alert": `\u{8B66}\u{793A}`,
4
- "dismiss": `\u{95DC}\u{9589}`
5
- };
6
-
7
-
8
- export {$03712eabbcfd201c$exports as default};
9
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1,9 +0,0 @@
1
- var $03712eabbcfd201c$exports = {};
2
- $03712eabbcfd201c$exports = {
3
- "alert": `\u{8B66}\u{793A}`,
4
- "dismiss": `\u{95DC}\u{9589}`
5
- };
6
-
7
-
8
- export {$03712eabbcfd201c$exports as default};
9
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,gBAAE,CAAC;IAC/B,WAAW,CAAC,gBAAE,CAAC;AACjB","sources":["packages/@react-spectrum/dialog/intl/zh-TW.json"],"sourcesContent":["{\n \"alert\": \"警示\",\n \"dismiss\": \"關閉\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
@@ -1,115 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import AlertMedium from '@spectrum-icons/ui/AlertMedium';
14
- import {Button} from '@react-spectrum/button';
15
- import {ButtonGroup} from '@react-spectrum/buttongroup';
16
- import {chain, filterDOMProps} from '@react-aria/utils';
17
- import {classNames, useStyleProps} from '@react-spectrum/utils';
18
- import {Content} from '@react-spectrum/view';
19
- import {Dialog} from './Dialog';
20
- import {DialogContext, DialogContextValue} from './context';
21
- import {Divider} from '@react-spectrum/divider';
22
- import {DOMRef} from '@react-types/shared';
23
- import {Heading} from '@react-spectrum/text';
24
- // @ts-ignore
25
- import intlMessages from '../intl/*.json';
26
- import React, {forwardRef, useContext} from 'react';
27
- import {SpectrumAlertDialogProps} from '@react-types/dialog';
28
- import {SpectrumButtonProps} from '@react-types/button';
29
- import styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';
30
- import {useLocalizedStringFormatter} from '@react-aria/i18n';
31
-
32
- /**
33
- * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
34
- */
35
- export const AlertDialog = forwardRef(function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
36
- let {
37
- onClose = () => {}
38
- } = useContext(DialogContext) || {} as DialogContextValue;
39
-
40
- let {
41
- variant,
42
- children,
43
- primaryActionLabel,
44
- secondaryActionLabel,
45
- cancelLabel,
46
- autoFocusButton,
47
- title,
48
- isPrimaryActionDisabled,
49
- isSecondaryActionDisabled,
50
- onCancel = () => {},
51
- onPrimaryAction = () => {},
52
- onSecondaryAction = () => {},
53
- ...otherProps
54
- } = props;
55
- let {styleProps} = useStyleProps(otherProps);
56
- let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');
57
-
58
- let confirmVariant: SpectrumButtonProps['variant'] = 'primary';
59
- if (variant) {
60
- if (variant === 'confirmation') {
61
- confirmVariant = 'cta';
62
- } else if (variant === 'destructive') {
63
- confirmVariant = 'negative';
64
- }
65
- }
66
-
67
- return (
68
- <Dialog
69
- UNSAFE_style={styleProps.style}
70
- UNSAFE_className={classNames(styles, {[`spectrum-Dialog--${variant}`]: variant}, styleProps.className)}
71
- isHidden={styleProps.hidden}
72
- size="M"
73
- role="alertdialog"
74
- ref={ref}
75
- {...filterDOMProps(props)}>
76
- <Heading>{title}</Heading>
77
- {(variant === 'error' || variant === 'warning') &&
78
- <AlertMedium
79
- slot="typeIcon"
80
- aria-label={stringFormatter.format('alert')} />
81
- }
82
- <Divider />
83
- <Content>{children}</Content>
84
- <ButtonGroup align="end">
85
- {cancelLabel &&
86
- <Button
87
- variant="secondary"
88
- onPress={() => chain(onClose(), onCancel())}
89
- autoFocus={autoFocusButton === 'cancel'}
90
- data-testid="rsp-AlertDialog-cancelButton">
91
- {cancelLabel}
92
- </Button>
93
- }
94
- {secondaryActionLabel &&
95
- <Button
96
- variant="secondary"
97
- onPress={() => chain(onClose(), onSecondaryAction())}
98
- isDisabled={isSecondaryActionDisabled}
99
- autoFocus={autoFocusButton === 'secondary'}
100
- data-testid="rsp-AlertDialog-secondaryButton">
101
- {secondaryActionLabel}
102
- </Button>
103
- }
104
- <Button
105
- variant={confirmVariant}
106
- onPress={() => chain(onClose(), onPrimaryAction())}
107
- isDisabled={isPrimaryActionDisabled}
108
- autoFocus={autoFocusButton === 'primary'}
109
- data-testid="rsp-AlertDialog-confirmButton">
110
- {primaryActionLabel}
111
- </Button>
112
- </ButtonGroup>
113
- </Dialog>
114
- );
115
- });
package/src/Dialog.tsx DELETED
@@ -1,118 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {ActionButton} from '@react-spectrum/button';
14
- import {
15
- classNames,
16
- SlotProvider,
17
- unwrapDOMRef,
18
- useDOMRef,
19
- useHasChild,
20
- useSlotProps,
21
- useStyleProps
22
- } from '@react-spectrum/utils';
23
- import CrossLarge from '@spectrum-icons/ui/CrossLarge';
24
- import {DialogContext, DialogContextValue} from './context';
25
- import {DOMRef} from '@react-types/shared';
26
- import {Grid} from '@react-spectrum/layout';
27
- // @ts-ignore
28
- import intlMessages from '../intl/*.json';
29
- import {mergeProps} from '@react-aria/utils';
30
- import React, {useContext, useMemo, useRef} from 'react';
31
- import {SpectrumDialogProps} from '@react-types/dialog';
32
- import styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';
33
- import {useDialog} from '@react-aria/dialog';
34
- import {useLocalizedStringFormatter} from '@react-aria/i18n';
35
-
36
- let sizeMap = {
37
- S: 'small',
38
- M: 'medium',
39
- L: 'large',
40
- fullscreen: 'fullscreen',
41
- fullscreenTakeover: 'fullscreenTakeover'
42
- };
43
-
44
- /**
45
- * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
46
- * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.
47
- */
48
- export const Dialog = React.forwardRef(function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
49
- props = useSlotProps(props, 'dialog');
50
- let {
51
- type = 'modal',
52
- ...contextProps
53
- } = useContext(DialogContext) || {} as DialogContextValue;
54
- let {
55
- children,
56
- isDismissable = contextProps.isDismissable,
57
- onDismiss = contextProps.onClose,
58
- size,
59
- ...otherProps
60
- } = props;
61
- let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dialog');
62
- let {styleProps} = useStyleProps(otherProps);
63
-
64
- size = type === 'popover' ? (size || 'S') : (size || 'L');
65
-
66
- let domRef = useDOMRef(ref);
67
- let gridRef = useRef(null);
68
- let sizeVariant = sizeMap[type] || sizeMap[size];
69
- let {dialogProps, titleProps} = useDialog(mergeProps(contextProps, props), domRef);
70
-
71
- let hasHeader = useHasChild(`.${styles['spectrum-Dialog-header']}`, unwrapDOMRef(gridRef));
72
- let hasHeading = useHasChild(`.${styles['spectrum-Dialog-heading']}`, unwrapDOMRef(gridRef));
73
- let hasFooter = useHasChild(`.${styles['spectrum-Dialog-footer']}`, unwrapDOMRef(gridRef));
74
- let hasTypeIcon = useHasChild(`.${styles['spectrum-Dialog-typeIcon']}`, unwrapDOMRef(gridRef));
75
-
76
- let slots = useMemo(() => ({
77
- hero: {UNSAFE_className: styles['spectrum-Dialog-hero']},
78
- heading: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-heading', {'spectrum-Dialog-heading--noHeader': !hasHeader, 'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon}), level: 2, ...titleProps},
79
- header: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-header', {'spectrum-Dialog-header--noHeading': !hasHeading, 'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon})},
80
- typeIcon: {UNSAFE_className: styles['spectrum-Dialog-typeIcon']},
81
- divider: {UNSAFE_className: styles['spectrum-Dialog-divider'], size: 'M'},
82
- content: {UNSAFE_className: styles['spectrum-Dialog-content']},
83
- footer: {UNSAFE_className: styles['spectrum-Dialog-footer']},
84
- buttonGroup: {UNSAFE_className: classNames(styles, 'spectrum-Dialog-buttonGroup', {'spectrum-Dialog-buttonGroup--noFooter': !hasFooter}), align: 'end'}
85
- // eslint-disable-next-line react-hooks/exhaustive-deps
86
- }), [hasFooter, hasHeader, titleProps]);
87
-
88
- return (
89
- <section
90
- {...styleProps}
91
- {...dialogProps}
92
- className={classNames(
93
- styles,
94
- 'spectrum-Dialog',
95
- {
96
- [`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
97
- 'spectrum-Dialog--dismissable': isDismissable
98
- },
99
- styleProps.className
100
- )}
101
- ref={domRef}>
102
- <Grid ref={gridRef} UNSAFE_className={styles['spectrum-Dialog-grid']}>
103
- <SlotProvider slots={slots}>
104
- {children}
105
- </SlotProvider>
106
- {isDismissable &&
107
- <ActionButton
108
- UNSAFE_className={styles['spectrum-Dialog-closeButton']}
109
- isQuiet
110
- aria-label={stringFormatter.format('dismiss')}
111
- onPress={onDismiss}>
112
- <CrossLarge />
113
- </ActionButton>
114
- }
115
- </Grid>
116
- </section>
117
- );
118
- });
@@ -1,79 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {DialogContext} from './context';
14
- import {Modal} from '@react-spectrum/overlays';
15
- import React, {JSX, ReactElement, useState} from 'react';
16
- import {SpectrumDialogContainerProps} from '@react-types/dialog';
17
- import {useOverlayTriggerState} from '@react-stately/overlays';
18
-
19
- /**
20
- * A DialogContainer accepts a single Dialog as a child, and manages showing and hiding
21
- * it in a modal. Useful in cases where there is no trigger element
22
- * or when the trigger unmounts while the dialog is open.
23
- */
24
- export function DialogContainer(props: SpectrumDialogContainerProps): JSX.Element {
25
- let {
26
- children,
27
- type = 'modal',
28
- onDismiss,
29
- isDismissable,
30
- isKeyboardDismissDisabled
31
- } = props;
32
-
33
- let childArray = React.Children.toArray(children);
34
- if (childArray.length > 1) {
35
- throw new Error('Only a single child can be passed to DialogContainer.');
36
- }
37
-
38
- let [lastChild, setLastChild] = useState<ReactElement | null>(null);
39
-
40
- // React.Children.toArray mutates the children, and we need them to be stable
41
- // between renders so that the lastChild comparison works.
42
- let child: ReactElement | undefined = undefined;
43
- if (Array.isArray(children)) {
44
- child = children.find(React.isValidElement);
45
- } else if (React.isValidElement(children)) {
46
- child = children;
47
- }
48
-
49
- if (child && child !== lastChild) {
50
- setLastChild(child);
51
- }
52
-
53
- let context = {
54
- type,
55
- onClose: onDismiss,
56
- isDismissable
57
- };
58
-
59
- let state = useOverlayTriggerState({
60
- isOpen: !!child,
61
- onOpenChange: isOpen => {
62
- if (!isOpen) {
63
- onDismiss();
64
- }
65
- }
66
- });
67
-
68
- return (
69
- <Modal
70
- state={state}
71
- type={type}
72
- isDismissable={isDismissable}
73
- isKeyboardDismissDisabled={isKeyboardDismissDisabled}>
74
- <DialogContext.Provider value={context}>
75
- {lastChild}
76
- </DialogContext.Provider>
77
- </Modal>
78
- );
79
- }