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AAK,GAAG;QACnC,0BAAY,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA0B;AAGjF","sources":["packages/@adobe/react-spectrum/src/radio/Radio.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 {AriaRadioProps, useRadio} from 'react-aria/useRadioGroup';\n\nimport {classNames} from '../utils/classNames';\nimport {FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport React, {forwardRef, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/radio/vars.css';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useHover} from 'react-aria/useHover';\nimport {useRadioProvider} from './context';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumRadioProps extends Omit<AriaRadioProps, 'onClick'>, StyleProps {}\n\n/**\n * Radio buttons allow users to select a single option from a list of mutually exclusive options.\n * All possible options are exposed up front for users to compare.\n */\nexport const Radio = forwardRef(function Radio(\n  props: SpectrumRadioProps,\n  ref: FocusableRef<HTMLLabelElement>\n) {\n  let {isDisabled, children, autoFocus, ...otherProps} = props;\n  let {styleProps} = useStyleProps(otherProps);\n  let {hoverProps, isHovered} = useHover({isDisabled});\n\n  let inputRef = useRef<HTMLInputElement>(null);\n  let domRef = useFocusableRef(ref, inputRef);\n\n  let radioGroupProps = useRadioProvider();\n  let {isEmphasized, state} = radioGroupProps;\n\n  let {labelProps, inputProps} = useRadio(\n    {\n      ...props,\n      ...radioGroupProps,\n      isDisabled\n    },\n    state,\n    inputRef\n  );\n\n  return (\n    <label\n      {...labelProps}\n      {...styleProps}\n      {...hoverProps}\n      ref={domRef}\n      className={classNames(\n        styles,\n        'spectrum-Radio',\n        {\n          // Removing. Pending design feedback.\n          // 'spectrum-Radio--labelBelow': labelPosition === 'bottom',\n          'spectrum-Radio--quiet': !isEmphasized,\n          'is-disabled': isDisabled,\n          'is-invalid': state.isInvalid,\n          'is-hovered': isHovered\n        },\n        styleProps.className\n      )}>\n      <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n        <input\n          {...inputProps}\n          ref={inputRef}\n          className={classNames(styles, 'spectrum-Radio-input')}\n        />\n      </FocusRing>\n      <span className={classNames(styles, 'spectrum-Radio-button')} />\n      {children && <span className={classNames(styles, 'spectrum-Radio-label')}>{children}</span>}\n    </label>\n  );\n});\n"],"names":[],"version":3,"file":"Radio.cjs.map"}