Updated several input components

This commit is contained in:
2025-07-19 23:58:16 -04:00
parent ea7ac27772
commit f84f0a0ebc
6 changed files with 607 additions and 463 deletions

View File

@@ -2,20 +2,19 @@ import type { TextInputProps } from "$/types/Input";
import clsx from "clsx";
export default function TextInput(props: TextInputProps){
const {
id,
className,
inputClassName,
labelClassName,
placeholder,
defaultValue,
value,
onChange,
disabled
} = props;
export default function TextInput({
id = crypto.randomUUID().replaceAll("-", ""),
className,
inputClassName,
labelClassName,
maxLength,
spellCheck,
placeholder,
defaultValue,
value,
onChange,
disabled
}: TextInputProps){
return (
<div
className={clsx(
@@ -34,10 +33,12 @@ export default function TextInput(props: TextInputProps){
inputClassName
)}
placeholder={placeholder}
maxLength={maxLength}
defaultValue={defaultValue}
value={value}
onChange={onChange}
disabled={disabled}
spellCheck={spellCheck}
/>
<label
className={clsx(
@@ -46,7 +47,7 @@ export default function TextInput(props: TextInputProps){
"flex items-center",
labelClassName
)}
style={{ transitionProperty: "top,, left, font-size, line-height", transitionTimingFunction: "cubic-bezier(0.4 0, 0.2, 1)", transitionDuration: "250ms" }}
style={{ transitionProperty: "top, left, font-size, line-height", transitionTimingFunction: "cubic-bezier(0.4 0, 0.2, 1)", transitionDuration: "250ms" }}
htmlFor={id}
>
{placeholder}