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
* `