@adobe/react-spectrum 3.47.2 → 3.47.3

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 (399) hide show
  1. package/dist/private/actionbar/ActionBar.cjs +2 -3
  2. package/dist/private/actionbar/ActionBar.cjs.map +1 -1
  3. package/dist/private/actionbar/ActionBar.js +2 -3
  4. package/dist/private/actionbar/ActionBar.js.map +1 -1
  5. package/dist/private/actionbar/ActionBar.mjs +2 -3
  6. package/dist/private/actionbar/ActionBar.mjs.map +1 -1
  7. package/dist/private/actiongroup/ActionGroup.cjs +5 -1
  8. package/dist/private/actiongroup/ActionGroup.cjs.map +1 -1
  9. package/dist/private/actiongroup/ActionGroup.js +5 -1
  10. package/dist/private/actiongroup/ActionGroup.js.map +1 -1
  11. package/dist/private/actiongroup/ActionGroup.mjs +5 -1
  12. package/dist/private/actiongroup/ActionGroup.mjs.map +1 -1
  13. package/dist/private/autocomplete/MobileSearchAutocomplete.cjs +6 -0
  14. package/dist/private/autocomplete/MobileSearchAutocomplete.cjs.map +1 -1
  15. package/dist/private/autocomplete/MobileSearchAutocomplete.js +6 -0
  16. package/dist/private/autocomplete/MobileSearchAutocomplete.js.map +1 -1
  17. package/dist/private/autocomplete/MobileSearchAutocomplete.mjs +6 -0
  18. package/dist/private/autocomplete/MobileSearchAutocomplete.mjs.map +1 -1
  19. package/dist/private/autocomplete/SearchAutocomplete.cjs +1 -0
  20. package/dist/private/autocomplete/SearchAutocomplete.cjs.map +1 -1
  21. package/dist/private/autocomplete/SearchAutocomplete.js +1 -0
  22. package/dist/private/autocomplete/SearchAutocomplete.js.map +1 -1
  23. package/dist/private/autocomplete/SearchAutocomplete.mjs +1 -0
  24. package/dist/private/autocomplete/SearchAutocomplete.mjs.map +1 -1
  25. package/dist/private/button/Button.cjs +2 -1
  26. package/dist/private/button/Button.cjs.map +1 -1
  27. package/dist/private/button/Button.js +3 -2
  28. package/dist/private/button/Button.js.map +1 -1
  29. package/dist/private/button/Button.mjs +3 -2
  30. package/dist/private/button/Button.mjs.map +1 -1
  31. package/dist/private/button/ClearButton.cjs +2 -1
  32. package/dist/private/button/ClearButton.cjs.map +1 -1
  33. package/dist/private/button/ClearButton.js +2 -1
  34. package/dist/private/button/ClearButton.js.map +1 -1
  35. package/dist/private/button/ClearButton.mjs +2 -1
  36. package/dist/private/button/ClearButton.mjs.map +1 -1
  37. package/dist/private/buttongroup/ButtonGroup.cjs +4 -2
  38. package/dist/private/buttongroup/ButtonGroup.cjs.map +1 -1
  39. package/dist/private/buttongroup/ButtonGroup.js +4 -2
  40. package/dist/private/buttongroup/ButtonGroup.js.map +1 -1
  41. package/dist/private/buttongroup/ButtonGroup.mjs +4 -2
  42. package/dist/private/buttongroup/ButtonGroup.mjs.map +1 -1
  43. package/dist/private/card/CardBase.cjs +1 -0
  44. package/dist/private/card/CardBase.cjs.map +1 -1
  45. package/dist/private/card/CardBase.js +1 -0
  46. package/dist/private/card/CardBase.js.map +1 -1
  47. package/dist/private/card/CardBase.mjs +1 -0
  48. package/dist/private/card/CardBase.mjs.map +1 -1
  49. package/dist/private/card/CardView.cjs +3 -0
  50. package/dist/private/card/CardView.cjs.map +1 -1
  51. package/dist/private/card/CardView.js +3 -0
  52. package/dist/private/card/CardView.js.map +1 -1
  53. package/dist/private/card/CardView.mjs +3 -0
  54. package/dist/private/card/CardView.mjs.map +1 -1
  55. package/dist/private/checkbox/Checkbox.cjs.map +1 -1
  56. package/dist/private/checkbox/Checkbox.js.map +1 -1
  57. package/dist/private/checkbox/Checkbox.mjs.map +1 -1
  58. package/dist/private/color/ColorField.cjs +1 -0
  59. package/dist/private/color/ColorField.cjs.map +1 -1
  60. package/dist/private/color/ColorField.js +1 -0
  61. package/dist/private/color/ColorField.js.map +1 -1
  62. package/dist/private/color/ColorField.mjs +1 -0
  63. package/dist/private/color/ColorField.mjs.map +1 -1
  64. package/dist/private/color/ColorPicker.cjs.map +1 -1
  65. package/dist/private/color/ColorPicker.js.map +1 -1
  66. package/dist/private/color/ColorPicker.mjs.map +1 -1
  67. package/dist/private/color/ColorSwatch.cjs +2 -1
  68. package/dist/private/color/ColorSwatch.cjs.map +1 -1
  69. package/dist/private/color/ColorSwatch.js +2 -1
  70. package/dist/private/color/ColorSwatch.js.map +1 -1
  71. package/dist/private/color/ColorSwatch.mjs +2 -1
  72. package/dist/private/color/ColorSwatch.mjs.map +1 -1
  73. package/dist/private/color/ColorSwatchPicker.cjs.map +1 -1
  74. package/dist/private/color/ColorSwatchPicker.js.map +1 -1
  75. package/dist/private/color/ColorSwatchPicker.mjs.map +1 -1
  76. package/dist/private/color/ColorWheel.cjs +1 -0
  77. package/dist/private/color/ColorWheel.cjs.map +1 -1
  78. package/dist/private/color/ColorWheel.js +1 -0
  79. package/dist/private/color/ColorWheel.js.map +1 -1
  80. package/dist/private/color/ColorWheel.mjs +1 -0
  81. package/dist/private/color/ColorWheel.mjs.map +1 -1
  82. package/dist/private/combobox/ComboBox.cjs +1 -0
  83. package/dist/private/combobox/ComboBox.cjs.map +1 -1
  84. package/dist/private/combobox/ComboBox.js +1 -0
  85. package/dist/private/combobox/ComboBox.js.map +1 -1
  86. package/dist/private/combobox/ComboBox.mjs +1 -0
  87. package/dist/private/combobox/ComboBox.mjs.map +1 -1
  88. package/dist/private/combobox/MobileComboBox.cjs +8 -0
  89. package/dist/private/combobox/MobileComboBox.cjs.map +1 -1
  90. package/dist/private/combobox/MobileComboBox.js +8 -0
  91. package/dist/private/combobox/MobileComboBox.js.map +1 -1
  92. package/dist/private/combobox/MobileComboBox.mjs +8 -0
  93. package/dist/private/combobox/MobileComboBox.mjs.map +1 -1
  94. package/dist/private/datepicker/DateField.cjs +2 -1
  95. package/dist/private/datepicker/DateField.cjs.map +1 -1
  96. package/dist/private/datepicker/DateField.js +2 -1
  97. package/dist/private/datepicker/DateField.js.map +1 -1
  98. package/dist/private/datepicker/DateField.mjs +2 -1
  99. package/dist/private/datepicker/DateField.mjs.map +1 -1
  100. package/dist/private/datepicker/DatePicker.cjs +2 -1
  101. package/dist/private/datepicker/DatePicker.cjs.map +1 -1
  102. package/dist/private/datepicker/DatePicker.js +2 -1
  103. package/dist/private/datepicker/DatePicker.js.map +1 -1
  104. package/dist/private/datepicker/DatePicker.mjs +2 -1
  105. package/dist/private/datepicker/DatePicker.mjs.map +1 -1
  106. package/dist/private/datepicker/DateRangePicker.cjs +2 -1
  107. package/dist/private/datepicker/DateRangePicker.cjs.map +1 -1
  108. package/dist/private/datepicker/DateRangePicker.js +2 -1
  109. package/dist/private/datepicker/DateRangePicker.js.map +1 -1
  110. package/dist/private/datepicker/DateRangePicker.mjs +2 -1
  111. package/dist/private/datepicker/DateRangePicker.mjs.map +1 -1
  112. package/dist/private/dialog/AlertDialog.cjs +3 -1
  113. package/dist/private/dialog/AlertDialog.cjs.map +1 -1
  114. package/dist/private/dialog/AlertDialog.js +3 -1
  115. package/dist/private/dialog/AlertDialog.js.map +1 -1
  116. package/dist/private/dialog/AlertDialog.mjs +3 -1
  117. package/dist/private/dialog/AlertDialog.mjs.map +1 -1
  118. package/dist/private/dialog/Dialog.cjs +10 -3
  119. package/dist/private/dialog/Dialog.cjs.map +1 -1
  120. package/dist/private/dialog/Dialog.js +10 -3
  121. package/dist/private/dialog/Dialog.js.map +1 -1
  122. package/dist/private/dialog/Dialog.mjs +10 -3
  123. package/dist/private/dialog/Dialog.mjs.map +1 -1
  124. package/dist/private/dnd/useDragAndDrop.cjs +7 -0
  125. package/dist/private/dnd/useDragAndDrop.cjs.map +1 -1
  126. package/dist/private/dnd/useDragAndDrop.js +7 -0
  127. package/dist/private/dnd/useDragAndDrop.js.map +1 -1
  128. package/dist/private/dnd/useDragAndDrop.mjs +7 -0
  129. package/dist/private/dnd/useDragAndDrop.mjs.map +1 -1
  130. package/dist/private/icon/Icon.cjs +1 -1
  131. package/dist/private/icon/Icon.cjs.map +1 -1
  132. package/dist/private/icon/Icon.js +1 -1
  133. package/dist/private/icon/Icon.js.map +1 -1
  134. package/dist/private/icon/Icon.mjs +1 -1
  135. package/dist/private/icon/Icon.mjs.map +1 -1
  136. package/dist/private/icon/UIIcon.cjs +1 -1
  137. package/dist/private/icon/UIIcon.cjs.map +1 -1
  138. package/dist/private/icon/UIIcon.js +1 -1
  139. package/dist/private/icon/UIIcon.js.map +1 -1
  140. package/dist/private/icon/UIIcon.mjs +1 -1
  141. package/dist/private/icon/UIIcon.mjs.map +1 -1
  142. package/dist/private/intl/label/zh-CN.cjs +1 -1
  143. package/dist/private/intl/label/zh-CN.cjs.map +1 -1
  144. package/dist/private/intl/label/zh-CN.js +1 -1
  145. package/dist/private/intl/label/zh-CN.js.map +1 -1
  146. package/dist/private/intl/label/zh-CN.mjs +1 -1
  147. package/dist/private/intl/label/zh-CN.mjs.map +1 -1
  148. package/dist/private/intl/menu/es-ES.cjs +1 -1
  149. package/dist/private/intl/menu/es-ES.cjs.map +1 -1
  150. package/dist/private/intl/menu/es-ES.js +1 -1
  151. package/dist/private/intl/menu/es-ES.js.map +1 -1
  152. package/dist/private/intl/menu/es-ES.mjs +1 -1
  153. package/dist/private/intl/menu/es-ES.mjs.map +1 -1
  154. package/dist/private/intl/picker/zh-CN.cjs +1 -1
  155. package/dist/private/intl/picker/zh-CN.cjs.map +1 -1
  156. package/dist/private/intl/picker/zh-CN.js +1 -1
  157. package/dist/private/intl/picker/zh-CN.js.map +1 -1
  158. package/dist/private/intl/picker/zh-CN.mjs +1 -1
  159. package/dist/private/intl/picker/zh-CN.mjs.map +1 -1
  160. package/dist/private/intl/table/es-ES.cjs +1 -1
  161. package/dist/private/intl/table/es-ES.cjs.map +1 -1
  162. package/dist/private/intl/table/es-ES.js +1 -1
  163. package/dist/private/intl/table/es-ES.js.map +1 -1
  164. package/dist/private/intl/table/es-ES.mjs +1 -1
  165. package/dist/private/intl/table/es-ES.mjs.map +1 -1
  166. package/dist/private/intl/table/zh-TW.cjs +2 -2
  167. package/dist/private/intl/table/zh-TW.cjs.map +1 -1
  168. package/dist/private/intl/table/zh-TW.js +2 -2
  169. package/dist/private/intl/table/zh-TW.js.map +1 -1
  170. package/dist/private/intl/table/zh-TW.mjs +2 -2
  171. package/dist/private/intl/table/zh-TW.mjs.map +1 -1
  172. package/dist/private/label/Field.cjs +2 -1
  173. package/dist/private/label/Field.cjs.map +1 -1
  174. package/dist/private/label/Field.js +2 -1
  175. package/dist/private/label/Field.js.map +1 -1
  176. package/dist/private/label/Field.mjs +2 -1
  177. package/dist/private/label/Field.mjs.map +1 -1
  178. package/dist/private/layout/Grid.cjs +2 -1
  179. package/dist/private/layout/Grid.cjs.map +1 -1
  180. package/dist/private/layout/Grid.js +2 -1
  181. package/dist/private/layout/Grid.js.map +1 -1
  182. package/dist/private/layout/Grid.mjs +2 -1
  183. package/dist/private/layout/Grid.mjs.map +1 -1
  184. package/dist/private/link/Link.cjs +3 -0
  185. package/dist/private/link/Link.cjs.map +1 -1
  186. package/dist/private/link/Link.js +3 -0
  187. package/dist/private/link/Link.js.map +1 -1
  188. package/dist/private/link/Link.mjs +3 -0
  189. package/dist/private/link/Link.mjs.map +1 -1
  190. package/dist/private/list/InsertionIndicator.cjs +1 -0
  191. package/dist/private/list/InsertionIndicator.cjs.map +1 -1
  192. package/dist/private/list/InsertionIndicator.js +1 -0
  193. package/dist/private/list/InsertionIndicator.js.map +1 -1
  194. package/dist/private/list/InsertionIndicator.mjs +1 -0
  195. package/dist/private/list/InsertionIndicator.mjs.map +1 -1
  196. package/dist/private/list/ListView.cjs +5 -0
  197. package/dist/private/list/ListView.cjs.map +1 -1
  198. package/dist/private/list/ListView.js +5 -0
  199. package/dist/private/list/ListView.js.map +1 -1
  200. package/dist/private/list/ListView.mjs +5 -0
  201. package/dist/private/list/ListView.mjs.map +1 -1
  202. package/dist/private/list/ListViewItem.cjs +2 -0
  203. package/dist/private/list/ListViewItem.cjs.map +1 -1
  204. package/dist/private/list/ListViewItem.js +2 -0
  205. package/dist/private/list/ListViewItem.js.map +1 -1
  206. package/dist/private/list/ListViewItem.mjs +2 -0
  207. package/dist/private/list/ListViewItem.mjs.map +1 -1
  208. package/dist/private/list/RootDropIndicator.cjs +1 -0
  209. package/dist/private/list/RootDropIndicator.cjs.map +1 -1
  210. package/dist/private/list/RootDropIndicator.js +1 -0
  211. package/dist/private/list/RootDropIndicator.js.map +1 -1
  212. package/dist/private/list/RootDropIndicator.mjs +1 -0
  213. package/dist/private/list/RootDropIndicator.mjs.map +1 -1
  214. package/dist/private/menu/ContextualHelpTrigger.cjs +7 -1
  215. package/dist/private/menu/ContextualHelpTrigger.cjs.map +1 -1
  216. package/dist/private/menu/ContextualHelpTrigger.js +7 -1
  217. package/dist/private/menu/ContextualHelpTrigger.js.map +1 -1
  218. package/dist/private/menu/ContextualHelpTrigger.mjs +7 -1
  219. package/dist/private/menu/ContextualHelpTrigger.mjs.map +1 -1
  220. package/dist/private/menu/MenuItem.cjs +2 -0
  221. package/dist/private/menu/MenuItem.cjs.map +1 -1
  222. package/dist/private/menu/MenuItem.js +2 -0
  223. package/dist/private/menu/MenuItem.js.map +1 -1
  224. package/dist/private/menu/MenuItem.mjs +2 -0
  225. package/dist/private/menu/MenuItem.mjs.map +1 -1
  226. package/dist/private/menu/MenuTrigger.cjs +1 -0
  227. package/dist/private/menu/MenuTrigger.cjs.map +1 -1
  228. package/dist/private/menu/MenuTrigger.js +1 -0
  229. package/dist/private/menu/MenuTrigger.js.map +1 -1
  230. package/dist/private/menu/MenuTrigger.mjs +1 -0
  231. package/dist/private/menu/MenuTrigger.mjs.map +1 -1
  232. package/dist/private/menu/SubmenuTrigger.cjs +6 -1
  233. package/dist/private/menu/SubmenuTrigger.cjs.map +1 -1
  234. package/dist/private/menu/SubmenuTrigger.js +6 -1
  235. package/dist/private/menu/SubmenuTrigger.js.map +1 -1
  236. package/dist/private/menu/SubmenuTrigger.mjs +6 -1
  237. package/dist/private/menu/SubmenuTrigger.mjs.map +1 -1
  238. package/dist/private/package.cjs +1 -1
  239. package/dist/private/package.cjs.map +1 -1
  240. package/dist/private/package.js +1 -1
  241. package/dist/private/package.js.map +1 -1
  242. package/dist/private/package.mjs +1 -1
  243. package/dist/private/package.mjs.map +1 -1
  244. package/dist/private/progress/ProgressBarBase.cjs +2 -1
  245. package/dist/private/progress/ProgressBarBase.cjs.map +1 -1
  246. package/dist/private/progress/ProgressBarBase.js +2 -1
  247. package/dist/private/progress/ProgressBarBase.js.map +1 -1
  248. package/dist/private/progress/ProgressBarBase.mjs +2 -1
  249. package/dist/private/progress/ProgressBarBase.mjs.map +1 -1
  250. package/dist/private/progress/ProgressCircle.cjs +2 -1
  251. package/dist/private/progress/ProgressCircle.cjs.map +1 -1
  252. package/dist/private/progress/ProgressCircle.js +2 -1
  253. package/dist/private/progress/ProgressCircle.js.map +1 -1
  254. package/dist/private/progress/ProgressCircle.mjs +2 -1
  255. package/dist/private/progress/ProgressCircle.mjs.map +1 -1
  256. package/dist/private/slider/Slider.cjs +1 -0
  257. package/dist/private/slider/Slider.cjs.map +1 -1
  258. package/dist/private/slider/Slider.js +1 -0
  259. package/dist/private/slider/Slider.js.map +1 -1
  260. package/dist/private/slider/Slider.mjs +1 -0
  261. package/dist/private/slider/Slider.mjs.map +1 -1
  262. package/dist/private/table/InsertionIndicator.cjs +1 -0
  263. package/dist/private/table/InsertionIndicator.cjs.map +1 -1
  264. package/dist/private/table/InsertionIndicator.js +1 -0
  265. package/dist/private/table/InsertionIndicator.js.map +1 -1
  266. package/dist/private/table/InsertionIndicator.mjs +1 -0
  267. package/dist/private/table/InsertionIndicator.mjs.map +1 -1
  268. package/dist/private/table/Resizer.cjs +2 -25
  269. package/dist/private/table/Resizer.cjs.map +1 -1
  270. package/dist/private/table/Resizer.js +3 -26
  271. package/dist/private/table/Resizer.js.map +1 -1
  272. package/dist/private/table/Resizer.mjs +3 -26
  273. package/dist/private/table/Resizer.mjs.map +1 -1
  274. package/dist/private/table/RootDropIndicator.cjs +1 -0
  275. package/dist/private/table/RootDropIndicator.cjs.map +1 -1
  276. package/dist/private/table/RootDropIndicator.js +1 -0
  277. package/dist/private/table/RootDropIndicator.js.map +1 -1
  278. package/dist/private/table/RootDropIndicator.mjs +1 -0
  279. package/dist/private/table/RootDropIndicator.mjs.map +1 -1
  280. package/dist/private/table/TableViewBase.cjs +8 -0
  281. package/dist/private/table/TableViewBase.cjs.map +1 -1
  282. package/dist/private/table/TableViewBase.js +8 -0
  283. package/dist/private/table/TableViewBase.js.map +1 -1
  284. package/dist/private/table/TableViewBase.mjs +8 -0
  285. package/dist/private/table/TableViewBase.mjs.map +1 -1
  286. package/dist/private/table/TreeGridTableView.cjs +1 -0
  287. package/dist/private/table/TreeGridTableView.cjs.map +1 -1
  288. package/dist/private/table/TreeGridTableView.js +1 -0
  289. package/dist/private/table/TreeGridTableView.js.map +1 -1
  290. package/dist/private/table/TreeGridTableView.mjs +1 -0
  291. package/dist/private/table/TreeGridTableView.mjs.map +1 -1
  292. package/dist/private/tabs/Tabs.cjs +4 -2
  293. package/dist/private/tabs/Tabs.cjs.map +1 -1
  294. package/dist/private/tabs/Tabs.js +4 -2
  295. package/dist/private/tabs/Tabs.js.map +1 -1
  296. package/dist/private/tabs/Tabs.mjs +4 -2
  297. package/dist/private/tabs/Tabs.mjs.map +1 -1
  298. package/dist/private/tag/TagGroup.cjs +2 -0
  299. package/dist/private/tag/TagGroup.cjs.map +1 -1
  300. package/dist/private/tag/TagGroup.js +2 -0
  301. package/dist/private/tag/TagGroup.js.map +1 -1
  302. package/dist/private/tag/TagGroup.mjs +2 -0
  303. package/dist/private/tag/TagGroup.mjs.map +1 -1
  304. package/dist/private/textfield/TextArea.cjs +2 -0
  305. package/dist/private/textfield/TextArea.cjs.map +1 -1
  306. package/dist/private/textfield/TextArea.js +2 -0
  307. package/dist/private/textfield/TextArea.js.map +1 -1
  308. package/dist/private/textfield/TextArea.mjs +2 -0
  309. package/dist/private/textfield/TextArea.mjs.map +1 -1
  310. package/dist/private/textfield/TextField.cjs +1 -0
  311. package/dist/private/textfield/TextField.cjs.map +1 -1
  312. package/dist/private/textfield/TextField.js +1 -0
  313. package/dist/private/textfield/TextField.js.map +1 -1
  314. package/dist/private/textfield/TextField.mjs +1 -0
  315. package/dist/private/textfield/TextField.mjs.map +1 -1
  316. package/dist/private/textfield/TextFieldBase.cjs +2 -1
  317. package/dist/private/textfield/TextFieldBase.cjs.map +1 -1
  318. package/dist/private/textfield/TextFieldBase.js +2 -1
  319. package/dist/private/textfield/TextFieldBase.js.map +1 -1
  320. package/dist/private/textfield/TextFieldBase.mjs +2 -1
  321. package/dist/private/textfield/TextFieldBase.mjs.map +1 -1
  322. package/dist/private/utils/Slots.cjs +1 -0
  323. package/dist/private/utils/Slots.cjs.map +1 -1
  324. package/dist/private/utils/Slots.js +1 -0
  325. package/dist/private/utils/Slots.js.map +1 -1
  326. package/dist/private/utils/Slots.mjs +1 -0
  327. package/dist/private/utils/Slots.mjs.map +1 -1
  328. package/dist/types/src/dialog/AlertDialog.d.ts +2 -2
  329. package/i18n/ar-AE.js +1 -1
  330. package/i18n/ar-AE.mjs +1 -1
  331. package/i18n/bg-BG.js +1 -1
  332. package/i18n/bg-BG.mjs +1 -1
  333. package/i18n/cs-CZ.js +1 -1
  334. package/i18n/cs-CZ.mjs +1 -1
  335. package/i18n/da-DK.js +1 -1
  336. package/i18n/da-DK.mjs +1 -1
  337. package/i18n/de-DE.js +1 -1
  338. package/i18n/de-DE.mjs +1 -1
  339. package/i18n/el-GR.js +1 -1
  340. package/i18n/el-GR.mjs +1 -1
  341. package/i18n/en-US.js +1 -1
  342. package/i18n/en-US.mjs +1 -1
  343. package/i18n/es-ES.js +1 -1
  344. package/i18n/es-ES.mjs +1 -1
  345. package/i18n/et-EE.js +1 -1
  346. package/i18n/et-EE.mjs +1 -1
  347. package/i18n/fi-FI.js +1 -1
  348. package/i18n/fi-FI.mjs +1 -1
  349. package/i18n/fr-FR.js +1 -1
  350. package/i18n/fr-FR.mjs +1 -1
  351. package/i18n/he-IL.js +1 -1
  352. package/i18n/he-IL.mjs +1 -1
  353. package/i18n/hr-HR.js +1 -1
  354. package/i18n/hr-HR.mjs +1 -1
  355. package/i18n/hu-HU.js +1 -1
  356. package/i18n/hu-HU.mjs +1 -1
  357. package/i18n/index.js +1 -1
  358. package/i18n/index.mjs +1 -1
  359. package/i18n/it-IT.js +1 -1
  360. package/i18n/it-IT.mjs +1 -1
  361. package/i18n/ja-JP.js +1 -1
  362. package/i18n/ja-JP.mjs +1 -1
  363. package/i18n/ko-KR.js +1 -1
  364. package/i18n/ko-KR.mjs +1 -1
  365. package/i18n/lt-LT.js +1 -1
  366. package/i18n/lt-LT.mjs +1 -1
  367. package/i18n/lv-LV.js +1 -1
  368. package/i18n/lv-LV.mjs +1 -1
  369. package/i18n/nb-NO.js +1 -1
  370. package/i18n/nb-NO.mjs +1 -1
  371. package/i18n/nl-NL.js +1 -1
  372. package/i18n/nl-NL.mjs +1 -1
  373. package/i18n/pl-PL.js +1 -1
  374. package/i18n/pl-PL.mjs +1 -1
  375. package/i18n/pt-BR.js +1 -1
  376. package/i18n/pt-BR.mjs +1 -1
  377. package/i18n/pt-PT.js +1 -1
  378. package/i18n/pt-PT.mjs +1 -1
  379. package/i18n/ro-RO.js +1 -1
  380. package/i18n/ro-RO.mjs +1 -1
  381. package/i18n/ru-RU.js +1 -1
  382. package/i18n/ru-RU.mjs +1 -1
  383. package/i18n/sk-SK.js +1 -1
  384. package/i18n/sk-SK.mjs +1 -1
  385. package/i18n/sl-SI.js +1 -1
  386. package/i18n/sl-SI.mjs +1 -1
  387. package/i18n/sr-SP.js +1 -1
  388. package/i18n/sr-SP.mjs +1 -1
  389. package/i18n/sv-SE.js +1 -1
  390. package/i18n/sv-SE.mjs +1 -1
  391. package/i18n/tr-TR.js +1 -1
  392. package/i18n/tr-TR.mjs +1 -1
  393. package/i18n/uk-UA.js +1 -1
  394. package/i18n/uk-UA.mjs +1 -1
  395. package/i18n/zh-CN.js +1 -1
  396. package/i18n/zh-CN.mjs +1 -1
  397. package/i18n/zh-TW.js +1 -1
  398. package/i18n/zh-TW.mjs +1 -1
  399. package/package.json +7 -7
