From d61e3f8422a8c1d5e4635a39a7e8f7f05942d9b7 Mon Sep 17 00:00:00 2001 From: Aditya Hegde Date: Mon, 3 Feb 2025 18:56:34 +0530 Subject: [PATCH] feat: file upload input (#6487) * Basic FileInput * Add error state * Add drag-drop support * Add drop-over state and loading state * Fix lint * Add preview --- .../src/components/forms/FileInput.svelte | 172 ++++++++++++++++++ .../src/components/icons/Attachment.svelte | 19 ++ 2 files changed, 191 insertions(+) create mode 100644 web-common/src/components/forms/FileInput.svelte create mode 100644 web-common/src/components/icons/Attachment.svelte diff --git a/web-common/src/components/forms/FileInput.svelte b/web-common/src/components/forms/FileInput.svelte new file mode 100644 index 00000000000..b97bab9751d --- /dev/null +++ b/web-common/src/components/forms/FileInput.svelte @@ -0,0 +1,172 @@ + + +
+ + {#if errorMessages.length > 0} +
+ {#each errorMessages as errorMessage, i (i)} +
{errorMessage}
+ {/each} +
+ {/if} + +
+ + diff --git a/web-common/src/components/icons/Attachment.svelte b/web-common/src/components/icons/Attachment.svelte new file mode 100644 index 00000000000..e9481bff9e1 --- /dev/null +++ b/web-common/src/components/icons/Attachment.svelte @@ -0,0 +1,19 @@ + + + + +