From 496bf5e518c997a201ebe4c106b16f0c9083a31c Mon Sep 17 00:00:00 2001 From: gabrielstuff Date: Tue, 7 Jul 2026 16:51:58 +0200 Subject: [PATCH] feat(drawer): replace vaul-vue with reka-ui's native Drawer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrates UDrawer off vaul-vue onto reka-ui's Drawer primitives, closing the SSR crash (`document is not defined`) that vaul-vue throws when the drawer is force-mounted for SSR. reka-ui's Drawer is unstyled/headless, so the open/close slide, live drag-follow transform, and overlay fade are now authored as Tailwind utilities driven by reka's `--drawer-*` CSS vars, matching the pattern already used for Slideover's enter/exit animations. Behavioral notes: - `dismissible: false` is now enforced centrally on the open-change reason (blocks escape/outside-press/swipe/programmatic-close-without-reason) since reka's swipe-to-dismiss bypasses the outside/escape DOM events Modal-style interception relies on. - Nested drawers no longer need the `nested` prop — reka-ui detects nesting automatically via context. - Dropped props with no reka-ui equivalent: `shouldScaleBackground`, `setBackgroundColorOnScale`, `scrollLockTimeout`, `fixed`, `noBodyStyles`, `handleOnly`, `preventScrollRestoration`, `closeThreshold`. `activeSnapPoint` is renamed to `snapPoint`/`defaultSnapPoint` to match reka's naming. Updated the Drawer docs page and playground demo accordingly, and regenerated snapshots for Drawer and the components that embed it (DashboardSidebar, Header). --- .../examples/drawer/DrawerNestedExample.vue | 2 +- docs/content/docs/2.components/drawer.md | 83 +------ docs/nuxt.config.ts | 4 +- package.json | 1 - .../nuxt/app/pages/components/drawer.vue | 12 +- playgrounds/nuxt/nuxt.config.ts | 3 +- pnpm-lock.yaml | 50 ----- src/runtime/components/Drawer.vue | 98 ++++++--- src/runtime/keyframes.css | 85 ++++++++ src/theme/drawer.ts | 65 +++++- .../DashboardSidebar-vue.spec.ts.snap | 6 +- .../DashboardSidebar.spec.ts.snap | 6 +- .../__snapshots__/Drawer-vue.spec.ts.snap | 206 +++++++++--------- .../__snapshots__/Drawer.spec.ts.snap | 206 +++++++++--------- .../__snapshots__/Header-vue.spec.ts.snap | 6 +- .../__snapshots__/Header.spec.ts.snap | 6 +- 16 files changed, 436 insertions(+), 403 deletions(-) diff --git a/docs/app/components/content/examples/drawer/DrawerNestedExample.vue b/docs/app/components/content/examples/drawer/DrawerNestedExample.vue index e1bf4124d0..cc1d6570bd 100644 --- a/docs/app/components/content/examples/drawer/DrawerNestedExample.vue +++ b/docs/app/components/content/examples/drawer/DrawerNestedExample.vue @@ -3,7 +3,7 @@