import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js'; /** Which edge of the panel's own container it's docked to. `'start'`/`'end'` * are logical-inline (mirror left/right depending on writing direction); * `'top'`/`'bottom'` are block-direction and unaffected by RTL. */ export type LyraDockPanelEdge='start'|'end'|'top'|'bottom';export interface LyraDockPanelResizeDetail{ /** The panel's new extent along its resize axis, always as a `px` CSS length string. */ readonly extent:string;}export interface LyraDockPanelCollapseChangeDetail{readonly collapsed:boolean;}export interface LyraDockPanelEventMap{'lr-resize-request':CustomEvent;'lr-resize-input':CustomEvent;'lr-resize-change':CustomEvent;'lr-collapse-request':CustomEvent;'lr-collapse-change':CustomEvent;} /** * `` — a single panel docked to one edge of whatever * contains it, resizable by dragging its inner edge. Unlike `` * (which owns and lays out N sibling panels, and requires restructuring a * layout so every panel becomes its direct child), this is one self- * contained element you drop next to your existing content -- typically as * an absolutely-positioned child of a `position: relative` parent, or as a * flex item alongside a main-content sibling. It deliberately imposes no * `position`/`inset` of its own (see the styles module): it only manages its * own size along the resize axis (`inline-size` for `start`/`end`, * `block-size` for `top`/`bottom`) and fills 100% of the cross axis, leaving * where it sits in the page entirely up to the consumer's own layout. Live * container changes and direct property writes are reconciled without resize * interaction events so the rendered extent and separator range remain * bounded atomically. * * `lr-multi-split` stays the right primitive for the multi-sibling-panel case; * this is the primitive for the single-edge-docked case, kept as a separate * component rather than a second mode bolted onto `lr-multi-split`'s API. * * Pointer-drag-resize mirrors `lr-multi-split`'s pointer-capture technique * (an admitted primary-button pointerdown captures the pointer on the handle, * pointermove computes a new size, and pointerup/pointercancel/ * lostpointercapture all release it) but * for a single draggable edge instead of N-1 dividers between N panels, and * reasons in raw pixels throughout rather than percent -- `extent` is a CSS * length, and pointer movement is naturally pixels, so there's no percent * domain to convert through here. Every resize (drag step, drag release, or * keyboard step) always commits `extent` as a `px` string regardless of what * unit `extent`/`min-extent`/`max-extent` were originally expressed in -- a drag * inherently produces a pixel-precise result, so re-expressing it in the * caller's original unit (e.g. back into `rem`) would just be lossy * re-derivation for no benefit. * * Collapsing hides the slotted content but keeps the panel itself at a * small persistent "rail" width/height (`--lr-dock-panel-collapsed-size`, * default `var(--lr-icon-button-size)`) rather than collapsing to zero -- * a zero-size collapsed panel would have nowhere left to host the toggle * button that re-expands it. `extent` itself is left untouched while * collapsed, so re-expanding restores what it was unless the live container * bounds now require a smaller or larger valid extent. * * @customElement lr-dock-panel * @slot - The panel's own content. * @event lr-resize-request - A cancelable proposed `extent` (a `px` CSS length string), `detail: { * extent }`, fired before a discrete keyboard step commits and before a pointer drag's final * settle commits. Call `preventDefault()` to reject it: a keyboard step simply does not apply, * and a drag's final settle snaps the panel back to the size it had before that drag gesture * began. Not fired for a continuous pointer drag's own intermediate ticks -- checking a * cancelable event on every pointermove would make a live drag visibly stutter -- only its * final settle on release. * @event lr-resize-input - Frozen `detail: { extent }` (a `px` CSS length string), fired for every * genuine pointer or keyboard value transition. Fully clamped/no-op attempts emit nothing. * @event lr-resize-change - Frozen `detail: { extent }`, fired once on genuine pointerup after at * least one value transition and the drag's `lr-resize-request` was not prevented, and after * each genuine keyboard step whose own `lr-resize-request` was not prevented. Pointer * cancellation, lost capture, policy/geometry mutation, no-op attempts, and a prevented * `lr-resize-request` all emit nothing. * @event lr-collapse-request - A cancelable proposed `collapsed` state from the built-in collapse * toggle. Call `preventDefault()` to keep `collapsed` unchanged. Not fired when a consumer sets * `collapsed` directly. `detail: { collapsed }`. * @event lr-collapse-change - Non-cancelable post-commit notification from the built-in collapse * toggle. Not fired when a consumer sets `collapsed` directly. `detail: { collapsed }` (the new * `collapsed` state). * @csspart base - The panel root. * @csspart content - The wrapper around the default slot; hidden while `collapsed`. * @csspart handle - The draggable resize handle on the panel's inner edge. Its numeric ARIA range * remains in CSS pixels while `aria-valuetext` reports the current extent through the effective * locale. Only rendered when `resizable` and not `collapsed`. * @csspart collapse-toggle - The collapse/expand toggle button. Only rendered when `collapsible`. * @cssprop [--lr-dock-panel-collapsed-size=var(--lr-icon-button-size)] - The extent the panel * keeps along its resize axis while `collapsed` -- enough to still host the toggle button that * re-expands it. * @cssprop [--lr-dock-panel-collapse-toggle-hover-bg=var(--lr-color-brand-quiet)] - Background of * `collapse-toggle` on hover; also feeds its pressed background via `color-mix()`. * @cssprop [--lr-dock-panel-collapse-toggle-hover-color=var(--lr-color-brand)] - Text/icon color * of `collapse-toggle` on hover, reused verbatim for its pressed color too. * @cssprop [--lr-dock-panel-handle-hover-color=var(--lr-color-brand)] - Background of `handle` on * hover and keyboard focus -- scoped separately from `collapse-toggle`'s own hover tokens above * even though both default to the same brand token, since the two serve unrelated purposes * (drag affordance vs. button feedback). * @cssprop [--lr-dock-panel-handle-active-color=color-mix(in oklab, var(--lr-dock-panel-handle-hover-color, var(--lr-color-brand)), var(--lr-color-mix-partner) var(--lr-color-mix-active))] - * Background of `handle` while actively dragged/pressed. * @status stable * @since 4.0.0 */ export declare class LyraDockPanel extends LyraElement{static styles:import("lit").CSSResultGroup[];edge:LyraDockPanelEdge; /** The current docked extent along the resize axis, as a CSS length (e.g. `"320px"`). * * Spelled `extent`, not `size`: everywhere else in the library `size` names a tier on the * shared six-step ladder (`internal/variants.ts`'s `LyraSize`), and this is an arbitrary CSS * length instead. A clean rename with no alias -- `size`/`min-size`/`max-size` on * `` are simply unknown attributes now. */ extent:string; /** Minimum resize bound, as a CSS length. */ minExtent:string; /** Maximum resize bound, as a CSS length. Empty means "no explicit cap" -- the live extent of * the containing element is used instead, so the panel still can't be dragged wider/taller than * its container. */ maxExtent:string;collapsible:boolean;collapsed:boolean; /** When `false`, no drag handle renders at all and the panel is a fixed size. */ resizable:boolean;private drag;private dragOwnerWindow?;private readonly contentId;private containerResizeObserver?;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void; /** Creates (idempotently) and observes both the containing element and this * host. The parent catches allocation changes; the host catches flex * reallocation whose parent box itself did not resize. */ private armContainerResizeObserver;protected willUpdate(changed:PropertyValues):void; /** `'inline'` for the `start`/`end` edges (resizing changes `inline-size`), `'block'` for * `top`/`bottom` (resizing changes `block-size`). */ private get axis(); /** +1 or -1: which physical pointer-movement/keyboard direction *grows* the panel, folding in * both which edge is pinned (the opposite edge is what's dragged) and, for the inline axis * only, the current RTL-ness -- mirrors lr-multi-split's own horizontal+RTL delta inversion, just * generalized to four possible pinned edges instead of split's always-LTR-authored pair order. */ private get growSign();private applyHostSize; /** Live pixel size of the containing block along the resize axis, used both to resolve a `%` * `min-extent`/`max-extent` and as the `max-extent` fallback when unset. Falls back to the viewport * when there's no parent element (e.g. not yet connected). */ private containerPx;private resolveBoundsPx; /** The panel's own current rendered size (px) along the resize axis, read straight off the * live box -- this is what lets `extent` be expressed in any CSS unit and still drag/step * correctly from wherever it actually rendered, with no separate unit-conversion path for the * "current" value. */ private currentSizePx;private resizeValueText;private reconcileLiveExtent; /** Computes the clamped extent a raw pixel size would resolve to, without applying it -- * `undefined` when it's a no-op against the current live size. Split from `applyProposal()` so * a discrete step (keyboard, or a pointer drag's final settle) can offer the proposed extent * through the cancelable `lr-resize-request` veto before mutating anything. */ private resolveProposal;private applyProposal; /** Continuous pointer-drag ticks apply immediately with no per-tick veto -- checking a * cancelable event on every pointermove would make a live drag visibly stutter waiting on * synchronous listener work. `onHandleKeyDown`'s discrete steps and a drag's final settle in * `onPointerUp` each go through `lr-resize-request` instead; see those for the veto path. */ private commitSize; /** Proposes `extent` through the cancelable `lr-resize-request` veto point (mirroring * `lr-collapse-request`'s propose-then-commit shape) and applies it only when not * `defaultPrevented`. Returns whether it was applied. */ private requestResize;private emitResize;private dragSnapshotIsCurrent;private onPointerDown;private onPointerMove;private onPointerUp;private onPointerCancel;private endDrag;private onHandleKeyDown;private toggleCollapsed; /** Rotation (deg) for the collapse-toggle's chevron: it points toward the * panel's pinned edge when expanded (that's the direction clicking it * will shrink toward) and away from it when collapsed (the direction * clicking it will grow toward) -- mirrors lr-widget's collapse-button * rotate-the-wrapping-part technique, generalized across four possible * pinned edges and, for `start`/`end`, RTL. */ private get toggleChevronDeg();private handleTemplate;private collapseToggleTemplate;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-dock-panel':LyraDockPanel;}}