@react-spectrum/actiongroup 3.10.17 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/ActionGroup.main.js +8 -3
  2. package/dist/ActionGroup.main.js.map +1 -1
  3. package/dist/ActionGroup.mjs +8 -3
  4. package/dist/ActionGroup.module.js +8 -3
  5. package/dist/ActionGroup.module.js.map +1 -1
  6. package/dist/{actiongroup.86a63cf1.css → actiongroup.bb161279.css} +13 -10
  7. package/dist/actiongroup.bb161279.css.map +1 -0
  8. package/dist/actiongroup.c0b1ee3f.css +254 -0
  9. package/dist/{actiongroup.817566a5.css.map → actiongroup.c0b1ee3f.css.map} +1 -1
  10. package/dist/actiongroup_vars_css.main.js +16 -16
  11. package/dist/actiongroup_vars_css.main.js.map +1 -1
  12. package/dist/actiongroup_vars_css.mjs +16 -16
  13. package/dist/actiongroup_vars_css.module.js +16 -16
  14. package/dist/actiongroup_vars_css.module.js.map +1 -1
  15. package/dist/ar-AE.main.js +6 -0
  16. package/dist/ar-AE.main.js.map +1 -0
  17. package/dist/ar-AE.mjs +8 -0
  18. package/dist/ar-AE.module.js +8 -0
  19. package/dist/ar-AE.module.js.map +1 -0
  20. package/dist/bg-BG.main.js +6 -0
  21. package/dist/bg-BG.main.js.map +1 -0
  22. package/dist/bg-BG.mjs +8 -0
  23. package/dist/bg-BG.module.js +8 -0
  24. package/dist/bg-BG.module.js.map +1 -0
  25. package/dist/cs-CZ.main.js +6 -0
  26. package/dist/cs-CZ.main.js.map +1 -0
  27. package/dist/cs-CZ.mjs +8 -0
  28. package/dist/cs-CZ.module.js +8 -0
  29. package/dist/cs-CZ.module.js.map +1 -0
  30. package/dist/da-DK.main.js +6 -0
  31. package/dist/da-DK.main.js.map +1 -0
  32. package/dist/da-DK.mjs +8 -0
  33. package/dist/da-DK.module.js +8 -0
  34. package/dist/da-DK.module.js.map +1 -0
  35. package/dist/de-DE.main.js +6 -0
  36. package/dist/de-DE.main.js.map +1 -0
  37. package/dist/de-DE.mjs +8 -0
  38. package/dist/de-DE.module.js +8 -0
  39. package/dist/de-DE.module.js.map +1 -0
  40. package/dist/el-GR.main.js +6 -0
  41. package/dist/el-GR.main.js.map +1 -0
  42. package/dist/el-GR.mjs +8 -0
  43. package/dist/el-GR.module.js +8 -0
  44. package/dist/el-GR.module.js.map +1 -0
  45. package/dist/en-US.main.js +6 -0
  46. package/dist/en-US.main.js.map +1 -0
  47. package/dist/en-US.mjs +8 -0
  48. package/dist/en-US.module.js +8 -0
  49. package/dist/en-US.module.js.map +1 -0
  50. package/dist/es-ES.main.js +6 -0
  51. package/dist/es-ES.main.js.map +1 -0
  52. package/dist/es-ES.mjs +8 -0
  53. package/dist/es-ES.module.js +8 -0
  54. package/dist/es-ES.module.js.map +1 -0
  55. package/dist/et-EE.main.js +6 -0
  56. package/dist/et-EE.main.js.map +1 -0
  57. package/dist/et-EE.mjs +8 -0
  58. package/dist/et-EE.module.js +8 -0
  59. package/dist/et-EE.module.js.map +1 -0
  60. package/dist/fi-FI.main.js +6 -0
  61. package/dist/fi-FI.main.js.map +1 -0
  62. package/dist/fi-FI.mjs +8 -0
  63. package/dist/fi-FI.module.js +8 -0
  64. package/dist/fi-FI.module.js.map +1 -0
  65. package/dist/fr-FR.main.js +6 -0
  66. package/dist/fr-FR.main.js.map +1 -0
  67. package/dist/fr-FR.mjs +8 -0
  68. package/dist/fr-FR.module.js +8 -0
  69. package/dist/fr-FR.module.js.map +1 -0
  70. package/dist/he-IL.main.js +6 -0
  71. package/dist/he-IL.main.js.map +1 -0
  72. package/dist/he-IL.mjs +8 -0
  73. package/dist/he-IL.module.js +8 -0
  74. package/dist/he-IL.module.js.map +1 -0
  75. package/dist/hr-HR.main.js +6 -0
  76. package/dist/hr-HR.main.js.map +1 -0
  77. package/dist/hr-HR.mjs +8 -0
  78. package/dist/hr-HR.module.js +8 -0
  79. package/dist/hr-HR.module.js.map +1 -0
  80. package/dist/hu-HU.main.js +6 -0
  81. package/dist/hu-HU.main.js.map +1 -0
  82. package/dist/hu-HU.mjs +8 -0
  83. package/dist/hu-HU.module.js +8 -0
  84. package/dist/hu-HU.module.js.map +1 -0
  85. package/dist/intlStrings.main.js +108 -0
  86. package/dist/intlStrings.main.js.map +1 -0
  87. package/dist/intlStrings.mjs +110 -0
  88. package/dist/intlStrings.module.js +110 -0
  89. package/dist/intlStrings.module.js.map +1 -0
  90. package/dist/it-IT.main.js +6 -0
  91. package/dist/it-IT.main.js.map +1 -0
  92. package/dist/it-IT.mjs +8 -0
  93. package/dist/it-IT.module.js +8 -0
  94. package/dist/it-IT.module.js.map +1 -0
  95. package/dist/ja-JP.main.js +6 -0
  96. package/dist/ja-JP.main.js.map +1 -0
  97. package/dist/ja-JP.mjs +8 -0
  98. package/dist/ja-JP.module.js +8 -0
  99. package/dist/ja-JP.module.js.map +1 -0
  100. package/dist/ko-KR.main.js +6 -0
  101. package/dist/ko-KR.main.js.map +1 -0
  102. package/dist/ko-KR.mjs +8 -0
  103. package/dist/ko-KR.module.js +8 -0
  104. package/dist/ko-KR.module.js.map +1 -0
  105. package/dist/lt-LT.main.js +6 -0
  106. package/dist/lt-LT.main.js.map +1 -0
  107. package/dist/lt-LT.mjs +8 -0
  108. package/dist/lt-LT.module.js +8 -0
  109. package/dist/lt-LT.module.js.map +1 -0
  110. package/dist/lv-LV.main.js +6 -0
  111. package/dist/lv-LV.main.js.map +1 -0
  112. package/dist/lv-LV.mjs +8 -0
  113. package/dist/lv-LV.module.js +8 -0
  114. package/dist/lv-LV.module.js.map +1 -0
  115. package/dist/nb-NO.main.js +6 -0
  116. package/dist/nb-NO.main.js.map +1 -0
  117. package/dist/nb-NO.mjs +8 -0
  118. package/dist/nb-NO.module.js +8 -0
  119. package/dist/nb-NO.module.js.map +1 -0
  120. package/dist/nl-NL.main.js +6 -0
  121. package/dist/nl-NL.main.js.map +1 -0
  122. package/dist/nl-NL.mjs +8 -0
  123. package/dist/nl-NL.module.js +8 -0
  124. package/dist/nl-NL.module.js.map +1 -0
  125. package/dist/pl-PL.main.js +6 -0
  126. package/dist/pl-PL.main.js.map +1 -0
  127. package/dist/pl-PL.mjs +8 -0
  128. package/dist/pl-PL.module.js +8 -0
  129. package/dist/pl-PL.module.js.map +1 -0
  130. package/dist/pt-BR.main.js +6 -0
  131. package/dist/pt-BR.main.js.map +1 -0
  132. package/dist/pt-BR.mjs +8 -0
  133. package/dist/pt-BR.module.js +8 -0
  134. package/dist/pt-BR.module.js.map +1 -0
  135. package/dist/pt-PT.main.js +6 -0
  136. package/dist/pt-PT.main.js.map +1 -0
  137. package/dist/pt-PT.mjs +8 -0
  138. package/dist/pt-PT.module.js +8 -0
  139. package/dist/pt-PT.module.js.map +1 -0
  140. package/dist/ro-RO.main.js +6 -0
  141. package/dist/ro-RO.main.js.map +1 -0
  142. package/dist/ro-RO.mjs +8 -0
  143. package/dist/ro-RO.module.js +8 -0
  144. package/dist/ro-RO.module.js.map +1 -0
  145. package/dist/ru-RU.main.js +6 -0
  146. package/dist/ru-RU.main.js.map +1 -0
  147. package/dist/ru-RU.mjs +8 -0
  148. package/dist/ru-RU.module.js +8 -0
  149. package/dist/ru-RU.module.js.map +1 -0
  150. package/dist/sk-SK.main.js +6 -0
  151. package/dist/sk-SK.main.js.map +1 -0
  152. package/dist/sk-SK.mjs +8 -0
  153. package/dist/sk-SK.module.js +8 -0
  154. package/dist/sk-SK.module.js.map +1 -0
  155. package/dist/sl-SI.main.js +6 -0
  156. package/dist/sl-SI.main.js.map +1 -0
  157. package/dist/sl-SI.mjs +8 -0
  158. package/dist/sl-SI.module.js +8 -0
  159. package/dist/sl-SI.module.js.map +1 -0
  160. package/dist/sr-SP.main.js +6 -0
  161. package/dist/sr-SP.main.js.map +1 -0
  162. package/dist/sr-SP.mjs +8 -0
  163. package/dist/sr-SP.module.js +8 -0
  164. package/dist/sr-SP.module.js.map +1 -0
  165. package/dist/sv-SE.main.js +6 -0
  166. package/dist/sv-SE.main.js.map +1 -0
  167. package/dist/sv-SE.mjs +8 -0
  168. package/dist/sv-SE.module.js +8 -0
  169. package/dist/sv-SE.module.js.map +1 -0
  170. package/dist/tr-TR.main.js +6 -0
  171. package/dist/tr-TR.main.js.map +1 -0
  172. package/dist/tr-TR.mjs +8 -0
  173. package/dist/tr-TR.module.js +8 -0
  174. package/dist/tr-TR.module.js.map +1 -0
  175. package/dist/types.d.ts.map +1 -1
  176. package/dist/uk-UA.main.js +6 -0
  177. package/dist/uk-UA.main.js.map +1 -0
  178. package/dist/uk-UA.mjs +8 -0
  179. package/dist/uk-UA.module.js +8 -0
  180. package/dist/uk-UA.module.js.map +1 -0
  181. package/dist/zh-CN.main.js +6 -0
  182. package/dist/zh-CN.main.js.map +1 -0
  183. package/dist/zh-CN.mjs +8 -0
  184. package/dist/zh-CN.module.js +8 -0
  185. package/dist/zh-CN.module.js.map +1 -0
  186. package/dist/zh-TW.main.js +6 -0
  187. package/dist/zh-TW.main.js.map +1 -0
  188. package/dist/zh-TW.mjs +8 -0
  189. package/dist/zh-TW.module.js +8 -0
  190. package/dist/zh-TW.module.js.map +1 -0
  191. package/package.json +18 -17
  192. package/src/ActionGroup.tsx +5 -1
  193. package/dist/actiongroup.817566a5.css +0 -254
  194. package/dist/actiongroup.86a63cf1.css.map +0 -1
