{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA4CM,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAC5C,KAAiC,EACjC,GAAoC;IAEpC,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cAAc,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACxD,IAAI,WAAW,CAAC,aAAa,KAAK,WAChC,WAAW,CAAC,aAAa,GAAG,gBAAgB,MAAM,CAAC;IAGrD,qBACE,0DAAC,CAAA,GAAA,qCAAU;QACT,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,cAAc,MAAM,YAAY;QAChC,OAAO,MAAM,KAAK;QAClB,WAAW,MAAM,SAAS;QAC1B,YAAY,MAAM,UAAU;qBAC5B,0DAAC,CAAA,GAAA,sCAAW;QAAE,KAAK;QAAM,GAAG,KAAK;QAAG,GAAG,WAAW;qBAChD,0DAAC,CAAA,GAAA,0DAAG,yBAEN,0DAAC,CAAA,GAAA,8BAAG;QACF,UAAU,MAAM,QAAQ;QACxB,OAAO,MAAM,KAAK;QAClB,cAAc,MAAM,YAAY;QAChC,UAAU,MAAM,QAAQ;;AAIhC","sources":["packages/@adobe/react-spectrum/src/menu/ActionMenu.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '../button/ActionButton';\nimport {\n  AriaLabelingProps,\n  CollectionBase,\n  DOMProps,\n  FocusableRef,\n  Key,\n  StyleProps\n} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\n// @ts-ignore\nimport intlMessages from '../../intl/menu/*.json';\nimport {Menu} from './Menu';\nimport {MenuTrigger, SpectrumMenuTriggerProps} from './MenuTrigger';\nimport More from '@spectrum-icons/workflow/More';\nimport React, {forwardRef, ReactElement} from 'react';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useSlotProps} from '../utils/Slots';\n\nexport interface SpectrumActionMenuProps<T>\n  extends\n    CollectionBase<T>,\n    Omit<SpectrumMenuTriggerProps, 'children'>,\n    StyleProps,\n    DOMProps,\n    AriaLabelingProps {\n  /** Whether the button is disabled. */\n  isDisabled?: boolean;\n  /**\n   * Whether the button should be displayed with a [quiet\n   * style](https://spectrum.adobe.com/page/action-button/#Quiet).\n   */\n  isQuiet?: boolean;\n  /** Whether the element should receive focus on render. */\n  autoFocus?: boolean;\n  /** Handler that is called when an item is selected. */\n  onAction?: (key: Key) => void;\n}\n\n/**\n * ActionMenu combines an ActionButton with a Menu for simple \"more actions\" use cases.\n */\nexport const ActionMenu = forwardRef(function ActionMenu<T extends object>(\n  props: SpectrumActionMenuProps<T>,\n  ref: FocusableRef<HTMLButtonElement>\n) {\n  props = useSlotProps(props, 'actionMenu');\n  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/menu');\n  let buttonProps = filterDOMProps(props, {labelable: true});\n  if (buttonProps['aria-label'] === undefined) {\n    buttonProps['aria-label'] = stringFormatter.format('moreActions');\n  }\n\n  return (\n    <MenuTrigger\n      isOpen={props.isOpen}\n      defaultOpen={props.defaultOpen}\n      onOpenChange={props.onOpenChange}\n      align={props.align}\n      direction={props.direction}\n      shouldFlip={props.shouldFlip}>\n      <ActionButton ref={ref} {...props} {...buttonProps}>\n        <More />\n      </ActionButton>\n      <Menu\n        children={props.children}\n        items={props.items}\n        disabledKeys={props.disabledKeys}\n        onAction={props.onAction}\n      />\n    </MenuTrigger>\n  );\n}) as <T>(\n  props: SpectrumActionMenuProps<T> & {ref?: FocusableRef<HTMLButtonElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"ActionMenu.cjs.map"}