"use client" import { Text, TextField } from "react-aria-components" import { Controller, useFormContext } from "react-hook-form" import { CheckIcon, InfoCircleIcon } from "@/components/Icons" import AriaInputWithLabel from "@/components/TempDesignSystem/Form/Input/AriaInputWithLabel" import Caption from "@/components/TempDesignSystem/Text/Caption" import styles from "./input.module.css" import type { HTMLAttributes, WheelEvent } from "react" import type { InputProps } from "./input" export default function Input({ "aria-label": ariaLabel, className = "", disabled = false, helpText = "", label, maxLength, name, placeholder = "", readOnly = false, registerOptions = {}, type = "text", }: InputProps) { const { control } = useFormContext() let numberAttributes: HTMLAttributes = {} if (type === "number") { numberAttributes.onWheel = function (evt: WheelEvent) { evt.currentTarget.blur() } } return ( ( {helpText && !fieldState.error ? ( {helpText} ) : null} {fieldState.error ? ( {fieldState.error.message} ) : null} )} /> ) }