@@ -1,6 +1,7 @@
1
- require("./actiongroup.86a63cf1.css");
1
+ require("./actiongroup.bb161279.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
- require("./actiongroup.817566a5.css");
3
+ var $78d2e63e5b4fce1c$exports = require("./intlStrings.main.js");
4
+ require("./actiongroup.c0b1ee3f.css");
4
5
  var $d9f76447f7a8d3f9$exports = require("./actiongroup_vars_css.main.js");
5
6
  var $2RJq8$reactspectrumbutton = require("@react-spectrum/button");
6
7
  var $2RJq8$spectrumiconsuiChevronDownMedium = require("@spectrum-icons/ui/ChevronDownMedium");
@@ -16,6 +17,7 @@ var $2RJq8$react = require("react");
16
17
  var $2RJq8$reactspectrumtext = require("@react-spectrum/text");
17
18
  var $2RJq8$reactspectrumtooltip = require("@react-spectrum/tooltip");
18
19
  var $2RJq8$reactariaactiongroup = require("@react-aria/actiongroup");
20
+ var $2RJq8$reactariai18n = require("@react-aria/i18n");
19
21
 
20
22
 
21
23
  function $parcel$interopDefault(a) {
@@ -53,6 +55,8 @@ $parcel$export(module.exports, "ActionGroup", () => $9f46a6387592b67c$export$c21
53
55
 
54
56
 
55
57
 
58
+
59
+
56
60
  const $9f46a6387592b67c$export$c21a5597f732a168 = /*#__PURE__*/ (0, $2RJq8$react.forwardRef)(function ActionGroup(props, ref) {
57
61
  props = (0, $2RJq8$reactspectrumprovider.useProviderProps)(props);
58
62
  props = (0, $2RJq8$reactspectrumutils.useSlotProps)(props, 'actionGroup');
@@ -302,6 +306,7 @@ function $9f46a6387592b67c$var$ActionGroupMenu({ state: state, isDisabled: isDis
302
306
  let { buttonProps: buttonProps } = (0, $2RJq8$reactariaactiongroup.useActionGroupItem)({
303
307
  key: key
304
308
  }, state);
309
+ let stringFormatter = (0, $2RJq8$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($78d2e63e5b4fce1c$exports))), '@react-spectrum/actiongroup');
305
310
  // The menu button shouldn't act like an actual action group item.
306
311
  delete buttonProps.onPress;
307
312
  delete buttonProps.role;
@@ -310,7 +315,7 @@ function $9f46a6387592b67c$var$ActionGroupMenu({ state: state, isDisabled: isDis
310
315
  isDisabled: isDisabled
311
316
  });
312
317
  // If no aria-label or aria-labelledby is given, provide a default one.
313
- let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : "\u2026");
318
+ let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));
314
319
  let ariaLabelledby = otherProps['aria-labelledby'];
315
320
  let textId = (0, $2RJq8$reactariautils.useId)();
316
321
  let id = (0, $2RJq8$reactariautils.useId)();
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;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/ActionGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nexport const ActionGroup = forwardRef(function ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAmCM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAA8B,KAAkC,EAAE,GAA2B;IAC1I,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,gBACF,YAAY,WACZ,OAAO,eACP,WAAW,cACX,UAAU,eACV,cAAc,uBACd,OAAO,eACP,WAAW,gBACX,eAAe,kBACf,QAAQ,uBACR,mBAAmB,eACnB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,QAAQ,CAAA,GAAA,oCAAW,EAAE;QAAC,GAAG,KAAK;QAAE,0BAA0B;IAAI;IAClE,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,0CAAa,EAAE,OAAO,OAAO;IACtD,IAAI,aAAa,gBAAgB;IACjC,IAAI,gBAAgB;sBAAC;oBAAc;iBAAY;IAAO;IACtD,IAAI,cAAC,UAAU,E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,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,KAAK,GAAI,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAAM,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nexport const ActionGroup = forwardRef(function ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actiongroup');\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.main.js.map"}
@@ -1,6 +1,7 @@
1
- import "./actiongroup.86a63cf1.css";
1
+ import "./actiongroup.bb161279.css";
2
2
  import $lajJX$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
- import "./actiongroup.817566a5.css";
3
+ import $lajJX$intlStringsmodulejs from "./intlStrings.mjs";
4
+ import "./actiongroup.c0b1ee3f.css";
4
5
  import $lajJX$actiongroup_vars_cssmodulejs from "./actiongroup_vars_css.mjs";
5
6
  import {ActionButton as $lajJX$ActionButton} from "@react-spectrum/button";
6
7
  import $lajJX$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
@@ -16,6 +17,7 @@ import $lajJX$react, {forwardRef as $lajJX$forwardRef, useRef as $lajJX$useRef,
16
17
  import {Text as $lajJX$Text} from "@react-spectrum/text";
17
18
  import {TooltipTrigger as $lajJX$TooltipTrigger, Tooltip as $lajJX$Tooltip} from "@react-spectrum/tooltip";
18
19
  import {useActionGroup as $lajJX$useActionGroup, useActionGroupItem as $lajJX$useActionGroupItem} from "@react-aria/actiongroup";
20
+ import {useLocalizedStringFormatter as $lajJX$useLocalizedStringFormatter} from "@react-aria/i18n";
19
21
 
20
22
 
21
23
  function $parcel$interopDefault(a) {
@@ -47,6 +49,8 @@ function $parcel$interopDefault(a) {
47
49
 
48
50
 
49
51
 
52
+
53
+
50
54
  const $a04ee251ffcc2690$export$c21a5597f732a168 = /*#__PURE__*/ (0, $lajJX$forwardRef)(function ActionGroup(props, ref) {
51
55
  props = (0, $lajJX$useProviderProps)(props);
52
56
  props = (0, $lajJX$useSlotProps)(props, 'actionGroup');
@@ -296,6 +300,7 @@ function $a04ee251ffcc2690$var$ActionGroupMenu({ state: state, isDisabled: isDis
296
300
  let { buttonProps: buttonProps } = (0, $lajJX$useActionGroupItem)({
297
301
  key: key
298
302
  }, state);
303
+ let stringFormatter = (0, $lajJX$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lajJX$intlStringsmodulejs))), '@react-spectrum/actiongroup');
299
304
  // The menu button shouldn't act like an actual action group item.
300
305
  delete buttonProps.onPress;
301
306
  delete buttonProps.role;
@@ -304,7 +309,7 @@ function $a04ee251ffcc2690$var$ActionGroupMenu({ state: state, isDisabled: isDis
304
309
  isDisabled: isDisabled
305
310
  });
306
311
  // If no aria-label or aria-labelledby is given, provide a default one.
307
- let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : "\u2026");
312
+ let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));
308
313
  let ariaLabelledby = otherProps['aria-labelledby'];
309
314
  let textId = (0, $lajJX$useId)();
310
315
  let id = (0, $lajJX$useId)();
@@ -1,6 +1,7 @@
1
- import "./actiongroup.86a63cf1.css";
1
+ import "./actiongroup.bb161279.css";
2
2
  import $lajJX$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
- import "./actiongroup.817566a5.css";
3
+ import $lajJX$intlStringsmodulejs from "./intlStrings.module.js";
4
+ import "./actiongroup.c0b1ee3f.css";
4
5
  import $lajJX$actiongroup_vars_cssmodulejs from "./actiongroup_vars_css.module.js";
5
6
  import {ActionButton as $lajJX$ActionButton} from "@react-spectrum/button";
6
7
  import $lajJX$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
@@ -16,6 +17,7 @@ import $lajJX$react, {forwardRef as $lajJX$forwardRef, useRef as $lajJX$useRef,
16
17
  import {Text as $lajJX$Text} from "@react-spectrum/text";
17
18
  import {TooltipTrigger as $lajJX$TooltipTrigger, Tooltip as $lajJX$Tooltip} from "@react-spectrum/tooltip";
18
19
  import {useActionGroup as $lajJX$useActionGroup, useActionGroupItem as $lajJX$useActionGroupItem} from "@react-aria/actiongroup";
20
+ import {useLocalizedStringFormatter as $lajJX$useLocalizedStringFormatter} from "@react-aria/i18n";
19
21
 
20
22
 
21
23
  function $parcel$interopDefault(a) {
@@ -47,6 +49,8 @@ function $parcel$interopDefault(a) {
47
49
 
48
50
 
49
51
 
52
+
53
+
50
54
  const $a04ee251ffcc2690$export$c21a5597f732a168 = /*#__PURE__*/ (0, $lajJX$forwardRef)(function ActionGroup(props, ref) {
51
55
  props = (0, $lajJX$useProviderProps)(props);
52
56
  props = (0, $lajJX$useSlotProps)(props, 'actionGroup');
@@ -296,6 +300,7 @@ function $a04ee251ffcc2690$var$ActionGroupMenu({ state: state, isDisabled: isDis
296
300
  let { buttonProps: buttonProps } = (0, $lajJX$useActionGroupItem)({
297
301
  key: key
298
302
  }, state);
303
+ let stringFormatter = (0, $lajJX$useLocalizedStringFormatter)((0, ($parcel$interopDefault($lajJX$intlStringsmodulejs))), '@react-spectrum/actiongroup');
299
304
  // The menu button shouldn't act like an actual action group item.
300
305
  delete buttonProps.onPress;
301
306
  delete buttonProps.role;
@@ -304,7 +309,7 @@ function $a04ee251ffcc2690$var$ActionGroupMenu({ state: state, isDisabled: isDis
304
309
  isDisabled: isDisabled
305
310
  });
306
311
  // If no aria-label or aria-labelledby is given, provide a default one.
307
- let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : "\u2026");
312
+ let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));
308
313
  let ariaLabelledby = otherProps['aria-labelledby'];
309
314
  let textId = (0, $lajJX$useId)();
310
315
  let id = (0, $lajJX$useId)();
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAgCM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAA8B,KAAkC,EAAE,GAA2B;IAC1I,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,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,gB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eAAe,CAAC;QACpE,UAAU;OACT,CAAA,qBAAQ,gCAAC,CAAA,GAAA,WAAG;YAAE,WAAW,KAAK,SAAS;YAAG,GAAG,CAAA,GAAA,qBAAa,EAAE,KAAK,KAAK,CAAC;WAAG,KAAK,QAAQ;AAIhG;AAEA,SAAS,iCAAW,OAAoB,EAAE,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,KAAK,GAAI,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAAM,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nexport const ActionGroup = forwardRef(function ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"Action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AS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nexport const ActionGroup = forwardRef(function ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actiongroup');\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : stringFormatter.format('more'));\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.module.js.map"}
@@ -90,18 +90,9 @@
90
90
  text-transform: none;
91
91
  -webkit-font-smoothing: antialiased;
92
92
  -moz-osx-font-smoothing: grayscale;
93
- vertical-align: top;
94
- transition: background var(--spectrum-global-animation-duration-100, .13s) ease-out, border-color var(--spectrum-global-animation-duration-100, .13s) ease-out, color var(--spectrum-global-animation-duration-100, .13s) ease-out, box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out;
95
- -webkit-user-select: none;
96
- user-select: none;
97
- touch-action: none;
98
- cursor: default;
99
- isolation: isolate;
100
93
  justify-content: center;
101
94
  align-items: center;
102
95
  margin: 0;
103
- line-height: 1.3;
104
- text-decoration: none;
105
96
  display: inline-flex;
106
97
  position: relative;
107
98
  overflow: visible;
@@ -111,6 +102,18 @@ button.o7Xu8a_spectrum-BaseButton {
111
102
  -webkit-appearance: button;
112
103
  }
113
104
 
105
+ .o7Xu8a_spectrum-BaseButton {
106
+ vertical-align: top;
107
+ transition: background var(--spectrum-global-animation-duration-100, .13s) ease-out, border-color var(--spectrum-global-animation-duration-100, .13s) ease-out, color var(--spectrum-global-animation-duration-100, .13s) ease-out, box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out;
108
+ -webkit-user-select: none;
109
+ user-select: none;
110
+ touch-action: none;
111
+ cursor: default;
112
+ isolation: isolate;
113
+ line-height: 1.3;
114
+ text-decoration: none;
115
+ }
116
+
114
117
  .o7Xu8a_spectrum-BaseButton:focus {
115
118
  outline: none;
116
119
  }
@@ -1663,4 +1666,4 @@ a.o7Xu8a_spectrum-Button, a.o7Xu8a_spectrum-ActionButton {
1663
1666
  --spectrum-actionbutton-static-color-selected-disabled: ButtonFace;
1664
1667
  }
1665
1668
  }
1666
- /*# sourceMappingURL=actiongroup.86a63cf1.css.map */
1669
+ /*# sourceMappingURL=actiongroup.bb161279.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;;;;;;;;;AA8BE;;;;AAMe;;;;;;;;;;;;AAqBf;;;;AAGA;;;;AAKA;;;;;;AAYA;;;;AAKA;;;;;;;;AAWF;;;;;;;;;;;;;;AAoBE;;;;AAMA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;;;;;AAWE;;;;AAOJ;;;;;;;AASA;;;;;;;;;;;AAiBE;;;;AAKA;;;;AAKA;;;;AAIA;;;;AAKA;;;;AAMA;;;;AAKA;;;;AAKF;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMA;;;;AAIA;;;;;;;AAYE;;;;AAKF;;;;;;AAMA;;;;;;;AAQA;;;;;;;;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;;AAIE;;;;AAJF;;;;AAIE;;;;AAKF;;;;;AAKE;;;;AALF;;;;;AAKE;;;;AAMF;;;;;AAOF;EACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDA;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/button/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"actiongroup.bb161279.css.map"}