From 4faf279c3e396d480362d9f58b050cda1d9f1a40 Mon Sep 17 00:00:00 2001 From: killer-cf Date: Sat, 13 Dec 2025 20:05:27 -0300 Subject: [PATCH] feat: refine login page functionality by adding validation, improving error handling, and enhancing user feedback mechanisms --- apps/web/src/lib/components/ui/Button.svelte | 128 +++++++++ apps/web/src/lib/components/ui/Input.svelte | 174 +++++++++++ apps/web/src/lib/components/ui/Select.svelte | 287 +++++++++++++++++++ 3 files changed, 589 insertions(+) create mode 100644 apps/web/src/lib/components/ui/Button.svelte create mode 100644 apps/web/src/lib/components/ui/Input.svelte create mode 100644 apps/web/src/lib/components/ui/Select.svelte diff --git a/apps/web/src/lib/components/ui/Button.svelte b/apps/web/src/lib/components/ui/Button.svelte new file mode 100644 index 0000000..e7ab5d8 --- /dev/null +++ b/apps/web/src/lib/components/ui/Button.svelte @@ -0,0 +1,128 @@ + + + diff --git a/apps/web/src/lib/components/ui/Input.svelte b/apps/web/src/lib/components/ui/Input.svelte new file mode 100644 index 0000000..f170a9d --- /dev/null +++ b/apps/web/src/lib/components/ui/Input.svelte @@ -0,0 +1,174 @@ + + + +
+ + {label} + + {@render right?.()} +
+ +
+ {#if left} +
+
+ {@render left()} +
+
+ {/if} + + + + {#if right} +
+
+ {@render right()} +
+
+ {/if} +
+ + {#if helperText && !error} + + {helperText} + + {/if} + + {#if error} + + {error} + + {/if} +
diff --git a/apps/web/src/lib/components/ui/Select.svelte b/apps/web/src/lib/components/ui/Select.svelte new file mode 100644 index 0000000..d94f806 --- /dev/null +++ b/apps/web/src/lib/components/ui/Select.svelte @@ -0,0 +1,287 @@ + + + +
+ + {label} + + {@render labelRight?.()} +
+ + + + +
+ {#if triggerLeft} + + {@render triggerLeft()} + + {/if} + +
+ +
+ {#if canClear} + + + + {/if} + + + +
+
+
+ + + + +
+ {#if hasGroups} + {#each groups as [groupLabel, groupItems] (groupLabel)} + + + {groupLabel} + + {#each groupItems as item (item.value)} + + {item.label} + + + + + {/each} + + {/each} + {:else} + {#each items as item (item.value)} + + {item.label} + + + + + {/each} + {/if} +
+
+
+
+ + +
+ + {#if helperText && !error} + + {helperText} + + {/if} + + {#if error} + + {error} + + {/if} +