@luxfi/ui 7.4.11 → 7.4.13
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/alert.cjs +68 -46
- package/dist/alert.js +69 -46
- package/dist/avatar.cjs +49 -47
- package/dist/avatar.js +52 -49
- package/dist/badge.cjs +82 -49
- package/dist/badge.js +83 -50
- package/dist/checkbox.cjs +42 -75
- package/dist/checkbox.js +43 -76
- package/dist/chrome.cjs +3 -7
- package/dist/chrome.js +3 -7
- package/dist/close-button.cjs +3 -7
- package/dist/close-button.js +3 -7
- package/dist/dialog.cjs +3 -7
- package/dist/dialog.js +3 -7
- package/dist/drawer.cjs +3 -7
- package/dist/drawer.js +3 -7
- package/dist/empty-state.cjs +13 -13
- package/dist/empty-state.js +13 -13
- package/dist/expiration-selector.cjs +58 -63
- package/dist/expiration-selector.js +58 -63
- package/dist/greeks-display.cjs +48 -39
- package/dist/greeks-display.js +48 -39
- package/dist/index.cjs +1053 -888
- package/dist/index.js +1054 -889
- package/dist/input-group.cjs +36 -19
- package/dist/input-group.js +37 -19
- package/dist/option-chain.cjs +89 -67
- package/dist/option-chain.js +89 -67
- package/dist/option-position.cjs +88 -85
- package/dist/option-position.js +88 -85
- package/dist/pin-input.cjs +30 -29
- package/dist/pin-input.js +30 -29
- package/dist/pnl-diagram.cjs +20 -20
- package/dist/pnl-diagram.js +20 -20
- package/dist/popover.cjs +3 -7
- package/dist/popover.js +3 -7
- package/dist/progress-circle.cjs +40 -22
- package/dist/progress-circle.d.cts +5 -5
- package/dist/progress-circle.d.ts +5 -5
- package/dist/progress-circle.js +41 -22
- package/dist/progress.cjs +15 -22
- package/dist/progress.d.cts +6 -6
- package/dist/progress.d.ts +6 -6
- package/dist/progress.js +15 -22
- package/dist/radio.cjs +35 -68
- package/dist/radio.d.cts +18 -18
- package/dist/radio.d.ts +18 -18
- package/dist/radio.js +36 -69
- package/dist/rating.cjs +15 -17
- package/dist/rating.js +15 -17
- package/dist/slider.cjs +33 -50
- package/dist/slider.js +34 -51
- package/dist/strategy-builder.cjs +194 -115
- package/dist/strategy-builder.js +194 -115
- package/dist/switch.cjs +48 -55
- package/dist/switch.js +49 -56
- package/dist/tag.cjs +115 -69
- package/dist/tag.js +116 -69
- package/dist/tooltip.cjs +28 -17
- package/dist/tooltip.js +30 -18
- package/package.json +1 -1
- package/src/alert.tsx +78 -45
- package/src/avatar.tsx +54 -38
- package/src/badge.tsx +65 -44
- package/src/checkbox.tsx +70 -89
- package/src/close-button.tsx +3 -8
- package/src/empty-state.tsx +21 -17
- package/src/expiration-selector.tsx +84 -66
- package/src/greeks-display.tsx +59 -51
- package/src/input-group.tsx +38 -24
- package/src/option-chain.tsx +154 -104
- package/src/option-position.tsx +143 -114
- package/src/pin-input.tsx +37 -29
- package/src/pnl-diagram.tsx +36 -28
- package/src/progress-circle.tsx +52 -28
- package/src/progress.tsx +17 -21
- package/src/radio.tsx +56 -76
- package/src/rating.tsx +22 -20
- package/src/slider.tsx +43 -45
- package/src/strategy-builder.tsx +260 -162
- package/src/switch.tsx +63 -64
- package/src/tag.tsx +89 -51
- package/src/tooltip.tsx +21 -13
- package/tokens.css +18 -0
package/dist/index.cjs
CHANGED
|
@@ -563,23 +563,19 @@ var CloseButtonFrame = gui.styled(gui.View, {
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
});
|
|
566
|
-
var CLOSE_BUTTON_CLASSES = [
|
|
567
|
-
"text-[var(--closeButton-fg,currentColor)]",
|
|
568
|
-
"hover:text-[var(--hover-color,currentColor)]",
|
|
569
|
-
"disabled:opacity-40"
|
|
570
|
-
].join(" ");
|
|
571
566
|
var CloseButton = React32__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
572
567
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
573
568
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
574
569
|
CloseButtonFrame,
|
|
575
570
|
{
|
|
576
571
|
ref,
|
|
577
|
-
className
|
|
572
|
+
className,
|
|
578
573
|
...rest,
|
|
579
574
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
575
|
"svg",
|
|
581
576
|
{
|
|
582
|
-
|
|
577
|
+
width: 20,
|
|
578
|
+
height: 20,
|
|
583
579
|
viewBox: "0 0 20 20",
|
|
584
580
|
fill: "none",
|
|
585
581
|
"aria-hidden": "true",
|
|
@@ -1477,22 +1473,30 @@ function LoadingBar({ loading = true }) {
|
|
|
1477
1473
|
if (!loading) return null;
|
|
1478
1474
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lux-loading", role: "progressbar", "aria-busy": "true", "aria-label": "Loading" });
|
|
1479
1475
|
}
|
|
1480
|
-
var IndicatorIcon2 = (
|
|
1481
|
-
var ALERT_BASE =
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1476
|
+
var IndicatorIcon2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm.75-11.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 10a.75.75 0 011.5 0v3a.75.75 0 01-1.5 0v-3z" }) });
|
|
1477
|
+
var ALERT_BASE = {
|
|
1478
|
+
width: "100%",
|
|
1479
|
+
position: "relative",
|
|
1480
|
+
alignItems: "flex-start",
|
|
1481
|
+
borderRadius: 4,
|
|
1482
|
+
gap: 8,
|
|
1483
|
+
paddingVertical: 8
|
|
1488
1484
|
};
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
|
|
1485
|
+
var ALERT_FG = "var(--color-alert-fg)";
|
|
1486
|
+
var STATUS_BG = {
|
|
1487
|
+
info: "var(--color-alert-bg-info)",
|
|
1488
|
+
warning: "var(--color-alert-bg-warning)",
|
|
1489
|
+
warning_table: "var(--color-alert-bg-warning-table)",
|
|
1490
|
+
success: "var(--color-alert-bg-success)",
|
|
1491
|
+
error: "var(--color-alert-bg-error)"
|
|
1492
|
+
};
|
|
1493
|
+
var SIZE = {
|
|
1494
|
+
sm: { paddingHorizontal: 8, fontSize: 12 },
|
|
1495
|
+
md: { paddingHorizontal: 12, fontSize: 16 }
|
|
1492
1496
|
};
|
|
1493
|
-
var
|
|
1494
|
-
sm:
|
|
1495
|
-
md:
|
|
1497
|
+
var INDICATOR_SIZE = {
|
|
1498
|
+
sm: { marginVertical: 0 },
|
|
1499
|
+
md: { marginVertical: 2 }
|
|
1496
1500
|
};
|
|
1497
1501
|
var Alert = React32__namespace.forwardRef(
|
|
1498
1502
|
function Alert2(props, ref) {
|
|
@@ -1521,7 +1525,8 @@ var Alert = React32__namespace.forwardRef(
|
|
|
1521
1525
|
const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
1522
1526
|
const [isOpen, setIsOpen] = React32__namespace.useState(true);
|
|
1523
1527
|
const resolvedSize = size ?? "md";
|
|
1524
|
-
const
|
|
1528
|
+
const fontSize = SIZE[resolvedSize].fontSize;
|
|
1529
|
+
const defaultIcon = /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon2, {});
|
|
1525
1530
|
const iconElement = (() => {
|
|
1526
1531
|
if (startElement !== void 0) {
|
|
1527
1532
|
return startElement;
|
|
@@ -1529,10 +1534,20 @@ var Alert = React32__namespace.forwardRef(
|
|
|
1529
1534
|
if (!showIcon && icon === void 0) {
|
|
1530
1535
|
return null;
|
|
1531
1536
|
}
|
|
1532
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1537
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1538
|
+
gui.XStack,
|
|
1539
|
+
{
|
|
1540
|
+
alignItems: "center",
|
|
1541
|
+
justifyContent: "center",
|
|
1542
|
+
flexShrink: 0,
|
|
1543
|
+
width: 20,
|
|
1544
|
+
height: 20,
|
|
1545
|
+
...INDICATOR_SIZE[resolvedSize],
|
|
1546
|
+
className: "lux-icon",
|
|
1547
|
+
style: { color: ALERT_FG },
|
|
1548
|
+
children: icon || defaultIcon
|
|
1549
|
+
}
|
|
1550
|
+
);
|
|
1536
1551
|
})();
|
|
1537
1552
|
const handleClose = React32__namespace.useCallback(() => {
|
|
1538
1553
|
setIsOpen(false);
|
|
@@ -1561,52 +1576,57 @@ var Alert = React32__namespace.forwardRef(
|
|
|
1561
1576
|
...descRowGap !== void 0 ? { rowGap: typeof descRowGap === "number" ? `${descRowGap * 4}px` : descRowGap } : {},
|
|
1562
1577
|
...descColumnGap !== void 0 ? { columnGap: typeof descColumnGap === "number" ? `${descColumnGap * 4}px` : descColumnGap } : {}
|
|
1563
1578
|
};
|
|
1579
|
+
const ContentFrame = inline ? gui.XStack : gui.YStack;
|
|
1564
1580
|
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1565
|
-
|
|
1581
|
+
gui.XStack,
|
|
1566
1582
|
{
|
|
1567
1583
|
ref,
|
|
1568
|
-
|
|
1584
|
+
...ALERT_BASE,
|
|
1585
|
+
paddingHorizontal: SIZE[resolvedSize].paddingHorizontal,
|
|
1586
|
+
backgroundColor: STATUS_BG[status],
|
|
1587
|
+
className,
|
|
1569
1588
|
style: alertStyle,
|
|
1570
1589
|
...alertRest,
|
|
1571
1590
|
children: [
|
|
1572
1591
|
iconElement,
|
|
1573
|
-
children ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1574
|
-
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1592
|
+
children ? /* @__PURE__ */ jsxRuntime.jsxs(ContentFrame, { flex: 1, alignItems: inline ? "center" : void 0, children: [
|
|
1593
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontWeight: "600", fontSize, color: ALERT_FG, children: title }),
|
|
1575
1594
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1576
|
-
|
|
1595
|
+
gui.XStack,
|
|
1577
1596
|
{
|
|
1578
|
-
|
|
1597
|
+
flexWrap: "wrap",
|
|
1598
|
+
className: descClassName,
|
|
1579
1599
|
style: Object.keys(descStyle).length > 0 ? descStyle : void 0,
|
|
1580
1600
|
...descRest,
|
|
1581
|
-
children
|
|
1601
|
+
children: ink(children, void 0, { fontSize, color: ALERT_FG })
|
|
1582
1602
|
}
|
|
1583
1603
|
)
|
|
1584
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1604
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontWeight: "600", fontSize, color: ALERT_FG, children: title }),
|
|
1585
1605
|
endElement,
|
|
1586
|
-
closable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1587
|
-
CloseButton,
|
|
1588
|
-
{
|
|
1589
|
-
className: "relative self-start",
|
|
1590
|
-
onClick: handleClose
|
|
1591
|
-
}
|
|
1592
|
-
)
|
|
1606
|
+
closable && /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "relative", alignSelf: "flex-start", children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: handleClose }) })
|
|
1593
1607
|
]
|
|
1594
1608
|
}
|
|
1595
1609
|
) });
|
|
1596
1610
|
}
|
|
1597
1611
|
);
|
|
1598
|
-
var
|
|
1599
|
-
xs:
|
|
1600
|
-
sm:
|
|
1601
|
-
md:
|
|
1602
|
-
lg:
|
|
1603
|
-
xl:
|
|
1604
|
-
"2xl":
|
|
1612
|
+
var SIZE2 = {
|
|
1613
|
+
xs: { width: 24, height: 24, fontSize: 10 },
|
|
1614
|
+
sm: { width: 32, height: 32, fontSize: 12 },
|
|
1615
|
+
md: { width: 40, height: 40, fontSize: 14 },
|
|
1616
|
+
lg: { width: 48, height: 48, fontSize: 16 },
|
|
1617
|
+
xl: { width: 64, height: 64, fontSize: 18 },
|
|
1618
|
+
"2xl": { width: 80, height: 80, fontSize: 20 }
|
|
1605
1619
|
};
|
|
1606
|
-
var
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1620
|
+
var RING = "var(--color-bg-body)";
|
|
1621
|
+
var VARIANT = {
|
|
1622
|
+
solid: { backgroundColor: "var(--color-gray-500)", color: "var(--color-white)" },
|
|
1623
|
+
subtle: { backgroundColor: "var(--color-badge-gray-bg)", color: "var(--color-badge-gray-fg)" },
|
|
1624
|
+
outline: {
|
|
1625
|
+
borderWidth: 2,
|
|
1626
|
+
borderColor: "var(--color-input-border)",
|
|
1627
|
+
backgroundColor: "transparent",
|
|
1628
|
+
color: "var(--color-text-secondary)"
|
|
1629
|
+
}
|
|
1610
1630
|
};
|
|
1611
1631
|
var DEFAULT_SIZE = "md";
|
|
1612
1632
|
var DEFAULT_VARIANT = "subtle";
|
|
@@ -1625,7 +1645,6 @@ var Avatar = React32__namespace.forwardRef(
|
|
|
1625
1645
|
icon,
|
|
1626
1646
|
fallback,
|
|
1627
1647
|
children,
|
|
1628
|
-
className,
|
|
1629
1648
|
size: sizeProp,
|
|
1630
1649
|
variant: variantProp,
|
|
1631
1650
|
borderless,
|
|
@@ -1638,21 +1657,26 @@ var Avatar = React32__namespace.forwardRef(
|
|
|
1638
1657
|
gui.Avatar,
|
|
1639
1658
|
{
|
|
1640
1659
|
ref,
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1660
|
+
position: "relative",
|
|
1661
|
+
display: "inline-flex",
|
|
1662
|
+
flexShrink: 0,
|
|
1663
|
+
alignItems: "center",
|
|
1664
|
+
justifyContent: "center",
|
|
1665
|
+
overflow: "hidden",
|
|
1666
|
+
borderRadius: 9999,
|
|
1667
|
+
...SIZE2[size],
|
|
1668
|
+
...VARIANT[variant],
|
|
1669
|
+
boxShadow: isBorderless ? void 0 : `0 0 0 2px ${RING}`,
|
|
1649
1670
|
...rest,
|
|
1650
1671
|
children: [
|
|
1651
1672
|
/* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { name, icon, children: fallback }),
|
|
1652
1673
|
src != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
1674
|
gui.Avatar.Image,
|
|
1654
1675
|
{
|
|
1655
|
-
|
|
1676
|
+
width: "100%",
|
|
1677
|
+
height: "100%",
|
|
1678
|
+
borderRadius: 9999,
|
|
1679
|
+
objectFit: "cover",
|
|
1656
1680
|
src,
|
|
1657
1681
|
srcSet,
|
|
1658
1682
|
loading,
|
|
@@ -1667,22 +1691,18 @@ var Avatar = React32__namespace.forwardRef(
|
|
|
1667
1691
|
);
|
|
1668
1692
|
var AvatarFallback = React32__namespace.forwardRef(
|
|
1669
1693
|
function AvatarFallback2(props, ref) {
|
|
1670
|
-
const { name, icon, children,
|
|
1671
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1694
|
+
const { name, icon, children, ...rest } = props;
|
|
1695
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1672
1696
|
gui.Avatar.Fallback,
|
|
1673
1697
|
{
|
|
1674
1698
|
ref,
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1699
|
+
display: "flex",
|
|
1700
|
+
width: "100%",
|
|
1701
|
+
height: "100%",
|
|
1702
|
+
alignItems: "center",
|
|
1703
|
+
justifyContent: "center",
|
|
1680
1704
|
...rest,
|
|
1681
|
-
children:
|
|
1682
|
-
children,
|
|
1683
|
-
name != null && children == null && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: getInitials(name) }),
|
|
1684
|
-
name == null && children == null && icon
|
|
1685
|
-
]
|
|
1705
|
+
children: ink(children ?? (name != null ? getInitials(name) : icon), void 0, { fontWeight: "500" })
|
|
1686
1706
|
}
|
|
1687
1707
|
);
|
|
1688
1708
|
}
|
|
@@ -1695,19 +1715,12 @@ function getInitials(name) {
|
|
|
1695
1715
|
}
|
|
1696
1716
|
var AvatarGroup = React32__namespace.forwardRef(
|
|
1697
1717
|
function AvatarGroup2(props, ref) {
|
|
1698
|
-
const { size, variant, borderless,
|
|
1718
|
+
const { size, variant, borderless, children, ...rest } = props;
|
|
1699
1719
|
const contextValue = React32__namespace.useMemo(
|
|
1700
1720
|
() => ({ size, variant, borderless }),
|
|
1701
1721
|
[size, variant, borderless]
|
|
1702
1722
|
);
|
|
1703
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AvatarGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1704
|
-
"div",
|
|
1705
|
-
{
|
|
1706
|
-
ref,
|
|
1707
|
-
className: cn("flex -space-x-3", className),
|
|
1708
|
-
...rest
|
|
1709
|
-
}
|
|
1710
|
-
) });
|
|
1723
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AvatarGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { ref, ...rest, children: React32__namespace.Children.map(children, (child, index) => index === 0 || !React32__namespace.isValidElement(child) ? child : React32__namespace.cloneElement(child, { marginLeft: -12 })) }) });
|
|
1711
1724
|
}
|
|
1712
1725
|
);
|
|
1713
1726
|
function mapPlacement(p) {
|
|
@@ -1801,14 +1814,21 @@ var Tooltip = React32__namespace.forwardRef(
|
|
|
1801
1814
|
{
|
|
1802
1815
|
ref,
|
|
1803
1816
|
unstyled: true,
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1817
|
+
zIndex: 9999,
|
|
1818
|
+
overflow: "hidden",
|
|
1819
|
+
borderRadius: 8,
|
|
1820
|
+
paddingHorizontal: 12,
|
|
1821
|
+
paddingVertical: 8,
|
|
1822
|
+
maxWidth: isPopover ? 384 : 320,
|
|
1823
|
+
backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)",
|
|
1824
|
+
transition: "quick",
|
|
1825
|
+
enterStyle: { opacity: 0, scale: 0.95 },
|
|
1826
|
+
exitStyle: { opacity: 0, scale: 0.95 },
|
|
1827
|
+
...isPopover ? {
|
|
1828
|
+
borderWidth: 1,
|
|
1829
|
+
borderColor: "var(--color-border-divider)",
|
|
1830
|
+
shadowColor: "var(--shadow-popover)"
|
|
1831
|
+
} : {},
|
|
1812
1832
|
onClick: interactive ? handleContentClick : void 0,
|
|
1813
1833
|
...selected ? { "data-selected": true } : {},
|
|
1814
1834
|
...contentProps,
|
|
@@ -1817,12 +1837,13 @@ var Tooltip = React32__namespace.forwardRef(
|
|
|
1817
1837
|
gui.Tooltip.Arrow,
|
|
1818
1838
|
{
|
|
1819
1839
|
unstyled: true,
|
|
1820
|
-
|
|
1821
|
-
isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
|
|
1822
|
-
)
|
|
1840
|
+
backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)"
|
|
1823
1841
|
}
|
|
1824
1842
|
),
|
|
1825
|
-
content
|
|
1843
|
+
ink(content, void 0, {
|
|
1844
|
+
fontSize: 14,
|
|
1845
|
+
color: isPopover ? "var(--color-text-primary)" : "var(--color-tooltip-fg)"
|
|
1846
|
+
})
|
|
1826
1847
|
]
|
|
1827
1848
|
}
|
|
1828
1849
|
)
|
|
@@ -1834,35 +1855,39 @@ var Tooltip = React32__namespace.forwardRef(
|
|
|
1834
1855
|
function TruncatedTextTooltip({ label, children }) {
|
|
1835
1856
|
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
1836
1857
|
}
|
|
1837
|
-
var
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
lg: "text-sm px-2 py-1 min-h-7 font-semibold"
|
|
1858
|
+
var SIZE3 = {
|
|
1859
|
+
sm: { padding: 4, height: 18, minHeight: 18 },
|
|
1860
|
+
md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24 },
|
|
1861
|
+
lg: { paddingHorizontal: 8, paddingVertical: 4, minHeight: 28 }
|
|
1842
1862
|
};
|
|
1843
|
-
var
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1863
|
+
var SIZE_TEXT = {
|
|
1864
|
+
sm: { fontSize: 12, fontWeight: "500" },
|
|
1865
|
+
md: { fontSize: 14, fontWeight: "500" },
|
|
1866
|
+
lg: { fontSize: 14, fontWeight: "600" }
|
|
1867
|
+
};
|
|
1868
|
+
var COLOR_PALETTE = {
|
|
1869
|
+
gray: { bg: "var(--color-badge-gray-bg)", fg: "var(--color-badge-gray-fg)" },
|
|
1870
|
+
green: { bg: "var(--color-badge-green-bg)", fg: "var(--color-badge-green-fg)" },
|
|
1871
|
+
red: { bg: "var(--color-badge-red-bg)", fg: "var(--color-badge-red-fg)" },
|
|
1872
|
+
purple: { bg: "var(--color-badge-purple-bg)", fg: "var(--color-badge-purple-fg)" },
|
|
1873
|
+
orange: { bg: "var(--color-badge-orange-bg)", fg: "var(--color-badge-orange-fg)" },
|
|
1874
|
+
blue: { bg: "var(--color-badge-blue-bg)", fg: "var(--color-badge-blue-fg)" },
|
|
1875
|
+
yellow: { bg: "var(--color-badge-yellow-bg)", fg: "var(--color-badge-yellow-fg)" },
|
|
1876
|
+
teal: { bg: "var(--color-badge-teal-bg)", fg: "var(--color-badge-teal-fg)" },
|
|
1877
|
+
cyan: { bg: "var(--color-badge-cyan-bg)", fg: "var(--color-badge-cyan-fg)" },
|
|
1878
|
+
pink: { bg: "var(--color-badge-pink-bg)", fg: "var(--color-badge-pink-fg)" },
|
|
1879
|
+
purple_alt: { bg: "var(--color-badge-purple-alt-bg)", fg: "var(--color-badge-purple-alt-fg)" },
|
|
1880
|
+
blue_alt: { bg: "var(--color-badge-blue-alt-bg)", fg: "var(--color-badge-blue-alt-fg)" },
|
|
1881
|
+
bright_gray: { bg: "var(--color-badge-bright-gray-bg)", fg: "var(--color-badge-bright-gray-fg)" },
|
|
1882
|
+
bright_green: { bg: "var(--color-badge-bright-green-bg)", fg: "var(--color-badge-bright-green-fg)" },
|
|
1883
|
+
bright_red: { bg: "var(--color-badge-bright-red-bg)", fg: "var(--color-badge-bright-red-fg)" },
|
|
1884
|
+
bright_blue: { bg: "var(--color-badge-bright-blue-bg)", fg: "var(--color-badge-bright-blue-fg)" },
|
|
1885
|
+
bright_yellow: { bg: "var(--color-badge-bright-yellow-bg)", fg: "var(--color-badge-bright-yellow-fg)" },
|
|
1886
|
+
bright_teal: { bg: "var(--color-badge-bright-teal-bg)", fg: "var(--color-badge-bright-teal-fg)" },
|
|
1887
|
+
bright_cyan: { bg: "var(--color-badge-bright-cyan-bg)", fg: "var(--color-badge-bright-cyan-fg)" },
|
|
1888
|
+
bright_orange: { bg: "var(--color-badge-bright-orange-bg)", fg: "var(--color-badge-bright-orange-fg)" },
|
|
1889
|
+
bright_purple: { bg: "var(--color-badge-bright-purple-bg)", fg: "var(--color-badge-bright-purple-fg)" },
|
|
1890
|
+
bright_pink: { bg: "var(--color-badge-bright-pink-bg)", fg: "var(--color-badge-bright-pink-fg)" }
|
|
1866
1891
|
};
|
|
1867
1892
|
var S2 = 4;
|
|
1868
1893
|
var Badge = React32__namespace.default.forwardRef(
|
|
@@ -1897,18 +1922,31 @@ var Badge = React32__namespace.default.forwardRef(
|
|
|
1897
1922
|
}
|
|
1898
1923
|
if (_mr !== void 0) shimStyle.marginRight = typeof _mr === "number" ? `${_mr * S2}px` : _mr;
|
|
1899
1924
|
const badgeStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
1900
|
-
const
|
|
1925
|
+
const palette = COLOR_PALETTE[colorPalette];
|
|
1926
|
+
const child = children ? (
|
|
1927
|
+
// `ellipsis` is gui Text's own built-in variant for single-line
|
|
1928
|
+
// truncation — it expands to the same overflow/text-overflow/
|
|
1929
|
+
// white-space/max-width rule Tailwind's `text-ellipsis` did, but
|
|
1930
|
+
// through the component's own variants (guaranteed to compile),
|
|
1931
|
+
// rather than naming each longhand as a separate style prop.
|
|
1932
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { ellipsis: true, ...SIZE_TEXT[size], color: palette.fg, children })
|
|
1933
|
+
) : null;
|
|
1901
1934
|
const childrenElement = truncated ? /* @__PURE__ */ jsxRuntime.jsx(TruncatedTextTooltip, { label: children, children: child }) : child;
|
|
1902
1935
|
const badgeElement = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1903
|
-
|
|
1936
|
+
gui.XStack,
|
|
1904
1937
|
{
|
|
1905
1938
|
ref,
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1939
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
1940
|
+
display: "inline-flex",
|
|
1941
|
+
alignItems: "center",
|
|
1942
|
+
alignSelf: "flex-start",
|
|
1943
|
+
borderRadius: 2,
|
|
1944
|
+
gap: 4,
|
|
1945
|
+
maxWidth: "100%",
|
|
1946
|
+
userSelect: "text",
|
|
1947
|
+
...SIZE3[size],
|
|
1948
|
+
backgroundColor: palette.bg,
|
|
1949
|
+
className,
|
|
1912
1950
|
style: badgeStyle,
|
|
1913
1951
|
...rest,
|
|
1914
1952
|
children: [
|
|
@@ -1982,7 +2020,7 @@ var ButtonFrame = gui.styled(gui.View, {
|
|
|
1982
2020
|
size: "md"
|
|
1983
2021
|
}
|
|
1984
2022
|
});
|
|
1985
|
-
var
|
|
2023
|
+
var VARIANT_CLASSES = {
|
|
1986
2024
|
solid: [
|
|
1987
2025
|
"bg-[var(--color-button-solid-bg)] text-[var(--color-button-solid-text)]",
|
|
1988
2026
|
"hover:bg-[var(--color-hover)]",
|
|
@@ -2082,7 +2120,7 @@ var VARIANT_CLASSES2 = {
|
|
|
2082
2120
|
"data-[selected]:hover:text-[var(--color-selected-control-text)] data-[selected]:hover:border-transparent"
|
|
2083
2121
|
].join(" ")
|
|
2084
2122
|
};
|
|
2085
|
-
var
|
|
2123
|
+
var BASE_CLASSES = "font-semibold whitespace-nowrap transition-colors duration-150";
|
|
2086
2124
|
var SP = 4;
|
|
2087
2125
|
function buildShimStyle(props) {
|
|
2088
2126
|
const s = { ...props.style };
|
|
@@ -2183,8 +2221,8 @@ var Button = React32__namespace.forwardRef(
|
|
|
2183
2221
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
|
|
2184
2222
|
loadingText != null && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: 8 }, children: loadingText })
|
|
2185
2223
|
] }) : children;
|
|
2186
|
-
const variantClass =
|
|
2187
|
-
const combinedClassName = [
|
|
2224
|
+
const variantClass = VARIANT_CLASSES[variant] ?? VARIANT_CLASSES.solid;
|
|
2225
|
+
const combinedClassName = [BASE_CLASSES, variantClass, className].filter(Boolean).join(" ");
|
|
2188
2226
|
const button = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2189
2227
|
ButtonFrame,
|
|
2190
2228
|
{
|
|
@@ -2205,7 +2243,7 @@ var Button = React32__namespace.forwardRef(
|
|
|
2205
2243
|
return button;
|
|
2206
2244
|
}
|
|
2207
2245
|
);
|
|
2208
|
-
var
|
|
2246
|
+
var SIZE_CLASSES = {
|
|
2209
2247
|
"2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
|
|
2210
2248
|
xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
|
|
2211
2249
|
sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
|
|
@@ -2214,7 +2252,7 @@ var SIZE_CLASSES4 = {
|
|
|
2214
2252
|
function buttonVariants(opts) {
|
|
2215
2253
|
const v = opts?.variant ?? "solid";
|
|
2216
2254
|
const s = opts?.size ?? "md";
|
|
2217
|
-
return [
|
|
2255
|
+
return [BASE_CLASSES, VARIANT_CLASSES[v] ?? "", SIZE_CLASSES[s] ?? ""].filter(Boolean).join(" ");
|
|
2218
2256
|
}
|
|
2219
2257
|
var ButtonGroup = React32__namespace.forwardRef(
|
|
2220
2258
|
function ButtonGroup2(props, ref) {
|
|
@@ -2292,7 +2330,6 @@ var CheckboxGroupBase = React32__namespace.forwardRef(
|
|
|
2292
2330
|
onValueChange,
|
|
2293
2331
|
orientation = "vertical",
|
|
2294
2332
|
name: _name,
|
|
2295
|
-
className,
|
|
2296
2333
|
...rest
|
|
2297
2334
|
} = props;
|
|
2298
2335
|
const [uncontrolledValue, setUncontrolledValue] = React32__namespace.useState(defaultValue ?? []);
|
|
@@ -2315,15 +2352,13 @@ var CheckboxGroupBase = React32__namespace.forwardRef(
|
|
|
2315
2352
|
}, [isControlled, controlledValue]);
|
|
2316
2353
|
const ctx = React32__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
|
|
2317
2354
|
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2318
|
-
|
|
2355
|
+
gui.View,
|
|
2319
2356
|
{
|
|
2320
2357
|
ref,
|
|
2321
2358
|
role: "group",
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
className
|
|
2326
|
-
),
|
|
2359
|
+
display: "flex",
|
|
2360
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
2361
|
+
gap: orientation === "vertical" ? 12 : 32,
|
|
2327
2362
|
...rest,
|
|
2328
2363
|
children
|
|
2329
2364
|
}
|
|
@@ -2331,46 +2366,22 @@ var CheckboxGroupBase = React32__namespace.forwardRef(
|
|
|
2331
2366
|
}
|
|
2332
2367
|
);
|
|
2333
2368
|
var CheckboxGroup2 = CheckboxGroupBase;
|
|
2334
|
-
var
|
|
2335
|
-
sm: {
|
|
2336
|
-
|
|
2337
|
-
control: "h-3.5 w-3.5 rounded-sm",
|
|
2338
|
-
label: "text-xs",
|
|
2339
|
-
icon: "h-3 w-3"
|
|
2340
|
-
},
|
|
2341
|
-
md: {
|
|
2342
|
-
root: "gap-2",
|
|
2343
|
-
control: "h-4 w-4 rounded",
|
|
2344
|
-
label: "text-sm",
|
|
2345
|
-
icon: "h-3.5 w-3.5"
|
|
2346
|
-
}
|
|
2369
|
+
var SIZE4 = {
|
|
2370
|
+
sm: { rootGap: 6, control: 14, radius: 2, label: 12, icon: 12 },
|
|
2371
|
+
md: { rootGap: 8, control: 16, radius: 4, label: 14, icon: 14 }
|
|
2347
2372
|
};
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2373
|
+
var INK = "var(--color-text-primary)";
|
|
2374
|
+
var ON_INK = "var(--color-bg-body)";
|
|
2375
|
+
var RESTING_BORDER = "var(--color-input-border)";
|
|
2376
|
+
var OUTLINE = "var(--color-gray-500)";
|
|
2377
|
+
var CheckIcon = ({ size, color }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2378
|
+
"path",
|
|
2350
2379
|
{
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
fill: "none",
|
|
2354
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2355
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2356
|
-
"path",
|
|
2357
|
-
{
|
|
2358
|
-
d: "M10.59 0.59L4 7.17L1.41 4.59L0 6L4 10L12 2L10.59 0.59Z",
|
|
2359
|
-
fill: "currentColor"
|
|
2360
|
-
}
|
|
2361
|
-
)
|
|
2380
|
+
d: "M10.59 0.59L4 7.17L1.41 4.59L0 6L4 10L12 2L10.59 0.59Z",
|
|
2381
|
+
fill: color
|
|
2362
2382
|
}
|
|
2363
|
-
);
|
|
2364
|
-
var IndeterminateIcon = ({
|
|
2365
|
-
"svg",
|
|
2366
|
-
{
|
|
2367
|
-
className,
|
|
2368
|
-
viewBox: "0 0 12 2",
|
|
2369
|
-
fill: "none",
|
|
2370
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2371
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
|
|
2372
|
-
}
|
|
2373
|
-
);
|
|
2383
|
+
) });
|
|
2384
|
+
var IndeterminateIcon = ({ size, color }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 12 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0H12V2H0V0Z", fill: color }) });
|
|
2374
2385
|
var CheckboxBase = React32__namespace.forwardRef(
|
|
2375
2386
|
function Checkbox(props, ref) {
|
|
2376
2387
|
const {
|
|
@@ -2388,7 +2399,6 @@ var CheckboxBase = React32__namespace.forwardRef(
|
|
|
2388
2399
|
size = "md",
|
|
2389
2400
|
name,
|
|
2390
2401
|
required,
|
|
2391
|
-
className,
|
|
2392
2402
|
...rest
|
|
2393
2403
|
} = props;
|
|
2394
2404
|
const group = useCheckboxGroupContext();
|
|
@@ -2441,18 +2451,19 @@ var CheckboxBase = React32__namespace.forwardRef(
|
|
|
2441
2451
|
},
|
|
2442
2452
|
[readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
|
|
2443
2453
|
);
|
|
2444
|
-
const
|
|
2454
|
+
const s = SIZE4[size];
|
|
2455
|
+
const isChecked = checkedState !== false;
|
|
2445
2456
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2446
|
-
|
|
2457
|
+
gui.Label,
|
|
2447
2458
|
{
|
|
2448
2459
|
ref: rootRef,
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2460
|
+
unstyled: true,
|
|
2461
|
+
flexDirection: "row",
|
|
2462
|
+
alignItems: "center",
|
|
2463
|
+
gap: s.rootGap,
|
|
2464
|
+
cursor: disabled ? "not-allowed" : readOnly ? "default" : "pointer",
|
|
2465
|
+
userSelect: "none",
|
|
2466
|
+
opacity: disabled ? 0.5 : 1,
|
|
2456
2467
|
onChange,
|
|
2457
2468
|
"data-disabled": disabled || void 0,
|
|
2458
2469
|
"data-readonly": readOnly || void 0,
|
|
@@ -2468,26 +2479,25 @@ var CheckboxBase = React32__namespace.forwardRef(
|
|
|
2468
2479
|
name,
|
|
2469
2480
|
value,
|
|
2470
2481
|
required,
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(gui.Checkbox.Indicator, {
|
|
2482
|
+
flexShrink: 0,
|
|
2483
|
+
alignItems: "center",
|
|
2484
|
+
justifyContent: "center",
|
|
2485
|
+
width: s.control,
|
|
2486
|
+
height: s.control,
|
|
2487
|
+
borderRadius: s.radius,
|
|
2488
|
+
borderWidth: 2,
|
|
2489
|
+
borderColor: isChecked ? INK : RESTING_BORDER,
|
|
2490
|
+
backgroundColor: isChecked ? INK : "transparent",
|
|
2491
|
+
transition: "quicker",
|
|
2492
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE, outlineOffset: 2 },
|
|
2493
|
+
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(gui.Checkbox.Indicator, { alignItems: "center", justifyContent: "center", width: s.icon, height: s.icon, children: checkedState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, { size: s.icon, color: ON_INK }) : /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { size: s.icon, color: ON_INK }) })
|
|
2483
2494
|
}
|
|
2484
2495
|
),
|
|
2485
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2486
2497
|
"input",
|
|
2487
2498
|
{
|
|
2488
2499
|
ref: setHiddenInputRef,
|
|
2489
2500
|
type: "checkbox",
|
|
2490
|
-
className: "sr-only",
|
|
2491
2501
|
checked: checkedState === true,
|
|
2492
2502
|
disabled,
|
|
2493
2503
|
readOnly,
|
|
@@ -2498,8 +2508,8 @@ var CheckboxBase = React32__namespace.forwardRef(
|
|
|
2498
2508
|
onChange: NOOP,
|
|
2499
2509
|
...inputProps
|
|
2500
2510
|
}
|
|
2501
|
-
),
|
|
2502
|
-
children != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2511
|
+
) }),
|
|
2512
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: s.label, children })
|
|
2503
2513
|
]
|
|
2504
2514
|
}
|
|
2505
2515
|
);
|
|
@@ -2518,7 +2528,7 @@ function stripUtmParams(url) {
|
|
|
2518
2528
|
return url;
|
|
2519
2529
|
}
|
|
2520
2530
|
}
|
|
2521
|
-
var
|
|
2531
|
+
var VARIANT_CLASSES2 = {
|
|
2522
2532
|
primary: cn(
|
|
2523
2533
|
"text-[var(--color-link-primary)]",
|
|
2524
2534
|
"hover:no-underline hover:text-[var(--color-link-primary-hover)]",
|
|
@@ -2558,7 +2568,7 @@ var VARIANT_CLASSES3 = {
|
|
|
2558
2568
|
"data-[hover]:no-underline"
|
|
2559
2569
|
)
|
|
2560
2570
|
};
|
|
2561
|
-
var
|
|
2571
|
+
var BASE_CLASSES2 = "inline-flex items-center gap-0 cursor-pointer data-[disabled]:cursor-not-allowed";
|
|
2562
2572
|
var LinkExternalIcon = ({ color }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2563
2573
|
ArrowIcon,
|
|
2564
2574
|
{
|
|
@@ -2627,7 +2637,7 @@ var Link = React32__namespace.default.forwardRef(
|
|
|
2627
2637
|
if (_minW !== void 0) shimStyle.minWidth = typeof _minW === "number" ? `${_minW * SPACING}px` : _minW;
|
|
2628
2638
|
if (_justifyContent) shimStyle.justifyContent = _justifyContent;
|
|
2629
2639
|
if (_position) shimStyle.position = _position;
|
|
2630
|
-
const linkClasses = cn(
|
|
2640
|
+
const linkClasses = cn(BASE_CLASSES2, VARIANT_CLASSES2[variant], className);
|
|
2631
2641
|
const linkStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
2632
2642
|
if (external) {
|
|
2633
2643
|
const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
|
|
@@ -2716,8 +2726,8 @@ var LinkOverlay = React32__namespace.default.forwardRef(
|
|
|
2716
2726
|
...rest
|
|
2717
2727
|
} = props;
|
|
2718
2728
|
const overlayClasses = cn(
|
|
2719
|
-
|
|
2720
|
-
|
|
2729
|
+
BASE_CLASSES2,
|
|
2730
|
+
VARIANT_CLASSES2[variant],
|
|
2721
2731
|
// Static positioning with a ::before pseudo-element that covers the LinkBox
|
|
2722
2732
|
"static",
|
|
2723
2733
|
'before:absolute before:inset-0 before:z-0 before:content-[""]',
|
|
@@ -3105,6 +3115,7 @@ function upperFirst(str) {
|
|
|
3105
3115
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
3106
3116
|
}
|
|
3107
3117
|
var ICONS = {};
|
|
3118
|
+
var MUTED = "var(--color-text-secondary)";
|
|
3108
3119
|
var EmptyState = React32__namespace.forwardRef(
|
|
3109
3120
|
function EmptyState2(props, ref) {
|
|
3110
3121
|
const { title, description, term, type = "query", icon, children, className, ...rest } = props;
|
|
@@ -3142,17 +3153,20 @@ var EmptyState = React32__namespace.forwardRef(
|
|
|
3142
3153
|
return icon;
|
|
3143
3154
|
})();
|
|
3144
3155
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3145
|
-
|
|
3156
|
+
gui.XStack,
|
|
3146
3157
|
{
|
|
3147
3158
|
ref,
|
|
3148
|
-
|
|
3159
|
+
alignItems: "center",
|
|
3160
|
+
justifyContent: "center",
|
|
3161
|
+
paddingVertical: 40,
|
|
3162
|
+
className,
|
|
3149
3163
|
...rest,
|
|
3150
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3151
|
-
iconContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3152
|
-
descriptionContent ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3153
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3155
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3164
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { alignItems: "center", gap: 20, children: [
|
|
3165
|
+
iconContent && /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", justifyContent: "center", children: iconContent }),
|
|
3166
|
+
descriptionContent ? /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { alignItems: "center", gap: 8, children: [
|
|
3167
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 18, fontWeight: "600", textAlign: "center", color: MUTED, children: titleContent }),
|
|
3168
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, textAlign: "center", color: MUTED, children: descriptionContent })
|
|
3169
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 18, fontWeight: "600", textAlign: "center", color: MUTED, children: titleContent }),
|
|
3156
3170
|
children
|
|
3157
3171
|
] })
|
|
3158
3172
|
}
|
|
@@ -3166,10 +3180,10 @@ function getComponentDisplayName(type) {
|
|
|
3166
3180
|
return void 0;
|
|
3167
3181
|
}
|
|
3168
3182
|
var ERROR = "var(--color-text-error)";
|
|
3169
|
-
var
|
|
3183
|
+
var MUTED2 = "var(--color-text-secondary)";
|
|
3170
3184
|
var Marks = ({ required, optionalText, errorText }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3171
3185
|
required && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { color: ERROR, "aria-hidden": true, children: "*" }),
|
|
3172
|
-
!required && optionalText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, color:
|
|
3186
|
+
!required && optionalText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, color: MUTED2, children: optionalText }),
|
|
3173
3187
|
errorText && /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 14, color: ERROR, children: [
|
|
3174
3188
|
"-",
|
|
3175
3189
|
space,
|
|
@@ -3220,7 +3234,7 @@ var Field = React32__namespace.forwardRef(
|
|
|
3220
3234
|
]
|
|
3221
3235
|
}
|
|
3222
3236
|
);
|
|
3223
|
-
const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginTop: 6, fontSize: 12, color:
|
|
3237
|
+
const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginTop: 6, fontSize: 12, color: MUTED2, children: helperText }) : null;
|
|
3224
3238
|
const child2 = React32__namespace.Children.only(children);
|
|
3225
3239
|
const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
|
|
3226
3240
|
if (isInputGroup) {
|
|
@@ -3258,7 +3272,7 @@ var Field = React32__namespace.forwardRef(
|
|
|
3258
3272
|
}
|
|
3259
3273
|
),
|
|
3260
3274
|
React32__namespace.cloneElement(child, { size }),
|
|
3261
|
-
helperText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color:
|
|
3275
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: MUTED2, children: helperText }),
|
|
3262
3276
|
errorText && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: ERROR, children: errorText })
|
|
3263
3277
|
] });
|
|
3264
3278
|
}
|
|
@@ -3312,7 +3326,7 @@ var IconButtonFrame = gui.styled(gui.View, {
|
|
|
3312
3326
|
var HOVER = "var(--color-hover)";
|
|
3313
3327
|
var SELECTED_BG = "var(--color-selected-control-bg)";
|
|
3314
3328
|
var SELECTED_FG = "var(--color-selected-control-text)";
|
|
3315
|
-
var
|
|
3329
|
+
var VARIANT2 = {
|
|
3316
3330
|
plain: {
|
|
3317
3331
|
rest: { backgroundColor: "transparent", hoverStyle: { backgroundColor: "transparent" } }
|
|
3318
3332
|
},
|
|
@@ -3387,7 +3401,7 @@ var IconButton = React32__namespace.forwardRef(
|
|
|
3387
3401
|
style: styleProp,
|
|
3388
3402
|
...rest
|
|
3389
3403
|
} = props;
|
|
3390
|
-
const look =
|
|
3404
|
+
const look = VARIANT2[variant] ?? VARIANT2.plain;
|
|
3391
3405
|
const iconSize = size ? ICON_SIZE[size] : void 0;
|
|
3392
3406
|
const button = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3393
3407
|
IconButtonFrame,
|
|
@@ -3634,14 +3648,14 @@ var Image = React32__namespace.default.forwardRef(
|
|
|
3634
3648
|
] });
|
|
3635
3649
|
}
|
|
3636
3650
|
);
|
|
3637
|
-
var
|
|
3651
|
+
var SIZE5 = {
|
|
3638
3652
|
xs: { height: 24, paddingHorizontal: 8, fontSize: 12, borderRadius: 4 },
|
|
3639
3653
|
sm: { height: 32, paddingHorizontal: 12, fontSize: 14, borderRadius: 6 },
|
|
3640
3654
|
md: { height: 40, paddingHorizontal: 16, fontSize: 16, borderRadius: 6 },
|
|
3641
3655
|
lg: { height: 48, paddingHorizontal: 16, fontSize: 18, borderRadius: 8 },
|
|
3642
3656
|
"2xl": { height: 56, paddingHorizontal: 16, fontSize: 20, borderRadius: 8 }
|
|
3643
3657
|
};
|
|
3644
|
-
var
|
|
3658
|
+
var VARIANT3 = {
|
|
3645
3659
|
outline: { borderWidth: 1, borderStyle: "solid" },
|
|
3646
3660
|
filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
|
|
3647
3661
|
unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
|
|
@@ -3672,8 +3686,8 @@ var Input = React32__namespace.default.forwardRef(
|
|
|
3672
3686
|
unstyled: true,
|
|
3673
3687
|
className: className ? `lux-control ${className}` : "lux-control",
|
|
3674
3688
|
...CONTROL,
|
|
3675
|
-
...
|
|
3676
|
-
...
|
|
3689
|
+
...SIZE5[size],
|
|
3690
|
+
...VARIANT3[variant],
|
|
3677
3691
|
...rest,
|
|
3678
3692
|
onChange: handleChange
|
|
3679
3693
|
}
|
|
@@ -3749,22 +3763,30 @@ var InputGroup = React32__namespace.forwardRef(
|
|
|
3749
3763
|
const { className: startClassName, ...startRest } = startElementProps ?? {};
|
|
3750
3764
|
const { className: endClassName, ...endRest } = endElementProps ?? {};
|
|
3751
3765
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3752
|
-
|
|
3766
|
+
gui.XStack,
|
|
3753
3767
|
{
|
|
3754
3768
|
ref: combinedRef,
|
|
3755
|
-
|
|
3769
|
+
position: "relative",
|
|
3770
|
+
width: "100%",
|
|
3771
|
+
alignItems: "center",
|
|
3772
|
+
className,
|
|
3756
3773
|
...rest,
|
|
3757
3774
|
children: [
|
|
3758
3775
|
startElement && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3759
|
-
|
|
3776
|
+
gui.XStack,
|
|
3760
3777
|
{
|
|
3761
3778
|
ref: startElementRef,
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3779
|
+
position: "absolute",
|
|
3780
|
+
top: 0,
|
|
3781
|
+
bottom: 0,
|
|
3782
|
+
left: 0,
|
|
3783
|
+
zIndex: 1,
|
|
3784
|
+
alignItems: "center",
|
|
3785
|
+
pointerEvents: "none",
|
|
3786
|
+
style: { color: "var(--color-icon-secondary)" },
|
|
3787
|
+
className: startClassName,
|
|
3766
3788
|
...startRest,
|
|
3767
|
-
children: startElement
|
|
3789
|
+
children: ink(startElement)
|
|
3768
3790
|
}
|
|
3769
3791
|
),
|
|
3770
3792
|
React32__namespace.Children.map(children, (child) => {
|
|
@@ -3783,15 +3805,20 @@ var InputGroup = React32__namespace.forwardRef(
|
|
|
3783
3805
|
});
|
|
3784
3806
|
}),
|
|
3785
3807
|
endElement && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3786
|
-
|
|
3808
|
+
gui.XStack,
|
|
3787
3809
|
{
|
|
3788
3810
|
ref: endElementRef,
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3811
|
+
position: "absolute",
|
|
3812
|
+
top: 0,
|
|
3813
|
+
bottom: 0,
|
|
3814
|
+
right: 0,
|
|
3815
|
+
zIndex: 1,
|
|
3816
|
+
alignItems: "center",
|
|
3817
|
+
pointerEvents: "none",
|
|
3818
|
+
style: { color: "var(--color-icon-secondary)" },
|
|
3819
|
+
className: endClassName,
|
|
3793
3820
|
...endRest,
|
|
3794
|
-
children: endElement
|
|
3821
|
+
children: ink(endElement)
|
|
3795
3822
|
}
|
|
3796
3823
|
)
|
|
3797
3824
|
]
|
|
@@ -3800,20 +3827,26 @@ var InputGroup = React32__namespace.forwardRef(
|
|
|
3800
3827
|
}
|
|
3801
3828
|
);
|
|
3802
3829
|
InputGroup.displayName = "InputGroup";
|
|
3803
|
-
var
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
"
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3830
|
+
var BOX = {
|
|
3831
|
+
width: 40,
|
|
3832
|
+
height: 40,
|
|
3833
|
+
textAlign: "center",
|
|
3834
|
+
fontSize: 14,
|
|
3835
|
+
fontWeight: 500,
|
|
3836
|
+
borderRadius: 6,
|
|
3837
|
+
borderWidth: 2,
|
|
3838
|
+
borderStyle: "solid",
|
|
3839
|
+
outlineWidth: 0,
|
|
3840
|
+
backgroundColor: "var(--color-input-bg)",
|
|
3841
|
+
color: "var(--color-input-fg)",
|
|
3842
|
+
borderColor: "var(--color-input-border)",
|
|
3843
|
+
hoverStyle: { borderColor: "var(--color-input-border-hover)" },
|
|
3844
|
+
focusStyle: {
|
|
3845
|
+
borderColor: "var(--color-input-border-focus)",
|
|
3846
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
|
|
3847
|
+
},
|
|
3848
|
+
disabledStyle: { opacity: 0.4 }
|
|
3849
|
+
};
|
|
3817
3850
|
var PinInput = React32__namespace.forwardRef(
|
|
3818
3851
|
function PinInput2(props, ref) {
|
|
3819
3852
|
const {
|
|
@@ -3905,8 +3938,8 @@ var PinInput = React32__namespace.forwardRef(
|
|
|
3905
3938
|
const onKeyDownAtIndex = React32__namespace.useCallback((index) => (e) => {
|
|
3906
3939
|
handleKeyDown(index, e);
|
|
3907
3940
|
}, [handleKeyDown]);
|
|
3908
|
-
const
|
|
3909
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3941
|
+
const boxBackground = bgColor ? `var(--color-${bgColor.replace(/\./g, "-")})` : BOX.backgroundColor;
|
|
3942
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { ref: rootRef, alignItems: "center", gap: attached ? 0 : 8, className, children: [
|
|
3910
3943
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3911
3944
|
"input",
|
|
3912
3945
|
{
|
|
@@ -3918,9 +3951,10 @@ var PinInput = React32__namespace.forwardRef(
|
|
|
3918
3951
|
}
|
|
3919
3952
|
),
|
|
3920
3953
|
Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3921
|
-
|
|
3954
|
+
gui.Input,
|
|
3922
3955
|
{
|
|
3923
3956
|
ref: setInputRef(index),
|
|
3957
|
+
unstyled: true,
|
|
3924
3958
|
type: "text",
|
|
3925
3959
|
inputMode: "numeric",
|
|
3926
3960
|
autoComplete: otp ? "one-time-code" : "off",
|
|
@@ -3929,14 +3963,12 @@ var PinInput = React32__namespace.forwardRef(
|
|
|
3929
3963
|
placeholder,
|
|
3930
3964
|
disabled,
|
|
3931
3965
|
"aria-invalid": invalid || void 0,
|
|
3966
|
+
"data-invalid": invalid || void 0,
|
|
3932
3967
|
value: values[index] || "",
|
|
3933
|
-
className:
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
attached && index > 0 && "-ml-0.5"
|
|
3938
|
-
),
|
|
3939
|
-
style: bgStyle,
|
|
3968
|
+
className: "lux-control",
|
|
3969
|
+
...BOX,
|
|
3970
|
+
backgroundColor: boxBackground,
|
|
3971
|
+
marginLeft: attached && index > 0 ? -2 : void 0,
|
|
3940
3972
|
onInput: onInputAtIndex(index),
|
|
3941
3973
|
onKeyDown: onKeyDownAtIndex(index),
|
|
3942
3974
|
onPaste: handlePaste,
|
|
@@ -4182,11 +4214,11 @@ var PopoverDescription = React32__namespace.forwardRef(function PopoverDescripti
|
|
|
4182
4214
|
}
|
|
4183
4215
|
);
|
|
4184
4216
|
});
|
|
4185
|
-
var
|
|
4186
|
-
sm:
|
|
4187
|
-
md:
|
|
4188
|
-
lg:
|
|
4189
|
-
xl:
|
|
4217
|
+
var SIZE6 = {
|
|
4218
|
+
sm: 4,
|
|
4219
|
+
md: 8,
|
|
4220
|
+
lg: 12,
|
|
4221
|
+
xl: 16
|
|
4190
4222
|
};
|
|
4191
4223
|
function normalizeValue(value, min, max) {
|
|
4192
4224
|
if (value == null) return 0;
|
|
@@ -4202,7 +4234,6 @@ var Progress = React32__namespace.forwardRef(
|
|
|
4202
4234
|
size = "md",
|
|
4203
4235
|
color,
|
|
4204
4236
|
trackProps,
|
|
4205
|
-
className,
|
|
4206
4237
|
style,
|
|
4207
4238
|
w,
|
|
4208
4239
|
flex,
|
|
@@ -4221,6 +4252,7 @@ var Progress = React32__namespace.forwardRef(
|
|
|
4221
4252
|
}
|
|
4222
4253
|
};
|
|
4223
4254
|
const rootStyle = {
|
|
4255
|
+
position: "relative",
|
|
4224
4256
|
...style,
|
|
4225
4257
|
...w !== void 0 && { width: w === "full" ? "100%" : w },
|
|
4226
4258
|
...flex !== void 0 && { flex }
|
|
@@ -4229,7 +4261,6 @@ var Progress = React32__namespace.forwardRef(
|
|
|
4229
4261
|
"div",
|
|
4230
4262
|
{
|
|
4231
4263
|
ref,
|
|
4232
|
-
className: cn("relative", className),
|
|
4233
4264
|
style: rootStyle,
|
|
4234
4265
|
...rest,
|
|
4235
4266
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4238,22 +4269,21 @@ var Progress = React32__namespace.forwardRef(
|
|
|
4238
4269
|
value: percent,
|
|
4239
4270
|
max: 100,
|
|
4240
4271
|
unstyled: true,
|
|
4241
|
-
className:
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
),
|
|
4272
|
+
className: trackProps?.className,
|
|
4273
|
+
width: "100%",
|
|
4274
|
+
overflow: "hidden",
|
|
4275
|
+
borderRadius: 9999,
|
|
4276
|
+
height: SIZE6[size],
|
|
4277
|
+
backgroundColor: "var(--color-progress-track)",
|
|
4247
4278
|
style: trackStyle,
|
|
4248
4279
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4249
4280
|
gui.Progress.Indicator,
|
|
4250
4281
|
{
|
|
4251
4282
|
unstyled: true,
|
|
4252
4283
|
transition: "slow",
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
),
|
|
4284
|
+
height: "100%",
|
|
4285
|
+
borderRadius: 9999,
|
|
4286
|
+
backgroundColor: color ? void 0 : "var(--color-progress-indicator)",
|
|
4257
4287
|
style: {
|
|
4258
4288
|
...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
|
|
4259
4289
|
}
|
|
@@ -4266,11 +4296,11 @@ var Progress = React32__namespace.forwardRef(
|
|
|
4266
4296
|
}
|
|
4267
4297
|
);
|
|
4268
4298
|
var SIZE_MAP = {
|
|
4269
|
-
xs: { size: 24, thickness: 4,
|
|
4270
|
-
sm: { size: 32, thickness: 5,
|
|
4271
|
-
md: { size: 40, thickness: 6,
|
|
4272
|
-
lg: { size: 48, thickness: 7,
|
|
4273
|
-
xl: { size: 64, thickness: 8,
|
|
4299
|
+
xs: { size: 24, thickness: 4, fontSize: 10 },
|
|
4300
|
+
sm: { size: 32, thickness: 5, fontSize: 10 },
|
|
4301
|
+
md: { size: 40, thickness: 6, fontSize: 12 },
|
|
4302
|
+
lg: { size: 48, thickness: 7, fontSize: 14 },
|
|
4303
|
+
xl: { size: 64, thickness: 8, fontSize: 14 }
|
|
4274
4304
|
};
|
|
4275
4305
|
var Ctx = React32__namespace.createContext({
|
|
4276
4306
|
value: 0,
|
|
@@ -4291,16 +4321,18 @@ var ProgressCircleRoot = React32__namespace.forwardRef(function ProgressCircleRo
|
|
|
4291
4321
|
[value, size, colorPalette]
|
|
4292
4322
|
);
|
|
4293
4323
|
return /* @__PURE__ */ jsxRuntime.jsx(Ctx.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4294
|
-
|
|
4324
|
+
gui.View,
|
|
4295
4325
|
{
|
|
4296
4326
|
ref,
|
|
4297
4327
|
role: "progressbar",
|
|
4298
4328
|
"aria-valuenow": value ?? void 0,
|
|
4299
4329
|
"aria-valuemin": 0,
|
|
4300
4330
|
"aria-valuemax": 100,
|
|
4301
|
-
|
|
4331
|
+
position: "relative",
|
|
4332
|
+
style: { display: "inline-flex", fontSize: 14 },
|
|
4333
|
+
className,
|
|
4302
4334
|
...rest,
|
|
4303
|
-
children
|
|
4335
|
+
children: ink(children)
|
|
4304
4336
|
}
|
|
4305
4337
|
) });
|
|
4306
4338
|
});
|
|
@@ -4319,10 +4351,7 @@ var ProgressCircleRing = React32__namespace.forwardRef(function ProgressCircleRi
|
|
|
4319
4351
|
width: size,
|
|
4320
4352
|
height: size,
|
|
4321
4353
|
viewBox: `0 0 ${size} ${size}`,
|
|
4322
|
-
className: cn(
|
|
4323
|
-
value === null && "animate-spin",
|
|
4324
|
-
className
|
|
4325
|
-
),
|
|
4354
|
+
className: value === null ? cn("lux-spin", className) : className,
|
|
4326
4355
|
...rest,
|
|
4327
4356
|
children: [
|
|
4328
4357
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4334,7 +4363,7 @@ var ProgressCircleRing = React32__namespace.forwardRef(function ProgressCircleRi
|
|
|
4334
4363
|
fill: "transparent",
|
|
4335
4364
|
strokeWidth: thickness,
|
|
4336
4365
|
stroke: trackColor ?? "currentColor",
|
|
4337
|
-
|
|
4366
|
+
opacity: !trackColor ? 0.2 : void 0
|
|
4338
4367
|
}
|
|
4339
4368
|
),
|
|
4340
4369
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4364,49 +4393,42 @@ var ProgressCircleRing = React32__namespace.forwardRef(function ProgressCircleRi
|
|
|
4364
4393
|
var ProgressCircleValueText = React32__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
|
|
4365
4394
|
const { className, children, ...rest } = props;
|
|
4366
4395
|
const { value, size: sizeKey } = React32__namespace.useContext(Ctx);
|
|
4367
|
-
const {
|
|
4396
|
+
const { fontSize } = SIZE_MAP[sizeKey];
|
|
4368
4397
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4369
|
-
|
|
4398
|
+
gui.View,
|
|
4370
4399
|
{
|
|
4371
4400
|
ref,
|
|
4372
4401
|
"aria-live": "polite",
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4402
|
+
position: "absolute",
|
|
4403
|
+
top: 0,
|
|
4404
|
+
left: 0,
|
|
4405
|
+
right: 0,
|
|
4406
|
+
bottom: 0,
|
|
4407
|
+
display: "flex",
|
|
4408
|
+
alignItems: "center",
|
|
4409
|
+
justifyContent: "center",
|
|
4410
|
+
style: {
|
|
4411
|
+
fontWeight: 500,
|
|
4412
|
+
fontSize,
|
|
4413
|
+
lineHeight: `${fontSize}px`,
|
|
4414
|
+
letterSpacing: fontSize * -0.025,
|
|
4415
|
+
fontVariantNumeric: "tabular-nums"
|
|
4416
|
+
},
|
|
4417
|
+
className,
|
|
4379
4418
|
...rest,
|
|
4380
|
-
children: children ?? `${Math.round(value ?? 0)}%`
|
|
4419
|
+
children: ink(children ?? `${Math.round(value ?? 0)}%`)
|
|
4381
4420
|
}
|
|
4382
4421
|
);
|
|
4383
4422
|
});
|
|
4384
|
-
var
|
|
4385
|
-
xs: {
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
label: "text-xs"
|
|
4390
|
-
},
|
|
4391
|
-
sm: {
|
|
4392
|
-
root: "gap-1.5",
|
|
4393
|
-
control: "h-3.5 w-3.5",
|
|
4394
|
-
indicator: "h-1.5 w-1.5",
|
|
4395
|
-
label: "text-xs"
|
|
4396
|
-
},
|
|
4397
|
-
md: {
|
|
4398
|
-
root: "gap-2",
|
|
4399
|
-
control: "h-4 w-4",
|
|
4400
|
-
indicator: "h-2 w-2",
|
|
4401
|
-
label: "text-sm"
|
|
4402
|
-
},
|
|
4403
|
-
lg: {
|
|
4404
|
-
root: "gap-2.5",
|
|
4405
|
-
control: "h-5 w-5",
|
|
4406
|
-
indicator: "h-2.5 w-2.5",
|
|
4407
|
-
label: "text-base"
|
|
4408
|
-
}
|
|
4423
|
+
var SIZE7 = {
|
|
4424
|
+
xs: { rootGap: 6, control: 12, indicator: 6, label: 12 },
|
|
4425
|
+
sm: { rootGap: 6, control: 14, indicator: 6, label: 12 },
|
|
4426
|
+
md: { rootGap: 8, control: 16, indicator: 8, label: 14 },
|
|
4427
|
+
lg: { rootGap: 10, control: 20, indicator: 10, label: 16 }
|
|
4409
4428
|
};
|
|
4429
|
+
var INK2 = "var(--color-text-primary)";
|
|
4430
|
+
var RESTING_BORDER2 = "var(--color-input-border)";
|
|
4431
|
+
var OUTLINE2 = "var(--color-gray-500)";
|
|
4410
4432
|
var RadioSizeContext = React32__namespace.createContext("md");
|
|
4411
4433
|
var RadioGroupBase = React32__namespace.forwardRef(
|
|
4412
4434
|
function RadioGroup(props, ref) {
|
|
@@ -4423,7 +4445,6 @@ var RadioGroupBase = React32__namespace.forwardRef(
|
|
|
4423
4445
|
value,
|
|
4424
4446
|
onValueChange,
|
|
4425
4447
|
size = "md",
|
|
4426
|
-
className,
|
|
4427
4448
|
...rest
|
|
4428
4449
|
} = props;
|
|
4429
4450
|
const handleValueChange = React32__namespace.useCallback(
|
|
@@ -4437,7 +4458,6 @@ var RadioGroupBase = React32__namespace.forwardRef(
|
|
|
4437
4458
|
gui.RadioGroup,
|
|
4438
4459
|
{
|
|
4439
4460
|
ref,
|
|
4440
|
-
unstyled: true,
|
|
4441
4461
|
name,
|
|
4442
4462
|
required,
|
|
4443
4463
|
disabled: disabled || readOnly,
|
|
@@ -4445,11 +4465,9 @@ var RadioGroupBase = React32__namespace.forwardRef(
|
|
|
4445
4465
|
defaultValue,
|
|
4446
4466
|
value: value ?? void 0,
|
|
4447
4467
|
onValueChange: handleValueChange,
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
className
|
|
4452
|
-
),
|
|
4468
|
+
display: "flex",
|
|
4469
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
4470
|
+
gap: orientation === "vertical" ? 12 : 24,
|
|
4453
4471
|
...rest,
|
|
4454
4472
|
children
|
|
4455
4473
|
}
|
|
@@ -4461,19 +4479,20 @@ var NOOP2 = () => {
|
|
|
4461
4479
|
};
|
|
4462
4480
|
var RadioBase = React32__namespace.forwardRef(
|
|
4463
4481
|
function Radio(props, ref) {
|
|
4464
|
-
const { children, inputProps, rootRef, value, disabled,
|
|
4482
|
+
const { children, inputProps, rootRef, value, disabled, ...rest } = props;
|
|
4465
4483
|
const size = React32__namespace.useContext(RadioSizeContext);
|
|
4466
|
-
const
|
|
4484
|
+
const s = SIZE7[size];
|
|
4467
4485
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4468
|
-
|
|
4486
|
+
gui.Label,
|
|
4469
4487
|
{
|
|
4470
4488
|
ref: rootRef,
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4489
|
+
unstyled: true,
|
|
4490
|
+
flexDirection: "row",
|
|
4491
|
+
alignItems: "center",
|
|
4492
|
+
gap: s.rootGap,
|
|
4493
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
4494
|
+
userSelect: "none",
|
|
4495
|
+
opacity: disabled ? 0.5 : 1,
|
|
4477
4496
|
"data-disabled": disabled || void 0,
|
|
4478
4497
|
...rest,
|
|
4479
4498
|
children: [
|
|
@@ -4483,32 +4502,24 @@ var RadioBase = React32__namespace.forwardRef(
|
|
|
4483
4502
|
unstyled: true,
|
|
4484
4503
|
value,
|
|
4485
4504
|
disabled,
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
unstyled: true,
|
|
4498
|
-
className: cn(
|
|
4499
|
-
"block rounded-full bg-gray-800 dark:bg-white",
|
|
4500
|
-
sizeClasses2.indicator
|
|
4501
|
-
)
|
|
4502
|
-
}
|
|
4503
|
-
)
|
|
4505
|
+
flexShrink: 0,
|
|
4506
|
+
alignItems: "center",
|
|
4507
|
+
justifyContent: "center",
|
|
4508
|
+
width: s.control,
|
|
4509
|
+
height: s.control,
|
|
4510
|
+
borderRadius: 9999,
|
|
4511
|
+
borderWidth: 2,
|
|
4512
|
+
borderColor: RESTING_BORDER2,
|
|
4513
|
+
transition: "quicker",
|
|
4514
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE2, outlineOffset: 2 },
|
|
4515
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(gui.RadioGroup.Indicator, { unstyled: true, borderRadius: 9999, width: s.indicator, height: s.indicator, backgroundColor: INK2 })
|
|
4504
4516
|
}
|
|
4505
4517
|
),
|
|
4506
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4518
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4507
4519
|
"input",
|
|
4508
4520
|
{
|
|
4509
4521
|
ref,
|
|
4510
4522
|
type: "radio",
|
|
4511
|
-
className: "sr-only",
|
|
4512
4523
|
value,
|
|
4513
4524
|
disabled,
|
|
4514
4525
|
tabIndex: -1,
|
|
@@ -4516,16 +4527,16 @@ var RadioBase = React32__namespace.forwardRef(
|
|
|
4516
4527
|
onChange: NOOP2,
|
|
4517
4528
|
...inputProps
|
|
4518
4529
|
}
|
|
4519
|
-
),
|
|
4520
|
-
children != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4530
|
+
) }),
|
|
4531
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: s.label, children })
|
|
4521
4532
|
]
|
|
4522
4533
|
}
|
|
4523
4534
|
);
|
|
4524
4535
|
}
|
|
4525
4536
|
);
|
|
4526
4537
|
var Radio2 = RadioBase;
|
|
4527
|
-
var StarFilledIcon = (
|
|
4528
|
-
var StarOutlineIcon = (
|
|
4538
|
+
var StarFilledIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
|
|
4539
|
+
var StarOutlineIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
|
|
4529
4540
|
var Rating = React32__namespace.forwardRef(
|
|
4530
4541
|
function Rating2(props, ref) {
|
|
4531
4542
|
const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
|
|
@@ -4545,28 +4556,30 @@ var Rating = React32__namespace.forwardRef(
|
|
|
4545
4556
|
const handleMouseLeave = React32__namespace.useCallback(() => {
|
|
4546
4557
|
setHoveredIndex(-1);
|
|
4547
4558
|
}, []);
|
|
4548
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4549
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4559
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { ref, display: "inline-flex", alignItems: "center", gap: 4, className, ...rest, children: [
|
|
4560
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { display: "inline-flex", alignItems: "center", onMouseLeave: handleMouseLeave, children: Array.from({ length: count }).map((_, index) => {
|
|
4550
4561
|
const filled = index < highlightedIndex;
|
|
4551
4562
|
const starIndex = index + 1;
|
|
4552
4563
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4553
|
-
|
|
4564
|
+
gui.View,
|
|
4554
4565
|
{
|
|
4555
|
-
type: "button",
|
|
4566
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
4556
4567
|
tabIndex: readOnly ? -1 : 0,
|
|
4557
4568
|
"aria-label": `Rate ${starIndex} of ${count}`,
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4569
|
+
display: "inline-flex",
|
|
4570
|
+
alignItems: "center",
|
|
4571
|
+
justifyContent: "center",
|
|
4572
|
+
width: 20,
|
|
4573
|
+
height: 20,
|
|
4574
|
+
cursor: readOnly ? "default" : "pointer",
|
|
4562
4575
|
onClick: handleClick(starIndex),
|
|
4563
4576
|
onMouseEnter: handleMouseEnter(index),
|
|
4564
|
-
children: filled ? /* @__PURE__ */ jsxRuntime.jsx(StarFilledIcon, {
|
|
4577
|
+
children: filled ? /* @__PURE__ */ jsxRuntime.jsx(StarFilledIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(StarOutlineIcon, {})
|
|
4565
4578
|
},
|
|
4566
4579
|
index
|
|
4567
4580
|
);
|
|
4568
4581
|
}) }),
|
|
4569
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4582
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, children: label })
|
|
4570
4583
|
] });
|
|
4571
4584
|
}
|
|
4572
4585
|
);
|
|
@@ -5002,6 +5015,11 @@ var Separator = React32__namespace.default.forwardRef(
|
|
|
5002
5015
|
);
|
|
5003
5016
|
}
|
|
5004
5017
|
);
|
|
5018
|
+
var MUTED3 = "var(--color-text-secondary)";
|
|
5019
|
+
var TRACK = "var(--color-border-divider)";
|
|
5020
|
+
var ACTIVE = "var(--color-link-primary)";
|
|
5021
|
+
var ACTIVE_HOVER = "var(--color-link-primary-hover)";
|
|
5022
|
+
var WHITE = "var(--color-white)";
|
|
5005
5023
|
var Slider = React32__namespace.forwardRef(
|
|
5006
5024
|
function Slider2(props, ref) {
|
|
5007
5025
|
const {
|
|
@@ -5034,21 +5052,22 @@ var Slider = React32__namespace.forwardRef(
|
|
|
5034
5052
|
const handleSlideEnd = React32__namespace.useCallback(() => {
|
|
5035
5053
|
onValueCommit?.(latest.current);
|
|
5036
5054
|
}, [onValueCommit]);
|
|
5037
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5038
|
-
label && !showValue && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5039
|
-
label && showValue && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5040
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5041
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5055
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { className, gap: 4, children: [
|
|
5056
|
+
label && !showValue && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, fontWeight: "500", color: MUTED3, children: label }),
|
|
5057
|
+
label && showValue && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5058
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, fontWeight: "500", color: MUTED3, children: label }),
|
|
5059
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, color: MUTED3, children: (value ?? defaultValue ?? [])?.join(", ") })
|
|
5042
5060
|
] }),
|
|
5043
5061
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5044
5062
|
gui.Slider,
|
|
5045
5063
|
{
|
|
5046
5064
|
ref,
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5065
|
+
position: "relative",
|
|
5066
|
+
flexDirection: "row",
|
|
5067
|
+
width: "100%",
|
|
5068
|
+
userSelect: "none",
|
|
5069
|
+
alignItems: "center",
|
|
5070
|
+
marginBottom: hasMarkLabel ? 24 : 0,
|
|
5052
5071
|
value,
|
|
5053
5072
|
defaultValue,
|
|
5054
5073
|
min,
|
|
@@ -5060,33 +5079,23 @@ var Slider = React32__namespace.forwardRef(
|
|
|
5060
5079
|
onValueChange: handleValueChange,
|
|
5061
5080
|
onSlideEnd: handleSlideEnd,
|
|
5062
5081
|
children: [
|
|
5063
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5064
|
-
gui.Slider.Track,
|
|
5065
|
-
{
|
|
5066
|
-
unstyled: true,
|
|
5067
|
-
className: "relative grow h-1.5 rounded-full bg-border-divider",
|
|
5068
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5069
|
-
gui.Slider.TrackActive,
|
|
5070
|
-
{
|
|
5071
|
-
unstyled: true,
|
|
5072
|
-
className: "absolute h-full rounded-full bg-link-primary"
|
|
5073
|
-
}
|
|
5074
|
-
)
|
|
5075
|
-
}
|
|
5076
|
-
),
|
|
5082
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Slider.Track, { unstyled: true, position: "relative", flexGrow: 1, height: 6, borderRadius: 9999, backgroundColor: TRACK, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.TrackActive, { unstyled: true, position: "absolute", height: "100%", borderRadius: 9999, backgroundColor: ACTIVE }) }),
|
|
5077
5083
|
resolvedValue?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5078
5084
|
gui.Slider.Thumb,
|
|
5079
5085
|
{
|
|
5080
5086
|
index,
|
|
5081
5087
|
unstyled: true,
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5088
|
+
width: 20,
|
|
5089
|
+
height: 20,
|
|
5090
|
+
borderRadius: 9999,
|
|
5091
|
+
borderWidth: 2,
|
|
5092
|
+
borderColor: ACTIVE,
|
|
5093
|
+
backgroundColor: WHITE,
|
|
5094
|
+
boxShadow: "0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
5095
|
+
transition: "quick",
|
|
5096
|
+
hoverStyle: { borderColor: ACTIVE_HOVER },
|
|
5097
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: ACTIVE, outlineOffset: 2 },
|
|
5098
|
+
disabledStyle: { pointerEvents: "none", opacity: 0.5 }
|
|
5090
5099
|
},
|
|
5091
5100
|
index
|
|
5092
5101
|
))
|
|
@@ -5101,41 +5110,25 @@ function SliderMarks(props) {
|
|
|
5101
5110
|
const { marks, min, max } = props;
|
|
5102
5111
|
if (!marks?.length) return null;
|
|
5103
5112
|
const range = max - min;
|
|
5104
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5113
|
+
return /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "relative", width: "100%", height: 16, children: marks.map((mark, index) => {
|
|
5105
5114
|
const percent = (mark.value - min) / range * 100;
|
|
5106
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5107
|
-
|
|
5108
|
-
{
|
|
5109
|
-
|
|
5110
|
-
style: { left: `${percent}%` },
|
|
5111
|
-
children: [
|
|
5112
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-0.5 bg-border-divider" }),
|
|
5113
|
-
mark.label != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 text-xs text-text-secondary whitespace-nowrap", children: mark.label })
|
|
5114
|
-
]
|
|
5115
|
-
},
|
|
5116
|
-
index
|
|
5117
|
-
);
|
|
5115
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { position: "absolute", left: `${percent}%`, alignItems: "center", children: [
|
|
5116
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { width: 2, height: 6, backgroundColor: TRACK }),
|
|
5117
|
+
mark.label != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginTop: 2, fontSize: 12, color: MUTED3, children: mark.label })
|
|
5118
|
+
] }, index);
|
|
5118
5119
|
}) });
|
|
5119
5120
|
}
|
|
5120
5121
|
var NOOP3 = () => {
|
|
5121
5122
|
};
|
|
5122
|
-
var
|
|
5123
|
-
sm: {
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
label: "text-xs"
|
|
5127
|
-
},
|
|
5128
|
-
md: {
|
|
5129
|
-
root: "h-5 w-9",
|
|
5130
|
-
thumb: "h-4 w-4",
|
|
5131
|
-
label: "text-sm"
|
|
5132
|
-
},
|
|
5133
|
-
lg: {
|
|
5134
|
-
root: "h-6 w-11",
|
|
5135
|
-
thumb: "h-5 w-5",
|
|
5136
|
-
label: "text-base"
|
|
5137
|
-
}
|
|
5123
|
+
var SIZE8 = {
|
|
5124
|
+
sm: { width: 28, height: 16, thumb: 12, label: 12 },
|
|
5125
|
+
md: { width: 36, height: 20, thumb: 16, label: 14 },
|
|
5126
|
+
lg: { width: 44, height: 24, thumb: 20, label: 16 }
|
|
5138
5127
|
};
|
|
5128
|
+
var TRACK_ON = "var(--color-text-primary)";
|
|
5129
|
+
var TRACK_OFF = "var(--color-switch-bg)";
|
|
5130
|
+
var OUTLINE3 = "var(--color-gray-500)";
|
|
5131
|
+
var WHITE2 = "var(--color-white)";
|
|
5139
5132
|
var SwitchBase = React32__namespace.forwardRef(
|
|
5140
5133
|
function Switch(props, ref) {
|
|
5141
5134
|
const {
|
|
@@ -5152,7 +5145,6 @@ var SwitchBase = React32__namespace.forwardRef(
|
|
|
5152
5145
|
disabled = false,
|
|
5153
5146
|
size = "md",
|
|
5154
5147
|
direction,
|
|
5155
|
-
className,
|
|
5156
5148
|
...rest
|
|
5157
5149
|
} = props;
|
|
5158
5150
|
const [internalChecked, setInternalChecked] = React32__namespace.useState(defaultChecked ?? false);
|
|
@@ -5167,18 +5159,19 @@ var SwitchBase = React32__namespace.forwardRef(
|
|
|
5167
5159
|
},
|
|
5168
5160
|
[isControlled, onCheckedChange]
|
|
5169
5161
|
);
|
|
5170
|
-
const
|
|
5162
|
+
const s = SIZE8[size];
|
|
5171
5163
|
const isRtl = direction === "rtl";
|
|
5172
5164
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5173
|
-
|
|
5165
|
+
gui.Label,
|
|
5174
5166
|
{
|
|
5175
5167
|
ref: rootRef,
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5168
|
+
unstyled: true,
|
|
5169
|
+
flexDirection: isRtl ? "row-reverse" : "row",
|
|
5170
|
+
alignItems: "center",
|
|
5171
|
+
gap: 8,
|
|
5172
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
5173
|
+
userSelect: "none",
|
|
5174
|
+
opacity: disabled ? 0.5 : 1,
|
|
5182
5175
|
onChange,
|
|
5183
5176
|
"data-disabled": disabled || void 0,
|
|
5184
5177
|
...rest,
|
|
@@ -5190,38 +5183,51 @@ var SwitchBase = React32__namespace.forwardRef(
|
|
|
5190
5183
|
checked: checkedState,
|
|
5191
5184
|
onCheckedChange: handleCheckedChange,
|
|
5192
5185
|
disabled,
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5186
|
+
position: "relative",
|
|
5187
|
+
flexShrink: 0,
|
|
5188
|
+
alignItems: "center",
|
|
5189
|
+
width: s.width,
|
|
5190
|
+
height: s.height,
|
|
5191
|
+
borderRadius: 9999,
|
|
5192
|
+
backgroundColor: checkedState ? TRACK_ON : TRACK_OFF,
|
|
5193
|
+
transition: "quick",
|
|
5194
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE3, outlineOffset: 2 },
|
|
5201
5195
|
children: [
|
|
5202
|
-
trackLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5196
|
+
trackLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5197
|
+
gui.Text,
|
|
5198
|
+
{
|
|
5199
|
+
position: "absolute",
|
|
5200
|
+
width: "100%",
|
|
5201
|
+
textAlign: "center",
|
|
5202
|
+
fontSize: 8,
|
|
5203
|
+
fontWeight: "700",
|
|
5204
|
+
color: WHITE2,
|
|
5205
|
+
pointerEvents: "none",
|
|
5206
|
+
children: checkedState ? trackLabel.on : trackLabel.off
|
|
5207
|
+
}
|
|
5208
|
+
),
|
|
5203
5209
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5204
5210
|
gui.Switch.Thumb,
|
|
5205
5211
|
{
|
|
5206
5212
|
unstyled: true,
|
|
5207
5213
|
"data-thumb": true,
|
|
5208
5214
|
transition: "quicker",
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5215
|
+
width: s.thumb,
|
|
5216
|
+
height: s.thumb,
|
|
5217
|
+
borderRadius: 9999,
|
|
5218
|
+
backgroundColor: WHITE2,
|
|
5219
|
+
boxShadow: "0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
5220
|
+
children: thumbLabel && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { width: "100%", height: "100%", textAlign: "center", fontSize: 8, children: checkedState ? thumbLabel.on : thumbLabel.off })
|
|
5214
5221
|
}
|
|
5215
5222
|
)
|
|
5216
5223
|
]
|
|
5217
5224
|
}
|
|
5218
5225
|
),
|
|
5219
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5226
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5220
5227
|
"input",
|
|
5221
5228
|
{
|
|
5222
5229
|
ref,
|
|
5223
5230
|
type: "checkbox",
|
|
5224
|
-
className: "sr-only",
|
|
5225
5231
|
checked: checkedState,
|
|
5226
5232
|
disabled,
|
|
5227
5233
|
tabIndex: -1,
|
|
@@ -5229,15 +5235,8 @@ var SwitchBase = React32__namespace.forwardRef(
|
|
|
5229
5235
|
onChange: NOOP3,
|
|
5230
5236
|
...inputProps
|
|
5231
5237
|
}
|
|
5232
|
-
),
|
|
5233
|
-
children != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5234
|
-
"span",
|
|
5235
|
-
{
|
|
5236
|
-
...labelProps,
|
|
5237
|
-
className: cn(sizeClasses2.label, labelProps?.className),
|
|
5238
|
-
children
|
|
5239
|
-
}
|
|
5240
|
-
)
|
|
5238
|
+
) }),
|
|
5239
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { ...labelProps, fontSize: s.label, children })
|
|
5241
5240
|
]
|
|
5242
5241
|
}
|
|
5243
5242
|
);
|
|
@@ -5655,14 +5654,14 @@ var Shape = React32__namespace.createContext({
|
|
|
5655
5654
|
size: "md",
|
|
5656
5655
|
fitted: false
|
|
5657
5656
|
});
|
|
5658
|
-
var
|
|
5657
|
+
var SIZE9 = {
|
|
5659
5658
|
sm: { height: 32, minWidth: 32, paddingVertical: 4, paddingHorizontal: 12, fontSize: 14 },
|
|
5660
5659
|
md: { height: 40, minWidth: 40, paddingVertical: 8, paddingHorizontal: 16, fontSize: 16 },
|
|
5661
5660
|
free: {}
|
|
5662
5661
|
};
|
|
5663
5662
|
var SELECTED_BG2 = "var(--color-selected-control-bg)";
|
|
5664
5663
|
var SELECTED_FG2 = "var(--color-selected-control-text)";
|
|
5665
|
-
var
|
|
5664
|
+
var VARIANT4 = {
|
|
5666
5665
|
solid: {
|
|
5667
5666
|
rest: {
|
|
5668
5667
|
fontWeight: "600",
|
|
@@ -5731,7 +5730,7 @@ var TabsList = (props) => {
|
|
|
5731
5730
|
};
|
|
5732
5731
|
var TabsTrigger = ({ children, ...props }) => {
|
|
5733
5732
|
const { variant, size, fitted } = React32__namespace.useContext(Shape);
|
|
5734
|
-
const { rest, active } =
|
|
5733
|
+
const { rest, active } = VARIANT4[variant];
|
|
5735
5734
|
const selected = gui.useTabsContext().value === props.value;
|
|
5736
5735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5737
5736
|
gui.Tabs.Tab,
|
|
@@ -5744,7 +5743,7 @@ var TabsTrigger = ({ children, ...props }) => {
|
|
|
5744
5743
|
cursor: "pointer",
|
|
5745
5744
|
gap: 8,
|
|
5746
5745
|
borderWidth: 0,
|
|
5747
|
-
...
|
|
5746
|
+
...SIZE9[size],
|
|
5748
5747
|
...rest,
|
|
5749
5748
|
...selected ? active : null,
|
|
5750
5749
|
...fitted ? { flex: 1 } : null,
|
|
@@ -5763,25 +5762,24 @@ var nbsp = String.fromCharCode(160);
|
|
|
5763
5762
|
function TruncatedTextTooltip2({ label, children }) {
|
|
5764
5763
|
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
5765
5764
|
}
|
|
5766
|
-
var
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5765
|
+
var TAG_VARIANT = {
|
|
5766
|
+
subtle: { backgroundColor: "var(--color-tag-subtle-bg)" },
|
|
5767
|
+
clickable: { backgroundColor: "var(--color-tag-clickable-bg)", cursor: "pointer", hoverStyle: { opacity: 0.76 } },
|
|
5768
|
+
filter: { backgroundColor: "var(--color-tag-filter-bg)" },
|
|
5769
|
+
select: { backgroundColor: "var(--color-tag-select-bg)", cursor: "pointer", hoverStyle: { opacity: 0.76 } }
|
|
5770
|
+
};
|
|
5771
|
+
var TAG_VARIANT_FG = {
|
|
5772
|
+
subtle: "var(--color-tag-subtle-fg)",
|
|
5773
|
+
clickable: "var(--color-tag-clickable-fg)",
|
|
5774
|
+
filter: void 0,
|
|
5775
|
+
select: "var(--color-tag-select-fg)"
|
|
5772
5776
|
};
|
|
5773
|
-
var
|
|
5774
|
-
sm:
|
|
5775
|
-
md:
|
|
5776
|
-
lg:
|
|
5777
|
+
var TAG_SIZE = {
|
|
5778
|
+
sm: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 20, gap: 4 },
|
|
5779
|
+
md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24, gap: 4 },
|
|
5780
|
+
lg: { paddingHorizontal: 6, paddingVertical: 6, minHeight: 32, minWidth: 32, gap: 4 }
|
|
5777
5781
|
};
|
|
5778
|
-
var
|
|
5779
|
-
"bg-[var(--color-tag-select-selected-bg)]",
|
|
5780
|
-
"text-[var(--color-tag-select-selected-fg)]",
|
|
5781
|
-
"hover:text-[var(--color-tag-select-selected-fg)]",
|
|
5782
|
-
"hover:opacity-76"
|
|
5783
|
-
].join(" ");
|
|
5784
|
-
var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
|
|
5782
|
+
var TAG_SIZE_FONT = { sm: 12, md: 14, lg: 14 };
|
|
5785
5783
|
var Tag = React32__namespace.forwardRef(
|
|
5786
5784
|
function Tag2(props, ref) {
|
|
5787
5785
|
const {
|
|
@@ -5801,52 +5799,87 @@ var Tag = React32__namespace.forwardRef(
|
|
|
5801
5799
|
className,
|
|
5802
5800
|
...rest
|
|
5803
5801
|
} = props;
|
|
5804
|
-
const
|
|
5802
|
+
const resolvedVariant = variant ?? "subtle";
|
|
5803
|
+
const resolvedSize = size ?? "md";
|
|
5804
|
+
const isSelected = Boolean(selected) && !loading;
|
|
5805
|
+
const backgroundColor = isSelected ? "var(--color-tag-select-selected-bg)" : TAG_VARIANT[resolvedVariant].backgroundColor;
|
|
5806
|
+
const color = isSelected ? "var(--color-tag-select-selected-fg)" : TAG_VARIANT_FG[resolvedVariant];
|
|
5807
|
+
const hoverStyle = isSelected ? { opacity: 0.76 } : TAG_VARIANT[resolvedVariant].hoverStyle;
|
|
5808
|
+
const textHoverColor = !isSelected && resolvedVariant === "select" ? "var(--color-hover)" : void 0;
|
|
5809
|
+
const labelElement = label ? /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: TAG_SIZE_FONT[resolvedSize], fontWeight: "500", color: "var(--color-text-secondary)", children: [
|
|
5805
5810
|
label,
|
|
5806
5811
|
":",
|
|
5807
5812
|
nbsp
|
|
5808
5813
|
] }) : null;
|
|
5809
|
-
const labelSpan =
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5814
|
+
const labelSpan = (
|
|
5815
|
+
// `ellipsis` is Text's own built-in single-line-truncation variant —
|
|
5816
|
+
// the same rule Tailwind's `line-clamp-1`/`text-ellipsis` drew, through
|
|
5817
|
+
// the component's variants rather than three separate style props.
|
|
5818
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5819
|
+
gui.Text,
|
|
5820
|
+
{
|
|
5821
|
+
ellipsis: true,
|
|
5822
|
+
fontWeight: "500",
|
|
5823
|
+
fontSize: TAG_SIZE_FONT[resolvedSize],
|
|
5824
|
+
color,
|
|
5825
|
+
hoverStyle: textHoverColor ? { color: textHoverColor } : void 0,
|
|
5826
|
+
children: [
|
|
5827
|
+
labelElement,
|
|
5828
|
+
children
|
|
5829
|
+
]
|
|
5830
|
+
}
|
|
5831
|
+
)
|
|
5832
|
+
);
|
|
5813
5833
|
const contentElement = truncated ? /* @__PURE__ */ jsxRuntime.jsx(TruncatedTextTooltip2, { label: children, children: labelSpan }) : labelSpan;
|
|
5814
5834
|
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5815
|
-
|
|
5835
|
+
gui.XStack,
|
|
5816
5836
|
{
|
|
5817
5837
|
ref,
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5838
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
5839
|
+
display: "inline-flex",
|
|
5840
|
+
alignItems: "center",
|
|
5841
|
+
verticalAlign: "top",
|
|
5842
|
+
maxWidth: "100%",
|
|
5843
|
+
userSelect: "text",
|
|
5844
|
+
...TAG_SIZE[resolvedSize],
|
|
5845
|
+
backgroundColor,
|
|
5846
|
+
hoverStyle,
|
|
5847
|
+
focusVisibleStyle: {
|
|
5848
|
+
outlineWidth: 2,
|
|
5849
|
+
outlineOffset: 2,
|
|
5850
|
+
outlineColor: "var(--color-gray-500)",
|
|
5851
|
+
outlineStyle: "solid"
|
|
5852
|
+
},
|
|
5853
|
+
cursor: disabled ? "not-allowed" : TAG_VARIANT[resolvedVariant].cursor,
|
|
5854
|
+
...disabled ? { opacity: 0.4, pointerEvents: "none" } : {},
|
|
5855
|
+
...isSelected && { "data-selected": true },
|
|
5827
5856
|
...disabled && { "data-disabled": true },
|
|
5857
|
+
className,
|
|
5828
5858
|
...rest,
|
|
5829
5859
|
children: [
|
|
5830
|
-
startElement && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5860
|
+
startElement && /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flexShrink: 0, alignItems: "center", justifyContent: "center", children: startElement }),
|
|
5831
5861
|
contentElement,
|
|
5832
|
-
endElement &&
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5862
|
+
endElement && (() => {
|
|
5863
|
+
const { className: endClassName, ...endElementRest } = endElementProps ?? {};
|
|
5864
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5865
|
+
gui.XStack,
|
|
5866
|
+
{
|
|
5867
|
+
...endElementRest,
|
|
5868
|
+
flexShrink: 0,
|
|
5869
|
+
alignItems: "center",
|
|
5870
|
+
justifyContent: "center",
|
|
5871
|
+
className: endClassName,
|
|
5872
|
+
children: endElement
|
|
5873
|
+
}
|
|
5874
|
+
);
|
|
5875
|
+
})(),
|
|
5876
|
+
closable && /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flexShrink: 0, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: onClose }) })
|
|
5844
5877
|
]
|
|
5845
5878
|
}
|
|
5846
5879
|
) });
|
|
5847
5880
|
}
|
|
5848
5881
|
);
|
|
5849
|
-
var
|
|
5882
|
+
var SIZE10 = {
|
|
5850
5883
|
xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: 12, borderRadius: 4 },
|
|
5851
5884
|
sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: 14, borderRadius: 6 },
|
|
5852
5885
|
md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: 16, borderRadius: 6 },
|
|
@@ -5869,8 +5902,8 @@ var Textarea = React32__namespace.default.forwardRef(
|
|
|
5869
5902
|
unstyled: true,
|
|
5870
5903
|
className: className ? `lux-control ${className}` : "lux-control",
|
|
5871
5904
|
...CONTROL,
|
|
5872
|
-
...
|
|
5873
|
-
...
|
|
5905
|
+
...SIZE10[size],
|
|
5906
|
+
...VARIANT3[variant],
|
|
5874
5907
|
...rest,
|
|
5875
5908
|
onChange: handleChange
|
|
5876
5909
|
}
|
|
@@ -5979,20 +6012,55 @@ function fmtPct(n) {
|
|
|
5979
6012
|
if (n === void 0 || n === null) return "-";
|
|
5980
6013
|
return `${(n * 100).toFixed(1)}%`;
|
|
5981
6014
|
}
|
|
6015
|
+
var justify = (align) => align === "right" ? "flex-end" : align === "left" ? "flex-start" : "center";
|
|
5982
6016
|
function QuoteCell({ value, highlight, align = "right", onClick, className }) {
|
|
5983
6017
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5984
|
-
|
|
6018
|
+
gui.View,
|
|
5985
6019
|
{
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
align === "right" ? "text-right" : "text-left",
|
|
5989
|
-
highlight && "text-zinc-100",
|
|
5990
|
-
!highlight && "text-zinc-400",
|
|
5991
|
-
onClick && "cursor-pointer hover:bg-zinc-700/50 transition-colors",
|
|
5992
|
-
className
|
|
5993
|
-
),
|
|
6020
|
+
unstyled: true,
|
|
6021
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("td", {}),
|
|
5994
6022
|
onClick,
|
|
5995
|
-
|
|
6023
|
+
paddingHorizontal: 6,
|
|
6024
|
+
paddingVertical: 4,
|
|
6025
|
+
cursor: onClick ? "pointer" : void 0,
|
|
6026
|
+
transition: "quick",
|
|
6027
|
+
hoverStyle: onClick ? { backgroundColor: "var(--color-popover-item-hover)" } : void 0,
|
|
6028
|
+
style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
|
|
6029
|
+
className,
|
|
6030
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6031
|
+
gui.Text,
|
|
6032
|
+
{
|
|
6033
|
+
fontSize: 12,
|
|
6034
|
+
style: { fontFamily: "monospace", whiteSpace: "nowrap" },
|
|
6035
|
+
fontVariant: ["tabular-nums"],
|
|
6036
|
+
color: highlight ? "var(--color-text-primary)" : "var(--color-text-secondary)",
|
|
6037
|
+
children: value
|
|
6038
|
+
}
|
|
6039
|
+
)
|
|
6040
|
+
}
|
|
6041
|
+
);
|
|
6042
|
+
}
|
|
6043
|
+
function HeadCell({ children, colSpan, align = "center", size = "column", color }) {
|
|
6044
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6045
|
+
gui.View,
|
|
6046
|
+
{
|
|
6047
|
+
unstyled: true,
|
|
6048
|
+
render: colSpan ? /* @__PURE__ */ jsxRuntime.jsx("th", { colSpan }) : /* @__PURE__ */ jsxRuntime.jsx("th", {}),
|
|
6049
|
+
paddingHorizontal: size === "group" ? 8 : 6,
|
|
6050
|
+
paddingVertical: size === "group" ? 6 : 4,
|
|
6051
|
+
style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
|
|
6052
|
+
children: children != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6053
|
+
gui.Text,
|
|
6054
|
+
{
|
|
6055
|
+
fontSize: 10,
|
|
6056
|
+
fontWeight: size === "group" ? "600" : "500",
|
|
6057
|
+
textTransform: "uppercase",
|
|
6058
|
+
letterSpacing: 0.5,
|
|
6059
|
+
style: { whiteSpace: "nowrap" },
|
|
6060
|
+
color: color ?? "var(--color-text-secondary)",
|
|
6061
|
+
children
|
|
6062
|
+
}
|
|
6063
|
+
)
|
|
5996
6064
|
}
|
|
5997
6065
|
);
|
|
5998
6066
|
}
|
|
@@ -6023,71 +6091,51 @@ var OptionChain = React32__namespace.forwardRef(
|
|
|
6023
6091
|
[onSelectContract]
|
|
6024
6092
|
);
|
|
6025
6093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6026
|
-
|
|
6094
|
+
gui.View,
|
|
6027
6095
|
{
|
|
6028
6096
|
ref,
|
|
6029
|
-
|
|
6097
|
+
unstyled: true,
|
|
6098
|
+
width: "100%",
|
|
6099
|
+
overflowX: "auto",
|
|
6100
|
+
className,
|
|
6030
6101
|
...rest,
|
|
6031
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("table", {
|
|
6032
|
-
/* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
|
|
6033
|
-
/* @__PURE__ */ jsxRuntime.jsxs("tr", {
|
|
6034
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
colSpan: CALL_HEADERS.length,
|
|
6038
|
-
className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-emerald-400",
|
|
6039
|
-
children: "Calls"
|
|
6040
|
-
}
|
|
6041
|
-
),
|
|
6042
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-zinc-500", children: "Strike" }),
|
|
6043
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6044
|
-
"th",
|
|
6045
|
-
{
|
|
6046
|
-
colSpan: PUT_HEADERS.length,
|
|
6047
|
-
className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-red-400",
|
|
6048
|
-
children: "Puts"
|
|
6049
|
-
}
|
|
6050
|
-
)
|
|
6102
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("table", {}), width: "100%", style: { borderCollapse: "collapse" }, children: [
|
|
6103
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("thead", {}), children: [
|
|
6104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-border-divider)", children: [
|
|
6105
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadCell, { colSpan: CALL_HEADERS.length, size: "group", color: "var(--color-status-good)", children: "Calls" }),
|
|
6106
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadCell, { size: "group", children: "Strike" }),
|
|
6107
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadCell, { colSpan: PUT_HEADERS.length, size: "group", color: "var(--color-status-bad)", children: "Puts" })
|
|
6051
6108
|
] }),
|
|
6052
|
-
/* @__PURE__ */ jsxRuntime.jsxs("tr", {
|
|
6053
|
-
CALL_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6054
|
-
|
|
6055
|
-
{
|
|
6056
|
-
className: "px-1.5 py-1 text-right text-[10px] font-medium uppercase tracking-wider text-zinc-500",
|
|
6057
|
-
children: h
|
|
6058
|
-
},
|
|
6059
|
-
`call-${h}`
|
|
6060
|
-
)),
|
|
6061
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-center text-[10px] font-medium uppercase tracking-wider text-zinc-500" }),
|
|
6109
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-popover-item-hover)", children: [
|
|
6110
|
+
CALL_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(HeadCell, { align: "right", children: h }, `call-${h}`)),
|
|
6111
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadCell, {}),
|
|
6062
6112
|
PUT_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6063
|
-
|
|
6113
|
+
HeadCell,
|
|
6064
6114
|
{
|
|
6065
|
-
|
|
6066
|
-
"px-1.5 py-1 text-[10px] font-medium uppercase tracking-wider text-zinc-500",
|
|
6067
|
-
h === "Bid" || h === "Ask" || h === "Last" ? "text-left" : "text-right"
|
|
6068
|
-
),
|
|
6115
|
+
align: h === "Bid" || h === "Ask" || h === "Last" ? "left" : "right",
|
|
6069
6116
|
children: h
|
|
6070
6117
|
},
|
|
6071
6118
|
`put-${h}`
|
|
6072
6119
|
))
|
|
6073
6120
|
] })
|
|
6074
6121
|
] }),
|
|
6075
|
-
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: strikes.map((row) => {
|
|
6122
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tbody", {}), children: strikes.map((row) => {
|
|
6076
6123
|
const isATM = Math.abs(row.strike - spotPrice) <= (strikes.length > 1 ? Math.abs((strikes[1]?.strike ?? 0) - (strikes[0]?.strike ?? 0)) / 2 : 0.5);
|
|
6077
6124
|
const callITM = row.strike < spotPrice;
|
|
6078
6125
|
const putITM = row.strike > spotPrice;
|
|
6079
6126
|
const c = row.call;
|
|
6080
6127
|
const p = row.put;
|
|
6128
|
+
const rowBg = isATM ? "var(--secondary)" : callITM ? "color-mix(in srgb, var(--color-status-good) 12%, transparent)" : putITM ? "color-mix(in srgb, var(--color-status-bad) 12%, transparent)" : "transparent";
|
|
6081
6129
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6082
|
-
|
|
6130
|
+
gui.View,
|
|
6083
6131
|
{
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
),
|
|
6132
|
+
unstyled: true,
|
|
6133
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}),
|
|
6134
|
+
borderBottomWidth: 1,
|
|
6135
|
+
borderColor: "color-mix(in srgb, var(--color-border-divider) 50%, transparent)",
|
|
6136
|
+
transition: "quick",
|
|
6137
|
+
backgroundColor: rowBg,
|
|
6138
|
+
hoverStyle: isATM || callITM || putITM ? void 0 : { backgroundColor: "var(--color-popover-item-hover)" },
|
|
6091
6139
|
children: [
|
|
6092
6140
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6093
6141
|
QuoteCell,
|
|
@@ -6111,13 +6159,24 @@ var OptionChain = React32__namespace.forwardRef(
|
|
|
6111
6159
|
/* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmtPct(c?.iv) }),
|
|
6112
6160
|
/* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmt(c?.delta, 3) }),
|
|
6113
6161
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6114
|
-
|
|
6162
|
+
gui.View,
|
|
6115
6163
|
{
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6164
|
+
unstyled: true,
|
|
6165
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("td", {}),
|
|
6166
|
+
paddingHorizontal: 8,
|
|
6167
|
+
paddingVertical: 4,
|
|
6168
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center" },
|
|
6169
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6170
|
+
gui.Text,
|
|
6171
|
+
{
|
|
6172
|
+
fontSize: 12,
|
|
6173
|
+
fontWeight: "600",
|
|
6174
|
+
style: { fontFamily: "monospace" },
|
|
6175
|
+
fontVariant: ["tabular-nums"],
|
|
6176
|
+
color: isATM ? "var(--foreground)" : "var(--muted-foreground)",
|
|
6177
|
+
children: fmt(row.strike)
|
|
6178
|
+
}
|
|
6179
|
+
)
|
|
6121
6180
|
}
|
|
6122
6181
|
),
|
|
6123
6182
|
/* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmt(p?.delta, 3), align: "right" }),
|
|
@@ -6154,40 +6213,54 @@ var OptionChain = React32__namespace.forwardRef(
|
|
|
6154
6213
|
}
|
|
6155
6214
|
);
|
|
6156
6215
|
var GREEKS = [
|
|
6157
|
-
{ key: "delta", label: "Delta", symbol: "\u0394", color: "
|
|
6158
|
-
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "
|
|
6159
|
-
{ key: "theta", label: "Theta", symbol: "\u0398", color: "
|
|
6160
|
-
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "
|
|
6161
|
-
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "
|
|
6162
|
-
{ key: "iv", label: "IV", symbol: "\u03C3", color: "
|
|
6216
|
+
{ key: "delta", label: "Delta", symbol: "\u0394", color: "var(--foreground)", barColor: "var(--foreground)", decimals: 4, maxMagnitude: 1 },
|
|
6217
|
+
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "var(--chart-1)", barColor: "var(--chart-1)", decimals: 4, maxMagnitude: 0.1 },
|
|
6218
|
+
{ key: "theta", label: "Theta", symbol: "\u0398", color: "var(--chart-4)", barColor: "var(--chart-4)", decimals: 4, maxMagnitude: 1 },
|
|
6219
|
+
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "var(--chart-2)", barColor: "var(--chart-2)", decimals: 4, maxMagnitude: 1 },
|
|
6220
|
+
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "var(--chart-3)", barColor: "var(--chart-3)", decimals: 4, maxMagnitude: 1 },
|
|
6221
|
+
{ key: "iv", label: "IV", symbol: "\u03C3", color: "var(--chart-5)", barColor: "var(--chart-5)", decimals: 1, maxMagnitude: 100 }
|
|
6163
6222
|
];
|
|
6164
6223
|
function GreekItem({ def, value, compact }) {
|
|
6165
6224
|
const magnitude = Math.min(Math.abs(value) / def.maxMagnitude, 1);
|
|
6166
6225
|
const displayValue = def.key === "iv" ? `${(value * 100).toFixed(def.decimals)}%` : value.toFixed(def.decimals);
|
|
6167
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6168
|
-
"
|
|
6169
|
-
{
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6226
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, minWidth: compact ? 0 : 100, children: [
|
|
6227
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, fontWeight: "600", flexShrink: 0, color: def.color, children: def.symbol }),
|
|
6228
|
+
!compact && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, flexShrink: 0, width: 34, color: "var(--color-text-secondary)", children: def.label }),
|
|
6229
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6230
|
+
gui.Text,
|
|
6231
|
+
{
|
|
6232
|
+
fontSize: 12,
|
|
6233
|
+
flexShrink: 0,
|
|
6234
|
+
style: { fontFamily: "monospace" },
|
|
6235
|
+
fontVariant: ["tabular-nums"],
|
|
6236
|
+
color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-primary)",
|
|
6237
|
+
children: displayValue
|
|
6238
|
+
}
|
|
6239
|
+
),
|
|
6240
|
+
!compact && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6241
|
+
gui.View,
|
|
6242
|
+
{
|
|
6243
|
+
flex: 1,
|
|
6244
|
+
height: 4,
|
|
6245
|
+
borderRadius: 9999,
|
|
6246
|
+
minWidth: 24,
|
|
6247
|
+
maxWidth: 48,
|
|
6248
|
+
overflow: "hidden",
|
|
6249
|
+
backgroundColor: "var(--color-progress-track)",
|
|
6250
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6251
|
+
gui.View,
|
|
6183
6252
|
{
|
|
6184
|
-
|
|
6185
|
-
|
|
6253
|
+
height: "100%",
|
|
6254
|
+
borderRadius: 9999,
|
|
6255
|
+
transition: "quick",
|
|
6256
|
+
width: `${magnitude * 100}%`,
|
|
6257
|
+
opacity: 0.7,
|
|
6258
|
+
backgroundColor: def.barColor
|
|
6186
6259
|
}
|
|
6187
|
-
)
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
);
|
|
6260
|
+
)
|
|
6261
|
+
}
|
|
6262
|
+
)
|
|
6263
|
+
] });
|
|
6191
6264
|
}
|
|
6192
6265
|
var GreeksDisplay = React32__namespace.forwardRef(
|
|
6193
6266
|
function GreeksDisplay2(props, ref) {
|
|
@@ -6212,14 +6285,13 @@ var GreeksDisplay = React32__namespace.forwardRef(
|
|
|
6212
6285
|
};
|
|
6213
6286
|
const activeGreeks = GREEKS.filter((g) => values[g.key] !== void 0);
|
|
6214
6287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6215
|
-
|
|
6288
|
+
gui.XStack,
|
|
6216
6289
|
{
|
|
6217
6290
|
ref,
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
),
|
|
6291
|
+
flexWrap: "wrap",
|
|
6292
|
+
alignItems: "center",
|
|
6293
|
+
gap: compact ? 12 : 16,
|
|
6294
|
+
className,
|
|
6223
6295
|
...rest,
|
|
6224
6296
|
children: activeGreeks.map((g) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6225
6297
|
GreekItem,
|
|
@@ -6342,84 +6414,145 @@ var STRATEGY_PRESETS = [
|
|
|
6342
6414
|
]
|
|
6343
6415
|
}
|
|
6344
6416
|
];
|
|
6417
|
+
var MONO = "monospace";
|
|
6418
|
+
var CONTROL_BOX = {
|
|
6419
|
+
backgroundColor: "var(--color-input-bg)",
|
|
6420
|
+
borderWidth: 1,
|
|
6421
|
+
borderColor: "var(--color-input-border)",
|
|
6422
|
+
outlineWidth: 0,
|
|
6423
|
+
focusStyle: { borderColor: "var(--color-input-border-focus)" }
|
|
6424
|
+
};
|
|
6425
|
+
var CONTROL_INK = { color: "var(--color-input-fg)" };
|
|
6345
6426
|
function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemove }) {
|
|
6346
6427
|
const update2 = (patch) => {
|
|
6347
6428
|
onChange(index, { ...leg, ...patch });
|
|
6348
6429
|
};
|
|
6349
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
"
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6430
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6431
|
+
gui.XStack,
|
|
6432
|
+
{
|
|
6433
|
+
alignItems: "center",
|
|
6434
|
+
gap: 8,
|
|
6435
|
+
borderRadius: 6,
|
|
6436
|
+
backgroundColor: "var(--color-tag-subtle-bg)",
|
|
6437
|
+
paddingHorizontal: 8,
|
|
6438
|
+
paddingVertical: 6,
|
|
6439
|
+
children: [
|
|
6440
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, style: { fontFamily: MONO }, flexShrink: 0, width: 16, color: "var(--color-text-secondary)", children: index + 1 }),
|
|
6441
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6442
|
+
gui.XStack,
|
|
6443
|
+
{
|
|
6444
|
+
unstyled: true,
|
|
6445
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
6446
|
+
onClick: () => update2({ action: leg.action === "buy" ? "sell" : "buy" }),
|
|
6447
|
+
paddingHorizontal: 8,
|
|
6448
|
+
paddingVertical: 2,
|
|
6449
|
+
borderRadius: 4,
|
|
6450
|
+
borderWidth: 0,
|
|
6451
|
+
cursor: "pointer",
|
|
6452
|
+
transition: "quick",
|
|
6453
|
+
backgroundColor: leg.action === "buy" ? "color-mix(in srgb, var(--color-status-good) 20%, transparent)" : "color-mix(in srgb, var(--color-status-bad) 20%, transparent)",
|
|
6454
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", color: leg.action === "buy" ? "var(--color-status-good)" : "var(--color-status-bad)", children: leg.action === "buy" ? "BUY" : "SELL" })
|
|
6455
|
+
}
|
|
6358
6456
|
),
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6457
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6458
|
+
gui.XStack,
|
|
6459
|
+
{
|
|
6460
|
+
unstyled: true,
|
|
6461
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
6462
|
+
onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
|
|
6463
|
+
paddingHorizontal: 8,
|
|
6464
|
+
paddingVertical: 2,
|
|
6465
|
+
borderRadius: 4,
|
|
6466
|
+
borderWidth: 0,
|
|
6467
|
+
cursor: "pointer",
|
|
6468
|
+
transition: "quick",
|
|
6469
|
+
backgroundColor: leg.type === "call" ? "var(--secondary)" : "var(--muted)",
|
|
6470
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "500", color: leg.type === "call" ? "var(--foreground)" : "var(--muted-foreground)", children: leg.type === "call" ? "CALL" : "PUT" })
|
|
6471
|
+
}
|
|
6371
6472
|
),
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6474
|
+
gui.View,
|
|
6475
|
+
{
|
|
6476
|
+
unstyled: true,
|
|
6477
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("select", { value: leg.strike, onChange: (e) => update2({ strike: Number(e.target.value) }) }),
|
|
6478
|
+
...CONTROL_BOX,
|
|
6479
|
+
borderRadius: 4,
|
|
6480
|
+
paddingHorizontal: 6,
|
|
6481
|
+
paddingVertical: 2,
|
|
6482
|
+
minWidth: 72,
|
|
6483
|
+
style: { ...CONTROL_INK, fontFamily: MONO, fontSize: 12 },
|
|
6484
|
+
children: strikes.map((s) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: s, children: s.toFixed(2) }, s))
|
|
6485
|
+
}
|
|
6486
|
+
),
|
|
6487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6488
|
+
gui.View,
|
|
6489
|
+
{
|
|
6490
|
+
unstyled: true,
|
|
6491
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("select", { value: leg.expiration, onChange: (e) => update2({ expiration: e.target.value }) }),
|
|
6492
|
+
...CONTROL_BOX,
|
|
6493
|
+
borderRadius: 4,
|
|
6494
|
+
paddingHorizontal: 6,
|
|
6495
|
+
paddingVertical: 2,
|
|
6496
|
+
minWidth: 80,
|
|
6497
|
+
style: { ...CONTROL_INK, fontSize: 12 },
|
|
6498
|
+
children: expirations.map((exp) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: exp, children: exp }, exp))
|
|
6499
|
+
}
|
|
6500
|
+
),
|
|
6501
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6502
|
+
gui.View,
|
|
6503
|
+
{
|
|
6504
|
+
unstyled: true,
|
|
6505
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6506
|
+
"input",
|
|
6507
|
+
{
|
|
6508
|
+
type: "number",
|
|
6509
|
+
min: 1,
|
|
6510
|
+
max: 999,
|
|
6511
|
+
value: leg.quantity,
|
|
6512
|
+
onChange: (e) => update2({ quantity: Math.max(1, parseInt(e.target.value, 10) || 1) })
|
|
6513
|
+
}
|
|
6514
|
+
),
|
|
6515
|
+
...CONTROL_BOX,
|
|
6516
|
+
borderRadius: 4,
|
|
6517
|
+
paddingHorizontal: 6,
|
|
6518
|
+
paddingVertical: 2,
|
|
6519
|
+
width: 48,
|
|
6520
|
+
style: { ...CONTROL_INK, fontFamily: MONO, fontSize: 12, textAlign: "center" }
|
|
6521
|
+
}
|
|
6522
|
+
),
|
|
6523
|
+
leg.premium !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6524
|
+
gui.Text,
|
|
6525
|
+
{
|
|
6526
|
+
fontSize: 12,
|
|
6527
|
+
style: { fontFamily: MONO },
|
|
6528
|
+
fontVariant: ["tabular-nums"],
|
|
6529
|
+
marginLeft: "auto",
|
|
6530
|
+
color: leg.premium >= 0 ? "var(--color-status-good)" : "var(--color-status-bad)",
|
|
6531
|
+
children: [
|
|
6532
|
+
leg.premium >= 0 ? "+" : "",
|
|
6533
|
+
leg.premium.toFixed(2)
|
|
6534
|
+
]
|
|
6535
|
+
}
|
|
6536
|
+
),
|
|
6537
|
+
removable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6538
|
+
gui.XStack,
|
|
6539
|
+
{
|
|
6540
|
+
unstyled: true,
|
|
6541
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Remove leg" }),
|
|
6542
|
+
onClick: () => onRemove(index),
|
|
6543
|
+
marginLeft: "auto",
|
|
6544
|
+
padding: 2,
|
|
6545
|
+
borderWidth: 0,
|
|
6546
|
+
cursor: "pointer",
|
|
6547
|
+
transition: "quick",
|
|
6548
|
+
style: { color: "var(--color-text-secondary)" },
|
|
6549
|
+
hoverStyle: { opacity: 0.7 },
|
|
6550
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
6551
|
+
}
|
|
6552
|
+
)
|
|
6553
|
+
]
|
|
6554
|
+
}
|
|
6555
|
+
);
|
|
6423
6556
|
}
|
|
6424
6557
|
var StrategyBuilder = React32__namespace.forwardRef(
|
|
6425
6558
|
function StrategyBuilder2(props, ref) {
|
|
@@ -6489,37 +6622,46 @@ var StrategyBuilder = React32__namespace.forwardRef(
|
|
|
6489
6622
|
});
|
|
6490
6623
|
}, [onSubmit, strategyType, legs, netPremium]);
|
|
6491
6624
|
const currentPreset = STRATEGY_PRESETS.find((p) => p.value === strategyType);
|
|
6625
|
+
const netColor = netPremium > 0 ? "var(--color-status-good)" : netPremium < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)";
|
|
6492
6626
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6493
|
-
|
|
6627
|
+
gui.YStack,
|
|
6494
6628
|
{
|
|
6495
6629
|
ref,
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
),
|
|
6630
|
+
gap: 12,
|
|
6631
|
+
borderRadius: 8,
|
|
6632
|
+
borderWidth: 1,
|
|
6633
|
+
borderColor: "var(--color-border-divider)",
|
|
6634
|
+
backgroundColor: "var(--card)",
|
|
6635
|
+
padding: 12,
|
|
6636
|
+
className,
|
|
6500
6637
|
...rest,
|
|
6501
6638
|
children: [
|
|
6502
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6503
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6504
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6505
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6639
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", gap: 12, children: [
|
|
6640
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 8, children: [
|
|
6641
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", letterSpacing: 0.6, color: "var(--color-text-secondary)", children: "Strategy" }),
|
|
6642
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, fontWeight: "500", color: "var(--color-text-primary)", children: underlying })
|
|
6506
6643
|
] }),
|
|
6507
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6644
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
|
|
6508
6645
|
"Spot: ",
|
|
6509
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6646
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { style: { fontFamily: MONO }, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: spotPrice.toFixed(2) })
|
|
6510
6647
|
] })
|
|
6511
6648
|
] }),
|
|
6512
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6513
|
-
|
|
6649
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6650
|
+
gui.View,
|
|
6514
6651
|
{
|
|
6515
|
-
|
|
6516
|
-
onChange: handleStrategyChange,
|
|
6517
|
-
|
|
6652
|
+
unstyled: true,
|
|
6653
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("select", { value: strategyType, onChange: handleStrategyChange }),
|
|
6654
|
+
flex: 1,
|
|
6655
|
+
...CONTROL_BOX,
|
|
6656
|
+
borderRadius: 6,
|
|
6657
|
+
paddingHorizontal: 10,
|
|
6658
|
+
paddingVertical: 6,
|
|
6659
|
+
style: { ...CONTROL_INK, fontSize: 14 },
|
|
6518
6660
|
children: STRATEGY_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: preset.value, children: preset.label }, preset.value))
|
|
6519
6661
|
}
|
|
6520
6662
|
) }),
|
|
6521
|
-
currentPreset && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6522
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6663
|
+
currentPreset && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 11, marginTop: -4, color: "var(--color-text-secondary)", children: currentPreset.description }),
|
|
6664
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: 6, children: legs.map((leg, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6523
6665
|
LegRow,
|
|
6524
6666
|
{
|
|
6525
6667
|
leg,
|
|
@@ -6533,40 +6675,53 @@ var StrategyBuilder = React32__namespace.forwardRef(
|
|
|
6533
6675
|
i
|
|
6534
6676
|
)) }),
|
|
6535
6677
|
strategyType === "custom" && legs.length < 4 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6536
|
-
|
|
6678
|
+
gui.XStack,
|
|
6537
6679
|
{
|
|
6538
|
-
|
|
6680
|
+
unstyled: true,
|
|
6681
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
6539
6682
|
onClick: handleAddLeg,
|
|
6540
|
-
|
|
6683
|
+
alignItems: "center",
|
|
6684
|
+
justifyContent: "center",
|
|
6685
|
+
gap: 4,
|
|
6686
|
+
borderRadius: 6,
|
|
6687
|
+
borderWidth: 1,
|
|
6688
|
+
paddingVertical: 4,
|
|
6689
|
+
cursor: "pointer",
|
|
6690
|
+
transition: "quick",
|
|
6691
|
+
borderColor: "var(--color-border-divider)",
|
|
6692
|
+
hoverStyle: { borderColor: "var(--color-hover)" },
|
|
6693
|
+
style: { color: "var(--color-text-secondary)", borderStyle: "dashed" },
|
|
6541
6694
|
children: [
|
|
6542
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", {
|
|
6543
|
-
"Add Leg"
|
|
6695
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }),
|
|
6696
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: "var(--color-text-secondary)", children: "Add Leg" })
|
|
6544
6697
|
]
|
|
6545
6698
|
}
|
|
6546
6699
|
),
|
|
6547
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6548
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6549
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6550
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
6551
|
-
"font-mono tabular-nums text-sm font-semibold",
|
|
6552
|
-
netPremium > 0 ? "text-emerald-400" : netPremium < 0 ? "text-red-400" : "text-zinc-400"
|
|
6553
|
-
), children: [
|
|
6700
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", paddingTop: 4, borderTopWidth: 1, borderColor: "var(--color-border-divider)", children: [
|
|
6701
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 8, children: [
|
|
6702
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, color: "var(--color-text-secondary)", children: "Net:" }),
|
|
6703
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 14, fontWeight: "600", style: { fontFamily: MONO }, fontVariant: ["tabular-nums"], color: netColor, children: [
|
|
6554
6704
|
netPremium > 0 ? "Credit " : netPremium < 0 ? "Debit " : "",
|
|
6555
6705
|
netPremium !== 0 ? `$${Math.abs(netPremium).toFixed(2)}` : "-"
|
|
6556
6706
|
] })
|
|
6557
6707
|
] }),
|
|
6558
6708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6559
|
-
|
|
6709
|
+
gui.XStack,
|
|
6560
6710
|
{
|
|
6561
|
-
|
|
6711
|
+
unstyled: true,
|
|
6712
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
6562
6713
|
onClick: handleSubmit,
|
|
6563
6714
|
disabled: legs.length === 0,
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6715
|
+
paddingHorizontal: 16,
|
|
6716
|
+
paddingVertical: 6,
|
|
6717
|
+
borderRadius: 6,
|
|
6718
|
+
borderWidth: 0,
|
|
6719
|
+
cursor: "pointer",
|
|
6720
|
+
transition: "quick",
|
|
6721
|
+
backgroundColor: "var(--color-button-solid-bg)",
|
|
6722
|
+
hoverStyle: { backgroundColor: "var(--color-hover)" },
|
|
6723
|
+
disabledStyle: { opacity: 0.4, cursor: "not-allowed" },
|
|
6724
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", color: "var(--color-button-solid-text)", children: "Review Order" })
|
|
6570
6725
|
}
|
|
6571
6726
|
)
|
|
6572
6727
|
] })
|
|
@@ -6706,19 +6861,21 @@ var PnlDiagram = React32__namespace.forwardRef(
|
|
|
6706
6861
|
chartH
|
|
6707
6862
|
);
|
|
6708
6863
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6709
|
-
|
|
6864
|
+
gui.View,
|
|
6710
6865
|
{
|
|
6711
6866
|
ref,
|
|
6712
|
-
|
|
6867
|
+
unstyled: true,
|
|
6868
|
+
width: "100%",
|
|
6869
|
+
className,
|
|
6713
6870
|
...rest,
|
|
6714
6871
|
children: [
|
|
6715
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6872
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { unstyled: true, ref: containerRef, width: "100%", height: "100%", minHeight: 200, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6716
6873
|
"svg",
|
|
6717
6874
|
{
|
|
6718
6875
|
width,
|
|
6719
6876
|
height,
|
|
6720
6877
|
viewBox: `0 0 ${width} ${height}`,
|
|
6721
|
-
|
|
6878
|
+
style: { userSelect: "none" },
|
|
6722
6879
|
onMouseMove: handleMouseMove,
|
|
6723
6880
|
onMouseLeave: handleMouseLeave,
|
|
6724
6881
|
children: [
|
|
@@ -6957,16 +7114,18 @@ var PnlDiagram = React32__namespace.forwardRef(
|
|
|
6957
7114
|
]
|
|
6958
7115
|
}
|
|
6959
7116
|
) }),
|
|
6960
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6961
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6962
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6963
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7117
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { flexWrap: "wrap", alignItems: "center", gap: 16, paddingHorizontal: 8, paddingTop: 4, children: [
|
|
7118
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
|
|
7119
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { height: 2, width: 16, borderRadius: 4, backgroundColor: "var(--color-gray-200)" }),
|
|
7120
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: "Combined" })
|
|
6964
7121
|
] }),
|
|
6965
|
-
legs.map((leg, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7122
|
+
legs.map((leg, i) => /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
|
|
6966
7123
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6967
|
-
|
|
7124
|
+
gui.View,
|
|
6968
7125
|
{
|
|
6969
|
-
|
|
7126
|
+
height: 2,
|
|
7127
|
+
width: 16,
|
|
7128
|
+
borderRadius: 4,
|
|
6970
7129
|
style: {
|
|
6971
7130
|
backgroundColor: LEG_COLORS[i % LEG_COLORS.length],
|
|
6972
7131
|
opacity: 0.6,
|
|
@@ -6974,7 +7133,7 @@ var PnlDiagram = React32__namespace.forwardRef(
|
|
|
6974
7133
|
}
|
|
6975
7134
|
}
|
|
6976
7135
|
),
|
|
6977
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7136
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
|
|
6978
7137
|
leg.action === "buy" ? "B" : "S",
|
|
6979
7138
|
" ",
|
|
6980
7139
|
leg.quantity,
|
|
@@ -6984,9 +7143,9 @@ var PnlDiagram = React32__namespace.forwardRef(
|
|
|
6984
7143
|
leg.type === "call" ? "C" : "P"
|
|
6985
7144
|
] })
|
|
6986
7145
|
] }, i)),
|
|
6987
|
-
breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6988
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6989
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7146
|
+
breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
|
|
7147
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { width: 6, height: 6, borderRadius: 9999, style: { background: BREAKEVEN_COLOR } }),
|
|
7148
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
|
|
6990
7149
|
"BE: ",
|
|
6991
7150
|
breakevens.map((b) => b.toFixed(1)).join(", ")
|
|
6992
7151
|
] })
|
|
@@ -7001,6 +7160,7 @@ function formatDate(date) {
|
|
|
7001
7160
|
const d = new Date(date);
|
|
7002
7161
|
return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
7003
7162
|
}
|
|
7163
|
+
var MONO2 = { fontFamily: "monospace" };
|
|
7004
7164
|
var OptionPositionCard = React32__namespace.forwardRef(
|
|
7005
7165
|
function OptionPositionCard2(props, ref) {
|
|
7006
7166
|
const {
|
|
@@ -7014,64 +7174,76 @@ var OptionPositionCard = React32__namespace.forwardRef(
|
|
|
7014
7174
|
const isLong = position.quantity > 0;
|
|
7015
7175
|
const isCall = position.type === "call";
|
|
7016
7176
|
const isProfitable = position.pnl >= 0;
|
|
7177
|
+
const pnlColor = isProfitable ? "var(--color-status-good)" : "var(--color-status-bad)";
|
|
7017
7178
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7018
|
-
|
|
7179
|
+
gui.YStack,
|
|
7019
7180
|
{
|
|
7020
7181
|
ref,
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
),
|
|
7182
|
+
gap: 8,
|
|
7183
|
+
borderRadius: 8,
|
|
7184
|
+
borderWidth: 1,
|
|
7185
|
+
borderColor: "var(--color-border-divider)",
|
|
7186
|
+
backgroundColor: "var(--card)",
|
|
7187
|
+
padding: 12,
|
|
7188
|
+
className,
|
|
7025
7189
|
...rest,
|
|
7026
7190
|
children: [
|
|
7027
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7028
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7191
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", children: [
|
|
7192
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7193
|
+
gui.XStack,
|
|
7194
|
+
{
|
|
7195
|
+
alignItems: "center",
|
|
7196
|
+
gap: 4,
|
|
7197
|
+
borderRadius: 4,
|
|
7198
|
+
paddingHorizontal: 6,
|
|
7199
|
+
paddingVertical: 2,
|
|
7200
|
+
backgroundColor: isCall ? "var(--secondary)" : "var(--muted)",
|
|
7201
|
+
children: [
|
|
7202
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.underlying }),
|
|
7203
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", style: MONO2, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
|
|
7204
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.type === "call" ? "C" : "P" }),
|
|
7205
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "400", color: "var(--color-text-secondary)", children: formatDate(position.expiration) })
|
|
7206
|
+
]
|
|
7207
|
+
}
|
|
7208
|
+
) }),
|
|
7209
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7210
|
+
gui.Text,
|
|
7211
|
+
{
|
|
7212
|
+
fontSize: 12,
|
|
7213
|
+
fontWeight: "600",
|
|
7214
|
+
style: MONO2,
|
|
7215
|
+
fontVariant: ["tabular-nums"],
|
|
7216
|
+
color: isLong ? "var(--color-status-good)" : "var(--color-status-bad)",
|
|
7217
|
+
children: [
|
|
7218
|
+
isLong ? "+" : "",
|
|
7219
|
+
position.quantity
|
|
7220
|
+
]
|
|
7221
|
+
}
|
|
7222
|
+
)
|
|
7045
7223
|
] }),
|
|
7046
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7047
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7048
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7049
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7224
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: 12, children: [
|
|
7225
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, children: [
|
|
7226
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Avg Cost" }),
|
|
7227
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, style: MONO2, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
|
|
7050
7228
|
"$",
|
|
7051
7229
|
position.avgCost.toFixed(2)
|
|
7052
7230
|
] })
|
|
7053
7231
|
] }),
|
|
7054
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7055
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7056
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7232
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, children: [
|
|
7233
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Value" }),
|
|
7234
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, style: MONO2, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
|
|
7057
7235
|
"$",
|
|
7058
7236
|
position.currentValue.toFixed(2)
|
|
7059
7237
|
] })
|
|
7060
7238
|
] }),
|
|
7061
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7062
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7063
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7064
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
7065
|
-
"font-mono tabular-nums text-xs font-semibold",
|
|
7066
|
-
isProfitable ? "text-emerald-400" : "text-red-400"
|
|
7067
|
-
), children: [
|
|
7239
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, alignItems: "flex-end", children: [
|
|
7240
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "P/L" }),
|
|
7241
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 4, children: [
|
|
7242
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, fontWeight: "600", style: MONO2, fontVariant: ["tabular-nums"], color: pnlColor, children: [
|
|
7068
7243
|
isProfitable ? "+" : "",
|
|
7069
7244
|
position.pnl.toFixed(2)
|
|
7070
7245
|
] }),
|
|
7071
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
7072
|
-
"font-mono tabular-nums text-[10px]",
|
|
7073
|
-
isProfitable ? "text-emerald-500/70" : "text-red-500/70"
|
|
7074
|
-
), children: [
|
|
7246
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, style: MONO2, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
|
|
7075
7247
|
"(",
|
|
7076
7248
|
isProfitable ? "+" : "",
|
|
7077
7249
|
position.pnlPercent.toFixed(1),
|
|
@@ -7080,53 +7252,47 @@ var OptionPositionCard = React32__namespace.forwardRef(
|
|
|
7080
7252
|
] })
|
|
7081
7253
|
] })
|
|
7082
7254
|
] }),
|
|
7083
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7084
|
-
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "
|
|
7085
|
-
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "
|
|
7086
|
-
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "
|
|
7087
|
-
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "
|
|
7255
|
+
/* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 12, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
|
|
7256
|
+
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "var(--foreground)" }),
|
|
7257
|
+
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "var(--chart-1)" }),
|
|
7258
|
+
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "var(--chart-4)" }),
|
|
7259
|
+
/* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "var(--chart-2)" })
|
|
7088
7260
|
] }),
|
|
7089
|
-
(onClose || onExercise || onRoll) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7090
|
-
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
type: "button",
|
|
7094
|
-
onClick: () => onClose(position),
|
|
7095
|
-
className: "flex-1 rounded-md bg-zinc-800 px-2 py-1 text-xs font-medium text-zinc-300 hover:bg-zinc-700 hover:text-zinc-100 transition-colors",
|
|
7096
|
-
children: "Close"
|
|
7097
|
-
}
|
|
7098
|
-
),
|
|
7099
|
-
onExercise && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7100
|
-
"button",
|
|
7101
|
-
{
|
|
7102
|
-
type: "button",
|
|
7103
|
-
onClick: () => onExercise(position),
|
|
7104
|
-
className: "flex-1 rounded-md bg-zinc-800 px-2 py-1 text-xs font-medium text-zinc-300 hover:bg-zinc-700 hover:text-zinc-100 transition-colors",
|
|
7105
|
-
children: "Exercise"
|
|
7106
|
-
}
|
|
7107
|
-
),
|
|
7108
|
-
onRoll && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7109
|
-
"button",
|
|
7110
|
-
{
|
|
7111
|
-
type: "button",
|
|
7112
|
-
onClick: () => onRoll(position),
|
|
7113
|
-
className: "flex-1 rounded-md bg-zinc-800 px-2 py-1 text-xs font-medium text-zinc-300 hover:bg-zinc-700 hover:text-zinc-100 transition-colors",
|
|
7114
|
-
children: "Roll"
|
|
7115
|
-
}
|
|
7116
|
-
)
|
|
7261
|
+
(onClose || onExercise || onRoll) && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 8, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
|
|
7262
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onClose(position), children: "Close" }),
|
|
7263
|
+
onExercise && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onExercise(position), children: "Exercise" }),
|
|
7264
|
+
onRoll && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onRoll(position), children: "Roll" })
|
|
7117
7265
|
] })
|
|
7118
7266
|
]
|
|
7119
7267
|
}
|
|
7120
7268
|
);
|
|
7121
7269
|
}
|
|
7122
7270
|
);
|
|
7271
|
+
function ActionButton({ onClick, children }) {
|
|
7272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7273
|
+
gui.XStack,
|
|
7274
|
+
{
|
|
7275
|
+
unstyled: true,
|
|
7276
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
7277
|
+
onClick,
|
|
7278
|
+
flex: 1,
|
|
7279
|
+
alignItems: "center",
|
|
7280
|
+
justifyContent: "center",
|
|
7281
|
+
borderRadius: 6,
|
|
7282
|
+
borderWidth: 0,
|
|
7283
|
+
paddingHorizontal: 8,
|
|
7284
|
+
paddingVertical: 4,
|
|
7285
|
+
backgroundColor: "var(--color-button-subtle-bg)",
|
|
7286
|
+
cursor: "pointer",
|
|
7287
|
+
hoverStyle: { color: "var(--color-hover)" },
|
|
7288
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "500", color: "var(--color-button-subtle-fg)", children })
|
|
7289
|
+
}
|
|
7290
|
+
);
|
|
7291
|
+
}
|
|
7123
7292
|
function GreekPill({ label, value, color }) {
|
|
7124
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7125
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7126
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
7127
|
-
"font-mono tabular-nums text-[11px]",
|
|
7128
|
-
value < 0 ? "text-red-400" : "text-zinc-400"
|
|
7129
|
-
), children: value.toFixed(4) })
|
|
7293
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 4, children: [
|
|
7294
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, fontWeight: "600", color, children: label }),
|
|
7295
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 11, style: MONO2, fontVariant: ["tabular-nums"], color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)", children: value.toFixed(4) })
|
|
7130
7296
|
] });
|
|
7131
7297
|
}
|
|
7132
7298
|
function formatExpDate(date) {
|
|
@@ -7139,28 +7305,53 @@ var GROUP_LABELS = {
|
|
|
7139
7305
|
monthly: "Monthly",
|
|
7140
7306
|
quarterly: "Quarterly"
|
|
7141
7307
|
};
|
|
7308
|
+
var SHAPE = {
|
|
7309
|
+
selected: {
|
|
7310
|
+
borderColor: "transparent",
|
|
7311
|
+
backgroundColor: "var(--color-selected-control-bg)",
|
|
7312
|
+
color: "var(--color-selected-control-text)"
|
|
7313
|
+
},
|
|
7314
|
+
resting: {
|
|
7315
|
+
borderColor: "var(--color-border-divider)",
|
|
7316
|
+
backgroundColor: "var(--card)",
|
|
7317
|
+
color: "var(--color-text-secondary)",
|
|
7318
|
+
hoverStyle: { borderColor: "var(--color-hover)", color: "var(--color-hover)" }
|
|
7319
|
+
}
|
|
7320
|
+
};
|
|
7142
7321
|
function ExpirationPill({ exp, isSelected, onClick }) {
|
|
7322
|
+
const shape = isSelected ? SHAPE.selected : SHAPE.resting;
|
|
7323
|
+
const dteColor = exp.dte <= 7 && !isSelected ? "var(--color-status-warn)" : isSelected ? "var(--color-selected-control-text)" : "var(--muted-foreground)";
|
|
7143
7324
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7144
|
-
|
|
7325
|
+
gui.YStack,
|
|
7145
7326
|
{
|
|
7146
|
-
|
|
7327
|
+
unstyled: true,
|
|
7328
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
7147
7329
|
onClick,
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7330
|
+
alignItems: "center",
|
|
7331
|
+
gap: 2,
|
|
7332
|
+
borderRadius: 6,
|
|
7333
|
+
paddingHorizontal: 12,
|
|
7334
|
+
paddingVertical: 6,
|
|
7335
|
+
flexShrink: 0,
|
|
7336
|
+
borderWidth: 1,
|
|
7337
|
+
borderStyle: "solid",
|
|
7338
|
+
cursor: "pointer",
|
|
7339
|
+
...shape,
|
|
7153
7340
|
children: [
|
|
7154
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
7155
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7341
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Text, { unstyled: true, fontSize: 12, fontWeight: "500", style: { whiteSpace: "nowrap" }, children: formatExpDate(exp.date) }),
|
|
7342
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7343
|
+
gui.Text,
|
|
7344
|
+
{
|
|
7345
|
+
fontVariant: ["tabular-nums"],
|
|
7346
|
+
style: { fontFamily: "monospace" },
|
|
7347
|
+
fontSize: 10,
|
|
7348
|
+
color: dteColor,
|
|
7349
|
+
children: [
|
|
7350
|
+
exp.dte,
|
|
7351
|
+
"d"
|
|
7352
|
+
]
|
|
7353
|
+
}
|
|
7354
|
+
)
|
|
7164
7355
|
]
|
|
7165
7356
|
}
|
|
7166
7357
|
);
|
|
@@ -7190,49 +7381,23 @@ var ExpirationSelector = React32__namespace.forwardRef(
|
|
|
7190
7381
|
label: GROUP_LABELS[type],
|
|
7191
7382
|
items: expirations.filter((e) => e.type === type)
|
|
7192
7383
|
})).filter((g) => g.items.length > 0);
|
|
7193
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
ref,
|
|
7197
|
-
className: cn("flex flex-col gap-2", className),
|
|
7198
|
-
...rest,
|
|
7199
|
-
children: grouped.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
7200
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-zinc-600 px-1", children: group.label }),
|
|
7201
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 overflow-x-auto no-scrollbar", children: group.items.map((exp) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7202
|
-
ExpirationPill,
|
|
7203
|
-
{
|
|
7204
|
-
exp,
|
|
7205
|
-
isSelected: exp.date === selected,
|
|
7206
|
-
onClick: () => onSelect(exp.date)
|
|
7207
|
-
}
|
|
7208
|
-
) }, exp.date)) })
|
|
7209
|
-
] }, group.type))
|
|
7210
|
-
}
|
|
7211
|
-
);
|
|
7212
|
-
}
|
|
7213
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7214
|
-
"div",
|
|
7215
|
-
{
|
|
7216
|
-
ref,
|
|
7217
|
-
className: cn("flex items-center gap-1", className),
|
|
7218
|
-
...rest,
|
|
7219
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7220
|
-
"div",
|
|
7384
|
+
return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { ref, gap: 8, className, ...rest, children: grouped.map((group) => /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: 4, children: [
|
|
7385
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7386
|
+
gui.Text,
|
|
7221
7387
|
{
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
onClick: () => onSelect(exp.date)
|
|
7230
|
-
}
|
|
7231
|
-
) }, exp.date))
|
|
7388
|
+
fontSize: 10,
|
|
7389
|
+
fontWeight: "600",
|
|
7390
|
+
textTransform: "uppercase",
|
|
7391
|
+
letterSpacing: 0.5,
|
|
7392
|
+
paddingHorizontal: 4,
|
|
7393
|
+
color: "var(--color-text-secondary)",
|
|
7394
|
+
children: group.label
|
|
7232
7395
|
}
|
|
7233
|
-
)
|
|
7234
|
-
|
|
7235
|
-
|
|
7396
|
+
),
|
|
7397
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { gap: 6, overflowX: "auto", overflowY: "hidden", className: "lux-no-scrollbar", children: group.items.map((exp) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(ExpirationPill, { exp, isSelected: exp.date === selected, onClick: () => onSelect(exp.date) }) }, exp.date)) })
|
|
7398
|
+
] }, group.type)) });
|
|
7399
|
+
}
|
|
7400
|
+
return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { ref, alignItems: "center", gap: 4, className, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { ref: scrollRef, gap: 6, overflowX: "auto", overflowY: "hidden", className: "lux-no-scrollbar", children: expirations.map((exp) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(ExpirationPill, { exp, isSelected: exp.date === selected, onClick: () => onSelect(exp.date) }) }, exp.date)) }) });
|
|
7236
7401
|
}
|
|
7237
7402
|
);
|
|
7238
7403
|
var bankColors = {
|