From be3c7874ffb3da8aa2a1b3014b349ee60be7743c Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Mon, 30 Dec 2024 18:36:37 -0500 Subject: [PATCH] update with label and error --- .../DataInput/TextInput.stories.svelte | 21 +++-- src/lib/components/DataInput/TextInput.svelte | 93 ++++++++++++------- 2 files changed, 77 insertions(+), 37 deletions(-) diff --git a/src/lib/components/DataInput/TextInput.stories.svelte b/src/lib/components/DataInput/TextInput.stories.svelte index 74eb578..55223ed 100644 --- a/src/lib/components/DataInput/TextInput.stories.svelte +++ b/src/lib/components/DataInput/TextInput.stories.svelte @@ -6,27 +6,36 @@ title: 'Data Input/Text Input', component: TextInput, argTypes: { + bordered: { + control: 'boolean', + }, color: { control: 'select', options: [ + 'ghost', 'primary', 'secondary', 'accent', - 'ghost', - 'link', 'info', 'success', 'warning', 'error', ], }, - bordered: { + disabled: { control: 'boolean', }, + error: { + control: 'text', + }, + fade: { control: 'boolean' }, + start: { control: 'text' }, + end: { control: 'text' }, + label: { control: 'text' }, + placeholder: { control: 'text' }, size: { control: 'select', - options: ['Default', 'xs', 'sm', 'lg'], - defaultValue: 'Default', + options: ['xs', 'sm', '-', 'lg'], }, type: { control: 'select', @@ -42,4 +51,4 @@ - + \ No newline at end of file diff --git a/src/lib/components/DataInput/TextInput.svelte b/src/lib/components/DataInput/TextInput.svelte index affbd2c..5b7fc02 100644 --- a/src/lib/components/DataInput/TextInput.svelte +++ b/src/lib/components/DataInput/TextInput.svelte @@ -8,9 +8,11 @@ bordered?: boolean; color?: Exclude; disabled?: boolean; + error?: string | Snippet; fade?: boolean; - start?: Snippet | string; - end?: Snippet | string; + start?: string | Snippet; + end?: string | Snippet; + label?: string | Snippet; name: string; placeholder?: string; size?: DaisySize; @@ -24,9 +26,11 @@ bordered = false, color, disabled, + error, fade, start, end, + label, name, placeholder, size, @@ -34,35 +38,62 @@ }: Props = $props(); -