@luxfi/ui 7.4.11 → 7.4.12
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 -46
- package/dist/avatar.js +52 -48
- 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 +756 -703
- package/dist/index.js +757 -704
- 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/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.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 -67
- package/dist/radio.d.cts +18 -18
- package/dist/radio.d.ts +18 -18
- package/dist/radio.js +36 -68
- package/dist/slider.cjs +33 -49
- package/dist/slider.js +34 -50
- package/dist/switch.cjs +48 -55
- package/dist/switch.js +49 -56
- package/dist/tag.cjs +112 -69
- package/dist/tag.js +113 -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 -37
- 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 +136 -114
- package/src/pin-input.tsx +37 -29
- package/src/pnl-diagram.tsx +36 -28
- package/src/progress.tsx +17 -21
- package/src/radio.tsx +56 -75
- package/src/slider.tsx +43 -44
- package/src/strategy-builder.tsx +245 -156
- 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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createGui, styled, View, Sheet, Dialog, Avatar as Avatar$1, TooltipGroup, Tooltip as Tooltip$1,
|
|
2
|
+
import { createGui, styled, View, Sheet, Dialog, XStack, YStack, Text, Avatar as Avatar$1, TooltipGroup, Tooltip as Tooltip$1, Label, Checkbox, VisuallyHidden, H3, H2, H1, Input as Input$1, Popover, Progress as Progress$1, RadioGroup, Select as Select$1, Separator as Separator$1, Slider as Slider$1, Switch, TextArea, GuiProvider, Menu, Accordion, Collapsible, Tabs, useTabsContext, ToastProvider, ToastViewport, Toast } from '@hanzo/gui';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import * as React32 from 'react';
|
|
5
5
|
import React32__default, { Children, createElement } from 'react';
|
|
@@ -542,23 +542,19 @@ var CloseButtonFrame = styled(View, {
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
|
-
var CLOSE_BUTTON_CLASSES = [
|
|
546
|
-
"text-[var(--closeButton-fg,currentColor)]",
|
|
547
|
-
"hover:text-[var(--hover-color,currentColor)]",
|
|
548
|
-
"disabled:opacity-40"
|
|
549
|
-
].join(" ");
|
|
550
545
|
var CloseButton = React32.forwardRef(function CloseButton2(props, ref) {
|
|
551
546
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
552
547
|
return /* @__PURE__ */ jsx(
|
|
553
548
|
CloseButtonFrame,
|
|
554
549
|
{
|
|
555
550
|
ref,
|
|
556
|
-
className
|
|
551
|
+
className,
|
|
557
552
|
...rest,
|
|
558
553
|
children: children ?? /* @__PURE__ */ jsx(
|
|
559
554
|
"svg",
|
|
560
555
|
{
|
|
561
|
-
|
|
556
|
+
width: 20,
|
|
557
|
+
height: 20,
|
|
562
558
|
viewBox: "0 0 20 20",
|
|
563
559
|
fill: "none",
|
|
564
560
|
"aria-hidden": "true",
|
|
@@ -1456,22 +1452,30 @@ function LoadingBar({ loading = true }) {
|
|
|
1456
1452
|
if (!loading) return null;
|
|
1457
1453
|
return /* @__PURE__ */ jsx("div", { className: "lux-loading", role: "progressbar", "aria-busy": "true", "aria-label": "Loading" });
|
|
1458
1454
|
}
|
|
1459
|
-
var IndicatorIcon2 = (
|
|
1460
|
-
var ALERT_BASE =
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1455
|
+
var IndicatorIcon2 = () => /* @__PURE__ */ jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ 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" }) });
|
|
1456
|
+
var ALERT_BASE = {
|
|
1457
|
+
width: "100%",
|
|
1458
|
+
position: "relative",
|
|
1459
|
+
alignItems: "flex-start",
|
|
1460
|
+
borderRadius: 4,
|
|
1461
|
+
gap: 8,
|
|
1462
|
+
paddingVertical: 8
|
|
1467
1463
|
};
|
|
1468
|
-
var
|
|
1469
|
-
|
|
1470
|
-
|
|
1464
|
+
var ALERT_FG = "var(--color-alert-fg)";
|
|
1465
|
+
var STATUS_BG = {
|
|
1466
|
+
info: "var(--color-alert-bg-info)",
|
|
1467
|
+
warning: "var(--color-alert-bg-warning)",
|
|
1468
|
+
warning_table: "var(--color-alert-bg-warning-table)",
|
|
1469
|
+
success: "var(--color-alert-bg-success)",
|
|
1470
|
+
error: "var(--color-alert-bg-error)"
|
|
1471
|
+
};
|
|
1472
|
+
var SIZE = {
|
|
1473
|
+
sm: { paddingHorizontal: 8, fontSize: 12 },
|
|
1474
|
+
md: { paddingHorizontal: 12, fontSize: 16 }
|
|
1471
1475
|
};
|
|
1472
|
-
var
|
|
1473
|
-
sm:
|
|
1474
|
-
md:
|
|
1476
|
+
var INDICATOR_SIZE = {
|
|
1477
|
+
sm: { marginVertical: 0 },
|
|
1478
|
+
md: { marginVertical: 2 }
|
|
1475
1479
|
};
|
|
1476
1480
|
var Alert = React32.forwardRef(
|
|
1477
1481
|
function Alert2(props, ref) {
|
|
@@ -1500,7 +1504,8 @@ var Alert = React32.forwardRef(
|
|
|
1500
1504
|
const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
1501
1505
|
const [isOpen, setIsOpen] = React32.useState(true);
|
|
1502
1506
|
const resolvedSize = size ?? "md";
|
|
1503
|
-
const
|
|
1507
|
+
const fontSize = SIZE[resolvedSize].fontSize;
|
|
1508
|
+
const defaultIcon = /* @__PURE__ */ jsx(IndicatorIcon2, {});
|
|
1504
1509
|
const iconElement = (() => {
|
|
1505
1510
|
if (startElement !== void 0) {
|
|
1506
1511
|
return startElement;
|
|
@@ -1508,10 +1513,20 @@ var Alert = React32.forwardRef(
|
|
|
1508
1513
|
if (!showIcon && icon === void 0) {
|
|
1509
1514
|
return null;
|
|
1510
1515
|
}
|
|
1511
|
-
return /* @__PURE__ */ jsx(
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1516
|
+
return /* @__PURE__ */ jsx(
|
|
1517
|
+
XStack,
|
|
1518
|
+
{
|
|
1519
|
+
alignItems: "center",
|
|
1520
|
+
justifyContent: "center",
|
|
1521
|
+
flexShrink: 0,
|
|
1522
|
+
width: 20,
|
|
1523
|
+
height: 20,
|
|
1524
|
+
...INDICATOR_SIZE[resolvedSize],
|
|
1525
|
+
className: "lux-icon",
|
|
1526
|
+
style: { color: ALERT_FG },
|
|
1527
|
+
children: icon || defaultIcon
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1515
1530
|
})();
|
|
1516
1531
|
const handleClose = React32.useCallback(() => {
|
|
1517
1532
|
setIsOpen(false);
|
|
@@ -1540,52 +1555,57 @@ var Alert = React32.forwardRef(
|
|
|
1540
1555
|
...descRowGap !== void 0 ? { rowGap: typeof descRowGap === "number" ? `${descRowGap * 4}px` : descRowGap } : {},
|
|
1541
1556
|
...descColumnGap !== void 0 ? { columnGap: typeof descColumnGap === "number" ? `${descColumnGap * 4}px` : descColumnGap } : {}
|
|
1542
1557
|
};
|
|
1558
|
+
const ContentFrame = inline ? XStack : YStack;
|
|
1543
1559
|
return /* @__PURE__ */ jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxs(
|
|
1544
|
-
|
|
1560
|
+
XStack,
|
|
1545
1561
|
{
|
|
1546
1562
|
ref,
|
|
1547
|
-
|
|
1563
|
+
...ALERT_BASE,
|
|
1564
|
+
paddingHorizontal: SIZE[resolvedSize].paddingHorizontal,
|
|
1565
|
+
backgroundColor: STATUS_BG[status],
|
|
1566
|
+
className,
|
|
1548
1567
|
style: alertStyle,
|
|
1549
1568
|
...alertRest,
|
|
1550
1569
|
children: [
|
|
1551
1570
|
iconElement,
|
|
1552
|
-
children ? /* @__PURE__ */ jsxs(
|
|
1553
|
-
title && /* @__PURE__ */ jsx(
|
|
1571
|
+
children ? /* @__PURE__ */ jsxs(ContentFrame, { flex: 1, alignItems: inline ? "center" : void 0, children: [
|
|
1572
|
+
title && /* @__PURE__ */ jsx(Text, { fontWeight: "600", fontSize, color: ALERT_FG, children: title }),
|
|
1554
1573
|
/* @__PURE__ */ jsx(
|
|
1555
|
-
|
|
1574
|
+
XStack,
|
|
1556
1575
|
{
|
|
1557
|
-
|
|
1576
|
+
flexWrap: "wrap",
|
|
1577
|
+
className: descClassName,
|
|
1558
1578
|
style: Object.keys(descStyle).length > 0 ? descStyle : void 0,
|
|
1559
1579
|
...descRest,
|
|
1560
|
-
children
|
|
1580
|
+
children: ink(children, void 0, { fontSize, color: ALERT_FG })
|
|
1561
1581
|
}
|
|
1562
1582
|
)
|
|
1563
|
-
] }) : /* @__PURE__ */ jsx(
|
|
1583
|
+
] }) : /* @__PURE__ */ jsx(Text, { flex: 1, fontWeight: "600", fontSize, color: ALERT_FG, children: title }),
|
|
1564
1584
|
endElement,
|
|
1565
|
-
closable && /* @__PURE__ */ jsx(
|
|
1566
|
-
CloseButton,
|
|
1567
|
-
{
|
|
1568
|
-
className: "relative self-start",
|
|
1569
|
-
onClick: handleClose
|
|
1570
|
-
}
|
|
1571
|
-
)
|
|
1585
|
+
closable && /* @__PURE__ */ jsx(View, { position: "relative", alignSelf: "flex-start", children: /* @__PURE__ */ jsx(CloseButton, { onClick: handleClose }) })
|
|
1572
1586
|
]
|
|
1573
1587
|
}
|
|
1574
1588
|
) });
|
|
1575
1589
|
}
|
|
1576
1590
|
);
|
|
1577
|
-
var
|
|
1578
|
-
xs:
|
|
1579
|
-
sm:
|
|
1580
|
-
md:
|
|
1581
|
-
lg:
|
|
1582
|
-
xl:
|
|
1583
|
-
"2xl":
|
|
1591
|
+
var SIZE2 = {
|
|
1592
|
+
xs: { width: 24, height: 24, fontSize: 10 },
|
|
1593
|
+
sm: { width: 32, height: 32, fontSize: 12 },
|
|
1594
|
+
md: { width: 40, height: 40, fontSize: 14 },
|
|
1595
|
+
lg: { width: 48, height: 48, fontSize: 16 },
|
|
1596
|
+
xl: { width: 64, height: 64, fontSize: 18 },
|
|
1597
|
+
"2xl": { width: 80, height: 80, fontSize: 20 }
|
|
1584
1598
|
};
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1599
|
+
var RING = "var(--color-bg-body)";
|
|
1600
|
+
var VARIANT = {
|
|
1601
|
+
solid: { backgroundColor: "var(--color-gray-500)", color: "var(--color-white)" },
|
|
1602
|
+
subtle: { backgroundColor: "var(--color-badge-gray-bg)", color: "var(--color-badge-gray-fg)" },
|
|
1603
|
+
outline: {
|
|
1604
|
+
borderWidth: 2,
|
|
1605
|
+
borderColor: "var(--color-input-border)",
|
|
1606
|
+
backgroundColor: "transparent",
|
|
1607
|
+
color: "var(--color-text-secondary)"
|
|
1608
|
+
}
|
|
1589
1609
|
};
|
|
1590
1610
|
var DEFAULT_SIZE = "md";
|
|
1591
1611
|
var DEFAULT_VARIANT = "subtle";
|
|
@@ -1604,7 +1624,6 @@ var Avatar = React32.forwardRef(
|
|
|
1604
1624
|
icon,
|
|
1605
1625
|
fallback,
|
|
1606
1626
|
children,
|
|
1607
|
-
className,
|
|
1608
1627
|
size: sizeProp,
|
|
1609
1628
|
variant: variantProp,
|
|
1610
1629
|
borderless,
|
|
@@ -1618,20 +1637,26 @@ var Avatar = React32.forwardRef(
|
|
|
1618
1637
|
{
|
|
1619
1638
|
ref,
|
|
1620
1639
|
unstyled: true,
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1640
|
+
position: "relative",
|
|
1641
|
+
display: "inline-flex",
|
|
1642
|
+
flexShrink: 0,
|
|
1643
|
+
alignItems: "center",
|
|
1644
|
+
justifyContent: "center",
|
|
1645
|
+
overflow: "hidden",
|
|
1646
|
+
borderRadius: 9999,
|
|
1647
|
+
...SIZE2[size],
|
|
1648
|
+
...VARIANT[variant],
|
|
1649
|
+
boxShadow: isBorderless ? void 0 : `0 0 0 2px ${RING}`,
|
|
1628
1650
|
...rest,
|
|
1629
1651
|
children: [
|
|
1630
1652
|
/* @__PURE__ */ jsx(AvatarFallback, { name, icon, children: fallback }),
|
|
1631
1653
|
src != null && /* @__PURE__ */ jsx(
|
|
1632
1654
|
Avatar$1.Image,
|
|
1633
1655
|
{
|
|
1634
|
-
|
|
1656
|
+
width: "100%",
|
|
1657
|
+
height: "100%",
|
|
1658
|
+
borderRadius: 9999,
|
|
1659
|
+
objectFit: "cover",
|
|
1635
1660
|
src,
|
|
1636
1661
|
srcSet,
|
|
1637
1662
|
loading,
|
|
@@ -1646,22 +1671,18 @@ var Avatar = React32.forwardRef(
|
|
|
1646
1671
|
);
|
|
1647
1672
|
var AvatarFallback = React32.forwardRef(
|
|
1648
1673
|
function AvatarFallback2(props, ref) {
|
|
1649
|
-
const { name, icon, children,
|
|
1650
|
-
return /* @__PURE__ */
|
|
1674
|
+
const { name, icon, children, ...rest } = props;
|
|
1675
|
+
return /* @__PURE__ */ jsx(
|
|
1651
1676
|
Avatar$1.Fallback,
|
|
1652
1677
|
{
|
|
1653
1678
|
ref,
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1679
|
+
display: "flex",
|
|
1680
|
+
width: "100%",
|
|
1681
|
+
height: "100%",
|
|
1682
|
+
alignItems: "center",
|
|
1683
|
+
justifyContent: "center",
|
|
1659
1684
|
...rest,
|
|
1660
|
-
children:
|
|
1661
|
-
children,
|
|
1662
|
-
name != null && children == null && /* @__PURE__ */ jsx(Fragment, { children: getInitials(name) }),
|
|
1663
|
-
name == null && children == null && icon
|
|
1664
|
-
]
|
|
1685
|
+
children: ink(children ?? (name != null ? getInitials(name) : icon), void 0, { fontWeight: "500" })
|
|
1665
1686
|
}
|
|
1666
1687
|
);
|
|
1667
1688
|
}
|
|
@@ -1674,19 +1695,12 @@ function getInitials(name) {
|
|
|
1674
1695
|
}
|
|
1675
1696
|
var AvatarGroup = React32.forwardRef(
|
|
1676
1697
|
function AvatarGroup2(props, ref) {
|
|
1677
|
-
const { size, variant, borderless,
|
|
1698
|
+
const { size, variant, borderless, children, ...rest } = props;
|
|
1678
1699
|
const contextValue = React32.useMemo(
|
|
1679
1700
|
() => ({ size, variant, borderless }),
|
|
1680
1701
|
[size, variant, borderless]
|
|
1681
1702
|
);
|
|
1682
|
-
return /* @__PURE__ */ jsx(AvatarGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
1683
|
-
"div",
|
|
1684
|
-
{
|
|
1685
|
-
ref,
|
|
1686
|
-
className: cn("flex -space-x-3", className),
|
|
1687
|
-
...rest
|
|
1688
|
-
}
|
|
1689
|
-
) });
|
|
1703
|
+
return /* @__PURE__ */ jsx(AvatarGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(XStack, { ref, ...rest, children: React32.Children.map(children, (child, index) => index === 0 || !React32.isValidElement(child) ? child : React32.cloneElement(child, { marginLeft: -12 })) }) });
|
|
1690
1704
|
}
|
|
1691
1705
|
);
|
|
1692
1706
|
function mapPlacement(p) {
|
|
@@ -1780,14 +1794,21 @@ var Tooltip = React32.forwardRef(
|
|
|
1780
1794
|
{
|
|
1781
1795
|
ref,
|
|
1782
1796
|
unstyled: true,
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1797
|
+
zIndex: 9999,
|
|
1798
|
+
overflow: "hidden",
|
|
1799
|
+
borderRadius: 8,
|
|
1800
|
+
paddingHorizontal: 12,
|
|
1801
|
+
paddingVertical: 8,
|
|
1802
|
+
maxWidth: isPopover ? 384 : 320,
|
|
1803
|
+
backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)",
|
|
1804
|
+
transition: "quick",
|
|
1805
|
+
enterStyle: { opacity: 0, scale: 0.95 },
|
|
1806
|
+
exitStyle: { opacity: 0, scale: 0.95 },
|
|
1807
|
+
...isPopover ? {
|
|
1808
|
+
borderWidth: 1,
|
|
1809
|
+
borderColor: "var(--color-border-divider)",
|
|
1810
|
+
shadowColor: "var(--shadow-popover)"
|
|
1811
|
+
} : {},
|
|
1791
1812
|
onClick: interactive ? handleContentClick : void 0,
|
|
1792
1813
|
...selected ? { "data-selected": true } : {},
|
|
1793
1814
|
...contentProps,
|
|
@@ -1796,12 +1817,13 @@ var Tooltip = React32.forwardRef(
|
|
|
1796
1817
|
Tooltip$1.Arrow,
|
|
1797
1818
|
{
|
|
1798
1819
|
unstyled: true,
|
|
1799
|
-
|
|
1800
|
-
isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
|
|
1801
|
-
)
|
|
1820
|
+
backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)"
|
|
1802
1821
|
}
|
|
1803
1822
|
),
|
|
1804
|
-
content
|
|
1823
|
+
ink(content, void 0, {
|
|
1824
|
+
fontSize: 14,
|
|
1825
|
+
color: isPopover ? "var(--color-text-primary)" : "var(--color-tooltip-fg)"
|
|
1826
|
+
})
|
|
1805
1827
|
]
|
|
1806
1828
|
}
|
|
1807
1829
|
)
|
|
@@ -1813,35 +1835,39 @@ var Tooltip = React32.forwardRef(
|
|
|
1813
1835
|
function TruncatedTextTooltip({ label, children }) {
|
|
1814
1836
|
return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
1815
1837
|
}
|
|
1816
|
-
var
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
lg: "text-sm px-2 py-1 min-h-7 font-semibold"
|
|
1838
|
+
var SIZE3 = {
|
|
1839
|
+
sm: { padding: 4, height: 18, minHeight: 18 },
|
|
1840
|
+
md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24 },
|
|
1841
|
+
lg: { paddingHorizontal: 8, paddingVertical: 4, minHeight: 28 }
|
|
1821
1842
|
};
|
|
1822
|
-
var
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1843
|
+
var SIZE_TEXT = {
|
|
1844
|
+
sm: { fontSize: 12, fontWeight: "500" },
|
|
1845
|
+
md: { fontSize: 14, fontWeight: "500" },
|
|
1846
|
+
lg: { fontSize: 14, fontWeight: "600" }
|
|
1847
|
+
};
|
|
1848
|
+
var COLOR_PALETTE = {
|
|
1849
|
+
gray: { bg: "var(--color-badge-gray-bg)", fg: "var(--color-badge-gray-fg)" },
|
|
1850
|
+
green: { bg: "var(--color-badge-green-bg)", fg: "var(--color-badge-green-fg)" },
|
|
1851
|
+
red: { bg: "var(--color-badge-red-bg)", fg: "var(--color-badge-red-fg)" },
|
|
1852
|
+
purple: { bg: "var(--color-badge-purple-bg)", fg: "var(--color-badge-purple-fg)" },
|
|
1853
|
+
orange: { bg: "var(--color-badge-orange-bg)", fg: "var(--color-badge-orange-fg)" },
|
|
1854
|
+
blue: { bg: "var(--color-badge-blue-bg)", fg: "var(--color-badge-blue-fg)" },
|
|
1855
|
+
yellow: { bg: "var(--color-badge-yellow-bg)", fg: "var(--color-badge-yellow-fg)" },
|
|
1856
|
+
teal: { bg: "var(--color-badge-teal-bg)", fg: "var(--color-badge-teal-fg)" },
|
|
1857
|
+
cyan: { bg: "var(--color-badge-cyan-bg)", fg: "var(--color-badge-cyan-fg)" },
|
|
1858
|
+
pink: { bg: "var(--color-badge-pink-bg)", fg: "var(--color-badge-pink-fg)" },
|
|
1859
|
+
purple_alt: { bg: "var(--color-badge-purple-alt-bg)", fg: "var(--color-badge-purple-alt-fg)" },
|
|
1860
|
+
blue_alt: { bg: "var(--color-badge-blue-alt-bg)", fg: "var(--color-badge-blue-alt-fg)" },
|
|
1861
|
+
bright_gray: { bg: "var(--color-badge-bright-gray-bg)", fg: "var(--color-badge-bright-gray-fg)" },
|
|
1862
|
+
bright_green: { bg: "var(--color-badge-bright-green-bg)", fg: "var(--color-badge-bright-green-fg)" },
|
|
1863
|
+
bright_red: { bg: "var(--color-badge-bright-red-bg)", fg: "var(--color-badge-bright-red-fg)" },
|
|
1864
|
+
bright_blue: { bg: "var(--color-badge-bright-blue-bg)", fg: "var(--color-badge-bright-blue-fg)" },
|
|
1865
|
+
bright_yellow: { bg: "var(--color-badge-bright-yellow-bg)", fg: "var(--color-badge-bright-yellow-fg)" },
|
|
1866
|
+
bright_teal: { bg: "var(--color-badge-bright-teal-bg)", fg: "var(--color-badge-bright-teal-fg)" },
|
|
1867
|
+
bright_cyan: { bg: "var(--color-badge-bright-cyan-bg)", fg: "var(--color-badge-bright-cyan-fg)" },
|
|
1868
|
+
bright_orange: { bg: "var(--color-badge-bright-orange-bg)", fg: "var(--color-badge-bright-orange-fg)" },
|
|
1869
|
+
bright_purple: { bg: "var(--color-badge-bright-purple-bg)", fg: "var(--color-badge-bright-purple-fg)" },
|
|
1870
|
+
bright_pink: { bg: "var(--color-badge-bright-pink-bg)", fg: "var(--color-badge-bright-pink-fg)" }
|
|
1845
1871
|
};
|
|
1846
1872
|
var S2 = 4;
|
|
1847
1873
|
var Badge = React32__default.forwardRef(
|
|
@@ -1876,18 +1902,31 @@ var Badge = React32__default.forwardRef(
|
|
|
1876
1902
|
}
|
|
1877
1903
|
if (_mr !== void 0) shimStyle.marginRight = typeof _mr === "number" ? `${_mr * S2}px` : _mr;
|
|
1878
1904
|
const badgeStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
1879
|
-
const
|
|
1905
|
+
const palette = COLOR_PALETTE[colorPalette];
|
|
1906
|
+
const child = children ? (
|
|
1907
|
+
// `ellipsis` is gui Text's own built-in variant for single-line
|
|
1908
|
+
// truncation — it expands to the same overflow/text-overflow/
|
|
1909
|
+
// white-space/max-width rule Tailwind's `text-ellipsis` did, but
|
|
1910
|
+
// through the component's own variants (guaranteed to compile),
|
|
1911
|
+
// rather than naming each longhand as a separate style prop.
|
|
1912
|
+
/* @__PURE__ */ jsx(Text, { ellipsis: true, ...SIZE_TEXT[size], color: palette.fg, children })
|
|
1913
|
+
) : null;
|
|
1880
1914
|
const childrenElement = truncated ? /* @__PURE__ */ jsx(TruncatedTextTooltip, { label: children, children: child }) : child;
|
|
1881
1915
|
const badgeElement = /* @__PURE__ */ jsxs(
|
|
1882
|
-
|
|
1916
|
+
XStack,
|
|
1883
1917
|
{
|
|
1884
1918
|
ref,
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1919
|
+
render: /* @__PURE__ */ jsx("span", {}),
|
|
1920
|
+
display: "inline-flex",
|
|
1921
|
+
alignItems: "center",
|
|
1922
|
+
alignSelf: "flex-start",
|
|
1923
|
+
borderRadius: 2,
|
|
1924
|
+
gap: 4,
|
|
1925
|
+
maxWidth: "100%",
|
|
1926
|
+
userSelect: "text",
|
|
1927
|
+
...SIZE3[size],
|
|
1928
|
+
backgroundColor: palette.bg,
|
|
1929
|
+
className,
|
|
1891
1930
|
style: badgeStyle,
|
|
1892
1931
|
...rest,
|
|
1893
1932
|
children: [
|
|
@@ -1961,7 +2000,7 @@ var ButtonFrame = styled(View, {
|
|
|
1961
2000
|
size: "md"
|
|
1962
2001
|
}
|
|
1963
2002
|
});
|
|
1964
|
-
var
|
|
2003
|
+
var VARIANT_CLASSES = {
|
|
1965
2004
|
solid: [
|
|
1966
2005
|
"bg-[var(--color-button-solid-bg)] text-[var(--color-button-solid-text)]",
|
|
1967
2006
|
"hover:bg-[var(--color-hover)]",
|
|
@@ -2061,7 +2100,7 @@ var VARIANT_CLASSES2 = {
|
|
|
2061
2100
|
"data-[selected]:hover:text-[var(--color-selected-control-text)] data-[selected]:hover:border-transparent"
|
|
2062
2101
|
].join(" ")
|
|
2063
2102
|
};
|
|
2064
|
-
var
|
|
2103
|
+
var BASE_CLASSES = "font-semibold whitespace-nowrap transition-colors duration-150";
|
|
2065
2104
|
var SP = 4;
|
|
2066
2105
|
function buildShimStyle(props) {
|
|
2067
2106
|
const s = { ...props.style };
|
|
@@ -2162,8 +2201,8 @@ var Button = React32.forwardRef(
|
|
|
2162
2201
|
/* @__PURE__ */ jsx(Spinner, {}),
|
|
2163
2202
|
loadingText != null && /* @__PURE__ */ jsx("span", { style: { marginLeft: 8 }, children: loadingText })
|
|
2164
2203
|
] }) : children;
|
|
2165
|
-
const variantClass =
|
|
2166
|
-
const combinedClassName = [
|
|
2204
|
+
const variantClass = VARIANT_CLASSES[variant] ?? VARIANT_CLASSES.solid;
|
|
2205
|
+
const combinedClassName = [BASE_CLASSES, variantClass, className].filter(Boolean).join(" ");
|
|
2167
2206
|
const button = /* @__PURE__ */ jsx(
|
|
2168
2207
|
ButtonFrame,
|
|
2169
2208
|
{
|
|
@@ -2184,7 +2223,7 @@ var Button = React32.forwardRef(
|
|
|
2184
2223
|
return button;
|
|
2185
2224
|
}
|
|
2186
2225
|
);
|
|
2187
|
-
var
|
|
2226
|
+
var SIZE_CLASSES = {
|
|
2188
2227
|
"2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
|
|
2189
2228
|
xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
|
|
2190
2229
|
sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
|
|
@@ -2193,7 +2232,7 @@ var SIZE_CLASSES4 = {
|
|
|
2193
2232
|
function buttonVariants(opts) {
|
|
2194
2233
|
const v = opts?.variant ?? "solid";
|
|
2195
2234
|
const s = opts?.size ?? "md";
|
|
2196
|
-
return [
|
|
2235
|
+
return [BASE_CLASSES, VARIANT_CLASSES[v] ?? "", SIZE_CLASSES[s] ?? ""].filter(Boolean).join(" ");
|
|
2197
2236
|
}
|
|
2198
2237
|
var ButtonGroup = React32.forwardRef(
|
|
2199
2238
|
function ButtonGroup2(props, ref) {
|
|
@@ -2271,7 +2310,6 @@ var CheckboxGroupBase = React32.forwardRef(
|
|
|
2271
2310
|
onValueChange,
|
|
2272
2311
|
orientation = "vertical",
|
|
2273
2312
|
name: _name,
|
|
2274
|
-
className,
|
|
2275
2313
|
...rest
|
|
2276
2314
|
} = props;
|
|
2277
2315
|
const [uncontrolledValue, setUncontrolledValue] = React32.useState(defaultValue ?? []);
|
|
@@ -2294,15 +2332,13 @@ var CheckboxGroupBase = React32.forwardRef(
|
|
|
2294
2332
|
}, [isControlled, controlledValue]);
|
|
2295
2333
|
const ctx = React32.useMemo(() => ({ value, toggle }), [value, toggle]);
|
|
2296
2334
|
return /* @__PURE__ */ jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
2297
|
-
|
|
2335
|
+
View,
|
|
2298
2336
|
{
|
|
2299
2337
|
ref,
|
|
2300
2338
|
role: "group",
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
className
|
|
2305
|
-
),
|
|
2339
|
+
display: "flex",
|
|
2340
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
2341
|
+
gap: orientation === "vertical" ? 12 : 32,
|
|
2306
2342
|
...rest,
|
|
2307
2343
|
children
|
|
2308
2344
|
}
|
|
@@ -2310,46 +2346,22 @@ var CheckboxGroupBase = React32.forwardRef(
|
|
|
2310
2346
|
}
|
|
2311
2347
|
);
|
|
2312
2348
|
var CheckboxGroup2 = CheckboxGroupBase;
|
|
2313
|
-
var
|
|
2314
|
-
sm: {
|
|
2315
|
-
|
|
2316
|
-
control: "h-3.5 w-3.5 rounded-sm",
|
|
2317
|
-
label: "text-xs",
|
|
2318
|
-
icon: "h-3 w-3"
|
|
2319
|
-
},
|
|
2320
|
-
md: {
|
|
2321
|
-
root: "gap-2",
|
|
2322
|
-
control: "h-4 w-4 rounded",
|
|
2323
|
-
label: "text-sm",
|
|
2324
|
-
icon: "h-3.5 w-3.5"
|
|
2325
|
-
}
|
|
2349
|
+
var SIZE4 = {
|
|
2350
|
+
sm: { rootGap: 6, control: 14, radius: 2, label: 12, icon: 12 },
|
|
2351
|
+
md: { rootGap: 8, control: 16, radius: 4, label: 14, icon: 14 }
|
|
2326
2352
|
};
|
|
2327
|
-
var
|
|
2328
|
-
|
|
2353
|
+
var INK = "var(--color-text-primary)";
|
|
2354
|
+
var ON_INK = "var(--color-bg-body)";
|
|
2355
|
+
var RESTING_BORDER = "var(--color-input-border)";
|
|
2356
|
+
var OUTLINE = "var(--color-gray-500)";
|
|
2357
|
+
var CheckIcon = ({ size, color }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
2358
|
+
"path",
|
|
2329
2359
|
{
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
fill: "none",
|
|
2333
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2334
|
-
children: /* @__PURE__ */ jsx(
|
|
2335
|
-
"path",
|
|
2336
|
-
{
|
|
2337
|
-
d: "M10.59 0.59L4 7.17L1.41 4.59L0 6L4 10L12 2L10.59 0.59Z",
|
|
2338
|
-
fill: "currentColor"
|
|
2339
|
-
}
|
|
2340
|
-
)
|
|
2341
|
-
}
|
|
2342
|
-
);
|
|
2343
|
-
var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
2344
|
-
"svg",
|
|
2345
|
-
{
|
|
2346
|
-
className,
|
|
2347
|
-
viewBox: "0 0 12 2",
|
|
2348
|
-
fill: "none",
|
|
2349
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2350
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
|
|
2360
|
+
d: "M10.59 0.59L4 7.17L1.41 4.59L0 6L4 10L12 2L10.59 0.59Z",
|
|
2361
|
+
fill: color
|
|
2351
2362
|
}
|
|
2352
|
-
);
|
|
2363
|
+
) });
|
|
2364
|
+
var IndeterminateIcon = ({ size, color }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 12 2", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M0 0H12V2H0V0Z", fill: color }) });
|
|
2353
2365
|
var CheckboxBase = React32.forwardRef(
|
|
2354
2366
|
function Checkbox$1(props, ref) {
|
|
2355
2367
|
const {
|
|
@@ -2367,7 +2379,6 @@ var CheckboxBase = React32.forwardRef(
|
|
|
2367
2379
|
size = "md",
|
|
2368
2380
|
name,
|
|
2369
2381
|
required,
|
|
2370
|
-
className,
|
|
2371
2382
|
...rest
|
|
2372
2383
|
} = props;
|
|
2373
2384
|
const group = useCheckboxGroupContext();
|
|
@@ -2420,18 +2431,19 @@ var CheckboxBase = React32.forwardRef(
|
|
|
2420
2431
|
},
|
|
2421
2432
|
[readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
|
|
2422
2433
|
);
|
|
2423
|
-
const
|
|
2434
|
+
const s = SIZE4[size];
|
|
2435
|
+
const isChecked = checkedState !== false;
|
|
2424
2436
|
return /* @__PURE__ */ jsxs(
|
|
2425
|
-
|
|
2437
|
+
Label,
|
|
2426
2438
|
{
|
|
2427
2439
|
ref: rootRef,
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2440
|
+
unstyled: true,
|
|
2441
|
+
flexDirection: "row",
|
|
2442
|
+
alignItems: "center",
|
|
2443
|
+
gap: s.rootGap,
|
|
2444
|
+
cursor: disabled ? "not-allowed" : readOnly ? "default" : "pointer",
|
|
2445
|
+
userSelect: "none",
|
|
2446
|
+
opacity: disabled ? 0.5 : 1,
|
|
2435
2447
|
onChange,
|
|
2436
2448
|
"data-disabled": disabled || void 0,
|
|
2437
2449
|
"data-readonly": readOnly || void 0,
|
|
@@ -2447,26 +2459,25 @@ var CheckboxBase = React32.forwardRef(
|
|
|
2447
2459
|
name,
|
|
2448
2460
|
value,
|
|
2449
2461
|
required,
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
children: icon ?? /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
2462
|
+
flexShrink: 0,
|
|
2463
|
+
alignItems: "center",
|
|
2464
|
+
justifyContent: "center",
|
|
2465
|
+
width: s.control,
|
|
2466
|
+
height: s.control,
|
|
2467
|
+
borderRadius: s.radius,
|
|
2468
|
+
borderWidth: 2,
|
|
2469
|
+
borderColor: isChecked ? INK : RESTING_BORDER,
|
|
2470
|
+
backgroundColor: isChecked ? INK : "transparent",
|
|
2471
|
+
transition: "quicker",
|
|
2472
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE, outlineOffset: 2 },
|
|
2473
|
+
children: icon ?? /* @__PURE__ */ jsx(Checkbox.Indicator, { alignItems: "center", justifyContent: "center", width: s.icon, height: s.icon, children: checkedState === "indeterminate" ? /* @__PURE__ */ jsx(IndeterminateIcon, { size: s.icon, color: ON_INK }) : /* @__PURE__ */ jsx(CheckIcon, { size: s.icon, color: ON_INK }) })
|
|
2462
2474
|
}
|
|
2463
2475
|
),
|
|
2464
|
-
/* @__PURE__ */ jsx(
|
|
2476
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
|
|
2465
2477
|
"input",
|
|
2466
2478
|
{
|
|
2467
2479
|
ref: setHiddenInputRef,
|
|
2468
2480
|
type: "checkbox",
|
|
2469
|
-
className: "sr-only",
|
|
2470
2481
|
checked: checkedState === true,
|
|
2471
2482
|
disabled,
|
|
2472
2483
|
readOnly,
|
|
@@ -2477,8 +2488,8 @@ var CheckboxBase = React32.forwardRef(
|
|
|
2477
2488
|
onChange: NOOP,
|
|
2478
2489
|
...inputProps
|
|
2479
2490
|
}
|
|
2480
|
-
),
|
|
2481
|
-
children != null && /* @__PURE__ */ jsx(
|
|
2491
|
+
) }),
|
|
2492
|
+
children != null && /* @__PURE__ */ jsx(Text, { fontSize: s.label, children })
|
|
2482
2493
|
]
|
|
2483
2494
|
}
|
|
2484
2495
|
);
|
|
@@ -2497,7 +2508,7 @@ function stripUtmParams(url) {
|
|
|
2497
2508
|
return url;
|
|
2498
2509
|
}
|
|
2499
2510
|
}
|
|
2500
|
-
var
|
|
2511
|
+
var VARIANT_CLASSES2 = {
|
|
2501
2512
|
primary: cn(
|
|
2502
2513
|
"text-[var(--color-link-primary)]",
|
|
2503
2514
|
"hover:no-underline hover:text-[var(--color-link-primary-hover)]",
|
|
@@ -2537,7 +2548,7 @@ var VARIANT_CLASSES3 = {
|
|
|
2537
2548
|
"data-[hover]:no-underline"
|
|
2538
2549
|
)
|
|
2539
2550
|
};
|
|
2540
|
-
var
|
|
2551
|
+
var BASE_CLASSES2 = "inline-flex items-center gap-0 cursor-pointer data-[disabled]:cursor-not-allowed";
|
|
2541
2552
|
var LinkExternalIcon = ({ color }) => /* @__PURE__ */ jsx(
|
|
2542
2553
|
ArrowIcon,
|
|
2543
2554
|
{
|
|
@@ -2606,7 +2617,7 @@ var Link = React32__default.forwardRef(
|
|
|
2606
2617
|
if (_minW !== void 0) shimStyle.minWidth = typeof _minW === "number" ? `${_minW * SPACING}px` : _minW;
|
|
2607
2618
|
if (_justifyContent) shimStyle.justifyContent = _justifyContent;
|
|
2608
2619
|
if (_position) shimStyle.position = _position;
|
|
2609
|
-
const linkClasses = cn(
|
|
2620
|
+
const linkClasses = cn(BASE_CLASSES2, VARIANT_CLASSES2[variant], className);
|
|
2610
2621
|
const linkStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
2611
2622
|
if (external) {
|
|
2612
2623
|
const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
|
|
@@ -2695,8 +2706,8 @@ var LinkOverlay = React32__default.forwardRef(
|
|
|
2695
2706
|
...rest
|
|
2696
2707
|
} = props;
|
|
2697
2708
|
const overlayClasses = cn(
|
|
2698
|
-
|
|
2699
|
-
|
|
2709
|
+
BASE_CLASSES2,
|
|
2710
|
+
VARIANT_CLASSES2[variant],
|
|
2700
2711
|
// Static positioning with a ::before pseudo-element that covers the LinkBox
|
|
2701
2712
|
"static",
|
|
2702
2713
|
'before:absolute before:inset-0 before:z-0 before:content-[""]',
|
|
@@ -3084,6 +3095,7 @@ function upperFirst(str) {
|
|
|
3084
3095
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
3085
3096
|
}
|
|
3086
3097
|
var ICONS = {};
|
|
3098
|
+
var MUTED = "var(--color-text-secondary)";
|
|
3087
3099
|
var EmptyState = React32.forwardRef(
|
|
3088
3100
|
function EmptyState2(props, ref) {
|
|
3089
3101
|
const { title, description, term, type = "query", icon, children, className, ...rest } = props;
|
|
@@ -3121,17 +3133,20 @@ var EmptyState = React32.forwardRef(
|
|
|
3121
3133
|
return icon;
|
|
3122
3134
|
})();
|
|
3123
3135
|
return /* @__PURE__ */ jsx(
|
|
3124
|
-
|
|
3136
|
+
XStack,
|
|
3125
3137
|
{
|
|
3126
3138
|
ref,
|
|
3127
|
-
|
|
3139
|
+
alignItems: "center",
|
|
3140
|
+
justifyContent: "center",
|
|
3141
|
+
paddingVertical: 40,
|
|
3142
|
+
className,
|
|
3128
3143
|
...rest,
|
|
3129
|
-
children: /* @__PURE__ */ jsxs(
|
|
3130
|
-
iconContent && /* @__PURE__ */ jsx(
|
|
3131
|
-
descriptionContent ? /* @__PURE__ */ jsxs(
|
|
3132
|
-
/* @__PURE__ */ jsx(
|
|
3133
|
-
/* @__PURE__ */ jsx(
|
|
3134
|
-
] }) : /* @__PURE__ */ jsx(
|
|
3144
|
+
children: /* @__PURE__ */ jsxs(YStack, { alignItems: "center", gap: 20, children: [
|
|
3145
|
+
iconContent && /* @__PURE__ */ jsx(XStack, { alignItems: "center", justifyContent: "center", children: iconContent }),
|
|
3146
|
+
descriptionContent ? /* @__PURE__ */ jsxs(YStack, { alignItems: "center", gap: 8, children: [
|
|
3147
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 18, fontWeight: "600", textAlign: "center", color: MUTED, children: titleContent }),
|
|
3148
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 14, textAlign: "center", color: MUTED, children: descriptionContent })
|
|
3149
|
+
] }) : /* @__PURE__ */ jsx(Text, { fontSize: 18, fontWeight: "600", textAlign: "center", color: MUTED, children: titleContent }),
|
|
3135
3150
|
children
|
|
3136
3151
|
] })
|
|
3137
3152
|
}
|
|
@@ -3145,10 +3160,10 @@ function getComponentDisplayName(type) {
|
|
|
3145
3160
|
return void 0;
|
|
3146
3161
|
}
|
|
3147
3162
|
var ERROR = "var(--color-text-error)";
|
|
3148
|
-
var
|
|
3163
|
+
var MUTED2 = "var(--color-text-secondary)";
|
|
3149
3164
|
var Marks = ({ required, optionalText, errorText }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3150
3165
|
required && /* @__PURE__ */ jsx(Text, { color: ERROR, "aria-hidden": true, children: "*" }),
|
|
3151
|
-
!required && optionalText && /* @__PURE__ */ jsx(Text, { fontSize: 14, color:
|
|
3166
|
+
!required && optionalText && /* @__PURE__ */ jsx(Text, { fontSize: 14, color: MUTED2, children: optionalText }),
|
|
3152
3167
|
errorText && /* @__PURE__ */ jsxs(Text, { fontSize: 14, color: ERROR, children: [
|
|
3153
3168
|
"-",
|
|
3154
3169
|
space,
|
|
@@ -3199,7 +3214,7 @@ var Field = React32.forwardRef(
|
|
|
3199
3214
|
]
|
|
3200
3215
|
}
|
|
3201
3216
|
);
|
|
3202
|
-
const helperTextElement = helperText ? /* @__PURE__ */ jsx(Text, { marginTop: 6, fontSize: 12, color:
|
|
3217
|
+
const helperTextElement = helperText ? /* @__PURE__ */ jsx(Text, { marginTop: 6, fontSize: 12, color: MUTED2, children: helperText }) : null;
|
|
3203
3218
|
const child2 = React32.Children.only(children);
|
|
3204
3219
|
const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
|
|
3205
3220
|
if (isInputGroup) {
|
|
@@ -3237,7 +3252,7 @@ var Field = React32.forwardRef(
|
|
|
3237
3252
|
}
|
|
3238
3253
|
),
|
|
3239
3254
|
React32.cloneElement(child, { size }),
|
|
3240
|
-
helperText && /* @__PURE__ */ jsx(Text, { fontSize: 12, color:
|
|
3255
|
+
helperText && /* @__PURE__ */ jsx(Text, { fontSize: 12, color: MUTED2, children: helperText }),
|
|
3241
3256
|
errorText && /* @__PURE__ */ jsx(Text, { fontSize: 12, color: ERROR, children: errorText })
|
|
3242
3257
|
] });
|
|
3243
3258
|
}
|
|
@@ -3291,7 +3306,7 @@ var IconButtonFrame = styled(View, {
|
|
|
3291
3306
|
var HOVER = "var(--color-hover)";
|
|
3292
3307
|
var SELECTED_BG = "var(--color-selected-control-bg)";
|
|
3293
3308
|
var SELECTED_FG = "var(--color-selected-control-text)";
|
|
3294
|
-
var
|
|
3309
|
+
var VARIANT2 = {
|
|
3295
3310
|
plain: {
|
|
3296
3311
|
rest: { backgroundColor: "transparent", hoverStyle: { backgroundColor: "transparent" } }
|
|
3297
3312
|
},
|
|
@@ -3366,7 +3381,7 @@ var IconButton = React32.forwardRef(
|
|
|
3366
3381
|
style: styleProp,
|
|
3367
3382
|
...rest
|
|
3368
3383
|
} = props;
|
|
3369
|
-
const look =
|
|
3384
|
+
const look = VARIANT2[variant] ?? VARIANT2.plain;
|
|
3370
3385
|
const iconSize = size ? ICON_SIZE[size] : void 0;
|
|
3371
3386
|
const button = /* @__PURE__ */ jsx(
|
|
3372
3387
|
IconButtonFrame,
|
|
@@ -3613,14 +3628,14 @@ var Image = React32__default.forwardRef(
|
|
|
3613
3628
|
] });
|
|
3614
3629
|
}
|
|
3615
3630
|
);
|
|
3616
|
-
var
|
|
3631
|
+
var SIZE5 = {
|
|
3617
3632
|
xs: { height: 24, paddingHorizontal: 8, fontSize: 12, borderRadius: 4 },
|
|
3618
3633
|
sm: { height: 32, paddingHorizontal: 12, fontSize: 14, borderRadius: 6 },
|
|
3619
3634
|
md: { height: 40, paddingHorizontal: 16, fontSize: 16, borderRadius: 6 },
|
|
3620
3635
|
lg: { height: 48, paddingHorizontal: 16, fontSize: 18, borderRadius: 8 },
|
|
3621
3636
|
"2xl": { height: 56, paddingHorizontal: 16, fontSize: 20, borderRadius: 8 }
|
|
3622
3637
|
};
|
|
3623
|
-
var
|
|
3638
|
+
var VARIANT3 = {
|
|
3624
3639
|
outline: { borderWidth: 1, borderStyle: "solid" },
|
|
3625
3640
|
filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
|
|
3626
3641
|
unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
|
|
@@ -3651,8 +3666,8 @@ var Input = React32__default.forwardRef(
|
|
|
3651
3666
|
unstyled: true,
|
|
3652
3667
|
className: className ? `lux-control ${className}` : "lux-control",
|
|
3653
3668
|
...CONTROL,
|
|
3654
|
-
...
|
|
3655
|
-
...
|
|
3669
|
+
...SIZE5[size],
|
|
3670
|
+
...VARIANT3[variant],
|
|
3656
3671
|
...rest,
|
|
3657
3672
|
onChange: handleChange
|
|
3658
3673
|
}
|
|
@@ -4161,11 +4176,11 @@ var PopoverDescription = React32.forwardRef(function PopoverDescription2(props,
|
|
|
4161
4176
|
}
|
|
4162
4177
|
);
|
|
4163
4178
|
});
|
|
4164
|
-
var
|
|
4165
|
-
sm:
|
|
4166
|
-
md:
|
|
4167
|
-
lg:
|
|
4168
|
-
xl:
|
|
4179
|
+
var SIZE6 = {
|
|
4180
|
+
sm: 4,
|
|
4181
|
+
md: 8,
|
|
4182
|
+
lg: 12,
|
|
4183
|
+
xl: 16
|
|
4169
4184
|
};
|
|
4170
4185
|
function normalizeValue(value, min, max) {
|
|
4171
4186
|
if (value == null) return 0;
|
|
@@ -4181,7 +4196,6 @@ var Progress = React32.forwardRef(
|
|
|
4181
4196
|
size = "md",
|
|
4182
4197
|
color,
|
|
4183
4198
|
trackProps,
|
|
4184
|
-
className,
|
|
4185
4199
|
style,
|
|
4186
4200
|
w,
|
|
4187
4201
|
flex,
|
|
@@ -4200,6 +4214,7 @@ var Progress = React32.forwardRef(
|
|
|
4200
4214
|
}
|
|
4201
4215
|
};
|
|
4202
4216
|
const rootStyle = {
|
|
4217
|
+
position: "relative",
|
|
4203
4218
|
...style,
|
|
4204
4219
|
...w !== void 0 && { width: w === "full" ? "100%" : w },
|
|
4205
4220
|
...flex !== void 0 && { flex }
|
|
@@ -4208,7 +4223,6 @@ var Progress = React32.forwardRef(
|
|
|
4208
4223
|
"div",
|
|
4209
4224
|
{
|
|
4210
4225
|
ref,
|
|
4211
|
-
className: cn("relative", className),
|
|
4212
4226
|
style: rootStyle,
|
|
4213
4227
|
...rest,
|
|
4214
4228
|
children: /* @__PURE__ */ jsx(
|
|
@@ -4217,22 +4231,21 @@ var Progress = React32.forwardRef(
|
|
|
4217
4231
|
value: percent,
|
|
4218
4232
|
max: 100,
|
|
4219
4233
|
unstyled: true,
|
|
4220
|
-
className:
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
),
|
|
4234
|
+
className: trackProps?.className,
|
|
4235
|
+
width: "100%",
|
|
4236
|
+
overflow: "hidden",
|
|
4237
|
+
borderRadius: 9999,
|
|
4238
|
+
height: SIZE6[size],
|
|
4239
|
+
backgroundColor: "var(--color-progress-track)",
|
|
4226
4240
|
style: trackStyle,
|
|
4227
4241
|
children: /* @__PURE__ */ jsx(
|
|
4228
4242
|
Progress$1.Indicator,
|
|
4229
4243
|
{
|
|
4230
4244
|
unstyled: true,
|
|
4231
4245
|
transition: "slow",
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
),
|
|
4246
|
+
height: "100%",
|
|
4247
|
+
borderRadius: 9999,
|
|
4248
|
+
backgroundColor: color ? void 0 : "var(--color-progress-indicator)",
|
|
4236
4249
|
style: {
|
|
4237
4250
|
...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
|
|
4238
4251
|
}
|
|
@@ -4360,32 +4373,15 @@ var ProgressCircleValueText = React32.forwardRef(function ProgressCircleValueTex
|
|
|
4360
4373
|
}
|
|
4361
4374
|
);
|
|
4362
4375
|
});
|
|
4363
|
-
var
|
|
4364
|
-
xs: {
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
label: "text-xs"
|
|
4369
|
-
},
|
|
4370
|
-
sm: {
|
|
4371
|
-
root: "gap-1.5",
|
|
4372
|
-
control: "h-3.5 w-3.5",
|
|
4373
|
-
indicator: "h-1.5 w-1.5",
|
|
4374
|
-
label: "text-xs"
|
|
4375
|
-
},
|
|
4376
|
-
md: {
|
|
4377
|
-
root: "gap-2",
|
|
4378
|
-
control: "h-4 w-4",
|
|
4379
|
-
indicator: "h-2 w-2",
|
|
4380
|
-
label: "text-sm"
|
|
4381
|
-
},
|
|
4382
|
-
lg: {
|
|
4383
|
-
root: "gap-2.5",
|
|
4384
|
-
control: "h-5 w-5",
|
|
4385
|
-
indicator: "h-2.5 w-2.5",
|
|
4386
|
-
label: "text-base"
|
|
4387
|
-
}
|
|
4376
|
+
var SIZE7 = {
|
|
4377
|
+
xs: { rootGap: 6, control: 12, indicator: 6, label: 12 },
|
|
4378
|
+
sm: { rootGap: 6, control: 14, indicator: 6, label: 12 },
|
|
4379
|
+
md: { rootGap: 8, control: 16, indicator: 8, label: 14 },
|
|
4380
|
+
lg: { rootGap: 10, control: 20, indicator: 10, label: 16 }
|
|
4388
4381
|
};
|
|
4382
|
+
var INK2 = "var(--color-text-primary)";
|
|
4383
|
+
var RESTING_BORDER2 = "var(--color-input-border)";
|
|
4384
|
+
var OUTLINE2 = "var(--color-gray-500)";
|
|
4389
4385
|
var RadioSizeContext = React32.createContext("md");
|
|
4390
4386
|
var RadioGroupBase = React32.forwardRef(
|
|
4391
4387
|
function RadioGroup$1(props, ref) {
|
|
@@ -4402,7 +4398,6 @@ var RadioGroupBase = React32.forwardRef(
|
|
|
4402
4398
|
value,
|
|
4403
4399
|
onValueChange,
|
|
4404
4400
|
size = "md",
|
|
4405
|
-
className,
|
|
4406
4401
|
...rest
|
|
4407
4402
|
} = props;
|
|
4408
4403
|
const handleValueChange = React32.useCallback(
|
|
@@ -4424,11 +4419,9 @@ var RadioGroupBase = React32.forwardRef(
|
|
|
4424
4419
|
defaultValue,
|
|
4425
4420
|
value: value ?? void 0,
|
|
4426
4421
|
onValueChange: handleValueChange,
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
className
|
|
4431
|
-
),
|
|
4422
|
+
display: "flex",
|
|
4423
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
4424
|
+
gap: orientation === "vertical" ? 12 : 24,
|
|
4432
4425
|
...rest,
|
|
4433
4426
|
children
|
|
4434
4427
|
}
|
|
@@ -4440,19 +4433,20 @@ var NOOP2 = () => {
|
|
|
4440
4433
|
};
|
|
4441
4434
|
var RadioBase = React32.forwardRef(
|
|
4442
4435
|
function Radio(props, ref) {
|
|
4443
|
-
const { children, inputProps, rootRef, value, disabled,
|
|
4436
|
+
const { children, inputProps, rootRef, value, disabled, ...rest } = props;
|
|
4444
4437
|
const size = React32.useContext(RadioSizeContext);
|
|
4445
|
-
const
|
|
4438
|
+
const s = SIZE7[size];
|
|
4446
4439
|
return /* @__PURE__ */ jsxs(
|
|
4447
|
-
|
|
4440
|
+
Label,
|
|
4448
4441
|
{
|
|
4449
4442
|
ref: rootRef,
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4443
|
+
unstyled: true,
|
|
4444
|
+
flexDirection: "row",
|
|
4445
|
+
alignItems: "center",
|
|
4446
|
+
gap: s.rootGap,
|
|
4447
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
4448
|
+
userSelect: "none",
|
|
4449
|
+
opacity: disabled ? 0.5 : 1,
|
|
4456
4450
|
"data-disabled": disabled || void 0,
|
|
4457
4451
|
...rest,
|
|
4458
4452
|
children: [
|
|
@@ -4462,32 +4456,24 @@ var RadioBase = React32.forwardRef(
|
|
|
4462
4456
|
unstyled: true,
|
|
4463
4457
|
value,
|
|
4464
4458
|
disabled,
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
unstyled: true,
|
|
4477
|
-
className: cn(
|
|
4478
|
-
"block rounded-full bg-gray-800 dark:bg-white",
|
|
4479
|
-
sizeClasses2.indicator
|
|
4480
|
-
)
|
|
4481
|
-
}
|
|
4482
|
-
)
|
|
4459
|
+
flexShrink: 0,
|
|
4460
|
+
alignItems: "center",
|
|
4461
|
+
justifyContent: "center",
|
|
4462
|
+
width: s.control,
|
|
4463
|
+
height: s.control,
|
|
4464
|
+
borderRadius: 9999,
|
|
4465
|
+
borderWidth: 2,
|
|
4466
|
+
borderColor: RESTING_BORDER2,
|
|
4467
|
+
transition: "quicker",
|
|
4468
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE2, outlineOffset: 2 },
|
|
4469
|
+
children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { unstyled: true, borderRadius: 9999, width: s.indicator, height: s.indicator, backgroundColor: INK2 })
|
|
4483
4470
|
}
|
|
4484
4471
|
),
|
|
4485
|
-
/* @__PURE__ */ jsx(
|
|
4472
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
|
|
4486
4473
|
"input",
|
|
4487
4474
|
{
|
|
4488
4475
|
ref,
|
|
4489
4476
|
type: "radio",
|
|
4490
|
-
className: "sr-only",
|
|
4491
4477
|
value,
|
|
4492
4478
|
disabled,
|
|
4493
4479
|
tabIndex: -1,
|
|
@@ -4495,8 +4481,8 @@ var RadioBase = React32.forwardRef(
|
|
|
4495
4481
|
onChange: NOOP2,
|
|
4496
4482
|
...inputProps
|
|
4497
4483
|
}
|
|
4498
|
-
),
|
|
4499
|
-
children != null && /* @__PURE__ */ jsx(
|
|
4484
|
+
) }),
|
|
4485
|
+
children != null && /* @__PURE__ */ jsx(Text, { fontSize: s.label, children })
|
|
4500
4486
|
]
|
|
4501
4487
|
}
|
|
4502
4488
|
);
|
|
@@ -4981,6 +4967,11 @@ var Separator = React32__default.forwardRef(
|
|
|
4981
4967
|
);
|
|
4982
4968
|
}
|
|
4983
4969
|
);
|
|
4970
|
+
var MUTED3 = "var(--color-text-secondary)";
|
|
4971
|
+
var TRACK = "var(--color-border-divider)";
|
|
4972
|
+
var ACTIVE = "var(--color-link-primary)";
|
|
4973
|
+
var ACTIVE_HOVER = "var(--color-link-primary-hover)";
|
|
4974
|
+
var WHITE = "var(--color-white)";
|
|
4984
4975
|
var Slider = React32.forwardRef(
|
|
4985
4976
|
function Slider2(props, ref) {
|
|
4986
4977
|
const {
|
|
@@ -5013,21 +5004,23 @@ var Slider = React32.forwardRef(
|
|
|
5013
5004
|
const handleSlideEnd = React32.useCallback(() => {
|
|
5014
5005
|
onValueCommit?.(latest.current);
|
|
5015
5006
|
}, [onValueCommit]);
|
|
5016
|
-
return /* @__PURE__ */ jsxs(
|
|
5017
|
-
label && !showValue && /* @__PURE__ */ jsx(
|
|
5018
|
-
label && showValue && /* @__PURE__ */ jsxs(
|
|
5019
|
-
/* @__PURE__ */ jsx(
|
|
5020
|
-
/* @__PURE__ */ jsx(
|
|
5007
|
+
return /* @__PURE__ */ jsxs(YStack, { className, gap: 4, children: [
|
|
5008
|
+
label && !showValue && /* @__PURE__ */ jsx(Text, { fontSize: 14, fontWeight: "500", color: MUTED3, children: label }),
|
|
5009
|
+
label && showValue && /* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5010
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 14, fontWeight: "500", color: MUTED3, children: label }),
|
|
5011
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 14, color: MUTED3, children: (value ?? defaultValue ?? [])?.join(", ") })
|
|
5021
5012
|
] }),
|
|
5022
5013
|
/* @__PURE__ */ jsxs(
|
|
5023
5014
|
Slider$1,
|
|
5024
5015
|
{
|
|
5025
5016
|
ref,
|
|
5026
5017
|
unstyled: true,
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5018
|
+
position: "relative",
|
|
5019
|
+
flexDirection: "row",
|
|
5020
|
+
width: "100%",
|
|
5021
|
+
userSelect: "none",
|
|
5022
|
+
alignItems: "center",
|
|
5023
|
+
marginBottom: hasMarkLabel ? 24 : 0,
|
|
5031
5024
|
value,
|
|
5032
5025
|
defaultValue,
|
|
5033
5026
|
min,
|
|
@@ -5039,33 +5032,23 @@ var Slider = React32.forwardRef(
|
|
|
5039
5032
|
onValueChange: handleValueChange,
|
|
5040
5033
|
onSlideEnd: handleSlideEnd,
|
|
5041
5034
|
children: [
|
|
5042
|
-
/* @__PURE__ */ jsx(
|
|
5043
|
-
Slider$1.Track,
|
|
5044
|
-
{
|
|
5045
|
-
unstyled: true,
|
|
5046
|
-
className: "relative grow h-1.5 rounded-full bg-border-divider",
|
|
5047
|
-
children: /* @__PURE__ */ jsx(
|
|
5048
|
-
Slider$1.TrackActive,
|
|
5049
|
-
{
|
|
5050
|
-
unstyled: true,
|
|
5051
|
-
className: "absolute h-full rounded-full bg-link-primary"
|
|
5052
|
-
}
|
|
5053
|
-
)
|
|
5054
|
-
}
|
|
5055
|
-
),
|
|
5035
|
+
/* @__PURE__ */ jsx(Slider$1.Track, { unstyled: true, position: "relative", flexGrow: 1, height: 6, borderRadius: 9999, backgroundColor: TRACK, children: /* @__PURE__ */ jsx(Slider$1.TrackActive, { unstyled: true, position: "absolute", height: "100%", borderRadius: 9999, backgroundColor: ACTIVE }) }),
|
|
5056
5036
|
resolvedValue?.map((_, index) => /* @__PURE__ */ jsx(
|
|
5057
5037
|
Slider$1.Thumb,
|
|
5058
5038
|
{
|
|
5059
5039
|
index,
|
|
5060
5040
|
unstyled: true,
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5041
|
+
width: 20,
|
|
5042
|
+
height: 20,
|
|
5043
|
+
borderRadius: 9999,
|
|
5044
|
+
borderWidth: 2,
|
|
5045
|
+
borderColor: ACTIVE,
|
|
5046
|
+
backgroundColor: WHITE,
|
|
5047
|
+
boxShadow: "0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
5048
|
+
transition: "quick",
|
|
5049
|
+
hoverStyle: { borderColor: ACTIVE_HOVER },
|
|
5050
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: ACTIVE, outlineOffset: 2 },
|
|
5051
|
+
disabledStyle: { pointerEvents: "none", opacity: 0.5 }
|
|
5069
5052
|
},
|
|
5070
5053
|
index
|
|
5071
5054
|
))
|
|
@@ -5080,41 +5063,25 @@ function SliderMarks(props) {
|
|
|
5080
5063
|
const { marks, min, max } = props;
|
|
5081
5064
|
if (!marks?.length) return null;
|
|
5082
5065
|
const range = max - min;
|
|
5083
|
-
return /* @__PURE__ */ jsx(
|
|
5066
|
+
return /* @__PURE__ */ jsx(View, { position: "relative", width: "100%", height: 16, children: marks.map((mark, index) => {
|
|
5084
5067
|
const percent = (mark.value - min) / range * 100;
|
|
5085
|
-
return /* @__PURE__ */ jsxs(
|
|
5086
|
-
|
|
5087
|
-
{
|
|
5088
|
-
|
|
5089
|
-
style: { left: `${percent}%` },
|
|
5090
|
-
children: [
|
|
5091
|
-
/* @__PURE__ */ jsx("div", { className: "h-1.5 w-0.5 bg-border-divider" }),
|
|
5092
|
-
mark.label != null && /* @__PURE__ */ jsx("span", { className: "mt-0.5 text-xs text-text-secondary whitespace-nowrap", children: mark.label })
|
|
5093
|
-
]
|
|
5094
|
-
},
|
|
5095
|
-
index
|
|
5096
|
-
);
|
|
5068
|
+
return /* @__PURE__ */ jsxs(View, { position: "absolute", left: `${percent}%`, alignItems: "center", children: [
|
|
5069
|
+
/* @__PURE__ */ jsx(View, { width: 2, height: 6, backgroundColor: TRACK }),
|
|
5070
|
+
mark.label != null && /* @__PURE__ */ jsx(Text, { marginTop: 2, fontSize: 12, color: MUTED3, children: mark.label })
|
|
5071
|
+
] }, index);
|
|
5097
5072
|
}) });
|
|
5098
5073
|
}
|
|
5099
5074
|
var NOOP3 = () => {
|
|
5100
5075
|
};
|
|
5101
|
-
var
|
|
5102
|
-
sm: {
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
label: "text-xs"
|
|
5106
|
-
},
|
|
5107
|
-
md: {
|
|
5108
|
-
root: "h-5 w-9",
|
|
5109
|
-
thumb: "h-4 w-4",
|
|
5110
|
-
label: "text-sm"
|
|
5111
|
-
},
|
|
5112
|
-
lg: {
|
|
5113
|
-
root: "h-6 w-11",
|
|
5114
|
-
thumb: "h-5 w-5",
|
|
5115
|
-
label: "text-base"
|
|
5116
|
-
}
|
|
5076
|
+
var SIZE8 = {
|
|
5077
|
+
sm: { width: 28, height: 16, thumb: 12, label: 12 },
|
|
5078
|
+
md: { width: 36, height: 20, thumb: 16, label: 14 },
|
|
5079
|
+
lg: { width: 44, height: 24, thumb: 20, label: 16 }
|
|
5117
5080
|
};
|
|
5081
|
+
var TRACK_ON = "var(--color-text-primary)";
|
|
5082
|
+
var TRACK_OFF = "var(--color-switch-bg)";
|
|
5083
|
+
var OUTLINE3 = "var(--color-gray-500)";
|
|
5084
|
+
var WHITE2 = "var(--color-white)";
|
|
5118
5085
|
var SwitchBase = React32.forwardRef(
|
|
5119
5086
|
function Switch$1(props, ref) {
|
|
5120
5087
|
const {
|
|
@@ -5131,7 +5098,6 @@ var SwitchBase = React32.forwardRef(
|
|
|
5131
5098
|
disabled = false,
|
|
5132
5099
|
size = "md",
|
|
5133
5100
|
direction,
|
|
5134
|
-
className,
|
|
5135
5101
|
...rest
|
|
5136
5102
|
} = props;
|
|
5137
5103
|
const [internalChecked, setInternalChecked] = React32.useState(defaultChecked ?? false);
|
|
@@ -5146,18 +5112,19 @@ var SwitchBase = React32.forwardRef(
|
|
|
5146
5112
|
},
|
|
5147
5113
|
[isControlled, onCheckedChange]
|
|
5148
5114
|
);
|
|
5149
|
-
const
|
|
5115
|
+
const s = SIZE8[size];
|
|
5150
5116
|
const isRtl = direction === "rtl";
|
|
5151
5117
|
return /* @__PURE__ */ jsxs(
|
|
5152
|
-
|
|
5118
|
+
Label,
|
|
5153
5119
|
{
|
|
5154
5120
|
ref: rootRef,
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5121
|
+
unstyled: true,
|
|
5122
|
+
flexDirection: isRtl ? "row-reverse" : "row",
|
|
5123
|
+
alignItems: "center",
|
|
5124
|
+
gap: 8,
|
|
5125
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
5126
|
+
userSelect: "none",
|
|
5127
|
+
opacity: disabled ? 0.5 : 1,
|
|
5161
5128
|
onChange,
|
|
5162
5129
|
"data-disabled": disabled || void 0,
|
|
5163
5130
|
...rest,
|
|
@@ -5169,38 +5136,51 @@ var SwitchBase = React32.forwardRef(
|
|
|
5169
5136
|
checked: checkedState,
|
|
5170
5137
|
onCheckedChange: handleCheckedChange,
|
|
5171
5138
|
disabled,
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5139
|
+
position: "relative",
|
|
5140
|
+
flexShrink: 0,
|
|
5141
|
+
alignItems: "center",
|
|
5142
|
+
width: s.width,
|
|
5143
|
+
height: s.height,
|
|
5144
|
+
borderRadius: 9999,
|
|
5145
|
+
backgroundColor: checkedState ? TRACK_ON : TRACK_OFF,
|
|
5146
|
+
transition: "quick",
|
|
5147
|
+
focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE3, outlineOffset: 2 },
|
|
5180
5148
|
children: [
|
|
5181
|
-
trackLabel && /* @__PURE__ */ jsx(
|
|
5149
|
+
trackLabel && /* @__PURE__ */ jsx(
|
|
5150
|
+
Text,
|
|
5151
|
+
{
|
|
5152
|
+
position: "absolute",
|
|
5153
|
+
width: "100%",
|
|
5154
|
+
textAlign: "center",
|
|
5155
|
+
fontSize: 8,
|
|
5156
|
+
fontWeight: "700",
|
|
5157
|
+
color: WHITE2,
|
|
5158
|
+
pointerEvents: "none",
|
|
5159
|
+
children: checkedState ? trackLabel.on : trackLabel.off
|
|
5160
|
+
}
|
|
5161
|
+
),
|
|
5182
5162
|
/* @__PURE__ */ jsx(
|
|
5183
5163
|
Switch.Thumb,
|
|
5184
5164
|
{
|
|
5185
5165
|
unstyled: true,
|
|
5186
5166
|
"data-thumb": true,
|
|
5187
5167
|
transition: "quicker",
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5168
|
+
width: s.thumb,
|
|
5169
|
+
height: s.thumb,
|
|
5170
|
+
borderRadius: 9999,
|
|
5171
|
+
backgroundColor: WHITE2,
|
|
5172
|
+
boxShadow: "0 1px 2px 0 rgba(0,0,0,0.05)",
|
|
5173
|
+
children: thumbLabel && /* @__PURE__ */ jsx(Text, { width: "100%", height: "100%", textAlign: "center", fontSize: 8, children: checkedState ? thumbLabel.on : thumbLabel.off })
|
|
5193
5174
|
}
|
|
5194
5175
|
)
|
|
5195
5176
|
]
|
|
5196
5177
|
}
|
|
5197
5178
|
),
|
|
5198
|
-
/* @__PURE__ */ jsx(
|
|
5179
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
|
|
5199
5180
|
"input",
|
|
5200
5181
|
{
|
|
5201
5182
|
ref,
|
|
5202
5183
|
type: "checkbox",
|
|
5203
|
-
className: "sr-only",
|
|
5204
5184
|
checked: checkedState,
|
|
5205
5185
|
disabled,
|
|
5206
5186
|
tabIndex: -1,
|
|
@@ -5208,15 +5188,8 @@ var SwitchBase = React32.forwardRef(
|
|
|
5208
5188
|
onChange: NOOP3,
|
|
5209
5189
|
...inputProps
|
|
5210
5190
|
}
|
|
5211
|
-
),
|
|
5212
|
-
children != null && /* @__PURE__ */ jsx(
|
|
5213
|
-
"span",
|
|
5214
|
-
{
|
|
5215
|
-
...labelProps,
|
|
5216
|
-
className: cn(sizeClasses2.label, labelProps?.className),
|
|
5217
|
-
children
|
|
5218
|
-
}
|
|
5219
|
-
)
|
|
5191
|
+
) }),
|
|
5192
|
+
children != null && /* @__PURE__ */ jsx(Text, { ...labelProps, fontSize: s.label, children })
|
|
5220
5193
|
]
|
|
5221
5194
|
}
|
|
5222
5195
|
);
|
|
@@ -5634,14 +5607,14 @@ var Shape = React32.createContext({
|
|
|
5634
5607
|
size: "md",
|
|
5635
5608
|
fitted: false
|
|
5636
5609
|
});
|
|
5637
|
-
var
|
|
5610
|
+
var SIZE9 = {
|
|
5638
5611
|
sm: { height: 32, minWidth: 32, paddingVertical: 4, paddingHorizontal: 12, fontSize: 14 },
|
|
5639
5612
|
md: { height: 40, minWidth: 40, paddingVertical: 8, paddingHorizontal: 16, fontSize: 16 },
|
|
5640
5613
|
free: {}
|
|
5641
5614
|
};
|
|
5642
5615
|
var SELECTED_BG2 = "var(--color-selected-control-bg)";
|
|
5643
5616
|
var SELECTED_FG2 = "var(--color-selected-control-text)";
|
|
5644
|
-
var
|
|
5617
|
+
var VARIANT4 = {
|
|
5645
5618
|
solid: {
|
|
5646
5619
|
rest: {
|
|
5647
5620
|
fontWeight: "600",
|
|
@@ -5710,7 +5683,7 @@ var TabsList = (props) => {
|
|
|
5710
5683
|
};
|
|
5711
5684
|
var TabsTrigger = ({ children, ...props }) => {
|
|
5712
5685
|
const { variant, size, fitted } = React32.useContext(Shape);
|
|
5713
|
-
const { rest, active } =
|
|
5686
|
+
const { rest, active } = VARIANT4[variant];
|
|
5714
5687
|
const selected = useTabsContext().value === props.value;
|
|
5715
5688
|
return /* @__PURE__ */ jsx(
|
|
5716
5689
|
Tabs.Tab,
|
|
@@ -5723,7 +5696,7 @@ var TabsTrigger = ({ children, ...props }) => {
|
|
|
5723
5696
|
cursor: "pointer",
|
|
5724
5697
|
gap: 8,
|
|
5725
5698
|
borderWidth: 0,
|
|
5726
|
-
...
|
|
5699
|
+
...SIZE9[size],
|
|
5727
5700
|
...rest,
|
|
5728
5701
|
...selected ? active : null,
|
|
5729
5702
|
...fitted ? { flex: 1 } : null,
|
|
@@ -5742,25 +5715,24 @@ var nbsp = String.fromCharCode(160);
|
|
|
5742
5715
|
function TruncatedTextTooltip2({ label, children }) {
|
|
5743
5716
|
return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
5744
5717
|
}
|
|
5745
|
-
var
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
select: "cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76"
|
|
5718
|
+
var TAG_VARIANT = {
|
|
5719
|
+
subtle: { backgroundColor: "var(--color-tag-subtle-bg)" },
|
|
5720
|
+
clickable: { backgroundColor: "var(--color-tag-clickable-bg)", cursor: "pointer", hoverStyle: { opacity: 0.76 } },
|
|
5721
|
+
filter: { backgroundColor: "var(--color-tag-filter-bg)" },
|
|
5722
|
+
select: { backgroundColor: "var(--color-tag-select-bg)", cursor: "pointer", hoverStyle: { opacity: 0.76 } }
|
|
5751
5723
|
};
|
|
5752
|
-
var
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5724
|
+
var TAG_VARIANT_FG = {
|
|
5725
|
+
subtle: "var(--color-tag-subtle-fg)",
|
|
5726
|
+
clickable: "var(--color-tag-clickable-fg)",
|
|
5727
|
+
filter: void 0,
|
|
5728
|
+
select: "var(--color-tag-select-fg)"
|
|
5756
5729
|
};
|
|
5757
|
-
var
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
|
|
5730
|
+
var TAG_SIZE = {
|
|
5731
|
+
sm: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 20, gap: 4 },
|
|
5732
|
+
md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24, gap: 4 },
|
|
5733
|
+
lg: { paddingHorizontal: 6, paddingVertical: 6, minHeight: 32, minWidth: 32, gap: 4 }
|
|
5734
|
+
};
|
|
5735
|
+
var TAG_SIZE_FONT = { sm: 12, md: 14, lg: 14 };
|
|
5764
5736
|
var Tag = React32.forwardRef(
|
|
5765
5737
|
function Tag2(props, ref) {
|
|
5766
5738
|
const {
|
|
@@ -5780,52 +5752,84 @@ var Tag = React32.forwardRef(
|
|
|
5780
5752
|
className,
|
|
5781
5753
|
...rest
|
|
5782
5754
|
} = props;
|
|
5783
|
-
const
|
|
5755
|
+
const resolvedVariant = variant ?? "subtle";
|
|
5756
|
+
const resolvedSize = size ?? "md";
|
|
5757
|
+
const isSelected = Boolean(selected) && !loading;
|
|
5758
|
+
const backgroundColor = isSelected ? "var(--color-tag-select-selected-bg)" : TAG_VARIANT[resolvedVariant].backgroundColor;
|
|
5759
|
+
const color = isSelected ? "var(--color-tag-select-selected-fg)" : TAG_VARIANT_FG[resolvedVariant];
|
|
5760
|
+
const hoverStyle = isSelected ? { opacity: 0.76 } : TAG_VARIANT[resolvedVariant].hoverStyle;
|
|
5761
|
+
const textHoverColor = !isSelected && resolvedVariant === "select" ? "var(--color-hover)" : void 0;
|
|
5762
|
+
const labelElement = label ? /* @__PURE__ */ jsxs(Text, { fontSize: TAG_SIZE_FONT[resolvedSize], fontWeight: "500", color: "var(--color-text-secondary)", children: [
|
|
5784
5763
|
label,
|
|
5785
5764
|
":",
|
|
5786
5765
|
nbsp
|
|
5787
5766
|
] }) : null;
|
|
5788
|
-
const labelSpan = /* @__PURE__ */ jsxs(
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5767
|
+
const labelSpan = /* @__PURE__ */ jsxs(
|
|
5768
|
+
Text,
|
|
5769
|
+
{
|
|
5770
|
+
overflow: "hidden",
|
|
5771
|
+
textOverflow: "ellipsis",
|
|
5772
|
+
whiteSpace: "nowrap",
|
|
5773
|
+
fontWeight: "500",
|
|
5774
|
+
fontSize: TAG_SIZE_FONT[resolvedSize],
|
|
5775
|
+
color,
|
|
5776
|
+
hoverStyle: textHoverColor ? { color: textHoverColor } : void 0,
|
|
5777
|
+
children: [
|
|
5778
|
+
labelElement,
|
|
5779
|
+
children
|
|
5780
|
+
]
|
|
5781
|
+
}
|
|
5782
|
+
);
|
|
5792
5783
|
const contentElement = truncated ? /* @__PURE__ */ jsx(TruncatedTextTooltip2, { label: children, children: labelSpan }) : labelSpan;
|
|
5793
5784
|
return /* @__PURE__ */ jsx(Skeleton, { loading, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
5794
|
-
|
|
5785
|
+
XStack,
|
|
5795
5786
|
{
|
|
5796
5787
|
ref,
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5788
|
+
render: /* @__PURE__ */ jsx("span", {}),
|
|
5789
|
+
display: "inline-flex",
|
|
5790
|
+
alignItems: "center",
|
|
5791
|
+
verticalAlign: "top",
|
|
5792
|
+
maxWidth: "100%",
|
|
5793
|
+
userSelect: "text",
|
|
5794
|
+
...TAG_SIZE[resolvedSize],
|
|
5795
|
+
backgroundColor,
|
|
5796
|
+
hoverStyle,
|
|
5797
|
+
focusVisibleStyle: {
|
|
5798
|
+
outlineWidth: 2,
|
|
5799
|
+
outlineOffset: 2,
|
|
5800
|
+
outlineColor: "var(--color-gray-500)",
|
|
5801
|
+
outlineStyle: "solid"
|
|
5802
|
+
},
|
|
5803
|
+
cursor: disabled ? "not-allowed" : TAG_VARIANT[resolvedVariant].cursor,
|
|
5804
|
+
...disabled ? { opacity: 0.4, pointerEvents: "none" } : {},
|
|
5805
|
+
...isSelected && { "data-selected": true },
|
|
5806
5806
|
...disabled && { "data-disabled": true },
|
|
5807
|
+
className,
|
|
5807
5808
|
...rest,
|
|
5808
5809
|
children: [
|
|
5809
|
-
startElement && /* @__PURE__ */ jsx(
|
|
5810
|
+
startElement && /* @__PURE__ */ jsx(XStack, { flexShrink: 0, alignItems: "center", justifyContent: "center", children: startElement }),
|
|
5810
5811
|
contentElement,
|
|
5811
|
-
endElement &&
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5812
|
+
endElement && (() => {
|
|
5813
|
+
const { className: endClassName, ...endElementRest } = endElementProps ?? {};
|
|
5814
|
+
return /* @__PURE__ */ jsx(
|
|
5815
|
+
XStack,
|
|
5816
|
+
{
|
|
5817
|
+
...endElementRest,
|
|
5818
|
+
flexShrink: 0,
|
|
5819
|
+
alignItems: "center",
|
|
5820
|
+
justifyContent: "center",
|
|
5821
|
+
className: endClassName,
|
|
5822
|
+
children: endElement
|
|
5823
|
+
}
|
|
5824
|
+
);
|
|
5825
|
+
})(),
|
|
5826
|
+
closable && /* @__PURE__ */ jsx(XStack, { flexShrink: 0, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(CloseButton, { onClick: onClose }) })
|
|
5823
5827
|
]
|
|
5824
5828
|
}
|
|
5825
5829
|
) });
|
|
5826
5830
|
}
|
|
5827
5831
|
);
|
|
5828
|
-
var
|
|
5832
|
+
var SIZE10 = {
|
|
5829
5833
|
xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: 12, borderRadius: 4 },
|
|
5830
5834
|
sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: 14, borderRadius: 6 },
|
|
5831
5835
|
md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: 16, borderRadius: 6 },
|
|
@@ -5848,8 +5852,8 @@ var Textarea = React32__default.forwardRef(
|
|
|
5848
5852
|
unstyled: true,
|
|
5849
5853
|
className: className ? `lux-control ${className}` : "lux-control",
|
|
5850
5854
|
...CONTROL,
|
|
5851
|
-
...
|
|
5852
|
-
...
|
|
5855
|
+
...SIZE10[size],
|
|
5856
|
+
...VARIANT3[variant],
|
|
5853
5857
|
...rest,
|
|
5854
5858
|
onChange: handleChange
|
|
5855
5859
|
}
|
|
@@ -5958,20 +5962,55 @@ function fmtPct(n) {
|
|
|
5958
5962
|
if (n === void 0 || n === null) return "-";
|
|
5959
5963
|
return `${(n * 100).toFixed(1)}%`;
|
|
5960
5964
|
}
|
|
5965
|
+
var justify = (align) => align === "right" ? "flex-end" : align === "left" ? "flex-start" : "center";
|
|
5961
5966
|
function QuoteCell({ value, highlight, align = "right", onClick, className }) {
|
|
5962
5967
|
return /* @__PURE__ */ jsx(
|
|
5963
|
-
|
|
5968
|
+
View,
|
|
5964
5969
|
{
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
align === "right" ? "text-right" : "text-left",
|
|
5968
|
-
highlight && "text-zinc-100",
|
|
5969
|
-
!highlight && "text-zinc-400",
|
|
5970
|
-
onClick && "cursor-pointer hover:bg-zinc-700/50 transition-colors",
|
|
5971
|
-
className
|
|
5972
|
-
),
|
|
5970
|
+
unstyled: true,
|
|
5971
|
+
render: /* @__PURE__ */ jsx("td", {}),
|
|
5973
5972
|
onClick,
|
|
5974
|
-
|
|
5973
|
+
paddingHorizontal: 6,
|
|
5974
|
+
paddingVertical: 4,
|
|
5975
|
+
cursor: onClick ? "pointer" : void 0,
|
|
5976
|
+
transition: "quick",
|
|
5977
|
+
hoverStyle: onClick ? { backgroundColor: "var(--color-popover-item-hover)" } : void 0,
|
|
5978
|
+
style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
|
|
5979
|
+
className,
|
|
5980
|
+
children: /* @__PURE__ */ jsx(
|
|
5981
|
+
Text,
|
|
5982
|
+
{
|
|
5983
|
+
fontSize: 12,
|
|
5984
|
+
style: { fontFamily: "monospace", whiteSpace: "nowrap" },
|
|
5985
|
+
fontVariant: ["tabular-nums"],
|
|
5986
|
+
color: highlight ? "var(--color-text-primary)" : "var(--color-text-secondary)",
|
|
5987
|
+
children: value
|
|
5988
|
+
}
|
|
5989
|
+
)
|
|
5990
|
+
}
|
|
5991
|
+
);
|
|
5992
|
+
}
|
|
5993
|
+
function HeadCell({ children, colSpan, align = "center", size = "column", color }) {
|
|
5994
|
+
return /* @__PURE__ */ jsx(
|
|
5995
|
+
View,
|
|
5996
|
+
{
|
|
5997
|
+
unstyled: true,
|
|
5998
|
+
render: colSpan ? /* @__PURE__ */ jsx("th", { colSpan }) : /* @__PURE__ */ jsx("th", {}),
|
|
5999
|
+
paddingHorizontal: size === "group" ? 8 : 6,
|
|
6000
|
+
paddingVertical: size === "group" ? 6 : 4,
|
|
6001
|
+
style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
|
|
6002
|
+
children: children != null && /* @__PURE__ */ jsx(
|
|
6003
|
+
Text,
|
|
6004
|
+
{
|
|
6005
|
+
fontSize: 10,
|
|
6006
|
+
fontWeight: size === "group" ? "600" : "500",
|
|
6007
|
+
textTransform: "uppercase",
|
|
6008
|
+
letterSpacing: 0.5,
|
|
6009
|
+
style: { whiteSpace: "nowrap" },
|
|
6010
|
+
color: color ?? "var(--color-text-secondary)",
|
|
6011
|
+
children
|
|
6012
|
+
}
|
|
6013
|
+
)
|
|
5975
6014
|
}
|
|
5976
6015
|
);
|
|
5977
6016
|
}
|
|
@@ -6002,71 +6041,51 @@ var OptionChain = React32.forwardRef(
|
|
|
6002
6041
|
[onSelectContract]
|
|
6003
6042
|
);
|
|
6004
6043
|
return /* @__PURE__ */ jsx(
|
|
6005
|
-
|
|
6044
|
+
View,
|
|
6006
6045
|
{
|
|
6007
6046
|
ref,
|
|
6008
|
-
|
|
6047
|
+
unstyled: true,
|
|
6048
|
+
width: "100%",
|
|
6049
|
+
overflowX: "auto",
|
|
6050
|
+
className,
|
|
6009
6051
|
...rest,
|
|
6010
|
-
children: /* @__PURE__ */ jsxs("table", {
|
|
6011
|
-
/* @__PURE__ */ jsxs("thead", { children: [
|
|
6012
|
-
/* @__PURE__ */ jsxs("tr", {
|
|
6013
|
-
/* @__PURE__ */ jsx(
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
colSpan: CALL_HEADERS.length,
|
|
6017
|
-
className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-emerald-400",
|
|
6018
|
-
children: "Calls"
|
|
6019
|
-
}
|
|
6020
|
-
),
|
|
6021
|
-
/* @__PURE__ */ jsx("th", { className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-zinc-500", children: "Strike" }),
|
|
6022
|
-
/* @__PURE__ */ jsx(
|
|
6023
|
-
"th",
|
|
6024
|
-
{
|
|
6025
|
-
colSpan: PUT_HEADERS.length,
|
|
6026
|
-
className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-red-400",
|
|
6027
|
-
children: "Puts"
|
|
6028
|
-
}
|
|
6029
|
-
)
|
|
6052
|
+
children: /* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("table", {}), width: "100%", style: { borderCollapse: "collapse" }, children: [
|
|
6053
|
+
/* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("thead", {}), children: [
|
|
6054
|
+
/* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-border-divider)", children: [
|
|
6055
|
+
/* @__PURE__ */ jsx(HeadCell, { colSpan: CALL_HEADERS.length, size: "group", color: "var(--color-status-good)", children: "Calls" }),
|
|
6056
|
+
/* @__PURE__ */ jsx(HeadCell, { size: "group", children: "Strike" }),
|
|
6057
|
+
/* @__PURE__ */ jsx(HeadCell, { colSpan: PUT_HEADERS.length, size: "group", color: "var(--color-status-bad)", children: "Puts" })
|
|
6030
6058
|
] }),
|
|
6031
|
-
/* @__PURE__ */ jsxs("tr", {
|
|
6032
|
-
CALL_HEADERS.map((h) => /* @__PURE__ */ jsx(
|
|
6033
|
-
|
|
6034
|
-
{
|
|
6035
|
-
className: "px-1.5 py-1 text-right text-[10px] font-medium uppercase tracking-wider text-zinc-500",
|
|
6036
|
-
children: h
|
|
6037
|
-
},
|
|
6038
|
-
`call-${h}`
|
|
6039
|
-
)),
|
|
6040
|
-
/* @__PURE__ */ jsx("th", { className: "px-2 py-1 text-center text-[10px] font-medium uppercase tracking-wider text-zinc-500" }),
|
|
6059
|
+
/* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-popover-item-hover)", children: [
|
|
6060
|
+
CALL_HEADERS.map((h) => /* @__PURE__ */ jsx(HeadCell, { align: "right", children: h }, `call-${h}`)),
|
|
6061
|
+
/* @__PURE__ */ jsx(HeadCell, {}),
|
|
6041
6062
|
PUT_HEADERS.map((h) => /* @__PURE__ */ jsx(
|
|
6042
|
-
|
|
6063
|
+
HeadCell,
|
|
6043
6064
|
{
|
|
6044
|
-
|
|
6045
|
-
"px-1.5 py-1 text-[10px] font-medium uppercase tracking-wider text-zinc-500",
|
|
6046
|
-
h === "Bid" || h === "Ask" || h === "Last" ? "text-left" : "text-right"
|
|
6047
|
-
),
|
|
6065
|
+
align: h === "Bid" || h === "Ask" || h === "Last" ? "left" : "right",
|
|
6048
6066
|
children: h
|
|
6049
6067
|
},
|
|
6050
6068
|
`put-${h}`
|
|
6051
6069
|
))
|
|
6052
6070
|
] })
|
|
6053
6071
|
] }),
|
|
6054
|
-
/* @__PURE__ */ jsx("tbody", { children: strikes.map((row) => {
|
|
6072
|
+
/* @__PURE__ */ jsx(View, { unstyled: true, render: /* @__PURE__ */ jsx("tbody", {}), children: strikes.map((row) => {
|
|
6055
6073
|
const isATM = Math.abs(row.strike - spotPrice) <= (strikes.length > 1 ? Math.abs((strikes[1]?.strike ?? 0) - (strikes[0]?.strike ?? 0)) / 2 : 0.5);
|
|
6056
6074
|
const callITM = row.strike < spotPrice;
|
|
6057
6075
|
const putITM = row.strike > spotPrice;
|
|
6058
6076
|
const c = row.call;
|
|
6059
6077
|
const p = row.put;
|
|
6078
|
+
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";
|
|
6060
6079
|
return /* @__PURE__ */ jsxs(
|
|
6061
|
-
|
|
6080
|
+
View,
|
|
6062
6081
|
{
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
),
|
|
6082
|
+
unstyled: true,
|
|
6083
|
+
render: /* @__PURE__ */ jsx("tr", {}),
|
|
6084
|
+
borderBottomWidth: 1,
|
|
6085
|
+
borderColor: "color-mix(in srgb, var(--color-border-divider) 50%, transparent)",
|
|
6086
|
+
transition: "quick",
|
|
6087
|
+
backgroundColor: rowBg,
|
|
6088
|
+
hoverStyle: isATM || callITM || putITM ? void 0 : { backgroundColor: "var(--color-popover-item-hover)" },
|
|
6070
6089
|
children: [
|
|
6071
6090
|
/* @__PURE__ */ jsx(
|
|
6072
6091
|
QuoteCell,
|
|
@@ -6090,13 +6109,24 @@ var OptionChain = React32.forwardRef(
|
|
|
6090
6109
|
/* @__PURE__ */ jsx(QuoteCell, { value: fmtPct(c?.iv) }),
|
|
6091
6110
|
/* @__PURE__ */ jsx(QuoteCell, { value: fmt(c?.delta, 3) }),
|
|
6092
6111
|
/* @__PURE__ */ jsx(
|
|
6093
|
-
|
|
6112
|
+
View,
|
|
6094
6113
|
{
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6114
|
+
unstyled: true,
|
|
6115
|
+
render: /* @__PURE__ */ jsx("td", {}),
|
|
6116
|
+
paddingHorizontal: 8,
|
|
6117
|
+
paddingVertical: 4,
|
|
6118
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center" },
|
|
6119
|
+
children: /* @__PURE__ */ jsx(
|
|
6120
|
+
Text,
|
|
6121
|
+
{
|
|
6122
|
+
fontSize: 12,
|
|
6123
|
+
fontWeight: "600",
|
|
6124
|
+
style: { fontFamily: "monospace" },
|
|
6125
|
+
fontVariant: ["tabular-nums"],
|
|
6126
|
+
color: isATM ? "var(--foreground)" : "var(--muted-foreground)",
|
|
6127
|
+
children: fmt(row.strike)
|
|
6128
|
+
}
|
|
6129
|
+
)
|
|
6100
6130
|
}
|
|
6101
6131
|
),
|
|
6102
6132
|
/* @__PURE__ */ jsx(QuoteCell, { value: fmt(p?.delta, 3), align: "right" }),
|
|
@@ -6133,40 +6163,54 @@ var OptionChain = React32.forwardRef(
|
|
|
6133
6163
|
}
|
|
6134
6164
|
);
|
|
6135
6165
|
var GREEKS = [
|
|
6136
|
-
{ key: "delta", label: "Delta", symbol: "\u0394", color: "
|
|
6137
|
-
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "
|
|
6138
|
-
{ key: "theta", label: "Theta", symbol: "\u0398", color: "
|
|
6139
|
-
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "
|
|
6140
|
-
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "
|
|
6141
|
-
{ key: "iv", label: "IV", symbol: "\u03C3", color: "
|
|
6166
|
+
{ key: "delta", label: "Delta", symbol: "\u0394", color: "var(--foreground)", barColor: "var(--foreground)", decimals: 4, maxMagnitude: 1 },
|
|
6167
|
+
{ key: "gamma", label: "Gamma", symbol: "\u0393", color: "var(--chart-1)", barColor: "var(--chart-1)", decimals: 4, maxMagnitude: 0.1 },
|
|
6168
|
+
{ key: "theta", label: "Theta", symbol: "\u0398", color: "var(--chart-4)", barColor: "var(--chart-4)", decimals: 4, maxMagnitude: 1 },
|
|
6169
|
+
{ key: "vega", label: "Vega", symbol: "\u03BD", color: "var(--chart-2)", barColor: "var(--chart-2)", decimals: 4, maxMagnitude: 1 },
|
|
6170
|
+
{ key: "rho", label: "Rho", symbol: "\u03C1", color: "var(--chart-3)", barColor: "var(--chart-3)", decimals: 4, maxMagnitude: 1 },
|
|
6171
|
+
{ key: "iv", label: "IV", symbol: "\u03C3", color: "var(--chart-5)", barColor: "var(--chart-5)", decimals: 1, maxMagnitude: 100 }
|
|
6142
6172
|
];
|
|
6143
6173
|
function GreekItem({ def, value, compact }) {
|
|
6144
6174
|
const magnitude = Math.min(Math.abs(value) / def.maxMagnitude, 1);
|
|
6145
6175
|
const displayValue = def.key === "iv" ? `${(value * 100).toFixed(def.decimals)}%` : value.toFixed(def.decimals);
|
|
6146
|
-
return /* @__PURE__ */ jsxs(
|
|
6147
|
-
"
|
|
6148
|
-
{
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6176
|
+
return /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 6, minWidth: compact ? 0 : 100, children: [
|
|
6177
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, fontWeight: "600", flexShrink: 0, color: def.color, children: def.symbol }),
|
|
6178
|
+
!compact && /* @__PURE__ */ jsx(Text, { fontSize: 10, flexShrink: 0, width: 34, color: "var(--color-text-secondary)", children: def.label }),
|
|
6179
|
+
/* @__PURE__ */ jsx(
|
|
6180
|
+
Text,
|
|
6181
|
+
{
|
|
6182
|
+
fontSize: 12,
|
|
6183
|
+
flexShrink: 0,
|
|
6184
|
+
style: { fontFamily: "monospace" },
|
|
6185
|
+
fontVariant: ["tabular-nums"],
|
|
6186
|
+
color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-primary)",
|
|
6187
|
+
children: displayValue
|
|
6188
|
+
}
|
|
6189
|
+
),
|
|
6190
|
+
!compact && /* @__PURE__ */ jsx(
|
|
6191
|
+
View,
|
|
6192
|
+
{
|
|
6193
|
+
flex: 1,
|
|
6194
|
+
height: 4,
|
|
6195
|
+
borderRadius: 9999,
|
|
6196
|
+
minWidth: 24,
|
|
6197
|
+
maxWidth: 48,
|
|
6198
|
+
overflow: "hidden",
|
|
6199
|
+
backgroundColor: "var(--color-progress-track)",
|
|
6200
|
+
children: /* @__PURE__ */ jsx(
|
|
6201
|
+
View,
|
|
6162
6202
|
{
|
|
6163
|
-
|
|
6164
|
-
|
|
6203
|
+
height: "100%",
|
|
6204
|
+
borderRadius: 9999,
|
|
6205
|
+
transition: "quick",
|
|
6206
|
+
width: `${magnitude * 100}%`,
|
|
6207
|
+
opacity: 0.7,
|
|
6208
|
+
backgroundColor: def.barColor
|
|
6165
6209
|
}
|
|
6166
|
-
)
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
);
|
|
6210
|
+
)
|
|
6211
|
+
}
|
|
6212
|
+
)
|
|
6213
|
+
] });
|
|
6170
6214
|
}
|
|
6171
6215
|
var GreeksDisplay = React32.forwardRef(
|
|
6172
6216
|
function GreeksDisplay2(props, ref) {
|
|
@@ -6191,14 +6235,13 @@ var GreeksDisplay = React32.forwardRef(
|
|
|
6191
6235
|
};
|
|
6192
6236
|
const activeGreeks = GREEKS.filter((g) => values[g.key] !== void 0);
|
|
6193
6237
|
return /* @__PURE__ */ jsx(
|
|
6194
|
-
|
|
6238
|
+
XStack,
|
|
6195
6239
|
{
|
|
6196
6240
|
ref,
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
),
|
|
6241
|
+
flexWrap: "wrap",
|
|
6242
|
+
alignItems: "center",
|
|
6243
|
+
gap: compact ? 12 : 16,
|
|
6244
|
+
className,
|
|
6202
6245
|
...rest,
|
|
6203
6246
|
children: activeGreeks.map((g) => /* @__PURE__ */ jsx(
|
|
6204
6247
|
GreekItem,
|
|
@@ -6685,19 +6728,21 @@ var PnlDiagram = React32.forwardRef(
|
|
|
6685
6728
|
chartH
|
|
6686
6729
|
);
|
|
6687
6730
|
return /* @__PURE__ */ jsxs(
|
|
6688
|
-
|
|
6731
|
+
View,
|
|
6689
6732
|
{
|
|
6690
6733
|
ref,
|
|
6691
|
-
|
|
6734
|
+
unstyled: true,
|
|
6735
|
+
width: "100%",
|
|
6736
|
+
className,
|
|
6692
6737
|
...rest,
|
|
6693
6738
|
children: [
|
|
6694
|
-
/* @__PURE__ */ jsx(
|
|
6739
|
+
/* @__PURE__ */ jsx(View, { unstyled: true, ref: containerRef, width: "100%", height: "100%", minHeight: 200, children: /* @__PURE__ */ jsxs(
|
|
6695
6740
|
"svg",
|
|
6696
6741
|
{
|
|
6697
6742
|
width,
|
|
6698
6743
|
height,
|
|
6699
6744
|
viewBox: `0 0 ${width} ${height}`,
|
|
6700
|
-
|
|
6745
|
+
style: { userSelect: "none" },
|
|
6701
6746
|
onMouseMove: handleMouseMove,
|
|
6702
6747
|
onMouseLeave: handleMouseLeave,
|
|
6703
6748
|
children: [
|
|
@@ -6936,16 +6981,18 @@ var PnlDiagram = React32.forwardRef(
|
|
|
6936
6981
|
]
|
|
6937
6982
|
}
|
|
6938
6983
|
) }),
|
|
6939
|
-
/* @__PURE__ */ jsxs(
|
|
6940
|
-
/* @__PURE__ */ jsxs(
|
|
6941
|
-
/* @__PURE__ */ jsx(
|
|
6942
|
-
/* @__PURE__ */ jsx(
|
|
6984
|
+
/* @__PURE__ */ jsxs(XStack, { flexWrap: "wrap", alignItems: "center", gap: 16, paddingHorizontal: 8, paddingTop: 4, children: [
|
|
6985
|
+
/* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 6, children: [
|
|
6986
|
+
/* @__PURE__ */ jsx(View, { height: 2, width: 16, borderRadius: 4, backgroundColor: "var(--color-gray-200)" }),
|
|
6987
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, color: "var(--color-text-secondary)", children: "Combined" })
|
|
6943
6988
|
] }),
|
|
6944
|
-
legs.map((leg, i) => /* @__PURE__ */ jsxs(
|
|
6989
|
+
legs.map((leg, i) => /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 6, children: [
|
|
6945
6990
|
/* @__PURE__ */ jsx(
|
|
6946
|
-
|
|
6991
|
+
View,
|
|
6947
6992
|
{
|
|
6948
|
-
|
|
6993
|
+
height: 2,
|
|
6994
|
+
width: 16,
|
|
6995
|
+
borderRadius: 4,
|
|
6949
6996
|
style: {
|
|
6950
6997
|
backgroundColor: LEG_COLORS[i % LEG_COLORS.length],
|
|
6951
6998
|
opacity: 0.6,
|
|
@@ -6953,7 +7000,7 @@ var PnlDiagram = React32.forwardRef(
|
|
|
6953
7000
|
}
|
|
6954
7001
|
}
|
|
6955
7002
|
),
|
|
6956
|
-
/* @__PURE__ */ jsxs(
|
|
7003
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
|
|
6957
7004
|
leg.action === "buy" ? "B" : "S",
|
|
6958
7005
|
" ",
|
|
6959
7006
|
leg.quantity,
|
|
@@ -6963,9 +7010,9 @@ var PnlDiagram = React32.forwardRef(
|
|
|
6963
7010
|
leg.type === "call" ? "C" : "P"
|
|
6964
7011
|
] })
|
|
6965
7012
|
] }, i)),
|
|
6966
|
-
breakevens.length > 0 && /* @__PURE__ */ jsxs(
|
|
6967
|
-
/* @__PURE__ */ jsx(
|
|
6968
|
-
/* @__PURE__ */ jsxs(
|
|
7013
|
+
breakevens.length > 0 && /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 6, children: [
|
|
7014
|
+
/* @__PURE__ */ jsx(View, { width: 6, height: 6, borderRadius: 9999, style: { background: BREAKEVEN_COLOR } }),
|
|
7015
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
|
|
6969
7016
|
"BE: ",
|
|
6970
7017
|
breakevens.map((b) => b.toFixed(1)).join(", ")
|
|
6971
7018
|
] })
|
|
@@ -6980,6 +7027,7 @@ function formatDate(date) {
|
|
|
6980
7027
|
const d = new Date(date);
|
|
6981
7028
|
return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
6982
7029
|
}
|
|
7030
|
+
var MONO = { fontFamily: "monospace" };
|
|
6983
7031
|
var OptionPositionCard = React32.forwardRef(
|
|
6984
7032
|
function OptionPositionCard2(props, ref) {
|
|
6985
7033
|
const {
|
|
@@ -6993,64 +7041,76 @@ var OptionPositionCard = React32.forwardRef(
|
|
|
6993
7041
|
const isLong = position.quantity > 0;
|
|
6994
7042
|
const isCall = position.type === "call";
|
|
6995
7043
|
const isProfitable = position.pnl >= 0;
|
|
7044
|
+
const pnlColor = isProfitable ? "var(--color-status-good)" : "var(--color-status-bad)";
|
|
6996
7045
|
return /* @__PURE__ */ jsxs(
|
|
6997
|
-
|
|
7046
|
+
YStack,
|
|
6998
7047
|
{
|
|
6999
7048
|
ref,
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
),
|
|
7049
|
+
gap: 8,
|
|
7050
|
+
borderRadius: 8,
|
|
7051
|
+
borderWidth: 1,
|
|
7052
|
+
borderColor: "var(--color-border-divider)",
|
|
7053
|
+
backgroundColor: "var(--card)",
|
|
7054
|
+
padding: 12,
|
|
7055
|
+
className,
|
|
7004
7056
|
...rest,
|
|
7005
7057
|
children: [
|
|
7006
|
-
/* @__PURE__ */ jsxs(
|
|
7007
|
-
/* @__PURE__ */ jsx(
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7058
|
+
/* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [
|
|
7059
|
+
/* @__PURE__ */ jsx(XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsxs(
|
|
7060
|
+
XStack,
|
|
7061
|
+
{
|
|
7062
|
+
alignItems: "center",
|
|
7063
|
+
gap: 4,
|
|
7064
|
+
borderRadius: 4,
|
|
7065
|
+
paddingHorizontal: 6,
|
|
7066
|
+
paddingVertical: 2,
|
|
7067
|
+
backgroundColor: isCall ? "var(--secondary)" : "var(--muted)",
|
|
7068
|
+
children: [
|
|
7069
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.underlying }),
|
|
7070
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
|
|
7071
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.type === "call" ? "C" : "P" }),
|
|
7072
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "400", color: "var(--color-text-secondary)", children: formatDate(position.expiration) })
|
|
7073
|
+
]
|
|
7074
|
+
}
|
|
7075
|
+
) }),
|
|
7076
|
+
/* @__PURE__ */ jsxs(
|
|
7077
|
+
Text,
|
|
7078
|
+
{
|
|
7079
|
+
fontSize: 12,
|
|
7080
|
+
fontWeight: "600",
|
|
7081
|
+
style: MONO,
|
|
7082
|
+
fontVariant: ["tabular-nums"],
|
|
7083
|
+
color: isLong ? "var(--color-status-good)" : "var(--color-status-bad)",
|
|
7084
|
+
children: [
|
|
7085
|
+
isLong ? "+" : "",
|
|
7086
|
+
position.quantity
|
|
7087
|
+
]
|
|
7088
|
+
}
|
|
7089
|
+
)
|
|
7024
7090
|
] }),
|
|
7025
|
-
/* @__PURE__ */ jsxs(
|
|
7026
|
-
/* @__PURE__ */ jsxs(
|
|
7027
|
-
/* @__PURE__ */ jsx(
|
|
7028
|
-
/* @__PURE__ */ jsxs(
|
|
7091
|
+
/* @__PURE__ */ jsxs(XStack, { gap: 12, children: [
|
|
7092
|
+
/* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
|
|
7093
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Avg Cost" }),
|
|
7094
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
|
|
7029
7095
|
"$",
|
|
7030
7096
|
position.avgCost.toFixed(2)
|
|
7031
7097
|
] })
|
|
7032
7098
|
] }),
|
|
7033
|
-
/* @__PURE__ */ jsxs(
|
|
7034
|
-
/* @__PURE__ */ jsx(
|
|
7035
|
-
/* @__PURE__ */ jsxs(
|
|
7099
|
+
/* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
|
|
7100
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Value" }),
|
|
7101
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
|
|
7036
7102
|
"$",
|
|
7037
7103
|
position.currentValue.toFixed(2)
|
|
7038
7104
|
] })
|
|
7039
7105
|
] }),
|
|
7040
|
-
/* @__PURE__ */ jsxs(
|
|
7041
|
-
/* @__PURE__ */ jsx(
|
|
7042
|
-
/* @__PURE__ */ jsxs(
|
|
7043
|
-
/* @__PURE__ */ jsxs("
|
|
7044
|
-
"font-mono tabular-nums text-xs font-semibold",
|
|
7045
|
-
isProfitable ? "text-emerald-400" : "text-red-400"
|
|
7046
|
-
), children: [
|
|
7106
|
+
/* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, alignItems: "flex-end", children: [
|
|
7107
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "P/L" }),
|
|
7108
|
+
/* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
|
|
7109
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, children: [
|
|
7047
7110
|
isProfitable ? "+" : "",
|
|
7048
7111
|
position.pnl.toFixed(2)
|
|
7049
7112
|
] }),
|
|
7050
|
-
/* @__PURE__ */ jsxs("
|
|
7051
|
-
"font-mono tabular-nums text-[10px]",
|
|
7052
|
-
isProfitable ? "text-emerald-500/70" : "text-red-500/70"
|
|
7053
|
-
), children: [
|
|
7113
|
+
/* @__PURE__ */ jsxs(Text, { fontSize: 10, style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
|
|
7054
7114
|
"(",
|
|
7055
7115
|
isProfitable ? "+" : "",
|
|
7056
7116
|
position.pnlPercent.toFixed(1),
|
|
@@ -7059,53 +7119,47 @@ var OptionPositionCard = React32.forwardRef(
|
|
|
7059
7119
|
] })
|
|
7060
7120
|
] })
|
|
7061
7121
|
] }),
|
|
7062
|
-
/* @__PURE__ */ jsxs(
|
|
7063
|
-
/* @__PURE__ */ jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "
|
|
7064
|
-
/* @__PURE__ */ jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "
|
|
7065
|
-
/* @__PURE__ */ jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "
|
|
7066
|
-
/* @__PURE__ */ jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "
|
|
7122
|
+
/* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 12, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
|
|
7123
|
+
/* @__PURE__ */ jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "var(--foreground)" }),
|
|
7124
|
+
/* @__PURE__ */ jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "var(--chart-1)" }),
|
|
7125
|
+
/* @__PURE__ */ jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "var(--chart-4)" }),
|
|
7126
|
+
/* @__PURE__ */ jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "var(--chart-2)" })
|
|
7067
7127
|
] }),
|
|
7068
|
-
(onClose || onExercise || onRoll) && /* @__PURE__ */ jsxs(
|
|
7069
|
-
onClose && /* @__PURE__ */ jsx(
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
type: "button",
|
|
7073
|
-
onClick: () => onClose(position),
|
|
7074
|
-
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",
|
|
7075
|
-
children: "Close"
|
|
7076
|
-
}
|
|
7077
|
-
),
|
|
7078
|
-
onExercise && /* @__PURE__ */ jsx(
|
|
7079
|
-
"button",
|
|
7080
|
-
{
|
|
7081
|
-
type: "button",
|
|
7082
|
-
onClick: () => onExercise(position),
|
|
7083
|
-
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",
|
|
7084
|
-
children: "Exercise"
|
|
7085
|
-
}
|
|
7086
|
-
),
|
|
7087
|
-
onRoll && /* @__PURE__ */ jsx(
|
|
7088
|
-
"button",
|
|
7089
|
-
{
|
|
7090
|
-
type: "button",
|
|
7091
|
-
onClick: () => onRoll(position),
|
|
7092
|
-
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",
|
|
7093
|
-
children: "Roll"
|
|
7094
|
-
}
|
|
7095
|
-
)
|
|
7128
|
+
(onClose || onExercise || onRoll) && /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 8, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
|
|
7129
|
+
onClose && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onClose(position), children: "Close" }),
|
|
7130
|
+
onExercise && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onExercise(position), children: "Exercise" }),
|
|
7131
|
+
onRoll && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onRoll(position), children: "Roll" })
|
|
7096
7132
|
] })
|
|
7097
7133
|
]
|
|
7098
7134
|
}
|
|
7099
7135
|
);
|
|
7100
7136
|
}
|
|
7101
7137
|
);
|
|
7138
|
+
function ActionButton({ onClick, children }) {
|
|
7139
|
+
return /* @__PURE__ */ jsx(
|
|
7140
|
+
XStack,
|
|
7141
|
+
{
|
|
7142
|
+
unstyled: true,
|
|
7143
|
+
render: /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
7144
|
+
onClick,
|
|
7145
|
+
flex: 1,
|
|
7146
|
+
alignItems: "center",
|
|
7147
|
+
justifyContent: "center",
|
|
7148
|
+
borderRadius: 6,
|
|
7149
|
+
borderWidth: 0,
|
|
7150
|
+
paddingHorizontal: 8,
|
|
7151
|
+
paddingVertical: 4,
|
|
7152
|
+
backgroundColor: "var(--color-button-subtle-bg)",
|
|
7153
|
+
cursor: "pointer",
|
|
7154
|
+
hoverStyle: { color: "var(--color-hover)" },
|
|
7155
|
+
children: /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "500", color: "var(--color-button-subtle-fg)", children })
|
|
7156
|
+
}
|
|
7157
|
+
);
|
|
7158
|
+
}
|
|
7102
7159
|
function GreekPill({ label, value, color }) {
|
|
7103
|
-
return /* @__PURE__ */ jsxs(
|
|
7104
|
-
/* @__PURE__ */ jsx(
|
|
7105
|
-
/* @__PURE__ */ jsx("
|
|
7106
|
-
"font-mono tabular-nums text-[11px]",
|
|
7107
|
-
value < 0 ? "text-red-400" : "text-zinc-400"
|
|
7108
|
-
), children: value.toFixed(4) })
|
|
7160
|
+
return /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
|
|
7161
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 10, fontWeight: "600", color, children: label }),
|
|
7162
|
+
/* @__PURE__ */ jsx(Text, { fontSize: 11, style: MONO, fontVariant: ["tabular-nums"], color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)", children: value.toFixed(4) })
|
|
7109
7163
|
] });
|
|
7110
7164
|
}
|
|
7111
7165
|
function formatExpDate(date) {
|
|
@@ -7118,28 +7172,53 @@ var GROUP_LABELS = {
|
|
|
7118
7172
|
monthly: "Monthly",
|
|
7119
7173
|
quarterly: "Quarterly"
|
|
7120
7174
|
};
|
|
7175
|
+
var SHAPE = {
|
|
7176
|
+
selected: {
|
|
7177
|
+
borderColor: "transparent",
|
|
7178
|
+
backgroundColor: "var(--color-selected-control-bg)",
|
|
7179
|
+
color: "var(--color-selected-control-text)"
|
|
7180
|
+
},
|
|
7181
|
+
resting: {
|
|
7182
|
+
borderColor: "var(--color-border-divider)",
|
|
7183
|
+
backgroundColor: "var(--card)",
|
|
7184
|
+
color: "var(--color-text-secondary)",
|
|
7185
|
+
hoverStyle: { borderColor: "var(--color-hover)", color: "var(--color-hover)" }
|
|
7186
|
+
}
|
|
7187
|
+
};
|
|
7121
7188
|
function ExpirationPill({ exp, isSelected, onClick }) {
|
|
7189
|
+
const shape = isSelected ? SHAPE.selected : SHAPE.resting;
|
|
7190
|
+
const dteColor = exp.dte <= 7 && !isSelected ? "var(--color-status-warn)" : isSelected ? "var(--color-selected-control-text)" : "var(--muted-foreground)";
|
|
7122
7191
|
return /* @__PURE__ */ jsxs(
|
|
7123
|
-
|
|
7192
|
+
YStack,
|
|
7124
7193
|
{
|
|
7125
|
-
|
|
7194
|
+
unstyled: true,
|
|
7195
|
+
render: /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
7126
7196
|
onClick,
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7197
|
+
alignItems: "center",
|
|
7198
|
+
gap: 2,
|
|
7199
|
+
borderRadius: 6,
|
|
7200
|
+
paddingHorizontal: 12,
|
|
7201
|
+
paddingVertical: 6,
|
|
7202
|
+
flexShrink: 0,
|
|
7203
|
+
borderWidth: 1,
|
|
7204
|
+
borderStyle: "solid",
|
|
7205
|
+
cursor: "pointer",
|
|
7206
|
+
...shape,
|
|
7132
7207
|
children: [
|
|
7133
|
-
/* @__PURE__ */ jsx("
|
|
7134
|
-
/* @__PURE__ */ jsxs(
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7208
|
+
/* @__PURE__ */ jsx(Text, { unstyled: true, fontSize: 12, fontWeight: "500", style: { whiteSpace: "nowrap" }, children: formatExpDate(exp.date) }),
|
|
7209
|
+
/* @__PURE__ */ jsxs(
|
|
7210
|
+
Text,
|
|
7211
|
+
{
|
|
7212
|
+
fontVariant: ["tabular-nums"],
|
|
7213
|
+
style: { fontFamily: "monospace" },
|
|
7214
|
+
fontSize: 10,
|
|
7215
|
+
color: dteColor,
|
|
7216
|
+
children: [
|
|
7217
|
+
exp.dte,
|
|
7218
|
+
"d"
|
|
7219
|
+
]
|
|
7220
|
+
}
|
|
7221
|
+
)
|
|
7143
7222
|
]
|
|
7144
7223
|
}
|
|
7145
7224
|
);
|
|
@@ -7169,49 +7248,23 @@ var ExpirationSelector = React32.forwardRef(
|
|
|
7169
7248
|
label: GROUP_LABELS[type],
|
|
7170
7249
|
items: expirations.filter((e) => e.type === type)
|
|
7171
7250
|
})).filter((g) => g.items.length > 0);
|
|
7172
|
-
return /* @__PURE__ */ jsx(
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
ref,
|
|
7176
|
-
className: cn("flex flex-col gap-2", className),
|
|
7177
|
-
...rest,
|
|
7178
|
-
children: grouped.map((group) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
7179
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-zinc-600 px-1", children: group.label }),
|
|
7180
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 overflow-x-auto no-scrollbar", children: group.items.map((exp) => /* @__PURE__ */ jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsx(
|
|
7181
|
-
ExpirationPill,
|
|
7182
|
-
{
|
|
7183
|
-
exp,
|
|
7184
|
-
isSelected: exp.date === selected,
|
|
7185
|
-
onClick: () => onSelect(exp.date)
|
|
7186
|
-
}
|
|
7187
|
-
) }, exp.date)) })
|
|
7188
|
-
] }, group.type))
|
|
7189
|
-
}
|
|
7190
|
-
);
|
|
7191
|
-
}
|
|
7192
|
-
return /* @__PURE__ */ jsx(
|
|
7193
|
-
"div",
|
|
7194
|
-
{
|
|
7195
|
-
ref,
|
|
7196
|
-
className: cn("flex items-center gap-1", className),
|
|
7197
|
-
...rest,
|
|
7198
|
-
children: /* @__PURE__ */ jsx(
|
|
7199
|
-
"div",
|
|
7251
|
+
return /* @__PURE__ */ jsx(YStack, { ref, gap: 8, className, ...rest, children: grouped.map((group) => /* @__PURE__ */ jsxs(YStack, { gap: 4, children: [
|
|
7252
|
+
/* @__PURE__ */ jsx(
|
|
7253
|
+
Text,
|
|
7200
7254
|
{
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
onClick: () => onSelect(exp.date)
|
|
7209
|
-
}
|
|
7210
|
-
) }, exp.date))
|
|
7255
|
+
fontSize: 10,
|
|
7256
|
+
fontWeight: "600",
|
|
7257
|
+
textTransform: "uppercase",
|
|
7258
|
+
letterSpacing: 0.5,
|
|
7259
|
+
paddingHorizontal: 4,
|
|
7260
|
+
color: "var(--color-text-secondary)",
|
|
7261
|
+
children: group.label
|
|
7211
7262
|
}
|
|
7212
|
-
)
|
|
7213
|
-
|
|
7214
|
-
|
|
7263
|
+
),
|
|
7264
|
+
/* @__PURE__ */ jsx(XStack, { gap: 6, overflowX: "auto", overflowY: "hidden", className: "lux-no-scrollbar", children: group.items.map((exp) => /* @__PURE__ */ jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsx(ExpirationPill, { exp, isSelected: exp.date === selected, onClick: () => onSelect(exp.date) }) }, exp.date)) })
|
|
7265
|
+
] }, group.type)) });
|
|
7266
|
+
}
|
|
7267
|
+
return /* @__PURE__ */ jsx(XStack, { ref, alignItems: "center", gap: 4, className, ...rest, children: /* @__PURE__ */ jsx(XStack, { ref: scrollRef, gap: 6, overflowX: "auto", overflowY: "hidden", className: "lux-no-scrollbar", children: expirations.map((exp) => /* @__PURE__ */ jsx("div", { "data-selected": exp.date === selected || void 0, children: /* @__PURE__ */ jsx(ExpirationPill, { exp, isSelected: exp.date === selected, onClick: () => onSelect(exp.date) }) }, exp.date)) }) });
|
|
7215
7268
|
}
|
|
7216
7269
|
);
|
|
7217
7270
|
var bankColors = {
|