✨(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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user