StackManager

Primitive #63

🔍 Problem it solves

Multiple overlays open at the same time (dialog on top of another dialog) need proper z‑index stacking and focus management. The newer overlay should appear above older ones, and closing it should restore focus.

✅ Solution

StackManager manages an overlay stack (push, pop, remove). It assigns increasing z‑index values, and can manage focus between stacked overlays (focus restoration handled by the caller). This demo creates floating panels that stack.

🧩 Used by components

Dialog, Modal, Popover, Tooltip, Toast, ContextMenu

🎮 Interactive demo