import type { Snippet } from "svelte"; export type PanelStackShape = "split-primary" | "sticky-item"; /** * Bound ratified by the chat consumer lane: beyond 4 sections, stacking * collapsible regions in a pane capped at 640px makes scrolling unmanageable * and the single-owner rule becomes untenable. Enforced as a dev-time * `console.warn` in `register()` (this package's established convention — * see NavActionStack/WaterfallChart — is to warn and degrade, never throw * or silently truncate); exported here so the bound is also visible through * types/docs to a consumer reading `PanelStackProps`. */ export declare const PANEL_STACK_MAX_SECTIONS = 4; /** * Default of `PanelStackProps.primaryMinHeight` (the primary section's * usable floor, in px) — exported so a consumer can reference the default * without hardcoding it. This is also the ONLY place the number is * hardcoded: PanelStack mirrors the live `primaryMinHeight` prop (which * defaults to this constant) onto the * `--st-component-panelStack-primaryMinBlockSize` custom property on its * own root, and the stylesheet's `min-block-size` reads that same * property — so the JS auto-collapse threshold and the CSS floor read the * same number and can no longer drift apart the way two independently * hardcoded copies could. */ export declare const PRIMARY_MIN_BLOCK_SIZE_PX = 160; export type PanelStackProps = { /** "sticky-item" (default): one section expanded at a time, all headers stay visible. "split-primary": the `primary` section is always expanded and owns the scroll; the others are content-sized disclosures. */ shape?: PanelStackShape; /** Accessible name for the stack region. */ label?: string; /** sticky-item, controlled: id of the expanded section. */ expanded?: string | null; /** sticky-item, uncontrolled seed. */ defaultExpanded?: string | null; onExpandedChange?: (id: string | null) => void; /** * split-primary: id of the section that owns the scroll. Falls back to the * first EXPANDED section (DOM order) when unset or stale, and — if nothing * is expanded — to the first registered section, so the stack never * degrades to zero scroll owners. */ primary?: string; /** Usable floor for the primary section, in px. While the primary sits above it the primary absorbs overflow; once it would drop below, a secondary auto-collapses instead of compressing the primary further. Default 160. */ primaryMinHeight?: number; /** * At most {@link PANEL_STACK_MAX_SECTIONS} `PanelSection` children are * supported — see that constant's doc comment for why. */ children?: Snippet; class?: string; }; /** * Context contract shared with PanelSection. Every shape-dependent branch * (sticky-item vs split-primary) is decided HERE and only here — PanelSection * never reads `shape`, it only calls these four functions/callback. If the * consumer-lane contract for these two shapes changes, this is the one place * to touch. */ export declare const PANEL_STACK_KEY: unique symbol; export type PanelStackContext = { /** Is this section the (non-collapsible) primary of a split-primary stack? */ isPrimary: (id: string) => boolean; /** Is this section currently expanded (body visible, content-sized or scrolling)? */ isExpanded: (id: string) => boolean; /** Is this section's body THE single scroll owner right now (flex:1 1 0, overflow:auto)? */ isScrollOwner: (id: string) => boolean; /** Header was activated (click / Space / Enter on the disclosure button). */ toggle: (id: string) => void; /** * Register a section's root AND header element, in mount/DOM order; * returns an unregister callback. NOT just bookkeeping — the stack falls * back to the first registered section as the scroll owner whenever * nothing else designates one (unset/stale `expanded` or `primary`), so * the invariant "exactly one scroll owner whenever the stack has ≥1 * section" holds even for a misconfigured or dynamically-changing stack. * `headerEl` is used only by split-primary's auto-collapse measurement * (the header of whichever section is CURRENTLY primary is observed for * its height); sticky-item ignores it. */ register: (id: string, rootEl: HTMLElement, headerEl: HTMLElement) => () => void; }; declare const PanelStack: import("svelte").Component; type PanelStack = ReturnType; export default PanelStack; //# sourceMappingURL=PanelStack.svelte.d.ts.map