@react-spectrum/actiongroup 3.11.7 → 3.12.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 (205) hide show
  1. package/dist/import.mjs +3 -3
  2. package/dist/main.js +4 -4
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +3 -3
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +3 -0
  7. package/package.json +14 -41
  8. package/src/index.ts +4 -3
  9. package/dist/ActionGroup.main.js +0 -398
  10. package/dist/ActionGroup.main.js.map +0 -1
  11. package/dist/ActionGroup.mjs +0 -393
  12. package/dist/ActionGroup.module.js +0 -393
  13. package/dist/ActionGroup.module.js.map +0 -1
  14. package/dist/actiongroup.bb161279.css +0 -1669
  15. package/dist/actiongroup.bb161279.css.map +0 -1
  16. package/dist/actiongroup.c0b1ee3f.css +0 -254
  17. package/dist/actiongroup.c0b1ee3f.css.map +0 -1
  18. package/dist/actiongroup_vars_css.main.js +0 -56
  19. package/dist/actiongroup_vars_css.main.js.map +0 -1
  20. package/dist/actiongroup_vars_css.mjs +0 -58
  21. package/dist/actiongroup_vars_css.module.js +0 -58
  22. package/dist/actiongroup_vars_css.module.js.map +0 -1
  23. package/dist/ar-AE.main.js +0 -6
  24. package/dist/ar-AE.main.js.map +0 -1
  25. package/dist/ar-AE.mjs +0 -8
  26. package/dist/ar-AE.module.js +0 -8
  27. package/dist/ar-AE.module.js.map +0 -1
  28. package/dist/bg-BG.main.js +0 -6
  29. package/dist/bg-BG.main.js.map +0 -1
  30. package/dist/bg-BG.mjs +0 -8
  31. package/dist/bg-BG.module.js +0 -8
  32. package/dist/bg-BG.module.js.map +0 -1
  33. package/dist/button_vars_css.main.js +0 -125
  34. package/dist/button_vars_css.main.js.map +0 -1
  35. package/dist/button_vars_css.mjs +0 -127
  36. package/dist/button_vars_css.module.js +0 -127
  37. package/dist/button_vars_css.module.js.map +0 -1
  38. package/dist/cs-CZ.main.js +0 -6
  39. package/dist/cs-CZ.main.js.map +0 -1
  40. package/dist/cs-CZ.mjs +0 -8
  41. package/dist/cs-CZ.module.js +0 -8
  42. package/dist/cs-CZ.module.js.map +0 -1
  43. package/dist/da-DK.main.js +0 -6
  44. package/dist/da-DK.main.js.map +0 -1
  45. package/dist/da-DK.mjs +0 -8
  46. package/dist/da-DK.module.js +0 -8
  47. package/dist/da-DK.module.js.map +0 -1
  48. package/dist/de-DE.main.js +0 -6
  49. package/dist/de-DE.main.js.map +0 -1
  50. package/dist/de-DE.mjs +0 -8
  51. package/dist/de-DE.module.js +0 -8
  52. package/dist/de-DE.module.js.map +0 -1
  53. package/dist/el-GR.main.js +0 -6
  54. package/dist/el-GR.main.js.map +0 -1
  55. package/dist/el-GR.mjs +0 -8
  56. package/dist/el-GR.module.js +0 -8
  57. package/dist/el-GR.module.js.map +0 -1
  58. package/dist/en-US.main.js +0 -6
  59. package/dist/en-US.main.js.map +0 -1
  60. package/dist/en-US.mjs +0 -8
  61. package/dist/en-US.module.js +0 -8
  62. package/dist/en-US.module.js.map +0 -1
  63. package/dist/es-ES.main.js +0 -6
  64. package/dist/es-ES.main.js.map +0 -1
  65. package/dist/es-ES.mjs +0 -8
  66. package/dist/es-ES.module.js +0 -8
  67. package/dist/es-ES.module.js.map +0 -1
  68. package/dist/et-EE.main.js +0 -6
  69. package/dist/et-EE.main.js.map +0 -1
  70. package/dist/et-EE.mjs +0 -8
  71. package/dist/et-EE.module.js +0 -8
  72. package/dist/et-EE.module.js.map +0 -1
  73. package/dist/fi-FI.main.js +0 -6
  74. package/dist/fi-FI.main.js.map +0 -1
  75. package/dist/fi-FI.mjs +0 -8
  76. package/dist/fi-FI.module.js +0 -8
  77. package/dist/fi-FI.module.js.map +0 -1
  78. package/dist/fr-FR.main.js +0 -6
  79. package/dist/fr-FR.main.js.map +0 -1
  80. package/dist/fr-FR.mjs +0 -8
  81. package/dist/fr-FR.module.js +0 -8
  82. package/dist/fr-FR.module.js.map +0 -1
  83. package/dist/he-IL.main.js +0 -6
  84. package/dist/he-IL.main.js.map +0 -1
  85. package/dist/he-IL.mjs +0 -8
  86. package/dist/he-IL.module.js +0 -8
  87. package/dist/he-IL.module.js.map +0 -1
  88. package/dist/hr-HR.main.js +0 -6
  89. package/dist/hr-HR.main.js.map +0 -1
  90. package/dist/hr-HR.mjs +0 -8
  91. package/dist/hr-HR.module.js +0 -8
  92. package/dist/hr-HR.module.js.map +0 -1
  93. package/dist/hu-HU.main.js +0 -6
  94. package/dist/hu-HU.main.js.map +0 -1
  95. package/dist/hu-HU.mjs +0 -8
  96. package/dist/hu-HU.module.js +0 -8
  97. package/dist/hu-HU.module.js.map +0 -1
  98. package/dist/intlStrings.main.js +0 -108
  99. package/dist/intlStrings.main.js.map +0 -1
  100. package/dist/intlStrings.mjs +0 -110
  101. package/dist/intlStrings.module.js +0 -110
  102. package/dist/intlStrings.module.js.map +0 -1
  103. package/dist/it-IT.main.js +0 -6
  104. package/dist/it-IT.main.js.map +0 -1
  105. package/dist/it-IT.mjs +0 -8
  106. package/dist/it-IT.module.js +0 -8
  107. package/dist/it-IT.module.js.map +0 -1
  108. package/dist/ja-JP.main.js +0 -6
  109. package/dist/ja-JP.main.js.map +0 -1
  110. package/dist/ja-JP.mjs +0 -8
  111. package/dist/ja-JP.module.js +0 -8
  112. package/dist/ja-JP.module.js.map +0 -1
  113. package/dist/ko-KR.main.js +0 -6
  114. package/dist/ko-KR.main.js.map +0 -1
  115. package/dist/ko-KR.mjs +0 -8
  116. package/dist/ko-KR.module.js +0 -8
  117. package/dist/ko-KR.module.js.map +0 -1
  118. package/dist/lt-LT.main.js +0 -6
  119. package/dist/lt-LT.main.js.map +0 -1
  120. package/dist/lt-LT.mjs +0 -8
  121. package/dist/lt-LT.module.js +0 -8
  122. package/dist/lt-LT.module.js.map +0 -1
  123. package/dist/lv-LV.main.js +0 -6
  124. package/dist/lv-LV.main.js.map +0 -1
  125. package/dist/lv-LV.mjs +0 -8
  126. package/dist/lv-LV.module.js +0 -8
  127. package/dist/lv-LV.module.js.map +0 -1
  128. package/dist/nb-NO.main.js +0 -6
  129. package/dist/nb-NO.main.js.map +0 -1
  130. package/dist/nb-NO.mjs +0 -8
  131. package/dist/nb-NO.module.js +0 -8
  132. package/dist/nb-NO.module.js.map +0 -1
  133. package/dist/nl-NL.main.js +0 -6
  134. package/dist/nl-NL.main.js.map +0 -1
  135. package/dist/nl-NL.mjs +0 -8
  136. package/dist/nl-NL.module.js +0 -8
  137. package/dist/nl-NL.module.js.map +0 -1
  138. package/dist/pl-PL.main.js +0 -6
  139. package/dist/pl-PL.main.js.map +0 -1
  140. package/dist/pl-PL.mjs +0 -8
  141. package/dist/pl-PL.module.js +0 -8
  142. package/dist/pl-PL.module.js.map +0 -1
  143. package/dist/pt-BR.main.js +0 -6
  144. package/dist/pt-BR.main.js.map +0 -1
  145. package/dist/pt-BR.mjs +0 -8
  146. package/dist/pt-BR.module.js +0 -8
  147. package/dist/pt-BR.module.js.map +0 -1
  148. package/dist/pt-PT.main.js +0 -6
  149. package/dist/pt-PT.main.js.map +0 -1
  150. package/dist/pt-PT.mjs +0 -8
  151. package/dist/pt-PT.module.js +0 -8
  152. package/dist/pt-PT.module.js.map +0 -1
  153. package/dist/ro-RO.main.js +0 -6
  154. package/dist/ro-RO.main.js.map +0 -1
  155. package/dist/ro-RO.mjs +0 -8
  156. package/dist/ro-RO.module.js +0 -8
  157. package/dist/ro-RO.module.js.map +0 -1
  158. package/dist/ru-RU.main.js +0 -6
  159. package/dist/ru-RU.main.js.map +0 -1
  160. package/dist/ru-RU.mjs +0 -8
  161. package/dist/ru-RU.module.js +0 -8
  162. package/dist/ru-RU.module.js.map +0 -1
  163. package/dist/sk-SK.main.js +0 -6
  164. package/dist/sk-SK.main.js.map +0 -1
  165. package/dist/sk-SK.mjs +0 -8
  166. package/dist/sk-SK.module.js +0 -8
  167. package/dist/sk-SK.module.js.map +0 -1
  168. package/dist/sl-SI.main.js +0 -6
  169. package/dist/sl-SI.main.js.map +0 -1
  170. package/dist/sl-SI.mjs +0 -8
  171. package/dist/sl-SI.module.js +0 -8
  172. package/dist/sl-SI.module.js.map +0 -1
  173. package/dist/sr-SP.main.js +0 -6
  174. package/dist/sr-SP.main.js.map +0 -1
  175. package/dist/sr-SP.mjs +0 -8
  176. package/dist/sr-SP.module.js +0 -8
  177. package/dist/sr-SP.module.js.map +0 -1
  178. package/dist/sv-SE.main.js +0 -6
  179. package/dist/sv-SE.main.js.map +0 -1
  180. package/dist/sv-SE.mjs +0 -8
  181. package/dist/sv-SE.module.js +0 -8
  182. package/dist/sv-SE.module.js.map +0 -1
  183. package/dist/tr-TR.main.js +0 -6
  184. package/dist/tr-TR.main.js.map +0 -1
  185. package/dist/tr-TR.mjs +0 -8
  186. package/dist/tr-TR.module.js +0 -8
  187. package/dist/tr-TR.module.js.map +0 -1
  188. package/dist/types.d.ts +0 -13
  189. package/dist/types.d.ts.map +0 -1
  190. package/dist/uk-UA.main.js +0 -6
  191. package/dist/uk-UA.main.js.map +0 -1
  192. package/dist/uk-UA.mjs +0 -8
  193. package/dist/uk-UA.module.js +0 -8
  194. package/dist/uk-UA.module.js.map +0 -1
  195. package/dist/zh-CN.main.js +0 -6
  196. package/dist/zh-CN.main.js.map +0 -1
  197. package/dist/zh-CN.mjs +0 -8
  198. package/dist/zh-CN.module.js +0 -8
  199. package/dist/zh-CN.module.js.map +0 -1
  200. package/dist/zh-TW.main.js +0 -6
  201. package/dist/zh-TW.main.js.map +0 -1
  202. package/dist/zh-TW.mjs +0 -8
  203. package/dist/zh-TW.module.js +0 -8
  204. package/dist/zh-TW.module.js.map +0 -1
  205. package/src/ActionGroup.tsx +0 -500
