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/alert-dialog/alert-dialog.svelte

21 lines
767 B

feat(alert-dialog): port from soma to eidos (Tier 1 sprint, 2/5) Modal Dialog variant with role=alertdialog, forced modal=true, and click-outside disabled. Soma delegates to the Dialog runtime (variant='alertdialog') so DOM markers are Dialog's (data-dialog-*) — eidos reuses Dialog's recipe for chrome and adds two alert-dialog-specific buttons: Action + Cancel. Eidos shape: - Provider, Content, Action, Cancel — alert-dialog-specific wrappers - Trigger, Overlay, Title, Description, Header, Footer, Portal — re-exported from Dialog's eidos barrel (zero duplication) Recipe (alert-dialog.css): - Only styles Action + Cancel - Buttons consume Toggle palette tokens (same "interactive button" vocabulary used by <Toggle> and <ToggleGroup.Item>) - Auto-color cascade: Action picks up the dialog's data-color so a risk/threat-flagged dialog gets a red/amber Action button without manual recipe code - Cancel stays neutral so the safe-choice contrast is preserved Morfo: - scope: ['soma'] → ['soma', 'sema', 'eidos'] - The morfo declares Action + Cancel parts only (Provider is virtual, other parts inherited via Dialog runtime delegation) - Classified passive at this contract level (Dialog owns the events); README documents this in §"Passive justification" Demo: 6-tab canonical template with intent / size / position chips, soma + eidos snippets, references comparison table vs Radix Primitives / Bits UI / Ark UI / Chakra v3 / Radix Themes / shadcn. Checks: svelte-check 0 errors, component:audit 91/91 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
<script lang="ts">
/**
* Eidos `<AlertDialog>` — root. Wraps soma's
* `<AlertDialog.Provider>` which delegates to the Dialog runtime
* with `variant='alertdialog'`, `modal=true` baked in.
*
* The actual DOM uses Dialog's data-attrs (`data-dialog-content`,
* `data-dialog-overlay`, etc.) so the existing Dialog recipe paints
* the chrome. Only `Action` and `Cancel` get fresh selectors
* (`data-alert-dialog-action`, `data-alert-dialog-cancel`).
*/
import * as AlertDialog from '$soma/components/alert-dialog';
import type { AlertDialogProps } from './types';
let { open = $bindable(false), children, ...rest }: AlertDialogProps = $props();
</script>
<AlertDialog.Provider {...rest} bind:open>
{@render children?.()}
</AlertDialog.Provider>

Powered by TurnKey Linux.