finish custom class and improved options overhaul

This commit is contained in:
Elijah Duffy
2025-07-03 14:45:23 -07:00
parent c54002f5fa
commit 02311a0e7b
16 changed files with 170 additions and 131 deletions

View File

@@ -6,12 +6,14 @@
import type { Snippet } from 'svelte';
import { validate } from '@svelte-toolkit/validate';
import { generateIdentifier } from './util.js';
import type { ClassValue } from 'svelte/elements';
interface Props {
name?: string;
required?: boolean;
value?: CheckboxState;
color?: 'default' | 'contrast';
class?: ClassValue | null | undefined;
children?: Snippet;
onchange: (value: CheckboxState) => void;
}
@@ -21,6 +23,7 @@
required = false,
value = $bindable(false),
color = 'contrast',
class: classValue,
children,
onchange
}: Props = $props();
@@ -30,7 +33,7 @@
let valid = $state(true);
</script>
<div class="flex items-center">
<div class={['flex items-center', classValue]}>
<input
type="hidden"
{name}