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.
svelte-kit-vice/src/uix/eidos/components/dialog/dialog-trigger.svelte

28 lines
973 B

<script lang="ts">
/**
* Eidos `<Dialog.Trigger>` — composes the canonical `<Button>` via soma's
* `child` snippet, so the trigger is a framework Button (not soma's native
* `<button>` fallback). `variant` / `size` / `color` default to nothing and
* therefore defer to Button's canonical defaults (`solid` / `md` / `primary`
* — the primary "open" action). A `child` snippet bypasses the Button for a
* fully custom trigger element.
*/
import * as Dialog from '$soma/components/dialog';
import { Button } from '$uix/eidos/components/button';
import type { DialogTriggerProps } from './types';
let { children, variant, size, color, child: outerChild, ...rest }: DialogTriggerProps = $props();
</script>
<Dialog.Trigger {...rest}>
{#snippet child({ props })}
{#if outerChild}
{@render outerChild({ props })}
{:else}
<Button {...props} {variant} {size} {color}>
{@render children?.()}
</Button>
{/if}
{/snippet}
</Dialog.Trigger>

Powered by TurnKey Linux.