mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-06 21:53:57 -05:00
Updated several input components
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user