remove select component

This commit is contained in:
Elijah Duffy
2025-07-03 14:12:27 -07:00
parent 07b7102a78
commit 06c1b9cb0b
2 changed files with 0 additions and 80 deletions

View File

@@ -1,66 +0,0 @@
<script lang="ts">
import Label from './Label.svelte';
import { validate } from '@svelte-toolkit/validate';
let {
name,
label,
value = $bindable(''),
required,
missingMessage,
node = $bindable(),
options,
placeholder
}: {
name: string;
label?: string;
value?: string;
placeholder?: string;
required?: boolean;
missingMessage?: string;
node?: HTMLSelectElement;
options: {
label: string;
value: string;
}[];
} = $props();
let valid: boolean = $state(true);
</script>
<div>
<Label for={name}>{label}</Label>
<select
id={name}
{name}
bind:value
class={[
'border-accent w-full rounded-sm border bg-white px-[1.125rem] py-3.5 font-normal transition-colors',
'text-text placeholder:text-text/60 dark:border-accent/50 dark:bg-text-800 placeholder:font-normal',
'dark:text-background dark:placeholder:text-background/60 dark:sm:bg-slate-800',
!valid && 'border-red-500!'
]}
use:validate={{ required }}
onvalidate={(e) => {
valid = e.detail.valid;
}}
bind:this={node}
>
{#if placeholder}
<option value="" disabled selected={value === '' || value === undefined}>
{placeholder}
</option>
{/if}
{#each options as opt}
<option value={opt.value} selected={opt.value === value}>
{opt.label}
</option>
{/each}
</select>
<div class={['opacity-0 transition-opacity', !valid && 'opacity-100']}>
<Label for={name} error>
{missingMessage !== undefined && missingMessage !== '' ? missingMessage : 'Field is required'}
</Label>
</div>
</div>

View File

@@ -8,7 +8,6 @@
import PhoneInput from '$lib/PhoneInput.svelte'; import PhoneInput from '$lib/PhoneInput.svelte';
import PinInput from '$lib/PinInput.svelte'; import PinInput from '$lib/PinInput.svelte';
import RadioGroup from '$lib/RadioGroup.svelte'; import RadioGroup from '$lib/RadioGroup.svelte';
import Select from '$lib/Select.svelte';
import StyledRawInput from '$lib/StyledRawInput.svelte'; import StyledRawInput from '$lib/StyledRawInput.svelte';
import TextInput from '$lib/TextInput.svelte'; import TextInput from '$lib/TextInput.svelte';
import TimeInput from '$lib/TimeInput.svelte'; import TimeInput from '$lib/TimeInput.svelte';
@@ -115,19 +114,6 @@
/> />
</div> </div>
<div class="component">
<p class="title">Select</p>
<Select
name="example-select"
label="Select an option"
options={[
{ label: 'Option 1', value: 'option1' },
{ label: 'Option 2', value: 'option2' },
{ label: 'Option 3', value: 'option3' }
]}
/>
</div>
<div class="component"> <div class="component">
<p class="title">Styled Raw Input, Text Input</p> <p class="title">Styled Raw Input, Text Input</p>