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sC,CAAC,CAAC;YACxC,sCAAsC,gBAAgB;YACtD,sCAAsC,gBAAgB;YACtD,aAAa;YACb,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;OAErB,gCACC,gCAAC,CAAA,GAAA,oCAAa;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBAEvD,gCAAC,CAAA,GAAA,yCAAS,uBACR,gCAAC,CAAA,GAAA,yCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,iBAAiB;oBACpD,iCAAiC;gBACnC;YACF;YACA,MAAM;gBACJ,GAAG,SAAS;YACd;QACF;OACC,OAAO,aAAa,YAAY,2BAAa,gCAAC,CAAA,GAAA,yCAAG,SAAG,YAAmB;AAMpF","sources":["packages/@adobe/react-spectrum/src/button/ActionButton.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 {AriaBaseButtonProps, ButtonProps, useButton} from 'react-aria/useButton';\n\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider, useSlotProps} from '../utils/Slots';\nimport CornerTriangle from '@spectrum-icons/ui/CornerTriangle';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {Text} from '../text/Text';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumActionButtonProps\n  extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps {\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  /** The static color style to apply. Useful when the button appears over a color background. */\n  staticColor?: 'white' | 'black';\n}\n\n/**\n * ActionButtons allow users to perform an action. They’re used for similar, task-based options\n * within a workflow, and are ideal for interfaces where buttons aren’t meant to draw a lot of\n * attention.\n */\nexport const ActionButton = React.forwardRef(function ActionButton(\n  props: SpectrumActionButtonProps,\n  ref: FocusableRef<HTMLButtonElement>\n) {\n  props = useProviderProps(props);\n  props = useSlotProps(props, 'actionButton');\n  let textProps = useSlotProps(\n    {UNSAFE_className: classNames(styles, 'spectrum-ActionButton-label')},\n    'text'\n  );\n\n  let {\n    isQuiet,\n    isDisabled,\n    staticColor,\n    children,\n    autoFocus,\n    // @ts-ignore (private)\n    holdAffordance,\n    // @ts-ignore (private)\n    hideButtonText,\n    ...otherProps\n  } = props;\n\n  let domRef = useFocusableRef(ref);\n  let {buttonProps, isPressed} = useButton(props, domRef);\n  let {hoverProps, isHovered} = useHover({isDisabled});\n  let {styleProps} = useStyleProps(otherProps);\n  let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n  return (\n    <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n      <button\n        {...styleProps}\n        {...mergeProps(buttonProps, hoverProps)}\n        ref={domRef}\n        className={classNames(\n          styles,\n          'spectrum-ActionButton',\n          {\n            'spectrum-ActionButton--quiet': isQuiet,\n            'spectrum-ActionButton--staticColor': !!staticColor,\n            'spectrum-ActionButton--staticWhite': staticColor === 'white',\n            'spectrum-ActionButton--staticBlack': staticColor === 'black',\n            'is-active': isPressed,\n            'is-disabled': isDisabled,\n            'is-hovered': isHovered\n          },\n          styleProps.className\n        )}>\n        {holdAffordance && (\n          <CornerTriangle UNSAFE_className={classNames(styles, 'spectrum-ActionButton-hold')} />\n        )}\n        <ClearSlots>\n          <SlotProvider\n            slots={{\n              icon: {\n                size: 'S',\n                UNSAFE_className: classNames(styles, 'spectrum-Icon', {\n                  'spectrum-ActionGroup-itemIcon': hideButtonText\n                })\n              },\n              text: {\n                ...textProps\n              }\n            }}>\n            {typeof children === 'string' || isTextOnly ? <Text>{children}</Text> : children}\n          </SlotProvider>\n        </ClearSlots>\n      </button>\n    </FocusRing>\n  );\n});\n"],"names":[],"version":3,"file":"ActionButton.mjs.map"}