simplifying
This commit is contained in:
@@ -4,7 +4,6 @@ export interface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string;
|
||||
error?: string;
|
||||
helperText?: string;
|
||||
containerClass?: string;
|
||||
ref?: HTMLInputElement | ((el: HTMLInputElement) => void);
|
||||
}
|
||||
|
||||
@@ -13,18 +12,16 @@ export default function Input(props: InputProps) {
|
||||
"label",
|
||||
"error",
|
||||
"helperText",
|
||||
"class",
|
||||
"containerClass",
|
||||
"ref"
|
||||
]);
|
||||
|
||||
return (
|
||||
<div class={local.containerClass || "input-group"}>
|
||||
<div class="input-group">
|
||||
<input
|
||||
{...others}
|
||||
ref={local.ref}
|
||||
placeholder=" "
|
||||
class={`underlinedInput bg-transparent ${local.class || ""}`}
|
||||
class={`underlinedInput w-full bg-transparent pr-10`}
|
||||
aria-invalid={!!local.error}
|
||||
aria-describedby={local.error ? `${others.id}-error` : undefined}
|
||||
/>
|
||||
|
||||
@@ -14,9 +14,7 @@ export default function PasswordInput(props: PasswordInputProps) {
|
||||
const [local, inputProps] = splitProps(props, [
|
||||
"showStrength",
|
||||
"defaultVisible",
|
||||
"passwordValue",
|
||||
"class",
|
||||
"containerClass"
|
||||
"passwordValue"
|
||||
]);
|
||||
|
||||
const [showPassword, setShowPassword] = createSignal(
|
||||
@@ -24,13 +22,12 @@ export default function PasswordInput(props: PasswordInputProps) {
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="flex flex-col items-center gap-2">
|
||||
<div class={local.containerClass || "input-group relative mx-4 mb-2"}>
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class={"input-group relative"}>
|
||||
<Input
|
||||
{...inputProps}
|
||||
type={showPassword() ? "text" : "password"}
|
||||
class={`w-full pr-10 ${local.class || ""}`}
|
||||
containerClass=""
|
||||
class={``}
|
||||
/>
|
||||
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user