From a61e7ce19a93e1654862707f5cf37b037c479938 Mon Sep 17 00:00:00 2001 From: Matthew Ellison Date: Mon, 16 Feb 2026 23:36:32 -0500 Subject: [PATCH] Update input components --- .../input/file/DragAndDropFileInput.tsx | 56 +++++++++++++------ lib/component/input/file/FileInput.tsx | 47 ++++++++++++---- lib/component/input/number/NumberInput.tsx | 48 ++++++++-------- lib/component/input/number/NumberSlider.tsx | 17 +++--- lib/component/input/text/OptionInput.tsx | 17 +++--- lib/component/input/text/SelectInput.tsx | 22 ++++---- lib/component/input/text/TextArea.tsx | 17 +++--- lib/component/input/text/TextInput.tsx | 15 +++-- lib/types/InputTypes.ts | 25 +++++---- src/util/InputUtils.tsx | 12 +++- 10 files changed, 171 insertions(+), 105 deletions(-) diff --git a/lib/component/input/file/DragAndDropFileInput.tsx b/lib/component/input/file/DragAndDropFileInput.tsx index 2ea4f5b..8aa3838 100644 --- a/lib/component/input/file/DragAndDropFileInput.tsx +++ b/lib/component/input/file/DragAndDropFileInput.tsx @@ -1,41 +1,47 @@ +import { DangerButton } from "$/component/button"; import type { FileInputProps } from "$/types/InputTypes"; import { humanReadableBytes } from "$/util/FileUtil"; import clsx from "clsx"; -import { useEffect, useRef, useState } from "react"; +import { useRef, useState } from "react"; +import { MdClose } from "react-icons/md"; export default function DragAndDropFileInput({ id, className, name, + ariaLabel, minSize, maxSize, - showFileName, - showSize, + showFileName = true, + showSize = true, onChange, disabled, children -}: FileInputProps){ +}: Readonly){ const [ file, setFile ] = useState(); const inputRef = useRef(null); - useEffect(() => { - onChange?.(file); - }, [ file, onChange ]); - return (