@ai-matrx/design-system 0.43.0 → 0.44.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/CHANGELOG.md +18 -0
- package/dist/content-transfer.cjs +39 -0
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.js +39 -0
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/data-row-inspector.cjs +39 -0
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +41 -2
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +39 -0
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +43 -4
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/index.cjs +39 -0
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +76 -37
- package/dist/data-table/index.js.map +1 -1
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +48 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -157,6 +157,7 @@ __export(src_exports, {
|
|
|
157
157
|
HoverCardTrigger: () => HoverCardTrigger,
|
|
158
158
|
Input: () => Input,
|
|
159
159
|
InputWithPrefix: () => InputWithPrefix,
|
|
160
|
+
LAYER_FRONT_EVENT: () => LAYER_FRONT_EVENT,
|
|
160
161
|
Label: () => Label3,
|
|
161
162
|
MOBILE_BREAKPOINT: () => MOBILE_BREAKPOINT,
|
|
162
163
|
MOTION_BOTTOM_SHEET: () => MOTION_BOTTOM_SHEET,
|
|
@@ -241,6 +242,7 @@ __export(src_exports, {
|
|
|
241
242
|
TooltipProvider: () => TooltipProvider,
|
|
242
243
|
TooltipTrigger: () => TooltipTrigger,
|
|
243
244
|
alertVariants: () => alertVariants,
|
|
245
|
+
announceLayerFront: () => announceLayerFront,
|
|
244
246
|
archiveFilterFromDisclosure: () => archiveFilterFromDisclosure,
|
|
245
247
|
badgeVariants: () => badgeVariants,
|
|
246
248
|
buttonVariants: () => buttonVariants,
|
|
@@ -2189,6 +2191,17 @@ var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
|
2189
2191
|
var VisuallyHidden2 = __toESM(require("@radix-ui/react-visually-hidden"), 1);
|
|
2190
2192
|
var import_react_tree3 = require("@ai-matrx/kit/react-tree");
|
|
2191
2193
|
var React18 = __toESM(require("react"), 1);
|
|
2194
|
+
|
|
2195
|
+
// src/layer-front.ts
|
|
2196
|
+
var LAYER_FRONT_EVENT = "matrx:layer-front";
|
|
2197
|
+
function announceLayerFront(element) {
|
|
2198
|
+
if (typeof document === "undefined") return;
|
|
2199
|
+
document.dispatchEvent(
|
|
2200
|
+
new CustomEvent(LAYER_FRONT_EVENT, { detail: { element } })
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
// src/dialog.tsx
|
|
2192
2205
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2193
2206
|
var DialogWindowedByDefaultContext = React18.createContext(false);
|
|
2194
2207
|
var Dialog = ({
|
|
@@ -2261,6 +2274,8 @@ var DialogContent = React18.forwardRef(
|
|
|
2261
2274
|
dismissOnOutsideClick = false,
|
|
2262
2275
|
onInteractOutside,
|
|
2263
2276
|
onEscapeKeyDown,
|
|
2277
|
+
onPointerDownCapture,
|
|
2278
|
+
onFocusCapture,
|
|
2264
2279
|
style,
|
|
2265
2280
|
...props
|
|
2266
2281
|
}, ref) => {
|
|
@@ -2273,6 +2288,24 @@ var DialogContent = React18.forwardRef(
|
|
|
2273
2288
|
const [containerEl, setContainerEl] = React18.useState(
|
|
2274
2289
|
null
|
|
2275
2290
|
);
|
|
2291
|
+
const stacks = windowed && windowedByDefault;
|
|
2292
|
+
const [behind, setBehind] = React18.useState(false);
|
|
2293
|
+
React18.useEffect(() => {
|
|
2294
|
+
if (!stacks || !containerEl) return;
|
|
2295
|
+
const onFront = (event) => {
|
|
2296
|
+
const element = event.detail?.element ?? null;
|
|
2297
|
+
if (element && (element === containerEl || containerEl.contains(element))) return;
|
|
2298
|
+
setBehind(true);
|
|
2299
|
+
};
|
|
2300
|
+
document.addEventListener(LAYER_FRONT_EVENT, onFront);
|
|
2301
|
+
announceLayerFront(containerEl);
|
|
2302
|
+
return () => document.removeEventListener(LAYER_FRONT_EVENT, onFront);
|
|
2303
|
+
}, [stacks, containerEl]);
|
|
2304
|
+
const bringToFront = () => {
|
|
2305
|
+
if (!stacks || !containerEl) return;
|
|
2306
|
+
setBehind(false);
|
|
2307
|
+
announceLayerFront(containerEl);
|
|
2308
|
+
};
|
|
2276
2309
|
const [offset, setOffset] = React18.useState({ x: 0, y: 0 });
|
|
2277
2310
|
const dragRef = React18.useRef(null);
|
|
2278
2311
|
const handle = React18.useMemo(() => {
|
|
@@ -2331,10 +2364,20 @@ var DialogContent = React18.forwardRef(
|
|
|
2331
2364
|
// z=1000); staying below that boundary makes a newly focused window
|
|
2332
2365
|
// usable without coupling the two systems.
|
|
2333
2366
|
!isModal && !windowedByDefault && "z-[900]",
|
|
2367
|
+
// Another layer came to the front after this window (layer-front.ts).
|
|
2368
|
+
stacks && behind && "z-[999]",
|
|
2334
2369
|
// Without an overlay the card needs its own separation from the page.
|
|
2335
2370
|
windowed && "shadow-2xl ring-1 ring-border/60"
|
|
2336
2371
|
),
|
|
2337
2372
|
style: windowed && (offset.x !== 0 || offset.y !== 0) ? { ...style, translate: `${offset.x}px ${offset.y}px` } : style,
|
|
2373
|
+
onPointerDownCapture: (event) => {
|
|
2374
|
+
onPointerDownCapture?.(event);
|
|
2375
|
+
if (behind) bringToFront();
|
|
2376
|
+
},
|
|
2377
|
+
onFocusCapture: (event) => {
|
|
2378
|
+
onFocusCapture?.(event);
|
|
2379
|
+
if (behind) bringToFront();
|
|
2380
|
+
},
|
|
2338
2381
|
onInteractOutside: (event) => {
|
|
2339
2382
|
onInteractOutside?.(event);
|
|
2340
2383
|
if (windowed && !dismissOnOutsideClick) event.preventDefault();
|