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ton.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 {AriaButtonProps, useButton} from 'react-aria/useButton';\n\nimport {classNames} from '../utils/classNames';\nimport CrossSmall from '@spectrum-icons/ui/CrossSmall';\nimport {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ElementType} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useStyleProps} from '../utils/styleProps';\n\ninterface ClearButtonProps<T extends ElementType = 'button'>\n  extends AriaButtonProps<T>, DOMProps, StyleProps {\n  focusClassName?: string;\n  variant?: 'overBackground';\n  excludeFromTabOrder?: boolean;\n  preventFocus?: boolean;\n  inset?: boolean;\n}\n\nexport const ClearButton = React.forwardRef(function ClearButton(\n  props: ClearButtonProps,\n  ref: FocusableRef<HTMLButtonElement>\n) {\n  let {\n    children = <CrossSmall UNSAFE_className={styles['spectrum-Icon']} />,\n    focusClassName,\n    variant,\n    autoFocus,\n    isDisabled,\n    preventFocus,\n    elementType = preventFocus ? 'div' : ('button' as ElementType),\n    inset = false,\n    ...otherProps\n  } = props;\n  let domRef = useFocusableRef(ref);\n  let {buttonProps, isPressed} = useButton({...props, elementType}, domRef);\n  let {hoverProps, isHovered} = useHover({isDisabled});\n  let {styleProps} = useStyleProps(otherProps);\n\n  // For cases like the clear button in a search field, remove the tabIndex so\n  // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when\n  // moving the cursor over the clear button.\n  if (preventFocus) {\n    delete buttonProps.tabIndex;\n  }\n\n  let ElementType = elementType;\n  return (\n    <FocusRing\n      focusRingClass={classNames(styles, 'focus-ring', focusClassName)}\n      autoFocus={autoFocus}>\n      <ElementType\n        {...styleProps}\n        {...mergeProps(buttonProps, hoverProps)}\n        ref={domRef}\n        className={classNames(\n          styles,\n          'spectrum-ClearButton',\n          {\n            [`spectrum-ClearButton--${variant}`]: variant,\n            'is-disabled': isDisabled,\n            'is-active': isPressed,\n            'is-hovered': isHovered,\n            'spectrum-ClearButton--inset': inset\n          },\n          styleProps.className\n        )}>\n        {children}\n      </ElementType>\n    </FocusRing>\n  );\n});\n"],"names":[],"version":3,"file":"ClearButton.cjs.map"}