@stokelp/ui 2.120.0 → 2.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app/navigation/AppNavigation.cjs +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.js +27 -15
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/dialog/styled.cjs +1 -1
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.d.ts +1 -1
- package/dist/components/dialog/styled.js +39 -40
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs +1 -1
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +28 -29
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/menu/Menu.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/theme/recipes/dialog.cjs +1 -1
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.js +1 -0
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/ui.css +1 -1
- package/package.json +2 -2
- package/dist/utils/overlay-lock-cleanup.cjs +0 -2
- package/dist/utils/overlay-lock-cleanup.cjs.map +0 -1
- package/dist/utils/overlay-lock-cleanup.d.ts +0 -2
- package/dist/utils/overlay-lock-cleanup.js +0 -38
- package/dist/utils/overlay-lock-cleanup.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stokelp/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.122.0",
|
|
4
4
|
"description": "Stokelp UI React",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"vite-tsconfig-paths": "^6.1.1"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@ark-ui/react": "5.
|
|
98
|
+
"@ark-ui/react": "5.39.1",
|
|
99
99
|
"@zag-js/utils": "^1.41.0",
|
|
100
100
|
"lodash": "^4.17.21",
|
|
101
101
|
"react-is": "19.2.6",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";let e=require("react");var t=`[data-scope="dialog"][data-state="open"],[data-scope="popover"][data-state="open"]`,n=[`overflow`,`padding-right`,`padding-left`,`position`,`top`,`left`,`right`];function r(){let e=document.body;if(!document.querySelector(t)){if(e.style.pointerEvents===`none`&&(e.style.pointerEvents=``),e.hasAttribute(`data-inert`)&&e.removeAttribute(`data-inert`),e.hasAttribute(`data-scroll-lock`)){e.removeAttribute(`data-scroll-lock`);for(let t of n)e.style.removeProperty(t);document.documentElement.style.removeProperty(`--scrollbar-width`),document.querySelectorAll(`[data-aria-hidden]`).forEach(e=>{e.removeAttribute(`aria-hidden`),e.removeAttribute(`data-aria-hidden`)})}e.getAttribute(`style`)===``&&e.removeAttribute(`style`)}}function i(t){(0,e.useEffect)(()=>{if(process.env.NODE_ENV===`production`)return;let e=()=>window.setTimeout(r,350);return t||e(),()=>{e()}},[t])}exports.useReleaseStaleOverlayLocks=i;
|
|
2
|
-
//# sourceMappingURL=overlay-lock-cleanup.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-lock-cleanup.cjs","names":[],"sources":["../../src/utils/overlay-lock-cleanup.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n// Any overlay that is still genuinely open owns its body locks; only clean up\n// when none remain. Dialogs and drawers both render `data-scope=\"dialog\"` (the\n// drawer is built on the dialog machine); popovers can lock scroll too.\nconst OPEN_OVERLAY_SELECTOR = '[data-scope=\"dialog\"][data-state=\"open\"],[data-scope=\"popover\"][data-state=\"open\"]'\nconst LOCKED_BODY_STYLES = ['overflow', 'padding-right', 'padding-left', 'position', 'top', 'left', 'right']\n\n// DEV-ONLY safety net. In React StrictMode (Next.js dev) the overlay effects are\n// double-invoked, which — combined with a consumer that force-unmounts the Root\n// on close (`{open && <Dialog open={open} />}`, `if (!open) return null`) — can\n// leave two independent body locks behind, because the Zag machine is torn out\n// before its own cleanup runs cleanly:\n// - @zag-js/dismissable: `pointer-events: none` + `data-inert` on <body>.\n// - @zag-js/remove-scroll: `data-scroll-lock` + `overflow: hidden` (plus\n// padding / position / `--scrollbar-width`) on <body>, and `aria-hidden` on\n// sibling elements. preventBodyScroll is re-entrancy guarded (`if (locked)\n// return`, no cleanup returned), so once it leaks no later overlay can\n// release it and the page stays unscrollable until a full reload.\n// A production build runs the effects once and its cleanup releases the locks\n// normally, so this is gated to dev (see useReleaseStaleOverlayLocks) and DCE'd\n// in prod. Idempotent and guarded: it never touches a lock while an overlay is\n// open, so legitimate locks are left alone.\nexport function releaseStaleOverlayLocks() {\n const body = document.body\n if (document.querySelector(OPEN_OVERLAY_SELECTOR)) return\n\n // @zag-js/dismissable leak.\n if (body.style.pointerEvents === 'none') body.style.pointerEvents = ''\n if (body.hasAttribute('data-inert')) body.removeAttribute('data-inert')\n\n // @zag-js/remove-scroll leak.\n if (body.hasAttribute('data-scroll-lock')) {\n body.removeAttribute('data-scroll-lock')\n for (const prop of LOCKED_BODY_STYLES) body.style.removeProperty(prop)\n document.documentElement.style.removeProperty('--scrollbar-width')\n document.querySelectorAll('[data-aria-hidden]').forEach(el => {\n el.removeAttribute('aria-hidden')\n el.removeAttribute('data-aria-hidden')\n })\n }\n\n if (body.getAttribute('style') === '') body.removeAttribute('style')\n}\n\n// Schedules the cleanup whenever the overlay closes AND on unmount, covering\n// both the normal close path (Content stays mounted, `open` flips to false) and\n// the force-unmount path (consumer yanks the Root while it is still open, so\n// `open` never transitions within a mounted Content). React does NOT cancel a\n// setTimeout queued from an effect cleanup, so the restore still runs after\n// Content unmounts. The delay clears the exit transition; the open-overlay guard\n// inside releaseStaleOverlayLocks keeps it from clobbering a live overlay.\nexport function useReleaseStaleOverlayLocks(open: boolean | undefined) {\n useEffect(() => {\n // Dev-only: production builds don't hit the StrictMode double-invoke that\n // leaks the locks, and the check is DCE'd by consumer bundlers in prod.\n if (process.env.NODE_ENV === 'production') return\n const schedule = () => window.setTimeout(releaseStaleOverlayLocks, 350)\n if (!open) schedule()\n return () => {\n schedule()\n }\n }, [open])\n}\n"],"mappings":"oCAKA,IAAM,EAAwB,qFACxB,EAAqB,CAAC,WAAY,gBAAiB,eAAgB,WAAY,MAAO,OAAQ,OAAO,EAiB3G,SAAgB,GAA2B,CACzC,IAAM,EAAO,SAAS,KAClB,aAAS,cAAc,CAAqB,EAOhD,IAJI,EAAK,MAAM,gBAAkB,SAAQ,EAAK,MAAM,cAAgB,IAChE,EAAK,aAAa,YAAY,GAAG,EAAK,gBAAgB,YAAY,EAGlE,EAAK,aAAa,kBAAkB,EAAG,CACzC,EAAK,gBAAgB,kBAAkB,EACvC,IAAK,IAAM,KAAQ,EAAoB,EAAK,MAAM,eAAe,CAAI,EACrE,SAAS,gBAAgB,MAAM,eAAe,mBAAmB,EACjE,SAAS,iBAAiB,oBAAoB,EAAE,QAAQ,GAAM,CAC5D,EAAG,gBAAgB,aAAa,EAChC,EAAG,gBAAgB,kBAAkB,CACvC,CAAC,CACH,CAEI,EAAK,aAAa,OAAO,IAAM,IAAI,EAAK,gBAAgB,OAAO,CAFnE,CAGF,CASA,SAAgB,EAA4B,EAA2B,EACrE,EAAA,EAAA,eAAgB,CAGd,GAAA,QAAA,IAAA,WAA6B,aAAc,OAC3C,IAAM,MAAiB,OAAO,WAAW,EAA0B,GAAG,EAEtE,OADK,GAAM,EAAS,MACP,CACX,EAAS,CACX,CACF,EAAG,CAAC,CAAI,CAAC,CACX"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect as e } from "react";
|
|
3
|
-
//#region src/utils/overlay-lock-cleanup.ts
|
|
4
|
-
var t = "[data-scope=\"dialog\"][data-state=\"open\"],[data-scope=\"popover\"][data-state=\"open\"]", n = [
|
|
5
|
-
"overflow",
|
|
6
|
-
"padding-right",
|
|
7
|
-
"padding-left",
|
|
8
|
-
"position",
|
|
9
|
-
"top",
|
|
10
|
-
"left",
|
|
11
|
-
"right"
|
|
12
|
-
];
|
|
13
|
-
function r() {
|
|
14
|
-
let e = document.body;
|
|
15
|
-
if (!document.querySelector(t)) {
|
|
16
|
-
if (e.style.pointerEvents === "none" && (e.style.pointerEvents = ""), e.hasAttribute("data-inert") && e.removeAttribute("data-inert"), e.hasAttribute("data-scroll-lock")) {
|
|
17
|
-
e.removeAttribute("data-scroll-lock");
|
|
18
|
-
for (let t of n) e.style.removeProperty(t);
|
|
19
|
-
document.documentElement.style.removeProperty("--scrollbar-width"), document.querySelectorAll("[data-aria-hidden]").forEach((e) => {
|
|
20
|
-
e.removeAttribute("aria-hidden"), e.removeAttribute("data-aria-hidden");
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
e.getAttribute("style") === "" && e.removeAttribute("style");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function i(t) {
|
|
27
|
-
e(() => {
|
|
28
|
-
if (process.env.NODE_ENV === "production") return;
|
|
29
|
-
let e = () => window.setTimeout(r, 350);
|
|
30
|
-
return t || e(), () => {
|
|
31
|
-
e();
|
|
32
|
-
};
|
|
33
|
-
}, [t]);
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { i as useReleaseStaleOverlayLocks };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=overlay-lock-cleanup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-lock-cleanup.js","names":[],"sources":["../../src/utils/overlay-lock-cleanup.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n// Any overlay that is still genuinely open owns its body locks; only clean up\n// when none remain. Dialogs and drawers both render `data-scope=\"dialog\"` (the\n// drawer is built on the dialog machine); popovers can lock scroll too.\nconst OPEN_OVERLAY_SELECTOR = '[data-scope=\"dialog\"][data-state=\"open\"],[data-scope=\"popover\"][data-state=\"open\"]'\nconst LOCKED_BODY_STYLES = ['overflow', 'padding-right', 'padding-left', 'position', 'top', 'left', 'right']\n\n// DEV-ONLY safety net. In React StrictMode (Next.js dev) the overlay effects are\n// double-invoked, which — combined with a consumer that force-unmounts the Root\n// on close (`{open && <Dialog open={open} />}`, `if (!open) return null`) — can\n// leave two independent body locks behind, because the Zag machine is torn out\n// before its own cleanup runs cleanly:\n// - @zag-js/dismissable: `pointer-events: none` + `data-inert` on <body>.\n// - @zag-js/remove-scroll: `data-scroll-lock` + `overflow: hidden` (plus\n// padding / position / `--scrollbar-width`) on <body>, and `aria-hidden` on\n// sibling elements. preventBodyScroll is re-entrancy guarded (`if (locked)\n// return`, no cleanup returned), so once it leaks no later overlay can\n// release it and the page stays unscrollable until a full reload.\n// A production build runs the effects once and its cleanup releases the locks\n// normally, so this is gated to dev (see useReleaseStaleOverlayLocks) and DCE'd\n// in prod. Idempotent and guarded: it never touches a lock while an overlay is\n// open, so legitimate locks are left alone.\nexport function releaseStaleOverlayLocks() {\n const body = document.body\n if (document.querySelector(OPEN_OVERLAY_SELECTOR)) return\n\n // @zag-js/dismissable leak.\n if (body.style.pointerEvents === 'none') body.style.pointerEvents = ''\n if (body.hasAttribute('data-inert')) body.removeAttribute('data-inert')\n\n // @zag-js/remove-scroll leak.\n if (body.hasAttribute('data-scroll-lock')) {\n body.removeAttribute('data-scroll-lock')\n for (const prop of LOCKED_BODY_STYLES) body.style.removeProperty(prop)\n document.documentElement.style.removeProperty('--scrollbar-width')\n document.querySelectorAll('[data-aria-hidden]').forEach(el => {\n el.removeAttribute('aria-hidden')\n el.removeAttribute('data-aria-hidden')\n })\n }\n\n if (body.getAttribute('style') === '') body.removeAttribute('style')\n}\n\n// Schedules the cleanup whenever the overlay closes AND on unmount, covering\n// both the normal close path (Content stays mounted, `open` flips to false) and\n// the force-unmount path (consumer yanks the Root while it is still open, so\n// `open` never transitions within a mounted Content). React does NOT cancel a\n// setTimeout queued from an effect cleanup, so the restore still runs after\n// Content unmounts. The delay clears the exit transition; the open-overlay guard\n// inside releaseStaleOverlayLocks keeps it from clobbering a live overlay.\nexport function useReleaseStaleOverlayLocks(open: boolean | undefined) {\n useEffect(() => {\n // Dev-only: production builds don't hit the StrictMode double-invoke that\n // leaks the locks, and the check is DCE'd by consumer bundlers in prod.\n if (process.env.NODE_ENV === 'production') return\n const schedule = () => window.setTimeout(releaseStaleOverlayLocks, 350)\n if (!open) schedule()\n return () => {\n schedule()\n }\n }, [open])\n}\n"],"mappings":";;;AAKA,IAAM,IAAwB,8FACxB,IAAqB;CAAC;CAAY;CAAiB;CAAgB;CAAY;CAAO;CAAQ;AAAO;AAiB3G,SAAgB,IAA2B;CACzC,IAAM,IAAO,SAAS;CAClB,cAAS,cAAc,CAAqB,GAOhD;MAJI,EAAK,MAAM,kBAAkB,WAAQ,EAAK,MAAM,gBAAgB,KAChE,EAAK,aAAa,YAAY,KAAG,EAAK,gBAAgB,YAAY,GAGlE,EAAK,aAAa,kBAAkB,GAAG;GACzC,EAAK,gBAAgB,kBAAkB;GACvC,KAAK,IAAM,KAAQ,GAAoB,EAAK,MAAM,eAAe,CAAI;GAErE,AADA,SAAS,gBAAgB,MAAM,eAAe,mBAAmB,GACjE,SAAS,iBAAiB,oBAAoB,EAAE,SAAQ,MAAM;IAE5D,AADA,EAAG,gBAAgB,aAAa,GAChC,EAAG,gBAAgB,kBAAkB;GACvC,CAAC;EACH;EAEA,AAAI,EAAK,aAAa,OAAO,MAAM,MAAI,EAAK,gBAAgB,OAAO;CAFnE;AAGF;AASA,SAAgB,EAA4B,GAA2B;CACrE,QAAgB;EAGd,IAAA,QAAA,IAAA,aAA6B,cAAc;EAC3C,IAAM,UAAiB,OAAO,WAAW,GAA0B,GAAG;EAEtE,OADK,KAAM,EAAS,SACP;GACX,EAAS;EACX;CACF,GAAG,CAAC,CAAI,CAAC;AACX"}
|