@ship-it-ui/ui 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1639 -583
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +385 -27
- package/dist/index.d.ts +385 -27
- package/dist/index.js +1643 -583
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
- package/src/styles/globals.css +4 -4
package/dist/index.js
CHANGED
|
@@ -837,7 +837,7 @@ function Select({
|
|
|
837
837
|
|
|
838
838
|
// src/components/Slider/Slider.tsx
|
|
839
839
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
840
|
-
import { forwardRef as forwardRef12 } from "react";
|
|
840
|
+
import { forwardRef as forwardRef12, useCallback as useCallback5, useState as useState6 } from "react";
|
|
841
841
|
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
842
842
|
var Slider = forwardRef12(function Slider2({
|
|
843
843
|
showValue,
|
|
@@ -845,6 +845,7 @@ var Slider = forwardRef12(function Slider2({
|
|
|
845
845
|
className,
|
|
846
846
|
value,
|
|
847
847
|
defaultValue,
|
|
848
|
+
onValueChange,
|
|
848
849
|
thumbLabels,
|
|
849
850
|
"aria-label": ariaLabel,
|
|
850
851
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -852,7 +853,20 @@ var Slider = forwardRef12(function Slider2({
|
|
|
852
853
|
}, ref) {
|
|
853
854
|
const arrValue = Array.isArray(value) ? value : value !== void 0 ? [value] : void 0;
|
|
854
855
|
const arrDefault = Array.isArray(defaultValue) ? defaultValue : defaultValue !== void 0 ? [defaultValue] : void 0;
|
|
855
|
-
const
|
|
856
|
+
const isControlled = arrValue !== void 0;
|
|
857
|
+
const [uncontrolledValue, setUncontrolledValue] = useState6(arrDefault);
|
|
858
|
+
const currentValue = isControlled ? arrValue : uncontrolledValue;
|
|
859
|
+
const wasScalar = !Array.isArray(value ?? defaultValue) && (value ?? defaultValue) !== void 0;
|
|
860
|
+
const handleValueChange = useCallback5(
|
|
861
|
+
(next) => {
|
|
862
|
+
if (!isControlled) setUncontrolledValue(next);
|
|
863
|
+
if (onValueChange) {
|
|
864
|
+
onValueChange(wasScalar ? next[0] ?? 0 : next);
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
[isControlled, onValueChange, wasScalar]
|
|
868
|
+
);
|
|
869
|
+
const display = currentValue?.[0] ?? props.min ?? 0;
|
|
856
870
|
const thumbCount = (arrValue ?? arrDefault)?.length ?? 1;
|
|
857
871
|
return /* @__PURE__ */ jsxs10(
|
|
858
872
|
"span",
|
|
@@ -866,6 +880,7 @@ var Slider = forwardRef12(function Slider2({
|
|
|
866
880
|
{
|
|
867
881
|
value: arrValue,
|
|
868
882
|
defaultValue: arrDefault,
|
|
883
|
+
onValueChange: handleValueChange,
|
|
869
884
|
className: "relative flex h-4 flex-1 touch-none items-center select-none",
|
|
870
885
|
...props,
|
|
871
886
|
children: [
|
|
@@ -1394,10 +1409,71 @@ var Kbd = forwardRef22(function Kbd2({ className, children, ...props }, ref) {
|
|
|
1394
1409
|
});
|
|
1395
1410
|
Kbd.displayName = "Kbd";
|
|
1396
1411
|
|
|
1412
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
1413
|
+
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
1414
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
1415
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1416
|
+
var scrollbarBase = "flex touch-none select-none p-[2px] transition-colors duration-(--duration-micro)";
|
|
1417
|
+
var thumbBase = 'relative flex-1 rounded-full bg-text-muted/40 hover:bg-text-muted/60 before:absolute before:inset-1/2 before:size-full before:min-h-[44px] before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2 before:content-[""]';
|
|
1418
|
+
var ScrollArea = forwardRef23(function ScrollArea2({
|
|
1419
|
+
type = "hover",
|
|
1420
|
+
orientation = "vertical",
|
|
1421
|
+
scrollHideDelay = 600,
|
|
1422
|
+
className,
|
|
1423
|
+
viewportClassName,
|
|
1424
|
+
viewportRef,
|
|
1425
|
+
children,
|
|
1426
|
+
...props
|
|
1427
|
+
}, ref) {
|
|
1428
|
+
const showVertical = orientation === "vertical" || orientation === "both";
|
|
1429
|
+
const showHorizontal = orientation === "horizontal" || orientation === "both";
|
|
1430
|
+
return /* @__PURE__ */ jsxs19(
|
|
1431
|
+
RadixScrollArea.Root,
|
|
1432
|
+
{
|
|
1433
|
+
ref,
|
|
1434
|
+
type,
|
|
1435
|
+
scrollHideDelay,
|
|
1436
|
+
className: cn("relative overflow-hidden", className),
|
|
1437
|
+
...props,
|
|
1438
|
+
children: [
|
|
1439
|
+
/* @__PURE__ */ jsx24(
|
|
1440
|
+
RadixScrollArea.Viewport,
|
|
1441
|
+
{
|
|
1442
|
+
ref: viewportRef,
|
|
1443
|
+
className: cn("h-full w-full rounded-[inherit]", viewportClassName),
|
|
1444
|
+
children
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
showVertical && /* @__PURE__ */ jsx24(
|
|
1448
|
+
RadixScrollArea.Scrollbar,
|
|
1449
|
+
{
|
|
1450
|
+
orientation: "vertical",
|
|
1451
|
+
className: cn(scrollbarBase, "bg-panel-2/40 hover:bg-panel-2/80 h-full w-[10px]"),
|
|
1452
|
+
children: /* @__PURE__ */ jsx24(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1453
|
+
}
|
|
1454
|
+
),
|
|
1455
|
+
showHorizontal && /* @__PURE__ */ jsx24(
|
|
1456
|
+
RadixScrollArea.Scrollbar,
|
|
1457
|
+
{
|
|
1458
|
+
orientation: "horizontal",
|
|
1459
|
+
className: cn(
|
|
1460
|
+
scrollbarBase,
|
|
1461
|
+
"bg-panel-2/40 hover:bg-panel-2/80 h-[10px] w-full flex-col"
|
|
1462
|
+
),
|
|
1463
|
+
children: /* @__PURE__ */ jsx24(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1464
|
+
}
|
|
1465
|
+
),
|
|
1466
|
+
orientation === "both" && /* @__PURE__ */ jsx24(RadixScrollArea.Corner, { className: "bg-panel-2/60" })
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
);
|
|
1470
|
+
});
|
|
1471
|
+
ScrollArea.displayName = "ScrollArea";
|
|
1472
|
+
|
|
1397
1473
|
// src/components/Skeleton/Skeleton.tsx
|
|
1398
1474
|
import { cva as cva7 } from "class-variance-authority";
|
|
1399
|
-
import { forwardRef as
|
|
1400
|
-
import { jsx as
|
|
1475
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
1476
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1401
1477
|
var skeletonStyles = cva7("block bg-panel-2 animate-[ship-skeleton_1.4s_infinite]", {
|
|
1402
1478
|
variants: {
|
|
1403
1479
|
shape: {
|
|
@@ -1409,11 +1485,11 @@ var skeletonStyles = cva7("block bg-panel-2 animate-[ship-skeleton_1.4s_infinite
|
|
|
1409
1485
|
defaultVariants: { shape: "line" }
|
|
1410
1486
|
});
|
|
1411
1487
|
var defaultHeight = { line: 14, block: 80, circle: 40 };
|
|
1412
|
-
var Skeleton =
|
|
1488
|
+
var Skeleton = forwardRef24(function Skeleton2({ shape = "line", width = "100%", height, standalone = false, className, style, ...props }, ref) {
|
|
1413
1489
|
const h = height ?? defaultHeight[shape];
|
|
1414
1490
|
const w = shape === "circle" ? h : width;
|
|
1415
1491
|
const a11yProps = standalone ? { role: "status", "aria-busy": true, "aria-label": "Loading" } : { "aria-hidden": true };
|
|
1416
|
-
return /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ jsx25(
|
|
1417
1493
|
"div",
|
|
1418
1494
|
{
|
|
1419
1495
|
ref,
|
|
@@ -1425,11 +1501,11 @@ var Skeleton = forwardRef23(function Skeleton2({ shape = "line", width = "100%",
|
|
|
1425
1501
|
);
|
|
1426
1502
|
});
|
|
1427
1503
|
Skeleton.displayName = "Skeleton";
|
|
1428
|
-
var SkeletonGroup =
|
|
1504
|
+
var SkeletonGroup = forwardRef24(function SkeletonGroup2({ label = "Loading", loading = true, className, children, ...props }, ref) {
|
|
1429
1505
|
if (!loading) {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ jsx25("div", { ref, className, ...props, children });
|
|
1431
1507
|
}
|
|
1432
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ jsx25(
|
|
1433
1509
|
"div",
|
|
1434
1510
|
{
|
|
1435
1511
|
ref,
|
|
@@ -1445,10 +1521,10 @@ var SkeletonGroup = forwardRef23(function SkeletonGroup2({ label = "Loading", lo
|
|
|
1445
1521
|
SkeletonGroup.displayName = "SkeletonGroup";
|
|
1446
1522
|
|
|
1447
1523
|
// src/components/Tag/Tag.tsx
|
|
1448
|
-
import { forwardRef as
|
|
1449
|
-
import { jsx as
|
|
1450
|
-
var Tag =
|
|
1451
|
-
return /* @__PURE__ */
|
|
1524
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
1525
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1526
|
+
var Tag = forwardRef25(function Tag2({ onRemove, icon, size = 22, className, children, ...props }, ref) {
|
|
1527
|
+
return /* @__PURE__ */ jsxs20(
|
|
1452
1528
|
"span",
|
|
1453
1529
|
{
|
|
1454
1530
|
ref,
|
|
@@ -1460,9 +1536,9 @@ var Tag = forwardRef24(function Tag2({ onRemove, icon, size = 22, className, chi
|
|
|
1460
1536
|
style: { height: size },
|
|
1461
1537
|
...props,
|
|
1462
1538
|
children: [
|
|
1463
|
-
icon && /* @__PURE__ */
|
|
1539
|
+
icon && /* @__PURE__ */ jsx26("span", { className: "text-text-dim inline-flex", children: icon }),
|
|
1464
1540
|
children,
|
|
1465
|
-
onRemove && /* @__PURE__ */
|
|
1541
|
+
onRemove && /* @__PURE__ */ jsx26(
|
|
1466
1542
|
"button",
|
|
1467
1543
|
{
|
|
1468
1544
|
type: "button",
|
|
@@ -1480,14 +1556,14 @@ Tag.displayName = "Tag";
|
|
|
1480
1556
|
|
|
1481
1557
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
1482
1558
|
import * as RadixContext from "@radix-ui/react-context-menu";
|
|
1483
|
-
import { forwardRef as
|
|
1484
|
-
import { jsx as
|
|
1559
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
1560
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1485
1561
|
var ContextMenuRoot = RadixContext.Root;
|
|
1486
1562
|
var ContextMenuTrigger = RadixContext.Trigger;
|
|
1487
1563
|
var ContextMenuPortal = RadixContext.Portal;
|
|
1488
|
-
var ContextMenuContent =
|
|
1564
|
+
var ContextMenuContent = forwardRef26(
|
|
1489
1565
|
function ContextMenuContent2({ className, ...props }, ref) {
|
|
1490
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsx27(RadixContext.Portal, { children: /* @__PURE__ */ jsx27(
|
|
1491
1567
|
RadixContext.Content,
|
|
1492
1568
|
{
|
|
1493
1569
|
ref,
|
|
@@ -1507,26 +1583,26 @@ var itemBase = cn(
|
|
|
1507
1583
|
"data-[highlighted]:bg-panel-2",
|
|
1508
1584
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1509
1585
|
);
|
|
1510
|
-
var ContextMenuItem =
|
|
1586
|
+
var ContextMenuItem = forwardRef26(
|
|
1511
1587
|
function ContextMenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
1512
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ jsxs21(
|
|
1513
1589
|
RadixContext.Item,
|
|
1514
1590
|
{
|
|
1515
1591
|
ref,
|
|
1516
1592
|
className: cn(itemBase, destructive ? "text-err" : "text-text", className),
|
|
1517
1593
|
...props,
|
|
1518
1594
|
children: [
|
|
1519
|
-
icon && /* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
trailing && /* @__PURE__ */
|
|
1595
|
+
icon && /* @__PURE__ */ jsx27("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
1596
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-1", children }),
|
|
1597
|
+
trailing && /* @__PURE__ */ jsx27("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1522
1598
|
]
|
|
1523
1599
|
}
|
|
1524
1600
|
);
|
|
1525
1601
|
}
|
|
1526
1602
|
);
|
|
1527
1603
|
ContextMenuItem.displayName = "ContextMenuItem";
|
|
1528
|
-
var ContextMenuSeparator =
|
|
1529
|
-
return /* @__PURE__ */
|
|
1604
|
+
var ContextMenuSeparator = forwardRef26(function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
1605
|
+
return /* @__PURE__ */ jsx27(
|
|
1530
1606
|
RadixContext.Separator,
|
|
1531
1607
|
{
|
|
1532
1608
|
ref,
|
|
@@ -1540,15 +1616,15 @@ var ContextMenu = RadixContext.Root;
|
|
|
1540
1616
|
|
|
1541
1617
|
// src/components/Dialog/Dialog.tsx
|
|
1542
1618
|
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
1543
|
-
import { forwardRef as
|
|
1544
|
-
import { jsx as
|
|
1619
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
1620
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1545
1621
|
var DialogRoot = RadixDialog.Root;
|
|
1546
1622
|
var DialogTrigger = RadixDialog.Trigger;
|
|
1547
1623
|
var DialogClose = RadixDialog.Close;
|
|
1548
1624
|
var DialogPortal = RadixDialog.Portal;
|
|
1549
|
-
var DialogOverlay =
|
|
1625
|
+
var DialogOverlay = forwardRef27(
|
|
1550
1626
|
function DialogOverlay2({ className, ...props }, ref) {
|
|
1551
|
-
return /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ jsx28(
|
|
1552
1628
|
RadixDialog.Overlay,
|
|
1553
1629
|
{
|
|
1554
1630
|
ref,
|
|
@@ -1563,10 +1639,10 @@ var DialogOverlay = forwardRef26(
|
|
|
1563
1639
|
}
|
|
1564
1640
|
);
|
|
1565
1641
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1566
|
-
var DialogContent =
|
|
1567
|
-
return /* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1642
|
+
var DialogContent = forwardRef27(function DialogContent2({ className, width = 460, style, children, ...props }, ref) {
|
|
1643
|
+
return /* @__PURE__ */ jsxs22(DialogPortal, { children: [
|
|
1644
|
+
/* @__PURE__ */ jsx28(DialogOverlay, {}),
|
|
1645
|
+
/* @__PURE__ */ jsx28(
|
|
1570
1646
|
RadixDialog.Content,
|
|
1571
1647
|
{
|
|
1572
1648
|
ref,
|
|
@@ -1586,31 +1662,31 @@ var DialogContent = forwardRef26(function DialogContent2({ className, width = 46
|
|
|
1586
1662
|
});
|
|
1587
1663
|
DialogContent.displayName = "DialogContent";
|
|
1588
1664
|
function Dialog({ title, description, footer, width, children, ...rootProps }) {
|
|
1589
|
-
return /* @__PURE__ */
|
|
1590
|
-
title && /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx28(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs22(DialogContent, { width, children: [
|
|
1666
|
+
title && /* @__PURE__ */ jsx28(
|
|
1591
1667
|
RadixDialog.Title,
|
|
1592
1668
|
{
|
|
1593
1669
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1594
1670
|
children: title
|
|
1595
1671
|
}
|
|
1596
1672
|
),
|
|
1597
|
-
description && /* @__PURE__ */
|
|
1673
|
+
description && /* @__PURE__ */ jsx28(RadixDialog.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1598
1674
|
children,
|
|
1599
|
-
footer && /* @__PURE__ */
|
|
1675
|
+
footer && /* @__PURE__ */ jsx28("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1600
1676
|
] }) });
|
|
1601
1677
|
}
|
|
1602
1678
|
|
|
1603
1679
|
// src/components/Dialog/Drawer.tsx
|
|
1604
1680
|
import * as RadixDialog2 from "@radix-ui/react-dialog";
|
|
1605
|
-
import { forwardRef as
|
|
1606
|
-
import { jsx as
|
|
1681
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
1682
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1607
1683
|
var sideClasses = {
|
|
1608
1684
|
left: "left-0 border-r border-border-strong data-[state=open]:animate-[ship-slide-in-left_220ms_var(--easing-out)]",
|
|
1609
1685
|
right: "right-0 border-l border-border-strong data-[state=open]:animate-[ship-slide-in-right_220ms_var(--easing-out)]"
|
|
1610
1686
|
};
|
|
1611
|
-
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1687
|
+
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ jsxs23("div", { className: "border-border flex items-center justify-between border-b p-[16px] px-5", children: [
|
|
1688
|
+
/* @__PURE__ */ jsx29(RadixDialog2.Title, { className: "text-[14px] font-medium", children: title }),
|
|
1689
|
+
/* @__PURE__ */ jsx29(
|
|
1614
1690
|
RadixDialog2.Close,
|
|
1615
1691
|
{
|
|
1616
1692
|
onClick: onClose,
|
|
@@ -1620,10 +1696,10 @@ var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ jsxs22("div", { class
|
|
|
1620
1696
|
}
|
|
1621
1697
|
)
|
|
1622
1698
|
] });
|
|
1623
|
-
var Drawer =
|
|
1624
|
-
return /* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1699
|
+
var Drawer = forwardRef28(function Drawer2({ side = "right", title, width = 420, children, ...rootProps }, ref) {
|
|
1700
|
+
return /* @__PURE__ */ jsx29(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs23(DialogPortal, { children: [
|
|
1701
|
+
/* @__PURE__ */ jsx29(DialogOverlay, {}),
|
|
1702
|
+
/* @__PURE__ */ jsxs23(
|
|
1627
1703
|
RadixDialog2.Content,
|
|
1628
1704
|
{
|
|
1629
1705
|
ref,
|
|
@@ -1634,8 +1710,8 @@ var Drawer = forwardRef27(function Drawer2({ side = "right", title, width = 420,
|
|
|
1634
1710
|
),
|
|
1635
1711
|
style: { width },
|
|
1636
1712
|
children: [
|
|
1637
|
-
title ? /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1713
|
+
title ? /* @__PURE__ */ jsx29(DrawerHeader, { title }) : /* @__PURE__ */ jsx29(RadixDialog2.Title, { className: "sr-only", children: "Drawer" }),
|
|
1714
|
+
/* @__PURE__ */ jsx29("div", { className: "flex-1 overflow-auto p-5", children })
|
|
1639
1715
|
]
|
|
1640
1716
|
}
|
|
1641
1717
|
)
|
|
@@ -1645,12 +1721,12 @@ Drawer.displayName = "Drawer";
|
|
|
1645
1721
|
|
|
1646
1722
|
// src/components/Dialog/Sheet.tsx
|
|
1647
1723
|
import * as RadixDialog3 from "@radix-ui/react-dialog";
|
|
1648
|
-
import { forwardRef as
|
|
1649
|
-
import { jsx as
|
|
1650
|
-
var Sheet =
|
|
1651
|
-
return /* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1653
|
-
/* @__PURE__ */
|
|
1724
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
1725
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1726
|
+
var Sheet = forwardRef29(function Sheet2({ title, width = "min(640px, 90vw)", children, ...rootProps }, ref) {
|
|
1727
|
+
return /* @__PURE__ */ jsx30(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs24(DialogPortal, { children: [
|
|
1728
|
+
/* @__PURE__ */ jsx30(DialogOverlay, {}),
|
|
1729
|
+
/* @__PURE__ */ jsxs24(
|
|
1654
1730
|
RadixDialog3.Content,
|
|
1655
1731
|
{
|
|
1656
1732
|
ref,
|
|
@@ -1662,7 +1738,7 @@ var Sheet = forwardRef28(function Sheet2({ title, width = "min(640px, 90vw)", ch
|
|
|
1662
1738
|
),
|
|
1663
1739
|
style: { width },
|
|
1664
1740
|
children: [
|
|
1665
|
-
title ? /* @__PURE__ */
|
|
1741
|
+
title ? /* @__PURE__ */ jsx30(RadixDialog3.Title, { className: "mb-1 text-[15px] font-medium", children: title }) : /* @__PURE__ */ jsx30(RadixDialog3.Title, { className: "sr-only", children: "Sheet" }),
|
|
1666
1742
|
children
|
|
1667
1743
|
]
|
|
1668
1744
|
}
|
|
@@ -1673,15 +1749,15 @@ Sheet.displayName = "Sheet";
|
|
|
1673
1749
|
|
|
1674
1750
|
// src/components/Dialog/AlertDialog.tsx
|
|
1675
1751
|
import * as RadixAlert from "@radix-ui/react-alert-dialog";
|
|
1676
|
-
import { forwardRef as
|
|
1677
|
-
import { jsx as
|
|
1752
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
1753
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1678
1754
|
var AlertDialogRoot = RadixAlert.Root;
|
|
1679
1755
|
var AlertDialogTrigger = RadixAlert.Trigger;
|
|
1680
1756
|
var AlertDialogAction = RadixAlert.Action;
|
|
1681
1757
|
var AlertDialogCancel = RadixAlert.Cancel;
|
|
1682
|
-
var AlertDialog =
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1758
|
+
var AlertDialog = forwardRef30(function AlertDialog2({ title, description, footer, width = 460, children, ...rootProps }, ref) {
|
|
1759
|
+
return /* @__PURE__ */ jsx31(AlertDialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs25(RadixAlert.Portal, { children: [
|
|
1760
|
+
/* @__PURE__ */ jsx31(
|
|
1685
1761
|
RadixAlert.Overlay,
|
|
1686
1762
|
{
|
|
1687
1763
|
className: cn(
|
|
@@ -1690,7 +1766,7 @@ var AlertDialog = forwardRef29(function AlertDialog2({ title, description, foote
|
|
|
1690
1766
|
)
|
|
1691
1767
|
}
|
|
1692
1768
|
),
|
|
1693
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ jsxs25(
|
|
1694
1770
|
RadixAlert.Content,
|
|
1695
1771
|
{
|
|
1696
1772
|
ref,
|
|
@@ -1701,16 +1777,16 @@ var AlertDialog = forwardRef29(function AlertDialog2({ title, description, foote
|
|
|
1701
1777
|
"data-[state=open]:animate-[ship-dialog-in_180ms_var(--easing-out)]"
|
|
1702
1778
|
),
|
|
1703
1779
|
children: [
|
|
1704
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ jsx31(
|
|
1705
1781
|
RadixAlert.Title,
|
|
1706
1782
|
{
|
|
1707
1783
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1708
1784
|
children: title
|
|
1709
1785
|
}
|
|
1710
1786
|
),
|
|
1711
|
-
description && /* @__PURE__ */
|
|
1787
|
+
description && /* @__PURE__ */ jsx31(RadixAlert.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1712
1788
|
children,
|
|
1713
|
-
footer && /* @__PURE__ */
|
|
1789
|
+
footer && /* @__PURE__ */ jsx31("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1714
1790
|
]
|
|
1715
1791
|
}
|
|
1716
1792
|
)
|
|
@@ -1720,17 +1796,17 @@ AlertDialog.displayName = "AlertDialog";
|
|
|
1720
1796
|
|
|
1721
1797
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1722
1798
|
import * as RadixMenu from "@radix-ui/react-dropdown-menu";
|
|
1723
|
-
import { forwardRef as
|
|
1724
|
-
import { jsx as
|
|
1799
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
1800
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1725
1801
|
var DropdownMenuRoot = RadixMenu.Root;
|
|
1726
1802
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
1727
1803
|
var DropdownMenuPortal = RadixMenu.Portal;
|
|
1728
1804
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
1729
1805
|
var DropdownMenuLabel = RadixMenu.Label;
|
|
1730
1806
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
1731
|
-
var DropdownMenuContent =
|
|
1807
|
+
var DropdownMenuContent = forwardRef31(
|
|
1732
1808
|
function DropdownMenuContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
1733
|
-
return /* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ jsx32(RadixMenu.Portal, { children: /* @__PURE__ */ jsx32(
|
|
1734
1810
|
RadixMenu.Content,
|
|
1735
1811
|
{
|
|
1736
1812
|
ref,
|
|
@@ -1752,32 +1828,32 @@ var itemBase2 = cn(
|
|
|
1752
1828
|
"data-[highlighted]:bg-panel-2",
|
|
1753
1829
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1754
1830
|
);
|
|
1755
|
-
var MenuItem =
|
|
1756
|
-
return /* @__PURE__ */
|
|
1831
|
+
var MenuItem = forwardRef31(function MenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
1832
|
+
return /* @__PURE__ */ jsxs26(
|
|
1757
1833
|
RadixMenu.Item,
|
|
1758
1834
|
{
|
|
1759
1835
|
ref,
|
|
1760
1836
|
className: cn(itemBase2, destructive ? "text-err" : "text-text", className),
|
|
1761
1837
|
...props,
|
|
1762
1838
|
children: [
|
|
1763
|
-
icon && /* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
trailing && /* @__PURE__ */
|
|
1839
|
+
icon && /* @__PURE__ */ jsx32("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
1840
|
+
/* @__PURE__ */ jsx32("span", { className: "flex-1", children }),
|
|
1841
|
+
trailing && /* @__PURE__ */ jsx32("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1766
1842
|
]
|
|
1767
1843
|
}
|
|
1768
1844
|
);
|
|
1769
1845
|
});
|
|
1770
1846
|
MenuItem.displayName = "MenuItem";
|
|
1771
|
-
var MenuCheckboxItem =
|
|
1847
|
+
var MenuCheckboxItem = forwardRef31(
|
|
1772
1848
|
function MenuCheckboxItem2({ className, children, ...props }, ref) {
|
|
1773
|
-
return /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ jsxs26(
|
|
1774
1850
|
RadixMenu.CheckboxItem,
|
|
1775
1851
|
{
|
|
1776
1852
|
ref,
|
|
1777
1853
|
className: cn(itemBase2, "text-text relative pl-[26px]", className),
|
|
1778
1854
|
...props,
|
|
1779
1855
|
children: [
|
|
1780
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ jsx32(RadixMenu.ItemIndicator, { className: "text-accent absolute top-1/2 left-2 -translate-y-1/2 text-[10px]", children: "\u2713" }),
|
|
1781
1857
|
children
|
|
1782
1858
|
]
|
|
1783
1859
|
}
|
|
@@ -1785,9 +1861,9 @@ var MenuCheckboxItem = forwardRef30(
|
|
|
1785
1861
|
}
|
|
1786
1862
|
);
|
|
1787
1863
|
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
1788
|
-
var MenuSeparator =
|
|
1864
|
+
var MenuSeparator = forwardRef31(
|
|
1789
1865
|
function MenuSeparator2({ className, ...props }, ref) {
|
|
1790
|
-
return /* @__PURE__ */
|
|
1866
|
+
return /* @__PURE__ */ jsx32(
|
|
1791
1867
|
RadixMenu.Separator,
|
|
1792
1868
|
{
|
|
1793
1869
|
ref,
|
|
@@ -1802,14 +1878,14 @@ var DropdownMenu = RadixMenu.Root;
|
|
|
1802
1878
|
|
|
1803
1879
|
// src/components/HoverCard/HoverCard.tsx
|
|
1804
1880
|
import * as RadixHoverCard from "@radix-ui/react-hover-card";
|
|
1805
|
-
import { forwardRef as
|
|
1806
|
-
import { jsx as
|
|
1881
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
1882
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1807
1883
|
var HoverCardRoot = RadixHoverCard.Root;
|
|
1808
1884
|
var HoverCardTrigger = RadixHoverCard.Trigger;
|
|
1809
1885
|
var HoverCardPortal = RadixHoverCard.Portal;
|
|
1810
|
-
var HoverCardContent =
|
|
1886
|
+
var HoverCardContent = forwardRef32(
|
|
1811
1887
|
function HoverCardContent2({ className, sideOffset = 4, ...props }, ref) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsx33(RadixHoverCard.Portal, { children: /* @__PURE__ */ jsx33(
|
|
1813
1889
|
RadixHoverCard.Content,
|
|
1814
1890
|
{
|
|
1815
1891
|
ref,
|
|
@@ -1826,25 +1902,25 @@ var HoverCardContent = forwardRef31(
|
|
|
1826
1902
|
);
|
|
1827
1903
|
HoverCardContent.displayName = "HoverCardContent";
|
|
1828
1904
|
function HoverCard({ trigger, content, ...rootProps }) {
|
|
1829
|
-
return /* @__PURE__ */
|
|
1830
|
-
/* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1905
|
+
return /* @__PURE__ */ jsxs27(RadixHoverCard.Root, { openDelay: 200, closeDelay: 120, ...rootProps, children: [
|
|
1906
|
+
/* @__PURE__ */ jsx33(RadixHoverCard.Trigger, { asChild: true, children: trigger }),
|
|
1907
|
+
/* @__PURE__ */ jsx33(HoverCardContent, { children: content })
|
|
1832
1908
|
] });
|
|
1833
1909
|
}
|
|
1834
1910
|
|
|
1835
1911
|
// src/components/Popover/Popover.tsx
|
|
1836
1912
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
1837
|
-
import { forwardRef as
|
|
1838
|
-
import { jsx as
|
|
1913
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
1914
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1839
1915
|
var PopoverRoot = RadixPopover.Root;
|
|
1840
1916
|
var PopoverTrigger = RadixPopover.Trigger;
|
|
1841
1917
|
var PopoverAnchor = RadixPopover.Anchor;
|
|
1842
1918
|
var PopoverPortal = RadixPopover.Portal;
|
|
1843
1919
|
var PopoverClose = RadixPopover.Close;
|
|
1844
1920
|
var PopoverArrow = RadixPopover.Arrow;
|
|
1845
|
-
var PopoverContent =
|
|
1921
|
+
var PopoverContent = forwardRef33(
|
|
1846
1922
|
function PopoverContent2({ className, align = "start", sideOffset = 6, ...props }, ref) {
|
|
1847
|
-
return /* @__PURE__ */
|
|
1923
|
+
return /* @__PURE__ */ jsx34(RadixPopover.Portal, { children: /* @__PURE__ */ jsx34(
|
|
1848
1924
|
RadixPopover.Content,
|
|
1849
1925
|
{
|
|
1850
1926
|
ref,
|
|
@@ -1867,13 +1943,13 @@ var Popover = RadixPopover.Root;
|
|
|
1867
1943
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
1868
1944
|
import {
|
|
1869
1945
|
createContext,
|
|
1870
|
-
forwardRef as
|
|
1871
|
-
useCallback as
|
|
1946
|
+
forwardRef as forwardRef34,
|
|
1947
|
+
useCallback as useCallback6,
|
|
1872
1948
|
useContext,
|
|
1873
1949
|
useMemo,
|
|
1874
|
-
useState as
|
|
1950
|
+
useState as useState7
|
|
1875
1951
|
} from "react";
|
|
1876
|
-
import { jsx as
|
|
1952
|
+
import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1877
1953
|
var ToastContext = createContext(null);
|
|
1878
1954
|
var variantIcon = {
|
|
1879
1955
|
default: "\u25CF",
|
|
@@ -1899,8 +1975,8 @@ var variantBorderLeft = {
|
|
|
1899
1975
|
var toastIdCounter = 0;
|
|
1900
1976
|
var nextToastId = () => `toast-${++toastIdCounter}`;
|
|
1901
1977
|
function ToastProvider({ children }) {
|
|
1902
|
-
const [toasts, setToasts] =
|
|
1903
|
-
const toast =
|
|
1978
|
+
const [toasts, setToasts] = useState7([]);
|
|
1979
|
+
const toast = useCallback6((t) => {
|
|
1904
1980
|
const explicitId = t.id;
|
|
1905
1981
|
const id = explicitId ?? nextToastId();
|
|
1906
1982
|
const entry = { ...t, id };
|
|
@@ -1912,14 +1988,14 @@ function ToastProvider({ children }) {
|
|
|
1912
1988
|
});
|
|
1913
1989
|
return id;
|
|
1914
1990
|
}, []);
|
|
1915
|
-
const dismiss =
|
|
1991
|
+
const dismiss = useCallback6((id) => {
|
|
1916
1992
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1917
1993
|
}, []);
|
|
1918
1994
|
const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
|
|
1919
|
-
return /* @__PURE__ */
|
|
1995
|
+
return /* @__PURE__ */ jsx35(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs28(RadixToast.Provider, { swipeDirection: "right", children: [
|
|
1920
1996
|
children,
|
|
1921
|
-
toasts.map((t) => /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1997
|
+
toasts.map((t) => /* @__PURE__ */ jsx35(ToastCard, { toast: t, onDismiss: () => dismiss(t.id) }, t.id)),
|
|
1998
|
+
/* @__PURE__ */ jsx35(RadixToast.Viewport, { className: "z-toast fixed right-5 bottom-5 flex w-[380px] max-w-[calc(100vw-40px)] flex-col gap-2 outline-none" })
|
|
1923
1999
|
] }) });
|
|
1924
2000
|
}
|
|
1925
2001
|
function useToast() {
|
|
@@ -1927,9 +2003,9 @@ function useToast() {
|
|
|
1927
2003
|
if (!ctx) throw new Error("useToast must be inside <ToastProvider>");
|
|
1928
2004
|
return ctx;
|
|
1929
2005
|
}
|
|
1930
|
-
var ToastCard =
|
|
2006
|
+
var ToastCard = forwardRef34(function ToastCard2({ toast, onDismiss }, ref) {
|
|
1931
2007
|
const variant = toast.variant ?? "default";
|
|
1932
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ jsxs28(
|
|
1933
2009
|
RadixToast.Root,
|
|
1934
2010
|
{
|
|
1935
2011
|
ref,
|
|
@@ -1944,13 +2020,13 @@ var ToastCard = forwardRef33(function ToastCard2({ toast, onDismiss }, ref) {
|
|
|
1944
2020
|
variantBorderLeft[variant]
|
|
1945
2021
|
),
|
|
1946
2022
|
children: [
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
toast.description && /* @__PURE__ */
|
|
1951
|
-
toast.action && /* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ jsx35("span", { className: cn("mt-px text-[14px] leading-none", variantTextColor[variant]), children: variantIcon[variant] }),
|
|
2024
|
+
/* @__PURE__ */ jsxs28("div", { className: "min-w-0 flex-1", children: [
|
|
2025
|
+
/* @__PURE__ */ jsx35(RadixToast.Title, { className: "text-text text-[13px] font-medium", children: toast.title }),
|
|
2026
|
+
toast.description && /* @__PURE__ */ jsx35(RadixToast.Description, { className: "text-text-muted mt-[2px] text-[12px] leading-[1.5]", children: toast.description }),
|
|
2027
|
+
toast.action && /* @__PURE__ */ jsx35("div", { className: "mt-2", children: toast.action })
|
|
1952
2028
|
] }),
|
|
1953
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ jsx35(
|
|
1954
2030
|
RadixToast.Close,
|
|
1955
2031
|
{
|
|
1956
2032
|
"aria-label": "Dismiss",
|
|
@@ -1966,16 +2042,16 @@ ToastCard.displayName = "ToastCard";
|
|
|
1966
2042
|
|
|
1967
2043
|
// src/components/Tooltip/Tooltip.tsx
|
|
1968
2044
|
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
1969
|
-
import { forwardRef as
|
|
1970
|
-
import { jsx as
|
|
2045
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
2046
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1971
2047
|
var TooltipProvider = RadixTooltip.Provider;
|
|
1972
2048
|
var TooltipRoot = RadixTooltip.Root;
|
|
1973
2049
|
var TooltipTrigger = RadixTooltip.Trigger;
|
|
1974
2050
|
var TooltipPortal = RadixTooltip.Portal;
|
|
1975
2051
|
var TooltipArrow = RadixTooltip.Arrow;
|
|
1976
|
-
var TooltipContent =
|
|
2052
|
+
var TooltipContent = forwardRef35(
|
|
1977
2053
|
function TooltipContent2({ className, sideOffset = 6, ...props }, ref) {
|
|
1978
|
-
return /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ jsx36(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx36(
|
|
1979
2055
|
RadixTooltip.Content,
|
|
1980
2056
|
{
|
|
1981
2057
|
ref,
|
|
@@ -1993,16 +2069,16 @@ var TooltipContent = forwardRef34(
|
|
|
1993
2069
|
);
|
|
1994
2070
|
TooltipContent.displayName = "TooltipContent";
|
|
1995
2071
|
function Tooltip({ content, children, side = "top", delayDuration = 400 }) {
|
|
1996
|
-
return /* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsx36(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs29(TooltipRoot, { children: [
|
|
2073
|
+
/* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children }),
|
|
2074
|
+
/* @__PURE__ */ jsx36(TooltipContent, { side, children: content })
|
|
1999
2075
|
] }) });
|
|
2000
2076
|
}
|
|
2001
2077
|
|
|
2002
2078
|
// src/patterns/Alert/Alert.tsx
|
|
2003
2079
|
import { cva as cva8 } from "class-variance-authority";
|
|
2004
|
-
import { forwardRef as
|
|
2005
|
-
import { jsx as
|
|
2080
|
+
import { forwardRef as forwardRef36 } from "react";
|
|
2081
|
+
import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2006
2082
|
var alertStyles = cva8("flex items-start gap-3 rounded-base border bg-panel p-3 text-[13px]", {
|
|
2007
2083
|
variants: {
|
|
2008
2084
|
tone: {
|
|
@@ -2026,7 +2102,7 @@ var defaultGlyph = {
|
|
|
2026
2102
|
warn: "!",
|
|
2027
2103
|
err: "\xD7"
|
|
2028
2104
|
};
|
|
2029
|
-
var Alert =
|
|
2105
|
+
var Alert = forwardRef36(function Alert2({
|
|
2030
2106
|
tone = "accent",
|
|
2031
2107
|
title,
|
|
2032
2108
|
description,
|
|
@@ -2038,7 +2114,7 @@ var Alert = forwardRef35(function Alert2({
|
|
|
2038
2114
|
...props
|
|
2039
2115
|
}, ref) {
|
|
2040
2116
|
const t = tone ?? "accent";
|
|
2041
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ jsxs30(
|
|
2042
2118
|
"div",
|
|
2043
2119
|
{
|
|
2044
2120
|
ref,
|
|
@@ -2047,13 +2123,13 @@ var Alert = forwardRef35(function Alert2({
|
|
|
2047
2123
|
className: cn(alertStyles({ tone }), className),
|
|
2048
2124
|
...props,
|
|
2049
2125
|
children: [
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
title && /* @__PURE__ */
|
|
2053
|
-
description && /* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ jsx37("span", { "aria-hidden": true, className: cn("mt-[1px] text-[14px] leading-none", iconColorClass[t]), children: icon ?? defaultGlyph[t] }),
|
|
2127
|
+
/* @__PURE__ */ jsxs30("div", { className: "min-w-0 flex-1", children: [
|
|
2128
|
+
title && /* @__PURE__ */ jsx37("div", { className: "font-medium", children: title }),
|
|
2129
|
+
description && /* @__PURE__ */ jsx37("div", { className: "text-text-muted mt-[2px] text-[12px]", children: description }),
|
|
2054
2130
|
children
|
|
2055
2131
|
] }),
|
|
2056
|
-
action && /* @__PURE__ */
|
|
2132
|
+
action && /* @__PURE__ */ jsx37("div", { className: "ml-1 shrink-0", children: action })
|
|
2057
2133
|
]
|
|
2058
2134
|
}
|
|
2059
2135
|
);
|
|
@@ -2062,8 +2138,8 @@ Alert.displayName = "Alert";
|
|
|
2062
2138
|
|
|
2063
2139
|
// src/patterns/Banner/Banner.tsx
|
|
2064
2140
|
import { cva as cva9 } from "class-variance-authority";
|
|
2065
|
-
import { forwardRef as
|
|
2066
|
-
import { jsx as
|
|
2141
|
+
import { forwardRef as forwardRef37 } from "react";
|
|
2142
|
+
import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2067
2143
|
var bannerStyles = cva9(
|
|
2068
2144
|
"flex items-center gap-3 border-b border-border px-[14px] py-2 text-[12px]",
|
|
2069
2145
|
{
|
|
@@ -2088,9 +2164,9 @@ var defaultGlyph2 = {
|
|
|
2088
2164
|
warn: "!",
|
|
2089
2165
|
err: "\xD7"
|
|
2090
2166
|
};
|
|
2091
|
-
var Banner =
|
|
2167
|
+
var Banner = forwardRef37(function Banner2({ tone = "accent", sticky, icon, action, live = "polite", className, children, ...props }, ref) {
|
|
2092
2168
|
const t = tone ?? "accent";
|
|
2093
|
-
return /* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ jsxs31(
|
|
2094
2170
|
"div",
|
|
2095
2171
|
{
|
|
2096
2172
|
ref,
|
|
@@ -2099,9 +2175,9 @@ var Banner = forwardRef36(function Banner2({ tone = "accent", sticky, icon, acti
|
|
|
2099
2175
|
className: cn(bannerStyles({ tone, sticky }), className),
|
|
2100
2176
|
...props,
|
|
2101
2177
|
children: [
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
action && /* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsx38("span", { "aria-hidden": true, className: "leading-none", children: icon ?? defaultGlyph2[t] }),
|
|
2179
|
+
/* @__PURE__ */ jsx38("div", { className: "min-w-0 flex-1", children }),
|
|
2180
|
+
action && /* @__PURE__ */ jsx38("div", { className: "ml-auto", children: action })
|
|
2105
2181
|
]
|
|
2106
2182
|
}
|
|
2107
2183
|
);
|
|
@@ -2111,30 +2187,30 @@ Banner.displayName = "Banner";
|
|
|
2111
2187
|
// src/patterns/Breadcrumbs/Breadcrumbs.tsx
|
|
2112
2188
|
import {
|
|
2113
2189
|
Children as Children2,
|
|
2114
|
-
forwardRef as
|
|
2190
|
+
forwardRef as forwardRef38,
|
|
2115
2191
|
isValidElement as isValidElement2
|
|
2116
2192
|
} from "react";
|
|
2117
|
-
import { jsx as
|
|
2118
|
-
var Breadcrumbs =
|
|
2193
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2194
|
+
var Breadcrumbs = forwardRef38(function Breadcrumbs2({ separator = "/", className, children, ...props }, ref) {
|
|
2119
2195
|
const crumbs = Children2.toArray(children).filter(isValidElement2);
|
|
2120
2196
|
const last = crumbs.length - 1;
|
|
2121
|
-
return /* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ jsx39("nav", { ref, "aria-label": "Breadcrumb", className: cn("text-[13px]", className), ...props, children: /* @__PURE__ */ jsx39("ol", { className: "text-text-muted flex flex-wrap items-center gap-[6px]", children: crumbs.map((crumb, i) => {
|
|
2122
2198
|
const isCurrent = i === last;
|
|
2123
|
-
return /* @__PURE__ */
|
|
2124
|
-
isCurrent ? /* @__PURE__ */
|
|
2125
|
-
!isCurrent && /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsxs32("li", { className: "inline-flex items-center gap-[6px]", children: [
|
|
2200
|
+
isCurrent ? /* @__PURE__ */ jsx39(Crumb, { ...crumb.props, current: true }) : crumb,
|
|
2201
|
+
!isCurrent && /* @__PURE__ */ jsx39("span", { "aria-hidden": true, className: "text-text-dim", children: separator })
|
|
2126
2202
|
] }, i);
|
|
2127
2203
|
}) }) });
|
|
2128
2204
|
});
|
|
2129
2205
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2130
|
-
var Crumb =
|
|
2206
|
+
var Crumb = forwardRef38(function Crumb2({ current, className, href, children, ...props }, ref) {
|
|
2131
2207
|
if (current) {
|
|
2132
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ jsx39("span", { "aria-current": "page", className: cn("text-text", className), children });
|
|
2133
2209
|
}
|
|
2134
2210
|
if (href === void 0) {
|
|
2135
|
-
return /* @__PURE__ */
|
|
2211
|
+
return /* @__PURE__ */ jsx39("span", { className: cn("text-text-dim", className), children });
|
|
2136
2212
|
}
|
|
2137
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ jsx39(
|
|
2138
2214
|
"a",
|
|
2139
2215
|
{
|
|
2140
2216
|
ref,
|
|
@@ -2149,14 +2225,14 @@ Crumb.displayName = "Crumb";
|
|
|
2149
2225
|
|
|
2150
2226
|
// src/patterns/Combobox/Combobox.tsx
|
|
2151
2227
|
import {
|
|
2152
|
-
forwardRef as
|
|
2228
|
+
forwardRef as forwardRef39,
|
|
2153
2229
|
useEffect as useEffect5,
|
|
2154
2230
|
useId as useId6,
|
|
2155
2231
|
useMemo as useMemo2,
|
|
2156
2232
|
useRef as useRef4,
|
|
2157
|
-
useState as
|
|
2233
|
+
useState as useState8
|
|
2158
2234
|
} from "react";
|
|
2159
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2160
2236
|
function normalize(option) {
|
|
2161
2237
|
if (typeof option === "string") {
|
|
2162
2238
|
return { value: option, label: option, searchText: option.toLowerCase() };
|
|
@@ -2172,7 +2248,7 @@ function normalize(option) {
|
|
|
2172
2248
|
};
|
|
2173
2249
|
}
|
|
2174
2250
|
var defaultFilter = (option, query) => option.searchText.includes(query.toLowerCase());
|
|
2175
|
-
var Combobox =
|
|
2251
|
+
var Combobox = forwardRef39(function Combobox2({
|
|
2176
2252
|
options,
|
|
2177
2253
|
value: valueProp,
|
|
2178
2254
|
defaultValue,
|
|
@@ -2211,7 +2287,7 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2211
2287
|
defaultValue: initialQuery,
|
|
2212
2288
|
onChange: onQueryChange
|
|
2213
2289
|
});
|
|
2214
|
-
const [open, setOpen] =
|
|
2290
|
+
const [open, setOpen] = useState8(false);
|
|
2215
2291
|
const wrapperRef = useRef4(null);
|
|
2216
2292
|
useOutsideClick(wrapperRef, () => setOpen(false));
|
|
2217
2293
|
const filtered = useMemo2(
|
|
@@ -2249,8 +2325,8 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2249
2325
|
setOpen(false);
|
|
2250
2326
|
}
|
|
2251
2327
|
};
|
|
2252
|
-
return /* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2328
|
+
return /* @__PURE__ */ jsxs33("div", { ref: wrapperRef, className: "relative", style: { width }, children: [
|
|
2329
|
+
/* @__PURE__ */ jsx40(
|
|
2254
2330
|
"input",
|
|
2255
2331
|
{
|
|
2256
2332
|
ref,
|
|
@@ -2284,7 +2360,7 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2284
2360
|
)
|
|
2285
2361
|
}
|
|
2286
2362
|
),
|
|
2287
|
-
open && /* @__PURE__ */
|
|
2363
|
+
open && /* @__PURE__ */ jsx40(
|
|
2288
2364
|
"ul",
|
|
2289
2365
|
{
|
|
2290
2366
|
id: listboxId,
|
|
@@ -2294,9 +2370,9 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2294
2370
|
"z-dropdown absolute top-full right-0 left-0 mt-1 max-h-[220px] overflow-auto",
|
|
2295
2371
|
"border-border bg-panel rounded-md border p-1 shadow-lg"
|
|
2296
2372
|
),
|
|
2297
|
-
children: filtered.length === 0 ? /* @__PURE__ */
|
|
2373
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx40("li", { className: "text-text-dim px-2 py-3 text-center text-[12px]", role: "presentation", children: emptyState ?? "No matches" }) : filtered.map((option, i) => {
|
|
2298
2374
|
const isActive = i === cursor;
|
|
2299
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsxs33(
|
|
2300
2376
|
"li",
|
|
2301
2377
|
{
|
|
2302
2378
|
id: `${listboxId}-option-${i}`,
|
|
@@ -2314,8 +2390,8 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2314
2390
|
option.disabled && "pointer-events-none opacity-40"
|
|
2315
2391
|
),
|
|
2316
2392
|
children: [
|
|
2317
|
-
/* @__PURE__ */
|
|
2318
|
-
option.description && /* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ jsx40("div", { children: option.label }),
|
|
2394
|
+
option.description && /* @__PURE__ */ jsx40("div", { className: "text-text-dim text-[11px]", children: option.description })
|
|
2319
2395
|
]
|
|
2320
2396
|
},
|
|
2321
2397
|
option.value
|
|
@@ -2323,19 +2399,19 @@ var Combobox = forwardRef38(function Combobox2({
|
|
|
2323
2399
|
})
|
|
2324
2400
|
}
|
|
2325
2401
|
),
|
|
2326
|
-
name && /* @__PURE__ */
|
|
2402
|
+
name && /* @__PURE__ */ jsx40("input", { type: "hidden", name, value: value ?? "", readOnly: true })
|
|
2327
2403
|
] });
|
|
2328
2404
|
});
|
|
2329
2405
|
Combobox.displayName = "Combobox";
|
|
2330
2406
|
|
|
2331
2407
|
// src/patterns/CommandPalette/CommandPalette.tsx
|
|
2332
2408
|
import * as RadixDialog4 from "@radix-ui/react-dialog";
|
|
2333
|
-
import { forwardRef as
|
|
2334
|
-
import { Fragment, jsx as
|
|
2409
|
+
import { forwardRef as forwardRef40, useEffect as useEffect6, useId as useId7, useMemo as useMemo3 } from "react";
|
|
2410
|
+
import { Fragment, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2335
2411
|
function flatItems(groups) {
|
|
2336
2412
|
return groups.flatMap((g) => g.items);
|
|
2337
2413
|
}
|
|
2338
|
-
var CommandPalette =
|
|
2414
|
+
var CommandPalette = forwardRef40(
|
|
2339
2415
|
function CommandPalette2({
|
|
2340
2416
|
open,
|
|
2341
2417
|
onOpenChange,
|
|
@@ -2364,8 +2440,8 @@ var CommandPalette = forwardRef39(
|
|
|
2364
2440
|
useEffect6(() => {
|
|
2365
2441
|
setCursor(0);
|
|
2366
2442
|
}, [query, groups, setCursor]);
|
|
2367
|
-
return /* @__PURE__ */
|
|
2368
|
-
/* @__PURE__ */
|
|
2443
|
+
return /* @__PURE__ */ jsx41(RadixDialog4.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs34(RadixDialog4.Portal, { children: [
|
|
2444
|
+
/* @__PURE__ */ jsx41(
|
|
2369
2445
|
RadixDialog4.Overlay,
|
|
2370
2446
|
{
|
|
2371
2447
|
className: cn(
|
|
@@ -2374,7 +2450,7 @@ var CommandPalette = forwardRef39(
|
|
|
2374
2450
|
)
|
|
2375
2451
|
}
|
|
2376
2452
|
),
|
|
2377
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsxs34(
|
|
2378
2454
|
RadixDialog4.Content,
|
|
2379
2455
|
{
|
|
2380
2456
|
ref,
|
|
@@ -2388,10 +2464,10 @@ var CommandPalette = forwardRef39(
|
|
|
2388
2464
|
),
|
|
2389
2465
|
onKeyDown,
|
|
2390
2466
|
children: [
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsx41(RadixDialog4.Title, { className: "sr-only", children: "Command palette" }),
|
|
2468
|
+
/* @__PURE__ */ jsxs34("div", { className: "border-border flex items-center gap-[10px] border-b px-4 py-[14px]", children: [
|
|
2469
|
+
/* @__PURE__ */ jsx41("span", { "aria-hidden": true, className: "text-text-dim", children: "\u2315" }),
|
|
2470
|
+
/* @__PURE__ */ jsx41(
|
|
2395
2471
|
"input",
|
|
2396
2472
|
{
|
|
2397
2473
|
autoFocus: true,
|
|
@@ -2408,9 +2484,9 @@ var CommandPalette = forwardRef39(
|
|
|
2408
2484
|
className: "text-text placeholder:text-text-dim flex-1 border-0 bg-transparent text-[14px] outline-none"
|
|
2409
2485
|
}
|
|
2410
2486
|
),
|
|
2411
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx41("span", { className: "border-border text-text-dim rounded-xs border px-[6px] py-[2px] font-mono text-[10px]", children: "ESC" })
|
|
2412
2488
|
] }),
|
|
2413
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsx41("div", { id: listboxId, className: "min-h-[220px] p-2", role: "listbox", "aria-label": "Results", children: flat.length === 0 ? emptyState ?? /* @__PURE__ */ jsx41("div", { className: "text-text-dim px-3 py-5 text-center text-[12px]", children: "No matches" }) : /* @__PURE__ */ jsx41(
|
|
2414
2490
|
CommandGroups,
|
|
2415
2491
|
{
|
|
2416
2492
|
groups,
|
|
@@ -2420,7 +2496,7 @@ var CommandPalette = forwardRef39(
|
|
|
2420
2496
|
optionId
|
|
2421
2497
|
}
|
|
2422
2498
|
) }),
|
|
2423
|
-
footer && /* @__PURE__ */
|
|
2499
|
+
footer && /* @__PURE__ */ jsx41("div", { className: "border-border text-text-dim flex gap-4 border-t px-[14px] py-[10px] font-mono text-[10px]", children: footer })
|
|
2424
2500
|
]
|
|
2425
2501
|
}
|
|
2426
2502
|
)
|
|
@@ -2430,10 +2506,10 @@ var CommandPalette = forwardRef39(
|
|
|
2430
2506
|
CommandPalette.displayName = "CommandPalette";
|
|
2431
2507
|
function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
2432
2508
|
let runningIndex = 0;
|
|
2433
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx41(Fragment, { children: groups.map((group, gIdx) => {
|
|
2434
2510
|
if (group.items.length === 0) return null;
|
|
2435
|
-
return /* @__PURE__ */
|
|
2436
|
-
group.label && /* @__PURE__ */
|
|
2511
|
+
return /* @__PURE__ */ jsxs34("div", { children: [
|
|
2512
|
+
group.label && /* @__PURE__ */ jsxs34("div", { className: "text-text-dim px-2 pt-2 pb-1 font-mono text-[9px] tracking-[1.4px] uppercase", children: [
|
|
2437
2513
|
group.label,
|
|
2438
2514
|
" \xB7 ",
|
|
2439
2515
|
group.items.length
|
|
@@ -2441,7 +2517,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2441
2517
|
group.items.map((item) => {
|
|
2442
2518
|
const myIndex = runningIndex++;
|
|
2443
2519
|
const isActive = cursor === myIndex;
|
|
2444
|
-
return /* @__PURE__ */
|
|
2520
|
+
return /* @__PURE__ */ jsxs34(
|
|
2445
2521
|
"button",
|
|
2446
2522
|
{
|
|
2447
2523
|
id: optionId(myIndex),
|
|
@@ -2455,7 +2531,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2455
2531
|
isActive ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
2456
2532
|
),
|
|
2457
2533
|
children: [
|
|
2458
|
-
item.glyph != null && /* @__PURE__ */
|
|
2534
|
+
item.glyph != null && /* @__PURE__ */ jsx41(
|
|
2459
2535
|
"span",
|
|
2460
2536
|
{
|
|
2461
2537
|
"aria-hidden": true,
|
|
@@ -2466,11 +2542,11 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2466
2542
|
children: item.glyph
|
|
2467
2543
|
}
|
|
2468
2544
|
),
|
|
2469
|
-
/* @__PURE__ */
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
item.description && /* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ jsxs34("span", { className: "min-w-0 flex-1", children: [
|
|
2546
|
+
/* @__PURE__ */ jsx41("span", { className: "block truncate text-[13px]", children: item.label }),
|
|
2547
|
+
item.description && /* @__PURE__ */ jsx41("span", { className: "text-text-dim block truncate text-[11px]", children: item.description })
|
|
2472
2548
|
] }),
|
|
2473
|
-
item.trailing && /* @__PURE__ */
|
|
2549
|
+
item.trailing && /* @__PURE__ */ jsx41("span", { className: "text-text-dim font-mono text-[10px]", children: item.trailing })
|
|
2474
2550
|
]
|
|
2475
2551
|
},
|
|
2476
2552
|
item.id
|
|
@@ -2493,7 +2569,7 @@ function filterCommandItems(query, groups) {
|
|
|
2493
2569
|
|
|
2494
2570
|
// src/patterns/DataTable/DataTable.tsx
|
|
2495
2571
|
import { useEffect as useEffect7, useMemo as useMemo4, useRef as useRef5 } from "react";
|
|
2496
|
-
import { jsx as
|
|
2572
|
+
import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2497
2573
|
var alignClass = {
|
|
2498
2574
|
left: "text-left",
|
|
2499
2575
|
right: "text-right",
|
|
@@ -2581,10 +2657,10 @@ function DataTable(props) {
|
|
|
2581
2657
|
return next;
|
|
2582
2658
|
});
|
|
2583
2659
|
};
|
|
2584
|
-
return /* @__PURE__ */
|
|
2585
|
-
caption && /* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
selectable && /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ jsxs35("table", { ref, className: cn("w-full border-collapse text-[12px]", className), children: [
|
|
2661
|
+
caption && /* @__PURE__ */ jsx42("caption", { className: "sr-only", children: caption }),
|
|
2662
|
+
/* @__PURE__ */ jsx42("thead", { className: cn("bg-panel-2", stickyHeader && "z-raised sticky top-0"), children: /* @__PURE__ */ jsxs35("tr", { children: [
|
|
2663
|
+
selectable && /* @__PURE__ */ jsx42("th", { scope: "col", className: "border-border w-8 border-b px-3 py-2 text-left", children: /* @__PURE__ */ jsx42(
|
|
2588
2664
|
"input",
|
|
2589
2665
|
{
|
|
2590
2666
|
ref: headerCheckRef,
|
|
@@ -2600,8 +2676,8 @@ function DataTable(props) {
|
|
|
2600
2676
|
const isSorted = sort?.key === col.key;
|
|
2601
2677
|
const ariaSort = !sortable ? void 0 : isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : "none";
|
|
2602
2678
|
const align = col.align ?? "left";
|
|
2603
|
-
const indicator = sortable && isSorted && /* @__PURE__ */
|
|
2604
|
-
return /* @__PURE__ */
|
|
2679
|
+
const indicator = sortable && isSorted && /* @__PURE__ */ jsx42("span", { "aria-hidden": true, className: "ml-1", children: sort?.direction === "asc" ? "\u2191" : "\u2193" });
|
|
2680
|
+
return /* @__PURE__ */ jsx42(
|
|
2605
2681
|
"th",
|
|
2606
2682
|
{
|
|
2607
2683
|
scope: "col",
|
|
@@ -2613,7 +2689,7 @@ function DataTable(props) {
|
|
|
2613
2689
|
sortable && "cursor-pointer",
|
|
2614
2690
|
isSorted ? "text-accent" : "text-text-dim"
|
|
2615
2691
|
),
|
|
2616
|
-
children: sortable ? /* @__PURE__ */
|
|
2692
|
+
children: sortable ? /* @__PURE__ */ jsxs35(
|
|
2617
2693
|
"button",
|
|
2618
2694
|
{
|
|
2619
2695
|
type: "button",
|
|
@@ -2630,8 +2706,8 @@ function DataTable(props) {
|
|
|
2630
2706
|
);
|
|
2631
2707
|
})
|
|
2632
2708
|
] }) }),
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
sortedData.length === 0 && /* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ jsxs35("tbody", { children: [
|
|
2710
|
+
sortedData.length === 0 && /* @__PURE__ */ jsx42("tr", { children: /* @__PURE__ */ jsx42(
|
|
2635
2711
|
"td",
|
|
2636
2712
|
{
|
|
2637
2713
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
@@ -2642,7 +2718,7 @@ function DataTable(props) {
|
|
|
2642
2718
|
sortedData.map((row) => {
|
|
2643
2719
|
const id = rowKey(row);
|
|
2644
2720
|
const isSelected = selectedSet.has(id);
|
|
2645
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsxs35(
|
|
2646
2722
|
"tr",
|
|
2647
2723
|
{
|
|
2648
2724
|
"data-state": isSelected ? "selected" : void 0,
|
|
@@ -2651,7 +2727,7 @@ function DataTable(props) {
|
|
|
2651
2727
|
isSelected ? "bg-accent-dim/50" : "hover:bg-panel-2"
|
|
2652
2728
|
),
|
|
2653
2729
|
children: [
|
|
2654
|
-
selectable && /* @__PURE__ */
|
|
2730
|
+
selectable && /* @__PURE__ */ jsx42("td", { className: "px-3 py-[10px]", children: /* @__PURE__ */ jsx42(
|
|
2655
2731
|
"input",
|
|
2656
2732
|
{
|
|
2657
2733
|
type: "checkbox",
|
|
@@ -2661,7 +2737,7 @@ function DataTable(props) {
|
|
|
2661
2737
|
className: "cursor-pointer accent-[var(--color-accent)]"
|
|
2662
2738
|
}
|
|
2663
2739
|
) }),
|
|
2664
|
-
columns.map((col) => /* @__PURE__ */
|
|
2740
|
+
columns.map((col) => /* @__PURE__ */ jsx42("td", { className: cn("px-3 py-[10px]", alignClass[col.align ?? "left"]), children: col.cell ? col.cell(row) : col.accessor ? String(col.accessor(row)) : null }, col.key))
|
|
2665
2741
|
]
|
|
2666
2742
|
},
|
|
2667
2743
|
id
|
|
@@ -2673,13 +2749,13 @@ function DataTable(props) {
|
|
|
2673
2749
|
|
|
2674
2750
|
// src/patterns/DatePicker/Calendar.tsx
|
|
2675
2751
|
import {
|
|
2676
|
-
forwardRef as
|
|
2677
|
-
useCallback as
|
|
2752
|
+
forwardRef as forwardRef41,
|
|
2753
|
+
useCallback as useCallback7,
|
|
2678
2754
|
useEffect as useEffect8,
|
|
2679
2755
|
useRef as useRef6,
|
|
2680
|
-
useState as
|
|
2756
|
+
useState as useState9
|
|
2681
2757
|
} from "react";
|
|
2682
|
-
import { jsx as
|
|
2758
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2683
2759
|
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2684
2760
|
var DAYS = ["S", "M", "T", "W", "T", "F", "S"];
|
|
2685
2761
|
function isSameDay(a, b) {
|
|
@@ -2690,7 +2766,7 @@ function clampDay(year, month, day) {
|
|
|
2690
2766
|
const max = new Date(year, month + 1, 0).getDate();
|
|
2691
2767
|
return Math.min(Math.max(1, day), max);
|
|
2692
2768
|
}
|
|
2693
|
-
var Calendar =
|
|
2769
|
+
var Calendar = forwardRef41(function Calendar2({
|
|
2694
2770
|
value,
|
|
2695
2771
|
defaultValue,
|
|
2696
2772
|
onValueChange,
|
|
@@ -2703,8 +2779,8 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2703
2779
|
className,
|
|
2704
2780
|
...props
|
|
2705
2781
|
}, ref) {
|
|
2706
|
-
const [today] =
|
|
2707
|
-
const [hydrated, setHydrated] =
|
|
2782
|
+
const [today] = useState9(() => /* @__PURE__ */ new Date());
|
|
2783
|
+
const [hydrated, setHydrated] = useState9(false);
|
|
2708
2784
|
useEffect8(() => setHydrated(true), []);
|
|
2709
2785
|
const [selectedDate, setSelectedDate] = useControllableState({
|
|
2710
2786
|
value,
|
|
@@ -2713,12 +2789,12 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2713
2789
|
});
|
|
2714
2790
|
const initialMonth = defaultMonth ?? defaultValue?.getMonth() ?? today.getMonth();
|
|
2715
2791
|
const initialYear = defaultYear ?? defaultValue?.getFullYear() ?? today.getFullYear();
|
|
2716
|
-
const [internalMonth, setInternalMonth] =
|
|
2717
|
-
const [internalYear, setInternalYear] =
|
|
2792
|
+
const [internalMonth, setInternalMonth] = useState9(initialMonth);
|
|
2793
|
+
const [internalYear, setInternalYear] = useState9(initialYear);
|
|
2718
2794
|
const month = monthProp ?? internalMonth;
|
|
2719
2795
|
const year = yearProp ?? internalYear;
|
|
2720
2796
|
const isControlled = monthProp !== void 0 && yearProp !== void 0;
|
|
2721
|
-
const setVisible =
|
|
2797
|
+
const setVisible = useCallback7(
|
|
2722
2798
|
(m, y) => {
|
|
2723
2799
|
if (!isControlled) {
|
|
2724
2800
|
setInternalMonth(m);
|
|
@@ -2728,19 +2804,19 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2728
2804
|
},
|
|
2729
2805
|
[isControlled, onVisibleMonthChange]
|
|
2730
2806
|
);
|
|
2731
|
-
const goPrev =
|
|
2807
|
+
const goPrev = useCallback7(() => {
|
|
2732
2808
|
const m = month === 0 ? 11 : month - 1;
|
|
2733
2809
|
const y = month === 0 ? year - 1 : year;
|
|
2734
2810
|
setVisible(m, y);
|
|
2735
2811
|
}, [month, year, setVisible]);
|
|
2736
|
-
const goNext =
|
|
2812
|
+
const goNext = useCallback7(() => {
|
|
2737
2813
|
const m = month === 11 ? 0 : month + 1;
|
|
2738
2814
|
const y = month === 11 ? year + 1 : year;
|
|
2739
2815
|
setVisible(m, y);
|
|
2740
2816
|
}, [month, year, setVisible]);
|
|
2741
2817
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
2742
2818
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
2743
|
-
const [focusedDate, setFocusedDate] =
|
|
2819
|
+
const [focusedDate, setFocusedDate] = useState9(() => {
|
|
2744
2820
|
if (selectedDate) return selectedDate;
|
|
2745
2821
|
return new Date(initialYear, initialMonth, 1);
|
|
2746
2822
|
});
|
|
@@ -2757,7 +2833,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2757
2833
|
const node = dayRefs.current.get(effectiveFocusDay);
|
|
2758
2834
|
node?.focus();
|
|
2759
2835
|
}, [effectiveFocusDay, month, year]);
|
|
2760
|
-
const moveFocus =
|
|
2836
|
+
const moveFocus = useCallback7(
|
|
2761
2837
|
(next) => {
|
|
2762
2838
|
setFocusedDate(next);
|
|
2763
2839
|
shouldFocusRef.current = true;
|
|
@@ -2769,7 +2845,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2769
2845
|
},
|
|
2770
2846
|
[month, year, setVisible]
|
|
2771
2847
|
);
|
|
2772
|
-
const onCellKeyDown =
|
|
2848
|
+
const onCellKeyDown = useCallback7(
|
|
2773
2849
|
(e, day) => {
|
|
2774
2850
|
const current = new Date(year, month, day);
|
|
2775
2851
|
let next = null;
|
|
@@ -2821,7 +2897,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2821
2897
|
},
|
|
2822
2898
|
[month, year, moveFocus]
|
|
2823
2899
|
);
|
|
2824
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ jsxs36(
|
|
2825
2901
|
"div",
|
|
2826
2902
|
{
|
|
2827
2903
|
ref,
|
|
@@ -2833,14 +2909,14 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2833
2909
|
),
|
|
2834
2910
|
...props,
|
|
2835
2911
|
children: [
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2912
|
+
/* @__PURE__ */ jsxs36("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
2913
|
+
/* @__PURE__ */ jsxs36("span", { className: "text-[13px] font-medium", "aria-live": "polite", children: [
|
|
2838
2914
|
MONTHS[month],
|
|
2839
2915
|
" ",
|
|
2840
2916
|
year
|
|
2841
2917
|
] }),
|
|
2842
|
-
/* @__PURE__ */
|
|
2843
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex gap-1", children: [
|
|
2919
|
+
/* @__PURE__ */ jsx43(
|
|
2844
2920
|
IconButton,
|
|
2845
2921
|
{
|
|
2846
2922
|
size: "sm",
|
|
@@ -2850,11 +2926,11 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2850
2926
|
onClick: goPrev
|
|
2851
2927
|
}
|
|
2852
2928
|
),
|
|
2853
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsx43(IconButton, { size: "sm", variant: "ghost", icon: "\u203A", "aria-label": "Next month", onClick: goNext })
|
|
2854
2930
|
] })
|
|
2855
2931
|
] }),
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2932
|
+
/* @__PURE__ */ jsxs36("div", { role: "grid", "aria-label": `${MONTHS[month]} ${year}`, className: "flex flex-col gap-[2px]", children: [
|
|
2933
|
+
/* @__PURE__ */ jsx43("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: DAYS.map((d, i) => /* @__PURE__ */ jsx43(
|
|
2858
2934
|
"div",
|
|
2859
2935
|
{
|
|
2860
2936
|
role: "columnheader",
|
|
@@ -2874,7 +2950,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2874
2950
|
const cellIndex = r * 7 + c;
|
|
2875
2951
|
const dayNum = cellIndex - firstDayOfMonth + 1;
|
|
2876
2952
|
if (dayNum < 1 || dayNum > daysInMonth) {
|
|
2877
|
-
cells.push(/* @__PURE__ */
|
|
2953
|
+
cells.push(/* @__PURE__ */ jsx43("div", { role: "gridcell", "aria-hidden": true }, `pad-${r}-${c}`));
|
|
2878
2954
|
continue;
|
|
2879
2955
|
}
|
|
2880
2956
|
const date = new Date(year, month, dayNum);
|
|
@@ -2884,7 +2960,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2884
2960
|
const isFocused = dayNum === effectiveFocusDay;
|
|
2885
2961
|
const day = dayNum;
|
|
2886
2962
|
cells.push(
|
|
2887
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx43("div", { role: "gridcell", "aria-selected": isSelected, children: /* @__PURE__ */ jsx43(
|
|
2888
2964
|
"button",
|
|
2889
2965
|
{
|
|
2890
2966
|
ref: (node) => {
|
|
@@ -2915,7 +2991,7 @@ var Calendar = forwardRef40(function Calendar2({
|
|
|
2915
2991
|
);
|
|
2916
2992
|
}
|
|
2917
2993
|
rows.push(
|
|
2918
|
-
/* @__PURE__ */
|
|
2994
|
+
/* @__PURE__ */ jsx43("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: cells }, `row-${r}`)
|
|
2919
2995
|
);
|
|
2920
2996
|
}
|
|
2921
2997
|
return rows;
|
|
@@ -2929,10 +3005,10 @@ Calendar.displayName = "Calendar";
|
|
|
2929
3005
|
|
|
2930
3006
|
// src/patterns/DatePicker/DatePicker.tsx
|
|
2931
3007
|
import * as RadixPopover2 from "@radix-ui/react-popover";
|
|
2932
|
-
import { forwardRef as
|
|
2933
|
-
import { jsx as
|
|
3008
|
+
import { forwardRef as forwardRef42, useState as useState10 } from "react";
|
|
3009
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2934
3010
|
var defaultFormat = (d) => d.toLocaleDateString();
|
|
2935
|
-
var DatePicker =
|
|
3011
|
+
var DatePicker = forwardRef42(function DatePicker2({
|
|
2936
3012
|
value: valueProp,
|
|
2937
3013
|
defaultValue,
|
|
2938
3014
|
onValueChange,
|
|
@@ -2946,14 +3022,14 @@ var DatePicker = forwardRef41(function DatePicker2({
|
|
|
2946
3022
|
id,
|
|
2947
3023
|
name
|
|
2948
3024
|
}, ref) {
|
|
2949
|
-
const [open, setOpen] =
|
|
3025
|
+
const [open, setOpen] = useState10(false);
|
|
2950
3026
|
const [value, setValue] = useControllableState({
|
|
2951
3027
|
value: valueProp,
|
|
2952
3028
|
defaultValue,
|
|
2953
3029
|
onChange: onValueChange
|
|
2954
3030
|
});
|
|
2955
|
-
return /* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
3031
|
+
return /* @__PURE__ */ jsxs37(RadixPopover2.Root, { open, onOpenChange: setOpen, children: [
|
|
3032
|
+
/* @__PURE__ */ jsx44(RadixPopover2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs37(
|
|
2957
3033
|
"button",
|
|
2958
3034
|
{
|
|
2959
3035
|
ref,
|
|
@@ -2970,18 +3046,18 @@ var DatePicker = forwardRef41(function DatePicker2({
|
|
|
2970
3046
|
),
|
|
2971
3047
|
style: { width },
|
|
2972
3048
|
children: [
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsx44("span", { "aria-hidden": true, className: "text-text-dim", children: "\u25A2" }),
|
|
3050
|
+
/* @__PURE__ */ jsx44("span", { className: cn("flex-1 truncate", !value && "text-text-dim"), children: value ? format(value) : emptyLabel ?? placeholder })
|
|
2975
3051
|
]
|
|
2976
3052
|
}
|
|
2977
3053
|
) }),
|
|
2978
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ jsx44(RadixPopover2.Portal, { children: /* @__PURE__ */ jsx44(
|
|
2979
3055
|
RadixPopover2.Content,
|
|
2980
3056
|
{
|
|
2981
3057
|
align: "start",
|
|
2982
3058
|
sideOffset: 6,
|
|
2983
3059
|
className: "z-popover outline-none data-[state=open]:animate-[ship-pop-in_140ms_var(--easing-out)]",
|
|
2984
|
-
children: /* @__PURE__ */
|
|
3060
|
+
children: /* @__PURE__ */ jsx44(
|
|
2985
3061
|
Calendar,
|
|
2986
3062
|
{
|
|
2987
3063
|
value,
|
|
@@ -2996,17 +3072,17 @@ var DatePicker = forwardRef41(function DatePicker2({
|
|
|
2996
3072
|
)
|
|
2997
3073
|
}
|
|
2998
3074
|
) }),
|
|
2999
|
-
name && /* @__PURE__ */
|
|
3075
|
+
name && /* @__PURE__ */ jsx44("input", { type: "hidden", name, value: value ? value.toISOString() : "", readOnly: true })
|
|
3000
3076
|
] });
|
|
3001
3077
|
});
|
|
3002
3078
|
DatePicker.displayName = "DatePicker";
|
|
3003
3079
|
|
|
3004
3080
|
// src/patterns/Dots/Dots.tsx
|
|
3005
|
-
import { forwardRef as
|
|
3006
|
-
import { jsx as
|
|
3007
|
-
var Dots =
|
|
3081
|
+
import { forwardRef as forwardRef43 } from "react";
|
|
3082
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3083
|
+
var Dots = forwardRef43(function Dots2({ total, current, onChange, className, "aria-label": ariaLabel = "Progress", ...props }, ref) {
|
|
3008
3084
|
const interactive = typeof onChange === "function";
|
|
3009
|
-
return /* @__PURE__ */
|
|
3085
|
+
return /* @__PURE__ */ jsx45(
|
|
3010
3086
|
"nav",
|
|
3011
3087
|
{
|
|
3012
3088
|
ref,
|
|
@@ -3020,7 +3096,7 @@ var Dots = forwardRef42(function Dots2({ total, current, onChange, className, "a
|
|
|
3020
3096
|
isActive ? "w-[18px] bg-accent" : "w-[6px] bg-panel-2"
|
|
3021
3097
|
);
|
|
3022
3098
|
if (interactive) {
|
|
3023
|
-
return /* @__PURE__ */
|
|
3099
|
+
return /* @__PURE__ */ jsx45(
|
|
3024
3100
|
"button",
|
|
3025
3101
|
{
|
|
3026
3102
|
type: "button",
|
|
@@ -3037,17 +3113,101 @@ var Dots = forwardRef42(function Dots2({ total, current, onChange, className, "a
|
|
|
3037
3113
|
i
|
|
3038
3114
|
);
|
|
3039
3115
|
}
|
|
3040
|
-
return /* @__PURE__ */
|
|
3116
|
+
return /* @__PURE__ */ jsx45("span", { "aria-hidden": true, className: sharedClass }, i);
|
|
3041
3117
|
})
|
|
3042
3118
|
}
|
|
3043
3119
|
);
|
|
3044
3120
|
});
|
|
3045
3121
|
Dots.displayName = "Dots";
|
|
3046
3122
|
|
|
3123
|
+
// src/patterns/Dropzone/Dropzone.tsx
|
|
3124
|
+
import {
|
|
3125
|
+
forwardRef as forwardRef44,
|
|
3126
|
+
useState as useState11
|
|
3127
|
+
} from "react";
|
|
3128
|
+
import { jsx as jsx46, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3129
|
+
function listToArray(list) {
|
|
3130
|
+
if (!list) return [];
|
|
3131
|
+
return Array.from(list);
|
|
3132
|
+
}
|
|
3133
|
+
var Dropzone = forwardRef44(function Dropzone2({
|
|
3134
|
+
onFiles,
|
|
3135
|
+
accept,
|
|
3136
|
+
multiple = true,
|
|
3137
|
+
title = "Drop files to ingest",
|
|
3138
|
+
description,
|
|
3139
|
+
icon = "\u21A5",
|
|
3140
|
+
disabled,
|
|
3141
|
+
className,
|
|
3142
|
+
...props
|
|
3143
|
+
}, ref) {
|
|
3144
|
+
const [isDragging, setIsDragging] = useState11(false);
|
|
3145
|
+
const onDragOver = (e) => {
|
|
3146
|
+
if (disabled) return;
|
|
3147
|
+
e.preventDefault();
|
|
3148
|
+
setIsDragging(true);
|
|
3149
|
+
};
|
|
3150
|
+
const onDragLeave = () => setIsDragging(false);
|
|
3151
|
+
const onDrop = (e) => {
|
|
3152
|
+
if (disabled) return;
|
|
3153
|
+
e.preventDefault();
|
|
3154
|
+
setIsDragging(false);
|
|
3155
|
+
const files = listToArray(e.dataTransfer.files);
|
|
3156
|
+
if (files.length) onFiles?.(files);
|
|
3157
|
+
};
|
|
3158
|
+
return /* @__PURE__ */ jsxs38(
|
|
3159
|
+
"label",
|
|
3160
|
+
{
|
|
3161
|
+
ref,
|
|
3162
|
+
onDragOver,
|
|
3163
|
+
onDragLeave,
|
|
3164
|
+
onDrop,
|
|
3165
|
+
className: cn(
|
|
3166
|
+
"rounded-base flex max-w-[420px] cursor-pointer flex-col items-center border-[1.5px] border-dashed p-8 text-center",
|
|
3167
|
+
"transition-[background,border] duration-(--duration-micro)",
|
|
3168
|
+
"focus-within:ring-accent-dim focus-within:ring-[3px]",
|
|
3169
|
+
isDragging ? "border-accent bg-accent-dim" : "border-border-strong bg-panel hover:bg-panel-2",
|
|
3170
|
+
disabled && "pointer-events-none cursor-not-allowed opacity-50",
|
|
3171
|
+
className
|
|
3172
|
+
),
|
|
3173
|
+
...props,
|
|
3174
|
+
children: [
|
|
3175
|
+
/* @__PURE__ */ jsx46(
|
|
3176
|
+
"input",
|
|
3177
|
+
{
|
|
3178
|
+
type: "file",
|
|
3179
|
+
accept,
|
|
3180
|
+
multiple,
|
|
3181
|
+
disabled,
|
|
3182
|
+
"aria-label": typeof title === "string" ? title : "Upload files",
|
|
3183
|
+
className: "sr-only",
|
|
3184
|
+
onChange: (e) => {
|
|
3185
|
+
const files = listToArray(e.target.files);
|
|
3186
|
+
if (files.length) onFiles?.(files);
|
|
3187
|
+
e.target.value = "";
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
),
|
|
3191
|
+
/* @__PURE__ */ jsx46(
|
|
3192
|
+
"div",
|
|
3193
|
+
{
|
|
3194
|
+
"aria-hidden": true,
|
|
3195
|
+
className: cn("mb-2 text-[28px]", isDragging ? "text-accent" : "text-text-dim"),
|
|
3196
|
+
children: icon
|
|
3197
|
+
}
|
|
3198
|
+
),
|
|
3199
|
+
/* @__PURE__ */ jsx46("div", { className: "mb-1 text-[13px] font-medium", children: title }),
|
|
3200
|
+
description && /* @__PURE__ */ jsx46("div", { className: "text-text-dim text-[11px]", children: description })
|
|
3201
|
+
]
|
|
3202
|
+
}
|
|
3203
|
+
);
|
|
3204
|
+
});
|
|
3205
|
+
Dropzone.displayName = "Dropzone";
|
|
3206
|
+
|
|
3047
3207
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
3048
3208
|
import { cva as cva10 } from "class-variance-authority";
|
|
3049
|
-
import { forwardRef as
|
|
3050
|
-
import { jsx as
|
|
3209
|
+
import { forwardRef as forwardRef45 } from "react";
|
|
3210
|
+
import { jsx as jsx47, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3051
3211
|
var plateStyles = cva10("grid h-12 w-12 place-items-center rounded-base text-[22px]", {
|
|
3052
3212
|
variants: {
|
|
3053
3213
|
tone: {
|
|
@@ -3060,8 +3220,8 @@ var plateStyles = cva10("grid h-12 w-12 place-items-center rounded-base text-[22
|
|
|
3060
3220
|
},
|
|
3061
3221
|
defaultVariants: { tone: "neutral" }
|
|
3062
3222
|
});
|
|
3063
|
-
var EmptyState =
|
|
3064
|
-
return /* @__PURE__ */
|
|
3223
|
+
var EmptyState = forwardRef45(function EmptyState2({ icon, title, description, action, chips, tone, className, ...props }, ref) {
|
|
3224
|
+
return /* @__PURE__ */ jsxs39(
|
|
3065
3225
|
"div",
|
|
3066
3226
|
{
|
|
3067
3227
|
ref,
|
|
@@ -3071,10 +3231,10 @@ var EmptyState = forwardRef43(function EmptyState2({ icon, title, description, a
|
|
|
3071
3231
|
),
|
|
3072
3232
|
...props,
|
|
3073
3233
|
children: [
|
|
3074
|
-
icon != null && /* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
description && /* @__PURE__ */
|
|
3077
|
-
chips && chips.length > 0 && /* @__PURE__ */
|
|
3234
|
+
icon != null && /* @__PURE__ */ jsx47("span", { "aria-hidden": true, className: plateStyles({ tone: tone ?? "neutral" }), children: icon }),
|
|
3235
|
+
/* @__PURE__ */ jsx47("div", { className: "text-[14px] font-medium", children: title }),
|
|
3236
|
+
description && /* @__PURE__ */ jsx47("div", { className: "text-text-muted max-w-[260px] text-[12px] leading-[1.5]", children: description }),
|
|
3237
|
+
chips && chips.length > 0 && /* @__PURE__ */ jsx47("div", { className: "flex w-full flex-col gap-1", children: chips.map((c, i) => /* @__PURE__ */ jsx47(
|
|
3078
3238
|
"button",
|
|
3079
3239
|
{
|
|
3080
3240
|
type: "button",
|
|
@@ -3096,18 +3256,18 @@ var EmptyState = forwardRef43(function EmptyState2({ icon, title, description, a
|
|
|
3096
3256
|
EmptyState.displayName = "EmptyState";
|
|
3097
3257
|
|
|
3098
3258
|
// src/patterns/FileChip/FileChip.tsx
|
|
3099
|
-
import { forwardRef as
|
|
3100
|
-
import { jsx as
|
|
3259
|
+
import { forwardRef as forwardRef46 } from "react";
|
|
3260
|
+
import { jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3101
3261
|
function deriveExt(name) {
|
|
3102
3262
|
const dot = name.lastIndexOf(".");
|
|
3103
3263
|
if (dot < 0) return "FILE";
|
|
3104
3264
|
return name.slice(dot + 1).slice(0, 4).toUpperCase();
|
|
3105
3265
|
}
|
|
3106
|
-
var FileChip =
|
|
3266
|
+
var FileChip = forwardRef46(function FileChip2({ name, size, progress, icon, onRemove, failed, className, ...props }, ref) {
|
|
3107
3267
|
const ext = deriveExt(name);
|
|
3108
3268
|
const showProgress = typeof progress === "number";
|
|
3109
3269
|
const isComplete = showProgress && progress >= 100;
|
|
3110
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ jsxs40(
|
|
3111
3271
|
"div",
|
|
3112
3272
|
{
|
|
3113
3273
|
ref,
|
|
@@ -3117,7 +3277,7 @@ var FileChip = forwardRef44(function FileChip2({ name, size, progress, icon, onR
|
|
|
3117
3277
|
),
|
|
3118
3278
|
...props,
|
|
3119
3279
|
children: [
|
|
3120
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ jsx48(
|
|
3121
3281
|
"span",
|
|
3122
3282
|
{
|
|
3123
3283
|
"aria-hidden": true,
|
|
@@ -3125,17 +3285,17 @@ var FileChip = forwardRef44(function FileChip2({ name, size, progress, icon, onR
|
|
|
3125
3285
|
children: icon ?? ext
|
|
3126
3286
|
}
|
|
3127
3287
|
),
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsxs40("div", { className: "min-w-0 flex-1", children: [
|
|
3289
|
+
/* @__PURE__ */ jsx48("div", { className: "truncate text-[12px] font-medium", children: name }),
|
|
3290
|
+
/* @__PURE__ */ jsxs40("div", { className: cn("font-mono text-[10px]", failed ? "text-err" : "text-text-dim"), children: [
|
|
3131
3291
|
size,
|
|
3132
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
3292
|
+
showProgress && !isComplete && /* @__PURE__ */ jsxs40("span", { children: [
|
|
3133
3293
|
" \xB7 ",
|
|
3134
3294
|
Math.round(progress),
|
|
3135
3295
|
"%"
|
|
3136
3296
|
] })
|
|
3137
3297
|
] }),
|
|
3138
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
3298
|
+
showProgress && !isComplete && /* @__PURE__ */ jsx48("div", { className: "bg-panel mt-1 h-[2px] overflow-hidden rounded-full", children: /* @__PURE__ */ jsx48(
|
|
3139
3299
|
"div",
|
|
3140
3300
|
{
|
|
3141
3301
|
className: cn(
|
|
@@ -3146,7 +3306,7 @@ var FileChip = forwardRef44(function FileChip2({ name, size, progress, icon, onR
|
|
|
3146
3306
|
}
|
|
3147
3307
|
) })
|
|
3148
3308
|
] }),
|
|
3149
|
-
onRemove && /* @__PURE__ */
|
|
3309
|
+
onRemove && /* @__PURE__ */ jsx48(
|
|
3150
3310
|
"button",
|
|
3151
3311
|
{
|
|
3152
3312
|
type: "button",
|
|
@@ -3165,100 +3325,989 @@ var FileChip = forwardRef44(function FileChip2({ name, size, progress, icon, onR
|
|
|
3165
3325
|
});
|
|
3166
3326
|
FileChip.displayName = "FileChip";
|
|
3167
3327
|
|
|
3168
|
-
// src/patterns/
|
|
3169
|
-
import
|
|
3170
|
-
import {
|
|
3171
|
-
|
|
3172
|
-
var
|
|
3173
|
-
|
|
3174
|
-
|
|
3328
|
+
// src/patterns/FilterPanel/FilterPanel.tsx
|
|
3329
|
+
import { forwardRef as forwardRef47, useCallback as useCallback8, useState as useState12 } from "react";
|
|
3330
|
+
import { jsx as jsx49, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3331
|
+
var EMPTY = Object.freeze({});
|
|
3332
|
+
var FilterPanel = forwardRef47(function FilterPanel2({
|
|
3333
|
+
facets,
|
|
3334
|
+
value,
|
|
3335
|
+
defaultValue,
|
|
3336
|
+
onValueChange,
|
|
3337
|
+
onReset,
|
|
3338
|
+
counts,
|
|
3339
|
+
title = "Filter",
|
|
3340
|
+
resetLabel = "Reset",
|
|
3341
|
+
className,
|
|
3342
|
+
...props
|
|
3343
|
+
}, ref) {
|
|
3344
|
+
const [selection, setSelection] = useControllableState({
|
|
3345
|
+
value,
|
|
3346
|
+
defaultValue: defaultValue ?? EMPTY,
|
|
3347
|
+
onChange: onValueChange
|
|
3348
|
+
});
|
|
3349
|
+
const total = facets.reduce((sum, facet) => sum + (selection[facet.id]?.length ?? 0), 0);
|
|
3350
|
+
const toggle = useCallback8(
|
|
3351
|
+
(facetId, optionValue, next) => {
|
|
3352
|
+
setSelection((prev) => {
|
|
3353
|
+
const current = prev?.[facetId] ?? [];
|
|
3354
|
+
const filtered = current.filter((v) => v !== optionValue);
|
|
3355
|
+
const updated = next ? [...filtered, optionValue] : filtered;
|
|
3356
|
+
return { ...prev ?? {}, [facetId]: updated };
|
|
3357
|
+
});
|
|
3358
|
+
},
|
|
3359
|
+
[setSelection]
|
|
3360
|
+
);
|
|
3361
|
+
const handleReset = useCallback8(() => {
|
|
3362
|
+
setSelection(EMPTY);
|
|
3363
|
+
onReset?.();
|
|
3364
|
+
}, [setSelection, onReset]);
|
|
3365
|
+
return /* @__PURE__ */ jsxs41(
|
|
3366
|
+
"div",
|
|
3175
3367
|
{
|
|
3176
3368
|
ref,
|
|
3369
|
+
role: "group",
|
|
3370
|
+
"aria-label": typeof title === "string" ? title : void 0,
|
|
3177
3371
|
className: cn(
|
|
3178
|
-
"border-border bg-panel flex
|
|
3372
|
+
"rounded-base border-border bg-panel flex w-[260px] flex-col gap-3 border p-4",
|
|
3179
3373
|
className
|
|
3180
3374
|
),
|
|
3181
|
-
...props
|
|
3375
|
+
...props,
|
|
3376
|
+
children: [
|
|
3377
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
3378
|
+
/* @__PURE__ */ jsx49("span", { className: "text-text-dim font-mono text-[10px] tracking-[1.4px] uppercase", children: title }),
|
|
3379
|
+
total > 0 && /* @__PURE__ */ jsx49(Badge, { size: "sm", variant: "accent", children: total }),
|
|
3380
|
+
/* @__PURE__ */ jsx49(
|
|
3381
|
+
Button,
|
|
3382
|
+
{
|
|
3383
|
+
type: "button",
|
|
3384
|
+
variant: "ghost",
|
|
3385
|
+
size: "sm",
|
|
3386
|
+
onClick: handleReset,
|
|
3387
|
+
disabled: total === 0,
|
|
3388
|
+
className: "ml-auto",
|
|
3389
|
+
children: resetLabel
|
|
3390
|
+
}
|
|
3391
|
+
)
|
|
3392
|
+
] }),
|
|
3393
|
+
facets.map((facet) => /* @__PURE__ */ jsx49(
|
|
3394
|
+
FilterFacetGroup,
|
|
3395
|
+
{
|
|
3396
|
+
facet,
|
|
3397
|
+
selected: selection[facet.id] ?? [],
|
|
3398
|
+
counts: counts?.[facet.id],
|
|
3399
|
+
onToggle: toggle
|
|
3400
|
+
},
|
|
3401
|
+
facet.id
|
|
3402
|
+
))
|
|
3403
|
+
]
|
|
3182
3404
|
}
|
|
3183
3405
|
);
|
|
3184
3406
|
});
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3407
|
+
FilterPanel.displayName = "FilterPanel";
|
|
3408
|
+
function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
3409
|
+
const collapsible = facet.collapsible ?? true;
|
|
3410
|
+
const [open, setOpen] = useState12(facet.defaultOpen ?? true);
|
|
3411
|
+
const isOpen = !collapsible || open;
|
|
3412
|
+
const selectedCount = selected.length;
|
|
3413
|
+
const headingClass = "text-text-muted flex items-center gap-[6px] font-mono text-[10px] tracking-[1.4px] uppercase";
|
|
3414
|
+
return /* @__PURE__ */ jsxs41("section", { className: "flex flex-col gap-1", children: [
|
|
3415
|
+
collapsible ? /* @__PURE__ */ jsxs41(
|
|
3416
|
+
"button",
|
|
3191
3417
|
{
|
|
3192
|
-
|
|
3418
|
+
type: "button",
|
|
3419
|
+
"aria-expanded": isOpen,
|
|
3420
|
+
onClick: () => setOpen((v) => !v),
|
|
3193
3421
|
className: cn(
|
|
3194
|
-
|
|
3195
|
-
"
|
|
3196
|
-
"data-[state=open]:bg-panel-2 hover:bg-panel-2",
|
|
3422
|
+
headingClass,
|
|
3423
|
+
"cursor-pointer rounded-xs px-1 py-[2px] outline-none",
|
|
3197
3424
|
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
3198
|
-
|
|
3425
|
+
"hover:text-text"
|
|
3199
3426
|
),
|
|
3200
|
-
|
|
3427
|
+
children: [
|
|
3428
|
+
/* @__PURE__ */ jsx49("span", { className: "flex-1 text-left", children: facet.label }),
|
|
3429
|
+
selectedCount > 0 && /* @__PURE__ */ jsx49(Badge, { size: "sm", variant: "neutral", children: selectedCount }),
|
|
3430
|
+
/* @__PURE__ */ jsx49("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3431
|
+
]
|
|
3201
3432
|
}
|
|
3202
|
-
)
|
|
3203
|
-
|
|
3204
|
-
)
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
className
|
|
3433
|
+
) : /* @__PURE__ */ jsxs41("div", { className: cn(headingClass, "px-1 py-[2px]"), children: [
|
|
3434
|
+
/* @__PURE__ */ jsx49("span", { className: "flex-1", children: facet.label }),
|
|
3435
|
+
selectedCount > 0 && /* @__PURE__ */ jsx49(Badge, { size: "sm", variant: "neutral", children: selectedCount })
|
|
3436
|
+
] }),
|
|
3437
|
+
isOpen && /* @__PURE__ */ jsx49("ul", { className: "m-0 flex list-none flex-col gap-[2px] p-0", children: facet.options.map((option) => {
|
|
3438
|
+
const isSelected = selected.includes(option.value);
|
|
3439
|
+
const count = counts?.[option.value];
|
|
3440
|
+
return /* @__PURE__ */ jsxs41("li", { className: "flex items-center gap-2 px-1 py-[3px]", children: [
|
|
3441
|
+
/* @__PURE__ */ jsx49(
|
|
3442
|
+
Checkbox,
|
|
3443
|
+
{
|
|
3444
|
+
checked: isSelected,
|
|
3445
|
+
onCheckedChange: (next) => onToggle(facet.id, option.value, next === true),
|
|
3446
|
+
label: option.label
|
|
3447
|
+
}
|
|
3218
3448
|
),
|
|
3219
|
-
|
|
3220
|
-
}
|
|
3221
|
-
) })
|
|
3222
|
-
}
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
);
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3449
|
+
typeof count === "number" && /* @__PURE__ */ jsx49("span", { className: "text-text-dim ml-auto font-mono text-[10px] tabular-nums", children: count })
|
|
3450
|
+
] }, option.value);
|
|
3451
|
+
}) })
|
|
3452
|
+
] });
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
// src/patterns/HealthScore/HealthScore.tsx
|
|
3456
|
+
import { forwardRef as forwardRef49 } from "react";
|
|
3457
|
+
|
|
3458
|
+
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
3459
|
+
import { forwardRef as forwardRef48 } from "react";
|
|
3460
|
+
import { jsx as jsx50, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3461
|
+
var toneStrokeClass = {
|
|
3462
|
+
accent: "stroke-accent",
|
|
3463
|
+
ok: "stroke-ok",
|
|
3464
|
+
warn: "stroke-warn",
|
|
3465
|
+
err: "stroke-err"
|
|
3466
|
+
};
|
|
3467
|
+
var RadialProgress = forwardRef48(
|
|
3468
|
+
function RadialProgress2({
|
|
3469
|
+
value,
|
|
3470
|
+
max = 100,
|
|
3471
|
+
size = 64,
|
|
3472
|
+
thickness = 4,
|
|
3473
|
+
tone,
|
|
3474
|
+
children,
|
|
3475
|
+
className,
|
|
3476
|
+
"aria-label": ariaLabel,
|
|
3477
|
+
...props
|
|
3478
|
+
}, ref) {
|
|
3479
|
+
const clamped = Math.min(max, Math.max(0, value));
|
|
3480
|
+
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
3481
|
+
const r = (size - thickness) / 2;
|
|
3482
|
+
const c = 2 * Math.PI * r;
|
|
3483
|
+
const dash = pct / 100 * c;
|
|
3484
|
+
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
3485
|
+
return /* @__PURE__ */ jsxs42(
|
|
3486
|
+
"div",
|
|
3487
|
+
{
|
|
3488
|
+
ref,
|
|
3489
|
+
role: "progressbar",
|
|
3490
|
+
"aria-valuemin": 0,
|
|
3491
|
+
"aria-valuemax": max,
|
|
3492
|
+
"aria-valuenow": Math.round(pct),
|
|
3493
|
+
"aria-label": ariaLabel ?? `${Math.round(pct)}%`,
|
|
3494
|
+
className: cn("relative inline-grid place-items-center", className),
|
|
3495
|
+
style: { width: size, height: size },
|
|
3496
|
+
...props,
|
|
3497
|
+
children: [
|
|
3498
|
+
/* @__PURE__ */ jsxs42("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
3499
|
+
/* @__PURE__ */ jsx50(
|
|
3500
|
+
"circle",
|
|
3501
|
+
{
|
|
3502
|
+
cx: size / 2,
|
|
3503
|
+
cy: size / 2,
|
|
3504
|
+
r,
|
|
3505
|
+
fill: "none",
|
|
3506
|
+
strokeWidth: thickness,
|
|
3507
|
+
className: "stroke-panel-2"
|
|
3508
|
+
}
|
|
3509
|
+
),
|
|
3510
|
+
/* @__PURE__ */ jsx50(
|
|
3511
|
+
"circle",
|
|
3512
|
+
{
|
|
3513
|
+
cx: size / 2,
|
|
3514
|
+
cy: size / 2,
|
|
3515
|
+
r,
|
|
3516
|
+
fill: "none",
|
|
3517
|
+
strokeWidth: thickness,
|
|
3518
|
+
strokeLinecap: "round",
|
|
3519
|
+
strokeDasharray: `${dash} ${c}`,
|
|
3520
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
3521
|
+
className: cn(
|
|
3522
|
+
"transition-[stroke-dasharray] duration-(--duration-step)",
|
|
3523
|
+
toneStrokeClass[resolvedTone]
|
|
3524
|
+
)
|
|
3525
|
+
}
|
|
3526
|
+
)
|
|
3527
|
+
] }),
|
|
3528
|
+
/* @__PURE__ */ jsx50("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
3529
|
+
]
|
|
3530
|
+
}
|
|
3531
|
+
);
|
|
3532
|
+
}
|
|
3533
|
+
);
|
|
3534
|
+
RadialProgress.displayName = "RadialProgress";
|
|
3535
|
+
|
|
3536
|
+
// src/patterns/HealthScore/HealthScore.tsx
|
|
3537
|
+
import { jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3538
|
+
function deltaTone(delta) {
|
|
3539
|
+
if (delta > 0) return "ok";
|
|
3540
|
+
if (delta < 0) return "err";
|
|
3541
|
+
return "accent";
|
|
3542
|
+
}
|
|
3543
|
+
function deltaGlyph(delta) {
|
|
3544
|
+
if (delta > 0) return "\u2191";
|
|
3545
|
+
if (delta < 0) return "\u2193";
|
|
3546
|
+
return "\xB7";
|
|
3547
|
+
}
|
|
3548
|
+
var toneTextClass = {
|
|
3549
|
+
accent: "text-text-muted",
|
|
3550
|
+
ok: "text-ok",
|
|
3551
|
+
warn: "text-warn",
|
|
3552
|
+
err: "text-err"
|
|
3553
|
+
};
|
|
3554
|
+
var HealthScore = forwardRef49(function HealthScore2({
|
|
3555
|
+
value,
|
|
3556
|
+
max = 100,
|
|
3557
|
+
delta,
|
|
3558
|
+
label,
|
|
3559
|
+
breakdown,
|
|
3560
|
+
size = 72,
|
|
3561
|
+
tone,
|
|
3562
|
+
className,
|
|
3563
|
+
"aria-label": ariaLabel,
|
|
3564
|
+
...props
|
|
3565
|
+
}, ref) {
|
|
3566
|
+
const pct = max > 0 ? Math.round(Math.min(max, Math.max(0, value)) / max * 100) : 0;
|
|
3567
|
+
const resolvedTone = tone ?? (pct >= 80 ? "ok" : pct >= 50 ? "accent" : "warn");
|
|
3568
|
+
const indicatorTone = typeof delta === "number" ? deltaTone(delta) : "accent";
|
|
3569
|
+
const core = /* @__PURE__ */ jsxs43(
|
|
3570
|
+
"div",
|
|
3571
|
+
{
|
|
3572
|
+
ref,
|
|
3573
|
+
className: cn("inline-flex flex-col items-center gap-1", className),
|
|
3574
|
+
"aria-label": ariaLabel ?? `${pct}% health`,
|
|
3575
|
+
...props,
|
|
3576
|
+
children: [
|
|
3577
|
+
/* @__PURE__ */ jsx51(RadialProgress, { value, max, size, tone: resolvedTone }),
|
|
3578
|
+
label && /* @__PURE__ */ jsx51("div", { className: "text-text-muted mt-1 text-[12px] leading-tight", children: label }),
|
|
3579
|
+
typeof delta === "number" && /* @__PURE__ */ jsxs43("div", { className: cn("font-mono text-[11px] tabular-nums", toneTextClass[indicatorTone]), children: [
|
|
3580
|
+
/* @__PURE__ */ jsx51("span", { "aria-hidden": true, children: deltaGlyph(delta) }),
|
|
3581
|
+
" ",
|
|
3582
|
+
Math.abs(delta)
|
|
3583
|
+
] })
|
|
3584
|
+
]
|
|
3585
|
+
}
|
|
3586
|
+
);
|
|
3587
|
+
if (!breakdown || breakdown.length === 0) {
|
|
3588
|
+
return core;
|
|
3589
|
+
}
|
|
3590
|
+
return /* @__PURE__ */ jsx51(
|
|
3591
|
+
HoverCard,
|
|
3592
|
+
{
|
|
3593
|
+
trigger: /* @__PURE__ */ jsx51("span", { className: "inline-flex", children: core }),
|
|
3594
|
+
content: /* @__PURE__ */ jsxs43("div", { className: "flex min-w-[180px] flex-col gap-2", children: [
|
|
3595
|
+
/* @__PURE__ */ jsx51("div", { className: "text-text-dim font-mono text-[9px] tracking-[1.4px] uppercase", children: "Breakdown" }),
|
|
3596
|
+
/* @__PURE__ */ jsx51("ul", { className: "m-0 flex list-none flex-col gap-1 p-0 text-[12px]", children: breakdown.map((entry, i) => /* @__PURE__ */ jsxs43("li", { className: "flex items-center gap-2", children: [
|
|
3597
|
+
/* @__PURE__ */ jsx51("span", { className: "text-text-muted flex-1 truncate", children: entry.label }),
|
|
3598
|
+
/* @__PURE__ */ jsx51(
|
|
3599
|
+
"span",
|
|
3600
|
+
{
|
|
3601
|
+
className: cn(
|
|
3602
|
+
"font-mono tabular-nums",
|
|
3603
|
+
entry.tone ? toneTextClass[entry.tone] : "text-text"
|
|
3604
|
+
),
|
|
3605
|
+
children: entry.value
|
|
3606
|
+
}
|
|
3607
|
+
)
|
|
3608
|
+
] }, i)) })
|
|
3609
|
+
] })
|
|
3610
|
+
}
|
|
3611
|
+
);
|
|
3612
|
+
});
|
|
3613
|
+
HealthScore.displayName = "HealthScore";
|
|
3614
|
+
|
|
3615
|
+
// src/patterns/Menubar/Menubar.tsx
|
|
3616
|
+
import * as RadixMenubar from "@radix-ui/react-menubar";
|
|
3617
|
+
import { forwardRef as forwardRef50 } from "react";
|
|
3618
|
+
import { jsx as jsx52, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3619
|
+
var Menubar = forwardRef50(function Menubar2({ className, ...props }, ref) {
|
|
3620
|
+
return /* @__PURE__ */ jsx52(
|
|
3621
|
+
RadixMenubar.Root,
|
|
3622
|
+
{
|
|
3623
|
+
ref,
|
|
3624
|
+
className: cn(
|
|
3625
|
+
"border-border bg-panel flex h-[30px] items-center gap-[2px] border-b px-3",
|
|
3626
|
+
className
|
|
3627
|
+
),
|
|
3628
|
+
...props
|
|
3629
|
+
}
|
|
3630
|
+
);
|
|
3631
|
+
});
|
|
3632
|
+
Menubar.displayName = "Menubar";
|
|
3633
|
+
var MenubarMenu = RadixMenubar.Menu;
|
|
3634
|
+
var MenubarTrigger = forwardRef50(
|
|
3635
|
+
function MenubarTrigger2({ className, ...props }, ref) {
|
|
3636
|
+
return /* @__PURE__ */ jsx52(
|
|
3637
|
+
RadixMenubar.Trigger,
|
|
3638
|
+
{
|
|
3639
|
+
ref,
|
|
3640
|
+
className: cn(
|
|
3641
|
+
"text-text cursor-pointer rounded-xs border-0 bg-transparent px-[10px] py-1 text-[12px] outline-none",
|
|
3642
|
+
"transition-colors duration-(--duration-micro)",
|
|
3643
|
+
"data-[state=open]:bg-panel-2 hover:bg-panel-2",
|
|
3644
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
3645
|
+
className
|
|
3646
|
+
),
|
|
3647
|
+
...props
|
|
3648
|
+
}
|
|
3649
|
+
);
|
|
3650
|
+
}
|
|
3651
|
+
);
|
|
3652
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
3653
|
+
var MenubarContent = forwardRef50(
|
|
3654
|
+
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
3655
|
+
return /* @__PURE__ */ jsx52(RadixMenubar.Portal, { children: /* @__PURE__ */ jsx52(
|
|
3656
|
+
RadixMenubar.Content,
|
|
3657
|
+
{
|
|
3658
|
+
ref,
|
|
3659
|
+
sideOffset,
|
|
3660
|
+
align,
|
|
3661
|
+
className: cn(
|
|
3662
|
+
"border-border-strong bg-panel z-popover min-w-[180px] rounded-md border p-1 shadow-lg outline-none",
|
|
3663
|
+
"data-[state=open]:animate-[ship-pop-in_140ms_var(--easing-out)]",
|
|
3664
|
+
className
|
|
3665
|
+
),
|
|
3666
|
+
...props
|
|
3667
|
+
}
|
|
3668
|
+
) });
|
|
3669
|
+
}
|
|
3670
|
+
);
|
|
3671
|
+
MenubarContent.displayName = "MenubarContent";
|
|
3672
|
+
var itemBase3 = cn(
|
|
3673
|
+
"flex items-center gap-2 rounded-sm px-[10px] py-[6px] text-[12px] cursor-pointer outline-none",
|
|
3674
|
+
"data-[highlighted]:bg-panel-2",
|
|
3675
|
+
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
3676
|
+
);
|
|
3677
|
+
var MenubarItem = forwardRef50(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
3678
|
+
return /* @__PURE__ */ jsxs44(
|
|
3679
|
+
RadixMenubar.Item,
|
|
3680
|
+
{
|
|
3681
|
+
ref,
|
|
3682
|
+
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
3683
|
+
...props,
|
|
3684
|
+
children: [
|
|
3685
|
+
/* @__PURE__ */ jsx52("span", { className: "flex-1", children }),
|
|
3686
|
+
trailing && /* @__PURE__ */ jsx52("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
3687
|
+
]
|
|
3688
|
+
}
|
|
3689
|
+
);
|
|
3690
|
+
});
|
|
3691
|
+
MenubarItem.displayName = "MenubarItem";
|
|
3692
|
+
var MenubarSeparator = forwardRef50(
|
|
3693
|
+
function MenubarSeparator2({ className, ...props }, ref) {
|
|
3694
|
+
return /* @__PURE__ */ jsx52(
|
|
3695
|
+
RadixMenubar.Separator,
|
|
3696
|
+
{
|
|
3697
|
+
ref,
|
|
3698
|
+
className: cn("bg-border my-1 h-px", className),
|
|
3699
|
+
...props
|
|
3700
|
+
}
|
|
3701
|
+
);
|
|
3702
|
+
}
|
|
3703
|
+
);
|
|
3704
|
+
MenubarSeparator.displayName = "MenubarSeparator";
|
|
3705
|
+
|
|
3706
|
+
// src/patterns/NavBar/NavBar.tsx
|
|
3707
|
+
import * as RadixNav from "@radix-ui/react-navigation-menu";
|
|
3708
|
+
import {
|
|
3709
|
+
forwardRef as forwardRef52,
|
|
3710
|
+
useCallback as useCallback10,
|
|
3711
|
+
useEffect as useEffect9,
|
|
3712
|
+
useRef as useRef7,
|
|
3713
|
+
useState as useState14
|
|
3714
|
+
} from "react";
|
|
3715
|
+
|
|
3716
|
+
// src/patterns/Sidebar/Sidebar.tsx
|
|
3717
|
+
import {
|
|
3718
|
+
forwardRef as forwardRef51,
|
|
3719
|
+
useCallback as useCallback9,
|
|
3720
|
+
useState as useState13
|
|
3721
|
+
} from "react";
|
|
3722
|
+
import { Fragment as Fragment2, jsx as jsx53, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3723
|
+
var Sidebar = forwardRef51(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
3724
|
+
return /* @__PURE__ */ jsx53(
|
|
3725
|
+
"aside",
|
|
3726
|
+
{
|
|
3727
|
+
ref,
|
|
3728
|
+
style: { width, ...style },
|
|
3729
|
+
className: cn(
|
|
3730
|
+
"border-border bg-panel flex h-full flex-col gap-2 border-r p-[14px]",
|
|
3731
|
+
className
|
|
3732
|
+
),
|
|
3733
|
+
...props
|
|
3734
|
+
}
|
|
3735
|
+
);
|
|
3736
|
+
});
|
|
3737
|
+
Sidebar.displayName = "Sidebar";
|
|
3738
|
+
var NavItem = forwardRef51(
|
|
3739
|
+
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
3740
|
+
const inner = /* @__PURE__ */ jsxs45(Fragment2, { children: [
|
|
3741
|
+
icon && /* @__PURE__ */ jsx53("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
3742
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-1 truncate", children: label }),
|
|
3743
|
+
badge != null && /* @__PURE__ */ jsx53(
|
|
3744
|
+
"span",
|
|
3745
|
+
{
|
|
3746
|
+
className: cn(
|
|
3747
|
+
"rounded-xs px-[6px] py-px font-mono text-[10px]",
|
|
3748
|
+
active ? "bg-accent text-on-accent" : "bg-panel-2 text-text-muted"
|
|
3749
|
+
),
|
|
3750
|
+
children: badge
|
|
3751
|
+
}
|
|
3752
|
+
)
|
|
3753
|
+
] });
|
|
3754
|
+
const baseClass = cn(
|
|
3755
|
+
"flex cursor-pointer items-center gap-[10px] rounded-xs px-2 py-[6px] text-[13px] outline-none",
|
|
3756
|
+
"transition-colors duration-(--duration-micro)",
|
|
3757
|
+
"focus-visible:ring-[3px] focus-visible:ring-accent-dim",
|
|
3758
|
+
active ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2",
|
|
3759
|
+
disabled && "opacity-50 pointer-events-none",
|
|
3760
|
+
className
|
|
3761
|
+
);
|
|
3762
|
+
if (href) {
|
|
3763
|
+
const anchorProps = props;
|
|
3764
|
+
return /* @__PURE__ */ jsx53(
|
|
3765
|
+
"a",
|
|
3766
|
+
{
|
|
3767
|
+
ref,
|
|
3768
|
+
href,
|
|
3769
|
+
"aria-current": active ? "page" : void 0,
|
|
3770
|
+
"aria-disabled": disabled || void 0,
|
|
3771
|
+
className: baseClass,
|
|
3772
|
+
...anchorProps,
|
|
3773
|
+
children: inner
|
|
3774
|
+
}
|
|
3775
|
+
);
|
|
3776
|
+
}
|
|
3777
|
+
const buttonProps = props;
|
|
3778
|
+
return /* @__PURE__ */ jsx53(
|
|
3779
|
+
"button",
|
|
3780
|
+
{
|
|
3781
|
+
ref,
|
|
3782
|
+
type: "button",
|
|
3783
|
+
"aria-current": active ? "page" : void 0,
|
|
3784
|
+
disabled,
|
|
3785
|
+
className: cn(baseClass, "w-full text-left"),
|
|
3786
|
+
...buttonProps,
|
|
3787
|
+
children: inner
|
|
3788
|
+
}
|
|
3789
|
+
);
|
|
3790
|
+
}
|
|
3791
|
+
);
|
|
3792
|
+
NavItem.displayName = "NavItem";
|
|
3793
|
+
var NavSection = forwardRef51(function NavSection2({
|
|
3794
|
+
label,
|
|
3795
|
+
icon,
|
|
3796
|
+
action,
|
|
3797
|
+
collapsible = false,
|
|
3798
|
+
defaultOpen = true,
|
|
3799
|
+
open,
|
|
3800
|
+
onOpenChange,
|
|
3801
|
+
indent = 0,
|
|
3802
|
+
className,
|
|
3803
|
+
children,
|
|
3804
|
+
...props
|
|
3805
|
+
}, ref) {
|
|
3806
|
+
const isControlled = open !== void 0;
|
|
3807
|
+
const [internalOpen, setInternalOpen] = useState13(defaultOpen);
|
|
3808
|
+
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
3809
|
+
const toggle = useCallback9(() => {
|
|
3810
|
+
const next = !isOpen;
|
|
3811
|
+
if (!isControlled) setInternalOpen(next);
|
|
3812
|
+
onOpenChange?.(next);
|
|
3813
|
+
}, [isOpen, isControlled, onOpenChange]);
|
|
3814
|
+
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
3815
|
+
return /* @__PURE__ */ jsxs45("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
3816
|
+
collapsible ? /* @__PURE__ */ jsxs45(
|
|
3817
|
+
"button",
|
|
3818
|
+
{
|
|
3819
|
+
type: "button",
|
|
3820
|
+
"aria-expanded": isOpen,
|
|
3821
|
+
onClick: toggle,
|
|
3822
|
+
className: cn(
|
|
3823
|
+
eyebrowClass,
|
|
3824
|
+
"cursor-pointer rounded-xs outline-none",
|
|
3825
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
3826
|
+
"hover:text-text-muted"
|
|
3827
|
+
),
|
|
3828
|
+
children: [
|
|
3829
|
+
icon != null && /* @__PURE__ */ jsx53("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
3830
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-1 text-left", children: label }),
|
|
3831
|
+
action,
|
|
3832
|
+
/* @__PURE__ */ jsx53("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3833
|
+
]
|
|
3834
|
+
}
|
|
3835
|
+
) : /* @__PURE__ */ jsxs45("div", { className: eyebrowClass, children: [
|
|
3836
|
+
icon != null && /* @__PURE__ */ jsx53("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
3837
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-1", children: label }),
|
|
3838
|
+
action
|
|
3839
|
+
] }),
|
|
3840
|
+
isOpen && /* @__PURE__ */ jsx53(
|
|
3841
|
+
"div",
|
|
3842
|
+
{
|
|
3843
|
+
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
3844
|
+
style: indent > 0 ? { paddingLeft: indent } : void 0,
|
|
3845
|
+
children
|
|
3846
|
+
}
|
|
3847
|
+
)
|
|
3848
|
+
] });
|
|
3849
|
+
});
|
|
3850
|
+
NavSection.displayName = "NavSection";
|
|
3851
|
+
|
|
3852
|
+
// src/patterns/NavBar/NavBar.tsx
|
|
3853
|
+
import { Fragment as Fragment3, jsx as jsx54, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3854
|
+
function isActiveTree(item, activeId) {
|
|
3855
|
+
if (item.id === activeId) return true;
|
|
3856
|
+
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
3857
|
+
}
|
|
3858
|
+
var NavBar = forwardRef52(function NavBar2({
|
|
3859
|
+
orientation = "horizontal",
|
|
3860
|
+
items,
|
|
3861
|
+
brand,
|
|
3862
|
+
actions,
|
|
3863
|
+
value,
|
|
3864
|
+
defaultValue,
|
|
3865
|
+
onValueChange,
|
|
3866
|
+
width = 240,
|
|
3867
|
+
responsive = true,
|
|
3868
|
+
className,
|
|
3869
|
+
...props
|
|
3870
|
+
}, ref) {
|
|
3871
|
+
const isControlled = value !== void 0;
|
|
3872
|
+
const [internalValue, setInternalValue] = useState14(defaultValue);
|
|
3873
|
+
const activeId = isControlled ? value : internalValue;
|
|
3874
|
+
const [drawerOpen, setDrawerOpen] = useState14(false);
|
|
3875
|
+
const select = useCallback10(
|
|
3876
|
+
(id) => {
|
|
3877
|
+
if (!isControlled) setInternalValue(id);
|
|
3878
|
+
onValueChange?.(id);
|
|
3879
|
+
},
|
|
3880
|
+
[isControlled, onValueChange]
|
|
3881
|
+
);
|
|
3882
|
+
const handleItemActivate = useCallback10(
|
|
3883
|
+
(id) => {
|
|
3884
|
+
select(id);
|
|
3885
|
+
setDrawerOpen(false);
|
|
3886
|
+
},
|
|
3887
|
+
[select]
|
|
3888
|
+
);
|
|
3889
|
+
const drawerBody = (
|
|
3890
|
+
// Distinct aria-label from the desktop <aside>'s <nav> below — when the
|
|
3891
|
+
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
3892
|
+
// sit in the DOM together. Identical accessible names would trip axe's
|
|
3893
|
+
// `landmark-unique` rule.
|
|
3894
|
+
/* @__PURE__ */ jsx54("nav", { "aria-label": "Mobile navigation", className: "flex flex-col gap-1", children: items.map((item) => /* @__PURE__ */ jsx54(
|
|
3895
|
+
VerticalItem,
|
|
3896
|
+
{
|
|
3897
|
+
item,
|
|
3898
|
+
activeId,
|
|
3899
|
+
onActivate: handleItemActivate
|
|
3900
|
+
},
|
|
3901
|
+
item.id
|
|
3902
|
+
)) })
|
|
3903
|
+
);
|
|
3904
|
+
const mobileBar = responsive ? /* @__PURE__ */ jsxs46(
|
|
3905
|
+
"div",
|
|
3906
|
+
{
|
|
3907
|
+
className: cn(
|
|
3908
|
+
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
3909
|
+
),
|
|
3910
|
+
children: [
|
|
3911
|
+
/* @__PURE__ */ jsx54(
|
|
3912
|
+
"button",
|
|
3913
|
+
{
|
|
3914
|
+
type: "button",
|
|
3915
|
+
onClick: () => setDrawerOpen(true),
|
|
3916
|
+
"aria-label": "Open navigation",
|
|
3917
|
+
className: "text-text-muted hover:text-text focus-visible:ring-accent-dim rounded-xs px-2 py-1 text-[18px] outline-none focus-visible:ring-[3px]",
|
|
3918
|
+
children: "\u2630"
|
|
3919
|
+
}
|
|
3920
|
+
),
|
|
3921
|
+
brand && /* @__PURE__ */ jsx54("div", { className: "flex flex-1 items-center text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
3922
|
+
actions && /* @__PURE__ */ jsx54("div", { className: "flex items-center gap-3", children: actions })
|
|
3923
|
+
]
|
|
3924
|
+
}
|
|
3925
|
+
) : null;
|
|
3926
|
+
if (orientation === "horizontal") {
|
|
3927
|
+
return /* @__PURE__ */ jsxs46(Fragment3, { children: [
|
|
3928
|
+
mobileBar,
|
|
3929
|
+
/* @__PURE__ */ jsxs46(
|
|
3930
|
+
"header",
|
|
3931
|
+
{
|
|
3932
|
+
ref,
|
|
3933
|
+
className: cn(
|
|
3934
|
+
"border-border bg-panel flex h-[52px] items-center gap-4 border-b px-5",
|
|
3935
|
+
responsive && "hidden md:flex",
|
|
3936
|
+
className
|
|
3937
|
+
),
|
|
3938
|
+
...props,
|
|
3939
|
+
children: [
|
|
3940
|
+
brand && /* @__PURE__ */ jsx54("div", { className: "shrink-0 text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
3941
|
+
/* @__PURE__ */ jsxs46(RadixNav.Root, { className: "relative flex-1", delayDuration: 120, children: [
|
|
3942
|
+
/* @__PURE__ */ jsx54(RadixNav.List, { className: "m-0! flex list-none! items-center gap-1 p-0! [&_li]:m-0!", children: items.map(
|
|
3943
|
+
(item) => item.children?.length ? /* @__PURE__ */ jsx54(
|
|
3944
|
+
HorizontalDropdown,
|
|
3945
|
+
{
|
|
3946
|
+
item,
|
|
3947
|
+
active: isActiveTree(item, activeId),
|
|
3948
|
+
activeId,
|
|
3949
|
+
onActivate: handleItemActivate
|
|
3950
|
+
},
|
|
3951
|
+
item.id
|
|
3952
|
+
) : /* @__PURE__ */ jsx54(RadixNav.Item, { children: /* @__PURE__ */ jsx54(
|
|
3953
|
+
HorizontalLink,
|
|
3954
|
+
{
|
|
3955
|
+
item,
|
|
3956
|
+
active: item.id === activeId,
|
|
3957
|
+
onActivate: handleItemActivate
|
|
3958
|
+
}
|
|
3959
|
+
) }, item.id)
|
|
3960
|
+
) }),
|
|
3961
|
+
/* @__PURE__ */ jsx54("div", { className: "z-popover absolute top-full left-0 flex justify-start", children: /* @__PURE__ */ jsx54(RadixNav.Viewport, { className: "origin-top-left data-[state=open]:animate-[ship-fade-in_120ms_var(--easing-out)]" }) })
|
|
3962
|
+
] }),
|
|
3963
|
+
actions && /* @__PURE__ */ jsx54("div", { className: "flex items-center gap-3", children: actions })
|
|
3964
|
+
]
|
|
3965
|
+
}
|
|
3966
|
+
),
|
|
3967
|
+
responsive && /* @__PURE__ */ jsx54(
|
|
3968
|
+
Drawer,
|
|
3969
|
+
{
|
|
3970
|
+
open: drawerOpen,
|
|
3971
|
+
onOpenChange: setDrawerOpen,
|
|
3972
|
+
side: "left",
|
|
3973
|
+
title: brand ?? "Navigation",
|
|
3974
|
+
width: 300,
|
|
3975
|
+
children: drawerBody
|
|
3976
|
+
}
|
|
3977
|
+
)
|
|
3978
|
+
] });
|
|
3979
|
+
}
|
|
3980
|
+
return /* @__PURE__ */ jsxs46(Fragment3, { children: [
|
|
3981
|
+
mobileBar,
|
|
3982
|
+
/* @__PURE__ */ jsxs46(
|
|
3983
|
+
"aside",
|
|
3984
|
+
{
|
|
3985
|
+
ref,
|
|
3986
|
+
"aria-label": "Primary navigation",
|
|
3987
|
+
style: { width },
|
|
3988
|
+
className: cn(
|
|
3989
|
+
"border-border bg-panel flex h-full flex-col gap-2 border-r p-[14px]",
|
|
3990
|
+
responsive && "hidden md:flex",
|
|
3991
|
+
className
|
|
3992
|
+
),
|
|
3993
|
+
...props,
|
|
3994
|
+
children: [
|
|
3995
|
+
brand && /* @__PURE__ */ jsx54("div", { className: "px-2 py-1 text-[13px] font-medium", children: brand }),
|
|
3996
|
+
/* @__PURE__ */ jsx54("nav", { "aria-label": "Sidebar navigation", className: "flex flex-1 flex-col gap-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ jsx54(
|
|
3997
|
+
VerticalItem,
|
|
3998
|
+
{
|
|
3999
|
+
item,
|
|
4000
|
+
activeId,
|
|
4001
|
+
onActivate: handleItemActivate
|
|
4002
|
+
},
|
|
4003
|
+
item.id
|
|
4004
|
+
)) }),
|
|
4005
|
+
actions && /* @__PURE__ */ jsx54("div", { className: "border-border mt-auto flex flex-col gap-2 border-t pt-3", children: actions })
|
|
4006
|
+
]
|
|
4007
|
+
}
|
|
4008
|
+
),
|
|
4009
|
+
responsive && /* @__PURE__ */ jsx54(
|
|
4010
|
+
Drawer,
|
|
4011
|
+
{
|
|
4012
|
+
open: drawerOpen,
|
|
4013
|
+
onOpenChange: setDrawerOpen,
|
|
4014
|
+
side: "left",
|
|
4015
|
+
title: brand ?? "Navigation",
|
|
4016
|
+
width: 300,
|
|
4017
|
+
children: drawerBody
|
|
4018
|
+
}
|
|
4019
|
+
)
|
|
4020
|
+
] });
|
|
4021
|
+
});
|
|
4022
|
+
NavBar.displayName = "NavBar";
|
|
4023
|
+
function HorizontalLink({ item, active, onActivate }) {
|
|
4024
|
+
const baseClass = cn(
|
|
4025
|
+
"flex items-center gap-[6px] rounded-xs px-3 py-[6px] text-[13px] outline-none",
|
|
4026
|
+
"transition-colors duration-(--duration-micro)",
|
|
4027
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
4028
|
+
active ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2",
|
|
4029
|
+
item.disabled && "pointer-events-none opacity-50"
|
|
4030
|
+
);
|
|
4031
|
+
const handleClick = (e) => {
|
|
4032
|
+
if (item.disabled) {
|
|
4033
|
+
e.preventDefault();
|
|
4034
|
+
return;
|
|
4035
|
+
}
|
|
4036
|
+
onActivate(item.id);
|
|
4037
|
+
};
|
|
4038
|
+
const inner = /* @__PURE__ */ jsxs46(Fragment3, { children: [
|
|
4039
|
+
item.icon != null && /* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4040
|
+
/* @__PURE__ */ jsx54("span", { children: item.label }),
|
|
4041
|
+
item.badge != null && /* @__PURE__ */ jsx54(ItemBadge, { active, children: item.badge })
|
|
4042
|
+
] });
|
|
4043
|
+
if (item.href) {
|
|
4044
|
+
return /* @__PURE__ */ jsx54(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx54(
|
|
4045
|
+
"a",
|
|
4046
|
+
{
|
|
4047
|
+
href: item.href,
|
|
4048
|
+
"aria-current": active ? "page" : void 0,
|
|
4049
|
+
"aria-disabled": item.disabled || void 0,
|
|
4050
|
+
className: baseClass,
|
|
4051
|
+
onClick: handleClick,
|
|
4052
|
+
children: inner
|
|
4053
|
+
}
|
|
4054
|
+
) });
|
|
4055
|
+
}
|
|
4056
|
+
return /* @__PURE__ */ jsx54(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx54(
|
|
4057
|
+
"button",
|
|
4058
|
+
{
|
|
4059
|
+
type: "button",
|
|
4060
|
+
"aria-current": active ? "page" : void 0,
|
|
4061
|
+
disabled: item.disabled,
|
|
4062
|
+
className: baseClass,
|
|
4063
|
+
onClick: handleClick,
|
|
4064
|
+
children: inner
|
|
4065
|
+
}
|
|
4066
|
+
) });
|
|
4067
|
+
}
|
|
4068
|
+
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
4069
|
+
return /* @__PURE__ */ jsxs46(RadixNav.Item, { children: [
|
|
4070
|
+
/* @__PURE__ */ jsxs46(
|
|
4071
|
+
RadixNav.Trigger,
|
|
4072
|
+
{
|
|
4073
|
+
className: cn(
|
|
4074
|
+
"group flex items-center gap-1 rounded-xs px-3 py-[6px] text-[13px] outline-none",
|
|
4075
|
+
"transition-colors duration-(--duration-micro)",
|
|
4076
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
4077
|
+
active ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2",
|
|
4078
|
+
"data-[state=open]:bg-panel-2"
|
|
4079
|
+
),
|
|
4080
|
+
disabled: item.disabled,
|
|
4081
|
+
children: [
|
|
4082
|
+
item.icon != null && /* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4083
|
+
/* @__PURE__ */ jsx54("span", { children: item.label }),
|
|
4084
|
+
/* @__PURE__ */ jsx54(
|
|
4085
|
+
"span",
|
|
4086
|
+
{
|
|
4087
|
+
"aria-hidden": true,
|
|
4088
|
+
className: "ml-1 text-[10px] opacity-70 transition-transform group-data-[state=open]:rotate-180",
|
|
4089
|
+
children: "\u25BE"
|
|
4090
|
+
}
|
|
4091
|
+
)
|
|
4092
|
+
]
|
|
4093
|
+
}
|
|
4094
|
+
),
|
|
4095
|
+
/* @__PURE__ */ jsx54(RadixNav.Content, { className: "border-border bg-panel min-w-[220px] rounded-xs border p-2 shadow-lg", children: /* @__PURE__ */ jsx54("ul", { className: "m-0! flex list-none! flex-col gap-[2px] p-0! [&_li]:m-0!", children: item.children.map((child) => /* @__PURE__ */ jsx54("li", { children: /* @__PURE__ */ jsx54(DropdownLink, { item: child, active: child.id === activeId, onActivate }) }, child.id)) }) })
|
|
4096
|
+
] });
|
|
4097
|
+
}
|
|
4098
|
+
function DropdownLink({ item, active, onActivate }) {
|
|
4099
|
+
const baseClass = cn(
|
|
4100
|
+
"flex w-full items-center gap-2 rounded-xs px-2 py-[6px] text-left text-[13px] outline-none",
|
|
4101
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
4102
|
+
active ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2",
|
|
4103
|
+
item.disabled && "pointer-events-none opacity-50"
|
|
4104
|
+
);
|
|
4105
|
+
const handleClick = (e) => {
|
|
4106
|
+
if (item.disabled) {
|
|
4107
|
+
e.preventDefault();
|
|
4108
|
+
return;
|
|
4109
|
+
}
|
|
4110
|
+
onActivate(item.id);
|
|
4111
|
+
};
|
|
4112
|
+
const inner = /* @__PURE__ */ jsxs46(Fragment3, { children: [
|
|
4113
|
+
item.icon != null && /* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4114
|
+
/* @__PURE__ */ jsx54("span", { className: "flex-1", children: item.label }),
|
|
4115
|
+
item.badge != null && /* @__PURE__ */ jsx54(ItemBadge, { active, children: item.badge })
|
|
4116
|
+
] });
|
|
4117
|
+
if (item.href) {
|
|
4118
|
+
return /* @__PURE__ */ jsx54(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx54(
|
|
4119
|
+
"a",
|
|
4120
|
+
{
|
|
4121
|
+
href: item.href,
|
|
4122
|
+
"aria-current": active ? "page" : void 0,
|
|
4123
|
+
"aria-disabled": item.disabled || void 0,
|
|
4124
|
+
className: baseClass,
|
|
4125
|
+
onClick: handleClick,
|
|
4126
|
+
children: inner
|
|
4127
|
+
}
|
|
4128
|
+
) });
|
|
4129
|
+
}
|
|
4130
|
+
return /* @__PURE__ */ jsx54(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx54(
|
|
4131
|
+
"button",
|
|
4132
|
+
{
|
|
4133
|
+
type: "button",
|
|
4134
|
+
"aria-current": active ? "page" : void 0,
|
|
4135
|
+
disabled: item.disabled,
|
|
4136
|
+
className: baseClass,
|
|
4137
|
+
onClick: handleClick,
|
|
4138
|
+
children: inner
|
|
4139
|
+
}
|
|
4140
|
+
) });
|
|
4141
|
+
}
|
|
4142
|
+
function VerticalItem({ item, activeId, onActivate }) {
|
|
4143
|
+
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
4144
|
+
const treeActive = isActiveTree(item, activeId);
|
|
4145
|
+
const [open, setOpen] = useState14(treeActive);
|
|
4146
|
+
const prevTreeActive = useRef7(treeActive);
|
|
4147
|
+
useEffect9(() => {
|
|
4148
|
+
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
4149
|
+
prevTreeActive.current = treeActive;
|
|
4150
|
+
}, [treeActive]);
|
|
4151
|
+
if (!hasChildren) {
|
|
4152
|
+
const handleClick = (e) => {
|
|
4153
|
+
if (item.disabled) {
|
|
4154
|
+
e.preventDefault();
|
|
4155
|
+
return;
|
|
4156
|
+
}
|
|
4157
|
+
onActivate(item.id);
|
|
4158
|
+
};
|
|
4159
|
+
return /* @__PURE__ */ jsx54(
|
|
4160
|
+
NavItem,
|
|
4161
|
+
{
|
|
4162
|
+
icon: item.icon,
|
|
4163
|
+
label: item.label,
|
|
4164
|
+
active: item.id === activeId,
|
|
4165
|
+
badge: item.badge,
|
|
4166
|
+
disabled: item.disabled,
|
|
4167
|
+
href: item.href,
|
|
4168
|
+
onClick: handleClick
|
|
4169
|
+
}
|
|
4170
|
+
);
|
|
4171
|
+
}
|
|
4172
|
+
return /* @__PURE__ */ jsxs46("div", { className: "flex flex-col", children: [
|
|
4173
|
+
/* @__PURE__ */ jsxs46(
|
|
4174
|
+
"button",
|
|
4175
|
+
{
|
|
4176
|
+
type: "button",
|
|
4177
|
+
"aria-expanded": open,
|
|
4178
|
+
onClick: () => setOpen((o) => !o),
|
|
4179
|
+
disabled: item.disabled,
|
|
4180
|
+
className: cn(
|
|
4181
|
+
"flex w-full items-center gap-[10px] rounded-xs px-2 py-[6px] text-left text-[13px] outline-none",
|
|
4182
|
+
"transition-colors duration-(--duration-micro)",
|
|
4183
|
+
"focus-visible:ring-accent-dim focus-visible:ring-[3px]",
|
|
4184
|
+
treeActive ? "text-text" : "text-text-muted",
|
|
4185
|
+
"hover:bg-panel-2",
|
|
4186
|
+
item.disabled && "pointer-events-none opacity-50"
|
|
4187
|
+
),
|
|
4188
|
+
children: [
|
|
4189
|
+
item.icon != null && /* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: item.icon }),
|
|
4190
|
+
/* @__PURE__ */ jsx54("span", { className: "flex-1 truncate", children: item.label }),
|
|
4191
|
+
item.badge != null && /* @__PURE__ */ jsx54(ItemBadge, { active: treeActive, children: item.badge }),
|
|
4192
|
+
/* @__PURE__ */ jsx54("span", { "aria-hidden": true, className: "text-[10px] opacity-60", children: open ? "\u25BE" : "\u25B8" })
|
|
4193
|
+
]
|
|
4194
|
+
}
|
|
4195
|
+
),
|
|
4196
|
+
open && /* @__PURE__ */ jsx54("div", { className: "border-border mt-1 ml-[18px] flex flex-col gap-[2px] border-l pl-3", children: item.children.map((child) => /* @__PURE__ */ jsx54(VerticalItem, { item: child, activeId, onActivate }, child.id)) })
|
|
4197
|
+
] });
|
|
4198
|
+
}
|
|
4199
|
+
function ItemBadge({ active, children }) {
|
|
4200
|
+
return /* @__PURE__ */ jsx54(
|
|
4201
|
+
"span",
|
|
4202
|
+
{
|
|
4203
|
+
className: cn(
|
|
4204
|
+
"rounded-xs px-[6px] py-px font-mono text-[10px]",
|
|
4205
|
+
active ? "bg-accent text-on-accent" : "bg-panel-2 text-text-muted"
|
|
4206
|
+
),
|
|
4207
|
+
children
|
|
4208
|
+
}
|
|
4209
|
+
);
|
|
4210
|
+
}
|
|
4211
|
+
|
|
4212
|
+
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
4213
|
+
import { forwardRef as forwardRef53 } from "react";
|
|
4214
|
+
import { Fragment as Fragment4, jsx as jsx55, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4215
|
+
var statusDot = {
|
|
4216
|
+
pending: "off",
|
|
4217
|
+
"in-progress": "sync",
|
|
4218
|
+
done: "ok"
|
|
4219
|
+
};
|
|
4220
|
+
var labelStateClass = {
|
|
4221
|
+
pending: "text-text",
|
|
4222
|
+
"in-progress": "text-text",
|
|
4223
|
+
done: "text-text-dim line-through"
|
|
4224
|
+
};
|
|
4225
|
+
var OnboardingChecklist = forwardRef53(
|
|
4226
|
+
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
4227
|
+
const total = items.length;
|
|
4228
|
+
const done = items.filter((i) => i.status === "done").length;
|
|
4229
|
+
return /* @__PURE__ */ jsxs47(
|
|
4230
|
+
"section",
|
|
4231
|
+
{
|
|
4232
|
+
ref,
|
|
4233
|
+
"aria-label": typeof title === "string" ? title : void 0,
|
|
4234
|
+
className: cn(
|
|
4235
|
+
"rounded-base border-border bg-panel flex flex-col gap-3 border p-5",
|
|
4236
|
+
className
|
|
4237
|
+
),
|
|
4238
|
+
...props,
|
|
4239
|
+
children: [
|
|
4240
|
+
/* @__PURE__ */ jsxs47("header", { className: "flex items-center gap-2", children: [
|
|
4241
|
+
/* @__PURE__ */ jsx55("span", { className: "text-[14px] font-medium", children: title }),
|
|
4242
|
+
/* @__PURE__ */ jsx55("span", { className: "text-text-dim ml-auto font-mono text-[11px] tabular-nums", children: progressLabel ?? `${done} of ${total} complete` })
|
|
4243
|
+
] }),
|
|
4244
|
+
!hideProgress && total > 0 && /* @__PURE__ */ jsx55(
|
|
4245
|
+
"div",
|
|
4246
|
+
{
|
|
4247
|
+
role: "progressbar",
|
|
4248
|
+
"aria-valuemin": 0,
|
|
4249
|
+
"aria-valuemax": total,
|
|
4250
|
+
"aria-valuenow": done,
|
|
4251
|
+
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
4252
|
+
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
4253
|
+
children: /* @__PURE__ */ jsx55(
|
|
4254
|
+
"span",
|
|
4255
|
+
{
|
|
4256
|
+
"aria-hidden": true,
|
|
4257
|
+
className: cn(
|
|
4258
|
+
"block h-full rounded-full transition-[width] duration-(--duration-step)",
|
|
4259
|
+
done === total ? "bg-ok" : "bg-accent"
|
|
4260
|
+
),
|
|
4261
|
+
style: { width: `${total > 0 ? done / total * 100 : 0}%` }
|
|
4262
|
+
}
|
|
4263
|
+
)
|
|
4264
|
+
}
|
|
4265
|
+
),
|
|
4266
|
+
/* @__PURE__ */ jsx55("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
4267
|
+
const interactive = typeof onItemClick === "function";
|
|
4268
|
+
const labelBlock = /* @__PURE__ */ jsxs47(Fragment4, { children: [
|
|
4269
|
+
/* @__PURE__ */ jsx55(
|
|
4270
|
+
StatusDot,
|
|
4271
|
+
{
|
|
4272
|
+
state: statusDot[item.status],
|
|
4273
|
+
pulse: item.status === "in-progress",
|
|
4274
|
+
size: 10,
|
|
4275
|
+
className: "mt-[3px]"
|
|
4276
|
+
}
|
|
4277
|
+
),
|
|
4278
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
4279
|
+
/* @__PURE__ */ jsx55("span", { className: cn("text-[13px]", labelStateClass[item.status]), children: item.label }),
|
|
4280
|
+
item.description && /* @__PURE__ */ jsx55("span", { className: "text-text-muted text-[12px] leading-[1.45]", children: item.description })
|
|
4281
|
+
] })
|
|
4282
|
+
] });
|
|
4283
|
+
const labelRegionClass = cn(
|
|
4284
|
+
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
4285
|
+
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
4286
|
+
);
|
|
4287
|
+
return /* @__PURE__ */ jsxs47("li", { className: "flex items-start gap-2", children: [
|
|
4288
|
+
interactive ? /* @__PURE__ */ jsx55(
|
|
4289
|
+
"button",
|
|
4290
|
+
{
|
|
4291
|
+
type: "button",
|
|
4292
|
+
"aria-current": item.status === "in-progress" ? "step" : void 0,
|
|
4293
|
+
onClick: () => onItemClick(item.id),
|
|
4294
|
+
className: labelRegionClass,
|
|
4295
|
+
children: labelBlock
|
|
4296
|
+
}
|
|
4297
|
+
) : /* @__PURE__ */ jsx55("div", { className: labelRegionClass, children: labelBlock }),
|
|
4298
|
+
item.action && /* @__PURE__ */ jsx55("div", { className: "shrink-0 self-center", children: item.action })
|
|
4299
|
+
] }, item.id);
|
|
4300
|
+
}) })
|
|
4301
|
+
]
|
|
4302
|
+
}
|
|
4303
|
+
);
|
|
4304
|
+
}
|
|
4305
|
+
);
|
|
4306
|
+
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
3258
4307
|
|
|
3259
4308
|
// src/patterns/Pagination/Pagination.tsx
|
|
3260
|
-
import { forwardRef as
|
|
3261
|
-
import { jsx as
|
|
4309
|
+
import { forwardRef as forwardRef54 } from "react";
|
|
4310
|
+
import { jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
3262
4311
|
function buildRange(page, total, siblings) {
|
|
3263
4312
|
if (total <= 0) return [];
|
|
3264
4313
|
const items = [];
|
|
@@ -3271,9 +4320,9 @@ function buildRange(page, total, siblings) {
|
|
|
3271
4320
|
if (total > 1) items.push(total);
|
|
3272
4321
|
return items;
|
|
3273
4322
|
}
|
|
3274
|
-
var Pagination =
|
|
4323
|
+
var Pagination = forwardRef54(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
3275
4324
|
const items = buildRange(page, total, siblings);
|
|
3276
|
-
return /* @__PURE__ */
|
|
4325
|
+
return /* @__PURE__ */ jsxs48(
|
|
3277
4326
|
"nav",
|
|
3278
4327
|
{
|
|
3279
4328
|
ref,
|
|
@@ -3281,7 +4330,7 @@ var Pagination = forwardRef46(function Pagination2({ page, total, onPageChange,
|
|
|
3281
4330
|
className: cn("inline-flex items-center gap-1", className),
|
|
3282
4331
|
...props,
|
|
3283
4332
|
children: [
|
|
3284
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ jsx56(
|
|
3285
4334
|
IconButton,
|
|
3286
4335
|
{
|
|
3287
4336
|
size: "sm",
|
|
@@ -3294,7 +4343,7 @@ var Pagination = forwardRef46(function Pagination2({ page, total, onPageChange,
|
|
|
3294
4343
|
),
|
|
3295
4344
|
items.map((item, i) => {
|
|
3296
4345
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
3297
|
-
return /* @__PURE__ */
|
|
4346
|
+
return /* @__PURE__ */ jsx56(
|
|
3298
4347
|
"span",
|
|
3299
4348
|
{
|
|
3300
4349
|
"aria-hidden": true,
|
|
@@ -3305,7 +4354,7 @@ var Pagination = forwardRef46(function Pagination2({ page, total, onPageChange,
|
|
|
3305
4354
|
);
|
|
3306
4355
|
}
|
|
3307
4356
|
const isActive = item === page;
|
|
3308
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx56(
|
|
3309
4358
|
"button",
|
|
3310
4359
|
{
|
|
3311
4360
|
type: "button",
|
|
@@ -3323,7 +4372,7 @@ var Pagination = forwardRef46(function Pagination2({ page, total, onPageChange,
|
|
|
3323
4372
|
item
|
|
3324
4373
|
);
|
|
3325
4374
|
}),
|
|
3326
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsx56(
|
|
3327
4376
|
IconButton,
|
|
3328
4377
|
{
|
|
3329
4378
|
size: "sm",
|
|
@@ -3342,8 +4391,8 @@ Pagination.displayName = "Pagination";
|
|
|
3342
4391
|
|
|
3343
4392
|
// src/patterns/Progress/Progress.tsx
|
|
3344
4393
|
import { cva as cva11 } from "class-variance-authority";
|
|
3345
|
-
import { forwardRef as
|
|
3346
|
-
import { jsx as
|
|
4394
|
+
import { forwardRef as forwardRef55 } from "react";
|
|
4395
|
+
import { jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
3347
4396
|
var trackStyles = cva11("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
3348
4397
|
variants: {
|
|
3349
4398
|
size: {
|
|
@@ -3365,7 +4414,7 @@ var fillStyles = cva11("h-full rounded-full transition-[width] duration-(--durat
|
|
|
3365
4414
|
},
|
|
3366
4415
|
defaultVariants: { tone: "accent" }
|
|
3367
4416
|
});
|
|
3368
|
-
var Progress =
|
|
4417
|
+
var Progress = forwardRef55(function Progress2({
|
|
3369
4418
|
value = 0,
|
|
3370
4419
|
max = 100,
|
|
3371
4420
|
indeterminate = false,
|
|
@@ -3379,15 +4428,15 @@ var Progress = forwardRef47(function Progress2({
|
|
|
3379
4428
|
const clamped = Math.min(max, Math.max(0, value));
|
|
3380
4429
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
3381
4430
|
const display = Math.round(pct);
|
|
3382
|
-
return /* @__PURE__ */
|
|
3383
|
-
label != null && /* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
4431
|
+
return /* @__PURE__ */ jsxs49("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
4432
|
+
label != null && /* @__PURE__ */ jsxs49("div", { className: "flex text-[12px]", children: [
|
|
4433
|
+
/* @__PURE__ */ jsx57("span", { className: "text-text-muted", children: label }),
|
|
4434
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs49("span", { className: "text-text ml-auto font-mono tabular-nums", children: [
|
|
3386
4435
|
display,
|
|
3387
4436
|
"%"
|
|
3388
4437
|
] })
|
|
3389
4438
|
] }),
|
|
3390
|
-
/* @__PURE__ */
|
|
4439
|
+
/* @__PURE__ */ jsx57(
|
|
3391
4440
|
"div",
|
|
3392
4441
|
{
|
|
3393
4442
|
role: "progressbar",
|
|
@@ -3396,7 +4445,7 @@ var Progress = forwardRef47(function Progress2({
|
|
|
3396
4445
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
3397
4446
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
3398
4447
|
className: trackStyles({ size }),
|
|
3399
|
-
children: indeterminate ? /* @__PURE__ */
|
|
4448
|
+
children: indeterminate ? /* @__PURE__ */ jsx57(
|
|
3400
4449
|
"span",
|
|
3401
4450
|
{
|
|
3402
4451
|
"aria-hidden": true,
|
|
@@ -3406,178 +4455,16 @@ var Progress = forwardRef47(function Progress2({
|
|
|
3406
4455
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
3407
4456
|
)
|
|
3408
4457
|
}
|
|
3409
|
-
) : /* @__PURE__ */
|
|
4458
|
+
) : /* @__PURE__ */ jsx57("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
3410
4459
|
}
|
|
3411
4460
|
)
|
|
3412
4461
|
] });
|
|
3413
4462
|
});
|
|
3414
4463
|
Progress.displayName = "Progress";
|
|
3415
4464
|
|
|
3416
|
-
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
3417
|
-
import { forwardRef as forwardRef48 } from "react";
|
|
3418
|
-
import { jsx as jsx50, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3419
|
-
var toneStrokeClass = {
|
|
3420
|
-
accent: "stroke-accent",
|
|
3421
|
-
ok: "stroke-ok",
|
|
3422
|
-
warn: "stroke-warn",
|
|
3423
|
-
err: "stroke-err"
|
|
3424
|
-
};
|
|
3425
|
-
var RadialProgress = forwardRef48(
|
|
3426
|
-
function RadialProgress2({
|
|
3427
|
-
value,
|
|
3428
|
-
max = 100,
|
|
3429
|
-
size = 64,
|
|
3430
|
-
thickness = 4,
|
|
3431
|
-
tone,
|
|
3432
|
-
children,
|
|
3433
|
-
className,
|
|
3434
|
-
"aria-label": ariaLabel,
|
|
3435
|
-
...props
|
|
3436
|
-
}, ref) {
|
|
3437
|
-
const clamped = Math.min(max, Math.max(0, value));
|
|
3438
|
-
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
3439
|
-
const r = (size - thickness) / 2;
|
|
3440
|
-
const c = 2 * Math.PI * r;
|
|
3441
|
-
const dash = pct / 100 * c;
|
|
3442
|
-
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
3443
|
-
return /* @__PURE__ */ jsxs42(
|
|
3444
|
-
"div",
|
|
3445
|
-
{
|
|
3446
|
-
ref,
|
|
3447
|
-
role: "progressbar",
|
|
3448
|
-
"aria-valuemin": 0,
|
|
3449
|
-
"aria-valuemax": max,
|
|
3450
|
-
"aria-valuenow": Math.round(pct),
|
|
3451
|
-
"aria-label": ariaLabel ?? `${Math.round(pct)}%`,
|
|
3452
|
-
className: cn("relative inline-grid place-items-center", className),
|
|
3453
|
-
style: { width: size, height: size },
|
|
3454
|
-
...props,
|
|
3455
|
-
children: [
|
|
3456
|
-
/* @__PURE__ */ jsxs42("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
3457
|
-
/* @__PURE__ */ jsx50(
|
|
3458
|
-
"circle",
|
|
3459
|
-
{
|
|
3460
|
-
cx: size / 2,
|
|
3461
|
-
cy: size / 2,
|
|
3462
|
-
r,
|
|
3463
|
-
fill: "none",
|
|
3464
|
-
strokeWidth: thickness,
|
|
3465
|
-
className: "stroke-panel-2"
|
|
3466
|
-
}
|
|
3467
|
-
),
|
|
3468
|
-
/* @__PURE__ */ jsx50(
|
|
3469
|
-
"circle",
|
|
3470
|
-
{
|
|
3471
|
-
cx: size / 2,
|
|
3472
|
-
cy: size / 2,
|
|
3473
|
-
r,
|
|
3474
|
-
fill: "none",
|
|
3475
|
-
strokeWidth: thickness,
|
|
3476
|
-
strokeLinecap: "round",
|
|
3477
|
-
strokeDasharray: `${dash} ${c}`,
|
|
3478
|
-
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
3479
|
-
className: cn(
|
|
3480
|
-
"transition-[stroke-dasharray] duration-(--duration-step)",
|
|
3481
|
-
toneStrokeClass[resolvedTone]
|
|
3482
|
-
)
|
|
3483
|
-
}
|
|
3484
|
-
)
|
|
3485
|
-
] }),
|
|
3486
|
-
/* @__PURE__ */ jsx50("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
3487
|
-
]
|
|
3488
|
-
}
|
|
3489
|
-
);
|
|
3490
|
-
}
|
|
3491
|
-
);
|
|
3492
|
-
RadialProgress.displayName = "RadialProgress";
|
|
3493
|
-
|
|
3494
|
-
// src/patterns/Sidebar/Sidebar.tsx
|
|
3495
|
-
import { forwardRef as forwardRef49 } from "react";
|
|
3496
|
-
import { Fragment as Fragment2, jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3497
|
-
var Sidebar = forwardRef49(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
3498
|
-
return /* @__PURE__ */ jsx51(
|
|
3499
|
-
"aside",
|
|
3500
|
-
{
|
|
3501
|
-
ref,
|
|
3502
|
-
style: { width, ...style },
|
|
3503
|
-
className: cn(
|
|
3504
|
-
"border-border bg-panel flex h-full flex-col gap-2 border-r p-[14px]",
|
|
3505
|
-
className
|
|
3506
|
-
),
|
|
3507
|
-
...props
|
|
3508
|
-
}
|
|
3509
|
-
);
|
|
3510
|
-
});
|
|
3511
|
-
Sidebar.displayName = "Sidebar";
|
|
3512
|
-
var NavItem = forwardRef49(
|
|
3513
|
-
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
3514
|
-
const inner = /* @__PURE__ */ jsxs43(Fragment2, { children: [
|
|
3515
|
-
icon && /* @__PURE__ */ jsx51("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
3516
|
-
/* @__PURE__ */ jsx51("span", { className: "flex-1 truncate", children: label }),
|
|
3517
|
-
badge != null && /* @__PURE__ */ jsx51(
|
|
3518
|
-
"span",
|
|
3519
|
-
{
|
|
3520
|
-
className: cn(
|
|
3521
|
-
"rounded-xs px-[6px] py-px font-mono text-[10px]",
|
|
3522
|
-
active ? "bg-accent text-on-accent" : "bg-panel-2 text-text-muted"
|
|
3523
|
-
),
|
|
3524
|
-
children: badge
|
|
3525
|
-
}
|
|
3526
|
-
)
|
|
3527
|
-
] });
|
|
3528
|
-
const baseClass = cn(
|
|
3529
|
-
"flex cursor-pointer items-center gap-[10px] rounded-xs px-2 py-[6px] text-[13px] outline-none",
|
|
3530
|
-
"transition-colors duration-(--duration-micro)",
|
|
3531
|
-
"focus-visible:ring-[3px] focus-visible:ring-accent-dim",
|
|
3532
|
-
active ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2",
|
|
3533
|
-
disabled && "opacity-50 pointer-events-none",
|
|
3534
|
-
className
|
|
3535
|
-
);
|
|
3536
|
-
if (href) {
|
|
3537
|
-
const anchorProps = props;
|
|
3538
|
-
return /* @__PURE__ */ jsx51(
|
|
3539
|
-
"a",
|
|
3540
|
-
{
|
|
3541
|
-
ref,
|
|
3542
|
-
href,
|
|
3543
|
-
"aria-current": active ? "page" : void 0,
|
|
3544
|
-
"aria-disabled": disabled || void 0,
|
|
3545
|
-
className: baseClass,
|
|
3546
|
-
...anchorProps,
|
|
3547
|
-
children: inner
|
|
3548
|
-
}
|
|
3549
|
-
);
|
|
3550
|
-
}
|
|
3551
|
-
const buttonProps = props;
|
|
3552
|
-
return /* @__PURE__ */ jsx51(
|
|
3553
|
-
"button",
|
|
3554
|
-
{
|
|
3555
|
-
ref,
|
|
3556
|
-
type: "button",
|
|
3557
|
-
"aria-current": active ? "page" : void 0,
|
|
3558
|
-
disabled,
|
|
3559
|
-
className: cn(baseClass, "w-full text-left"),
|
|
3560
|
-
...buttonProps,
|
|
3561
|
-
children: inner
|
|
3562
|
-
}
|
|
3563
|
-
);
|
|
3564
|
-
}
|
|
3565
|
-
);
|
|
3566
|
-
NavItem.displayName = "NavItem";
|
|
3567
|
-
var NavSection = forwardRef49(function NavSection2({ label, action, className, children, ...props }, ref) {
|
|
3568
|
-
return /* @__PURE__ */ jsxs43("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
3569
|
-
/* @__PURE__ */ jsxs43("div", { className: "text-text-dim flex items-center px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase", children: [
|
|
3570
|
-
/* @__PURE__ */ jsx51("span", { className: "flex-1", children: label }),
|
|
3571
|
-
action
|
|
3572
|
-
] }),
|
|
3573
|
-
/* @__PURE__ */ jsx51("div", { className: "flex flex-col gap-[2px]", children })
|
|
3574
|
-
] });
|
|
3575
|
-
});
|
|
3576
|
-
NavSection.displayName = "NavSection";
|
|
3577
|
-
|
|
3578
4465
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
3579
|
-
import { forwardRef as
|
|
3580
|
-
import { jsx as
|
|
4466
|
+
import { forwardRef as forwardRef56, useMemo as useMemo5 } from "react";
|
|
4467
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
3581
4468
|
function buildPath(values, w, h) {
|
|
3582
4469
|
if (values.length === 0) return { line: "", area: "" };
|
|
3583
4470
|
const pad = 2;
|
|
@@ -3596,7 +4483,7 @@ function buildPath(values, w, h) {
|
|
|
3596
4483
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
3597
4484
|
return { line, area };
|
|
3598
4485
|
}
|
|
3599
|
-
var Sparkline =
|
|
4486
|
+
var Sparkline = forwardRef56(function Sparkline2({
|
|
3600
4487
|
values,
|
|
3601
4488
|
width = 160,
|
|
3602
4489
|
height = 32,
|
|
@@ -3608,7 +4495,7 @@ var Sparkline = forwardRef50(function Sparkline2({
|
|
|
3608
4495
|
...props
|
|
3609
4496
|
}, ref) {
|
|
3610
4497
|
const { line, area } = useMemo5(() => buildPath(values, width, height), [values, width, height]);
|
|
3611
|
-
return /* @__PURE__ */
|
|
4498
|
+
return /* @__PURE__ */ jsxs50(
|
|
3612
4499
|
"svg",
|
|
3613
4500
|
{
|
|
3614
4501
|
ref,
|
|
@@ -3620,8 +4507,8 @@ var Sparkline = forwardRef50(function Sparkline2({
|
|
|
3620
4507
|
className: cn("inline-block", className),
|
|
3621
4508
|
...props,
|
|
3622
4509
|
children: [
|
|
3623
|
-
fill && /* @__PURE__ */
|
|
3624
|
-
/* @__PURE__ */
|
|
4510
|
+
fill && /* @__PURE__ */ jsx58("path", { d: area, fill: stroke, fillOpacity: 0.16, stroke: "none" }),
|
|
4511
|
+
/* @__PURE__ */ jsx58(
|
|
3625
4512
|
"path",
|
|
3626
4513
|
{
|
|
3627
4514
|
d: line,
|
|
@@ -3639,16 +4526,16 @@ var Sparkline = forwardRef50(function Sparkline2({
|
|
|
3639
4526
|
Sparkline.displayName = "Sparkline";
|
|
3640
4527
|
|
|
3641
4528
|
// src/patterns/Spinner/Spinner.tsx
|
|
3642
|
-
import { forwardRef as
|
|
3643
|
-
import { jsx as
|
|
4529
|
+
import { forwardRef as forwardRef57 } from "react";
|
|
4530
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3644
4531
|
var sizes = {
|
|
3645
4532
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
3646
4533
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
3647
4534
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
3648
4535
|
};
|
|
3649
|
-
var Spinner2 =
|
|
4536
|
+
var Spinner2 = forwardRef57(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
3650
4537
|
const s = sizes[size];
|
|
3651
|
-
return /* @__PURE__ */
|
|
4538
|
+
return /* @__PURE__ */ jsx59(
|
|
3652
4539
|
"span",
|
|
3653
4540
|
{
|
|
3654
4541
|
ref,
|
|
@@ -3656,7 +4543,7 @@ var Spinner2 = forwardRef51(function Spinner3({ size = "md", label = "Loading",
|
|
|
3656
4543
|
"aria-label": label,
|
|
3657
4544
|
className: cn("inline-block", className),
|
|
3658
4545
|
...props,
|
|
3659
|
-
children: /* @__PURE__ */
|
|
4546
|
+
children: /* @__PURE__ */ jsx59(
|
|
3660
4547
|
"span",
|
|
3661
4548
|
{
|
|
3662
4549
|
"aria-hidden": true,
|
|
@@ -3673,15 +4560,15 @@ var Spinner2 = forwardRef51(function Spinner3({ size = "md", label = "Loading",
|
|
|
3673
4560
|
Spinner2.displayName = "Spinner";
|
|
3674
4561
|
|
|
3675
4562
|
// src/patterns/Stepper/Stepper.tsx
|
|
3676
|
-
import { forwardRef as
|
|
3677
|
-
import { jsx as
|
|
4563
|
+
import { forwardRef as forwardRef58, Fragment as Fragment5 } from "react";
|
|
4564
|
+
import { jsx as jsx60, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
3678
4565
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
3679
4566
|
var dotStateClass = {
|
|
3680
4567
|
done: "bg-accent text-on-accent border-accent",
|
|
3681
4568
|
current: "bg-accent-dim text-accent border-accent",
|
|
3682
4569
|
upcoming: "bg-panel text-text-dim border-border"
|
|
3683
4570
|
};
|
|
3684
|
-
var
|
|
4571
|
+
var labelStateClass2 = {
|
|
3685
4572
|
done: "text-text",
|
|
3686
4573
|
current: "text-text font-medium",
|
|
3687
4574
|
upcoming: "text-text-dim"
|
|
@@ -3691,8 +4578,8 @@ function stateFor(index, current) {
|
|
|
3691
4578
|
if (index === current) return "current";
|
|
3692
4579
|
return "upcoming";
|
|
3693
4580
|
}
|
|
3694
|
-
var Stepper =
|
|
3695
|
-
return /* @__PURE__ */
|
|
4581
|
+
var Stepper = forwardRef58(function Stepper2({ steps, current, className, ...props }, ref) {
|
|
4582
|
+
return /* @__PURE__ */ jsx60(
|
|
3696
4583
|
"ol",
|
|
3697
4584
|
{
|
|
3698
4585
|
ref,
|
|
@@ -3704,19 +4591,19 @@ var Stepper = forwardRef52(function Stepper2({ steps, current, className, ...pro
|
|
|
3704
4591
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
3705
4592
|
const state = stateFor(i, current);
|
|
3706
4593
|
const connectorActive = i < current;
|
|
3707
|
-
return /* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ jsxs51(Fragment5, { children: [
|
|
4595
|
+
/* @__PURE__ */ jsxs51(
|
|
3709
4596
|
"li",
|
|
3710
4597
|
{
|
|
3711
4598
|
"aria-current": state === "current" ? "step" : void 0,
|
|
3712
4599
|
className: "flex items-center gap-2",
|
|
3713
4600
|
children: [
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ jsx60("span", { "aria-hidden": true, className: cn(dotBase, dotStateClass[state]), children: state === "done" ? "\u2713" : i + 1 }),
|
|
4602
|
+
/* @__PURE__ */ jsx60("span", { className: cn("text-[12px]", labelStateClass2[state]), children: label })
|
|
3716
4603
|
]
|
|
3717
4604
|
}
|
|
3718
4605
|
),
|
|
3719
|
-
i < steps.length - 1 && /* @__PURE__ */
|
|
4606
|
+
i < steps.length - 1 && /* @__PURE__ */ jsx60(
|
|
3720
4607
|
"span",
|
|
3721
4608
|
{
|
|
3722
4609
|
"aria-hidden": true,
|
|
@@ -3733,8 +4620,8 @@ Stepper.displayName = "Stepper";
|
|
|
3733
4620
|
// src/patterns/Tabs/Tabs.tsx
|
|
3734
4621
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3735
4622
|
import { cva as cva12 } from "class-variance-authority";
|
|
3736
|
-
import { createContext as createContext2, forwardRef as
|
|
3737
|
-
import { jsx as
|
|
4623
|
+
import { createContext as createContext2, forwardRef as forwardRef59, useContext as useContext2 } from "react";
|
|
4624
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3738
4625
|
var TabsVariantContext = createContext2("underline");
|
|
3739
4626
|
var tabsListStyles = cva12("", {
|
|
3740
4627
|
variants: {
|
|
@@ -3765,8 +4652,8 @@ var tabsTriggerStyles = cva12(
|
|
|
3765
4652
|
}
|
|
3766
4653
|
}
|
|
3767
4654
|
);
|
|
3768
|
-
var Tabs =
|
|
3769
|
-
return /* @__PURE__ */
|
|
4655
|
+
var Tabs = forwardRef59(function Tabs2({ variant = "underline", className, ...props }, ref) {
|
|
4656
|
+
return /* @__PURE__ */ jsx61(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx61(
|
|
3770
4657
|
RadixTabs.Root,
|
|
3771
4658
|
{
|
|
3772
4659
|
ref,
|
|
@@ -3776,14 +4663,14 @@ var Tabs = forwardRef53(function Tabs2({ variant = "underline", className, ...pr
|
|
|
3776
4663
|
) });
|
|
3777
4664
|
});
|
|
3778
4665
|
Tabs.displayName = "Tabs";
|
|
3779
|
-
var TabsList =
|
|
4666
|
+
var TabsList = forwardRef59(function TabsList2({ className, ...props }, ref) {
|
|
3780
4667
|
const variant = useContext2(TabsVariantContext);
|
|
3781
|
-
return /* @__PURE__ */
|
|
4668
|
+
return /* @__PURE__ */ jsx61(RadixTabs.List, { ref, className: cn(tabsListStyles({ variant }), className), ...props });
|
|
3782
4669
|
});
|
|
3783
4670
|
TabsList.displayName = "TabsList";
|
|
3784
|
-
var Tab =
|
|
4671
|
+
var Tab = forwardRef59(function Tab2({ className, ...props }, ref) {
|
|
3785
4672
|
const variant = useContext2(TabsVariantContext);
|
|
3786
|
-
return /* @__PURE__ */
|
|
4673
|
+
return /* @__PURE__ */ jsx61(
|
|
3787
4674
|
RadixTabs.Trigger,
|
|
3788
4675
|
{
|
|
3789
4676
|
ref,
|
|
@@ -3793,9 +4680,9 @@ var Tab = forwardRef53(function Tab2({ className, ...props }, ref) {
|
|
|
3793
4680
|
);
|
|
3794
4681
|
});
|
|
3795
4682
|
Tab.displayName = "Tab";
|
|
3796
|
-
var TabsContent =
|
|
4683
|
+
var TabsContent = forwardRef59(
|
|
3797
4684
|
function TabsContent2({ className, ...props }, ref) {
|
|
3798
|
-
return /* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsx61(
|
|
3799
4686
|
RadixTabs.Content,
|
|
3800
4687
|
{
|
|
3801
4688
|
ref,
|
|
@@ -3811,8 +4698,8 @@ var TabsContent = forwardRef53(
|
|
|
3811
4698
|
TabsContent.displayName = "TabsContent";
|
|
3812
4699
|
|
|
3813
4700
|
// src/patterns/Timeline/Timeline.tsx
|
|
3814
|
-
import { forwardRef as
|
|
3815
|
-
import { jsx as
|
|
4701
|
+
import { forwardRef as forwardRef60 } from "react";
|
|
4702
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
3816
4703
|
var ringClass = {
|
|
3817
4704
|
accent: "border-accent",
|
|
3818
4705
|
ok: "border-ok",
|
|
@@ -3820,8 +4707,8 @@ var ringClass = {
|
|
|
3820
4707
|
err: "border-err",
|
|
3821
4708
|
muted: "border-text-dim"
|
|
3822
4709
|
};
|
|
3823
|
-
var Timeline =
|
|
3824
|
-
return /* @__PURE__ */
|
|
4710
|
+
var Timeline = forwardRef60(function Timeline2({ events, className, children, ...props }, ref) {
|
|
4711
|
+
return /* @__PURE__ */ jsx62(
|
|
3825
4712
|
"ol",
|
|
3826
4713
|
{
|
|
3827
4714
|
ref,
|
|
@@ -3831,14 +4718,14 @@ var Timeline = forwardRef54(function Timeline2({ events, className, children, ..
|
|
|
3831
4718
|
className
|
|
3832
4719
|
),
|
|
3833
4720
|
...props,
|
|
3834
|
-
children: events ? events.map((e, i) => /* @__PURE__ */
|
|
4721
|
+
children: events ? events.map((e, i) => /* @__PURE__ */ jsx62(TimelineItem, { tone: e.tone, time: e.time, description: e.description, children: e.title }, i)) : children
|
|
3835
4722
|
}
|
|
3836
4723
|
);
|
|
3837
4724
|
});
|
|
3838
4725
|
Timeline.displayName = "Timeline";
|
|
3839
|
-
var TimelineItem =
|
|
3840
|
-
return /* @__PURE__ */
|
|
3841
|
-
/* @__PURE__ */
|
|
4726
|
+
var TimelineItem = forwardRef60(function TimelineItem2({ tone = "accent", description, time, className, children, ...props }, ref) {
|
|
4727
|
+
return /* @__PURE__ */ jsxs52("li", { ref, className: cn("relative mb-[18px] last:mb-0", className), ...props, children: [
|
|
4728
|
+
/* @__PURE__ */ jsx62(
|
|
3842
4729
|
"span",
|
|
3843
4730
|
{
|
|
3844
4731
|
"aria-hidden": true,
|
|
@@ -3848,18 +4735,107 @@ var TimelineItem = forwardRef54(function TimelineItem2({ tone = "accent", descri
|
|
|
3848
4735
|
)
|
|
3849
4736
|
}
|
|
3850
4737
|
),
|
|
3851
|
-
/* @__PURE__ */
|
|
3852
|
-
description && /* @__PURE__ */
|
|
3853
|
-
time && /* @__PURE__ */
|
|
4738
|
+
/* @__PURE__ */ jsx62("div", { className: "text-[13px] font-medium", children }),
|
|
4739
|
+
description && /* @__PURE__ */ jsx62("div", { className: "text-text-muted text-[12px]", children: description }),
|
|
4740
|
+
time && /* @__PURE__ */ jsx62("div", { className: "text-text-dim mt-[2px] font-mono text-[10px]", children: time })
|
|
3854
4741
|
] });
|
|
3855
4742
|
});
|
|
3856
4743
|
TimelineItem.displayName = "TimelineItem";
|
|
3857
4744
|
|
|
4745
|
+
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
4746
|
+
import { forwardRef as forwardRef61 } from "react";
|
|
4747
|
+
|
|
4748
|
+
// src/patterns/Timeline/formatRelative.ts
|
|
4749
|
+
var SECOND = 1e3;
|
|
4750
|
+
var MINUTE = 60 * SECOND;
|
|
4751
|
+
var HOUR = 60 * MINUTE;
|
|
4752
|
+
var DAY = 24 * HOUR;
|
|
4753
|
+
var WEEK = 7 * DAY;
|
|
4754
|
+
var MONTH = 30 * DAY;
|
|
4755
|
+
var YEAR = 365 * DAY;
|
|
4756
|
+
var UNITS = [
|
|
4757
|
+
{ ms: YEAR, short: "y" },
|
|
4758
|
+
{ ms: MONTH, short: "mo" },
|
|
4759
|
+
{ ms: WEEK, short: "w" },
|
|
4760
|
+
{ ms: DAY, short: "d" },
|
|
4761
|
+
{ ms: HOUR, short: "h" },
|
|
4762
|
+
{ ms: MINUTE, short: "m" },
|
|
4763
|
+
{ ms: SECOND, short: "s" }
|
|
4764
|
+
];
|
|
4765
|
+
function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
4766
|
+
const target = input instanceof Date ? input : new Date(input);
|
|
4767
|
+
if (Number.isNaN(target.getTime())) return "";
|
|
4768
|
+
const diffMs = now.getTime() - target.getTime();
|
|
4769
|
+
const abs = Math.abs(diffMs);
|
|
4770
|
+
if (abs < 5 * SECOND) return "just now";
|
|
4771
|
+
for (const unit of UNITS) {
|
|
4772
|
+
if (abs >= unit.ms) {
|
|
4773
|
+
const n = Math.floor(abs / unit.ms);
|
|
4774
|
+
return diffMs >= 0 ? `${n}${unit.short} ago` : `in ${n}${unit.short}`;
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
return "just now";
|
|
4778
|
+
}
|
|
4779
|
+
|
|
4780
|
+
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
4781
|
+
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4782
|
+
var ringClass2 = {
|
|
4783
|
+
accent: "border-accent",
|
|
4784
|
+
ok: "border-ok",
|
|
4785
|
+
warn: "border-warn",
|
|
4786
|
+
err: "border-err",
|
|
4787
|
+
muted: "border-text-dim"
|
|
4788
|
+
};
|
|
4789
|
+
var ActivityTimeline = forwardRef61(
|
|
4790
|
+
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
4791
|
+
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
4792
|
+
return /* @__PURE__ */ jsx63(
|
|
4793
|
+
"ol",
|
|
4794
|
+
{
|
|
4795
|
+
ref,
|
|
4796
|
+
className: cn(
|
|
4797
|
+
"relative m-0 list-none p-0 pl-6",
|
|
4798
|
+
"before:bg-border before:absolute before:top-[6px] before:bottom-[6px] before:left-[7px] before:w-px",
|
|
4799
|
+
className
|
|
4800
|
+
),
|
|
4801
|
+
...props,
|
|
4802
|
+
children: events.map((event) => {
|
|
4803
|
+
const tone = event.tone ?? "accent";
|
|
4804
|
+
const time = formatRelative(event.at, now);
|
|
4805
|
+
return /* @__PURE__ */ jsxs53("li", { className: "relative mb-4 last:mb-0", children: [
|
|
4806
|
+
/* @__PURE__ */ jsx63(
|
|
4807
|
+
"span",
|
|
4808
|
+
{
|
|
4809
|
+
"aria-hidden": true,
|
|
4810
|
+
className: cn(
|
|
4811
|
+
"bg-bg absolute top-[4px] -left-6 h-[14px] w-[14px] rounded-full border-2",
|
|
4812
|
+
ringClass2[tone]
|
|
4813
|
+
)
|
|
4814
|
+
}
|
|
4815
|
+
),
|
|
4816
|
+
/* @__PURE__ */ jsxs53("div", { className: "flex items-baseline gap-2", children: [
|
|
4817
|
+
event.icon && /* @__PURE__ */ jsx63("span", { "aria-hidden": true, className: "text-text-muted font-mono text-[12px]", children: event.icon }),
|
|
4818
|
+
/* @__PURE__ */ jsx63("div", { className: "text-[13px] font-medium", children: event.title }),
|
|
4819
|
+
time && /* @__PURE__ */ jsx63("time", { className: "text-text-dim ml-auto font-mono text-[10px]", children: time })
|
|
4820
|
+
] }),
|
|
4821
|
+
event.actor && /* @__PURE__ */ jsxs53("div", { className: "text-text-muted mt-[2px] flex items-center gap-[6px] text-[12px]", children: [
|
|
4822
|
+
event.actor.avatar && /* @__PURE__ */ jsx63("span", { "aria-hidden": true, className: "inline-flex", children: event.actor.avatar }),
|
|
4823
|
+
/* @__PURE__ */ jsx63("span", { children: event.actor.name })
|
|
4824
|
+
] }),
|
|
4825
|
+
event.payload && /* @__PURE__ */ jsx63("div", { className: "border-border bg-panel-2 mt-2 rounded-md border px-3 py-2 font-mono text-[11px] leading-[1.5]", children: event.payload })
|
|
4826
|
+
] }, event.id);
|
|
4827
|
+
})
|
|
4828
|
+
}
|
|
4829
|
+
);
|
|
4830
|
+
}
|
|
4831
|
+
);
|
|
4832
|
+
ActivityTimeline.displayName = "ActivityTimeline";
|
|
4833
|
+
|
|
3858
4834
|
// src/patterns/Topbar/Topbar.tsx
|
|
3859
|
-
import { forwardRef as
|
|
3860
|
-
import { jsx as
|
|
3861
|
-
var Topbar =
|
|
3862
|
-
return /* @__PURE__ */
|
|
4835
|
+
import { forwardRef as forwardRef62 } from "react";
|
|
4836
|
+
import { jsx as jsx64, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4837
|
+
var Topbar = forwardRef62(function Topbar2({ title, leading, actions, className, children, ...props }, ref) {
|
|
4838
|
+
return /* @__PURE__ */ jsxs54(
|
|
3863
4839
|
"header",
|
|
3864
4840
|
{
|
|
3865
4841
|
ref,
|
|
@@ -3870,9 +4846,9 @@ var Topbar = forwardRef55(function Topbar2({ title, leading, actions, className,
|
|
|
3870
4846
|
...props,
|
|
3871
4847
|
children: [
|
|
3872
4848
|
leading,
|
|
3873
|
-
title && /* @__PURE__ */
|
|
3874
|
-
/* @__PURE__ */
|
|
3875
|
-
actions && /* @__PURE__ */
|
|
4849
|
+
title && /* @__PURE__ */ jsx64("div", { className: "text-[13px] font-medium", children: title }),
|
|
4850
|
+
/* @__PURE__ */ jsx64("div", { className: "flex flex-1 items-center" }),
|
|
4851
|
+
actions && /* @__PURE__ */ jsx64("div", { className: "flex items-center gap-3", children: actions }),
|
|
3876
4852
|
children
|
|
3877
4853
|
]
|
|
3878
4854
|
}
|
|
@@ -3882,14 +4858,14 @@ Topbar.displayName = "Topbar";
|
|
|
3882
4858
|
|
|
3883
4859
|
// src/patterns/Tree/Tree.tsx
|
|
3884
4860
|
import {
|
|
3885
|
-
forwardRef as
|
|
3886
|
-
useCallback as
|
|
3887
|
-
useEffect as
|
|
4861
|
+
forwardRef as forwardRef63,
|
|
4862
|
+
useCallback as useCallback11,
|
|
4863
|
+
useEffect as useEffect10,
|
|
3888
4864
|
useMemo as useMemo6,
|
|
3889
|
-
useRef as
|
|
3890
|
-
useState as
|
|
4865
|
+
useRef as useRef8,
|
|
4866
|
+
useState as useState15
|
|
3891
4867
|
} from "react";
|
|
3892
|
-
import { jsx as
|
|
4868
|
+
import { jsx as jsx65, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
3893
4869
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
3894
4870
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
3895
4871
|
for (const item of items) {
|
|
@@ -3900,7 +4876,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
3900
4876
|
}
|
|
3901
4877
|
}
|
|
3902
4878
|
}
|
|
3903
|
-
var Tree =
|
|
4879
|
+
var Tree = forwardRef63(function Tree2({
|
|
3904
4880
|
items,
|
|
3905
4881
|
expanded: expandedProp,
|
|
3906
4882
|
defaultExpanded,
|
|
@@ -3928,8 +4904,8 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3928
4904
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
3929
4905
|
return out;
|
|
3930
4906
|
}, [items, expandedSet]);
|
|
3931
|
-
const [activeId, setActiveId] =
|
|
3932
|
-
|
|
4907
|
+
const [activeId, setActiveId] = useState15(null);
|
|
4908
|
+
useEffect10(() => {
|
|
3933
4909
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
3934
4910
|
setActiveId(null);
|
|
3935
4911
|
}
|
|
@@ -3939,8 +4915,8 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3939
4915
|
if (value && flatVisible.some((f) => f.id === value)) return value;
|
|
3940
4916
|
return flatVisible[0]?.id ?? null;
|
|
3941
4917
|
}, [activeId, flatVisible, value]);
|
|
3942
|
-
const listRef =
|
|
3943
|
-
const setRefs =
|
|
4918
|
+
const listRef = useRef8(null);
|
|
4919
|
+
const setRefs = useCallback11(
|
|
3944
4920
|
(node) => {
|
|
3945
4921
|
listRef.current = node;
|
|
3946
4922
|
if (typeof ref === "function") ref(node);
|
|
@@ -3948,20 +4924,20 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3948
4924
|
},
|
|
3949
4925
|
[ref]
|
|
3950
4926
|
);
|
|
3951
|
-
const focusItem =
|
|
4927
|
+
const focusItem = useCallback11((id) => {
|
|
3952
4928
|
const root = listRef.current;
|
|
3953
4929
|
if (!root) return;
|
|
3954
4930
|
const el = root.querySelector(`[data-treeitem-id="${CSS.escape(id)}"]`);
|
|
3955
4931
|
el?.focus();
|
|
3956
4932
|
}, []);
|
|
3957
|
-
const moveActive =
|
|
4933
|
+
const moveActive = useCallback11(
|
|
3958
4934
|
(id) => {
|
|
3959
4935
|
setActiveId(id);
|
|
3960
4936
|
queueMicrotask(() => focusItem(id));
|
|
3961
4937
|
},
|
|
3962
4938
|
[focusItem]
|
|
3963
4939
|
);
|
|
3964
|
-
const toggle =
|
|
4940
|
+
const toggle = useCallback11(
|
|
3965
4941
|
(id) => {
|
|
3966
4942
|
setExpanded((prev) => {
|
|
3967
4943
|
const next = new Set(prev ?? EMPTY_SET2);
|
|
@@ -3972,7 +4948,7 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3972
4948
|
},
|
|
3973
4949
|
[setExpanded]
|
|
3974
4950
|
);
|
|
3975
|
-
const expand =
|
|
4951
|
+
const expand = useCallback11(
|
|
3976
4952
|
(id) => {
|
|
3977
4953
|
setExpanded((prev) => {
|
|
3978
4954
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -3984,7 +4960,7 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3984
4960
|
},
|
|
3985
4961
|
[setExpanded]
|
|
3986
4962
|
);
|
|
3987
|
-
const collapse =
|
|
4963
|
+
const collapse = useCallback11(
|
|
3988
4964
|
(id) => {
|
|
3989
4965
|
setExpanded((prev) => {
|
|
3990
4966
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -3996,13 +4972,13 @@ var Tree = forwardRef56(function Tree2({
|
|
|
3996
4972
|
},
|
|
3997
4973
|
[setExpanded]
|
|
3998
4974
|
);
|
|
3999
|
-
const selectItem =
|
|
4975
|
+
const selectItem = useCallback11(
|
|
4000
4976
|
(id) => {
|
|
4001
4977
|
setValue(id);
|
|
4002
4978
|
},
|
|
4003
4979
|
[setValue]
|
|
4004
4980
|
);
|
|
4005
|
-
const handleKeyDown =
|
|
4981
|
+
const handleKeyDown = useCallback11(
|
|
4006
4982
|
(e) => {
|
|
4007
4983
|
onKeyDown?.(e);
|
|
4008
4984
|
if (e.defaultPrevented) return;
|
|
@@ -4082,7 +5058,7 @@ var Tree = forwardRef56(function Tree2({
|
|
|
4082
5058
|
toggle
|
|
4083
5059
|
]
|
|
4084
5060
|
);
|
|
4085
|
-
return /* @__PURE__ */
|
|
5061
|
+
return /* @__PURE__ */ jsx65(
|
|
4086
5062
|
"ul",
|
|
4087
5063
|
{
|
|
4088
5064
|
ref: setRefs,
|
|
@@ -4090,7 +5066,7 @@ var Tree = forwardRef56(function Tree2({
|
|
|
4090
5066
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
4091
5067
|
onKeyDown: handleKeyDown,
|
|
4092
5068
|
...props,
|
|
4093
|
-
children: items.map((item) => /* @__PURE__ */
|
|
5069
|
+
children: items.map((item) => /* @__PURE__ */ jsx65(
|
|
4094
5070
|
TreeItemRow,
|
|
4095
5071
|
{
|
|
4096
5072
|
item,
|
|
@@ -4125,8 +5101,8 @@ function TreeItemRow({
|
|
|
4125
5101
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
4126
5102
|
const isSelected = selected === item.id;
|
|
4127
5103
|
const isTabStop = tabStopId === item.id;
|
|
4128
|
-
return /* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
5104
|
+
return /* @__PURE__ */ jsxs55("li", { role: "none", children: [
|
|
5105
|
+
/* @__PURE__ */ jsxs55(
|
|
4130
5106
|
"div",
|
|
4131
5107
|
{
|
|
4132
5108
|
role: "treeitem",
|
|
@@ -4149,14 +5125,14 @@ function TreeItemRow({
|
|
|
4149
5125
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
4150
5126
|
),
|
|
4151
5127
|
children: [
|
|
4152
|
-
/* @__PURE__ */
|
|
4153
|
-
item.icon && /* @__PURE__ */
|
|
4154
|
-
/* @__PURE__ */
|
|
5128
|
+
/* @__PURE__ */ jsx65("span", { "aria-hidden": true, className: "text-text-dim grid w-3 place-items-center text-[10px]", children: hasChildren ? isExpanded ? "\u25BE" : "\u25B8" : "" }),
|
|
5129
|
+
item.icon && /* @__PURE__ */ jsx65("span", { "aria-hidden": true, className: "text-[12px] opacity-80", children: item.icon }),
|
|
5130
|
+
/* @__PURE__ */ jsx65("span", { className: "flex-1 truncate", children: item.label }),
|
|
4155
5131
|
item.trailing
|
|
4156
5132
|
]
|
|
4157
5133
|
}
|
|
4158
5134
|
),
|
|
4159
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
5135
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx65("ul", { role: "group", className: "flex flex-col gap-px", children: (item.children ?? []).map((child) => /* @__PURE__ */ jsx65(
|
|
4160
5136
|
TreeItemRow,
|
|
4161
5137
|
{
|
|
4162
5138
|
item: child,
|
|
@@ -4172,7 +5148,83 @@ function TreeItemRow({
|
|
|
4172
5148
|
)) })
|
|
4173
5149
|
] });
|
|
4174
5150
|
}
|
|
5151
|
+
|
|
5152
|
+
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
5153
|
+
import * as RadixDialog5 from "@radix-ui/react-dialog";
|
|
5154
|
+
import { forwardRef as forwardRef64, useCallback as useCallback12, useMemo as useMemo7, useState as useState16 } from "react";
|
|
5155
|
+
import { jsx as jsx66, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
5156
|
+
var WizardDialog = forwardRef64(function WizardDialog2({
|
|
5157
|
+
open,
|
|
5158
|
+
defaultOpen,
|
|
5159
|
+
onOpenChange,
|
|
5160
|
+
steps,
|
|
5161
|
+
initialStep = 0,
|
|
5162
|
+
onComplete,
|
|
5163
|
+
title,
|
|
5164
|
+
description,
|
|
5165
|
+
width = 560,
|
|
5166
|
+
nextLabel = "Next",
|
|
5167
|
+
completeLabel = "Done",
|
|
5168
|
+
backLabel = "Back",
|
|
5169
|
+
cancelLabel,
|
|
5170
|
+
onCancel
|
|
5171
|
+
}, ref) {
|
|
5172
|
+
const [current, setCurrent] = useState16(initialStep);
|
|
5173
|
+
const total = steps.length;
|
|
5174
|
+
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
5175
|
+
const step = steps[safeCurrent];
|
|
5176
|
+
const goTo = useCallback12(
|
|
5177
|
+
(index) => {
|
|
5178
|
+
setCurrent(Math.min(Math.max(0, index), Math.max(0, total - 1)));
|
|
5179
|
+
},
|
|
5180
|
+
[total]
|
|
5181
|
+
);
|
|
5182
|
+
const goNext = useCallback12(() => setCurrent((c) => Math.min(c + 1, total - 1)), [total]);
|
|
5183
|
+
const goBack = useCallback12(() => setCurrent((c) => Math.max(c - 1, 0)), []);
|
|
5184
|
+
const ctx = useMemo7(
|
|
5185
|
+
() => ({
|
|
5186
|
+
current: safeCurrent,
|
|
5187
|
+
total,
|
|
5188
|
+
goNext,
|
|
5189
|
+
goBack,
|
|
5190
|
+
goTo,
|
|
5191
|
+
isFirst: safeCurrent === 0,
|
|
5192
|
+
isLast: safeCurrent >= total - 1
|
|
5193
|
+
}),
|
|
5194
|
+
[safeCurrent, total, goNext, goBack, goTo]
|
|
5195
|
+
);
|
|
5196
|
+
const stepperSteps = useMemo7(() => steps.map((s) => ({ id: s.id, label: s.label })), [steps]);
|
|
5197
|
+
if (!step) return null;
|
|
5198
|
+
const canAdvance = step.canAdvance ? step.canAdvance(ctx) : true;
|
|
5199
|
+
const body = typeof step.content === "function" ? step.content(ctx) : step.content;
|
|
5200
|
+
const handlePrimary = () => {
|
|
5201
|
+
if (ctx.isLast) {
|
|
5202
|
+
onComplete?.();
|
|
5203
|
+
} else {
|
|
5204
|
+
goNext();
|
|
5205
|
+
}
|
|
5206
|
+
};
|
|
5207
|
+
return /* @__PURE__ */ jsx66(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ jsxs56(DialogContent, { ref, width, children: [
|
|
5208
|
+
title && /* @__PURE__ */ jsx66(WizardTitle, { children: title }),
|
|
5209
|
+
description && /* @__PURE__ */ jsx66(WizardDescription, { children: description }),
|
|
5210
|
+
/* @__PURE__ */ jsx66("div", { className: "mb-5", children: /* @__PURE__ */ jsx66(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
5211
|
+
/* @__PURE__ */ jsx66("div", { className: "mb-5", children: body }),
|
|
5212
|
+
/* @__PURE__ */ jsxs56("div", { className: "flex justify-end gap-2", children: [
|
|
5213
|
+
cancelLabel && /* @__PURE__ */ jsx66(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
5214
|
+
/* @__PURE__ */ jsx66(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
5215
|
+
/* @__PURE__ */ jsx66(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
5216
|
+
] })
|
|
5217
|
+
] }) });
|
|
5218
|
+
});
|
|
5219
|
+
function WizardTitle({ children }) {
|
|
5220
|
+
return /* @__PURE__ */ jsx66(RadixDialog5.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
5221
|
+
}
|
|
5222
|
+
function WizardDescription({ children }) {
|
|
5223
|
+
return /* @__PURE__ */ jsx66(RadixDialog5.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
5224
|
+
}
|
|
5225
|
+
WizardDialog.displayName = "WizardDialog";
|
|
4175
5226
|
export {
|
|
5227
|
+
ActivityTimeline,
|
|
4176
5228
|
Alert,
|
|
4177
5229
|
AlertDialog,
|
|
4178
5230
|
AlertDialogAction,
|
|
@@ -4220,10 +5272,13 @@ export {
|
|
|
4220
5272
|
DropdownMenuRadioGroup,
|
|
4221
5273
|
DropdownMenuRoot,
|
|
4222
5274
|
DropdownMenuTrigger,
|
|
5275
|
+
Dropzone,
|
|
4223
5276
|
EmptyState,
|
|
4224
5277
|
FAB,
|
|
4225
5278
|
Field,
|
|
4226
5279
|
FileChip,
|
|
5280
|
+
FilterPanel,
|
|
5281
|
+
HealthScore,
|
|
4227
5282
|
HoverCard,
|
|
4228
5283
|
HoverCardContent,
|
|
4229
5284
|
HoverCardPortal,
|
|
@@ -4241,9 +5296,11 @@ export {
|
|
|
4241
5296
|
MenubarMenu,
|
|
4242
5297
|
MenubarSeparator,
|
|
4243
5298
|
MenubarTrigger,
|
|
5299
|
+
NavBar,
|
|
4244
5300
|
NavItem,
|
|
4245
5301
|
NavSection,
|
|
4246
5302
|
OTP,
|
|
5303
|
+
OnboardingChecklist,
|
|
4247
5304
|
Pagination,
|
|
4248
5305
|
Popover,
|
|
4249
5306
|
PopoverAnchor,
|
|
@@ -4257,6 +5314,7 @@ export {
|
|
|
4257
5314
|
RadialProgress,
|
|
4258
5315
|
Radio,
|
|
4259
5316
|
RadioGroup,
|
|
5317
|
+
ScrollArea,
|
|
4260
5318
|
SearchInput,
|
|
4261
5319
|
Select,
|
|
4262
5320
|
SelectContent,
|
|
@@ -4297,11 +5355,13 @@ export {
|
|
|
4297
5355
|
TooltipTrigger,
|
|
4298
5356
|
Topbar,
|
|
4299
5357
|
Tree,
|
|
5358
|
+
WizardDialog,
|
|
4300
5359
|
badgeStyles,
|
|
4301
5360
|
buttonStyles,
|
|
4302
5361
|
cardStyles,
|
|
4303
5362
|
cn,
|
|
4304
5363
|
filterCommandItems,
|
|
5364
|
+
formatRelative,
|
|
4305
5365
|
iconButtonStyles,
|
|
4306
5366
|
useControllableState,
|
|
4307
5367
|
useDisclosure,
|