diff --git a/components/atoms/TextInput/text-input.tsx b/components/atoms/TextInput/text-input.tsx index 672b1d4f58..512fbda015 100644 --- a/components/atoms/TextInput/text-input.tsx +++ b/components/atoms/TextInput/text-input.tsx @@ -1,24 +1,15 @@ import { CheckCircleFillIcon, XCircleFillIcon } from "@primer/octicons-react"; -import React, { useRef, useState } from "react"; +import React, { useRef } from "react"; import clsx from "clsx"; -interface TextInputProps { + +interface TextInputProps extends React.InputHTMLAttributes { label?: string; - placeholder?: string; - name?: string; state?: "default" | "valid" | "invalid"; - id?: string; - disabled?: boolean; - autoFocus?: boolean; borderless?: boolean; descriptionText?: string; classNames?: string; errorMsg?: string; - value?: string; - defaultValue?: string; - required?: boolean; fieldRef?: React.RefObject; - pattern?: string; - onChange?: (event: React.ChangeEvent) => void; } const TextInput = ({ @@ -27,18 +18,14 @@ const TextInput = ({ placeholder, state = "default", id, + value, descriptionText, classNames, + fieldRef, disabled = false, - autoFocus, borderless = false, - value, - defaultValue, - onChange, - required, - fieldRef, - pattern, - errorMsg = "" + errorMsg = "", + ...props }: TextInputProps) => { const inputRef = useRef(null); const handleResetInput = () => { @@ -46,35 +33,31 @@ const TextInput = ({ : inputRef.current!.value = ""; }; + return ( <>