From f84f0a0ebc6890baefda33f2fa4b2b5daf0344e3 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Sat, 19 Jul 2025 23:58:16 -0400 Subject: [PATCH] Updated several input components --- lib/component/input/SelectInput.tsx | 32 +- lib/component/input/TextArea.tsx | 61 ++++ lib/component/input/TextInput.tsx | 31 +- lib/types/Input.d.ts | 10 +- src/routes/input/index.tsx | 432 +----------------------- src/util/InputUtils.tsx | 504 ++++++++++++++++++++++++++++ 6 files changed, 607 insertions(+), 463 deletions(-) create mode 100644 lib/component/input/TextArea.tsx create mode 100644 src/util/InputUtils.tsx diff --git a/lib/component/input/SelectInput.tsx b/lib/component/input/SelectInput.tsx index f0ea3ec..19ad8e4 100644 --- a/lib/component/input/SelectInput.tsx +++ b/lib/component/input/SelectInput.tsx @@ -18,24 +18,22 @@ export default function SelectInput(props: SelectInputProps){ value={value} onChange={onChange} > -
- - {label} - - - - {children} - -
+ {label} + + + + {children} + ); } diff --git a/lib/component/input/TextArea.tsx b/lib/component/input/TextArea.tsx new file mode 100644 index 0000000..d5d0633 --- /dev/null +++ b/lib/component/input/TextArea.tsx @@ -0,0 +1,61 @@ +import type { TextAreaProps } from "$/types/Input"; +import clsx from "clsx"; + + +export default function TextArea({ + id = crypto.randomUUID().replaceAll("-", ""), + className, + inputClassName, + labelClassName, + maxLength, + rows, + cols, + spellCheck, + placeholder, + defaultValue, + value, + onChange, + disabled +}: TextAreaProps){ + return ( +
+
+