12 implement twilio sms #37

Merged
BenjaminPalko merged 26 commits from 12-implement-twilio-sms into master 2025-01-02 20:11:28 -05:00
2 changed files with 77 additions and 37 deletions
Showing only changes of commit be3c7874ff - Show all commits

View file

@ -6,27 +6,36 @@
title: 'Data Input/Text Input', title: 'Data Input/Text Input',
component: TextInput, component: TextInput,
argTypes: { argTypes: {
bordered: {
control: 'boolean',
},
color: { color: {
control: 'select', control: 'select',
options: [ options: [
'ghost',
'primary', 'primary',
'secondary', 'secondary',
'accent', 'accent',
'ghost',
'link',
'info', 'info',
'success', 'success',
'warning', 'warning',
'error', 'error',
], ],
}, },
bordered: { disabled: {
control: 'boolean', control: 'boolean',
}, },
error: {
control: 'text',
},
fade: { control: 'boolean' },
start: { control: 'text' },
end: { control: 'text' },
label: { control: 'text' },
placeholder: { control: 'text' },
size: { size: {
control: 'select', control: 'select',
options: ['Default', 'xs', 'sm', 'lg'], options: ['xs', 'sm', '-', 'lg'],
defaultValue: 'Default',
}, },
type: { type: {
control: 'select', control: 'select',

View file

@ -8,9 +8,11 @@
bordered?: boolean; bordered?: boolean;
color?: Exclude<DaisyColor, 'neutral'>; color?: Exclude<DaisyColor, 'neutral'>;
disabled?: boolean; disabled?: boolean;
error?: string | Snippet;
fade?: boolean; fade?: boolean;
start?: Snippet | string; start?: string | Snippet;
end?: Snippet | string; end?: string | Snippet;
label?: string | Snippet;
name: string; name: string;
placeholder?: string; placeholder?: string;
size?: DaisySize; size?: DaisySize;
@ -24,9 +26,11 @@
bordered = false, bordered = false,
color, color,
disabled, disabled,
error,
fade, fade,
start, start,
end, end,
label,
name, name,
placeholder, placeholder,
size, size,
@ -34,7 +38,33 @@
}: Props = $props(); }: Props = $props();
</script> </script>
<label <label class="form-control w-full">
<div class="label">
<span
class="label-text"
class:text-primary={color === 'primary'}
class:text-secondary={color === 'secondary'}
class:text-accent={color === 'accent'}
class:text-info={color === 'info'}
class:text-success={color === 'success'}
class:text-warning={color === 'warning'}
class:text-error={color === 'error' || error}
>
{#if typeof label === 'string'}
{label}
{:else if label}
{@render label()}
{/if}
</span>
<span class="label-text-alt font-semibold text-error">
{#if typeof error === 'string'}
{error}
{:else if error}
{@render error()}
{/if}
</span>
</div>
<div
transition:fadeTransition={{ duration: fade ? 200 : 0 }} transition:fadeTransition={{ duration: fade ? 200 : 0 }}
class="input flex w-full items-center gap-2" class="input flex w-full items-center gap-2"
class:input-bordered={bordered} class:input-bordered={bordered}
@ -49,7 +79,7 @@
class:input-info={color === 'info'} class:input-info={color === 'info'}
class:input-success={color === 'success'} class:input-success={color === 'success'}
class:input-warning={color === 'warning'} class:input-warning={color === 'warning'}
class:input-error={color === 'error'} class:input-error={color === 'error' || error}
> >
{#if typeof start === 'string'} {#if typeof start === 'string'}
{start} {start}
@ -62,6 +92,7 @@
{:else} {:else}
{@render end?.()} {@render end?.()}
{/if} {/if}
</div>
</label> </label>
<style> <style>