You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
869 B
28 lines
869 B
<script lang="ts">
|
|
/**
|
|
* Eidos `Checkbox.Indicator` — defaults to `<SvgCheck>` /
|
|
* `<SvgDash>` from the eidos svg primitives. Pass an `icon` snippet
|
|
* to override (receives `{ checked, indeterminate }` so a single
|
|
* snippet can branch on state).
|
|
*/
|
|
import * as Checkbox from '$soma/components/checkbox';
|
|
import { SvgCheck, SvgDash } from '$uix/eidos/components/svg';
|
|
import type { CheckboxIndicatorProps } from './types';
|
|
|
|
let { icon, children: indicatorContent, ...rest }: CheckboxIndicatorProps = $props();
|
|
</script>
|
|
|
|
<Checkbox.Indicator {...rest}>
|
|
{#snippet children(snippetProps)}
|
|
{#if icon}
|
|
{@render icon(snippetProps)}
|
|
{:else if indicatorContent}
|
|
{@render indicatorContent(snippetProps)}
|
|
{:else if snippetProps.indeterminate}
|
|
<SvgDash />
|
|
{:else if snippetProps.checked}
|
|
<SvgCheck />
|
|
{/if}
|
|
{/snippet}
|
|
</Checkbox.Indicator>
|