@@ -76,9 +76,8 @@ function $d8369c3f1737954d$var$ActionBarInner(props, ref) {
76
76
  let [lastCount, setLastCount] = (0, $6UHGv$react.useState)(selectedItemCount);
77
77
  if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) setLastCount(selectedItemCount);
78
78
  let { keyboardProps: keyboardProps } = (0, $6UHGv$reactariauseKeyboard.useKeyboard)({
79
- onKeyDown (e) {
80
- if (e.key === 'Escape') {
81
- e.preventDefault();
79
+ shortcuts: {
80
+ Escape: ()=>{
82
81
  onClearSelection();
83
82
  }
84
83
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA2B;IAE3B,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,wCAAa;QAAE,SAAS;QAAQ,IAAI;QAAQ,cAAA;QAAa,eAAA;qBACxD,0DAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SAAS,qCAAkB,KAA6B,EAAE,GAAwB;IAChF,QAAQ,CAAA,GAAA,0CAAe,EAAE;IAEzB,IAAI,YACF,QAAQ,gBACR,YAAY,YACZ,QAAQ,oBACR,gBAAgB,qBAChB,iBAAiB,UACjB,MAAM,uBACN,sBAAsB,mBACtB,KAAK,gBACL,YAAY,EACb,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,mHAAmH;IACnH,IAAI,CAAC,WAAW,aAAa,GAAG,CAA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AAA,GAAA,0DAAS,yBAEZ,0DAAC,CAAA,GAAA,8BAAG;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@adobe/react-spectrum/src/actionbar/ActionBar.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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA2B;IAE3B,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,wCAAa;QAAE,SAAS;QAAQ,IAAI;QAAQ,cAAA;QAAa,eAAA;qBACxD,0DAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SAAS,qCAAkB,KAA6B,EAAE,GAAwB;IAChF,QAAQ,CAAA,GAAA,0CAAe,EAAE;IAEzB,IAAI,YACF,QAAQ,gBACR,YAAY,YACZ,QAAQ,oBACR,gBAAgB,qBAChB,iBAAiB,UACjB,MAAM,uBACN,sBAAsB,mBACtB,KAAK,gBACL,YAAY,EACb,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,mHAAmH;IACnH,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,IAAI,AAAC,CAAA,sBAAsB,SAAS,oBAAoB,CAAA,KAAM,sBAAsB,WAClF,aAAa;IAGf,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,uCAAU,EAAE;QAChC,WAAW;YACT,QAAQ;gBACN;YACF;QACF;IACF;IAEA,yCAAyC;IACzC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IAC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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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n shortcuts: {\n Escape: () => {\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.cjs.map"}
@@ -70,9 +70,8 @@ function $524588d80192d966$var$ActionBarInner(props, ref) {
70
70
  let [lastCount, setLastCount] = (0, $4oqpT$useState)(selectedItemCount);
71
71
  if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) setLastCount(selectedItemCount);
72
72
  let { keyboardProps: keyboardProps } = (0, $4oqpT$useKeyboard)({
73
- onKeyDown (e) {
74
- if (e.key === 'Escape') {
75
- e.preventDefault();
73
+ shortcuts: {
74
+ Escape: ()=>{
76
75
  onClearSelection();
77
76
  }
78
77
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA2B;IAE3B,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAa;QAAE,SAAS;QAAQ,IAAI;QAAQ,cAAA;QAAa,eAAA;qBACxD,gCAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SAAS,qCAAkB,KAA6B,EAAE,GAAwB;IAChF,QAAQ,CAAA,GAAA,yCAAe,EAAE;IAEzB,IAAI,YACF,QAAQ,gBACR,YAAY,YACZ,QAAQ,oBACR,gBAAgB,qBAChB,iBAAiB,UACjB,MAAM,uBACN,sBAAsB,mBACtB,KAAK,gBACL,YAAY,EACb,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,8CAAW,GAAG;IAEhE,mHAAmH;IACnH,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAE;IACzC,IAAI,AAAC,CAAA,sBAAsB,SAAS,oBAAoB,CAAA,KAAM,sBAAsB,WAClF,aAAa;IAGf,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE;QAChC,WAAU,CAAC;YACT,IAAI,EAAE,GAAG,KAAK,UAAU;gBACtB,EAAE,cAAc;gBAChB;YACF;QACF;IACF;IAEA,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AAC","sources":["packages/@adobe/react-spectrum/src/actionbar/ActionBar.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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,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G,UAAU;QACb,GAAG,aAAa;QACjB,KAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,iDAAK,GACL,4BACA;YACE,wCAAwC;YACxC,WAAW;QACb,GACA,WAAW,SAAS;qBAEtB,gCAAC;QAAI,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;qBACjC,gCAAC,CAAA,GAAA,yCAAU;QACT,OAAO;QACP,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAA;QACA,aAAa,eAAe,UAAU;QACtC,cAAa;QACb,qBAAqB;QACrB,UAAU;QACV,cAAc;QACd,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACpC,yBAEH,gCAAC,CAAA,GAAA,yCAAW;QACV,UAAU,CAAA,GAAA,iDAAK,EAAE,KAAK;QACtB,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS,IAAM;QACf,SAAA;QACA,aAAa,eAAe,UAAU;qBACtC,gCAAC,CAAA,GAAA,gCAAS,yBAEZ,gCAAC,CAAA,GAAA,yCAAG;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@adobe/react-spectrum/src/actionbar/ActionBar.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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n shortcuts: {\n Escape: () => {\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.js.map"}
@@ -70,9 +70,8 @@ function $7d249c89c790c78f$var$ActionBarInner(props, ref) {
70
70
  let [lastCount, setLastCount] = (0, $dytRF$useState)(selectedItemCount);
71
71
  if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) setLastCount(selectedItemCount);
72
72
  let { keyboardProps: keyboardProps } = (0, $dytRF$useKeyboard)({
73
- onKeyDown (e) {
74
- if (e.key === 'Escape') {
75
- e.preventDefault();
73
+ shortcuts: {
74
+ Escape: ()=>{
76
75
  onClearSelection();
77
76
  }
78
77
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,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E,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACb,GAAG,aAAa;QACjB,KAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,iDAAK,GACL,4BACA;YACE,wCAAwC;YACxC,WAAW;QACb,GACA,WAAW,SAAS;qBAEtB,gCAAC;QAAI,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;qBACjC,gCAAC,CAAA,GAAA,yCAAU;QACT,OAAO;QACP,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAA;QACA,aAAa,eAAe,UAAU;QACtC,cAAa;QACb,qBAAqB;QACrB,UAAU;QACV,cAAc;QACd,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACpC,yBAEH,gCAAC,CAAA,GAAA,yCAAW;QACV,UAAU,CAAA,GAAA,iDAAK,EAAE,KAAK;QACtB,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS,IAAM;QACf,SAAA;QACA,aAAa,eAAe,UAAU;qBACtC,gCAAC,CAAA,GAAA,gCAAS,yBAEZ,gCAAC,CAAA,GAAA,yCAAG;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@adobe/react-spectrum/src/actionbar/ActionBar.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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA2B;IAE3B,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAa;QAAE,SAAS;QAAQ,IAAI;QAAQ,cAAA;QAAa,eAAA;qBACxD,gCAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SA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Y,gBAAgB,MAAM,CAAC;QACnC,SAAA;QACA,aAAa,eAAe,UAAU;QACtC,cAAa;QACb,qBAAqB;QACrB,UAAU;QACV,cAAc;QACd,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACpC,yBAEH,gCAAC,CAAA,GAAA,yCAAW;QACV,UAAU,CAAA,GAAA,iDAAK,EAAE,KAAK;QACtB,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS,IAAM;QACf,SAAA;QACA,aAAa,eAAe,UAAU;qBACtC,gCAAC,CAAA,GAAA,gCAAS,yBAEZ,gCAAC,CAAA,GAAA,yCAAG;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,iDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@adobe/react-spectrum/src/actionbar/ActionBar.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 '../button/ActionButton';\nimport {ActionGroup} from '../actiongroup/ActionGroup';\nimport {announce} from 'react-aria/private/live-announcer/LiveAnnouncer';\nimport {classNames} from '../utils/classNames';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMProps, DOMRef, ItemElement, ItemRenderer, Key, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actionbar/*.json';\nimport {OpenTransition} from '../overlays/OpenTransition';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport styles from './actionbar.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ActionBarProps<T> {\n /**\n * An list of `Item` elements or a function. If the latter, a list of items must be provided using\n * the `items` prop.\n */\n children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;\n /** A list of items to display as children. Must be used with a function as the sole child. */\n items?: Iterable<T>;\n /** A list of keys to disable. */\n disabledKeys?: Iterable<Key>;\n /**\n * The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is\n * hidden.\n */\n selectedItemCount: number | 'all';\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection: () => void;\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean;\n /** Handler that is called when an ActionBar button is pressed. */\n onAction?: (key: Key) => void;\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'collapse'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n}\n\nexport interface SpectrumActionBarProps<T> extends ActionBarProps<T>, DOMProps, StyleProps {}\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions\n * on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(\n props: SpectrumActionBarProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition nodeRef={domRef} in={isOpen} mountOnEnter unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean;\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n shortcuts: {\n Escape: () => {\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar',\n {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(\n props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.mjs.map"}
@@ -192,7 +192,8 @@ const $1f2a1f451a6aa23a$export$c21a5597f732a168 = /*#__PURE__*/ (0, $gC6oF$react
192
192
  get current () {
193
193
  return wrapperRef.current?.parentElement;
194
194
  }
195
- }), [
195
+ }), // oxlint-disable-next-line react/react-compiler
196
+ [
196
197
  wrapperRef
197
198
  ]);
198
199
  (0, $gC6oF$reactariaprivateutilsuseResizeObserver.useResizeObserver)({
@@ -332,8 +333,11 @@ function $1f2a1f451a6aa23a$var$ActionGroupMenu({ state: state, isDisabled: isDis
332
333
  }, state);
333
334
  let stringFormatter = (0, $gC6oF$reactariauseLocalizedStringFormatter.useLocalizedStringFormatter)((0, ($parcel$interopDefault($b9a8a32d848cb509$exports))), '@react-spectrum/actiongroup');
334
335
  // The menu button shouldn't act like an actual action group item.
336
+ // oxlint-disable-next-line react/react-compiler
335
337
  delete buttonProps.onPress;
338
+ // oxlint-disable-next-line react/react-compiler
336
339
  delete buttonProps.role;
340
+ // oxlint-disable-next-line react/react-compiler
337
341
  delete buttonProps['aria-checked'];
338
342
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $gC6oF$reactariauseHover.useHover)({
339
343
  isDisabled: isDisabled
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;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obe/react-spectrum/src/actiongroup/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 '../button/ActionButton';\nimport {AriaActionGroupProps, useActionGroup} from 'react-aria/private/actiongroup/useActionGroup';\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 {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider, useSlotProps} from '../utils/Slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actiongroup/*.json';\nimport {Item} from 'react-stately/Item';\nimport {ListState, useListState} from 'react-stately/useListState';\nimport {Menu} from '../menu/Menu';\nimport {MenuTrigger} from '../menu/MenuTrigger';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport {Provider, useProviderProps} from '../provider/Provider';\nimport React, {\n forwardRef,\n ReactElement,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '../text/Text';\nimport {Tooltip} from '../tooltip/Tooltip';\nimport {TooltipTrigger} from '../tooltip/TooltipTrigger';\nimport {useActionGroupItem} from 'react-aria/private/actiongroup/useActionGroupItem';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\n\nexport interface SpectrumActionGroupProps<T> extends AriaActionGroupProps<T>, StyleProps {\n /**\n * Whether the ActionButtons should be displayed with a [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n /**\n * Sets the amount of space between buttons.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular';\n /** Whether the ActionButtons should be justified in their container. */\n isJustified?: boolean;\n /**\n * Whether ActionButtons should use the [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n /** The static color style to apply. Useful when the ActionGroup appears over a color background. */\n staticColor?: 'white' | 'black';\n /**\n * Defines the behavior of the ActionGroup when the buttons do not fit in the available space.\n * When set to 'wrap', the items wrap to form a new line. When set to 'collapse', the items that\n * do not fit are collapsed into a dropdown menu.\n *\n * @default 'wrap'\n */\n overflowMode?: 'wrap' | 'collapse';\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'show'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n /** The icon displayed in the dropdown menu button when a selectable ActionGroup is collapsed. */\n summaryIcon?: ReactElement;\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>(\n props: SpectrumActionGroupProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\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(\n () => [...state.collection].every(item => typeof item.rendered !== 'string'),\n [state.collection]\n );\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 =\n orientation === 'horizontal'\n ? wrapperRef.current.getBoundingClientRect().width\n : 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 +=\n 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 +=\n 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 (\n newVisibleItems < state.collection.size &&\n buttonLabelBehavior === 'collapse' &&\n isIconCollapsible\n ) {\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 }, [\n domRef,\n state.collection,\n setVisibleItems,\n overflowMode,\n selectionMode,\n buttonLabelBehavior,\n isIconCollapsible,\n orientation\n ]);\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 () => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }),\n [wrapperRef]\n );\n useResizeObserver({\n ref: overflowMode !== 'wrap' ? parentRef : undefined,\n onResize: updateOverflow\n });\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={key => onAction?.(key)}\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\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\n {...styleProps}\n style={style}\n className={classNames(styles, 'flex-container', styleProps.className)}\n ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={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 <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 ))}\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>({\n item,\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n onAction,\n hideButtonText,\n orientation\n}: 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={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(buttonStyles, {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\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>({\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n items,\n onAction,\n summaryIcon,\n hideButtonText,\n isOnlyItem,\n orientation,\n ...otherProps\n}: 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 =\n otherProps['aria-label'] ||\n (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 =\n 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 (\n !summaryIcon &&\n state.selectionManager.selectionMode === 'single' &&\n state.selectionManager.disallowEmptySelection &&\n state.selectionManager.firstSelectedKey != null\n ) {\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\n UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')}\n />\n <span\n className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {\n 'spectrum-ActionGroup-item--iconOnly': iconOnly\n })}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger\n align={isOnlyItem ? 'start' : 'end'}\n 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={classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(buttonStyles, {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\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 => (\n <Item textValue={node.textValue} {...filterDOMProps(node.props)}>\n {node.rendered}\n </Item>\n )}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().width +\n (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) +\n (ignoreRightMargin ? 0 : toNumber(style.marginRight))\n );\n}\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().height +\n (ignoreTopMargin ? 0 : toNumber(style.marginTop)) +\n (ignoreBottomMargin ? 0 : toNumber(style.marginBottom))\n );\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.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAC7C,KAAkC,EAClC,GAA2B;IAE3B,QAAQ,CAAA,GAAA,0CAAe,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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AAgB,CAAC,eAAe,CAAC;QAClE,UAAU;OACT,CAAA,qBACC,0DAAC,CAAA,GAAA,4BAAG;YAAE,WAAW,KAAK,SAAS;YAAG,GAAG,CAAA,GAAA,6CAAa,EAAE,KAAK,KAAK,CAAC;WAC5D,KAAK,QAAQ;AAM1B;AAEA,SAAS,iCAAW,OAAoB,EAAE,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OACE,QAAQ,qBAAqB,GAAG,KAAK,GACpC,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAChD,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAEvD;AAEA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OACE,QAAQ,qBAAqB,GAAG,MAAM,GACrC,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAC9C,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAEzD;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@adobe/react-spectrum/src/actiongroup/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 '../button/ActionButton';\nimport {AriaActionGroupProps, useActionGroup} from 'react-aria/private/actiongroup/useActionGroup';\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 {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider, useSlotProps} from '../utils/Slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actiongroup/*.json';\nimport {Item} from 'react-stately/Item';\nimport {ListState, useListState} from 'react-stately/useListState';\nimport {Menu} from '../menu/Menu';\nimport {MenuTrigger} from '../menu/MenuTrigger';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport {Provider, useProviderProps} from '../provider/Provider';\nimport React, {\n forwardRef,\n ReactElement,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '../text/Text';\nimport {Tooltip} from '../tooltip/Tooltip';\nimport {TooltipTrigger} from '../tooltip/TooltipTrigger';\nimport {useActionGroupItem} from 'react-aria/private/actiongroup/useActionGroupItem';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\n\nexport interface SpectrumActionGroupProps<T> extends AriaActionGroupProps<T>, StyleProps {\n /**\n * Whether the ActionButtons should be displayed with a [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n /**\n * Sets the amount of space between buttons.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular';\n /** Whether the ActionButtons should be justified in their container. */\n isJustified?: boolean;\n /**\n * Whether ActionButtons should use the [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n /** The static color style to apply. Useful when the ActionGroup appears over a color background. */\n staticColor?: 'white' | 'black';\n /**\n * Defines the behavior of the ActionGroup when the buttons do not fit in the available space.\n * When set to 'wrap', the items wrap to form a new line. When set to 'collapse', the items that\n * do not fit are collapsed into a dropdown menu.\n *\n * @default 'wrap'\n */\n overflowMode?: 'wrap' | 'collapse';\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'show'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n /** The icon displayed in the dropdown menu button when a selectable ActionGroup is collapsed. */\n summaryIcon?: ReactElement;\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>(\n props: SpectrumActionGroupProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\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(\n () => [...state.collection].every(item => typeof item.rendered !== 'string'),\n [state.collection]\n );\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 =\n orientation === 'horizontal'\n ? wrapperRef.current.getBoundingClientRect().width\n : 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 +=\n 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 +=\n 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 (\n newVisibleItems < state.collection.size &&\n buttonLabelBehavior === 'collapse' &&\n isIconCollapsible\n ) {\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 }, [\n domRef,\n state.collection,\n setVisibleItems,\n overflowMode,\n selectionMode,\n buttonLabelBehavior,\n isIconCollapsible,\n orientation\n ]);\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 () => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }),\n // oxlint-disable-next-line react/react-compiler\n [wrapperRef]\n );\n useResizeObserver({\n ref: overflowMode !== 'wrap' ? parentRef : undefined,\n onResize: updateOverflow\n });\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={key => onAction?.(key)}\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\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\n {...styleProps}\n style={style}\n className={classNames(styles, 'flex-container', styleProps.className)}\n ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={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 <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 ))}\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>({\n item,\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n onAction,\n hideButtonText,\n orientation\n}: 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={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(buttonStyles, {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\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>({\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n items,\n onAction,\n summaryIcon,\n hideButtonText,\n isOnlyItem,\n orientation,\n ...otherProps\n}: 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 // oxlint-disable-next-line react/react-compiler\n delete buttonProps.onPress;\n // oxlint-disable-next-line react/react-compiler\n delete buttonProps.role;\n // oxlint-disable-next-line react/react-compiler\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 =\n otherProps['aria-label'] ||\n (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 =\n 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 (\n !summaryIcon &&\n state.selectionManager.selectionMode === 'single' &&\n state.selectionManager.disallowEmptySelection &&\n state.selectionManager.firstSelectedKey != null\n ) {\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\n UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')}\n />\n <span\n className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {\n 'spectrum-ActionGroup-item--iconOnly': iconOnly\n })}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger\n align={isOnlyItem ? 'start' : 'end'}\n 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={classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(buttonStyles, {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\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 => (\n <Item textValue={node.textValue} {...filterDOMProps(node.props)}>\n {node.rendered}\n </Item>\n )}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().width +\n (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) +\n (ignoreRightMargin ? 0 : toNumber(style.marginRight))\n );\n}\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().height +\n (ignoreTopMargin ? 0 : toNumber(style.marginTop)) +\n (ignoreBottomMargin ? 0 : toNumber(style.marginBottom))\n );\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.cjs.map"}
@@ -187,7 +187,8 @@ const $78c8311cc10fd6f1$export$c21a5597f732a168 = /*#__PURE__*/ (0, $h7VIV$forwa
187
187
  var _wrapperRef_current;
188
188
  return (_wrapperRef_current = wrapperRef.current) === null || _wrapperRef_current === void 0 ? void 0 : _wrapperRef_current.parentElement;
189
189
  }
190
- }), [
190
+ }), // oxlint-disable-next-line react/react-compiler
191
+ [
191
192
  wrapperRef
192
193
  ]);
193
194
  (0, $h7VIV$useResizeObserver)({
@@ -328,8 +329,11 @@ function $78c8311cc10fd6f1$var$ActionGroupMenu({ state: state, isDisabled: isDis
328
329
  }, state);
329
330
  let stringFormatter = (0, $h7VIV$useLocalizedStringFormatter)((0, ($parcel$interopDefault($h7VIV$intlStringsjs))), '@react-spectrum/actiongroup');
330
331
  // The menu button shouldn't act like an actual action group item.
332
+ // oxlint-disable-next-line react/react-compiler
331
333
  delete buttonProps.onPress;
334
+ // oxlint-disable-next-line react/react-compiler
332
335
  delete buttonProps.role;
336
+ // oxlint-disable-next-line react/react-compiler
333
337
  delete buttonProps['aria-checked'];
334
338
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $h7VIV$useHover)({
335
339
  isDisabled: isDisabled
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFM,MAAM,0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ionGroup.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 '../button/ActionButton';\nimport {AriaActionGroupProps, useActionGroup} from 'react-aria/private/actiongroup/useActionGroup';\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 {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider, useSlotProps} from '../utils/Slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actiongroup/*.json';\nimport {Item} from 'react-stately/Item';\nimport {ListState, useListState} from 'react-stately/useListState';\nimport {Menu} from '../menu/Menu';\nimport {MenuTrigger} from '../menu/MenuTrigger';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport {Provider, useProviderProps} from '../provider/Provider';\nimport React, {\n forwardRef,\n ReactElement,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '../text/Text';\nimport {Tooltip} from '../tooltip/Tooltip';\nimport {TooltipTrigger} from '../tooltip/TooltipTrigger';\nimport {useActionGroupItem} from 'react-aria/private/actiongroup/useActionGroupItem';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\n\nexport interface SpectrumActionGroupProps<T> extends AriaActionGroupProps<T>, StyleProps {\n /**\n * Whether the ActionButtons should be displayed with a [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n /**\n * Sets the amount of space between buttons.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular';\n /** Whether the ActionButtons should be justified in their container. */\n isJustified?: boolean;\n /**\n * Whether ActionButtons should use the [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n /** The static color style to apply. Useful when the ActionGroup appears over a color background. */\n staticColor?: 'white' | 'black';\n /**\n * Defines the behavior of the ActionGroup when the buttons do not fit in the available space.\n * When set to 'wrap', the items wrap to form a new line. When set to 'collapse', the items that\n * do not fit are collapsed into a dropdown menu.\n *\n * @default 'wrap'\n */\n overflowMode?: 'wrap' | 'collapse';\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'show'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n /** The icon displayed in the dropdown menu button when a selectable ActionGroup is collapsed. */\n summaryIcon?: ReactElement;\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>(\n props: SpectrumActionGroupProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\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(\n () => [...state.collection].every(item => typeof item.rendered !== 'string'),\n [state.collection]\n );\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 =\n orientation === 'horizontal'\n ? wrapperRef.current.getBoundingClientRect().width\n : 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 +=\n 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 +=\n 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 (\n newVisibleItems < state.collection.size &&\n buttonLabelBehavior === 'collapse' &&\n isIconCollapsible\n ) {\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 }, [\n domRef,\n state.collection,\n setVisibleItems,\n overflowMode,\n selectionMode,\n buttonLabelBehavior,\n isIconCollapsible,\n orientation\n ]);\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 () => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }),\n [wrapperRef]\n );\n useResizeObserver({\n ref: overflowMode !== 'wrap' ? parentRef : undefined,\n onResize: updateOverflow\n });\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={key => onAction?.(key)}\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\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\n {...styleProps}\n style={style}\n className={classNames(styles, 'flex-container', styleProps.className)}\n ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={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 <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 ))}\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>({\n item,\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n onAction,\n hideButtonText,\n orientation\n}: 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={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(buttonStyles, {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\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>({\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n items,\n onAction,\n summaryIcon,\n hideButtonText,\n isOnlyItem,\n orientation,\n ...otherProps\n}: 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 =\n otherProps['aria-label'] ||\n (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 =\n 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 (\n !summaryIcon &&\n state.selectionManager.selectionMode === 'single' &&\n state.selectionManager.disallowEmptySelection &&\n state.selectionManager.firstSelectedKey != null\n ) {\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\n UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')}\n />\n <span\n className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {\n 'spectrum-ActionGroup-item--iconOnly': iconOnly\n })}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger\n align={isOnlyItem ? 'start' : 'end'}\n 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={classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(buttonStyles, {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\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 => (\n <Item textValue={node.textValue} {...filterDOMProps(node.props)}>\n {node.rendered}\n </Item>\n )}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().width +\n (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) +\n (ignoreRightMargin ? 0 : toNumber(style.marginRight))\n );\n}\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().height +\n (ignoreTopMargin ? 0 : toNumber(style.marginTop)) +\n (ignoreBottomMargin ? 0 : toNumber(style.marginBottom))\n );\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.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAkC,EAClC,GAA2B;IAE3B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,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,yCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IACxC,IAAI,QAAQ,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gBAAgB,CAAC,sBAAsB;QACrE,mBAAmB,CAAA,OAAQ,MAAM,gBAAgB,CAAC,eAAe,CAAC;QAClE,UAAU;OACT,CAAA,qBACC,gCAAC,CAAA,GAAA,WAAG;YAAE,WAAW,KAAK,SAAS;YAAG,GAAG,CAAA,GAAA,qBAAa,EAAE,KAAK,KAAK,CAAC;WAC5D,KAAK,QAAQ;AAM1B;AAEA,SAAS,iCAAW,OAAoB,EAAE,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OACE,QAAQ,qBAAqB,GAAG,KAAK,GACpC,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAChD,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAEvD;AAEA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OACE,QAAQ,qBAAqB,GAAG,MAAM,GACrC,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAC9C,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAEzD;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@adobe/react-spectrum/src/actiongroup/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 '../button/ActionButton';\nimport {AriaActionGroupProps, useActionGroup} from 'react-aria/private/actiongroup/useActionGroup';\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 {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider, useSlotProps} from '../utils/Slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport intlMessages from '../../intl/actiongroup/*.json';\nimport {Item} from 'react-stately/Item';\nimport {ListState, useListState} from 'react-stately/useListState';\nimport {Menu} from '../menu/Menu';\nimport {MenuTrigger} from '../menu/MenuTrigger';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport {Provider, useProviderProps} from '../provider/Provider';\nimport React, {\n forwardRef,\n ReactElement,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '../text/Text';\nimport {Tooltip} from '../tooltip/Tooltip';\nimport {TooltipTrigger} from '../tooltip/TooltipTrigger';\nimport {useActionGroupItem} from 'react-aria/private/actiongroup/useActionGroupItem';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nimport {useStyleProps} from '../utils/styleProps';\nimport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\n\nexport interface SpectrumActionGroupProps<T> extends AriaActionGroupProps<T>, StyleProps {\n /**\n * Whether the ActionButtons should be displayed with a [emphasized\n * style](https://spectrum.adobe.com/page/action-button/#Emphasis).\n */\n isEmphasized?: boolean;\n /**\n * Sets the amount of space between buttons.\n *\n * @default 'regular'\n */\n density?: 'compact' | 'regular';\n /** Whether the ActionButtons should be justified in their container. */\n isJustified?: boolean;\n /**\n * Whether ActionButtons should use the [quiet\n * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n */\n isQuiet?: boolean;\n /** The static color style to apply. Useful when the ActionGroup appears over a color background. */\n staticColor?: 'white' | 'black';\n /**\n * Defines the behavior of the ActionGroup when the buttons do not fit in the available space.\n * When set to 'wrap', the items wrap to form a new line. When set to 'collapse', the items that\n * do not fit are collapsed into a dropdown menu.\n *\n * @default 'wrap'\n */\n overflowMode?: 'wrap' | 'collapse';\n /**\n * Defines when the text within the buttons should be hidden and only the icon should be shown.\n * When set to 'hide', the text is always shown in a tooltip. When set to 'collapse', the text is\n * visible if space is available, and hidden when space is limited. The text is always visible\n * when the item is collapsed into a menu.\n *\n * @default 'show'\n */\n buttonLabelBehavior?: 'show' | 'collapse' | 'hide';\n /** The icon displayed in the dropdown menu button when a selectable ActionGroup is collapsed. */\n summaryIcon?: ReactElement;\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>(\n props: SpectrumActionGroupProps<T>,\n ref: DOMRef<HTMLDivElement>\n) {\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(\n () => [...state.collection].every(item => typeof item.rendered !== 'string'),\n [state.collection]\n );\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 =\n orientation === 'horizontal'\n ? wrapperRef.current.getBoundingClientRect().width\n : 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 +=\n 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 +=\n 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 (\n newVisibleItems < state.collection.size &&\n buttonLabelBehavior === 'collapse' &&\n isIconCollapsible\n ) {\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 }, [\n domRef,\n state.collection,\n setVisibleItems,\n overflowMode,\n selectionMode,\n buttonLabelBehavior,\n isIconCollapsible,\n orientation\n ]);\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 () => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }),\n // oxlint-disable-next-line react/react-compiler\n [wrapperRef]\n );\n useResizeObserver({\n ref: overflowMode !== 'wrap' ? parentRef : undefined,\n onResize: updateOverflow\n });\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={key => onAction?.(key)}\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\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\n {...styleProps}\n style={style}\n className={classNames(styles, 'flex-container', styleProps.className)}\n ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={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 <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 ))}\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>({\n item,\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n onAction,\n hideButtonText,\n orientation\n}: 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={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(buttonStyles, {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\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>({\n state,\n isDisabled,\n isEmphasized,\n staticColor,\n items,\n onAction,\n summaryIcon,\n hideButtonText,\n isOnlyItem,\n orientation,\n ...otherProps\n}: 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 // oxlint-disable-next-line react/react-compiler\n delete buttonProps.onPress;\n // oxlint-disable-next-line react/react-compiler\n delete buttonProps.role;\n // oxlint-disable-next-line react/react-compiler\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 =\n otherProps['aria-label'] ||\n (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 =\n 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 (\n !summaryIcon &&\n state.selectionManager.selectionMode === 'single' &&\n state.selectionManager.disallowEmptySelection &&\n state.selectionManager.firstSelectedKey != null\n ) {\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\n UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')}\n />\n <span\n className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {\n 'spectrum-ActionGroup-item--iconOnly': iconOnly\n })}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger\n align={isOnlyItem ? 'start' : 'end'}\n 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={classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(buttonStyles, {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\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 => (\n <Item textValue={node.textValue} {...filterDOMProps(node.props)}>\n {node.rendered}\n </Item>\n )}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().width +\n (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) +\n (ignoreRightMargin ? 0 : toNumber(style.marginRight))\n );\n}\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return (\n element.getBoundingClientRect().height +\n (ignoreTopMargin ? 0 : toNumber(style.marginTop)) +\n (ignoreBottomMargin ? 0 : toNumber(style.marginBottom))\n );\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.js.map"}
@@ -186,7 +186,8 @@ const $e4f8d481fcca6617$export$c21a5597f732a168 = /*#__PURE__*/ (0, $2VrXO$forwa
186
186
  get current () {
187
187
  return wrapperRef.current?.parentElement;
188
188
  }
189
- }), [
189
+ }), // oxlint-disable-next-line react/react-compiler
190
+ [
190
191
  wrapperRef
191
192
  ]);
192
193
  (0, $2VrXO$useResizeObserver)({
@@ -326,8 +327,11 @@ function $e4f8d481fcca6617$var$ActionGroupMenu({ state: state, isDisabled: isDis
326
327
  }, state);
327
328
  let stringFormatter = (0, $2VrXO$useLocalizedStringFormatter)((0, ($parcel$interopDefault($2VrXO$intlStringsmjs))), '@react-spectrum/actiongroup');
328
329
  // The menu button shouldn't act like an actual action group item.
330
+ // oxlint-disable-next-line react/react-compiler
329
331
  delete buttonProps.onPress;
332
+ // oxlint-disable-next-line react/react-compiler
330
333
  delete buttonProps.role;
334
+ // oxlint-disable-next-line react/react-compiler
331
335
  delete buttonProps['aria-checked'];
332
336
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $2VrXO$useHover)({
333
337
  isDisabled: isDisabled