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AChC,sCAAsC,CAAC,CAAC;YACxC,sCAAsC,gBAAgB;YACtD,sCAAsC,gBAAgB;YACtD,aAAa;YACb,eAAe;YACf,cAAc;QAChB,GACA,WAAW,SAAS;OAGvB,gCACC,0DAAC,CAAA,GAAA,8DAAa;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBAEvD,0DAAC,CAAA,GAAA,oCAAS,uBACR,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EACzB,CAAA,GAAA,mDAAK,GACL,iBACA;oBACE,iCAAiC;gBACnC;YAEJ;YACA,MAAM;gBACJ,GAAG,SAAS;YACd;QACF;OACC,OAAO,aAAa,YAAY,2BAC7B,0DAAC,CAAA,GAAA,8BAAG,SAAG,YACP;AAMhB","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 extends AriaBaseButtonProps, Omit<ButtonProps, 'onClick'>, StyleProps {\n  /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\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.\n * They’re used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren’t meant to draw a lot of attention.\n */\nexport const ActionButton = React.forwardRef(function ActionButton(props: SpectrumActionButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n  props = useProviderProps(props);\n  props = useSlotProps(props, 'actionButton');\n  let textProps = useSlotProps({UNSAFE_className: classNames(styles, 'spectrum-ActionButton-label')}, 'text');\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={\n          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        }>\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(\n                  styles,\n                  'spectrum-Icon',\n                  {\n                    'spectrum-ActionGroup-itemIcon': hideButtonText\n                  }\n                )\n              },\n              text: {\n                ...textProps\n              }\n            }}>\n            {typeof children === 'string' || isTextOnly\n              ? <Text>{children}</Text>\n              : children}\n          </SlotProvider>\n        </ClearSlots>\n      </button>\n    </FocusRing>\n  );\n});\n"],"names":[],"version":3,"file":"ActionButton.cjs.map"}