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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 {\n ClassNameOrFunction,\n ContextValue,\n dom,\n StyleRenderProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, InputHTMLAttributes} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\n\nexport interface InputRenderProps {\n  /**\n   * Whether the input is currently hovered with a mouse.\n   * @selector [data-hovered]\n   */\n  isHovered: boolean,\n  /**\n   * Whether the input is focused, either via a mouse or keyboard.\n   * @selector [data-focused]\n   */\n  isFocused: boolean,\n  /**\n   * Whether the input is keyboard focused.\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean,\n  /**\n   * Whether the input is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * Whether the input is invalid.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean\n}\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps, 'input'> {\n /**\n  * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n  * @default 'react-aria-Input'\n  */\n className?: ClassNameOrFunction<InputRenderProps>,\n /**\n  * Temporary text that occupies the text input when it is empty.\n  * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/placeholder).\n  */\n placeholder?: string\n}\n\nexport const InputContext = createContext<ContextValue<InputProps, HTMLInputElement>>({});\n\nlet filterHoverProps = (props: InputProps) => {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n  return otherProps;\n};\n\n/**\n * An input allows a user to input text.\n */\nexport const Input = /*#__PURE__*/ createHideableComponent(function Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n  [props, ref] = useContextProps(props, ref, InputContext);\n\n  let {hoverProps, isHovered} = useHover({\n    ...props,\n    isDisabled: props.disabled\n  });\n  let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n    isTextInput: true,\n    autoFocus: props.autoFocus\n  });\n\n  let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      isHovered,\n      isFocused,\n      isFocusVisible,\n      isDisabled: props.disabled || false,\n      isInvalid\n    },\n    defaultClassName: 'react-aria-Input'\n  });\n\n  return (\n    <dom.input\n      {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n      {...renderProps}\n      ref={ref}\n      data-focused={isFocused || undefined}\n      data-disabled={props.disabled || undefined}\n      data-hovered={isHovered || undefined}\n      data-focus-visible={isFocusVisible || undefined}\n      data-invalid={isInvalid || undefined} />\n  );\n});\n"],"names":[],"version":3,"file":"Input.cjs.map"}