Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687<script module lang="ts"> import { tv, type VariantProps } from "tailwind-variants";
export const formStep = tv({ slots: { root: "relative flex gap-md pl-xl", marker: "absolute -left-3", body: "min-w-0 flex-1", title: "typography-paragraph-large font-medium text-foreground-default", description: "mb-md typography-paragraph-small text-foreground-muted" }, variants: { connected: { true: { root: "border-l border-border-default" }, false: { root: "" } }, last: { true: { root: "[border-image:linear-gradient(var(--color-border-default),transparent)_1]" }, false: { root: "" } }, spacing: { regular: { root: "pb-3xl" }, none: { root: "" } }, markerAlign: { top: { marker: "top-0" }, middle: { marker: "top-1/2 -translate-y-1/2" } }, disabled: { true: { root: "opacity-50" } } }, defaultVariants: { connected: true, last: false, spacing: "regular", markerAlign: "top" } });
export type FormStepVariants = VariantProps<typeof formStep>;</script>
<script lang="ts"> import type { Snippet } from "svelte"; import StepMarker from "#lib/components/ui/StepMarker.svelte";
interface Props { step: number; title: string; description?: string; connected?: FormStepVariants["connected"]; last?: FormStepVariants["last"]; spacing?: FormStepVariants["spacing"]; disabled?: boolean; class?: string; children: Snippet; }
let { step, title, description, connected, last, spacing, disabled = false, class: className, children }: Props = $props();
const slot = $derived(formStep({ connected, last, spacing, disabled }));</script>
<div class={slot.root({ class: className })} inert={disabled}> <StepMarker class={slot.marker()}>{step}</StepMarker> <div class={slot.body()}> <h2 class={slot.title()}>{title}</h2> {#if description} <p class={slot.description()}>{description}</p> {/if} {@render children()} </div></div>