createDrawer — the reusable open/close controller behind any slide-in panel (cart, mobile nav, a Sheet): toggles
the panel + backdrop visibility and an open class (for the CSS transition), makes the page chrome inert while
open (a real focus-trap + AT hide — honoring aria-modal), closes on Escape + backdrop click, and restores focus on
close. Framework-agnostic; the look + the RTL-aware slide direction live in CSS. Timing is injectable so the
open/close state machine is unit-testable without a real DOM.
createDrawer — the reusable open/close controller behind any slide-in panel (cart, mobile nav, a Sheet): toggles the panel + backdrop visibility and an
openclass (for the CSS transition), makes the page chromeinertwhile open (a real focus-trap + AT hide — honoring aria-modal), closes on Escape + backdrop click, and restores focus on close. Framework-agnostic; the look + the RTL-aware slide direction live in CSS. Timing is injectable so the open/close state machine is unit-testable without a real DOM.