diff --git a/src/lib/components/ui/TagInput.svelte b/src/lib/components/ui/TagInput.svelte new file mode 100644 index 00000000..fce66b9b --- /dev/null +++ b/src/lib/components/ui/TagInput.svelte @@ -0,0 +1,294 @@ + + + + +{#if label || error} +
+ {#if label} + + {label} + + {/if} + +
e.key === 'Enter' && focusInput()} + role="button" + tabindex="-1" + > + {#each value as tag, index} + + {tag} + + + {/each} + + {#if canAddMore} + + {/if} +
+ + {#if error} + {error} + {/if} +
+{:else} +
e.key === 'Enter' && focusInput()} + role="button" + tabindex="-1" + > + {#each value as tag, index} + + {tag} + + + {/each} + + {#if canAddMore} + + {/if} +
+{/if} + +