refactor(dashboard-v2): reimplement TextInputBasic component
This commit is contained in:
parent
7014e983a5
commit
132ee4f88f
|
@ -1,18 +1,20 @@
|
||||||
|
import { nanoid } from "nanoid";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
|
||||||
|
export const TextInputBasic = ({ label, placeholder, ...props }) => {
|
||||||
|
const id = useMemo(() => `input-${nanoid()}`, []);
|
||||||
|
|
||||||
/**
|
|
||||||
* Primary UI component for user interaction
|
|
||||||
*/
|
|
||||||
export const TextInputBasic = ({ label, placeholder }) => {
|
|
||||||
return (
|
return (
|
||||||
<div className={""}>
|
<div className="flex flex-col w-full gap-1">
|
||||||
<p className={"font-sans uppercase text-palette-300 text-inputLabel mb-textInputLabelBottom"}>{label}</p>
|
<label className="font-sans uppercase text-palette-300 text-xs" htmlFor={id}>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
|
id={id}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
className={
|
className="w-full py-2 px-4 bg-palette-100 rounded-sm placeholder:text-palette-200 focus:outline outline-1 outline-palette-200"
|
||||||
"w-full bg-palette-100 h-textInput px-textInputBasicX focus:outline-none bg-transparent " +
|
{...props}
|
||||||
"placeholder-palette-400 text-content tracking-inputPlaceholder text-textInput"
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Reference in New Issue