@ai-matrx/design-system 0.60.8 → 0.60.9
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 +23 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.d.cts +1 -1
- package/dist/data-table/host.d.ts +1 -1
- package/dist/data-table/index.cjs +357 -334
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +357 -334
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +365 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +365 -233
- package/dist/index.js.map +1 -1
- package/dist/{layered-filters-BsnawJgC.d.ts → layered-filters-B0q8G3QR.d.ts} +21 -0
- package/dist/{layered-filters-C9MwGVTc.d.cts → layered-filters-CisXX8K5.d.cts} +21 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -281,9 +281,10 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
281
281
|
|
|
282
282
|
// src/badge.tsx
|
|
283
283
|
import { cva } from "class-variance-authority";
|
|
284
|
+
import * as React2 from "react";
|
|
284
285
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
285
286
|
var badgeVariants = cva(
|
|
286
|
-
"inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0",
|
|
287
|
+
"inline-flex min-w-0 max-w-[16rem] items-center gap-1 whitespace-nowrap rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 [&>svg]:shrink-0",
|
|
287
288
|
{
|
|
288
289
|
variants: {
|
|
289
290
|
variant: {
|
|
@@ -303,8 +304,136 @@ var badgeVariants = cva(
|
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
306
|
);
|
|
306
|
-
function
|
|
307
|
-
|
|
307
|
+
function textOf(children) {
|
|
308
|
+
const parts = [];
|
|
309
|
+
let onlyText = true;
|
|
310
|
+
React2.Children.forEach(children, (c) => {
|
|
311
|
+
if (typeof c === "string" || typeof c === "number") parts.push(String(c));
|
|
312
|
+
else if (c != null && typeof c !== "boolean") onlyText = false;
|
|
313
|
+
});
|
|
314
|
+
const text = parts.join("").trim();
|
|
315
|
+
return onlyText && text ? text : null;
|
|
316
|
+
}
|
|
317
|
+
function Badge({ className, variant, children, title, ...props }) {
|
|
318
|
+
const clamped = React2.Children.map(
|
|
319
|
+
children,
|
|
320
|
+
(c) => typeof c === "string" || typeof c === "number" ? /* @__PURE__ */ jsx3("span", { "data-slot": "badge-text", className: "min-w-0 truncate", children: c }) : c
|
|
321
|
+
);
|
|
322
|
+
return /* @__PURE__ */ jsx3(
|
|
323
|
+
"span",
|
|
324
|
+
{
|
|
325
|
+
"data-slot": "badge",
|
|
326
|
+
title: title ?? textOf(children) ?? void 0,
|
|
327
|
+
className: cn(badgeVariants({ variant }), className),
|
|
328
|
+
...props,
|
|
329
|
+
children: clamped
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/pill-guard.ts
|
|
335
|
+
var PILL_MAX_WIDTH_PX = 320;
|
|
336
|
+
var SELECTOR = [
|
|
337
|
+
'[data-slot="badge"]',
|
|
338
|
+
"[data-matrx-pill]",
|
|
339
|
+
"a.rounded-full",
|
|
340
|
+
"button.rounded-full",
|
|
341
|
+
"span.rounded-full",
|
|
342
|
+
"div.rounded-full"
|
|
343
|
+
].join(",");
|
|
344
|
+
var SLOT = /* @__PURE__ */ Symbol.for("@ai-matrx/design-system:pill-guard");
|
|
345
|
+
function px(v) {
|
|
346
|
+
const n = Number.parseFloat(v ?? "");
|
|
347
|
+
return Number.isFinite(n) ? n : 0;
|
|
348
|
+
}
|
|
349
|
+
function describe(el) {
|
|
350
|
+
const t = (el.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
351
|
+
return t.length > 60 ? `${t.slice(0, 57)}\u2026` : t;
|
|
352
|
+
}
|
|
353
|
+
function findPillViolation(el, maxWidth = PILL_MAX_WIDTH_PX) {
|
|
354
|
+
if (el.getAttribute("data-matrx-pill") === "off") return null;
|
|
355
|
+
const text = (el.textContent ?? "").trim();
|
|
356
|
+
if (!text) return null;
|
|
357
|
+
const view = el.ownerDocument.defaultView;
|
|
358
|
+
if (!view) return null;
|
|
359
|
+
const rect = el.getBoundingClientRect();
|
|
360
|
+
if (rect.width === 0 || rect.height === 0) return null;
|
|
361
|
+
const cs = view.getComputedStyle(el);
|
|
362
|
+
if (cs.display === "none" || cs.visibility === "hidden") return null;
|
|
363
|
+
if (rect.width > maxWidth + 0.5) {
|
|
364
|
+
return `pill is ${Math.round(rect.width)}px wide (budget ${maxWidth}px) holding "${describe(el)}" \u2014 a pill holds a short label: clamp it (Badge, or truncate + max-w + title) or render a list row.`;
|
|
365
|
+
}
|
|
366
|
+
const fontSize = px(cs.fontSize) || 12;
|
|
367
|
+
const lineHeight = px(cs.lineHeight) || fontSize * 1.4;
|
|
368
|
+
const inner = rect.height - px(cs.paddingTop) - px(cs.paddingBottom) - px(cs.borderTopWidth) - px(cs.borderBottomWidth);
|
|
369
|
+
if (inner > lineHeight * 1.5) {
|
|
370
|
+
const lines = Math.round(inner / lineHeight);
|
|
371
|
+
return `pill wraps to ${lines} lines holding "${describe(el)}" \u2014 a pill is one line: clamp it (Badge, or truncate + max-w + title) or render a list row.`;
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
var OUTLINE = "2px dashed hsl(var(--destructive))";
|
|
376
|
+
function enablePillGuard(options = {}) {
|
|
377
|
+
const g = globalThis;
|
|
378
|
+
if (g[SLOT]) return g[SLOT];
|
|
379
|
+
const doc = options.root ?? (typeof document === "undefined" ? null : document);
|
|
380
|
+
const view = doc?.defaultView;
|
|
381
|
+
if (!doc || !view) return () => {
|
|
382
|
+
};
|
|
383
|
+
const maxWidth = options.maxWidth ?? PILL_MAX_WIDTH_PX;
|
|
384
|
+
const marked = /* @__PURE__ */ new Map();
|
|
385
|
+
const reported2 = /* @__PURE__ */ new Set();
|
|
386
|
+
let timer = null;
|
|
387
|
+
let observer = null;
|
|
388
|
+
const scan = () => {
|
|
389
|
+
timer = null;
|
|
390
|
+
observer?.disconnect();
|
|
391
|
+
for (const [el, before] of marked) {
|
|
392
|
+
if (!el.isConnected || !findPillViolation(el, maxWidth)) {
|
|
393
|
+
el.style.outline = before;
|
|
394
|
+
el.removeAttribute("data-matrx-pill-violation");
|
|
395
|
+
marked.delete(el);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
doc.querySelectorAll(SELECTOR).forEach((el) => {
|
|
399
|
+
const reason = findPillViolation(el, maxWidth);
|
|
400
|
+
if (!reason) return;
|
|
401
|
+
if (!marked.has(el)) marked.set(el, el.style.outline);
|
|
402
|
+
el.style.outline = OUTLINE;
|
|
403
|
+
el.style.outlineOffset = "1px";
|
|
404
|
+
el.setAttribute("data-matrx-pill-violation", reason);
|
|
405
|
+
if (!reported2.has(reason)) {
|
|
406
|
+
reported2.add(reason);
|
|
407
|
+
console.error(`[pill-guard] ${reason}`, el);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
observe();
|
|
411
|
+
};
|
|
412
|
+
const schedule = () => {
|
|
413
|
+
if (timer) clearTimeout(timer);
|
|
414
|
+
timer = setTimeout(scan, 400);
|
|
415
|
+
};
|
|
416
|
+
const observe = () => {
|
|
417
|
+
if (!doc.body) return;
|
|
418
|
+
observer ??= new view.MutationObserver(schedule);
|
|
419
|
+
observer.observe(doc.body, { childList: true, subtree: true, characterData: true });
|
|
420
|
+
};
|
|
421
|
+
view.addEventListener("resize", schedule);
|
|
422
|
+
observe();
|
|
423
|
+
schedule();
|
|
424
|
+
const off = () => {
|
|
425
|
+
observer?.disconnect();
|
|
426
|
+
view.removeEventListener("resize", schedule);
|
|
427
|
+
if (timer) clearTimeout(timer);
|
|
428
|
+
for (const [el, before] of marked) {
|
|
429
|
+
el.style.outline = before;
|
|
430
|
+
el.removeAttribute("data-matrx-pill-violation");
|
|
431
|
+
}
|
|
432
|
+
marked.clear();
|
|
433
|
+
delete g[SLOT];
|
|
434
|
+
};
|
|
435
|
+
g[SLOT] = off;
|
|
436
|
+
return off;
|
|
308
437
|
}
|
|
309
438
|
|
|
310
439
|
// src/bottom-sheet.tsx
|
|
@@ -313,13 +442,13 @@ import { Drawer as DrawerPrimitive2 } from "vaul";
|
|
|
313
442
|
|
|
314
443
|
// src/drawer.tsx
|
|
315
444
|
import { treeContainsComponent } from "@ai-matrx/kit/react-tree";
|
|
316
|
-
import * as
|
|
445
|
+
import * as React5 from "react";
|
|
317
446
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
318
447
|
|
|
319
448
|
// src/floating-layer.tsx
|
|
320
449
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
321
450
|
import { Slot } from "@radix-ui/react-slot";
|
|
322
|
-
import * as
|
|
451
|
+
import * as React3 from "react";
|
|
323
452
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
324
453
|
var MODAL_LAYER_Z = 1e4;
|
|
325
454
|
var FLOATING_LAYER_ATTR = "data-matrx-floating-layer";
|
|
@@ -364,10 +493,10 @@ function subscribe(listener) {
|
|
|
364
493
|
return () => registry.listeners.delete(listener);
|
|
365
494
|
}
|
|
366
495
|
function useModalLayerOpen() {
|
|
367
|
-
return
|
|
496
|
+
return React3.useSyncExternalStore(subscribe, isModalLayerOpen, () => false);
|
|
368
497
|
}
|
|
369
498
|
function useModalLayer(active) {
|
|
370
|
-
|
|
499
|
+
React3.useLayoutEffect(() => active ? registerModalLayer() : void 0, [active]);
|
|
371
500
|
}
|
|
372
501
|
var POPPER_WRAPPER = "[data-radix-popper-content-wrapper]";
|
|
373
502
|
function isInsideFloatingLayer(target) {
|
|
@@ -388,8 +517,8 @@ function useFloatingLayerZIndex(ownZ) {
|
|
|
388
517
|
return floatingLayerZIndex(ownZ, useModalLayerOpen());
|
|
389
518
|
}
|
|
390
519
|
var preventAutoFocus = (event) => event.preventDefault();
|
|
391
|
-
var FloatingLayer =
|
|
392
|
-
const [opener] =
|
|
520
|
+
var FloatingLayer = React3.forwardRef(({ children }, ref) => {
|
|
521
|
+
const [opener] = React3.useState(
|
|
393
522
|
() => typeof document === "undefined" ? null : document.activeElement
|
|
394
523
|
);
|
|
395
524
|
const returnFocus = (event) => {
|
|
@@ -423,11 +552,11 @@ var FloatingLayer = React2.forwardRef(({ children }, ref) => {
|
|
|
423
552
|
FloatingLayer.displayName = "FloatingLayer";
|
|
424
553
|
|
|
425
554
|
// src/radix-dialog-modal-context.tsx
|
|
426
|
-
import * as
|
|
555
|
+
import * as React4 from "react";
|
|
427
556
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
428
557
|
var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-modal-context");
|
|
429
558
|
var contextRegistry = globalThis;
|
|
430
|
-
var RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??=
|
|
559
|
+
var RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??= React4.createContext(true);
|
|
431
560
|
function RadixDialogModalProvider({
|
|
432
561
|
children,
|
|
433
562
|
modal
|
|
@@ -435,13 +564,13 @@ function RadixDialogModalProvider({
|
|
|
435
564
|
return /* @__PURE__ */ jsx5(RadixDialogModalContext.Provider, { value: modal, children });
|
|
436
565
|
}
|
|
437
566
|
function useRadixDialogModal() {
|
|
438
|
-
return
|
|
567
|
+
return React4.useContext(RadixDialogModalContext);
|
|
439
568
|
}
|
|
440
569
|
|
|
441
570
|
// src/drawer.tsx
|
|
442
571
|
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
443
|
-
var DrawerDirectionContext =
|
|
444
|
-
var useDrawerDirection = () =>
|
|
572
|
+
var DrawerDirectionContext = React5.createContext("bottom");
|
|
573
|
+
var useDrawerDirection = () => React5.useContext(DrawerDirectionContext);
|
|
445
574
|
var Drawer = ({
|
|
446
575
|
children,
|
|
447
576
|
shouldScaleBackground = true,
|
|
@@ -471,7 +600,7 @@ Drawer.displayName = "Drawer";
|
|
|
471
600
|
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
472
601
|
var DrawerPortal = DrawerPrimitive.Portal;
|
|
473
602
|
var DrawerClose = DrawerPrimitive.Close;
|
|
474
|
-
var DrawerOverlay =
|
|
603
|
+
var DrawerOverlay = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
475
604
|
DrawerPrimitive.Overlay,
|
|
476
605
|
{
|
|
477
606
|
ref,
|
|
@@ -484,7 +613,7 @@ var DrawerOverlay = React4.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
484
613
|
}
|
|
485
614
|
));
|
|
486
615
|
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
487
|
-
var DrawerDescription =
|
|
616
|
+
var DrawerDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
488
617
|
DrawerPrimitive.Description,
|
|
489
618
|
{
|
|
490
619
|
ref,
|
|
@@ -494,7 +623,7 @@ var DrawerDescription = React4.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
494
623
|
}
|
|
495
624
|
));
|
|
496
625
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
497
|
-
var DrawerContentPrimitive =
|
|
626
|
+
var DrawerContentPrimitive = React5.forwardRef(({ onInteractOutside, ...props }, ref) => {
|
|
498
627
|
useModalLayer(true);
|
|
499
628
|
return /* @__PURE__ */ jsx6(
|
|
500
629
|
DrawerPrimitive.Content,
|
|
@@ -520,7 +649,7 @@ var SIZE_CLASSES = {
|
|
|
520
649
|
left: { adaptive: "w-auto max-w-[92vw]", full: "h-dvh w-[92vw] max-w-sm" },
|
|
521
650
|
right: { adaptive: "w-auto max-w-[92vw]", full: "h-dvh w-[92vw] max-w-sm" }
|
|
522
651
|
};
|
|
523
|
-
var DrawerContent =
|
|
652
|
+
var DrawerContent = React5.forwardRef(({ className, children, size = "adaptive", showHandle, ...props }, ref) => {
|
|
524
653
|
const direction = useDrawerDirection();
|
|
525
654
|
const hasDescription = treeContainsComponent(children, DrawerDescription) || treeContainsComponent(children, DrawerPrimitive.Description);
|
|
526
655
|
const withHandle = showHandle ?? (direction === "bottom" || direction === "top");
|
|
@@ -602,7 +731,7 @@ var DrawerFooter = ({
|
|
|
602
731
|
}
|
|
603
732
|
);
|
|
604
733
|
DrawerFooter.displayName = "DrawerFooter";
|
|
605
|
-
var DrawerTitle =
|
|
734
|
+
var DrawerTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
606
735
|
DrawerPrimitive.Title,
|
|
607
736
|
{
|
|
608
737
|
ref,
|
|
@@ -724,14 +853,14 @@ function BottomSheetFooter({
|
|
|
724
853
|
|
|
725
854
|
// src/alert.tsx
|
|
726
855
|
import { cva as cva2 } from "class-variance-authority";
|
|
727
|
-
import * as
|
|
856
|
+
import * as React7 from "react";
|
|
728
857
|
|
|
729
858
|
// src/error-box.tsx
|
|
730
|
-
import * as
|
|
859
|
+
import * as React6 from "react";
|
|
731
860
|
import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
732
861
|
var CONTEXT_KEY = /* @__PURE__ */ Symbol.for("@ai-matrx/design-system/error-actions");
|
|
733
862
|
var registry2 = globalThis;
|
|
734
|
-
var ErrorActionsContext = registry2[CONTEXT_KEY] ?? (registry2[CONTEXT_KEY] =
|
|
863
|
+
var ErrorActionsContext = registry2[CONTEXT_KEY] ?? (registry2[CONTEXT_KEY] = React6.createContext(null));
|
|
735
864
|
function ErrorActionsProvider({
|
|
736
865
|
render,
|
|
737
866
|
children
|
|
@@ -739,14 +868,14 @@ function ErrorActionsProvider({
|
|
|
739
868
|
return /* @__PURE__ */ jsx8(ErrorActionsContext.Provider, { value: render, children });
|
|
740
869
|
}
|
|
741
870
|
function useErrorActions() {
|
|
742
|
-
return
|
|
871
|
+
return React6.useContext(ErrorActionsContext);
|
|
743
872
|
}
|
|
744
873
|
function ErrorActions(props) {
|
|
745
874
|
const render = useErrorActions();
|
|
746
875
|
if (!render) return null;
|
|
747
876
|
return /* @__PURE__ */ jsx8(Fragment, { children: render(props) });
|
|
748
877
|
}
|
|
749
|
-
var ErrorBox =
|
|
878
|
+
var ErrorBox = React6.forwardRef(function ErrorBox2({
|
|
750
879
|
as = "p",
|
|
751
880
|
message,
|
|
752
881
|
title,
|
|
@@ -793,7 +922,7 @@ var alertVariants = cva2(
|
|
|
793
922
|
}
|
|
794
923
|
}
|
|
795
924
|
);
|
|
796
|
-
var Alert =
|
|
925
|
+
var Alert = React7.forwardRef(
|
|
797
926
|
({ className, variant, children, errorFacts, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
798
927
|
"div",
|
|
799
928
|
{
|
|
@@ -811,7 +940,7 @@ var Alert = React6.forwardRef(
|
|
|
811
940
|
)
|
|
812
941
|
);
|
|
813
942
|
Alert.displayName = "Alert";
|
|
814
|
-
var AlertTitle =
|
|
943
|
+
var AlertTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
815
944
|
"h5",
|
|
816
945
|
{
|
|
817
946
|
ref,
|
|
@@ -821,7 +950,7 @@ var AlertTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
821
950
|
}
|
|
822
951
|
));
|
|
823
952
|
AlertTitle.displayName = "AlertTitle";
|
|
824
|
-
var AlertDescription =
|
|
953
|
+
var AlertDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
825
954
|
"div",
|
|
826
955
|
{
|
|
827
956
|
ref,
|
|
@@ -835,12 +964,12 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
835
964
|
// src/alert-dialog.tsx
|
|
836
965
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
837
966
|
import { treeContainsComponent as treeContainsComponent2 } from "@ai-matrx/kit/react-tree";
|
|
838
|
-
import * as
|
|
967
|
+
import * as React10 from "react";
|
|
839
968
|
|
|
840
969
|
// src/button.tsx
|
|
841
970
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
842
971
|
import { cva as cva3 } from "class-variance-authority";
|
|
843
|
-
import * as
|
|
972
|
+
import * as React8 from "react";
|
|
844
973
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
845
974
|
var buttonVariants = cva3(
|
|
846
975
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -908,7 +1037,7 @@ function swallowClick(event) {
|
|
|
908
1037
|
event.preventDefault();
|
|
909
1038
|
event.stopPropagation();
|
|
910
1039
|
}
|
|
911
|
-
var Button =
|
|
1040
|
+
var Button = React8.forwardRef(
|
|
912
1041
|
({ className, variant, size, asChild = false, onClick, ...props }, ref) => {
|
|
913
1042
|
const Component = asChild ? Slot2 : "button";
|
|
914
1043
|
const resolvedSize = size ?? "default";
|
|
@@ -975,11 +1104,11 @@ var FORBIDDEN_HOST_MOTION_UTILITIES = [
|
|
|
975
1104
|
];
|
|
976
1105
|
|
|
977
1106
|
// src/portal-container.tsx
|
|
978
|
-
import * as
|
|
1107
|
+
import * as React9 from "react";
|
|
979
1108
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
980
1109
|
var CONTEXT_SLOT2 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
|
|
981
1110
|
var contextRegistry2 = globalThis;
|
|
982
|
-
var PortalContainerContext = contextRegistry2[CONTEXT_SLOT2] ??=
|
|
1111
|
+
var PortalContainerContext = contextRegistry2[CONTEXT_SLOT2] ??= React9.createContext(void 0);
|
|
983
1112
|
function PortalContainerProvider({
|
|
984
1113
|
container,
|
|
985
1114
|
children
|
|
@@ -987,7 +1116,7 @@ function PortalContainerProvider({
|
|
|
987
1116
|
return /* @__PURE__ */ jsx11(PortalContainerContext.Provider, { value: container ?? void 0, children });
|
|
988
1117
|
}
|
|
989
1118
|
function usePortalContainer(explicit) {
|
|
990
|
-
const injected =
|
|
1119
|
+
const injected = React9.useContext(PortalContainerContext);
|
|
991
1120
|
if (explicit !== void 0) {
|
|
992
1121
|
return explicit ?? void 0;
|
|
993
1122
|
}
|
|
@@ -1006,7 +1135,7 @@ var AlertDialogPortal = ({
|
|
|
1006
1135
|
return /* @__PURE__ */ jsx12(AlertDialogPrimitive.Portal, { container: resolved ?? null, ...props });
|
|
1007
1136
|
};
|
|
1008
1137
|
AlertDialogPortal.displayName = "AlertDialogPortal";
|
|
1009
|
-
var AlertDialogOverlay =
|
|
1138
|
+
var AlertDialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1010
1139
|
AlertDialogPrimitive.Overlay,
|
|
1011
1140
|
{
|
|
1012
1141
|
ref,
|
|
@@ -1020,12 +1149,12 @@ var AlertDialogOverlay = React9.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1020
1149
|
}
|
|
1021
1150
|
));
|
|
1022
1151
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
1023
|
-
var AlertDialogContentPrimitive =
|
|
1152
|
+
var AlertDialogContentPrimitive = React10.forwardRef((props, ref) => {
|
|
1024
1153
|
useModalLayer(true);
|
|
1025
1154
|
return /* @__PURE__ */ jsx12(AlertDialogPrimitive.Content, { ...props, ref, "aria-modal": "true" });
|
|
1026
1155
|
});
|
|
1027
1156
|
AlertDialogContentPrimitive.displayName = "AlertDialogContentPrimitive";
|
|
1028
|
-
var AlertDialogDescription =
|
|
1157
|
+
var AlertDialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1029
1158
|
AlertDialogPrimitive.Description,
|
|
1030
1159
|
{
|
|
1031
1160
|
ref,
|
|
@@ -1035,7 +1164,7 @@ var AlertDialogDescription = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
1035
1164
|
}
|
|
1036
1165
|
));
|
|
1037
1166
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
1038
|
-
var AlertDialogContent =
|
|
1167
|
+
var AlertDialogContent = React10.forwardRef(({ className, children, container, animated = true, ...props }, ref) => {
|
|
1039
1168
|
const hasDescription = treeContainsComponent2(children, AlertDialogDescription) || treeContainsComponent2(children, AlertDialogPrimitive.Description);
|
|
1040
1169
|
return /* @__PURE__ */ jsxs7(AlertDialogPortal, { container, children: [
|
|
1041
1170
|
/* @__PURE__ */ jsx12(AlertDialogOverlay, {}),
|
|
@@ -1114,7 +1243,7 @@ var AlertDialogFooter = ({
|
|
|
1114
1243
|
}
|
|
1115
1244
|
);
|
|
1116
1245
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
1117
|
-
var AlertDialogTitle =
|
|
1246
|
+
var AlertDialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1118
1247
|
AlertDialogPrimitive.Title,
|
|
1119
1248
|
{
|
|
1120
1249
|
ref,
|
|
@@ -1124,7 +1253,7 @@ var AlertDialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1124
1253
|
}
|
|
1125
1254
|
));
|
|
1126
1255
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
1127
|
-
var AlertDialogAction =
|
|
1256
|
+
var AlertDialogAction = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1128
1257
|
AlertDialogPrimitive.Action,
|
|
1129
1258
|
{
|
|
1130
1259
|
ref,
|
|
@@ -1134,7 +1263,7 @@ var AlertDialogAction = React9.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1134
1263
|
}
|
|
1135
1264
|
));
|
|
1136
1265
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
1137
|
-
var AlertDialogCancel =
|
|
1266
|
+
var AlertDialogCancel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1138
1267
|
AlertDialogPrimitive.Cancel,
|
|
1139
1268
|
{
|
|
1140
1269
|
ref,
|
|
@@ -1200,14 +1329,14 @@ function DragCursorMonitor({
|
|
|
1200
1329
|
|
|
1201
1330
|
// src/avatar.tsx
|
|
1202
1331
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
1203
|
-
import * as
|
|
1332
|
+
import * as React11 from "react";
|
|
1204
1333
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1205
1334
|
var AVATAR_SIZES = {
|
|
1206
1335
|
sm: "h-8 w-8 text-[11px]",
|
|
1207
1336
|
md: "h-9 w-9 text-xs",
|
|
1208
1337
|
lg: "h-10 w-10 text-sm"
|
|
1209
1338
|
};
|
|
1210
|
-
var Avatar =
|
|
1339
|
+
var Avatar = React11.forwardRef(({ className, size = "lg", ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1211
1340
|
AvatarPrimitive.Root,
|
|
1212
1341
|
{
|
|
1213
1342
|
ref,
|
|
@@ -1221,7 +1350,7 @@ var Avatar = React10.forwardRef(({ className, size = "lg", ...props }, ref) => /
|
|
|
1221
1350
|
}
|
|
1222
1351
|
));
|
|
1223
1352
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
1224
|
-
var AvatarImage =
|
|
1353
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1225
1354
|
AvatarPrimitive.Image,
|
|
1226
1355
|
{
|
|
1227
1356
|
ref,
|
|
@@ -1231,7 +1360,7 @@ var AvatarImage = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1231
1360
|
}
|
|
1232
1361
|
));
|
|
1233
1362
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
1234
|
-
var AvatarFallback =
|
|
1363
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1235
1364
|
AvatarPrimitive.Fallback,
|
|
1236
1365
|
{
|
|
1237
1366
|
ref,
|
|
@@ -1246,7 +1375,7 @@ var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1246
1375
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
1247
1376
|
|
|
1248
1377
|
// src/card.tsx
|
|
1249
|
-
import * as
|
|
1378
|
+
import * as React12 from "react";
|
|
1250
1379
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1251
1380
|
var CARD_SIZES = {
|
|
1252
1381
|
sm: {
|
|
@@ -1265,11 +1394,11 @@ var CARD_SIZES = {
|
|
|
1265
1394
|
padTopless: "p-6 pt-0"
|
|
1266
1395
|
}
|
|
1267
1396
|
};
|
|
1268
|
-
var CardSizeContext =
|
|
1397
|
+
var CardSizeContext = React12.createContext("md");
|
|
1269
1398
|
function useCardSize() {
|
|
1270
|
-
return
|
|
1399
|
+
return React12.useContext(CardSizeContext);
|
|
1271
1400
|
}
|
|
1272
|
-
var Card =
|
|
1401
|
+
var Card = React12.forwardRef(
|
|
1273
1402
|
({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx14(CardSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx14(
|
|
1274
1403
|
"div",
|
|
1275
1404
|
{
|
|
@@ -1282,7 +1411,7 @@ var Card = React11.forwardRef(
|
|
|
1282
1411
|
) })
|
|
1283
1412
|
);
|
|
1284
1413
|
Card.displayName = "Card";
|
|
1285
|
-
var CardHeader =
|
|
1414
|
+
var CardHeader = React12.forwardRef(({ className, ...props }, ref) => {
|
|
1286
1415
|
const size = useCardSize();
|
|
1287
1416
|
return /* @__PURE__ */ jsx14(
|
|
1288
1417
|
"div",
|
|
@@ -1299,7 +1428,7 @@ var CardHeader = React11.forwardRef(({ className, ...props }, ref) => {
|
|
|
1299
1428
|
);
|
|
1300
1429
|
});
|
|
1301
1430
|
CardHeader.displayName = "CardHeader";
|
|
1302
|
-
var CardTitle =
|
|
1431
|
+
var CardTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1303
1432
|
"h3",
|
|
1304
1433
|
{
|
|
1305
1434
|
ref,
|
|
@@ -1309,7 +1438,7 @@ var CardTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1309
1438
|
}
|
|
1310
1439
|
));
|
|
1311
1440
|
CardTitle.displayName = "CardTitle";
|
|
1312
|
-
var CardDescription =
|
|
1441
|
+
var CardDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1313
1442
|
"p",
|
|
1314
1443
|
{
|
|
1315
1444
|
ref,
|
|
@@ -1319,7 +1448,7 @@ var CardDescription = React11.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1319
1448
|
}
|
|
1320
1449
|
));
|
|
1321
1450
|
CardDescription.displayName = "CardDescription";
|
|
1322
|
-
var CardAction =
|
|
1451
|
+
var CardAction = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1323
1452
|
"div",
|
|
1324
1453
|
{
|
|
1325
1454
|
ref,
|
|
@@ -1329,7 +1458,7 @@ var CardAction = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1329
1458
|
}
|
|
1330
1459
|
));
|
|
1331
1460
|
CardAction.displayName = "CardAction";
|
|
1332
|
-
var CardContent =
|
|
1461
|
+
var CardContent = React12.forwardRef(({ className, ...props }, ref) => {
|
|
1333
1462
|
const size = useCardSize();
|
|
1334
1463
|
return /* @__PURE__ */ jsx14(
|
|
1335
1464
|
"div",
|
|
@@ -1342,7 +1471,7 @@ var CardContent = React11.forwardRef(({ className, ...props }, ref) => {
|
|
|
1342
1471
|
);
|
|
1343
1472
|
});
|
|
1344
1473
|
CardContent.displayName = "CardContent";
|
|
1345
|
-
var CardFooter =
|
|
1474
|
+
var CardFooter = React12.forwardRef(({ className, ...props }, ref) => {
|
|
1346
1475
|
const size = useCardSize();
|
|
1347
1476
|
return /* @__PURE__ */ jsx14(
|
|
1348
1477
|
"div",
|
|
@@ -1362,13 +1491,13 @@ CardFooter.displayName = "CardFooter";
|
|
|
1362
1491
|
|
|
1363
1492
|
// src/checkbox.tsx
|
|
1364
1493
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1365
|
-
import * as
|
|
1494
|
+
import * as React13 from "react";
|
|
1366
1495
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1367
1496
|
var CHECKBOX_SIZES = {
|
|
1368
1497
|
sm: { root: "h-3.5 w-3.5 rounded-xs", glyph: "h-3 w-3" },
|
|
1369
1498
|
md: { root: "h-4 w-4 rounded-sm", glyph: "h-3.5 w-3.5" }
|
|
1370
1499
|
};
|
|
1371
|
-
var Checkbox =
|
|
1500
|
+
var Checkbox = React13.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1372
1501
|
CheckboxPrimitive.Root,
|
|
1373
1502
|
{
|
|
1374
1503
|
ref,
|
|
@@ -1393,11 +1522,11 @@ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
|
1393
1522
|
|
|
1394
1523
|
// src/collapsible.tsx
|
|
1395
1524
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1396
|
-
import * as
|
|
1525
|
+
import * as React14 from "react";
|
|
1397
1526
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1398
1527
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
1399
1528
|
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
1400
|
-
var CollapsibleContent2 =
|
|
1529
|
+
var CollapsibleContent2 = React14.forwardRef(({ className, animated = true, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1401
1530
|
CollapsiblePrimitive.CollapsibleContent,
|
|
1402
1531
|
{
|
|
1403
1532
|
ref,
|
|
@@ -1414,14 +1543,14 @@ CollapsibleContent2.displayName = "CollapsibleContent";
|
|
|
1414
1543
|
// src/command.tsx
|
|
1415
1544
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1416
1545
|
import { Command as CommandPrimitive } from "cmdk";
|
|
1417
|
-
import * as
|
|
1546
|
+
import * as React15 from "react";
|
|
1418
1547
|
|
|
1419
1548
|
// src/use-is-mobile.ts
|
|
1420
1549
|
import { MOBILE_BREAKPOINT, useIsMobile } from "@ai-matrx/kit/media-query";
|
|
1421
1550
|
|
|
1422
1551
|
// src/command.tsx
|
|
1423
1552
|
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1424
|
-
var Command =
|
|
1553
|
+
var Command = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1425
1554
|
CommandPrimitive,
|
|
1426
1555
|
{
|
|
1427
1556
|
ref,
|
|
@@ -1436,7 +1565,7 @@ Command.displayName = CommandPrimitive.displayName;
|
|
|
1436
1565
|
var DIALOG_DESKTOP_CLASSES = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
|
|
1437
1566
|
var DIALOG_MOBILE_SHEET_CLASSES = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
1438
1567
|
var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
1439
|
-
var CommandDialogContent =
|
|
1568
|
+
var CommandDialogContent = React15.forwardRef(({ className, children, container, onInteractOutside, ...props }, ref) => {
|
|
1440
1569
|
const isMobile = useIsMobile();
|
|
1441
1570
|
const isModal = useRadixDialogModal();
|
|
1442
1571
|
useModalLayer(isModal);
|
|
@@ -1496,7 +1625,7 @@ var CommandDialog = ({
|
|
|
1496
1625
|
}
|
|
1497
1626
|
) }) });
|
|
1498
1627
|
};
|
|
1499
|
-
var CommandInput =
|
|
1628
|
+
var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
1500
1629
|
/* @__PURE__ */ jsx17(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
1501
1630
|
/* @__PURE__ */ jsx17(
|
|
1502
1631
|
CommandPrimitive.Input,
|
|
@@ -1511,7 +1640,7 @@ var CommandInput = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1511
1640
|
)
|
|
1512
1641
|
] }));
|
|
1513
1642
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
1514
|
-
var CommandList =
|
|
1643
|
+
var CommandList = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1515
1644
|
CommandPrimitive.List,
|
|
1516
1645
|
{
|
|
1517
1646
|
ref,
|
|
@@ -1520,7 +1649,7 @@ var CommandList = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1520
1649
|
}
|
|
1521
1650
|
));
|
|
1522
1651
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
1523
|
-
var CommandEmpty =
|
|
1652
|
+
var CommandEmpty = React15.forwardRef((props, ref) => /* @__PURE__ */ jsx17(
|
|
1524
1653
|
CommandPrimitive.Empty,
|
|
1525
1654
|
{
|
|
1526
1655
|
ref,
|
|
@@ -1529,7 +1658,7 @@ var CommandEmpty = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx17(
|
|
|
1529
1658
|
}
|
|
1530
1659
|
));
|
|
1531
1660
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
1532
|
-
var CommandGroup =
|
|
1661
|
+
var CommandGroup = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1533
1662
|
CommandPrimitive.Group,
|
|
1534
1663
|
{
|
|
1535
1664
|
ref,
|
|
@@ -1541,7 +1670,7 @@ var CommandGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1541
1670
|
}
|
|
1542
1671
|
));
|
|
1543
1672
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
1544
|
-
var CommandSeparator =
|
|
1673
|
+
var CommandSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1545
1674
|
CommandPrimitive.Separator,
|
|
1546
1675
|
{
|
|
1547
1676
|
ref,
|
|
@@ -1550,7 +1679,7 @@ var CommandSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1550
1679
|
}
|
|
1551
1680
|
));
|
|
1552
1681
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
1553
|
-
var CommandItem =
|
|
1682
|
+
var CommandItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1554
1683
|
CommandPrimitive.Item,
|
|
1555
1684
|
{
|
|
1556
1685
|
ref,
|
|
@@ -1640,13 +1769,13 @@ function ConfirmDialog({
|
|
|
1640
1769
|
// src/confirm-host.tsx
|
|
1641
1770
|
import { confirmOpener } from "@ai-matrx/kit/confirm-opener";
|
|
1642
1771
|
import { useOpenerHost } from "@ai-matrx/kit/opener-react";
|
|
1643
|
-
import * as
|
|
1772
|
+
import * as React16 from "react";
|
|
1644
1773
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1645
1774
|
function ConfirmDialogHost() {
|
|
1646
1775
|
const { shown, open, settle } = useOpenerHost(confirmOpener);
|
|
1647
|
-
const [readyFor, setReadyFor] =
|
|
1776
|
+
const [readyFor, setReadyFor] = React16.useState(null);
|
|
1648
1777
|
const ready = shown?.ready;
|
|
1649
|
-
|
|
1778
|
+
React16.useEffect(() => {
|
|
1650
1779
|
if (!shown || !ready) return void 0;
|
|
1651
1780
|
let live = true;
|
|
1652
1781
|
const release = () => {
|
|
@@ -1658,8 +1787,8 @@ function ConfirmDialogHost() {
|
|
|
1658
1787
|
};
|
|
1659
1788
|
}, [shown, ready]);
|
|
1660
1789
|
const held = !!ready && readyFor !== shown;
|
|
1661
|
-
const handleConfirm =
|
|
1662
|
-
const handleOpenChange =
|
|
1790
|
+
const handleConfirm = React16.useCallback(() => settle(true), [settle]);
|
|
1791
|
+
const handleOpenChange = React16.useCallback(
|
|
1663
1792
|
(next) => {
|
|
1664
1793
|
if (!next) settle(false);
|
|
1665
1794
|
},
|
|
@@ -1683,10 +1812,10 @@ function ConfirmDialogHost() {
|
|
|
1683
1812
|
|
|
1684
1813
|
// src/context-menu.tsx
|
|
1685
1814
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1686
|
-
import * as
|
|
1815
|
+
import * as React19 from "react";
|
|
1687
1816
|
|
|
1688
1817
|
// src/menu-scroll-edges.tsx
|
|
1689
|
-
import * as
|
|
1818
|
+
import * as React17 from "react";
|
|
1690
1819
|
|
|
1691
1820
|
// src/use-scroll-fade.ts
|
|
1692
1821
|
import { useCallback as useCallback2, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
|
@@ -1755,13 +1884,13 @@ function composeRefs(...refs) {
|
|
|
1755
1884
|
};
|
|
1756
1885
|
}
|
|
1757
1886
|
function MenuScrollEdge({ side, scroller }) {
|
|
1758
|
-
const frame =
|
|
1887
|
+
const frame = React17.useRef(null);
|
|
1759
1888
|
const dir = side === "top" ? -1 : 1;
|
|
1760
|
-
const stop =
|
|
1889
|
+
const stop = React17.useCallback(() => {
|
|
1761
1890
|
if (frame.current !== null) cancelAnimationFrame(frame.current);
|
|
1762
1891
|
frame.current = null;
|
|
1763
1892
|
}, []);
|
|
1764
|
-
const glide =
|
|
1893
|
+
const glide = React17.useCallback(() => {
|
|
1765
1894
|
stop();
|
|
1766
1895
|
let last = performance.now();
|
|
1767
1896
|
const step = (now) => {
|
|
@@ -1773,7 +1902,7 @@ function MenuScrollEdge({ side, scroller }) {
|
|
|
1773
1902
|
};
|
|
1774
1903
|
frame.current = requestAnimationFrame(step);
|
|
1775
1904
|
}, [dir, scroller, stop]);
|
|
1776
|
-
|
|
1905
|
+
React17.useEffect(() => stop, [stop]);
|
|
1777
1906
|
return /* @__PURE__ */ jsx20("div", { "aria-hidden": true, "data-menu-scroll-edge": side, className: "matrx-menu-scroll-edge", children: /* @__PURE__ */ jsx20("div", { className: "matrx-menu-scroll-fade", children: /* @__PURE__ */ jsx20(
|
|
1778
1907
|
"div",
|
|
1779
1908
|
{
|
|
@@ -1795,8 +1924,8 @@ function MenuScrollEdge({ side, scroller }) {
|
|
|
1795
1924
|
}
|
|
1796
1925
|
function useMenuScrollEdges(...forwarded) {
|
|
1797
1926
|
const fade = useScrollFade();
|
|
1798
|
-
const scroller =
|
|
1799
|
-
const ref =
|
|
1927
|
+
const scroller = React17.useRef(null);
|
|
1928
|
+
const ref = React17.useCallback(composeRefs(scroller, fade.ref, ...forwarded), [
|
|
1800
1929
|
fade.ref,
|
|
1801
1930
|
...forwarded
|
|
1802
1931
|
]);
|
|
@@ -1809,10 +1938,10 @@ function useMenuScrollEdges(...forwarded) {
|
|
|
1809
1938
|
}
|
|
1810
1939
|
|
|
1811
1940
|
// src/submenu-focus.ts
|
|
1812
|
-
import * as
|
|
1941
|
+
import * as React18 from "react";
|
|
1813
1942
|
function useSubmenuSurvivesParentPanelFocus(forwardedRef, onFocusOutside) {
|
|
1814
|
-
const content =
|
|
1815
|
-
const ref =
|
|
1943
|
+
const content = React18.useRef(null);
|
|
1944
|
+
const ref = React18.useCallback(
|
|
1816
1945
|
(node) => {
|
|
1817
1946
|
content.current = node;
|
|
1818
1947
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -1843,7 +1972,7 @@ var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
|
1843
1972
|
var SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
|
|
1844
1973
|
var ITEM_CLASS = "relative flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50";
|
|
1845
1974
|
var INDICATOR_ITEM_CLASS = "relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50";
|
|
1846
|
-
var ContextMenuSubTrigger =
|
|
1975
|
+
var ContextMenuSubTrigger = React19.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1847
1976
|
ContextMenuPrimitive.SubTrigger,
|
|
1848
1977
|
{
|
|
1849
1978
|
ref,
|
|
@@ -1861,7 +1990,7 @@ var ContextMenuSubTrigger = React18.forwardRef(({ className, inset, children, ..
|
|
|
1861
1990
|
}
|
|
1862
1991
|
));
|
|
1863
1992
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1864
|
-
var ContextMenuSubContent =
|
|
1993
|
+
var ContextMenuSubContent = React19.forwardRef(({ className, container, onFocusOutside, children, ...props }, ref) => {
|
|
1865
1994
|
const portalContainer = usePortalContainer(container);
|
|
1866
1995
|
const keep = useSubmenuSurvivesParentPanelFocus(ref, onFocusOutside);
|
|
1867
1996
|
const edges = useMenuScrollEdges(keep.ref);
|
|
@@ -1878,7 +2007,7 @@ var ContextMenuSubContent = React18.forwardRef(({ className, container, onFocusO
|
|
|
1878
2007
|
) });
|
|
1879
2008
|
});
|
|
1880
2009
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1881
|
-
var ContextMenuContent =
|
|
2010
|
+
var ContextMenuContent = React19.forwardRef(({ className, container, children, ...props }, ref) => {
|
|
1882
2011
|
const portalContainer = usePortalContainer(container);
|
|
1883
2012
|
const edges = useMenuScrollEdges(ref);
|
|
1884
2013
|
return /* @__PURE__ */ jsx21(ContextMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx21(
|
|
@@ -1893,7 +2022,7 @@ var ContextMenuContent = React18.forwardRef(({ className, container, children, .
|
|
|
1893
2022
|
) });
|
|
1894
2023
|
});
|
|
1895
2024
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1896
|
-
var ContextMenuItem =
|
|
2025
|
+
var ContextMenuItem = React19.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1897
2026
|
ContextMenuPrimitive.Item,
|
|
1898
2027
|
{
|
|
1899
2028
|
ref,
|
|
@@ -1908,7 +2037,7 @@ var ContextMenuItem = React18.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
1908
2037
|
}
|
|
1909
2038
|
));
|
|
1910
2039
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1911
|
-
var ContextMenuCheckboxItem =
|
|
2040
|
+
var ContextMenuCheckboxItem = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1912
2041
|
ContextMenuPrimitive.CheckboxItem,
|
|
1913
2042
|
{
|
|
1914
2043
|
ref,
|
|
@@ -1922,7 +2051,7 @@ var ContextMenuCheckboxItem = React18.forwardRef(({ className, children, ...prop
|
|
|
1922
2051
|
}
|
|
1923
2052
|
));
|
|
1924
2053
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1925
|
-
var ContextMenuRadioItem =
|
|
2054
|
+
var ContextMenuRadioItem = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1926
2055
|
ContextMenuPrimitive.RadioItem,
|
|
1927
2056
|
{
|
|
1928
2057
|
ref,
|
|
@@ -1936,7 +2065,7 @@ var ContextMenuRadioItem = React18.forwardRef(({ className, children, ...props }
|
|
|
1936
2065
|
}
|
|
1937
2066
|
));
|
|
1938
2067
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1939
|
-
var ContextMenuLabel =
|
|
2068
|
+
var ContextMenuLabel = React19.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1940
2069
|
ContextMenuPrimitive.Label,
|
|
1941
2070
|
{
|
|
1942
2071
|
ref,
|
|
@@ -1950,7 +2079,7 @@ var ContextMenuLabel = React18.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1950
2079
|
}
|
|
1951
2080
|
));
|
|
1952
2081
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1953
|
-
var ContextMenuSeparator =
|
|
2082
|
+
var ContextMenuSeparator = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1954
2083
|
ContextMenuPrimitive.Separator,
|
|
1955
2084
|
{
|
|
1956
2085
|
ref,
|
|
@@ -1976,7 +2105,7 @@ ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
|
1976
2105
|
// src/select.tsx
|
|
1977
2106
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1978
2107
|
import { cva as cva4 } from "class-variance-authority";
|
|
1979
|
-
import * as
|
|
2108
|
+
import * as React20 from "react";
|
|
1980
2109
|
|
|
1981
2110
|
// src/field-surface.ts
|
|
1982
2111
|
var FIELD_SURFACE_CLASS = "border border-border bg-card";
|
|
@@ -2011,7 +2140,7 @@ function SelectChevron({ className, size = "default" }) {
|
|
|
2011
2140
|
}
|
|
2012
2141
|
);
|
|
2013
2142
|
}
|
|
2014
|
-
var SelectTrigger =
|
|
2143
|
+
var SelectTrigger = React20.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ jsxs12(
|
|
2015
2144
|
SelectPrimitive.Trigger,
|
|
2016
2145
|
{
|
|
2017
2146
|
ref,
|
|
@@ -2024,7 +2153,7 @@ var SelectTrigger = React19.forwardRef(({ className, children, hideArrow = false
|
|
|
2024
2153
|
}
|
|
2025
2154
|
));
|
|
2026
2155
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2027
|
-
var SelectScrollUpButton =
|
|
2156
|
+
var SelectScrollUpButton = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2028
2157
|
SelectPrimitive.ScrollUpButton,
|
|
2029
2158
|
{
|
|
2030
2159
|
ref,
|
|
@@ -2037,7 +2166,7 @@ var SelectScrollUpButton = React19.forwardRef(({ className, ...props }, ref) =>
|
|
|
2037
2166
|
}
|
|
2038
2167
|
));
|
|
2039
2168
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2040
|
-
var SelectScrollDownButton =
|
|
2169
|
+
var SelectScrollDownButton = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2041
2170
|
SelectPrimitive.ScrollDownButton,
|
|
2042
2171
|
{
|
|
2043
2172
|
ref,
|
|
@@ -2050,7 +2179,7 @@ var SelectScrollDownButton = React19.forwardRef(({ className, ...props }, ref) =
|
|
|
2050
2179
|
}
|
|
2051
2180
|
));
|
|
2052
2181
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
2053
|
-
var SelectContent =
|
|
2182
|
+
var SelectContent = React20.forwardRef(
|
|
2054
2183
|
({
|
|
2055
2184
|
className,
|
|
2056
2185
|
children,
|
|
@@ -2096,7 +2225,7 @@ var SelectContent = React19.forwardRef(
|
|
|
2096
2225
|
}
|
|
2097
2226
|
);
|
|
2098
2227
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2099
|
-
var SelectLabel =
|
|
2228
|
+
var SelectLabel = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2100
2229
|
SelectPrimitive.Label,
|
|
2101
2230
|
{
|
|
2102
2231
|
ref,
|
|
@@ -2105,7 +2234,7 @@ var SelectLabel = React19.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2105
2234
|
}
|
|
2106
2235
|
));
|
|
2107
2236
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2108
|
-
var SelectItem =
|
|
2237
|
+
var SelectItem = React20.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ jsxs12(
|
|
2109
2238
|
SelectPrimitive.Item,
|
|
2110
2239
|
{
|
|
2111
2240
|
ref,
|
|
@@ -2123,7 +2252,7 @@ var SelectItem = React19.forwardRef(({ className, children, description, ...prop
|
|
|
2123
2252
|
}
|
|
2124
2253
|
));
|
|
2125
2254
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2126
|
-
var SelectSeparator =
|
|
2255
|
+
var SelectSeparator = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2127
2256
|
SelectPrimitive.Separator,
|
|
2128
2257
|
{
|
|
2129
2258
|
ref,
|
|
@@ -2141,12 +2270,12 @@ import {
|
|
|
2141
2270
|
|
|
2142
2271
|
// src/popover.tsx
|
|
2143
2272
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2144
|
-
import * as
|
|
2273
|
+
import * as React21 from "react";
|
|
2145
2274
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2146
2275
|
var Popover = PopoverPrimitive.Root;
|
|
2147
2276
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
2148
2277
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
2149
|
-
var PopoverContent =
|
|
2278
|
+
var PopoverContent = React21.forwardRef(
|
|
2150
2279
|
({
|
|
2151
2280
|
className,
|
|
2152
2281
|
align = "center",
|
|
@@ -2425,7 +2554,7 @@ function CreatablePicker({
|
|
|
2425
2554
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
2426
2555
|
import * as VisuallyHidden2 from "@radix-ui/react-visually-hidden";
|
|
2427
2556
|
import { treeContainsComponent as treeContainsComponent3 } from "@ai-matrx/kit/react-tree";
|
|
2428
|
-
import * as
|
|
2557
|
+
import * as React22 from "react";
|
|
2429
2558
|
|
|
2430
2559
|
// src/layer-front.ts
|
|
2431
2560
|
var LAYER_FRONT_EVENT = "matrx:layer-front";
|
|
@@ -2438,7 +2567,7 @@ function announceLayerFront(element) {
|
|
|
2438
2567
|
|
|
2439
2568
|
// src/dialog.tsx
|
|
2440
2569
|
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2441
|
-
var DialogWindowedByDefaultContext =
|
|
2570
|
+
var DialogWindowedByDefaultContext = React22.createContext(false);
|
|
2442
2571
|
var Dialog = ({
|
|
2443
2572
|
children,
|
|
2444
2573
|
...props
|
|
@@ -2460,9 +2589,9 @@ var DialogPortal = ({
|
|
|
2460
2589
|
DialogPortal.displayName = "DialogPortal";
|
|
2461
2590
|
var CONTEXT_SLOT3 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-container-context");
|
|
2462
2591
|
var contextRegistry3 = globalThis;
|
|
2463
|
-
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??=
|
|
2464
|
-
var useDialogContainer = () =>
|
|
2465
|
-
var DialogOverlay =
|
|
2592
|
+
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??= React22.createContext(null);
|
|
2593
|
+
var useDialogContainer = () => React22.useContext(DialogContainerContext);
|
|
2594
|
+
var DialogOverlay = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2466
2595
|
DialogPrimitive2.Overlay,
|
|
2467
2596
|
{
|
|
2468
2597
|
ref,
|
|
@@ -2478,7 +2607,7 @@ var DialogOverlay = React21.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2478
2607
|
}
|
|
2479
2608
|
));
|
|
2480
2609
|
DialogOverlay.displayName = DialogPrimitive2.Overlay.displayName;
|
|
2481
|
-
var DialogContentPrimitive =
|
|
2610
|
+
var DialogContentPrimitive = React22.forwardRef(({ onInteractOutside, ...props }, ref) => {
|
|
2482
2611
|
const isModal = useRadixDialogModal();
|
|
2483
2612
|
useModalLayer(isModal);
|
|
2484
2613
|
return /* @__PURE__ */ jsx25(
|
|
@@ -2495,12 +2624,12 @@ DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
|
2495
2624
|
var DIALOG_DESKTOP_CLASSES2 = "matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg";
|
|
2496
2625
|
var DIALOG_MOBILE_SHEET_CLASSES2 = "matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
2497
2626
|
var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
2498
|
-
var DialogWindowHandleContext =
|
|
2627
|
+
var DialogWindowHandleContext = React22.createContext(null);
|
|
2499
2628
|
var WINDOW_KEEP_VISIBLE = 80;
|
|
2500
2629
|
function isInteractiveTarget(target) {
|
|
2501
2630
|
return target instanceof Element && Boolean(target.closest("button, a, input, textarea, select, [role='button'], [contenteditable='true']"));
|
|
2502
2631
|
}
|
|
2503
|
-
var DialogContent =
|
|
2632
|
+
var DialogContent = React22.forwardRef(
|
|
2504
2633
|
({
|
|
2505
2634
|
className,
|
|
2506
2635
|
children,
|
|
@@ -2521,13 +2650,13 @@ var DialogContent = React21.forwardRef(
|
|
|
2521
2650
|
const injectedContainer = usePortalContainer(container);
|
|
2522
2651
|
const asSheet = mobileSheet && isMobile;
|
|
2523
2652
|
const windowed = !isModal && !asSheet;
|
|
2524
|
-
const windowedByDefault =
|
|
2525
|
-
const [containerEl, setContainerEl] =
|
|
2653
|
+
const windowedByDefault = React22.useContext(DialogWindowedByDefaultContext);
|
|
2654
|
+
const [containerEl, setContainerEl] = React22.useState(
|
|
2526
2655
|
null
|
|
2527
2656
|
);
|
|
2528
2657
|
const stacks = windowed && windowedByDefault;
|
|
2529
|
-
const [behind, setBehind] =
|
|
2530
|
-
|
|
2658
|
+
const [behind, setBehind] = React22.useState(false);
|
|
2659
|
+
React22.useEffect(() => {
|
|
2531
2660
|
if (!stacks || !containerEl) return;
|
|
2532
2661
|
const onFront = (event) => {
|
|
2533
2662
|
const element = event.detail?.element ?? null;
|
|
@@ -2543,9 +2672,9 @@ var DialogContent = React21.forwardRef(
|
|
|
2543
2672
|
setBehind(false);
|
|
2544
2673
|
announceLayerFront(containerEl);
|
|
2545
2674
|
};
|
|
2546
|
-
const [offset, setOffset] =
|
|
2547
|
-
const dragRef =
|
|
2548
|
-
const handle =
|
|
2675
|
+
const [offset, setOffset] = React22.useState({ x: 0, y: 0 });
|
|
2676
|
+
const dragRef = React22.useRef(null);
|
|
2677
|
+
const handle = React22.useMemo(() => {
|
|
2549
2678
|
if (!windowed) return null;
|
|
2550
2679
|
const clamp = (value, limit) => Math.max(-limit, Math.min(limit, value));
|
|
2551
2680
|
return {
|
|
@@ -2573,7 +2702,7 @@ var DialogContent = React21.forwardRef(
|
|
|
2573
2702
|
onDoubleClick: () => setOffset({ x: 0, y: 0 })
|
|
2574
2703
|
};
|
|
2575
2704
|
}, [windowed, offset.x, offset.y]);
|
|
2576
|
-
const mergedRef =
|
|
2705
|
+
const mergedRef = React22.useCallback(
|
|
2577
2706
|
(node) => {
|
|
2578
2707
|
setContainerEl(node);
|
|
2579
2708
|
if (typeof ref === "function") ref(node);
|
|
@@ -2660,7 +2789,7 @@ var DialogHeader = ({
|
|
|
2660
2789
|
className,
|
|
2661
2790
|
...props
|
|
2662
2791
|
}) => {
|
|
2663
|
-
const handle =
|
|
2792
|
+
const handle = React22.useContext(DialogWindowHandleContext);
|
|
2664
2793
|
return /* @__PURE__ */ jsx25(
|
|
2665
2794
|
"div",
|
|
2666
2795
|
{
|
|
@@ -2717,7 +2846,7 @@ var DialogFooter = ({
|
|
|
2717
2846
|
}
|
|
2718
2847
|
);
|
|
2719
2848
|
DialogFooter.displayName = "DialogFooter";
|
|
2720
|
-
var DialogTitle =
|
|
2849
|
+
var DialogTitle = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2721
2850
|
DialogPrimitive2.Title,
|
|
2722
2851
|
{
|
|
2723
2852
|
ref,
|
|
@@ -2727,7 +2856,7 @@ var DialogTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2727
2856
|
}
|
|
2728
2857
|
));
|
|
2729
2858
|
DialogTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
2730
|
-
var DialogDescription =
|
|
2859
|
+
var DialogDescription = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2731
2860
|
DialogPrimitive2.Description,
|
|
2732
2861
|
{
|
|
2733
2862
|
ref,
|
|
@@ -2740,7 +2869,7 @@ DialogDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
|
2740
2869
|
|
|
2741
2870
|
// src/dropdown-menu.tsx
|
|
2742
2871
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2743
|
-
import * as
|
|
2872
|
+
import * as React23 from "react";
|
|
2744
2873
|
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2745
2874
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2746
2875
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
@@ -2751,7 +2880,7 @@ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
|
2751
2880
|
var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
|
|
2752
2881
|
var MENU_ITEM_CLASS = "relative flex select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50";
|
|
2753
2882
|
var MENU_INDICATOR_ITEM_CLASS = "relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50";
|
|
2754
|
-
var DropdownMenuSubTrigger =
|
|
2883
|
+
var DropdownMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2755
2884
|
DropdownMenuPrimitive.SubTrigger,
|
|
2756
2885
|
{
|
|
2757
2886
|
ref,
|
|
@@ -2769,7 +2898,7 @@ var DropdownMenuSubTrigger = React22.forwardRef(({ className, inset, children, .
|
|
|
2769
2898
|
}
|
|
2770
2899
|
));
|
|
2771
2900
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
2772
|
-
var DropdownMenuSubContent =
|
|
2901
|
+
var DropdownMenuSubContent = React23.forwardRef(({ className, container, sideOffset = 2, alignOffset = -4, collisionPadding = 8, onFocusOutside, children, ...props }, ref) => {
|
|
2773
2902
|
const portalContainer = usePortalContainer(container);
|
|
2774
2903
|
const keep = useSubmenuSurvivesParentPanelFocus(ref, onFocusOutside);
|
|
2775
2904
|
const edges = useMenuScrollEdges(keep.ref);
|
|
@@ -2789,7 +2918,7 @@ var DropdownMenuSubContent = React22.forwardRef(({ className, container, sideOff
|
|
|
2789
2918
|
) });
|
|
2790
2919
|
});
|
|
2791
2920
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
2792
|
-
var DropdownMenuContent =
|
|
2921
|
+
var DropdownMenuContent = React23.forwardRef(({ className, sideOffset = 4, container, children, ...props }, ref) => {
|
|
2793
2922
|
const portalContainer = usePortalContainer(container);
|
|
2794
2923
|
const edges = useMenuScrollEdges(ref);
|
|
2795
2924
|
return /* @__PURE__ */ jsx26(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx26(
|
|
@@ -2811,7 +2940,7 @@ var DropdownMenuContent = React22.forwardRef(({ className, sideOffset = 4, conta
|
|
|
2811
2940
|
) });
|
|
2812
2941
|
});
|
|
2813
2942
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
2814
|
-
var DropdownMenuItem =
|
|
2943
|
+
var DropdownMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
2815
2944
|
DropdownMenuPrimitive.Item,
|
|
2816
2945
|
{
|
|
2817
2946
|
ref,
|
|
@@ -2821,7 +2950,7 @@ var DropdownMenuItem = React22.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2821
2950
|
}
|
|
2822
2951
|
));
|
|
2823
2952
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2824
|
-
var DropdownMenuCheckboxItem =
|
|
2953
|
+
var DropdownMenuCheckboxItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2825
2954
|
DropdownMenuPrimitive.CheckboxItem,
|
|
2826
2955
|
{
|
|
2827
2956
|
ref,
|
|
@@ -2835,7 +2964,7 @@ var DropdownMenuCheckboxItem = React22.forwardRef(({ className, children, ...pro
|
|
|
2835
2964
|
}
|
|
2836
2965
|
));
|
|
2837
2966
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2838
|
-
var DropdownMenuRadioItem =
|
|
2967
|
+
var DropdownMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2839
2968
|
DropdownMenuPrimitive.RadioItem,
|
|
2840
2969
|
{
|
|
2841
2970
|
ref,
|
|
@@ -2849,7 +2978,7 @@ var DropdownMenuRadioItem = React22.forwardRef(({ className, children, ...props
|
|
|
2849
2978
|
}
|
|
2850
2979
|
));
|
|
2851
2980
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2852
|
-
var DropdownMenuLabel =
|
|
2981
|
+
var DropdownMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
2853
2982
|
DropdownMenuPrimitive.Label,
|
|
2854
2983
|
{
|
|
2855
2984
|
ref,
|
|
@@ -2859,7 +2988,7 @@ var DropdownMenuLabel = React22.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2859
2988
|
}
|
|
2860
2989
|
));
|
|
2861
2990
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2862
|
-
var DropdownMenuSeparator =
|
|
2991
|
+
var DropdownMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
2863
2992
|
DropdownMenuPrimitive.Separator,
|
|
2864
2993
|
{
|
|
2865
2994
|
ref,
|
|
@@ -3071,7 +3200,7 @@ function EditableLabel({
|
|
|
3071
3200
|
}
|
|
3072
3201
|
|
|
3073
3202
|
// src/input.tsx
|
|
3074
|
-
import * as
|
|
3203
|
+
import * as React24 from "react";
|
|
3075
3204
|
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3076
3205
|
var getVariantStyles = (variant = "default") => {
|
|
3077
3206
|
const baseStyles = `flex h-10 w-full ${FIELD_SURFACE_CLASS} text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
|
|
@@ -3100,7 +3229,7 @@ var getVariantStyles = (variant = "default") => {
|
|
|
3100
3229
|
return baseStyles;
|
|
3101
3230
|
}
|
|
3102
3231
|
};
|
|
3103
|
-
var Input =
|
|
3232
|
+
var Input = React24.forwardRef(
|
|
3104
3233
|
({ className, type, variant = "default", ...props }, ref) => {
|
|
3105
3234
|
return /* @__PURE__ */ jsx28(
|
|
3106
3235
|
"input",
|
|
@@ -3114,7 +3243,7 @@ var Input = React23.forwardRef(
|
|
|
3114
3243
|
}
|
|
3115
3244
|
);
|
|
3116
3245
|
Input.displayName = "Input";
|
|
3117
|
-
var EnterInput =
|
|
3246
|
+
var EnterInput = React24.forwardRef(
|
|
3118
3247
|
({ onEnter, ...props }, ref) => {
|
|
3119
3248
|
const handleKeyDown = (e) => {
|
|
3120
3249
|
if (e.key === "Enter" && onEnter) {
|
|
@@ -3138,7 +3267,7 @@ var EnterInput = React23.forwardRef(
|
|
|
3138
3267
|
}
|
|
3139
3268
|
);
|
|
3140
3269
|
EnterInput.displayName = "EnterInput";
|
|
3141
|
-
var BasicInput =
|
|
3270
|
+
var BasicInput = React24.forwardRef(
|
|
3142
3271
|
// `variant` is accepted (prop-compatible with Input) but intentionally
|
|
3143
3272
|
// unused — and destructured so it never leaks onto the DOM element.
|
|
3144
3273
|
({ className, type, variant: _variant = "default", ...props }, ref) => {
|
|
@@ -3157,7 +3286,7 @@ var BasicInput = React23.forwardRef(
|
|
|
3157
3286
|
}
|
|
3158
3287
|
);
|
|
3159
3288
|
BasicInput.displayName = "BasicInput";
|
|
3160
|
-
var InputWithPrefix =
|
|
3289
|
+
var InputWithPrefix = React24.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
|
|
3161
3290
|
return /* @__PURE__ */ jsxs17("div", { className: cn("relative", wrapperClassName), children: [
|
|
3162
3291
|
prefix && /* @__PURE__ */ jsx28("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
|
|
3163
3292
|
/* @__PURE__ */ jsx28(
|
|
@@ -3174,9 +3303,9 @@ InputWithPrefix.displayName = "InputWithPrefix";
|
|
|
3174
3303
|
|
|
3175
3304
|
// src/label.tsx
|
|
3176
3305
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3177
|
-
import * as
|
|
3306
|
+
import * as React25 from "react";
|
|
3178
3307
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3179
|
-
var Label4 =
|
|
3308
|
+
var Label4 = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
3180
3309
|
LabelPrimitive.Root,
|
|
3181
3310
|
{
|
|
3182
3311
|
ref,
|
|
@@ -3354,7 +3483,7 @@ function OverflowToolbar({
|
|
|
3354
3483
|
|
|
3355
3484
|
// src/progress.tsx
|
|
3356
3485
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3357
|
-
import * as
|
|
3486
|
+
import * as React27 from "react";
|
|
3358
3487
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3359
3488
|
var PROGRESS_TONES = {
|
|
3360
3489
|
default: "bg-primary",
|
|
@@ -3362,7 +3491,7 @@ var PROGRESS_TONES = {
|
|
|
3362
3491
|
warning: "bg-warning",
|
|
3363
3492
|
destructive: "bg-destructive"
|
|
3364
3493
|
};
|
|
3365
|
-
var Progress =
|
|
3494
|
+
var Progress = React27.forwardRef(({ className, tone = "default", indicatorClassName, ...props }, ref) => {
|
|
3366
3495
|
const { value, max } = props;
|
|
3367
3496
|
const ceiling = max ?? 100;
|
|
3368
3497
|
const isIndeterminate = value === null || value === void 0;
|
|
@@ -3399,9 +3528,9 @@ Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
|
3399
3528
|
|
|
3400
3529
|
// src/scroll-area.tsx
|
|
3401
3530
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3402
|
-
import * as
|
|
3531
|
+
import * as React28 from "react";
|
|
3403
3532
|
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3404
|
-
var ScrollArea =
|
|
3533
|
+
var ScrollArea = React28.forwardRef(
|
|
3405
3534
|
({
|
|
3406
3535
|
className,
|
|
3407
3536
|
children,
|
|
@@ -3434,7 +3563,7 @@ var ScrollArea = React27.forwardRef(
|
|
|
3434
3563
|
)
|
|
3435
3564
|
);
|
|
3436
3565
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
3437
|
-
var ScrollBar =
|
|
3566
|
+
var ScrollBar = React28.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
3438
3567
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3439
3568
|
{
|
|
3440
3569
|
ref,
|
|
@@ -3603,7 +3732,7 @@ function SegmentedControl({
|
|
|
3603
3732
|
}
|
|
3604
3733
|
|
|
3605
3734
|
// src/archive-filter.tsx
|
|
3606
|
-
import * as
|
|
3735
|
+
import * as React29 from "react";
|
|
3607
3736
|
import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3608
3737
|
var ARCHIVE_FILTER_VALUES = ["active", "archived", "all"];
|
|
3609
3738
|
var DEFAULT_ARCHIVE_FILTER = "active";
|
|
@@ -3629,7 +3758,7 @@ function ArchiveFilter({
|
|
|
3629
3758
|
"aria-label": ariaLabel = "Archive filter",
|
|
3630
3759
|
disabled = false
|
|
3631
3760
|
}) {
|
|
3632
|
-
const data =
|
|
3761
|
+
const data = React29.useMemo(
|
|
3633
3762
|
() => ARCHIVE_FILTER_VALUES.map((state) => {
|
|
3634
3763
|
const text = labels?.[state] ?? ARCHIVE_FILTER_LABELS[state];
|
|
3635
3764
|
const count = counts?.[state];
|
|
@@ -3692,9 +3821,9 @@ function ArchivedDisclosure({
|
|
|
3692
3821
|
|
|
3693
3822
|
// src/separator.tsx
|
|
3694
3823
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3695
|
-
import * as
|
|
3824
|
+
import * as React30 from "react";
|
|
3696
3825
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3697
|
-
var Separator4 =
|
|
3826
|
+
var Separator4 = React30.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3698
3827
|
SeparatorPrimitive.Root,
|
|
3699
3828
|
{
|
|
3700
3829
|
ref,
|
|
@@ -3714,9 +3843,9 @@ Separator4.displayName = SeparatorPrimitive.Root.displayName;
|
|
|
3714
3843
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3715
3844
|
import { treeContainsComponent as treeContainsComponent4 } from "@ai-matrx/kit/react-tree";
|
|
3716
3845
|
import { cva as cva5 } from "class-variance-authority";
|
|
3717
|
-
import * as
|
|
3846
|
+
import * as React31 from "react";
|
|
3718
3847
|
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3719
|
-
var SheetContentBase =
|
|
3848
|
+
var SheetContentBase = React31.forwardRef(({ onInteractOutside, ...props }, ref) => {
|
|
3720
3849
|
const isModal = useRadixDialogModal();
|
|
3721
3850
|
useModalLayer(isModal);
|
|
3722
3851
|
return /* @__PURE__ */ jsx38(
|
|
@@ -3730,7 +3859,7 @@ var SheetContentBase = React30.forwardRef(({ onInteractOutside, ...props }, ref)
|
|
|
3730
3859
|
);
|
|
3731
3860
|
});
|
|
3732
3861
|
SheetContentBase.displayName = "SheetContentBase";
|
|
3733
|
-
var Sheet =
|
|
3862
|
+
var Sheet = React31.forwardRef(({ children, ...props }, _ref) => {
|
|
3734
3863
|
const modal = props.modal ?? true;
|
|
3735
3864
|
return /* @__PURE__ */ jsx38(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx38(SheetPrimitive.Root, { ...props, modal, children }) });
|
|
3736
3865
|
});
|
|
@@ -3738,7 +3867,7 @@ Sheet.displayName = "Sheet";
|
|
|
3738
3867
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
3739
3868
|
var SheetClose = SheetPrimitive.Close;
|
|
3740
3869
|
var SheetPortal = SheetPrimitive.Portal;
|
|
3741
|
-
var SheetOverlay =
|
|
3870
|
+
var SheetOverlay = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3742
3871
|
SheetPrimitive.Overlay,
|
|
3743
3872
|
{
|
|
3744
3873
|
className: cn(
|
|
@@ -3777,7 +3906,7 @@ var sheetVariants = cva5(
|
|
|
3777
3906
|
}
|
|
3778
3907
|
}
|
|
3779
3908
|
);
|
|
3780
|
-
var SheetDescription =
|
|
3909
|
+
var SheetDescription = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3781
3910
|
SheetPrimitive.Description,
|
|
3782
3911
|
{
|
|
3783
3912
|
ref,
|
|
@@ -3786,7 +3915,7 @@ var SheetDescription = React30.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3786
3915
|
}
|
|
3787
3916
|
));
|
|
3788
3917
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
3789
|
-
var SheetContent =
|
|
3918
|
+
var SheetContent = React31.forwardRef(
|
|
3790
3919
|
({
|
|
3791
3920
|
side = "right",
|
|
3792
3921
|
className,
|
|
@@ -3857,7 +3986,7 @@ var SheetFooter = ({
|
|
|
3857
3986
|
}
|
|
3858
3987
|
);
|
|
3859
3988
|
SheetFooter.displayName = "SheetFooter";
|
|
3860
|
-
var SheetTitle =
|
|
3989
|
+
var SheetTitle = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3861
3990
|
SheetPrimitive.Title,
|
|
3862
3991
|
{
|
|
3863
3992
|
ref,
|
|
@@ -3868,7 +3997,7 @@ var SheetTitle = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3868
3997
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
3869
3998
|
|
|
3870
3999
|
// src/organization-picker.tsx
|
|
3871
|
-
import * as
|
|
4000
|
+
import * as React32 from "react";
|
|
3872
4001
|
|
|
3873
4002
|
// src/skeleton.tsx
|
|
3874
4003
|
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
@@ -3956,9 +4085,9 @@ function OrganizationPicker({
|
|
|
3956
4085
|
foldedLabel = "More",
|
|
3957
4086
|
className
|
|
3958
4087
|
}) {
|
|
3959
|
-
const [query, setQuery] =
|
|
3960
|
-
const [showFixtures, setShowFixtures] =
|
|
3961
|
-
const [showFolded, setShowFolded] =
|
|
4088
|
+
const [query, setQuery] = React32.useState("");
|
|
4089
|
+
const [showFixtures, setShowFixtures] = React32.useState(false);
|
|
4090
|
+
const [showFolded, setShowFolded] = React32.useState(false);
|
|
3962
4091
|
const favorites = new Set(favoriteOrganizationIds);
|
|
3963
4092
|
const isFavorite = (id) => favorites.has(id);
|
|
3964
4093
|
const rank = (org) => isFavorite(org.id) ? 0 : org.isOwn ? 1 : 2;
|
|
@@ -4158,11 +4287,11 @@ function OrganizationPicker({
|
|
|
4158
4287
|
// src/sidebar.tsx
|
|
4159
4288
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
4160
4289
|
import { cva as cva6 } from "class-variance-authority";
|
|
4161
|
-
import * as
|
|
4290
|
+
import * as React34 from "react";
|
|
4162
4291
|
|
|
4163
4292
|
// src/tooltip.tsx
|
|
4164
4293
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4165
|
-
import * as
|
|
4294
|
+
import * as React33 from "react";
|
|
4166
4295
|
|
|
4167
4296
|
// src/title-tooltips.ts
|
|
4168
4297
|
var TITLE_TOOLTIP_ATTR = "data-matrx-title";
|
|
@@ -4221,7 +4350,7 @@ function install(doc) {
|
|
|
4221
4350
|
if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;
|
|
4222
4351
|
return el;
|
|
4223
4352
|
};
|
|
4224
|
-
const
|
|
4353
|
+
const textOf2 = (el) => (el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute("title") ?? "").trim();
|
|
4225
4354
|
const lift = (el) => {
|
|
4226
4355
|
const title = el.getAttribute("title");
|
|
4227
4356
|
if (title === null) return;
|
|
@@ -4303,7 +4432,7 @@ function install(doc) {
|
|
|
4303
4432
|
const show = (el, instant) => {
|
|
4304
4433
|
if (active !== el) return;
|
|
4305
4434
|
if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;
|
|
4306
|
-
const text =
|
|
4435
|
+
const text = textOf2(el);
|
|
4307
4436
|
if (!text || !el.isConnected) return;
|
|
4308
4437
|
if (repeatsVisibleText(el, text)) return;
|
|
4309
4438
|
const node = ensureSurface();
|
|
@@ -4396,16 +4525,16 @@ function install(doc) {
|
|
|
4396
4525
|
// src/tooltip.tsx
|
|
4397
4526
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4398
4527
|
function TooltipProvider({ titleTooltips = true, ...props }) {
|
|
4399
|
-
|
|
4528
|
+
React33.useEffect(() => {
|
|
4400
4529
|
if (!titleTooltips) return;
|
|
4401
4530
|
return acquireTitleTooltips();
|
|
4402
4531
|
}, [titleTooltips]);
|
|
4403
4532
|
return /* @__PURE__ */ jsx41(TooltipPrimitive.Provider, { ...props });
|
|
4404
4533
|
}
|
|
4405
4534
|
var Tooltip = TooltipPrimitive.Root;
|
|
4406
|
-
var TooltipTrigger =
|
|
4535
|
+
var TooltipTrigger = React33.forwardRef((props, ref) => /* @__PURE__ */ jsx41(TooltipPrimitive.Trigger, { ref, ...{ [TOOLTIP_TRIGGER_ATTR]: "" }, ...props }));
|
|
4407
4536
|
TooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;
|
|
4408
|
-
var TooltipContent =
|
|
4537
|
+
var TooltipContent = React33.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
4409
4538
|
const resolved = usePortalContainer(container);
|
|
4410
4539
|
return /* @__PURE__ */ jsx41(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx41(
|
|
4411
4540
|
TooltipPrimitive.Content,
|
|
@@ -4430,9 +4559,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
4430
4559
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
4431
4560
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4432
4561
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4433
|
-
var SidebarContext =
|
|
4562
|
+
var SidebarContext = React34.createContext(null);
|
|
4434
4563
|
function useSidebar() {
|
|
4435
|
-
const context =
|
|
4564
|
+
const context = React34.useContext(SidebarContext);
|
|
4436
4565
|
if (!context) {
|
|
4437
4566
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4438
4567
|
}
|
|
@@ -4449,10 +4578,10 @@ function SidebarProvider({
|
|
|
4449
4578
|
...props
|
|
4450
4579
|
}) {
|
|
4451
4580
|
const isMobile = useIsMobile();
|
|
4452
|
-
const [openMobile, setOpenMobile] =
|
|
4453
|
-
const [_open, _setOpen] =
|
|
4581
|
+
const [openMobile, setOpenMobile] = React34.useState(false);
|
|
4582
|
+
const [_open, _setOpen] = React34.useState(defaultOpen);
|
|
4454
4583
|
const open = openProp ?? _open;
|
|
4455
|
-
const setOpen =
|
|
4584
|
+
const setOpen = React34.useCallback(
|
|
4456
4585
|
(value) => {
|
|
4457
4586
|
const openState = typeof value === "function" ? value(open) : value;
|
|
4458
4587
|
if (setOpenProp) {
|
|
@@ -4463,10 +4592,10 @@ function SidebarProvider({
|
|
|
4463
4592
|
},
|
|
4464
4593
|
[setOpenProp, open]
|
|
4465
4594
|
);
|
|
4466
|
-
const toggleSidebar =
|
|
4595
|
+
const toggleSidebar = React34.useCallback(() => {
|
|
4467
4596
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
4468
4597
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
4469
|
-
|
|
4598
|
+
React34.useEffect(() => {
|
|
4470
4599
|
if (!keyboardShortcut) return;
|
|
4471
4600
|
const handleKeyDown = (event) => {
|
|
4472
4601
|
if (event.key === keyboardShortcut && (event.metaKey || event.ctrlKey)) {
|
|
@@ -4478,7 +4607,7 @@ function SidebarProvider({
|
|
|
4478
4607
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4479
4608
|
}, [keyboardShortcut, toggleSidebar]);
|
|
4480
4609
|
const state = open ? "expanded" : "collapsed";
|
|
4481
|
-
const contextValue =
|
|
4610
|
+
const contextValue = React34.useMemo(
|
|
4482
4611
|
() => ({
|
|
4483
4612
|
state,
|
|
4484
4613
|
open,
|
|
@@ -4926,7 +5055,7 @@ function SidebarMenuSkeleton({
|
|
|
4926
5055
|
showIcon = false,
|
|
4927
5056
|
...props
|
|
4928
5057
|
}) {
|
|
4929
|
-
const width =
|
|
5058
|
+
const width = React34.useMemo(() => {
|
|
4930
5059
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
4931
5060
|
}, []);
|
|
4932
5061
|
return /* @__PURE__ */ jsxs25(
|
|
@@ -5007,7 +5136,7 @@ function SidebarMenuSubButton({
|
|
|
5007
5136
|
}
|
|
5008
5137
|
|
|
5009
5138
|
// src/app-shell/app-rail.tsx
|
|
5010
|
-
import * as
|
|
5139
|
+
import * as React35 from "react";
|
|
5011
5140
|
|
|
5012
5141
|
// src/app-shell/status-dot.tsx
|
|
5013
5142
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
@@ -5063,7 +5192,7 @@ function AppRailGroup({ className, ...props }) {
|
|
|
5063
5192
|
function AppRailSpacer() {
|
|
5064
5193
|
return /* @__PURE__ */ jsx44("div", { "data-slot": "app-rail-spacer", className: "flex-1" });
|
|
5065
5194
|
}
|
|
5066
|
-
var AppRailItem =
|
|
5195
|
+
var AppRailItem = React35.forwardRef(function AppRailItem2({ icon, label, shortcut, active = false, attention, attentionLabel, className, ...props }, ref) {
|
|
5067
5196
|
return /* @__PURE__ */ jsxs26(Tooltip, { children: [
|
|
5068
5197
|
/* @__PURE__ */ jsx44(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs26(
|
|
5069
5198
|
"button",
|
|
@@ -5103,7 +5232,7 @@ var AppRailItem = React34.forwardRef(function AppRailItem2({ icon, label, shortc
|
|
|
5103
5232
|
] }) })
|
|
5104
5233
|
] });
|
|
5105
5234
|
});
|
|
5106
|
-
var AppRailAvatar =
|
|
5235
|
+
var AppRailAvatar = React35.forwardRef(function AppRailAvatar2({ initials = "", label, className, children, ...props }, ref) {
|
|
5107
5236
|
return /* @__PURE__ */ jsxs26(Tooltip, { children: [
|
|
5108
5237
|
/* @__PURE__ */ jsx44(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx44(
|
|
5109
5238
|
"button",
|
|
@@ -5126,7 +5255,7 @@ var AppRailAvatar = React34.forwardRef(function AppRailAvatar2({ initials = "",
|
|
|
5126
5255
|
});
|
|
5127
5256
|
|
|
5128
5257
|
// src/app-shell/canvas.tsx
|
|
5129
|
-
import * as
|
|
5258
|
+
import * as React36 from "react";
|
|
5130
5259
|
|
|
5131
5260
|
// src/resizable.tsx
|
|
5132
5261
|
import { Group as Group4, Panel, Separator as Separator5 } from "react-resizable-panels";
|
|
@@ -5193,7 +5322,7 @@ function CanvasLayout({ columns, expandedId = null, className }) {
|
|
|
5193
5322
|
if (expanded) {
|
|
5194
5323
|
return /* @__PURE__ */ jsx46("div", { "data-slot": "canvas-layout", "data-expanded": expanded.id, className: cn("flex h-full w-full", className), children: expanded.node });
|
|
5195
5324
|
}
|
|
5196
|
-
return /* @__PURE__ */ jsx46(ResizablePanelGroup, { "data-slot": "canvas-layout", orientation: "horizontal", className: cn("gap-0", className), children: visible2.map((column, ci) => /* @__PURE__ */ jsxs27(
|
|
5325
|
+
return /* @__PURE__ */ jsx46(ResizablePanelGroup, { "data-slot": "canvas-layout", orientation: "horizontal", className: cn("gap-0", className), children: visible2.map((column, ci) => /* @__PURE__ */ jsxs27(React36.Fragment, { children: [
|
|
5197
5326
|
ci > 0 ? /* @__PURE__ */ jsx46(ResizableHandle, { "data-canvas-gap": "column", size: "md", className: GAP }) : null,
|
|
5198
5327
|
/* @__PURE__ */ jsx46(
|
|
5199
5328
|
ResizablePanel,
|
|
@@ -5201,7 +5330,7 @@ function CanvasLayout({ columns, expandedId = null, className }) {
|
|
|
5201
5330
|
id: column.id,
|
|
5202
5331
|
minSize: column.minSize ?? 220,
|
|
5203
5332
|
...column.defaultSize !== void 0 ? { defaultSize: column.defaultSize } : {},
|
|
5204
|
-
children: /* @__PURE__ */ jsx46(ResizablePanelGroup, { "data-canvas-column": column.id, orientation: "vertical", children: column.panels.map((panel, pi) => /* @__PURE__ */ jsxs27(
|
|
5333
|
+
children: /* @__PURE__ */ jsx46(ResizablePanelGroup, { "data-canvas-column": column.id, orientation: "vertical", children: column.panels.map((panel, pi) => /* @__PURE__ */ jsxs27(React36.Fragment, { children: [
|
|
5205
5334
|
pi > 0 ? /* @__PURE__ */ jsx46(ResizableHandle, { "data-canvas-gap": "row", size: "md", className: GAP }) : null,
|
|
5206
5335
|
/* @__PURE__ */ jsx46(
|
|
5207
5336
|
ResizablePanel,
|
|
@@ -5219,10 +5348,10 @@ function CanvasLayout({ columns, expandedId = null, className }) {
|
|
|
5219
5348
|
}
|
|
5220
5349
|
|
|
5221
5350
|
// src/app-shell/mode-switch.tsx
|
|
5222
|
-
import * as
|
|
5351
|
+
import * as React37 from "react";
|
|
5223
5352
|
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5224
5353
|
function ModeSwitch({ value, onValueChange, options, label = "Mode", className }) {
|
|
5225
|
-
const refs =
|
|
5354
|
+
const refs = React37.useRef([]);
|
|
5226
5355
|
const move = (from, delta) => {
|
|
5227
5356
|
const next = (from + delta + options.length) % options.length;
|
|
5228
5357
|
const option = options[next];
|
|
@@ -5285,7 +5414,7 @@ function ModeSwitch({ value, onValueChange, options, label = "Mode", className }
|
|
|
5285
5414
|
|
|
5286
5415
|
// src/switch.tsx
|
|
5287
5416
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5288
|
-
import * as
|
|
5417
|
+
import * as React38 from "react";
|
|
5289
5418
|
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
5290
5419
|
var SWITCH_SIZES = {
|
|
5291
5420
|
sm: {
|
|
@@ -5297,7 +5426,7 @@ var SWITCH_SIZES = {
|
|
|
5297
5426
|
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
5298
5427
|
}
|
|
5299
5428
|
};
|
|
5300
|
-
var Switch =
|
|
5429
|
+
var Switch = React38.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx48(
|
|
5301
5430
|
SwitchPrimitives.Root,
|
|
5302
5431
|
{
|
|
5303
5432
|
ref,
|
|
@@ -5378,17 +5507,17 @@ function TabbedBottomSheet({
|
|
|
5378
5507
|
}
|
|
5379
5508
|
|
|
5380
5509
|
// src/table.tsx
|
|
5381
|
-
import * as
|
|
5510
|
+
import * as React39 from "react";
|
|
5382
5511
|
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
5383
5512
|
var TABLE_SIZES = {
|
|
5384
5513
|
sm: { head: "px-2", cell: "p-2" },
|
|
5385
5514
|
md: { head: "px-3", cell: "p-3" }
|
|
5386
5515
|
};
|
|
5387
|
-
var TableSizeContext =
|
|
5516
|
+
var TableSizeContext = React39.createContext("md");
|
|
5388
5517
|
function useTableSize() {
|
|
5389
|
-
return
|
|
5518
|
+
return React39.useContext(TableSizeContext);
|
|
5390
5519
|
}
|
|
5391
|
-
var Table =
|
|
5520
|
+
var Table = React39.forwardRef(
|
|
5392
5521
|
({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
5393
5522
|
const table = /* @__PURE__ */ jsx50(
|
|
5394
5523
|
"table",
|
|
@@ -5411,7 +5540,7 @@ var Table = React38.forwardRef(
|
|
|
5411
5540
|
}
|
|
5412
5541
|
);
|
|
5413
5542
|
Table.displayName = "Table";
|
|
5414
|
-
var TableHeader =
|
|
5543
|
+
var TableHeader = React39.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
5415
5544
|
"thead",
|
|
5416
5545
|
{
|
|
5417
5546
|
ref,
|
|
@@ -5425,7 +5554,7 @@ var TableHeader = React38.forwardRef(({ className, sticky = false, ...props }, r
|
|
|
5425
5554
|
}
|
|
5426
5555
|
));
|
|
5427
5556
|
TableHeader.displayName = "TableHeader";
|
|
5428
|
-
var TableBody =
|
|
5557
|
+
var TableBody = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
5429
5558
|
"tbody",
|
|
5430
5559
|
{
|
|
5431
5560
|
ref,
|
|
@@ -5435,7 +5564,7 @@ var TableBody = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5435
5564
|
}
|
|
5436
5565
|
));
|
|
5437
5566
|
TableBody.displayName = "TableBody";
|
|
5438
|
-
var TableFooter =
|
|
5567
|
+
var TableFooter = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
5439
5568
|
"tfoot",
|
|
5440
5569
|
{
|
|
5441
5570
|
ref,
|
|
@@ -5448,7 +5577,7 @@ var TableFooter = React38.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5448
5577
|
}
|
|
5449
5578
|
));
|
|
5450
5579
|
TableFooter.displayName = "TableFooter";
|
|
5451
|
-
var TableRow =
|
|
5580
|
+
var TableRow = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
5452
5581
|
"tr",
|
|
5453
5582
|
{
|
|
5454
5583
|
ref,
|
|
@@ -5461,7 +5590,7 @@ var TableRow = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5461
5590
|
}
|
|
5462
5591
|
));
|
|
5463
5592
|
TableRow.displayName = "TableRow";
|
|
5464
|
-
var TableHead =
|
|
5593
|
+
var TableHead = React39.forwardRef(({ className, ...props }, ref) => {
|
|
5465
5594
|
const size = useTableSize();
|
|
5466
5595
|
return /* @__PURE__ */ jsx50(
|
|
5467
5596
|
"th",
|
|
@@ -5478,7 +5607,7 @@ var TableHead = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
5478
5607
|
);
|
|
5479
5608
|
});
|
|
5480
5609
|
TableHead.displayName = "TableHead";
|
|
5481
|
-
var TableCell =
|
|
5610
|
+
var TableCell = React39.forwardRef(({ className, ...props }, ref) => {
|
|
5482
5611
|
const size = useTableSize();
|
|
5483
5612
|
return /* @__PURE__ */ jsx50(
|
|
5484
5613
|
"td",
|
|
@@ -5495,7 +5624,7 @@ var TableCell = React38.forwardRef(({ className, ...props }, ref) => {
|
|
|
5495
5624
|
);
|
|
5496
5625
|
});
|
|
5497
5626
|
TableCell.displayName = "TableCell";
|
|
5498
|
-
var TableCaption =
|
|
5627
|
+
var TableCaption = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
5499
5628
|
"caption",
|
|
5500
5629
|
{
|
|
5501
5630
|
ref,
|
|
@@ -5508,11 +5637,11 @@ TableCaption.displayName = "TableCaption";
|
|
|
5508
5637
|
|
|
5509
5638
|
// src/tabs.tsx
|
|
5510
5639
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5511
|
-
import * as
|
|
5640
|
+
import * as React40 from "react";
|
|
5512
5641
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
5513
5642
|
var Tabs = TabsPrimitive.Root;
|
|
5514
5643
|
var TABS_TRIGGER_BASE = "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm";
|
|
5515
|
-
var TabsList =
|
|
5644
|
+
var TabsList = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5516
5645
|
TabsPrimitive.List,
|
|
5517
5646
|
{
|
|
5518
5647
|
ref,
|
|
@@ -5525,7 +5654,7 @@ var TabsList = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5525
5654
|
}
|
|
5526
5655
|
));
|
|
5527
5656
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5528
|
-
var TabsTrigger =
|
|
5657
|
+
var TabsTrigger = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5529
5658
|
TabsPrimitive.Trigger,
|
|
5530
5659
|
{
|
|
5531
5660
|
ref,
|
|
@@ -5539,7 +5668,7 @@ var TabsTrigger = React39.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5539
5668
|
}
|
|
5540
5669
|
));
|
|
5541
5670
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5542
|
-
var TabsTriggerCore =
|
|
5671
|
+
var TabsTriggerCore = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5543
5672
|
TabsPrimitive.Trigger,
|
|
5544
5673
|
{
|
|
5545
5674
|
ref,
|
|
@@ -5549,7 +5678,7 @@ var TabsTriggerCore = React39.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
5549
5678
|
}
|
|
5550
5679
|
));
|
|
5551
5680
|
TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
|
|
5552
|
-
var TabsContent =
|
|
5681
|
+
var TabsContent = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5553
5682
|
TabsPrimitive.Content,
|
|
5554
5683
|
{
|
|
5555
5684
|
ref,
|
|
@@ -5565,7 +5694,7 @@ var TabsContent = React39.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5565
5694
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5566
5695
|
|
|
5567
5696
|
// src/textarea.tsx
|
|
5568
|
-
import * as
|
|
5697
|
+
import * as React41 from "react";
|
|
5569
5698
|
import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5570
5699
|
var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
|
|
5571
5700
|
var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
|
|
@@ -5579,7 +5708,7 @@ function getStretchClasses(className) {
|
|
|
5579
5708
|
var TEXTAREA_ELEVATED_CLASS = `flex h-auto w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;
|
|
5580
5709
|
var TEXTAREA_CONTROL_CLASS = `flex w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`;
|
|
5581
5710
|
function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
5582
|
-
|
|
5711
|
+
React41.useEffect(() => {
|
|
5583
5712
|
if (!autoGrow || !ref.current) return;
|
|
5584
5713
|
const textarea = ref.current;
|
|
5585
5714
|
textarea.style.height = "auto";
|
|
@@ -5595,8 +5724,8 @@ function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
|
5595
5724
|
}, [value, autoGrow, minHeight, maxHeight, ref]);
|
|
5596
5725
|
}
|
|
5597
5726
|
function useMergedTextareaRef(forwarded) {
|
|
5598
|
-
const internal =
|
|
5599
|
-
const callback =
|
|
5727
|
+
const internal = React41.useRef(null);
|
|
5728
|
+
const callback = React41.useCallback(
|
|
5600
5729
|
(node) => {
|
|
5601
5730
|
internal.current = node;
|
|
5602
5731
|
if (typeof forwarded === "function") forwarded(node);
|
|
@@ -5613,7 +5742,7 @@ function boxStyle(minHeight, maxHeight) {
|
|
|
5613
5742
|
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
5614
5743
|
};
|
|
5615
5744
|
}
|
|
5616
|
-
var Textarea =
|
|
5745
|
+
var Textarea = React41.forwardRef(
|
|
5617
5746
|
({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
|
|
5618
5747
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
5619
5748
|
const stretchClasses = getStretchClasses(className);
|
|
@@ -5639,7 +5768,7 @@ var Textarea = React40.forwardRef(
|
|
|
5639
5768
|
}
|
|
5640
5769
|
);
|
|
5641
5770
|
Textarea.displayName = "Textarea";
|
|
5642
|
-
var BasicTextarea =
|
|
5771
|
+
var BasicTextarea = React41.forwardRef(
|
|
5643
5772
|
({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
|
|
5644
5773
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
5645
5774
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
@@ -5661,7 +5790,7 @@ var BasicTextarea = React40.forwardRef(
|
|
|
5661
5790
|
}
|
|
5662
5791
|
);
|
|
5663
5792
|
BasicTextarea.displayName = "BasicTextarea";
|
|
5664
|
-
var TextareaWithPrefix =
|
|
5793
|
+
var TextareaWithPrefix = React41.forwardRef(
|
|
5665
5794
|
({
|
|
5666
5795
|
prefix,
|
|
5667
5796
|
className,
|
|
@@ -5704,11 +5833,11 @@ TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
|
5704
5833
|
|
|
5705
5834
|
// src/hover-card.tsx
|
|
5706
5835
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
5707
|
-
import * as
|
|
5836
|
+
import * as React42 from "react";
|
|
5708
5837
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
5709
5838
|
var HoverCard = HoverCardPrimitive.Root;
|
|
5710
5839
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
5711
|
-
var HoverCardContent =
|
|
5840
|
+
var HoverCardContent = React42.forwardRef(
|
|
5712
5841
|
({ className, align = "center", sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
5713
5842
|
const resolved = usePortalContainer(container);
|
|
5714
5843
|
return /* @__PURE__ */ jsx53(HoverCardPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx53(
|
|
@@ -5732,9 +5861,9 @@ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
5732
5861
|
|
|
5733
5862
|
// src/radio-group.tsx
|
|
5734
5863
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5735
|
-
import * as
|
|
5864
|
+
import * as React43 from "react";
|
|
5736
5865
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
5737
|
-
var RadioGroupSizeContext =
|
|
5866
|
+
var RadioGroupSizeContext = React43.createContext("md");
|
|
5738
5867
|
var CONTROL_CLASSES = {
|
|
5739
5868
|
sm: "h-3.5 w-3.5",
|
|
5740
5869
|
md: "h-4 w-4",
|
|
@@ -5745,7 +5874,7 @@ var DOT_CLASSES = {
|
|
|
5745
5874
|
md: "h-1.5 w-1.5",
|
|
5746
5875
|
lg: "h-2 w-2"
|
|
5747
5876
|
};
|
|
5748
|
-
var RadioGroup3 =
|
|
5877
|
+
var RadioGroup3 = React43.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx54(RadioGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx54(
|
|
5749
5878
|
RadioGroupPrimitive.Root,
|
|
5750
5879
|
{
|
|
5751
5880
|
ref,
|
|
@@ -5755,8 +5884,8 @@ var RadioGroup3 = React42.forwardRef(({ className, size = "md", ...props }, ref)
|
|
|
5755
5884
|
}
|
|
5756
5885
|
) }));
|
|
5757
5886
|
RadioGroup3.displayName = RadioGroupPrimitive.Root.displayName;
|
|
5758
|
-
var RadioGroupItem =
|
|
5759
|
-
const groupSize =
|
|
5887
|
+
var RadioGroupItem = React43.forwardRef(({ className, size, ...props }, ref) => {
|
|
5888
|
+
const groupSize = React43.useContext(RadioGroupSizeContext);
|
|
5760
5889
|
const resolved = size ?? groupSize;
|
|
5761
5890
|
return /* @__PURE__ */ jsx54(
|
|
5762
5891
|
RadioGroupPrimitive.Item,
|
|
@@ -5788,7 +5917,7 @@ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
|
5788
5917
|
|
|
5789
5918
|
// src/slider.tsx
|
|
5790
5919
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
5791
|
-
import * as
|
|
5920
|
+
import * as React44 from "react";
|
|
5792
5921
|
import { jsx as jsx55, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5793
5922
|
var TRACK_CLASSES = {
|
|
5794
5923
|
sm: "h-1",
|
|
@@ -5800,7 +5929,7 @@ var THUMB_CLASSES = {
|
|
|
5800
5929
|
md: "h-4 w-4",
|
|
5801
5930
|
lg: "h-5 w-5"
|
|
5802
5931
|
};
|
|
5803
|
-
var Slider =
|
|
5932
|
+
var Slider = React44.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
5804
5933
|
const thumbCount = Math.max(
|
|
5805
5934
|
1,
|
|
5806
5935
|
(props.value ?? props.defaultValue ?? [0]).length
|
|
@@ -5862,7 +5991,7 @@ Slider.displayName = SliderPrimitive.Root.displayName;
|
|
|
5862
5991
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5863
5992
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5864
5993
|
import { cva as cva7 } from "class-variance-authority";
|
|
5865
|
-
import * as
|
|
5994
|
+
import * as React45 from "react";
|
|
5866
5995
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5867
5996
|
var toggleVariants = cva7(
|
|
5868
5997
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -5884,7 +6013,7 @@ var toggleVariants = cva7(
|
|
|
5884
6013
|
}
|
|
5885
6014
|
}
|
|
5886
6015
|
);
|
|
5887
|
-
var Toggle =
|
|
6016
|
+
var Toggle = React45.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
5888
6017
|
TogglePrimitive.Root,
|
|
5889
6018
|
{
|
|
5890
6019
|
ref,
|
|
@@ -5894,8 +6023,8 @@ var Toggle = React44.forwardRef(({ className, variant, size, ...props }, ref) =>
|
|
|
5894
6023
|
}
|
|
5895
6024
|
));
|
|
5896
6025
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5897
|
-
var ToggleGroupContext =
|
|
5898
|
-
var ToggleGroup =
|
|
6026
|
+
var ToggleGroupContext = React45.createContext({ size: "default", variant: "default" });
|
|
6027
|
+
var ToggleGroup = React45.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
5899
6028
|
ToggleGroupPrimitive.Root,
|
|
5900
6029
|
{
|
|
5901
6030
|
ref,
|
|
@@ -5906,8 +6035,8 @@ var ToggleGroup = React44.forwardRef(({ className, variant, size, children, ...p
|
|
|
5906
6035
|
}
|
|
5907
6036
|
));
|
|
5908
6037
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
5909
|
-
var ToggleGroupItem =
|
|
5910
|
-
const context =
|
|
6038
|
+
var ToggleGroupItem = React45.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
6039
|
+
const context = React45.useContext(ToggleGroupContext);
|
|
5911
6040
|
return /* @__PURE__ */ jsx56(
|
|
5912
6041
|
ToggleGroupPrimitive.Item,
|
|
5913
6042
|
{
|
|
@@ -5981,11 +6110,11 @@ function classNameMisuse(className) {
|
|
|
5981
6110
|
const bad = className.split(/\s+/).filter((t) => t && NON_COLOUR_CLASS.test(t));
|
|
5982
6111
|
return bad.length ? `className is the glyph colour only \u2014 remove "${bad.join(" ")}"` : null;
|
|
5983
6112
|
}
|
|
5984
|
-
function
|
|
6113
|
+
function px2(value) {
|
|
5985
6114
|
const n = Number.parseFloat(value);
|
|
5986
6115
|
return Number.isFinite(n) ? n : 0;
|
|
5987
6116
|
}
|
|
5988
|
-
function
|
|
6117
|
+
function describe2(el) {
|
|
5989
6118
|
const cls = typeof el.className === "string" ? el.className.trim().split(/\s+/).slice(0, 4).join(".") : "";
|
|
5990
6119
|
return `<${el.tagName.toLowerCase()}${cls ? `.${cls}` : ""}>`;
|
|
5991
6120
|
}
|
|
@@ -6030,7 +6159,7 @@ function canon(doc) {
|
|
|
6030
6159
|
key,
|
|
6031
6160
|
target: a.offsetHeight,
|
|
6032
6161
|
pill: a.firstElementChild.offsetHeight,
|
|
6033
|
-
icon:
|
|
6162
|
+
icon: px2(view.getComputedStyle(a.querySelector("svg")).height),
|
|
6034
6163
|
sm: b.offsetHeight,
|
|
6035
6164
|
smPill: b.firstElementChild.offsetHeight,
|
|
6036
6165
|
wide: w.firstElementChild.offsetHeight
|
|
@@ -6060,7 +6189,7 @@ function findTapViolation(el) {
|
|
|
6060
6189
|
const inline = /matrx-tap-target-(?:inline|mobile-icon-only)/.test(el.className);
|
|
6061
6190
|
const pill = el.querySelector(":scope > .matrx-tap-pill");
|
|
6062
6191
|
const icon = pill?.querySelector(".matrx-tap-icon") ?? null;
|
|
6063
|
-
const floored =
|
|
6192
|
+
const floored = px2(cs.minHeight) >= el.offsetHeight - 0.5 || px2(cs.minWidth) >= el.offsetWidth - 0.5;
|
|
6064
6193
|
if (!inTable && pill && !floored) {
|
|
6065
6194
|
const c = canon(doc);
|
|
6066
6195
|
const box = sm ? c.sm : c.target;
|
|
@@ -6071,7 +6200,7 @@ function findTapViolation(el) {
|
|
|
6071
6200
|
return `pill is ${pill.offsetHeight}px, canon is ${pillSizes.join(" or ")}px`;
|
|
6072
6201
|
}
|
|
6073
6202
|
if (icon && !moved.has("--matrx-tap-icon-size")) {
|
|
6074
|
-
const size =
|
|
6203
|
+
const size = px2(view.getComputedStyle(icon).height);
|
|
6075
6204
|
if (Math.abs(size - c.icon) > 0.5) return `glyph is ${size}px, canon is ${c.icon}px`;
|
|
6076
6205
|
}
|
|
6077
6206
|
}
|
|
@@ -6088,9 +6217,9 @@ function findTapViolation(el) {
|
|
|
6088
6217
|
if (others.length > 0) break;
|
|
6089
6218
|
if (ownText(parent, slot, view) !== "") break;
|
|
6090
6219
|
const pcs = view.getComputedStyle(parent);
|
|
6091
|
-
const space =
|
|
6220
|
+
const space = px2(pcs.marginLeft) + px2(pcs.marginRight) + px2(pcs.paddingLeft) + px2(pcs.paddingRight);
|
|
6092
6221
|
if (space > 0.5) {
|
|
6093
|
-
return `${
|
|
6222
|
+
return `${describe2(parent)} adds ${space}px around a tap button \u2014 tap buttons space themselves`;
|
|
6094
6223
|
}
|
|
6095
6224
|
slot = parent;
|
|
6096
6225
|
}
|
|
@@ -6101,9 +6230,9 @@ function findTapViolation(el) {
|
|
|
6101
6230
|
const neighbours = Array.from(row.children).filter((c) => c !== slot && isTapSlot(c, view));
|
|
6102
6231
|
if (flexOrGrid && neighbours.length > 0) {
|
|
6103
6232
|
const horizontal = rcs.display.includes("grid") || !rcs.flexDirection.startsWith("column");
|
|
6104
|
-
const gap =
|
|
6233
|
+
const gap = px2(horizontal ? rcs.columnGap : rcs.rowGap);
|
|
6105
6234
|
if (gap > 0.5) {
|
|
6106
|
-
return `${
|
|
6235
|
+
return `${describe2(row)} adds a ${gap}px gap between tap buttons \u2014 remove it; tap buttons space themselves`;
|
|
6107
6236
|
}
|
|
6108
6237
|
}
|
|
6109
6238
|
}
|
|
@@ -6146,11 +6275,11 @@ function findTapPlacementWarning(el) {
|
|
|
6146
6275
|
if (!row) return null;
|
|
6147
6276
|
if (glass) {
|
|
6148
6277
|
const mixed = Array.from(row.children).find((c) => c !== slot && visible(c, view) && !isGlassItem(c));
|
|
6149
|
-
if (mixed) return `glass beside non-glass ${
|
|
6278
|
+
if (mixed) return `glass beside non-glass ${describe2(mixed)} \u2014 make the row all glass or none`;
|
|
6150
6279
|
}
|
|
6151
6280
|
const pill = el.querySelector(":scope > .matrx-tap-pill") ?? slot.querySelector(".matrx-tap-group-capsule");
|
|
6152
6281
|
if (!pill) return null;
|
|
6153
|
-
const gap =
|
|
6282
|
+
const gap = px2(view.getComputedStyle(el).getPropertyValue("--matrx-tap-gap")) || 6;
|
|
6154
6283
|
const p = pill.getBoundingClientRect();
|
|
6155
6284
|
if (p.width === 0) return null;
|
|
6156
6285
|
for (const [side, sib] of [["after", slot.nextElementSibling], ["before", slot.previousElementSibling]]) {
|
|
@@ -6158,9 +6287,9 @@ function findTapPlacementWarning(el) {
|
|
|
6158
6287
|
const r = sib.getBoundingClientRect();
|
|
6159
6288
|
if (Math.abs(r.top + r.height / 2 - (p.top + p.height / 2)) > p.height) continue;
|
|
6160
6289
|
const cs = view.getComputedStyle(sib);
|
|
6161
|
-
const distance = side === "after" ? r.left +
|
|
6290
|
+
const distance = side === "after" ? r.left + px2(cs.paddingLeft) - p.right : p.left - (r.right - px2(cs.paddingRight));
|
|
6162
6291
|
if (distance < gap - 0.5) {
|
|
6163
|
-
return `${
|
|
6292
|
+
return `${describe2(sib)} sits ${Math.round(distance)}px from the pill \u2014 anything beside a tap button adds its own ${gap / 2}px (the box only carries ${gap / 2}px)`;
|
|
6164
6293
|
}
|
|
6165
6294
|
}
|
|
6166
6295
|
return null;
|
|
@@ -7362,6 +7491,7 @@ export {
|
|
|
7362
7491
|
OrganizationMark,
|
|
7363
7492
|
OrganizationPicker,
|
|
7364
7493
|
OverflowToolbar,
|
|
7494
|
+
PILL_MAX_WIDTH_PX,
|
|
7365
7495
|
POPPER_OFFSET,
|
|
7366
7496
|
Popover,
|
|
7367
7497
|
PopoverAnchor,
|
|
@@ -7468,7 +7598,9 @@ export {
|
|
|
7468
7598
|
badgeVariants,
|
|
7469
7599
|
buttonVariants,
|
|
7470
7600
|
cn,
|
|
7601
|
+
enablePillGuard,
|
|
7471
7602
|
enableTapTargetGuard,
|
|
7603
|
+
findPillViolation,
|
|
7472
7604
|
findTapPlacementWarning,
|
|
7473
7605
|
findTapViolation,
|
|
7474
7606
|
floatingLayerZIndex,
|