import type { HTMLInputAttributes } from 'svelte/elements';
- import { circOut } from 'svelte/easing';
import { scale } from 'svelte/transition';
import type { CheckboxProps } from './types';
import { Icon } from '$svelte-atoms/core/components/icon';
- import { DURATION } from '$svelte-atoms/core/shared';
import { HtmlAtom } from '$svelte-atoms/core/components/atom';
import CheckmarkRegularIcon from '$svelte-atoms/core/icons/icon-checkmark.svelte';
- import { getPreset } from '$svelte-atoms/core/context';
- import { toClassValue } from '$svelte-atoms/core/utils';
import './checkbox.css';
-
- const preset = getPreset('checkbox');
- const checkmarkPreset = getPreset('checkbox.checkmark');
- const indeterminatePreset = getPreset('checkbox.indeterminate');
+ import { DURATION } from '$svelte-atoms/core/shared';
+ import { circOut } from 'svelte/easing';
let {
class: klass = '',
@@ -21,7 +15,6 @@
indeterminate = $bindable(),
value = $bindable(undefined),
group = $bindable([]),
- base = preset?.base as B,
id,
checkedContent,
indeterminateContent,
@@ -77,19 +70,19 @@
@@ -114,41 +107,40 @@
{#if indeterminate}
{#if indeterminateContent}
{:else}
-
+
{/if}
{:else if checked === true}
{#if checkedContent}
{:else}
- scale(node, { duration: DURATION.fast, easing: circOut, start: 0.6 })}
+ exit={(node) => scale(node, { duration: DURATION.fast, easing: circOut, start: 0.6 })}
>
-
+
{/if}
{/if}