@ai-matrx/design-system 0.10.1 → 0.11.1
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 +92 -0
- package/README.md +20 -1
- package/dist/index.cjs +395 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +432 -318
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1302,10 +1302,122 @@ var CommandShortcut = ({
|
|
|
1302
1302
|
};
|
|
1303
1303
|
CommandShortcut.displayName = "CommandShortcut";
|
|
1304
1304
|
|
|
1305
|
+
// src/confirm-dialog.tsx
|
|
1306
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1307
|
+
function ConfirmDialog({
|
|
1308
|
+
open,
|
|
1309
|
+
onOpenChange,
|
|
1310
|
+
title,
|
|
1311
|
+
description,
|
|
1312
|
+
content,
|
|
1313
|
+
contentClassName,
|
|
1314
|
+
confirmLabel = "Confirm",
|
|
1315
|
+
cancelLabel = "Cancel",
|
|
1316
|
+
variant = "default",
|
|
1317
|
+
busy = false,
|
|
1318
|
+
confirmDisabled = false,
|
|
1319
|
+
portalContainer,
|
|
1320
|
+
onConfirm
|
|
1321
|
+
}) {
|
|
1322
|
+
return /* @__PURE__ */ jsx16(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs7(
|
|
1323
|
+
AlertDialogContent,
|
|
1324
|
+
{
|
|
1325
|
+
className: contentClassName,
|
|
1326
|
+
...portalContainer === void 0 ? {} : { container: portalContainer },
|
|
1327
|
+
children: [
|
|
1328
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
1329
|
+
/* @__PURE__ */ jsx16(AlertDialogTitle, { children: title }),
|
|
1330
|
+
description ? /* @__PURE__ */ jsx16(AlertDialogDescription, { children: description }) : null
|
|
1331
|
+
] }),
|
|
1332
|
+
content ?? null,
|
|
1333
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
1334
|
+
cancelLabel === null ? null : /* @__PURE__ */ jsx16(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
1335
|
+
/* @__PURE__ */ jsxs7(
|
|
1336
|
+
AlertDialogAction,
|
|
1337
|
+
{
|
|
1338
|
+
disabled: busy || confirmDisabled,
|
|
1339
|
+
onClick: (event) => {
|
|
1340
|
+
event.preventDefault();
|
|
1341
|
+
void onConfirm();
|
|
1342
|
+
},
|
|
1343
|
+
className: cn(
|
|
1344
|
+
"max-lg:min-h-11",
|
|
1345
|
+
// One source of button appearance: the destructive look comes
|
|
1346
|
+
// from `buttonVariants`, not a second hand-written copy of it.
|
|
1347
|
+
// tailwind-merge makes it WIN over the default variant classes.
|
|
1348
|
+
variant === "destructive" && buttonVariants({ variant: "destructive" })
|
|
1349
|
+
),
|
|
1350
|
+
children: [
|
|
1351
|
+
busy ? /* @__PURE__ */ jsx16(Loader2Icon, { className: cn("mr-2 h-4 w-4", MOTION_SPIN) }) : null,
|
|
1352
|
+
confirmLabel
|
|
1353
|
+
]
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
] })
|
|
1357
|
+
]
|
|
1358
|
+
}
|
|
1359
|
+
) });
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// src/confirm-host.tsx
|
|
1363
|
+
import {
|
|
1364
|
+
_registerHost,
|
|
1365
|
+
_unregisterHost
|
|
1366
|
+
} from "@ai-matrx/kit/confirm-opener";
|
|
1367
|
+
import * as React14 from "react";
|
|
1368
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1369
|
+
function ConfirmDialogHost() {
|
|
1370
|
+
const [active, setActive] = React14.useState(null);
|
|
1371
|
+
const [tick, setTick] = React14.useState(0);
|
|
1372
|
+
const queueRef = React14.useRef([]);
|
|
1373
|
+
React14.useEffect(() => {
|
|
1374
|
+
const controller = {
|
|
1375
|
+
show: (opts, resolve) => {
|
|
1376
|
+
queueRef.current.push({ opts, resolve });
|
|
1377
|
+
setTick((n) => n + 1);
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
_registerHost(controller);
|
|
1381
|
+
return () => _unregisterHost(controller);
|
|
1382
|
+
}, []);
|
|
1383
|
+
React14.useEffect(() => {
|
|
1384
|
+
if (active === null && queueRef.current.length > 0) {
|
|
1385
|
+
setActive(queueRef.current.shift());
|
|
1386
|
+
}
|
|
1387
|
+
}, [active, tick]);
|
|
1388
|
+
const handleConfirm = React14.useCallback(() => {
|
|
1389
|
+
if (!active) return;
|
|
1390
|
+
active.resolve(true);
|
|
1391
|
+
setActive(null);
|
|
1392
|
+
}, [active]);
|
|
1393
|
+
const handleOpenChange = React14.useCallback(
|
|
1394
|
+
(open) => {
|
|
1395
|
+
if (!open && active) {
|
|
1396
|
+
active.resolve(false);
|
|
1397
|
+
setActive(null);
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
[active]
|
|
1401
|
+
);
|
|
1402
|
+
return /* @__PURE__ */ jsx17(
|
|
1403
|
+
ConfirmDialog,
|
|
1404
|
+
{
|
|
1405
|
+
open: !!active,
|
|
1406
|
+
onOpenChange: handleOpenChange,
|
|
1407
|
+
title: active?.opts.title ?? "",
|
|
1408
|
+
description: active?.opts.description,
|
|
1409
|
+
confirmLabel: active?.opts.confirmLabel,
|
|
1410
|
+
cancelLabel: active?.opts.cancelLabel,
|
|
1411
|
+
variant: active?.opts.variant,
|
|
1412
|
+
onConfirm: handleConfirm
|
|
1413
|
+
}
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1305
1417
|
// src/context-menu.tsx
|
|
1306
1418
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1307
|
-
import * as
|
|
1308
|
-
import { jsx as
|
|
1419
|
+
import * as React15 from "react";
|
|
1420
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1309
1421
|
var ContextMenu = ContextMenuPrimitive.Root;
|
|
1310
1422
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1311
1423
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
@@ -1315,7 +1427,7 @@ var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
|
1315
1427
|
var SURFACE_CLASS = "z-50 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";
|
|
1316
1428
|
var ITEM_CLASS = "relative flex cursor-default 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]:pointer-events-none data-[disabled]:opacity-50";
|
|
1317
1429
|
var INDICATOR_ITEM_CLASS = "relative flex cursor-default 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]:pointer-events-none data-[disabled]:opacity-50";
|
|
1318
|
-
var ContextMenuSubTrigger =
|
|
1430
|
+
var ContextMenuSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
1319
1431
|
ContextMenuPrimitive.SubTrigger,
|
|
1320
1432
|
{
|
|
1321
1433
|
ref,
|
|
@@ -1328,12 +1440,12 @@ var ContextMenuSubTrigger = React14.forwardRef(({ className, inset, children, ..
|
|
|
1328
1440
|
...props,
|
|
1329
1441
|
children: [
|
|
1330
1442
|
children,
|
|
1331
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ jsx18(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1332
1444
|
]
|
|
1333
1445
|
}
|
|
1334
1446
|
));
|
|
1335
1447
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1336
|
-
var ContextMenuSubContent =
|
|
1448
|
+
var ContextMenuSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1337
1449
|
ContextMenuPrimitive.SubContent,
|
|
1338
1450
|
{
|
|
1339
1451
|
ref,
|
|
@@ -1343,9 +1455,9 @@ var ContextMenuSubContent = React14.forwardRef(({ className, ...props }, ref) =>
|
|
|
1343
1455
|
}
|
|
1344
1456
|
));
|
|
1345
1457
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1346
|
-
var ContextMenuContent =
|
|
1458
|
+
var ContextMenuContent = React15.forwardRef(({ className, container, ...props }, ref) => {
|
|
1347
1459
|
const portalContainer = usePortalContainer(container);
|
|
1348
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ jsx18(ContextMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx18(
|
|
1349
1461
|
ContextMenuPrimitive.Content,
|
|
1350
1462
|
{
|
|
1351
1463
|
ref,
|
|
@@ -1356,7 +1468,7 @@ var ContextMenuContent = React14.forwardRef(({ className, container, ...props },
|
|
|
1356
1468
|
) });
|
|
1357
1469
|
});
|
|
1358
1470
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1359
|
-
var ContextMenuItem =
|
|
1471
|
+
var ContextMenuItem = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1360
1472
|
ContextMenuPrimitive.Item,
|
|
1361
1473
|
{
|
|
1362
1474
|
ref,
|
|
@@ -1371,7 +1483,7 @@ var ContextMenuItem = React14.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
1371
1483
|
}
|
|
1372
1484
|
));
|
|
1373
1485
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1374
|
-
var ContextMenuCheckboxItem =
|
|
1486
|
+
var ContextMenuCheckboxItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
1375
1487
|
ContextMenuPrimitive.CheckboxItem,
|
|
1376
1488
|
{
|
|
1377
1489
|
ref,
|
|
@@ -1379,13 +1491,13 @@ var ContextMenuCheckboxItem = React14.forwardRef(({ className, children, ...prop
|
|
|
1379
1491
|
className: cn(INDICATOR_ITEM_CLASS, className),
|
|
1380
1492
|
...props,
|
|
1381
1493
|
children: [
|
|
1382
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ jsx18("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx18(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx18(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1383
1495
|
children
|
|
1384
1496
|
]
|
|
1385
1497
|
}
|
|
1386
1498
|
));
|
|
1387
1499
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1388
|
-
var ContextMenuRadioItem =
|
|
1500
|
+
var ContextMenuRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs8(
|
|
1389
1501
|
ContextMenuPrimitive.RadioItem,
|
|
1390
1502
|
{
|
|
1391
1503
|
ref,
|
|
@@ -1393,13 +1505,13 @@ var ContextMenuRadioItem = React14.forwardRef(({ className, children, ...props }
|
|
|
1393
1505
|
className: cn(INDICATOR_ITEM_CLASS, className),
|
|
1394
1506
|
...props,
|
|
1395
1507
|
children: [
|
|
1396
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ jsx18("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx18(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx18(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1397
1509
|
children
|
|
1398
1510
|
]
|
|
1399
1511
|
}
|
|
1400
1512
|
));
|
|
1401
1513
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1402
|
-
var ContextMenuLabel =
|
|
1514
|
+
var ContextMenuLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1403
1515
|
ContextMenuPrimitive.Label,
|
|
1404
1516
|
{
|
|
1405
1517
|
ref,
|
|
@@ -1413,7 +1525,7 @@ var ContextMenuLabel = React14.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1413
1525
|
}
|
|
1414
1526
|
));
|
|
1415
1527
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1416
|
-
var ContextMenuSeparator =
|
|
1528
|
+
var ContextMenuSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1417
1529
|
ContextMenuPrimitive.Separator,
|
|
1418
1530
|
{
|
|
1419
1531
|
ref,
|
|
@@ -1426,7 +1538,7 @@ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
|
1426
1538
|
var ContextMenuShortcut = ({
|
|
1427
1539
|
className,
|
|
1428
1540
|
...props
|
|
1429
|
-
}) => /* @__PURE__ */
|
|
1541
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1430
1542
|
"span",
|
|
1431
1543
|
{
|
|
1432
1544
|
"data-slot": "context-menu-shortcut",
|
|
@@ -1438,18 +1550,18 @@ ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
|
1438
1550
|
|
|
1439
1551
|
// src/creatable-picker.tsx
|
|
1440
1552
|
import {
|
|
1441
|
-
useRef,
|
|
1442
|
-
useState as
|
|
1553
|
+
useRef as useRef2,
|
|
1554
|
+
useState as useState3
|
|
1443
1555
|
} from "react";
|
|
1444
1556
|
|
|
1445
1557
|
// src/popover.tsx
|
|
1446
1558
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1447
|
-
import * as
|
|
1448
|
-
import { jsx as
|
|
1559
|
+
import * as React16 from "react";
|
|
1560
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1449
1561
|
var Popover = PopoverPrimitive.Root;
|
|
1450
1562
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1451
1563
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
1452
|
-
var PopoverContent =
|
|
1564
|
+
var PopoverContent = React16.forwardRef(
|
|
1453
1565
|
({
|
|
1454
1566
|
className,
|
|
1455
1567
|
align = "center",
|
|
@@ -1459,7 +1571,7 @@ var PopoverContent = React15.forwardRef(
|
|
|
1459
1571
|
...props
|
|
1460
1572
|
}, ref) => {
|
|
1461
1573
|
const portalContainer = usePortalContainer(container);
|
|
1462
|
-
return /* @__PURE__ */
|
|
1574
|
+
return /* @__PURE__ */ jsx19(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx19(
|
|
1463
1575
|
PopoverPrimitive.Content,
|
|
1464
1576
|
{
|
|
1465
1577
|
ref,
|
|
@@ -1484,7 +1596,7 @@ var PopoverContent = React15.forwardRef(
|
|
|
1484
1596
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1485
1597
|
|
|
1486
1598
|
// src/creatable-picker.tsx
|
|
1487
|
-
import { jsx as
|
|
1599
|
+
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1488
1600
|
function article(noun) {
|
|
1489
1601
|
return /^[aeiou]/i.test(noun.trim()) ? `an ${noun}` : `a ${noun}`;
|
|
1490
1602
|
}
|
|
@@ -1511,11 +1623,11 @@ function CreatablePicker({
|
|
|
1511
1623
|
renderSelected,
|
|
1512
1624
|
size = "sm"
|
|
1513
1625
|
}) {
|
|
1514
|
-
const [open, setOpen] =
|
|
1515
|
-
const [query, setQuery] =
|
|
1516
|
-
const [busy, setBusy] =
|
|
1517
|
-
const inputRef =
|
|
1518
|
-
const [needsName, setNeedsName] =
|
|
1626
|
+
const [open, setOpen] = useState3(false);
|
|
1627
|
+
const [query, setQuery] = useState3("");
|
|
1628
|
+
const [busy, setBusy] = useState3(false);
|
|
1629
|
+
const inputRef = useRef2(null);
|
|
1630
|
+
const [needsName, setNeedsName] = useState3(false);
|
|
1519
1631
|
const selected = options.find((option) => option.value === value) ?? null;
|
|
1520
1632
|
const groups = [];
|
|
1521
1633
|
for (const option of options) {
|
|
@@ -1559,8 +1671,8 @@ function CreatablePicker({
|
|
|
1559
1671
|
setBusy(false);
|
|
1560
1672
|
}
|
|
1561
1673
|
};
|
|
1562
|
-
return /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1674
|
+
return /* @__PURE__ */ jsxs9(Popover, { open, onOpenChange: (next) => next ? setOpen(true) : close(), children: [
|
|
1675
|
+
/* @__PURE__ */ jsx20(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs9(
|
|
1564
1676
|
"button",
|
|
1565
1677
|
{
|
|
1566
1678
|
type: "button",
|
|
@@ -1574,12 +1686,12 @@ function CreatablePicker({
|
|
|
1574
1686
|
triggerClassName
|
|
1575
1687
|
),
|
|
1576
1688
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate", children: selected ? renderSelected ?? selected.render ?? selected.label : /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: loading ? "Loading\u2026" : placeholder }) }),
|
|
1690
|
+
/* @__PURE__ */ jsx20(ChevronsUpDownIcon, { className: "size-3.5 shrink-0 opacity-50" })
|
|
1579
1691
|
]
|
|
1580
1692
|
}
|
|
1581
1693
|
) }),
|
|
1582
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ jsx20(PopoverContent, { align: "start", className: "w-[--radix-popover-trigger-width] min-w-56 p-0", children: /* @__PURE__ */ jsxs9(
|
|
1583
1695
|
Command,
|
|
1584
1696
|
{
|
|
1585
1697
|
filter: (itemValue, search, keywords) => {
|
|
@@ -1587,7 +1699,7 @@ function CreatablePicker({
|
|
|
1587
1699
|
return haystack.includes(search.toLowerCase()) ? 1 : 0;
|
|
1588
1700
|
},
|
|
1589
1701
|
children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ jsx20(
|
|
1591
1703
|
CommandInput,
|
|
1592
1704
|
{
|
|
1593
1705
|
ref: inputRef,
|
|
@@ -1599,13 +1711,13 @@ function CreatablePicker({
|
|
|
1599
1711
|
placeholder: searchPlaceholder ?? `Search or add ${article(noun)}\u2026`
|
|
1600
1712
|
}
|
|
1601
1713
|
),
|
|
1602
|
-
/* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
groups.map((group) => /* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ jsxs9(CommandList, { children: [
|
|
1715
|
+
/* @__PURE__ */ jsx20(CommandEmpty, { children: emptyLabel }),
|
|
1716
|
+
groups.map((group) => /* @__PURE__ */ jsx20(
|
|
1605
1717
|
CommandGroup,
|
|
1606
1718
|
{
|
|
1607
1719
|
...group.heading === void 0 ? {} : { heading: group.heading },
|
|
1608
|
-
children: group.options.map((option) => /* @__PURE__ */
|
|
1720
|
+
children: group.options.map((option) => /* @__PURE__ */ jsxs9(
|
|
1609
1721
|
CommandItem,
|
|
1610
1722
|
{
|
|
1611
1723
|
value: option.label,
|
|
@@ -1616,7 +1728,7 @@ function CreatablePicker({
|
|
|
1616
1728
|
},
|
|
1617
1729
|
className: "gap-2 text-xs",
|
|
1618
1730
|
children: [
|
|
1619
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ jsx20(
|
|
1620
1732
|
LucideCheckIcon,
|
|
1621
1733
|
{
|
|
1622
1734
|
className: cn(
|
|
@@ -1625,8 +1737,8 @@ function CreatablePicker({
|
|
|
1625
1737
|
)
|
|
1626
1738
|
}
|
|
1627
1739
|
),
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
option.hint ? /* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate", children: option.render ?? option.label }),
|
|
1741
|
+
option.hint ? /* @__PURE__ */ jsx20("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: option.hint }) : null
|
|
1630
1742
|
]
|
|
1631
1743
|
},
|
|
1632
1744
|
option.value
|
|
@@ -1635,9 +1747,9 @@ function CreatablePicker({
|
|
|
1635
1747
|
group.heading ?? "__ungrouped__"
|
|
1636
1748
|
))
|
|
1637
1749
|
] }),
|
|
1638
|
-
canCreate ? /* @__PURE__ */
|
|
1639
|
-
createExtra && typed && !exactMatch ? /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1750
|
+
canCreate ? /* @__PURE__ */ jsxs9("div", { className: "space-y-1 border-t border-border p-1", children: [
|
|
1751
|
+
createExtra && typed && !exactMatch ? /* @__PURE__ */ jsx20("div", { className: "px-1 pt-0.5", children: typeof createExtra === "function" ? createExtra(typed) : createExtra }) : null,
|
|
1752
|
+
/* @__PURE__ */ jsxs9(
|
|
1641
1753
|
"button",
|
|
1642
1754
|
{
|
|
1643
1755
|
type: "button",
|
|
@@ -1645,22 +1757,22 @@ function CreatablePicker({
|
|
|
1645
1757
|
onClick: () => void create(typed),
|
|
1646
1758
|
className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",
|
|
1647
1759
|
children: [
|
|
1648
|
-
busy ? /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1760
|
+
busy ? /* @__PURE__ */ jsx20(Loader2Icon, { className: "size-3.5 shrink-0 matrx-spin" }) : /* @__PURE__ */ jsx20(PlusIcon, { className: "size-3.5 shrink-0" }),
|
|
1761
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 truncate", children: typed && !exactMatch ? `Create \u201C${typed}\u201D` : `Add ${article(noun)}\u2026` })
|
|
1650
1762
|
]
|
|
1651
1763
|
}
|
|
1652
1764
|
),
|
|
1653
|
-
needsName ? /* @__PURE__ */
|
|
1765
|
+
needsName ? /* @__PURE__ */ jsxs9("p", { className: "px-2 pb-0.5 text-[11px] leading-snug text-muted-foreground", children: [
|
|
1654
1766
|
"Type the name of the ",
|
|
1655
1767
|
noun,
|
|
1656
1768
|
" you want to add \u2014 then this creates it."
|
|
1657
1769
|
] }) : null
|
|
1658
1770
|
] }) : null,
|
|
1659
|
-
footerActions?.length || manageAction ? /* @__PURE__ */
|
|
1771
|
+
footerActions?.length || manageAction ? /* @__PURE__ */ jsxs9("div", { className: "space-y-0.5 border-t border-border p-1", children: [
|
|
1660
1772
|
footerActions?.map((action) => {
|
|
1661
1773
|
const Icon2 = action.icon;
|
|
1662
|
-
return /* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsxs9("div", { children: [
|
|
1775
|
+
/* @__PURE__ */ jsxs9(
|
|
1664
1776
|
"button",
|
|
1665
1777
|
{
|
|
1666
1778
|
type: "button",
|
|
@@ -1670,15 +1782,15 @@ function CreatablePicker({
|
|
|
1670
1782
|
},
|
|
1671
1783
|
className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
1672
1784
|
children: [
|
|
1673
|
-
Icon2 ? /* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1785
|
+
Icon2 ? /* @__PURE__ */ jsx20(Icon2, { className: "size-3.5 shrink-0" }) : null,
|
|
1786
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 truncate", children: action.label })
|
|
1675
1787
|
]
|
|
1676
1788
|
}
|
|
1677
1789
|
),
|
|
1678
|
-
action.note ? /* @__PURE__ */
|
|
1790
|
+
action.note ? /* @__PURE__ */ jsx20("p", { className: "px-2 pb-1 text-[10px] leading-snug text-muted-foreground", children: action.note }) : null
|
|
1679
1791
|
] }, action.label);
|
|
1680
1792
|
}),
|
|
1681
|
-
manageAction ? /* @__PURE__ */
|
|
1793
|
+
manageAction ? /* @__PURE__ */ jsxs9(
|
|
1682
1794
|
"a",
|
|
1683
1795
|
{
|
|
1684
1796
|
href: manageAction.href,
|
|
@@ -1687,18 +1799,18 @@ function CreatablePicker({
|
|
|
1687
1799
|
onClick: close,
|
|
1688
1800
|
className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
1689
1801
|
children: [
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1802
|
+
/* @__PURE__ */ jsx20(ExternalLinkIcon, { className: "size-3.5 shrink-0" }),
|
|
1803
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 truncate", children: manageAction.label })
|
|
1692
1804
|
]
|
|
1693
1805
|
}
|
|
1694
1806
|
) : null
|
|
1695
1807
|
] }) : null,
|
|
1696
|
-
lockedNote ? /* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1808
|
+
lockedNote ? /* @__PURE__ */ jsxs9("div", { className: "space-y-1 border-t border-border p-2", children: [
|
|
1809
|
+
/* @__PURE__ */ jsxs9("p", { className: "flex gap-1.5 text-[11px] leading-snug text-muted-foreground", children: [
|
|
1810
|
+
/* @__PURE__ */ jsx20(LockIcon, { className: "mt-px size-3 shrink-0" }),
|
|
1811
|
+
/* @__PURE__ */ jsx20("span", { children: lockedNote })
|
|
1700
1812
|
] }),
|
|
1701
|
-
lockedAction ? /* @__PURE__ */
|
|
1813
|
+
lockedAction ? /* @__PURE__ */ jsxs9(
|
|
1702
1814
|
"button",
|
|
1703
1815
|
{
|
|
1704
1816
|
type: "button",
|
|
@@ -1708,8 +1820,8 @@ function CreatablePicker({
|
|
|
1708
1820
|
},
|
|
1709
1821
|
className: "flex w-full items-center gap-2 rounded-sm px-1 py-1 text-left text-xs font-medium text-primary transition-colors hover:bg-accent",
|
|
1710
1822
|
children: [
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1823
|
+
/* @__PURE__ */ jsx20(PlusIcon, { className: "size-3.5 shrink-0" }),
|
|
1824
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 truncate", children: lockedAction.label })
|
|
1713
1825
|
]
|
|
1714
1826
|
}
|
|
1715
1827
|
) : null
|
|
@@ -1724,14 +1836,14 @@ function CreatablePicker({
|
|
|
1724
1836
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
1725
1837
|
import * as VisuallyHidden2 from "@radix-ui/react-visually-hidden";
|
|
1726
1838
|
import { treeContainsComponent as treeContainsComponent3 } from "@ai-matrx/kit/react-tree";
|
|
1727
|
-
import * as
|
|
1728
|
-
import { jsx as
|
|
1839
|
+
import * as React17 from "react";
|
|
1840
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1729
1841
|
var Dialog = ({
|
|
1730
1842
|
children,
|
|
1731
1843
|
...props
|
|
1732
1844
|
}) => {
|
|
1733
1845
|
const modal = props.modal ?? true;
|
|
1734
|
-
return /* @__PURE__ */
|
|
1846
|
+
return /* @__PURE__ */ jsx21(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx21(DialogPrimitive2.Root, { ...props, modal, children }) });
|
|
1735
1847
|
};
|
|
1736
1848
|
Dialog.displayName = "Dialog";
|
|
1737
1849
|
var DialogTrigger = DialogPrimitive2.Trigger;
|
|
@@ -1741,12 +1853,12 @@ var DialogPortal = ({
|
|
|
1741
1853
|
...props
|
|
1742
1854
|
}) => {
|
|
1743
1855
|
const resolved = usePortalContainer(container);
|
|
1744
|
-
return /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsx21(DialogPrimitive2.Portal, { container: resolved ?? null, ...props });
|
|
1745
1857
|
};
|
|
1746
1858
|
DialogPortal.displayName = "DialogPortal";
|
|
1747
|
-
var DialogContainerContext =
|
|
1748
|
-
var useDialogContainer = () =>
|
|
1749
|
-
var DialogOverlay =
|
|
1859
|
+
var DialogContainerContext = React17.createContext(null);
|
|
1860
|
+
var useDialogContainer = () => React17.useContext(DialogContainerContext);
|
|
1861
|
+
var DialogOverlay = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1750
1862
|
DialogPrimitive2.Overlay,
|
|
1751
1863
|
{
|
|
1752
1864
|
ref,
|
|
@@ -1762,9 +1874,9 @@ var DialogOverlay = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1762
1874
|
}
|
|
1763
1875
|
));
|
|
1764
1876
|
DialogOverlay.displayName = DialogPrimitive2.Overlay.displayName;
|
|
1765
|
-
var DialogContentPrimitive =
|
|
1877
|
+
var DialogContentPrimitive = React17.forwardRef((props, ref) => {
|
|
1766
1878
|
const isModal = useRadixDialogModal();
|
|
1767
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsx21(
|
|
1768
1880
|
DialogPrimitive2.Content,
|
|
1769
1881
|
{
|
|
1770
1882
|
...props,
|
|
@@ -1777,7 +1889,7 @@ DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
|
1777
1889
|
var DIALOG_DESKTOP_CLASSES2 = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} 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`;
|
|
1778
1890
|
var DIALOG_MOBILE_SHEET_CLASSES2 = "matrx-mobile-sheet 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 [--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";
|
|
1779
1891
|
var DIALOG_MOBILE_SHEET_OVERRIDE2 = "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";
|
|
1780
|
-
var DialogContent =
|
|
1892
|
+
var DialogContent = React17.forwardRef(
|
|
1781
1893
|
({
|
|
1782
1894
|
className,
|
|
1783
1895
|
children,
|
|
@@ -1791,10 +1903,10 @@ var DialogContent = React16.forwardRef(
|
|
|
1791
1903
|
const isModal = useRadixDialogModal();
|
|
1792
1904
|
const injectedContainer = usePortalContainer(container);
|
|
1793
1905
|
const asSheet = mobileSheet && isMobile;
|
|
1794
|
-
const [containerEl, setContainerEl] =
|
|
1906
|
+
const [containerEl, setContainerEl] = React17.useState(
|
|
1795
1907
|
null
|
|
1796
1908
|
);
|
|
1797
|
-
const mergedRef =
|
|
1909
|
+
const mergedRef = React17.useCallback(
|
|
1798
1910
|
(node) => {
|
|
1799
1911
|
setContainerEl(node);
|
|
1800
1912
|
if (typeof ref === "function") ref(node);
|
|
@@ -1805,9 +1917,9 @@ var DialogContent = React16.forwardRef(
|
|
|
1805
1917
|
);
|
|
1806
1918
|
const hasTitle = treeContainsComponent3(children, DialogTitle) || treeContainsComponent3(children, DialogPrimitive2.Title);
|
|
1807
1919
|
const hasDescription = treeContainsComponent3(children, DialogDescription) || treeContainsComponent3(children, DialogPrimitive2.Description);
|
|
1808
|
-
return /* @__PURE__ */
|
|
1809
|
-
isModal ? /* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsxs10(DialogPortal, { container, children: [
|
|
1921
|
+
isModal ? /* @__PURE__ */ jsx21(DialogOverlay, {}) : null,
|
|
1922
|
+
/* @__PURE__ */ jsxs10(
|
|
1811
1923
|
DialogContentPrimitive,
|
|
1812
1924
|
{
|
|
1813
1925
|
ref: mergedRef,
|
|
@@ -1826,23 +1938,23 @@ var DialogContent = React16.forwardRef(
|
|
|
1826
1938
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1827
1939
|
...props,
|
|
1828
1940
|
children: [
|
|
1829
|
-
hasTitle ? null : /* @__PURE__ */
|
|
1830
|
-
/* @__PURE__ */
|
|
1941
|
+
hasTitle ? null : /* @__PURE__ */ jsx21(VisuallyHidden2.Root, { children: /* @__PURE__ */ jsx21(DialogPrimitive2.Title, { children: "Dialog" }) }),
|
|
1942
|
+
/* @__PURE__ */ jsx21(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ jsx21(
|
|
1831
1943
|
PortalContainerProvider,
|
|
1832
1944
|
{
|
|
1833
1945
|
container: containerEl ?? injectedContainer ?? null,
|
|
1834
1946
|
children
|
|
1835
1947
|
}
|
|
1836
1948
|
) }),
|
|
1837
|
-
showCloseButton ? /* @__PURE__ */
|
|
1949
|
+
showCloseButton ? /* @__PURE__ */ jsxs10(
|
|
1838
1950
|
DialogPrimitive2.Close,
|
|
1839
1951
|
{
|
|
1840
1952
|
"data-slot": "dialog-close",
|
|
1841
1953
|
"aria-label": "Close",
|
|
1842
1954
|
className: "absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10",
|
|
1843
1955
|
children: [
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ jsx21(XIcon, { className: "h-4 w-4" }),
|
|
1957
|
+
/* @__PURE__ */ jsx21("span", { className: "sr-only", children: "Close" })
|
|
1846
1958
|
]
|
|
1847
1959
|
}
|
|
1848
1960
|
) : null
|
|
@@ -1856,7 +1968,7 @@ DialogContent.displayName = DialogPrimitive2.Content.displayName;
|
|
|
1856
1968
|
var DialogHeader = ({
|
|
1857
1969
|
className,
|
|
1858
1970
|
...props
|
|
1859
|
-
}) => /* @__PURE__ */
|
|
1971
|
+
}) => /* @__PURE__ */ jsx21(
|
|
1860
1972
|
"div",
|
|
1861
1973
|
{
|
|
1862
1974
|
"data-slot": "dialog-header",
|
|
@@ -1873,7 +1985,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
1873
1985
|
var DialogFooter = ({
|
|
1874
1986
|
className,
|
|
1875
1987
|
...props
|
|
1876
|
-
}) => /* @__PURE__ */
|
|
1988
|
+
}) => /* @__PURE__ */ jsx21(
|
|
1877
1989
|
"div",
|
|
1878
1990
|
{
|
|
1879
1991
|
"data-slot": "dialog-footer",
|
|
@@ -1887,7 +1999,7 @@ var DialogFooter = ({
|
|
|
1887
1999
|
}
|
|
1888
2000
|
);
|
|
1889
2001
|
DialogFooter.displayName = "DialogFooter";
|
|
1890
|
-
var DialogTitle =
|
|
2002
|
+
var DialogTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1891
2003
|
DialogPrimitive2.Title,
|
|
1892
2004
|
{
|
|
1893
2005
|
ref,
|
|
@@ -1897,7 +2009,7 @@ var DialogTitle = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1897
2009
|
}
|
|
1898
2010
|
));
|
|
1899
2011
|
DialogTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
1900
|
-
var DialogDescription =
|
|
2012
|
+
var DialogDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1901
2013
|
DialogPrimitive2.Description,
|
|
1902
2014
|
{
|
|
1903
2015
|
ref,
|
|
@@ -1910,8 +2022,8 @@ DialogDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
|
1910
2022
|
|
|
1911
2023
|
// src/dropdown-menu.tsx
|
|
1912
2024
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1913
|
-
import * as
|
|
1914
|
-
import { jsx as
|
|
2025
|
+
import * as React18 from "react";
|
|
2026
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1915
2027
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1916
2028
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1917
2029
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
@@ -1921,7 +2033,7 @@ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
|
1921
2033
|
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";
|
|
1922
2034
|
var MENU_ITEM_CLASS = "relative flex cursor-default 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]:pointer-events-none data-[disabled]:opacity-50";
|
|
1923
2035
|
var MENU_INDICATOR_ITEM_CLASS = "relative flex cursor-default 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]:pointer-events-none data-[disabled]:opacity-50";
|
|
1924
|
-
var DropdownMenuSubTrigger =
|
|
2036
|
+
var DropdownMenuSubTrigger = React18.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1925
2037
|
DropdownMenuPrimitive.SubTrigger,
|
|
1926
2038
|
{
|
|
1927
2039
|
ref,
|
|
@@ -1934,12 +2046,12 @@ var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, .
|
|
|
1934
2046
|
...props,
|
|
1935
2047
|
children: [
|
|
1936
2048
|
children,
|
|
1937
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsx22(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1938
2050
|
]
|
|
1939
2051
|
}
|
|
1940
2052
|
));
|
|
1941
2053
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1942
|
-
var DropdownMenuSubContent =
|
|
2054
|
+
var DropdownMenuSubContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1943
2055
|
DropdownMenuPrimitive.SubContent,
|
|
1944
2056
|
{
|
|
1945
2057
|
ref,
|
|
@@ -1949,9 +2061,9 @@ var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) =
|
|
|
1949
2061
|
}
|
|
1950
2062
|
));
|
|
1951
2063
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1952
|
-
var DropdownMenuContent =
|
|
2064
|
+
var DropdownMenuContent = React18.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
1953
2065
|
const portalContainer = usePortalContainer(container);
|
|
1954
|
-
return /* @__PURE__ */
|
|
2066
|
+
return /* @__PURE__ */ jsx22(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx22(
|
|
1955
2067
|
DropdownMenuPrimitive.Content,
|
|
1956
2068
|
{
|
|
1957
2069
|
ref,
|
|
@@ -1968,7 +2080,7 @@ var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, conta
|
|
|
1968
2080
|
) });
|
|
1969
2081
|
});
|
|
1970
2082
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1971
|
-
var DropdownMenuItem =
|
|
2083
|
+
var DropdownMenuItem = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1972
2084
|
DropdownMenuPrimitive.Item,
|
|
1973
2085
|
{
|
|
1974
2086
|
ref,
|
|
@@ -1978,7 +2090,7 @@ var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1978
2090
|
}
|
|
1979
2091
|
));
|
|
1980
2092
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1981
|
-
var DropdownMenuCheckboxItem =
|
|
2093
|
+
var DropdownMenuCheckboxItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1982
2094
|
DropdownMenuPrimitive.CheckboxItem,
|
|
1983
2095
|
{
|
|
1984
2096
|
ref,
|
|
@@ -1986,13 +2098,13 @@ var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...pro
|
|
|
1986
2098
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
1987
2099
|
...props,
|
|
1988
2100
|
children: [
|
|
1989
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx22("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx22(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx22(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1990
2102
|
children
|
|
1991
2103
|
]
|
|
1992
2104
|
}
|
|
1993
2105
|
));
|
|
1994
2106
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1995
|
-
var DropdownMenuRadioItem =
|
|
2107
|
+
var DropdownMenuRadioItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1996
2108
|
DropdownMenuPrimitive.RadioItem,
|
|
1997
2109
|
{
|
|
1998
2110
|
ref,
|
|
@@ -2000,13 +2112,13 @@ var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props
|
|
|
2000
2112
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
2001
2113
|
...props,
|
|
2002
2114
|
children: [
|
|
2003
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx22("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx22(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx22(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
2004
2116
|
children
|
|
2005
2117
|
]
|
|
2006
2118
|
}
|
|
2007
2119
|
));
|
|
2008
2120
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2009
|
-
var DropdownMenuLabel =
|
|
2121
|
+
var DropdownMenuLabel = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2010
2122
|
DropdownMenuPrimitive.Label,
|
|
2011
2123
|
{
|
|
2012
2124
|
ref,
|
|
@@ -2016,7 +2128,7 @@ var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2016
2128
|
}
|
|
2017
2129
|
));
|
|
2018
2130
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2019
|
-
var DropdownMenuSeparator =
|
|
2131
|
+
var DropdownMenuSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2020
2132
|
DropdownMenuPrimitive.Separator,
|
|
2021
2133
|
{
|
|
2022
2134
|
ref,
|
|
@@ -2029,7 +2141,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
|
2029
2141
|
var DropdownMenuShortcut = ({
|
|
2030
2142
|
className,
|
|
2031
2143
|
...props
|
|
2032
|
-
}) => /* @__PURE__ */
|
|
2144
|
+
}) => /* @__PURE__ */ jsx22(
|
|
2033
2145
|
"span",
|
|
2034
2146
|
{
|
|
2035
2147
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -2040,8 +2152,8 @@ var DropdownMenuShortcut = ({
|
|
|
2040
2152
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2041
2153
|
|
|
2042
2154
|
// src/editable-label.tsx
|
|
2043
|
-
import { useCallback as
|
|
2044
|
-
import { jsx as
|
|
2155
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef3, useState as useState5 } from "react";
|
|
2156
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2045
2157
|
function EditableLabel({
|
|
2046
2158
|
value,
|
|
2047
2159
|
onCommit,
|
|
@@ -2061,22 +2173,22 @@ function EditableLabel({
|
|
|
2061
2173
|
inputClassName
|
|
2062
2174
|
}) {
|
|
2063
2175
|
const controlled = activation === "controlled";
|
|
2064
|
-
const [internalEditing, setInternalEditing] =
|
|
2176
|
+
const [internalEditing, setInternalEditing] = useState5(false);
|
|
2065
2177
|
const editing = controlled ? !!editingProp : internalEditing;
|
|
2066
|
-
const [draft, setDraft] =
|
|
2067
|
-
const [error, setError] =
|
|
2068
|
-
const [busy, setBusy] =
|
|
2069
|
-
const inputRef =
|
|
2070
|
-
|
|
2178
|
+
const [draft, setDraft] = useState5(value);
|
|
2179
|
+
const [error, setError] = useState5(null);
|
|
2180
|
+
const [busy, setBusy] = useState5(false);
|
|
2181
|
+
const inputRef = useRef3(null);
|
|
2182
|
+
useEffect3(() => {
|
|
2071
2183
|
if (!editing) setDraft(value);
|
|
2072
2184
|
}, [value, editing]);
|
|
2073
|
-
|
|
2185
|
+
useEffect3(() => {
|
|
2074
2186
|
if (editing && inputRef.current) {
|
|
2075
2187
|
inputRef.current.focus();
|
|
2076
2188
|
if (selectOnEdit) inputRef.current.select();
|
|
2077
2189
|
}
|
|
2078
2190
|
}, [editing, selectOnEdit]);
|
|
2079
|
-
const setEditing =
|
|
2191
|
+
const setEditing = useCallback3(
|
|
2080
2192
|
(next) => {
|
|
2081
2193
|
if (controlled) {
|
|
2082
2194
|
onEditingChange?.(next);
|
|
@@ -2087,18 +2199,18 @@ function EditableLabel({
|
|
|
2087
2199
|
},
|
|
2088
2200
|
[controlled, onEditingChange]
|
|
2089
2201
|
);
|
|
2090
|
-
const startEdit =
|
|
2202
|
+
const startEdit = useCallback3(() => {
|
|
2091
2203
|
setDraft(value);
|
|
2092
2204
|
setError(null);
|
|
2093
2205
|
setEditing(true);
|
|
2094
2206
|
}, [value, setEditing]);
|
|
2095
|
-
const cancel =
|
|
2207
|
+
const cancel = useCallback3(() => {
|
|
2096
2208
|
setDraft(value);
|
|
2097
2209
|
setError(null);
|
|
2098
2210
|
setBusy(false);
|
|
2099
2211
|
setEditing(false);
|
|
2100
2212
|
}, [value, setEditing]);
|
|
2101
|
-
const commit =
|
|
2213
|
+
const commit = useCallback3(() => {
|
|
2102
2214
|
if (busy) return;
|
|
2103
2215
|
const trimmed = draft.trim();
|
|
2104
2216
|
const next = trimmed || emptyFallback;
|
|
@@ -2148,8 +2260,8 @@ function EditableLabel({
|
|
|
2148
2260
|
setEditing
|
|
2149
2261
|
]);
|
|
2150
2262
|
if (editing) {
|
|
2151
|
-
return /* @__PURE__ */
|
|
2152
|
-
/* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsxs12("span", { className: cn("relative flex min-w-0 flex-1 items-center", className), children: [
|
|
2264
|
+
/* @__PURE__ */ jsx23(
|
|
2153
2265
|
"input",
|
|
2154
2266
|
{
|
|
2155
2267
|
ref: inputRef,
|
|
@@ -2189,12 +2301,12 @@ function EditableLabel({
|
|
|
2189
2301
|
)
|
|
2190
2302
|
}
|
|
2191
2303
|
),
|
|
2192
|
-
busy && /* @__PURE__ */
|
|
2193
|
-
error && /* @__PURE__ */
|
|
2304
|
+
busy && /* @__PURE__ */ jsx23(Loader2Icon, { className: "absolute right-1 h-3.5 w-3.5 matrx-spin text-muted-foreground" }),
|
|
2305
|
+
error && /* @__PURE__ */ jsx23("span", { className: "absolute left-0 top-full mt-0.5 whitespace-nowrap text-xs text-destructive", children: error })
|
|
2194
2306
|
] });
|
|
2195
2307
|
}
|
|
2196
2308
|
if (controlled) return null;
|
|
2197
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx23(
|
|
2198
2310
|
"button",
|
|
2199
2311
|
{
|
|
2200
2312
|
type: "button",
|
|
@@ -2228,8 +2340,8 @@ function EditableLabel({
|
|
|
2228
2340
|
}
|
|
2229
2341
|
|
|
2230
2342
|
// src/input.tsx
|
|
2231
|
-
import * as
|
|
2232
|
-
import { jsx as
|
|
2343
|
+
import * as React19 from "react";
|
|
2344
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2233
2345
|
var getVariantStyles = (variant = "default") => {
|
|
2234
2346
|
const baseStyles = `flex h-10 w-full border border-border bg-background text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
|
|
2235
2347
|
file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
|
|
@@ -2257,9 +2369,9 @@ var getVariantStyles = (variant = "default") => {
|
|
|
2257
2369
|
return baseStyles;
|
|
2258
2370
|
}
|
|
2259
2371
|
};
|
|
2260
|
-
var Input =
|
|
2372
|
+
var Input = React19.forwardRef(
|
|
2261
2373
|
({ className, type, variant = "default", ...props }, ref) => {
|
|
2262
|
-
return /* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsx24(
|
|
2263
2375
|
"input",
|
|
2264
2376
|
{
|
|
2265
2377
|
type,
|
|
@@ -2271,7 +2383,7 @@ var Input = React18.forwardRef(
|
|
|
2271
2383
|
}
|
|
2272
2384
|
);
|
|
2273
2385
|
Input.displayName = "Input";
|
|
2274
|
-
var EnterInput =
|
|
2386
|
+
var EnterInput = React19.forwardRef(
|
|
2275
2387
|
({ onEnter, ...props }, ref) => {
|
|
2276
2388
|
const handleKeyDown = (e) => {
|
|
2277
2389
|
if (e.key === "Enter" && onEnter) {
|
|
@@ -2279,7 +2391,7 @@ var EnterInput = React18.forwardRef(
|
|
|
2279
2391
|
onEnter();
|
|
2280
2392
|
}
|
|
2281
2393
|
};
|
|
2282
|
-
return /* @__PURE__ */
|
|
2394
|
+
return /* @__PURE__ */ jsx24(
|
|
2283
2395
|
Input,
|
|
2284
2396
|
{
|
|
2285
2397
|
...props,
|
|
@@ -2295,11 +2407,11 @@ var EnterInput = React18.forwardRef(
|
|
|
2295
2407
|
}
|
|
2296
2408
|
);
|
|
2297
2409
|
EnterInput.displayName = "EnterInput";
|
|
2298
|
-
var BasicInput =
|
|
2410
|
+
var BasicInput = React19.forwardRef(
|
|
2299
2411
|
// `variant` is accepted (prop-compatible with Input) but intentionally
|
|
2300
2412
|
// unused — and destructured so it never leaks onto the DOM element.
|
|
2301
2413
|
({ className, type, variant: _variant = "default", ...props }, ref) => {
|
|
2302
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsx24(
|
|
2303
2415
|
"input",
|
|
2304
2416
|
{
|
|
2305
2417
|
type,
|
|
@@ -2314,10 +2426,10 @@ var BasicInput = React18.forwardRef(
|
|
|
2314
2426
|
}
|
|
2315
2427
|
);
|
|
2316
2428
|
BasicInput.displayName = "BasicInput";
|
|
2317
|
-
var InputWithPrefix =
|
|
2318
|
-
return /* @__PURE__ */
|
|
2319
|
-
prefix && /* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2429
|
+
var InputWithPrefix = React19.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
|
|
2430
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("relative", wrapperClassName), children: [
|
|
2431
|
+
prefix && /* @__PURE__ */ jsx24("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
|
|
2432
|
+
/* @__PURE__ */ jsx24(
|
|
2321
2433
|
Input,
|
|
2322
2434
|
{
|
|
2323
2435
|
ref,
|
|
@@ -2331,9 +2443,9 @@ InputWithPrefix.displayName = "InputWithPrefix";
|
|
|
2331
2443
|
|
|
2332
2444
|
// src/label.tsx
|
|
2333
2445
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2334
|
-
import * as
|
|
2335
|
-
import { jsx as
|
|
2336
|
-
var Label3 =
|
|
2446
|
+
import * as React20 from "react";
|
|
2447
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2448
|
+
var Label3 = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
2337
2449
|
LabelPrimitive.Root,
|
|
2338
2450
|
{
|
|
2339
2451
|
ref,
|
|
@@ -2347,8 +2459,8 @@ var Label3 = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
2347
2459
|
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
2348
2460
|
|
|
2349
2461
|
// src/overflow-toolbar.tsx
|
|
2350
|
-
import { useLayoutEffect, useMemo, useRef as
|
|
2351
|
-
import { Fragment, jsx as
|
|
2462
|
+
import { useLayoutEffect, useMemo, useRef as useRef4, useState as useState6 } from "react";
|
|
2463
|
+
import { Fragment, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2352
2464
|
var GAP_PX = 6;
|
|
2353
2465
|
var TONE = {
|
|
2354
2466
|
default: "border border-border bg-background hover:bg-accent text-foreground",
|
|
@@ -2370,16 +2482,16 @@ function ToolbarButton({
|
|
|
2370
2482
|
action.hideLabel && !action.running ? "w-7 justify-center px-0" : "px-2",
|
|
2371
2483
|
TONE[tone]
|
|
2372
2484
|
);
|
|
2373
|
-
const inner = /* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2485
|
+
const inner = /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
2486
|
+
/* @__PURE__ */ jsx26(
|
|
2375
2487
|
Icon2,
|
|
2376
2488
|
{
|
|
2377
2489
|
className: cn("w-3.5 h-3.5 shrink-0", action.running && "matrx-spin")
|
|
2378
2490
|
}
|
|
2379
2491
|
),
|
|
2380
|
-
showLabel && /* @__PURE__ */
|
|
2492
|
+
showLabel && /* @__PURE__ */ jsx26("span", { children: text })
|
|
2381
2493
|
] });
|
|
2382
|
-
const control = action.href && !action.disabled ? /* @__PURE__ */
|
|
2494
|
+
const control = action.href && !action.disabled ? /* @__PURE__ */ jsx26(
|
|
2383
2495
|
"a",
|
|
2384
2496
|
{
|
|
2385
2497
|
href: action.href,
|
|
@@ -2389,7 +2501,7 @@ function ToolbarButton({
|
|
|
2389
2501
|
"aria-label": action.label,
|
|
2390
2502
|
children: inner
|
|
2391
2503
|
}
|
|
2392
|
-
) : /* @__PURE__ */
|
|
2504
|
+
) : /* @__PURE__ */ jsx26(
|
|
2393
2505
|
"button",
|
|
2394
2506
|
{
|
|
2395
2507
|
type: "button",
|
|
@@ -2401,12 +2513,12 @@ function ToolbarButton({
|
|
|
2401
2513
|
}
|
|
2402
2514
|
);
|
|
2403
2515
|
if (enableTooltip && action.hideLabel && renderTooltip) {
|
|
2404
|
-
return /* @__PURE__ */
|
|
2516
|
+
return /* @__PURE__ */ jsx26(Fragment, { children: renderTooltip(control, action.label) });
|
|
2405
2517
|
}
|
|
2406
2518
|
return control;
|
|
2407
2519
|
}
|
|
2408
2520
|
function OverflowTrigger({ ariaLabel }) {
|
|
2409
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ jsx26(
|
|
2410
2522
|
"button",
|
|
2411
2523
|
{
|
|
2412
2524
|
type: "button",
|
|
@@ -2417,7 +2529,7 @@ function OverflowTrigger({ ariaLabel }) {
|
|
|
2417
2529
|
"inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors",
|
|
2418
2530
|
"border border-border bg-background hover:bg-accent text-foreground"
|
|
2419
2531
|
),
|
|
2420
|
-
children: /* @__PURE__ */
|
|
2532
|
+
children: /* @__PURE__ */ jsx26(MoreHorizontalIcon, { className: "w-3.5 h-3.5" })
|
|
2421
2533
|
}
|
|
2422
2534
|
);
|
|
2423
2535
|
}
|
|
@@ -2433,10 +2545,10 @@ function OverflowToolbar({
|
|
|
2433
2545
|
() => actions.filter((a) => !a.hidden),
|
|
2434
2546
|
[actions]
|
|
2435
2547
|
);
|
|
2436
|
-
const containerRef =
|
|
2437
|
-
const ghostRef =
|
|
2438
|
-
const leadingRef =
|
|
2439
|
-
const [visibleCount, setVisibleCount] =
|
|
2548
|
+
const containerRef = useRef4(null);
|
|
2549
|
+
const ghostRef = useRef4(null);
|
|
2550
|
+
const leadingRef = useRef4(null);
|
|
2551
|
+
const [visibleCount, setVisibleCount] = useState6(visibleActions.length);
|
|
2440
2552
|
const signature = visibleActions.map(
|
|
2441
2553
|
(a) => `${a.id}:${a.hideLabel ? 1 : 0}:${a.running ? 1 : 0}:${a.runningLabel ?? ""}:${a.label}`
|
|
2442
2554
|
).join("|");
|
|
@@ -2477,22 +2589,22 @@ function OverflowToolbar({
|
|
|
2477
2589
|
}, [signature, leading != null]);
|
|
2478
2590
|
const shown = visibleActions.slice(0, visibleCount);
|
|
2479
2591
|
const hidden = visibleActions.slice(visibleCount);
|
|
2480
|
-
return /* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ jsxs14("div", { ref: containerRef, className: cn("relative min-w-0", className), children: [
|
|
2593
|
+
/* @__PURE__ */ jsxs14(
|
|
2482
2594
|
"div",
|
|
2483
2595
|
{
|
|
2484
2596
|
ref: ghostRef,
|
|
2485
2597
|
"aria-hidden": true,
|
|
2486
2598
|
className: "pointer-events-none absolute left-0 top-0 flex items-center gap-1.5 opacity-0",
|
|
2487
2599
|
children: [
|
|
2488
|
-
visibleActions.map((a) => /* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2600
|
+
visibleActions.map((a) => /* @__PURE__ */ jsx26(ToolbarButton, { action: a }, a.id)),
|
|
2601
|
+
/* @__PURE__ */ jsx26(OverflowTrigger, { ariaLabel: overflowAriaLabel })
|
|
2490
2602
|
]
|
|
2491
2603
|
}
|
|
2492
2604
|
),
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
leading != null && /* @__PURE__ */
|
|
2495
|
-
shown.map((a) => /* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
2606
|
+
leading != null && /* @__PURE__ */ jsx26("span", { ref: leadingRef, className: "shrink-0", children: leading }),
|
|
2607
|
+
shown.map((a) => /* @__PURE__ */ jsx26(
|
|
2496
2608
|
ToolbarButton,
|
|
2497
2609
|
{
|
|
2498
2610
|
action: a,
|
|
@@ -2503,7 +2615,7 @@ function OverflowToolbar({
|
|
|
2503
2615
|
)),
|
|
2504
2616
|
hidden.length > 0 && renderOverflowMenu({
|
|
2505
2617
|
actions: hidden,
|
|
2506
|
-
trigger: /* @__PURE__ */
|
|
2618
|
+
trigger: /* @__PURE__ */ jsx26(OverflowTrigger, { ariaLabel: overflowAriaLabel })
|
|
2507
2619
|
})
|
|
2508
2620
|
] })
|
|
2509
2621
|
] });
|
|
@@ -2511,20 +2623,20 @@ function OverflowToolbar({
|
|
|
2511
2623
|
|
|
2512
2624
|
// src/progress.tsx
|
|
2513
2625
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
2514
|
-
import * as
|
|
2515
|
-
import { jsx as
|
|
2626
|
+
import * as React22 from "react";
|
|
2627
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2516
2628
|
var PROGRESS_TONES = {
|
|
2517
2629
|
default: "bg-primary",
|
|
2518
2630
|
success: "bg-success",
|
|
2519
2631
|
warning: "bg-warning",
|
|
2520
2632
|
destructive: "bg-destructive"
|
|
2521
2633
|
};
|
|
2522
|
-
var Progress =
|
|
2634
|
+
var Progress = React22.forwardRef(({ className, tone = "default", indicatorClassName, ...props }, ref) => {
|
|
2523
2635
|
const { value, max } = props;
|
|
2524
2636
|
const ceiling = max ?? 100;
|
|
2525
2637
|
const isIndeterminate = value === null || value === void 0;
|
|
2526
2638
|
const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, value / ceiling * 100));
|
|
2527
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsx27(
|
|
2528
2640
|
ProgressPrimitive.Root,
|
|
2529
2641
|
{
|
|
2530
2642
|
ref,
|
|
@@ -2534,7 +2646,7 @@ var Progress = React21.forwardRef(({ className, tone = "default", indicatorClass
|
|
|
2534
2646
|
className
|
|
2535
2647
|
),
|
|
2536
2648
|
...props,
|
|
2537
|
-
children: /* @__PURE__ */
|
|
2649
|
+
children: /* @__PURE__ */ jsx27(
|
|
2538
2650
|
ProgressPrimitive.Indicator,
|
|
2539
2651
|
{
|
|
2540
2652
|
"data-slot": "progress-indicator",
|
|
@@ -2554,9 +2666,9 @@ Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
|
2554
2666
|
|
|
2555
2667
|
// src/scroll-area.tsx
|
|
2556
2668
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
2557
|
-
import * as
|
|
2558
|
-
import { jsx as
|
|
2559
|
-
var ScrollArea =
|
|
2669
|
+
import * as React23 from "react";
|
|
2670
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2671
|
+
var ScrollArea = React23.forwardRef(
|
|
2560
2672
|
({
|
|
2561
2673
|
className,
|
|
2562
2674
|
children,
|
|
@@ -2565,7 +2677,7 @@ var ScrollArea = React22.forwardRef(
|
|
|
2565
2677
|
scrollBarClassName,
|
|
2566
2678
|
orientation = "vertical",
|
|
2567
2679
|
...props
|
|
2568
|
-
}, ref) => /* @__PURE__ */
|
|
2680
|
+
}, ref) => /* @__PURE__ */ jsxs15(
|
|
2569
2681
|
ScrollAreaPrimitive.Root,
|
|
2570
2682
|
{
|
|
2571
2683
|
ref,
|
|
@@ -2573,7 +2685,7 @@ var ScrollArea = React22.forwardRef(
|
|
|
2573
2685
|
className: cn("relative overflow-hidden", className),
|
|
2574
2686
|
...props,
|
|
2575
2687
|
children: [
|
|
2576
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ jsx28(
|
|
2577
2689
|
ScrollAreaPrimitive.Viewport,
|
|
2578
2690
|
{
|
|
2579
2691
|
ref: viewportRef,
|
|
@@ -2582,14 +2694,14 @@ var ScrollArea = React22.forwardRef(
|
|
|
2582
2694
|
children
|
|
2583
2695
|
}
|
|
2584
2696
|
),
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2697
|
+
/* @__PURE__ */ jsx28(ScrollBar, { orientation, className: scrollBarClassName }),
|
|
2698
|
+
/* @__PURE__ */ jsx28(ScrollAreaPrimitive.Corner, {})
|
|
2587
2699
|
]
|
|
2588
2700
|
}
|
|
2589
2701
|
)
|
|
2590
2702
|
);
|
|
2591
2703
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2592
|
-
var ScrollBar =
|
|
2704
|
+
var ScrollBar = React23.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
2593
2705
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2594
2706
|
{
|
|
2595
2707
|
ref,
|
|
@@ -2602,7 +2714,7 @@ var ScrollBar = React22.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
2602
2714
|
className
|
|
2603
2715
|
),
|
|
2604
2716
|
...props,
|
|
2605
|
-
children: /* @__PURE__ */
|
|
2717
|
+
children: /* @__PURE__ */ jsx28(
|
|
2606
2718
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
2607
2719
|
{
|
|
2608
2720
|
"data-slot": "scroll-area-thumb",
|
|
@@ -2614,7 +2726,7 @@ var ScrollBar = React22.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
2614
2726
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2615
2727
|
|
|
2616
2728
|
// src/score-ring.tsx
|
|
2617
|
-
import { jsx as
|
|
2729
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2618
2730
|
var DEFAULT_SCORE_THRESHOLDS = {
|
|
2619
2731
|
good: 75,
|
|
2620
2732
|
warning: 50
|
|
@@ -2645,7 +2757,7 @@ function ScoreRing({
|
|
|
2645
2757
|
const circumference = 2 * Math.PI * radius;
|
|
2646
2758
|
const boundedPct = pct === null ? 0 : Math.max(0, Math.min(100, pct));
|
|
2647
2759
|
const dashOffset = circumference * (1 - boundedPct / 100);
|
|
2648
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ jsxs16(
|
|
2649
2761
|
"div",
|
|
2650
2762
|
{
|
|
2651
2763
|
className: cn(
|
|
@@ -2656,8 +2768,8 @@ function ScoreRing({
|
|
|
2656
2768
|
role: "img",
|
|
2657
2769
|
"aria-label": `${label ?? "Score"}: ${pct === null ? "not available" : `${pct} out of 100`}`,
|
|
2658
2770
|
children: [
|
|
2659
|
-
/* @__PURE__ */
|
|
2660
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsxs16("svg", { viewBox: "0 0 100 100", className: "h-full w-full -rotate-90", children: [
|
|
2772
|
+
/* @__PURE__ */ jsx29(
|
|
2661
2773
|
"circle",
|
|
2662
2774
|
{
|
|
2663
2775
|
cx: "50",
|
|
@@ -2668,7 +2780,7 @@ function ScoreRing({
|
|
|
2668
2780
|
fill: "none"
|
|
2669
2781
|
}
|
|
2670
2782
|
),
|
|
2671
|
-
pct !== null ? /* @__PURE__ */
|
|
2783
|
+
pct !== null ? /* @__PURE__ */ jsx29(
|
|
2672
2784
|
"circle",
|
|
2673
2785
|
{
|
|
2674
2786
|
cx: "50",
|
|
@@ -2687,8 +2799,8 @@ function ScoreRing({
|
|
|
2687
2799
|
}
|
|
2688
2800
|
) : null
|
|
2689
2801
|
] }),
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ jsxs16("div", { className: "absolute flex flex-col items-center justify-center", children: [
|
|
2803
|
+
/* @__PURE__ */ jsx29(
|
|
2692
2804
|
"span",
|
|
2693
2805
|
{
|
|
2694
2806
|
className: cn(
|
|
@@ -2698,7 +2810,7 @@ function ScoreRing({
|
|
|
2698
2810
|
children: pct === null ? "\u2014" : `${pct}${suffix}`
|
|
2699
2811
|
}
|
|
2700
2812
|
),
|
|
2701
|
-
label ? /* @__PURE__ */
|
|
2813
|
+
label ? /* @__PURE__ */ jsx29("span", { className: "max-w-[74px] truncate text-[9px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }) : null
|
|
2702
2814
|
] })
|
|
2703
2815
|
]
|
|
2704
2816
|
}
|
|
@@ -2706,7 +2818,7 @@ function ScoreRing({
|
|
|
2706
2818
|
}
|
|
2707
2819
|
|
|
2708
2820
|
// src/segmented-control.tsx
|
|
2709
|
-
import { jsx as
|
|
2821
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2710
2822
|
function SegmentedControl({
|
|
2711
2823
|
value,
|
|
2712
2824
|
onValueChange,
|
|
@@ -2721,7 +2833,7 @@ function SegmentedControl({
|
|
|
2721
2833
|
md: "h-9 text-sm",
|
|
2722
2834
|
lg: "h-10 text-base"
|
|
2723
2835
|
};
|
|
2724
|
-
return /* @__PURE__ */
|
|
2836
|
+
return /* @__PURE__ */ jsx30(
|
|
2725
2837
|
"div",
|
|
2726
2838
|
{
|
|
2727
2839
|
className: cn(
|
|
@@ -2732,7 +2844,7 @@ function SegmentedControl({
|
|
|
2732
2844
|
role: "tablist",
|
|
2733
2845
|
children: data.map((option) => {
|
|
2734
2846
|
const isActive = value === option.value;
|
|
2735
|
-
return /* @__PURE__ */
|
|
2847
|
+
return /* @__PURE__ */ jsx30(
|
|
2736
2848
|
"button",
|
|
2737
2849
|
{
|
|
2738
2850
|
type: "button",
|
|
@@ -2759,8 +2871,8 @@ function SegmentedControl({
|
|
|
2759
2871
|
// src/select.tsx
|
|
2760
2872
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2761
2873
|
import { cva as cva4 } from "class-variance-authority";
|
|
2762
|
-
import * as
|
|
2763
|
-
import { jsx as
|
|
2874
|
+
import * as React24 from "react";
|
|
2875
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2764
2876
|
var Select = SelectPrimitive.Root;
|
|
2765
2877
|
var SelectGroup = SelectPrimitive.Group;
|
|
2766
2878
|
var SelectValue = SelectPrimitive.Value;
|
|
@@ -2779,7 +2891,7 @@ var selectTriggerVariants = cva4(
|
|
|
2779
2891
|
}
|
|
2780
2892
|
}
|
|
2781
2893
|
);
|
|
2782
|
-
var SelectTrigger =
|
|
2894
|
+
var SelectTrigger = React24.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ jsxs17(
|
|
2783
2895
|
SelectPrimitive.Trigger,
|
|
2784
2896
|
{
|
|
2785
2897
|
ref,
|
|
@@ -2787,12 +2899,12 @@ var SelectTrigger = React23.forwardRef(({ className, children, hideArrow = false
|
|
|
2787
2899
|
...props,
|
|
2788
2900
|
children: [
|
|
2789
2901
|
children,
|
|
2790
|
-
!hideArrow && /* @__PURE__ */
|
|
2902
|
+
!hideArrow && /* @__PURE__ */ jsx31(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx31(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
2791
2903
|
]
|
|
2792
2904
|
}
|
|
2793
2905
|
));
|
|
2794
2906
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2795
|
-
var SelectScrollUpButton =
|
|
2907
|
+
var SelectScrollUpButton = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
2796
2908
|
SelectPrimitive.ScrollUpButton,
|
|
2797
2909
|
{
|
|
2798
2910
|
ref,
|
|
@@ -2801,11 +2913,11 @@ var SelectScrollUpButton = React23.forwardRef(({ className, ...props }, ref) =>
|
|
|
2801
2913
|
className
|
|
2802
2914
|
),
|
|
2803
2915
|
...props,
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2916
|
+
children: /* @__PURE__ */ jsx31(RadixChevronUpIcon, {})
|
|
2805
2917
|
}
|
|
2806
2918
|
));
|
|
2807
2919
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2808
|
-
var SelectScrollDownButton =
|
|
2920
|
+
var SelectScrollDownButton = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
2809
2921
|
SelectPrimitive.ScrollDownButton,
|
|
2810
2922
|
{
|
|
2811
2923
|
ref,
|
|
@@ -2814,11 +2926,11 @@ var SelectScrollDownButton = React23.forwardRef(({ className, ...props }, ref) =
|
|
|
2814
2926
|
className
|
|
2815
2927
|
),
|
|
2816
2928
|
...props,
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2929
|
+
children: /* @__PURE__ */ jsx31(RadixChevronDownIcon, {})
|
|
2818
2930
|
}
|
|
2819
2931
|
));
|
|
2820
2932
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
2821
|
-
var SelectContent =
|
|
2933
|
+
var SelectContent = React24.forwardRef(
|
|
2822
2934
|
({
|
|
2823
2935
|
className,
|
|
2824
2936
|
children,
|
|
@@ -2828,7 +2940,7 @@ var SelectContent = React23.forwardRef(
|
|
|
2828
2940
|
...props
|
|
2829
2941
|
}, ref) => {
|
|
2830
2942
|
const portalContainer = usePortalContainer(container);
|
|
2831
|
-
return /* @__PURE__ */
|
|
2943
|
+
return /* @__PURE__ */ jsx31(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs17(
|
|
2832
2944
|
SelectPrimitive.Content,
|
|
2833
2945
|
{
|
|
2834
2946
|
ref,
|
|
@@ -2846,8 +2958,8 @@ var SelectContent = React23.forwardRef(
|
|
|
2846
2958
|
position,
|
|
2847
2959
|
...props,
|
|
2848
2960
|
children: [
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2961
|
+
/* @__PURE__ */ jsx31(SelectScrollUpButton, {}),
|
|
2962
|
+
/* @__PURE__ */ jsx31(
|
|
2851
2963
|
SelectPrimitive.Viewport,
|
|
2852
2964
|
{
|
|
2853
2965
|
className: cn(
|
|
@@ -2857,14 +2969,14 @@ var SelectContent = React23.forwardRef(
|
|
|
2857
2969
|
children
|
|
2858
2970
|
}
|
|
2859
2971
|
),
|
|
2860
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ jsx31(SelectScrollDownButton, {})
|
|
2861
2973
|
]
|
|
2862
2974
|
}
|
|
2863
2975
|
) });
|
|
2864
2976
|
}
|
|
2865
2977
|
);
|
|
2866
2978
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2867
|
-
var SelectLabel =
|
|
2979
|
+
var SelectLabel = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
2868
2980
|
SelectPrimitive.Label,
|
|
2869
2981
|
{
|
|
2870
2982
|
ref,
|
|
@@ -2873,7 +2985,7 @@ var SelectLabel = React23.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2873
2985
|
}
|
|
2874
2986
|
));
|
|
2875
2987
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2876
|
-
var SelectItem =
|
|
2988
|
+
var SelectItem = React24.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ jsxs17(
|
|
2877
2989
|
SelectPrimitive.Item,
|
|
2878
2990
|
{
|
|
2879
2991
|
ref,
|
|
@@ -2884,14 +2996,14 @@ var SelectItem = React23.forwardRef(({ className, children, description, ...prop
|
|
|
2884
2996
|
),
|
|
2885
2997
|
...props,
|
|
2886
2998
|
children: [
|
|
2887
|
-
/* @__PURE__ */
|
|
2888
|
-
/* @__PURE__ */
|
|
2889
|
-
description ? /* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ jsx31("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx31(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx31(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
3000
|
+
/* @__PURE__ */ jsx31(SelectPrimitive.ItemText, { children }),
|
|
3001
|
+
description ? /* @__PURE__ */ jsx31("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
2890
3002
|
]
|
|
2891
3003
|
}
|
|
2892
3004
|
));
|
|
2893
3005
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2894
|
-
var SelectSeparator =
|
|
3006
|
+
var SelectSeparator = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
2895
3007
|
SelectPrimitive.Separator,
|
|
2896
3008
|
{
|
|
2897
3009
|
ref,
|
|
@@ -2903,9 +3015,9 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
2903
3015
|
|
|
2904
3016
|
// src/separator.tsx
|
|
2905
3017
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2906
|
-
import * as
|
|
2907
|
-
import { jsx as
|
|
2908
|
-
var Separator4 =
|
|
3018
|
+
import * as React25 from "react";
|
|
3019
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3020
|
+
var Separator4 = React25.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx32(
|
|
2909
3021
|
SeparatorPrimitive.Root,
|
|
2910
3022
|
{
|
|
2911
3023
|
ref,
|
|
@@ -2925,11 +3037,11 @@ Separator4.displayName = SeparatorPrimitive.Root.displayName;
|
|
|
2925
3037
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
2926
3038
|
import { treeContainsComponent as treeContainsComponent4 } from "@ai-matrx/kit/react-tree";
|
|
2927
3039
|
import { cva as cva5 } from "class-variance-authority";
|
|
2928
|
-
import * as
|
|
2929
|
-
import { jsx as
|
|
2930
|
-
var SheetContentBase =
|
|
3040
|
+
import * as React26 from "react";
|
|
3041
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3042
|
+
var SheetContentBase = React26.forwardRef(({ ...props }, ref) => {
|
|
2931
3043
|
const isModal = useRadixDialogModal();
|
|
2932
|
-
return /* @__PURE__ */
|
|
3044
|
+
return /* @__PURE__ */ jsx33(
|
|
2933
3045
|
SheetPrimitive.Content,
|
|
2934
3046
|
{
|
|
2935
3047
|
...props,
|
|
@@ -2939,15 +3051,15 @@ var SheetContentBase = React25.forwardRef(({ ...props }, ref) => {
|
|
|
2939
3051
|
);
|
|
2940
3052
|
});
|
|
2941
3053
|
SheetContentBase.displayName = "SheetContentBase";
|
|
2942
|
-
var Sheet =
|
|
3054
|
+
var Sheet = React26.forwardRef(({ children, ...props }, _ref) => {
|
|
2943
3055
|
const modal = props.modal ?? true;
|
|
2944
|
-
return /* @__PURE__ */
|
|
3056
|
+
return /* @__PURE__ */ jsx33(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx33(SheetPrimitive.Root, { ...props, modal, children }) });
|
|
2945
3057
|
});
|
|
2946
3058
|
Sheet.displayName = "Sheet";
|
|
2947
3059
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
2948
3060
|
var SheetClose = SheetPrimitive.Close;
|
|
2949
3061
|
var SheetPortal = SheetPrimitive.Portal;
|
|
2950
|
-
var SheetOverlay =
|
|
3062
|
+
var SheetOverlay = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2951
3063
|
SheetPrimitive.Overlay,
|
|
2952
3064
|
{
|
|
2953
3065
|
className: cn(
|
|
@@ -2984,7 +3096,7 @@ var sheetVariants = cva5(
|
|
|
2984
3096
|
}
|
|
2985
3097
|
}
|
|
2986
3098
|
);
|
|
2987
|
-
var SheetDescription =
|
|
3099
|
+
var SheetDescription = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2988
3100
|
SheetPrimitive.Description,
|
|
2989
3101
|
{
|
|
2990
3102
|
ref,
|
|
@@ -2993,7 +3105,7 @@ var SheetDescription = React25.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2993
3105
|
}
|
|
2994
3106
|
));
|
|
2995
3107
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
2996
|
-
var SheetContent =
|
|
3108
|
+
var SheetContent = React26.forwardRef(
|
|
2997
3109
|
({
|
|
2998
3110
|
side = "right",
|
|
2999
3111
|
className,
|
|
@@ -3005,9 +3117,9 @@ var SheetContent = React25.forwardRef(
|
|
|
3005
3117
|
...props
|
|
3006
3118
|
}, ref) => {
|
|
3007
3119
|
const hasDescription = treeContainsComponent4(children, SheetDescription) || treeContainsComponent4(children, SheetPrimitive.Description);
|
|
3008
|
-
return /* @__PURE__ */
|
|
3009
|
-
!hideOverlay && /* @__PURE__ */
|
|
3010
|
-
/* @__PURE__ */
|
|
3120
|
+
return /* @__PURE__ */ jsxs18(SheetPortal, { children: [
|
|
3121
|
+
!hideOverlay && /* @__PURE__ */ jsx33(SheetOverlay, { className: overlayClassName }),
|
|
3122
|
+
/* @__PURE__ */ jsxs18(
|
|
3011
3123
|
SheetContentBase,
|
|
3012
3124
|
{
|
|
3013
3125
|
ref,
|
|
@@ -3019,9 +3131,9 @@ var SheetContent = React25.forwardRef(
|
|
|
3019
3131
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
3020
3132
|
...props,
|
|
3021
3133
|
children: [
|
|
3022
|
-
!hideCloseButton && /* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3134
|
+
!hideCloseButton && /* @__PURE__ */ jsxs18(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
3135
|
+
/* @__PURE__ */ jsx33(Cross2Icon, { className: "h-4 w-4" }),
|
|
3136
|
+
/* @__PURE__ */ jsx33("span", { className: "sr-only", children: "Close" })
|
|
3025
3137
|
] }),
|
|
3026
3138
|
children
|
|
3027
3139
|
]
|
|
@@ -3034,7 +3146,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
3034
3146
|
var SheetHeader = ({
|
|
3035
3147
|
className,
|
|
3036
3148
|
...props
|
|
3037
|
-
}) => /* @__PURE__ */
|
|
3149
|
+
}) => /* @__PURE__ */ jsx33(
|
|
3038
3150
|
"div",
|
|
3039
3151
|
{
|
|
3040
3152
|
className: cn(
|
|
@@ -3048,7 +3160,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
3048
3160
|
var SheetFooter = ({
|
|
3049
3161
|
className,
|
|
3050
3162
|
...props
|
|
3051
|
-
}) => /* @__PURE__ */
|
|
3163
|
+
}) => /* @__PURE__ */ jsx33(
|
|
3052
3164
|
"div",
|
|
3053
3165
|
{
|
|
3054
3166
|
className: cn(
|
|
@@ -3059,7 +3171,7 @@ var SheetFooter = ({
|
|
|
3059
3171
|
}
|
|
3060
3172
|
);
|
|
3061
3173
|
SheetFooter.displayName = "SheetFooter";
|
|
3062
|
-
var SheetTitle =
|
|
3174
|
+
var SheetTitle = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
3063
3175
|
SheetPrimitive.Title,
|
|
3064
3176
|
{
|
|
3065
3177
|
ref,
|
|
@@ -3070,9 +3182,9 @@ var SheetTitle = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3070
3182
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
3071
3183
|
|
|
3072
3184
|
// src/skeleton.tsx
|
|
3073
|
-
import { jsx as
|
|
3185
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3074
3186
|
function Skeleton({ className, animated = true, ...props }) {
|
|
3075
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ jsx34(
|
|
3076
3188
|
"div",
|
|
3077
3189
|
{
|
|
3078
3190
|
"data-slot": "skeleton",
|
|
@@ -3088,8 +3200,8 @@ function Skeleton({ className, animated = true, ...props }) {
|
|
|
3088
3200
|
|
|
3089
3201
|
// src/switch.tsx
|
|
3090
3202
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3091
|
-
import * as
|
|
3092
|
-
import { jsx as
|
|
3203
|
+
import * as React27 from "react";
|
|
3204
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3093
3205
|
var SWITCH_SIZES = {
|
|
3094
3206
|
sm: {
|
|
3095
3207
|
root: "h-4 w-9 border-border data-[state=unchecked]:bg-input",
|
|
@@ -3100,7 +3212,7 @@ var SWITCH_SIZES = {
|
|
|
3100
3212
|
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
3101
3213
|
}
|
|
3102
3214
|
};
|
|
3103
|
-
var Switch =
|
|
3215
|
+
var Switch = React27.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
3104
3216
|
SwitchPrimitives.Root,
|
|
3105
3217
|
{
|
|
3106
3218
|
ref,
|
|
@@ -3111,7 +3223,7 @@ var Switch = React26.forwardRef(({ className, size = "md", ...props }, ref) => /
|
|
|
3111
3223
|
className
|
|
3112
3224
|
),
|
|
3113
3225
|
...props,
|
|
3114
|
-
children: /* @__PURE__ */
|
|
3226
|
+
children: /* @__PURE__ */ jsx35(
|
|
3115
3227
|
SwitchPrimitives.Thumb,
|
|
3116
3228
|
{
|
|
3117
3229
|
"data-slot": "switch-thumb",
|
|
@@ -3126,30 +3238,30 @@ var Switch = React26.forwardRef(({ className, size = "md", ...props }, ref) => /
|
|
|
3126
3238
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3127
3239
|
|
|
3128
3240
|
// src/tabbed-bottom-sheet.tsx
|
|
3129
|
-
import { useState as
|
|
3130
|
-
import { jsx as
|
|
3241
|
+
import { useState as useState7 } from "react";
|
|
3242
|
+
import { jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3131
3243
|
function TabbedBottomSheet({
|
|
3132
3244
|
open,
|
|
3133
3245
|
onOpenChange,
|
|
3134
3246
|
title,
|
|
3135
3247
|
tabs
|
|
3136
3248
|
}) {
|
|
3137
|
-
const [selectedTabId, setSelectedTabId] =
|
|
3138
|
-
const [wasOpen, setWasOpen] =
|
|
3249
|
+
const [selectedTabId, setSelectedTabId] = useState7(null);
|
|
3250
|
+
const [wasOpen, setWasOpen] = useState7(open);
|
|
3139
3251
|
if (open !== wasOpen) {
|
|
3140
3252
|
setWasOpen(open);
|
|
3141
3253
|
if (open) setSelectedTabId(null);
|
|
3142
3254
|
}
|
|
3143
3255
|
const selectedTab = selectedTabId ? tabs.find((tab) => tab.id === selectedTabId) : null;
|
|
3144
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ jsx36(
|
|
3145
3257
|
BottomSheet,
|
|
3146
3258
|
{
|
|
3147
3259
|
open,
|
|
3148
3260
|
onOpenChange,
|
|
3149
3261
|
title,
|
|
3150
3262
|
size: "full",
|
|
3151
|
-
children: /* @__PURE__ */
|
|
3152
|
-
/* @__PURE__ */
|
|
3263
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "matrx-mobile-sheet flex min-h-0 flex-1 flex-col", children: [
|
|
3264
|
+
/* @__PURE__ */ jsx36(
|
|
3153
3265
|
BottomSheetHeader,
|
|
3154
3266
|
{
|
|
3155
3267
|
title: selectedTab ? selectedTab.label : title,
|
|
@@ -3157,19 +3269,19 @@ function TabbedBottomSheet({
|
|
|
3157
3269
|
onBack: () => setSelectedTabId(null)
|
|
3158
3270
|
}
|
|
3159
3271
|
),
|
|
3160
|
-
selectedTab ? /* @__PURE__ */
|
|
3272
|
+
selectedTab ? /* @__PURE__ */ jsx36("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden pb-safe", children: selectedTab.content }) : /* @__PURE__ */ jsx36(BottomSheetBody, { children: /* @__PURE__ */ jsx36("ul", { className: "divide-y divide-border", children: tabs.map((tab) => {
|
|
3161
3273
|
const Icon2 = tab.icon;
|
|
3162
|
-
return /* @__PURE__ */
|
|
3274
|
+
return /* @__PURE__ */ jsx36("li", { children: /* @__PURE__ */ jsxs19(
|
|
3163
3275
|
"button",
|
|
3164
3276
|
{
|
|
3165
3277
|
type: "button",
|
|
3166
3278
|
onClick: () => setSelectedTabId(tab.id),
|
|
3167
3279
|
className: "flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-muted/60 active:bg-muted",
|
|
3168
3280
|
children: [
|
|
3169
|
-
Icon2 ? /* @__PURE__ */
|
|
3170
|
-
/* @__PURE__ */
|
|
3281
|
+
Icon2 ? /* @__PURE__ */ jsx36(Icon2, { className: "h-5 w-5 shrink-0 text-muted-foreground" }) : null,
|
|
3282
|
+
/* @__PURE__ */ jsx36("span", { className: "min-w-0 flex-1 text-base text-foreground", children: tab.label }),
|
|
3171
3283
|
tab.trailing,
|
|
3172
|
-
/* @__PURE__ */
|
|
3284
|
+
/* @__PURE__ */ jsx36(ChevronRightIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" })
|
|
3173
3285
|
]
|
|
3174
3286
|
}
|
|
3175
3287
|
) }, tab.id);
|
|
@@ -3180,19 +3292,19 @@ function TabbedBottomSheet({
|
|
|
3180
3292
|
}
|
|
3181
3293
|
|
|
3182
3294
|
// src/table.tsx
|
|
3183
|
-
import * as
|
|
3184
|
-
import { jsx as
|
|
3295
|
+
import * as React28 from "react";
|
|
3296
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3185
3297
|
var TABLE_SIZES = {
|
|
3186
3298
|
sm: { head: "px-2", cell: "p-2" },
|
|
3187
3299
|
md: { head: "px-3", cell: "p-3" }
|
|
3188
3300
|
};
|
|
3189
|
-
var TableSizeContext =
|
|
3301
|
+
var TableSizeContext = React28.createContext("md");
|
|
3190
3302
|
function useTableSize() {
|
|
3191
|
-
return
|
|
3303
|
+
return React28.useContext(TableSizeContext);
|
|
3192
3304
|
}
|
|
3193
|
-
var Table =
|
|
3305
|
+
var Table = React28.forwardRef(
|
|
3194
3306
|
({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
3195
|
-
const table = /* @__PURE__ */
|
|
3307
|
+
const table = /* @__PURE__ */ jsx37(
|
|
3196
3308
|
"table",
|
|
3197
3309
|
{
|
|
3198
3310
|
ref,
|
|
@@ -3202,7 +3314,7 @@ var Table = React27.forwardRef(
|
|
|
3202
3314
|
...props
|
|
3203
3315
|
}
|
|
3204
3316
|
);
|
|
3205
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ jsx37(TableSizeContext.Provider, { value: size, children: wrap ? /* @__PURE__ */ jsx37(
|
|
3206
3318
|
"div",
|
|
3207
3319
|
{
|
|
3208
3320
|
"data-slot": "table-wrapper",
|
|
@@ -3213,7 +3325,7 @@ var Table = React27.forwardRef(
|
|
|
3213
3325
|
}
|
|
3214
3326
|
);
|
|
3215
3327
|
Table.displayName = "Table";
|
|
3216
|
-
var TableHeader =
|
|
3328
|
+
var TableHeader = React28.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3217
3329
|
"thead",
|
|
3218
3330
|
{
|
|
3219
3331
|
ref,
|
|
@@ -3227,7 +3339,7 @@ var TableHeader = React27.forwardRef(({ className, sticky = false, ...props }, r
|
|
|
3227
3339
|
}
|
|
3228
3340
|
));
|
|
3229
3341
|
TableHeader.displayName = "TableHeader";
|
|
3230
|
-
var TableBody =
|
|
3342
|
+
var TableBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3231
3343
|
"tbody",
|
|
3232
3344
|
{
|
|
3233
3345
|
ref,
|
|
@@ -3237,7 +3349,7 @@ var TableBody = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3237
3349
|
}
|
|
3238
3350
|
));
|
|
3239
3351
|
TableBody.displayName = "TableBody";
|
|
3240
|
-
var TableFooter =
|
|
3352
|
+
var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3241
3353
|
"tfoot",
|
|
3242
3354
|
{
|
|
3243
3355
|
ref,
|
|
@@ -3250,7 +3362,7 @@ var TableFooter = React27.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3250
3362
|
}
|
|
3251
3363
|
));
|
|
3252
3364
|
TableFooter.displayName = "TableFooter";
|
|
3253
|
-
var TableRow =
|
|
3365
|
+
var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3254
3366
|
"tr",
|
|
3255
3367
|
{
|
|
3256
3368
|
ref,
|
|
@@ -3263,9 +3375,9 @@ var TableRow = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3263
3375
|
}
|
|
3264
3376
|
));
|
|
3265
3377
|
TableRow.displayName = "TableRow";
|
|
3266
|
-
var TableHead =
|
|
3378
|
+
var TableHead = React28.forwardRef(({ className, ...props }, ref) => {
|
|
3267
3379
|
const size = useTableSize();
|
|
3268
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ jsx37(
|
|
3269
3381
|
"th",
|
|
3270
3382
|
{
|
|
3271
3383
|
ref,
|
|
@@ -3280,9 +3392,9 @@ var TableHead = React27.forwardRef(({ className, ...props }, ref) => {
|
|
|
3280
3392
|
);
|
|
3281
3393
|
});
|
|
3282
3394
|
TableHead.displayName = "TableHead";
|
|
3283
|
-
var TableCell =
|
|
3395
|
+
var TableCell = React28.forwardRef(({ className, ...props }, ref) => {
|
|
3284
3396
|
const size = useTableSize();
|
|
3285
|
-
return /* @__PURE__ */
|
|
3397
|
+
return /* @__PURE__ */ jsx37(
|
|
3286
3398
|
"td",
|
|
3287
3399
|
{
|
|
3288
3400
|
ref,
|
|
@@ -3297,7 +3409,7 @@ var TableCell = React27.forwardRef(({ className, ...props }, ref) => {
|
|
|
3297
3409
|
);
|
|
3298
3410
|
});
|
|
3299
3411
|
TableCell.displayName = "TableCell";
|
|
3300
|
-
var TableCaption =
|
|
3412
|
+
var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
3301
3413
|
"caption",
|
|
3302
3414
|
{
|
|
3303
3415
|
ref,
|
|
@@ -3310,11 +3422,11 @@ TableCaption.displayName = "TableCaption";
|
|
|
3310
3422
|
|
|
3311
3423
|
// src/tabs.tsx
|
|
3312
3424
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3313
|
-
import * as
|
|
3314
|
-
import { jsx as
|
|
3425
|
+
import * as React29 from "react";
|
|
3426
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3315
3427
|
var Tabs = TabsPrimitive.Root;
|
|
3316
3428
|
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:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm";
|
|
3317
|
-
var TabsList =
|
|
3429
|
+
var TabsList = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3318
3430
|
TabsPrimitive.List,
|
|
3319
3431
|
{
|
|
3320
3432
|
ref,
|
|
@@ -3327,7 +3439,7 @@ var TabsList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3327
3439
|
}
|
|
3328
3440
|
));
|
|
3329
3441
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3330
|
-
var TabsTrigger =
|
|
3442
|
+
var TabsTrigger = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3331
3443
|
TabsPrimitive.Trigger,
|
|
3332
3444
|
{
|
|
3333
3445
|
ref,
|
|
@@ -3341,7 +3453,7 @@ var TabsTrigger = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3341
3453
|
}
|
|
3342
3454
|
));
|
|
3343
3455
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3344
|
-
var TabsTriggerCore =
|
|
3456
|
+
var TabsTriggerCore = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3345
3457
|
TabsPrimitive.Trigger,
|
|
3346
3458
|
{
|
|
3347
3459
|
ref,
|
|
@@ -3351,7 +3463,7 @@ var TabsTriggerCore = React28.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3351
3463
|
}
|
|
3352
3464
|
));
|
|
3353
3465
|
TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
|
|
3354
|
-
var TabsContent =
|
|
3466
|
+
var TabsContent = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3355
3467
|
TabsPrimitive.Content,
|
|
3356
3468
|
{
|
|
3357
3469
|
ref,
|
|
@@ -3367,8 +3479,8 @@ var TabsContent = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3367
3479
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
3368
3480
|
|
|
3369
3481
|
// src/textarea.tsx
|
|
3370
|
-
import * as
|
|
3371
|
-
import { jsx as
|
|
3482
|
+
import * as React30 from "react";
|
|
3483
|
+
import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3372
3484
|
var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
|
|
3373
3485
|
var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
|
|
3374
3486
|
function getStretchClasses(className) {
|
|
@@ -3381,7 +3493,7 @@ function getStretchClasses(className) {
|
|
|
3381
3493
|
var TEXTAREA_ELEVATED_CLASS = "flex h-auto w-full rounded-md border border-input bg-background 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";
|
|
3382
3494
|
var TEXTAREA_CONTROL_CLASS = "flex w-full rounded-md border border-input bg-transparent 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";
|
|
3383
3495
|
function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
3384
|
-
|
|
3496
|
+
React30.useEffect(() => {
|
|
3385
3497
|
if (!autoGrow || !ref.current) return;
|
|
3386
3498
|
const textarea = ref.current;
|
|
3387
3499
|
textarea.style.height = "auto";
|
|
@@ -3397,8 +3509,8 @@ function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
|
3397
3509
|
}, [value, autoGrow, minHeight, maxHeight, ref]);
|
|
3398
3510
|
}
|
|
3399
3511
|
function useMergedTextareaRef(forwarded) {
|
|
3400
|
-
const internal =
|
|
3401
|
-
const callback =
|
|
3512
|
+
const internal = React30.useRef(null);
|
|
3513
|
+
const callback = React30.useCallback(
|
|
3402
3514
|
(node) => {
|
|
3403
3515
|
internal.current = node;
|
|
3404
3516
|
if (typeof forwarded === "function") forwarded(node);
|
|
@@ -3415,13 +3527,13 @@ function boxStyle(minHeight, maxHeight) {
|
|
|
3415
3527
|
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
3416
3528
|
};
|
|
3417
3529
|
}
|
|
3418
|
-
var Textarea =
|
|
3530
|
+
var Textarea = React30.forwardRef(
|
|
3419
3531
|
({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
|
|
3420
3532
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3421
3533
|
const stretchClasses = getStretchClasses(className);
|
|
3422
3534
|
const needsWrapper = Boolean(wrapperClassName || stretchClasses);
|
|
3423
3535
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3424
|
-
const textarea = /* @__PURE__ */
|
|
3536
|
+
const textarea = /* @__PURE__ */ jsx39(
|
|
3425
3537
|
"textarea",
|
|
3426
3538
|
{
|
|
3427
3539
|
ref: callback,
|
|
@@ -3437,15 +3549,15 @@ var Textarea = React29.forwardRef(
|
|
|
3437
3549
|
}
|
|
3438
3550
|
);
|
|
3439
3551
|
if (!needsWrapper) return textarea;
|
|
3440
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx39("div", { className: cn(stretchClasses, wrapperClassName), children: textarea });
|
|
3441
3553
|
}
|
|
3442
3554
|
);
|
|
3443
3555
|
Textarea.displayName = "Textarea";
|
|
3444
|
-
var BasicTextarea =
|
|
3556
|
+
var BasicTextarea = React30.forwardRef(
|
|
3445
3557
|
({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
|
|
3446
3558
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3447
3559
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3448
|
-
return /* @__PURE__ */
|
|
3560
|
+
return /* @__PURE__ */ jsx39(
|
|
3449
3561
|
"textarea",
|
|
3450
3562
|
{
|
|
3451
3563
|
ref: callback,
|
|
@@ -3463,7 +3575,7 @@ var BasicTextarea = React29.forwardRef(
|
|
|
3463
3575
|
}
|
|
3464
3576
|
);
|
|
3465
3577
|
BasicTextarea.displayName = "BasicTextarea";
|
|
3466
|
-
var TextareaWithPrefix =
|
|
3578
|
+
var TextareaWithPrefix = React30.forwardRef(
|
|
3467
3579
|
({
|
|
3468
3580
|
prefix,
|
|
3469
3581
|
className,
|
|
@@ -3475,13 +3587,13 @@ var TextareaWithPrefix = React29.forwardRef(
|
|
|
3475
3587
|
}, forwarded) => {
|
|
3476
3588
|
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3477
3589
|
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3478
|
-
return /* @__PURE__ */
|
|
3590
|
+
return /* @__PURE__ */ jsxs20(
|
|
3479
3591
|
"div",
|
|
3480
3592
|
{
|
|
3481
3593
|
className: cn("relative", getStretchClasses(className), wrapperClassName),
|
|
3482
3594
|
children: [
|
|
3483
|
-
prefix ? /* @__PURE__ */
|
|
3484
|
-
/* @__PURE__ */
|
|
3595
|
+
prefix ? /* @__PURE__ */ jsx39("div", { className: "pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground", children: prefix }) : null,
|
|
3596
|
+
/* @__PURE__ */ jsx39(
|
|
3485
3597
|
"textarea",
|
|
3486
3598
|
{
|
|
3487
3599
|
ref: callback,
|
|
@@ -3505,16 +3617,16 @@ var TextareaWithPrefix = React29.forwardRef(
|
|
|
3505
3617
|
TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
3506
3618
|
|
|
3507
3619
|
// src/use-scroll-fade.ts
|
|
3508
|
-
import { useCallback as
|
|
3620
|
+
import { useCallback as useCallback5, useEffect as useEffect5, useRef as useRef6, useState as useState8 } from "react";
|
|
3509
3621
|
var EPSILON = 2;
|
|
3510
3622
|
function useScrollFade() {
|
|
3511
|
-
const [state, setState] =
|
|
3623
|
+
const [state, setState] = useState8({
|
|
3512
3624
|
top: false,
|
|
3513
3625
|
bottom: false
|
|
3514
3626
|
});
|
|
3515
|
-
const nodeRef =
|
|
3516
|
-
const cleanupRef =
|
|
3517
|
-
const measure =
|
|
3627
|
+
const nodeRef = useRef6(null);
|
|
3628
|
+
const cleanupRef = useRef6(null);
|
|
3629
|
+
const measure = useCallback5(() => {
|
|
3518
3630
|
const el = nodeRef.current;
|
|
3519
3631
|
if (!el) return;
|
|
3520
3632
|
const overflowing = el.scrollHeight - el.clientHeight > EPSILON;
|
|
@@ -3526,7 +3638,7 @@ function useScrollFade() {
|
|
|
3526
3638
|
(prev) => prev.top === next.top && prev.bottom === next.bottom ? prev : next
|
|
3527
3639
|
);
|
|
3528
3640
|
}, []);
|
|
3529
|
-
const ref =
|
|
3641
|
+
const ref = useCallback5(
|
|
3530
3642
|
(node) => {
|
|
3531
3643
|
cleanupRef.current?.();
|
|
3532
3644
|
cleanupRef.current = null;
|
|
@@ -3546,7 +3658,7 @@ function useScrollFade() {
|
|
|
3546
3658
|
},
|
|
3547
3659
|
[measure]
|
|
3548
3660
|
);
|
|
3549
|
-
|
|
3661
|
+
useEffect5(() => () => cleanupRef.current?.(), []);
|
|
3550
3662
|
return {
|
|
3551
3663
|
ref,
|
|
3552
3664
|
state,
|
|
@@ -3560,14 +3672,14 @@ function useScrollFade() {
|
|
|
3560
3672
|
|
|
3561
3673
|
// src/hover-card.tsx
|
|
3562
3674
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3563
|
-
import * as
|
|
3564
|
-
import { jsx as
|
|
3675
|
+
import * as React31 from "react";
|
|
3676
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3565
3677
|
var HoverCard = HoverCardPrimitive.Root;
|
|
3566
3678
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
3567
|
-
var HoverCardContent =
|
|
3679
|
+
var HoverCardContent = React31.forwardRef(
|
|
3568
3680
|
({ className, align = "center", sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
3569
3681
|
const resolved = usePortalContainer(container);
|
|
3570
|
-
return /* @__PURE__ */
|
|
3682
|
+
return /* @__PURE__ */ jsx40(HoverCardPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx40(
|
|
3571
3683
|
HoverCardPrimitive.Content,
|
|
3572
3684
|
{
|
|
3573
3685
|
ref,
|
|
@@ -3588,9 +3700,9 @@ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
3588
3700
|
|
|
3589
3701
|
// src/radio-group.tsx
|
|
3590
3702
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3591
|
-
import * as
|
|
3592
|
-
import { jsx as
|
|
3593
|
-
var RadioGroupSizeContext =
|
|
3703
|
+
import * as React32 from "react";
|
|
3704
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3705
|
+
var RadioGroupSizeContext = React32.createContext("md");
|
|
3594
3706
|
var CONTROL_CLASSES = {
|
|
3595
3707
|
sm: "h-3.5 w-3.5",
|
|
3596
3708
|
md: "h-4 w-4",
|
|
@@ -3601,7 +3713,7 @@ var DOT_CLASSES = {
|
|
|
3601
3713
|
md: "h-1.5 w-1.5",
|
|
3602
3714
|
lg: "h-2 w-2"
|
|
3603
3715
|
};
|
|
3604
|
-
var RadioGroup3 =
|
|
3716
|
+
var RadioGroup3 = React32.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx41(RadioGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx41(
|
|
3605
3717
|
RadioGroupPrimitive.Root,
|
|
3606
3718
|
{
|
|
3607
3719
|
ref,
|
|
@@ -3611,10 +3723,10 @@ var RadioGroup3 = React31.forwardRef(({ className, size = "md", ...props }, ref)
|
|
|
3611
3723
|
}
|
|
3612
3724
|
) }));
|
|
3613
3725
|
RadioGroup3.displayName = RadioGroupPrimitive.Root.displayName;
|
|
3614
|
-
var RadioGroupItem =
|
|
3615
|
-
const groupSize =
|
|
3726
|
+
var RadioGroupItem = React32.forwardRef(({ className, size, ...props }, ref) => {
|
|
3727
|
+
const groupSize = React32.useContext(RadioGroupSizeContext);
|
|
3616
3728
|
const resolved = size ?? groupSize;
|
|
3617
|
-
return /* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ jsx41(
|
|
3618
3730
|
RadioGroupPrimitive.Item,
|
|
3619
3731
|
{
|
|
3620
3732
|
ref,
|
|
@@ -3631,7 +3743,7 @@ var RadioGroupItem = React31.forwardRef(({ className, size, ...props }, ref) =>
|
|
|
3631
3743
|
className
|
|
3632
3744
|
),
|
|
3633
3745
|
...props,
|
|
3634
|
-
children: /* @__PURE__ */
|
|
3746
|
+
children: /* @__PURE__ */ jsx41(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx41(
|
|
3635
3747
|
"div",
|
|
3636
3748
|
{
|
|
3637
3749
|
className: cn("rounded-full bg-primary-foreground", DOT_CLASSES[resolved])
|
|
@@ -3644,7 +3756,7 @@ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
|
3644
3756
|
|
|
3645
3757
|
// src/resizable.tsx
|
|
3646
3758
|
import { Group as Group4, Panel, Separator as Separator5 } from "react-resizable-panels";
|
|
3647
|
-
import { jsx as
|
|
3759
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3648
3760
|
var HANDLE_SIZES = {
|
|
3649
3761
|
xs: "w-0.5 [&[aria-orientation=horizontal]]:h-0.5 [&[aria-orientation=horizontal]]:w-full",
|
|
3650
3762
|
sm: "w-1 [&[aria-orientation=horizontal]]:h-1 [&[aria-orientation=horizontal]]:w-full",
|
|
@@ -3658,7 +3770,7 @@ var HANDLE_SIZES = {
|
|
|
3658
3770
|
var ResizablePanelGroup = ({
|
|
3659
3771
|
className,
|
|
3660
3772
|
...props
|
|
3661
|
-
}) => /* @__PURE__ */
|
|
3773
|
+
}) => /* @__PURE__ */ jsx42(
|
|
3662
3774
|
Group4,
|
|
3663
3775
|
{
|
|
3664
3776
|
"data-slot": "resizable-group",
|
|
@@ -3673,7 +3785,7 @@ var ResizableHandle = ({
|
|
|
3673
3785
|
size = "xs",
|
|
3674
3786
|
className,
|
|
3675
3787
|
...props
|
|
3676
|
-
}) => /* @__PURE__ */
|
|
3788
|
+
}) => /* @__PURE__ */ jsx42(
|
|
3677
3789
|
Separator5,
|
|
3678
3790
|
{
|
|
3679
3791
|
"data-slot": "resizable-handle",
|
|
@@ -3693,15 +3805,15 @@ var ResizableHandle = ({
|
|
|
3693
3805
|
className
|
|
3694
3806
|
),
|
|
3695
3807
|
...props,
|
|
3696
|
-
children: withHandle ? /* @__PURE__ */
|
|
3808
|
+
children: withHandle ? /* @__PURE__ */ jsx42("div", { className: "z-10 flex h-8 w-4 items-center justify-center rounded-sm border bg-border group-aria-[orientation=horizontal]/handle:h-4 group-aria-[orientation=horizontal]/handle:w-8", children: /* @__PURE__ */ jsx42(DragHandleDots2Icon, { className: "h-2.5 w-2.5 group-aria-[orientation=horizontal]/handle:rotate-90" }) }) : null
|
|
3697
3809
|
}
|
|
3698
3810
|
);
|
|
3699
3811
|
ResizableHandle.displayName = "ResizableHandle";
|
|
3700
3812
|
|
|
3701
3813
|
// src/slider.tsx
|
|
3702
3814
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3703
|
-
import * as
|
|
3704
|
-
import { jsx as
|
|
3815
|
+
import * as React33 from "react";
|
|
3816
|
+
import { jsx as jsx43, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3705
3817
|
var TRACK_CLASSES = {
|
|
3706
3818
|
sm: "h-1",
|
|
3707
3819
|
md: "h-1.5",
|
|
@@ -3712,12 +3824,12 @@ var THUMB_CLASSES = {
|
|
|
3712
3824
|
md: "h-4 w-4",
|
|
3713
3825
|
lg: "h-5 w-5"
|
|
3714
3826
|
};
|
|
3715
|
-
var Slider =
|
|
3827
|
+
var Slider = React33.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
3716
3828
|
const thumbCount = Math.max(
|
|
3717
3829
|
1,
|
|
3718
3830
|
(props.value ?? props.defaultValue ?? [0]).length
|
|
3719
3831
|
);
|
|
3720
|
-
return /* @__PURE__ */
|
|
3832
|
+
return /* @__PURE__ */ jsxs21(
|
|
3721
3833
|
SliderPrimitive.Root,
|
|
3722
3834
|
{
|
|
3723
3835
|
ref,
|
|
@@ -3729,7 +3841,7 @@ var Slider = React32.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
|
3729
3841
|
),
|
|
3730
3842
|
...props,
|
|
3731
3843
|
children: [
|
|
3732
|
-
/* @__PURE__ */
|
|
3844
|
+
/* @__PURE__ */ jsx43(
|
|
3733
3845
|
SliderPrimitive.Track,
|
|
3734
3846
|
{
|
|
3735
3847
|
"data-slot": "slider-track",
|
|
@@ -3738,7 +3850,7 @@ var Slider = React32.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
|
3738
3850
|
TRACK_CLASSES[size],
|
|
3739
3851
|
"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
3740
3852
|
),
|
|
3741
|
-
children: /* @__PURE__ */
|
|
3853
|
+
children: /* @__PURE__ */ jsx43(
|
|
3742
3854
|
SliderPrimitive.Range,
|
|
3743
3855
|
{
|
|
3744
3856
|
"data-slot": "slider-range",
|
|
@@ -3747,7 +3859,7 @@ var Slider = React32.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
|
3747
3859
|
)
|
|
3748
3860
|
}
|
|
3749
3861
|
),
|
|
3750
|
-
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */
|
|
3862
|
+
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */ jsx43(
|
|
3751
3863
|
SliderPrimitive.Thumb,
|
|
3752
3864
|
{
|
|
3753
3865
|
"data-slot": "slider-thumb",
|
|
@@ -3774,8 +3886,8 @@ Slider.displayName = SliderPrimitive.Root.displayName;
|
|
|
3774
3886
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3775
3887
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3776
3888
|
import { cva as cva6 } from "class-variance-authority";
|
|
3777
|
-
import * as
|
|
3778
|
-
import { jsx as
|
|
3889
|
+
import * as React34 from "react";
|
|
3890
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3779
3891
|
var toggleVariants = cva6(
|
|
3780
3892
|
"inline-flex cursor-pointer 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:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
3781
3893
|
{
|
|
@@ -3796,7 +3908,7 @@ var toggleVariants = cva6(
|
|
|
3796
3908
|
}
|
|
3797
3909
|
}
|
|
3798
3910
|
);
|
|
3799
|
-
var Toggle =
|
|
3911
|
+
var Toggle = React34.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
3800
3912
|
TogglePrimitive.Root,
|
|
3801
3913
|
{
|
|
3802
3914
|
ref,
|
|
@@ -3806,21 +3918,21 @@ var Toggle = React33.forwardRef(({ className, variant, size, ...props }, ref) =>
|
|
|
3806
3918
|
}
|
|
3807
3919
|
));
|
|
3808
3920
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
3809
|
-
var ToggleGroupContext =
|
|
3810
|
-
var ToggleGroup =
|
|
3921
|
+
var ToggleGroupContext = React34.createContext({ size: "default", variant: "default" });
|
|
3922
|
+
var ToggleGroup = React34.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
3811
3923
|
ToggleGroupPrimitive.Root,
|
|
3812
3924
|
{
|
|
3813
3925
|
ref,
|
|
3814
3926
|
"data-slot": "toggle-group",
|
|
3815
3927
|
className: cn("flex items-center justify-center gap-1", className),
|
|
3816
3928
|
...props,
|
|
3817
|
-
children: /* @__PURE__ */
|
|
3929
|
+
children: /* @__PURE__ */ jsx44(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
3818
3930
|
}
|
|
3819
3931
|
));
|
|
3820
3932
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
3821
|
-
var ToggleGroupItem =
|
|
3822
|
-
const context =
|
|
3823
|
-
return /* @__PURE__ */
|
|
3933
|
+
var ToggleGroupItem = React34.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
3934
|
+
const context = React34.useContext(ToggleGroupContext);
|
|
3935
|
+
return /* @__PURE__ */ jsx44(
|
|
3824
3936
|
ToggleGroupPrimitive.Item,
|
|
3825
3937
|
{
|
|
3826
3938
|
ref,
|
|
@@ -3841,14 +3953,14 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
3841
3953
|
|
|
3842
3954
|
// src/tooltip.tsx
|
|
3843
3955
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3844
|
-
import * as
|
|
3845
|
-
import { jsx as
|
|
3956
|
+
import * as React35 from "react";
|
|
3957
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3846
3958
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
3847
3959
|
var Tooltip = TooltipPrimitive.Root;
|
|
3848
3960
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3849
|
-
var TooltipContent =
|
|
3961
|
+
var TooltipContent = React35.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
3850
3962
|
const resolved = usePortalContainer(container);
|
|
3851
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ jsx45(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx45(
|
|
3852
3964
|
TooltipPrimitive.Content,
|
|
3853
3965
|
{
|
|
3854
3966
|
ref,
|
|
@@ -3917,6 +4029,8 @@ export {
|
|
|
3917
4029
|
CommandList,
|
|
3918
4030
|
CommandSeparator,
|
|
3919
4031
|
CommandShortcut,
|
|
4032
|
+
ConfirmDialog,
|
|
4033
|
+
ConfirmDialogHost,
|
|
3920
4034
|
ContextMenu,
|
|
3921
4035
|
ContextMenuCheckboxItem,
|
|
3922
4036
|
ContextMenuContent,
|