@diwauhris/ui 1.7.41 → 1.7.42
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/lib/index.cjs +8 -3
- package/lib/index.mjs +8 -3
- package/lib/types/lib/utils.d.ts +9 -0
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -54,6 +54,7 @@ let sonner = require("sonner");
|
|
|
54
54
|
function cn(...inputs) {
|
|
55
55
|
return (0, tailwind_merge.twMerge)((0, clsx.clsx)(inputs));
|
|
56
56
|
}
|
|
57
|
+
var FLOATING_LAYER_SELECTOR = `.pis-datepicker-popover, [data-pis-floating]`;
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
59
60
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -2471,7 +2472,7 @@ function Modal({ isOpen, onClose, title, children, icon, subtitle, headerMeta, f
|
|
|
2471
2472
|
onCloseAutoFocus,
|
|
2472
2473
|
onEscapeKeyDown: preventClose ? (e) => e.preventDefault() : onEscapeKeyDown,
|
|
2473
2474
|
onInteractOutside: (e) => {
|
|
2474
|
-
if (e.target?.closest(
|
|
2475
|
+
if (e.target?.closest(FLOATING_LAYER_SELECTOR)) {
|
|
2475
2476
|
e.preventDefault();
|
|
2476
2477
|
return;
|
|
2477
2478
|
}
|
|
@@ -2596,7 +2597,7 @@ function Dialog({ open, onClose, title, description, preventClose = false, size
|
|
|
2596
2597
|
className: cn("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "flex w-full flex-col overflow-hidden", "rounded-lg bg-white shadow-xl", "max-h-[90vh] outline-none", SIZE_CLASS[size]),
|
|
2597
2598
|
onEscapeKeyDown: preventClose ? (e) => e.preventDefault() : onEscapeKeyDown,
|
|
2598
2599
|
onInteractOutside: (e) => {
|
|
2599
|
-
if (e.target?.closest(
|
|
2600
|
+
if (e.target?.closest(FLOATING_LAYER_SELECTOR)) {
|
|
2600
2601
|
e.preventDefault();
|
|
2601
2602
|
return;
|
|
2602
2603
|
}
|
|
@@ -4265,7 +4266,11 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4265
4266
|
ref: panelRef,
|
|
4266
4267
|
role: "menu",
|
|
4267
4268
|
"aria-label": ariaLabel,
|
|
4268
|
-
|
|
4269
|
+
["data-pis-floating"]: "",
|
|
4270
|
+
style: {
|
|
4271
|
+
...panelStyle,
|
|
4272
|
+
pointerEvents: "auto"
|
|
4273
|
+
},
|
|
4269
4274
|
className: cn("overflow-y-auto overscroll-contain rounded-xl border border-slate-200 bg-white py-1 shadow-xl", panelClassName),
|
|
4270
4275
|
children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4271
4276
|
ref: (node) => {
|
package/lib/index.mjs
CHANGED
|
@@ -30,6 +30,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
30
30
|
function cn(...inputs) {
|
|
31
31
|
return twMerge(clsx(inputs));
|
|
32
32
|
}
|
|
33
|
+
var FLOATING_LAYER_SELECTOR = `.pis-datepicker-popover, [data-pis-floating]`;
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
35
36
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -2447,7 +2448,7 @@ function Modal({ isOpen, onClose, title, children, icon, subtitle, headerMeta, f
|
|
|
2447
2448
|
onCloseAutoFocus,
|
|
2448
2449
|
onEscapeKeyDown: preventClose ? (e) => e.preventDefault() : onEscapeKeyDown,
|
|
2449
2450
|
onInteractOutside: (e) => {
|
|
2450
|
-
if (e.target?.closest(
|
|
2451
|
+
if (e.target?.closest(FLOATING_LAYER_SELECTOR)) {
|
|
2451
2452
|
e.preventDefault();
|
|
2452
2453
|
return;
|
|
2453
2454
|
}
|
|
@@ -2572,7 +2573,7 @@ function Dialog({ open, onClose, title, description, preventClose = false, size
|
|
|
2572
2573
|
className: cn("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "flex w-full flex-col overflow-hidden", "rounded-lg bg-white shadow-xl", "max-h-[90vh] outline-none", SIZE_CLASS[size]),
|
|
2573
2574
|
onEscapeKeyDown: preventClose ? (e) => e.preventDefault() : onEscapeKeyDown,
|
|
2574
2575
|
onInteractOutside: (e) => {
|
|
2575
|
-
if (e.target?.closest(
|
|
2576
|
+
if (e.target?.closest(FLOATING_LAYER_SELECTOR)) {
|
|
2576
2577
|
e.preventDefault();
|
|
2577
2578
|
return;
|
|
2578
2579
|
}
|
|
@@ -4241,7 +4242,11 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4241
4242
|
ref: panelRef,
|
|
4242
4243
|
role: "menu",
|
|
4243
4244
|
"aria-label": ariaLabel,
|
|
4244
|
-
|
|
4245
|
+
["data-pis-floating"]: "",
|
|
4246
|
+
style: {
|
|
4247
|
+
...panelStyle,
|
|
4248
|
+
pointerEvents: "auto"
|
|
4249
|
+
},
|
|
4245
4250
|
className: cn("overflow-y-auto overscroll-contain rounded-xl border border-slate-200 bg-white py-1 shadow-xl", panelClassName),
|
|
4246
4251
|
children: items.map((item, index) => /* @__PURE__ */ jsxs("button", {
|
|
4247
4252
|
ref: (node) => {
|
package/lib/types/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
/**
|
|
4
|
+
* Floating layers (Menu panels, DatePicker calendars) portal to document.body.
|
|
5
|
+
* Inside an open Modal/Dialog, Radix blocks pointer events outside its content
|
|
6
|
+
* and treats any interaction there as "outside" (closing the dialog). Floating
|
|
7
|
+
* layers opt out by setting `pointer-events: auto` and carrying this marker;
|
|
8
|
+
* Modal and Dialog then ignore interactions that land inside them.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FLOATING_LAYER_ATTR = "data-pis-floating";
|
|
11
|
+
export declare const FLOATING_LAYER_SELECTOR = ".pis-datepicker-popover, [data-pis-floating]";
|