finish custom class and improved options overhaul
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user