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/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';\n\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';\n// @ts-ignore\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={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\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"}