package/dist/import.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import {ActionGroup as $a04ee251ffcc2690$export$c21a5597f732a168} from "./ActionGroup.mjs";
2
- import {Item as $d15e9ac28055143d$re_export$Item} from "@react-stately/collections";
1
+ import {ActionGroup as $ad185d44fd8b0d40$re_export$ActionGroup} from "@adobe/react-spectrum/ActionGroup";
2
+ import {Item as $ad185d44fd8b0d40$re_export$Item} from "react-stately/Item";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Item as $d15e9ac28055143d$re_export$Item} from "@react-stately/collectio
16
16
 
17
17
 
18
18
 
19
- export {$a04ee251ffcc2690$export$c21a5597f732a168 as ActionGroup, $d15e9ac28055143d$re_export$Item as Item};
19
+ export {$ad185d44fd8b0d40$re_export$ActionGroup as ActionGroup, $ad185d44fd8b0d40$re_export$Item as Item};
20
20
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,13 +1,13 @@
1
- var $9f46a6387592b67c$exports = require("./ActionGroup.main.js");
2
- var $8vZTF$reactstatelycollections = require("@react-stately/collections");
1
+ var $dFWqh$adobereactspectrumActionGroup = require("@adobe/react-spectrum/ActionGroup");
2
+ var $dFWqh$reactstatelyItem = require("react-stately/Item");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "ActionGroup", () => $9f46a6387592b67c$exports.ActionGroup);
10
- $parcel$export(module.exports, "Item", () => $8vZTF$reactstatelycollections.Item);
9
+ $parcel$export(module.exports, "ActionGroup", function () { return $dFWqh$adobereactspectrumActionGroup.ActionGroup; });
10
+ $parcel$export(module.exports, "Item", function () { return $dFWqh$reactstatelyItem.Item; });
11
11
  /*
12
12
  * Copyright 2020 Adobe. All rights reserved.
13
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/actiongroup/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/// <reference types=\"css-module-types\" />\nexport {ActionGroup} from './ActionGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumActionGroupProps} from '@react-types/actiongroup';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/actiongroup/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/// <reference types=\"css-module-types\" />\nexport {ActionGroup} from '@adobe/react-spectrum/ActionGroup';\n\nexport type {SpectrumActionGroupProps} from '@adobe/react-spectrum/ActionGroup';\nexport {Item} from 'react-stately/Item';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import {ActionGroup as $a04ee251ffcc2690$export$c21a5597f732a168} from "./ActionGroup.module.js";
2
- import {Item as $d15e9ac28055143d$re_export$Item} from "@react-stately/collections";
1
+ import {ActionGroup as $ad185d44fd8b0d40$re_export$ActionGroup} from "@adobe/react-spectrum/ActionGroup";
2
+ import {Item as $ad185d44fd8b0d40$re_export$Item} from "react-stately/Item";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {Item as $d15e9ac28055143d$re_export$Item} from "@react-stately/collectio
16
16
 
17
17
 
18
18
 
19
- export {$a04ee251ffcc2690$export$c21a5597f732a168 as ActionGroup, $d15e9ac28055143d$re_export$Item as Item};
19
+ export {$ad185d44fd8b0d40$re_export$ActionGroup as ActionGroup, $ad185d44fd8b0d40$re_export$Item as Item};
20
20
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/actiongroup/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/// <reference types=\"css-module-types\" />\nexport {ActionGroup} from './ActionGroup';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumActionGroupProps} from '@react-types/actiongroup';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/actiongroup/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/// <reference types=\"css-module-types\" />\nexport {ActionGroup} from '@adobe/react-spectrum/ActionGroup';\n\nexport type {SpectrumActionGroupProps} from '@adobe/react-spectrum/ActionGroup';\nexport {Item} from 'react-stately/Item';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,3 @@
1
+ export { ActionGroup } from '@adobe/react-spectrum/ActionGroup';
2
+ export type { SpectrumActionGroupProps } from '@adobe/react-spectrum/ActionGroup';
3
+ export { Item } from 'react-stately/Item';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/actiongroup",
3
- "version": "3.11.7",
3
+ "version": "3.12.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,50 +24,23 @@
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/actiongroup": "^3.7.24",
44
- "@react-aria/focus": "^3.21.5",
45
- "@react-aria/i18n": "^3.12.16",
46
- "@react-aria/interactions": "^3.27.1",
47
- "@react-aria/utils": "^3.33.1",
48
- "@react-spectrum/button": "^3.17.7",
49
- "@react-spectrum/menu": "^3.22.11",
50
- "@react-spectrum/text": "^3.5.25",
51
- "@react-spectrum/tooltip": "^3.8.2",
52
- "@react-spectrum/utils": "^3.12.12",
53
- "@react-stately/collections": "^3.12.10",
54
- "@react-stately/list": "^3.13.4",
55
- "@react-types/actiongroup": "^3.4.23",
56
- "@react-types/shared": "^3.33.1",
57
- "@spectrum-icons/ui": "^3.6.23",
58
- "@spectrum-icons/workflow": "^4.2.28",
59
- "@swc/helpers": "^0.5.0"
60
- },
61
- "devDependencies": {
62
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
34
+ "@adobe/react-spectrum": "3.47.0",
35
+ "@swc/helpers": "^0.5.0",
36
+ "react-stately": "3.46.0"
63
37
  },
64
38
  "peerDependencies": {
65
- "@react-spectrum/provider": "^3.2.0",
66
39
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
67
40
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
68
41
  },
69
42
  "publishConfig": {
70
43
  "access": "public"
71
44
  },
72
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
45
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
73
46
  }
package/src/index.ts CHANGED
@@ -10,6 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  /// <reference types="css-module-types" />
13
- export {ActionGroup} from './ActionGroup';
14
- export {Item} from '@react-stately/collections';
15
- export type {SpectrumActionGroupProps} from '@react-types/actiongroup';
13
+ export {ActionGroup} from '@adobe/react-spectrum/ActionGroup';
14
+
15
+ export type {SpectrumActionGroupProps} from '@adobe/react-spectrum/ActionGroup';
16
+ export {Item} from 'react-stately/Item';
@@ -1,398 +0,0 @@
1
- require("./actiongroup.bb161279.css");
2
- var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
- var $78d2e63e5b4fce1c$exports = require("./intlStrings.main.js");
4
- require("./actiongroup.c0b1ee3f.css");
5
- var $d9f76447f7a8d3f9$exports = require("./actiongroup_vars_css.main.js");
6
- var $2RJq8$reactspectrumbutton = require("@react-spectrum/button");
7
- var $2RJq8$spectrumiconsuiChevronDownMedium = require("@spectrum-icons/ui/ChevronDownMedium");
8
- var $2RJq8$reactspectrumutils = require("@react-spectrum/utils");
9
- var $2RJq8$reactariautils = require("@react-aria/utils");
10
- var $2RJq8$reactariafocus = require("@react-aria/focus");
11
- var $2RJq8$reactspectrummenu = require("@react-spectrum/menu");
12
- var $2RJq8$reactstatelylist = require("@react-stately/list");
13
- var $2RJq8$spectrumiconsworkflowMore = require("@spectrum-icons/workflow/More");
14
- var $2RJq8$reactariainteractions = require("@react-aria/interactions");
15
- var $2RJq8$reactspectrumprovider = require("@react-spectrum/provider");
16
- var $2RJq8$react = require("react");
17
- var $2RJq8$reactspectrumtext = require("@react-spectrum/text");
18
- var $2RJq8$reactspectrumtooltip = require("@react-spectrum/tooltip");
19
- var $2RJq8$reactariaactiongroup = require("@react-aria/actiongroup");
20
- var $2RJq8$reactariai18n = require("@react-aria/i18n");
21
-
22
-
23
- function $parcel$interopDefault(a) {
24
- return a && a.__esModule ? a.default : a;
25
- }
26
-
27
- function $parcel$export(e, n, v, s) {
28
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
29
- }
30
-
31
- $parcel$export(module.exports, "ActionGroup", () => $9f46a6387592b67c$export$c21a5597f732a168);
32
- /*
33
- * Copyright 2020 Adobe. All rights reserved.
34
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
- * you may not use this file except in compliance with the License. You may obtain a copy
36
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
37
- *
38
- * Unless required by applicable law or agreed to in writing, software distributed under
39
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
- * OF ANY KIND, either express or implied. See the License for the specific language
41
- * governing permissions and limitations under the License.
42
- */
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
- const $9f46a6387592b67c$export$c21a5597f732a168 = /*#__PURE__*/ (0, $2RJq8$react.forwardRef)(function ActionGroup(props, ref) {
61
- props = (0, $2RJq8$reactspectrumprovider.useProviderProps)(props);
62
- props = (0, $2RJq8$reactspectrumutils.useSlotProps)(props, 'actionGroup');
63
- let { isEmphasized: isEmphasized, density: density, isJustified: isJustified, isDisabled: isDisabled, orientation: orientation = 'horizontal', isQuiet: isQuiet, staticColor: staticColor, overflowMode: overflowMode = 'wrap', onAction: onAction, buttonLabelBehavior: buttonLabelBehavior, summaryIcon: summaryIcon, ...otherProps } = props;
64
- let domRef = (0, $2RJq8$reactspectrumutils.useDOMRef)(ref);
65
- let wrapperRef = (0, $2RJq8$react.useRef)(null);
66
- let state = (0, $2RJq8$reactstatelylist.useListState)({
67
- ...props,
68
- suppressTextValueWarning: true
69
- });
70
- let { actionGroupProps: actionGroupProps } = (0, $2RJq8$reactariaactiongroup.useActionGroup)(props, state, domRef);
71
- let isVertical = orientation === 'vertical';
72
- let providerProps = {
73
- isEmphasized: isEmphasized,
74
- isDisabled: isDisabled,
75
- isQuiet: isQuiet
76
- };
77
- let { styleProps: styleProps } = (0, $2RJq8$reactspectrumutils.useStyleProps)(props);
78
- // Only hide button text if every item contains more than just plain text (we assume an icon).
79
- let isIconCollapsible = (0, $2RJq8$react.useMemo)(()=>[
80
- ...state.collection
81
- ].every((item)=>typeof item.rendered !== 'string'), [
82
- state.collection
83
- ]);
84
- let [{ visibleItems: visibleItems, hideButtonText: hideButtonText, isMeasuring: isMeasuring }, setVisibleItems] = (0, $2RJq8$reactariautils.useValueEffect)({
85
- visibleItems: state.collection.size,
86
- hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,
87
- isMeasuring: false
88
- });
89
- let selectionMode = state.selectionManager.selectionMode;
90
- let updateOverflow = (0, $2RJq8$react.useCallback)(()=>{
91
- if (overflowMode === 'wrap') return;
92
- if (orientation === 'vertical' && selectionMode !== 'none') // Collapsing vertical action groups with selection is currently unsupported by Spectrum.
93
- return;
94
- let computeVisibleItems = (visibleItems)=>{
95
- if (domRef.current && wrapperRef.current) {
96
- let listItems = Array.from(domRef.current.children);
97
- let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;
98
- let isShowingMenu = visibleItems < state.collection.size;
99
- let calculatedSize = 0;
100
- let newVisibleItems = 0;
101
- if (isShowingMenu) {
102
- let item = listItems.pop();
103
- if (item) calculatedSize += orientation === 'horizontal' ? $9f46a6387592b67c$var$outerWidth(item, false, true) : $9f46a6387592b67c$var$outerHeight(item, false, true);
104
- }
105
- for (let [i, item] of listItems.entries()){
106
- calculatedSize += orientation === 'horizontal' ? $9f46a6387592b67c$var$outerWidth(item, i === 0, i === listItems.length - 1) : $9f46a6387592b67c$var$outerHeight(item, i === 0, i === listItems.length - 1);
107
- if (Math.round(calculatedSize) <= Math.round(containerSize)) newVisibleItems++;
108
- else break;
109
- }
110
- // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown
111
- // immediately rather than having some visible and some not.
112
- if (selectionMode !== 'none' && newVisibleItems < state.collection.size) return 0;
113
- return newVisibleItems;
114
- }
115
- return visibleItems;
116
- };
117
- setVisibleItems(function*() {
118
- let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;
119
- // Update to show all items.
120
- yield {
121
- visibleItems: state.collection.size,
122
- hideButtonText: hideButtonText,
123
- isMeasuring: true
124
- };
125
- // Measure, and update to show the items that fit.
126
- let newVisibleItems = computeVisibleItems(state.collection.size);
127
- let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;
128
- // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding
129
- // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.
130
- if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {
131
- yield {
132
- visibleItems: state.collection.size,
133
- hideButtonText: true,
134
- isMeasuring: true
135
- };
136
- newVisibleItems = computeVisibleItems(state.collection.size);
137
- isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;
138
- hideButtonText = true;
139
- }
140
- yield {
141
- visibleItems: newVisibleItems,
142
- hideButtonText: hideButtonText,
143
- isMeasuring: isMeasuring
144
- };
145
- // If the number of items is less than the number of children,
146
- // then update again to ensure that the menu fits.
147
- if (isMeasuring) yield {
148
- visibleItems: computeVisibleItems(newVisibleItems),
149
- hideButtonText: hideButtonText,
150
- isMeasuring: false
151
- };
152
- });
153
- }, [
154
- domRef,
155
- state.collection,
156
- setVisibleItems,
157
- overflowMode,
158
- selectionMode,
159
- buttonLabelBehavior,
160
- isIconCollapsible,
161
- orientation
162
- ]);
163
- // Watch the parent element for size changes. Watching only the action group itself may not work
164
- // in all scenarios because it may not shrink when available space is reduced.
165
- let parentRef = (0, $2RJq8$react.useMemo)(()=>({
166
- get current () {
167
- var _wrapperRef_current;
168
- return (_wrapperRef_current = wrapperRef.current) === null || _wrapperRef_current === void 0 ? void 0 : _wrapperRef_current.parentElement;
169
- }
170
- }), [
171
- wrapperRef
172
- ]);
173
- (0, $2RJq8$reactariautils.useResizeObserver)({
174
- ref: overflowMode !== 'wrap' ? parentRef : undefined,
175
- onResize: updateOverflow
176
- });
177
- (0, $2RJq8$reactariautils.useLayoutEffect)(updateOverflow, [
178
- updateOverflow,
179
- state.collection
180
- ]);
181
- let children = [
182
- ...state.collection
183
- ];
184
- let menuItem = null;
185
- let menuProps = {};
186
- // If there are no visible items, don't apply any props to the action group container
187
- // and pass all aria labeling props through to the menu button.
188
- if (overflowMode === 'collapse' && visibleItems === 0) {
189
- menuProps = (0, $2RJq8$reactariautils.filterDOMProps)(props, {
190
- labelable: true
191
- });
192
- actionGroupProps = {};
193
- }
194
- if (overflowMode === 'collapse' && visibleItems < state.collection.size) {
195
- let menuChildren = children.slice(visibleItems);
196
- children = children.slice(0, visibleItems);
197
- menuItem = /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement($9f46a6387592b67c$var$ActionGroupMenu, {
198
- ...menuProps,
199
- items: menuChildren,
200
- onAction: onAction,
201
- isDisabled: isDisabled,
202
- isEmphasized: isEmphasized,
203
- staticColor: staticColor,
204
- state: state,
205
- summaryIcon: summaryIcon,
206
- hideButtonText: hideButtonText,
207
- isOnlyItem: visibleItems === 0,
208
- orientation: orientation
209
- });
210
- }
211
- let style = {
212
- ...styleProps.style,
213
- // While measuring, take up as much space as possible.
214
- flexBasis: isMeasuring ? '100%' : undefined
215
- };
216
- return /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactariafocus.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement("div", {
217
- ...styleProps,
218
- style: style,
219
- className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'flex-container', styleProps.className),
220
- ref: wrapperRef
221
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement("div", {
222
- ...actionGroupProps,
223
- ref: domRef,
224
- className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'flex-gap', 'spectrum-ActionGroup', {
225
- 'spectrum-ActionGroup--quiet': isQuiet,
226
- 'spectrum-ActionGroup--vertical': isVertical,
227
- 'spectrum-ActionGroup--compact': density === 'compact',
228
- 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,
229
- 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'
230
- }, otherProps.UNSAFE_className)
231
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumprovider.Provider), providerProps, children.map((item)=>/*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement($9f46a6387592b67c$var$ActionGroupItem, {
232
- key: item.key,
233
- onAction: onAction,
234
- isDisabled: isDisabled,
235
- isEmphasized: isEmphasized,
236
- staticColor: staticColor,
237
- item: item,
238
- state: state,
239
- hideButtonText: hideButtonText,
240
- orientation: orientation
241
- })), menuItem))));
242
- });
243
- function $9f46a6387592b67c$var$ActionGroupItem({ item: item, state: state, isDisabled: isDisabled, isEmphasized: isEmphasized, staticColor: staticColor, onAction: onAction, hideButtonText: hideButtonText, orientation: orientation }) {
244
- let ref = (0, $2RJq8$react.useRef)(null);
245
- let { buttonProps: buttonProps } = (0, $2RJq8$reactariaactiongroup.useActionGroupItem)({
246
- key: item.key
247
- }, state);
248
- isDisabled = isDisabled || state.disabledKeys.has(item.key);
249
- let isSelected = state.selectionManager.isSelected(item.key);
250
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $2RJq8$reactariainteractions.useHover)({
251
- isDisabled: isDisabled
252
- });
253
- let domProps = (0, $2RJq8$reactariautils.filterDOMProps)(item.props);
254
- if (onAction && !isDisabled) buttonProps = (0, $2RJq8$reactariautils.mergeProps)(buttonProps, {
255
- onPress: ()=>onAction(item.key)
256
- });
257
- // If button text is hidden, we need to show it as a tooltip instead, so
258
- // go find the text element in the DOM after rendering.
259
- let textId = (0, $2RJq8$reactariautils.useId)();
260
- let [textContent, setTextContent] = (0, $2RJq8$react.useState)('');
261
- (0, $2RJq8$reactariautils.useLayoutEffect)(()=>{
262
- var _document_getElementById;
263
- if (hideButtonText) setTextContent((_document_getElementById = document.getElementById(textId)) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.textContent);
264
- }, [
265
- hideButtonText,
266
- item.rendered,
267
- textId
268
- ]);
269
- let button = // Use a PressResponder to send DOM props through.
270
- // ActionButton doesn't allow overriding the role by default.
271
- /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactariainteractions.PressResponder), (0, $2RJq8$reactariautils.mergeProps)(buttonProps, hoverProps, domProps), /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumutils.ClearSlots), null, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumutils.SlotProvider), {
272
- slots: {
273
- text: {
274
- id: hideButtonText ? textId : null,
275
- isHidden: hideButtonText
276
- }
277
- }
278
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumbutton.ActionButton), {
279
- ref: ref,
280
- // @ts-ignore (private)
281
- hideButtonText: hideButtonText,
282
- UNSAFE_className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'spectrum-ActionGroup-item', {
283
- 'is-selected': isSelected,
284
- 'is-hovered': isHovered,
285
- 'spectrum-ActionGroup-item--iconOnly': hideButtonText,
286
- 'spectrum-ActionGroup-item--isDisabled': isDisabled
287
- }, (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), {
288
- 'spectrum-ActionButton--emphasized': isEmphasized,
289
- 'is-selected': isSelected
290
- })),
291
- isDisabled: isDisabled,
292
- staticColor: staticColor,
293
- "aria-label": item['aria-label'],
294
- "aria-labelledby": item['aria-label'] == null && hideButtonText ? textId : undefined
295
- }, item.rendered))));
296
- if (hideButtonText && textContent) button = /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumtooltip.TooltipTrigger), {
297
- placement: orientation === 'vertical' ? 'end' : 'top'
298
- }, button, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumtooltip.Tooltip), null, textContent));
299
- if (item.wrapper) button = item.wrapper(button);
300
- return button;
301
- }
302
- function $9f46a6387592b67c$var$ActionGroupMenu({ state: state, isDisabled: isDisabled, isEmphasized: isEmphasized, staticColor: staticColor, items: items, onAction: onAction, summaryIcon: summaryIcon, hideButtonText: hideButtonText, isOnlyItem: isOnlyItem, orientation: orientation, ...otherProps }) {
303
- // Use the key of the first item within the menu as the key of the button.
304
- // The key must actually exist in the collection for focus to work correctly.
305
- let key = items[0].key;
306
- let { buttonProps: buttonProps } = (0, $2RJq8$reactariaactiongroup.useActionGroupItem)({
307
- key: key
308
- }, state);
309
- let stringFormatter = (0, $2RJq8$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($78d2e63e5b4fce1c$exports))), '@react-spectrum/actiongroup');
310
- // The menu button shouldn't act like an actual action group item.
311
- delete buttonProps.onPress;
312
- delete buttonProps.role;
313
- delete buttonProps['aria-checked'];
314
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $2RJq8$reactariainteractions.useHover)({
315
- isDisabled: isDisabled
316
- });
317
- // If no aria-label or aria-labelledby is given, provide a default one.
318
- let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));
319
- let ariaLabelledby = otherProps['aria-labelledby'];
320
- let textId = (0, $2RJq8$reactariautils.useId)();
321
- let id = (0, $2RJq8$reactariautils.useId)();
322
- // Summary icon only applies when selection is enabled.
323
- if (state.selectionManager.selectionMode === 'none') summaryIcon = null;
324
- let iconOnly = false;
325
- // If there is a selection, show the selected state on the menu button.
326
- let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;
327
- // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).
328
- if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {
329
- let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);
330
- if (selectedItem) {
331
- summaryIcon = selectedItem.rendered;
332
- if (typeof summaryIcon === 'string') summaryIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumtext.Text), null, summaryIcon);
333
- iconOnly = !!hideButtonText;
334
- ariaLabelledby = `${ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : id} ${textId}`;
335
- }
336
- }
337
- if (summaryIcon) // If there's a custom summary icon, also add a chevron.
338
- summaryIcon = /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, ($parcel$interopDefault($2RJq8$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, ($parcel$interopDefault($2RJq8$spectrumiconsuiChevronDownMedium))), {
339
- UNSAFE_className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'spectrum-ActionGroup-menu-chevron')
340
- }), /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement("span", {
341
- className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'spectrum-ActionGroup-menu-contents', {
342
- 'spectrum-ActionGroup-item--iconOnly': iconOnly
343
- })
344
- }, summaryIcon));
345
- return(// Use a PressResponder to send DOM props through.
346
- /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrummenu.MenuTrigger), {
347
- align: isOnlyItem ? 'start' : 'end',
348
- direction: orientation === 'vertical' ? 'end' : 'bottom'
349
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumutils.SlotProvider), {
350
- slots: {
351
- text: {
352
- id: hideButtonText ? textId : null,
353
- isHidden: hideButtonText,
354
- UNSAFE_className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'spectrum-ActionGroup-menu-text')
355
- }
356
- }
357
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactariainteractions.PressResponder), (0, $2RJq8$reactariautils.mergeProps)(buttonProps, hoverProps), /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrumbutton.ActionButton), {
358
- ...otherProps,
359
- id: id,
360
- "aria-label": ariaLabel,
361
- "aria-labelledby": ariaLabelledby,
362
- UNSAFE_className: (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d9f76447f7a8d3f9$exports))), 'spectrum-ActionGroup-item', 'spectrum-ActionGroup-menu', {
363
- 'is-hovered': isHovered,
364
- 'is-selected': isSelected
365
- }, (0, $2RJq8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), {
366
- 'is-selected': isSelected,
367
- 'spectrum-ActionButton--emphasized': isEmphasized
368
- })),
369
- isDisabled: isDisabled,
370
- staticColor: staticColor
371
- }, summaryIcon || /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, ($parcel$interopDefault($2RJq8$spectrumiconsworkflowMore))), null)))), /*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrummenu.Menu), {
372
- items: items,
373
- disabledKeys: state.disabledKeys,
374
- selectionMode: state.selectionManager.selectionMode,
375
- selectedKeys: state.selectionManager.selectedKeys,
376
- disallowEmptySelection: state.selectionManager.disallowEmptySelection,
377
- onSelectionChange: (keys)=>state.selectionManager.setSelectedKeys(keys),
378
- onAction: onAction
379
- }, (node)=>/*#__PURE__*/ (0, ($parcel$interopDefault($2RJq8$react))).createElement((0, $2RJq8$reactspectrummenu.Item), {
380
- textValue: node.textValue,
381
- ...(0, $2RJq8$reactariautils.filterDOMProps)(node.props)
382
- }, node.rendered))));
383
- }
384
- function $9f46a6387592b67c$var$outerWidth(element, ignoreLeftMargin, ignoreRightMargin) {
385
- let style = window.getComputedStyle(element);
386
- return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : $9f46a6387592b67c$var$toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : $9f46a6387592b67c$var$toNumber(style.marginRight));
387
- }
388
- function $9f46a6387592b67c$var$outerHeight(element, ignoreTopMargin, ignoreBottomMargin) {
389
- let style = window.getComputedStyle(element);
390
- return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : $9f46a6387592b67c$var$toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : $9f46a6387592b67c$var$toNumber(style.marginBottom));
391
- }
392
- function $9f46a6387592b67c$var$toNumber(value) {
393
- let parsed = parseInt(value, 10);
394
- return isNaN(parsed) ? 0 : parsed;
395
- }
396
-
397
-
398
- //# sourceMappingURL=ActionGroup.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAmCM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAA8B,KAAkC,EAAE,GAA2B;IAC1I,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,gBACF,YAAY,WACZ,OAAO,eACP,WAAW,cACX,UAAU,eACV,cAAc,uBACd,OAAO,eACP,WAAW,gBACX,eAAe,kBACf,QAAQ,uBACR,mBAAmB,eACnB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,QAAQ,CAAA,GAAA,oCAAW,EAAE;QAAC,GAAG,KAAK;QAAE,0BAA0B;IAAI;IAClE,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,0CAAa,EAAE,OAAO,OAAO;IACtD,IAAI,aAAa,gBAAgB;IACjC,IAAI,gBAAgB;sBAAC;oBAAc;iBAAY;IAAO;IACtD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,8FAA8F;IAC9F,IAAI,oBAAoB,CAAA,GAAA,oBAAM,EAAE,IAAM;eAAI,MAAM,UAAU;SAAC,CAAC,KAAK,CAAC,CAAA,OAAQ,OAAO,KAAK,QAAQ,KAAK,WAAW;QAAC,MAAM,UAAU;KAAC;IAChI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,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nexport const ActionGroup = forwardRef(function ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actiongroup');\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.main.js.map"}