From 7265eaad182a8b7cdd1dfa9708afaf1dd92c1488 Mon Sep 17 00:00:00 2001 From: Matthew Ellison Date: Fri, 20 Mar 2026 22:12:59 -0400 Subject: [PATCH] Add password input --- lib/component/input/index.ts | 1 + lib/component/input/text/PasswordInput.tsx | 66 ++++++++++++++++++++++ lib/component/input/text/TextArea.tsx | 2 +- lib/component/input/text/TextInput.tsx | 2 +- lib/provider/axios/AxiosProvider.tsx | 6 +- lib/provider/token/TokenUtils.ts | 2 +- 6 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 lib/component/input/text/PasswordInput.tsx diff --git a/lib/component/input/index.ts b/lib/component/input/index.ts index 98a95f5..7e5d274 100644 --- a/lib/component/input/index.ts +++ b/lib/component/input/index.ts @@ -47,6 +47,7 @@ export { default as DragAndDropFileInput } from "./file/DragAndDropFileInput"; export { default as FileInput } from "./file/FileInput"; export { default as NumberInput } from "./number/NumberInput"; export { default as OptionInput } from "./text/OptionInput"; +export { default as PasswordInput } from "./text/PasswordInput"; export { default as PhoneInput } from "./text/PhoneInput"; export { default as SelectInput } from "./text/SelectInput"; export { default as TextArea } from "./text/TextArea"; diff --git a/lib/component/input/text/PasswordInput.tsx b/lib/component/input/text/PasswordInput.tsx new file mode 100644 index 0000000..0c41826 --- /dev/null +++ b/lib/component/input/text/PasswordInput.tsx @@ -0,0 +1,66 @@ +import type { TextInputProps } from "$/types/InputTypes"; +import clsx from "clsx"; +import { useId } from "react"; + + +export default function PasswordInput({ + id, + className, + inputClassName, + labelClassName, + name, + maxLength, + spellCheck, + placeholder, + value, + onChange, + onKeyDown, + disabled +}: Readonly){ + const componentId = useId(); + const activeId = id ?? componentId; + + + return ( +
+
+ onChange?.(e.target.value)} + disabled={disabled} + spellCheck={spellCheck} + onKeyDown={onKeyDown} + /> + +
+
+ ); +} diff --git a/lib/component/input/text/TextArea.tsx b/lib/component/input/text/TextArea.tsx index 7b6f05e..3528589 100644 --- a/lib/component/input/text/TextArea.tsx +++ b/lib/component/input/text/TextArea.tsx @@ -53,7 +53,7 @@ export default function TextArea({