(react) add Input component

Finally the first form component of the design system. It wraps and enhance
the native input element.
This commit is contained in:
Nathan Vasse
2023-04-14 16:38:58 +02:00
committed by NathanVss
parent 4f1168463f
commit feea284ec8
18 changed files with 1121 additions and 32 deletions

View File

@@ -3,3 +3,12 @@ export const noop = () => undefined;
export function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export function randomString(length: number = 8): string {
const chars =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let result = "";
for (let i = length; i > 0; --i)
result += chars[Math.floor(Math.random() * chars.length)];
return result;
}