import type { Snippet } from 'svelte'; import type { GuideController, GuideDirection, GuideStorageAdapter, GuideTour, Placement } from '../../utils/index.js'; import type { GuideArticleSlots, GuideBeaconSlots, GuideBeaconVariants, GuideHintSlots, GuideMarkerSlots, GuideMarkerVariants, GuideMentionSlots, GuidePanelSlots, GuidePanelVariants, GuideRefSlots, GuideTourSlots } from './guide.variants.js'; /** * @summary The root that wires every guide component to one controller. * @description Root provider for the Guide help system. Instantiates a `GuideController` * and shares it via context with all Guide components (Panel, Marker, Mention, Hint, Tour). * Place once near the app root. The context is optional: a component used without a provider * renders inert rather than throwing. * @tag overlay * @tag feedback * @related GuidePanel * @related GuideMarker * @stability beta * @standalone * * @example * ```svelte * * * * * * * * ``` */ export interface GuideProviderProps { /** Persistence adapter for "seen" state (tours/hints). @default localStorage-backed adapter */ storage?: GuideStorageAdapter; /** * Navigation hook for declarative cross-route tours, forwarded to the internally created * controller. A SvelteKit consumer wires `(route) => goto(route)`; a step's `route` then * navigates before its spotlight. Ignored when a `controller` is supplied (set it there). * @default undefined */ navigate?: (route: string) => void | Promise; /** * Supply a pre-created `GuideController` for programmatic access from outside the provider * (start tours, open the panel, query `hasSeen`). When omitted, the provider creates one * internally and shares it via context. When supplied, `storage` and `navigate` are ignored. */ controller?: GuideController; /** App subtree wired to the Guide context. */ children: Snippet; } /** * @summary Help that docks to the edge and leaves the app usable behind it. * @description Non-modal help panel for the Guide system. Slides in (default from the right) * without a backdrop or focus trap, so the app stays interactive behind it — this is what lets * a `GuideMention` highlight a UI element while the panel is open (D1). Visibility is driven by * the controller (`openPanel`/`closePanel`), not a local prop. Place `GuideArticle` children * inside: the panel shows a list of them, or the active article's content with a back button. * @tag overlay * @tag navigation * @related GuideProvider * @related GuideArticle * @related GuideMarker * @stability beta * @standalone * * @example * ```svelte * * *

Use the Save button to persist your changes.

*
*
* ``` */ export interface GuidePanelProps { /** * Stable DOM id for the panel root. `GuideMarker`s reference it via `aria-controls`. * @default auto-generated (`guide-panel-`) */ id?: string; /** Side the panel docks to. @default 'right' */ placement?: GuidePanelVariants['placement']; /** Panel width. @default 'md' */ size?: GuidePanelVariants['size']; /** Heading shown when no article is open. @default i18n `guide.openHelp` */ title?: string; /** * Render a filter input above the article index that matches article titles * (case-insensitive). Off by default. Pairs with article grouping — filtered * results keep their section headers and empty sections disappear. * @default false */ searchable?: boolean; /** Close the panel when Escape is pressed. @default true */ closeOnEscape?: boolean; /** Optional footer content. */ footer?: Snippet; /** `GuideArticle` children and any custom content. */ children?: Snippet; /** Additional classes on the panel root. */ class?: string; /** Strip all default styles. @default false */ unstyled?: boolean; /** Per-slot class overrides. */ slotClasses?: Partial>; /** Apply a named preset registered via ``. */ preset?: string; } /** * @summary One help article inside the guide panel. * @description A single help article inside a `GuidePanel`. Registers itself in the panel's * list (by `title`) and renders its content only when it is the active article * (`controller.activeArticle === id`). Use `GuideMention` inside to link back to UI elements. * @tag display * @related GuidePanel * @related GuideMention * @stability beta * @standalone * * @example * ```svelte * *

Each seat is one team member.

*
* ``` */ export interface GuideArticleProps { /** Unique article id — referenced by `GuideMarker` and `openPanel(id)`. */ id: string; /** Title shown in the panel list and header. */ title: string; /** * Optional section this article belongs to in the panel index. Articles that * share a `group` are rendered under one section header (sections appear in * the order their first article is defined); articles without a `group` stay * in an ungrouped block. When no article sets a `group`, the index is a flat * list — unchanged from today. */ group?: string; /** Article body. */ children?: Snippet; /** Additional classes on the article root. */ class?: string; /** Strip all default styles. @default false */ unstyled?: boolean; /** Per-slot class overrides. */ slotClasses?: Partial>; /** Apply a named preset registered via ``. */ preset?: string; } /** * @summary The discreet marker that opens the help panel at the right article. * @description Direction A of the bidirectional link (UI → Guide): a discreet "ⓘ" trigger * that sits on a UI element and opens the `GuidePanel` at the matching article. A real * ` * * * You can now export on a schedule from here. * * ``` */ export interface GuideHintProps { /** `data-guide` id of the element to anchor to. Required — a hint with no anchor has nothing to point at. */ for: string; /** * Persistence key for the "seen once" state, decoupled from the anchor (this is *not* a DOM id — * the popover gets none). Override only to track two hints on one element independently, or to keep * a stable key across a renamed anchor. * @default the `for` id */ seenId?: string; /** * Manual visibility for `trigger="manual"` (the on-route / on-condition strategy). Ignored for * `trigger="mount"`. Re-raising it to `true` after a dismiss re-surfaces the hint (subject to `once`). * @default false */ open?: boolean; /** * When the hint may appear: `'mount'` shows it as soon as it mounts; `'manual'` waits for * `open` to become `true` (the consumer's route/condition logic). * @default 'mount' */ trigger?: 'mount' | 'manual'; /** * When dismissed, persist a "seen" flag (via the controller's StorageAdapter) so the hint * does not reappear on later mounts. Mirrors the tour's "mark seen on end" rule — a hint * shown but never dismissed may show again. Set `false` to always show. * @default true */ once?: boolean; /** Preferred placement relative to the target. @default 'bottom' */ placement?: Placement; /** Render the pointer arrow. @default true */ arrow?: boolean; /** Optional bold heading above the body. */ title?: string; /** Hint body. */ children?: Snippet; /** Called when the hint is dismissed (close button or Escape). */ onDismiss?: () => void; /** Additional classes on the hint root. */ class?: string; /** Strip all default styles. @default false */ unstyled?: boolean; /** Per-slot class overrides. */ slotClasses?: Partial>; /** Apply a named preset registered via ``. */ preset?: string; } /** * @summary The guided tour — opt-in, step by step, and only when the user asks for it. * @description The guided-tour renderer: the opt-in, intrusive Guide component. * Renders the active tour the controller drives (`startTour`/`next`/`prev`/ * `skip`/`finish`): a spotlight that dims everything but a cut-out hole over the current step's * target (the one *subtractive* Guide treatment, D5) plus an anchored bubble with the step * title, body, dot progress, and Back / Next / Skip controls. Mount once inside `GuideProvider`; * it renders nothing until a tour starts. Top-layer (native popover), so it clears app stacking * contexts; it steps aside (pauses) when a foreign modal stacks above it. A step with no `target` * renders centered over a full scrim. Renders inert without a `GuideProvider`. * @tag overlay * @tag feedback * @related GuideProvider * @related GuideBeacon * @related GuideHint * @stability beta * * @example * ```svelte * * * * * * * ``` */ export interface GuideProps { /** * Padding in px between the step target and the spotlight hole edge. Also frames the * additive highlight ring the engine paints on the target. @default 8 */ padding?: number; /** * Spotlight hole corner radius in px. When omitted, it follows the target's own * border-radius (plus `padding`), clamped to the hole size. Set a number to force it. */ radius?: number; /** Render the bubble's pointer arrow on anchored steps. @default true */ arrow?: boolean; /** Preferred bubble placement when a step omits its own `placement`. @default 'bottom' */ placement?: Placement; /** Additional classes on the bubble. */ class?: string; /** Strip all default styles. @default false */ unstyled?: boolean; /** * Per-slot class overrides. Beyond the tour's own `tv()` slots, `skip` / `prev` / `next` * forward to the footer's nested `