@luxfi/ui 7.4.10 → 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.
Files changed (137) hide show
  1. package/dist/accordion.cjs +107 -166
  2. package/dist/accordion.d.cts +18 -51
  3. package/dist/accordion.d.ts +18 -51
  4. package/dist/accordion.js +109 -166
  5. package/dist/alert.cjs +68 -46
  6. package/dist/alert.js +69 -46
  7. package/dist/avatar.cjs +49 -46
  8. package/dist/avatar.js +52 -48
  9. package/dist/badge.cjs +82 -49
  10. package/dist/badge.js +83 -50
  11. package/dist/checkbox.cjs +42 -75
  12. package/dist/checkbox.js +43 -76
  13. package/dist/chrome.cjs +196 -386
  14. package/dist/chrome.js +198 -386
  15. package/dist/close-button.cjs +3 -7
  16. package/dist/close-button.js +3 -7
  17. package/dist/collapsible.cjs +35 -26
  18. package/dist/collapsible.d.cts +2 -1
  19. package/dist/collapsible.d.ts +2 -1
  20. package/dist/collapsible.js +34 -24
  21. package/dist/dialog.cjs +3 -7
  22. package/dist/dialog.d.cts +1 -1
  23. package/dist/dialog.d.ts +1 -1
  24. package/dist/dialog.js +3 -7
  25. package/dist/drawer.cjs +95 -122
  26. package/dist/drawer.d.cts +43 -10
  27. package/dist/drawer.d.ts +43 -10
  28. package/dist/drawer.js +97 -122
  29. package/dist/empty-state.cjs +13 -13
  30. package/dist/empty-state.js +13 -13
  31. package/dist/expiration-selector.cjs +58 -63
  32. package/dist/expiration-selector.js +58 -63
  33. package/dist/field.cjs +60 -109
  34. package/dist/field.d.cts +0 -1
  35. package/dist/field.d.ts +0 -1
  36. package/dist/field.js +61 -109
  37. package/dist/greeks-display.cjs +48 -39
  38. package/dist/greeks-display.js +48 -39
  39. package/dist/heading.cjs +10 -17
  40. package/dist/heading.d.cts +0 -2
  41. package/dist/heading.d.ts +0 -2
  42. package/dist/heading.js +10 -17
  43. package/dist/icon-button.cjs +82 -82
  44. package/dist/icon-button.d.cts +16 -12
  45. package/dist/icon-button.d.ts +16 -12
  46. package/dist/icon-button.js +82 -82
  47. package/dist/index.cjs +1812 -2105
  48. package/dist/index.d.cts +1 -5
  49. package/dist/index.d.ts +1 -5
  50. package/dist/index.js +1814 -2100
  51. package/dist/input-group.cjs +11 -12
  52. package/dist/input-group.js +11 -12
  53. package/dist/input.cjs +27 -27
  54. package/dist/input.d.cts +21 -1
  55. package/dist/input.d.ts +21 -1
  56. package/dist/input.js +25 -28
  57. package/dist/menu.cjs +160 -271
  58. package/dist/menu.d.cts +41 -57
  59. package/dist/menu.d.ts +41 -57
  60. package/dist/menu.js +161 -251
  61. package/dist/option-chain.cjs +89 -67
  62. package/dist/option-chain.js +89 -67
  63. package/dist/option-position.cjs +88 -85
  64. package/dist/option-position.js +88 -85
  65. package/dist/pnl-diagram.cjs +20 -20
  66. package/dist/pnl-diagram.js +20 -20
  67. package/dist/popover.cjs +4 -8
  68. package/dist/popover.js +4 -8
  69. package/dist/progress.cjs +15 -22
  70. package/dist/progress.d.cts +6 -6
  71. package/dist/progress.d.ts +6 -6
  72. package/dist/progress.js +15 -22
  73. package/dist/radio.cjs +35 -67
  74. package/dist/radio.d.cts +18 -18
  75. package/dist/radio.d.ts +18 -18
  76. package/dist/radio.js +36 -68
  77. package/dist/select.cjs +40 -39
  78. package/dist/select.d.cts +35 -4
  79. package/dist/select.d.ts +35 -4
  80. package/dist/select.js +40 -38
  81. package/dist/separator.cjs +8 -33
  82. package/dist/separator.js +8 -33
  83. package/dist/slider.cjs +33 -49
  84. package/dist/slider.js +34 -50
  85. package/dist/switch.cjs +48 -55
  86. package/dist/switch.js +49 -56
  87. package/dist/tabs.cjs +108 -197
  88. package/dist/tabs.d.cts +16 -60
  89. package/dist/tabs.d.ts +16 -60
  90. package/dist/tabs.js +109 -196
  91. package/dist/tag.cjs +112 -69
  92. package/dist/tag.js +113 -69
  93. package/dist/textarea.cjs +56 -27
  94. package/dist/textarea.js +57 -28
  95. package/dist/toaster.cjs +97 -79
  96. package/dist/toaster.d.cts +7 -8
  97. package/dist/toaster.d.ts +7 -8
  98. package/dist/toaster.js +78 -80
  99. package/dist/tooltip.cjs +28 -17
  100. package/dist/tooltip.js +30 -18
  101. package/package.json +2 -16
  102. package/src/accordion.tsx +173 -227
  103. package/src/alert.tsx +78 -45
  104. package/src/avatar.tsx +54 -37
  105. package/src/badge.tsx +65 -44
  106. package/src/checkbox.tsx +70 -89
  107. package/src/close-button.tsx +3 -8
  108. package/src/collapsible.tsx +55 -52
  109. package/src/drawer.tsx +123 -115
  110. package/src/empty-state.tsx +21 -17
  111. package/src/expiration-selector.tsx +84 -66
  112. package/src/field.tsx +68 -124
  113. package/src/greeks-display.tsx +59 -51
  114. package/src/heading.tsx +22 -26
  115. package/src/icon-button.tsx +134 -141
  116. package/src/ink.tsx +37 -0
  117. package/src/input-group.tsx +59 -36
  118. package/src/input.tsx +41 -32
  119. package/src/menu.tsx +224 -397
  120. package/src/option-chain.tsx +154 -104
  121. package/src/option-position.tsx +136 -114
  122. package/src/pin-input.tsx +37 -29
  123. package/src/pnl-diagram.tsx +36 -28
  124. package/src/popover.tsx +1 -1
  125. package/src/progress.tsx +17 -21
  126. package/src/radio.tsx +56 -75
  127. package/src/select.tsx +80 -59
  128. package/src/separator.tsx +13 -34
  129. package/src/slider.tsx +43 -44
  130. package/src/strategy-builder.tsx +245 -156
  131. package/src/switch.tsx +63 -64
  132. package/src/tabs.tsx +166 -296
  133. package/src/tag.tsx +89 -51
  134. package/src/textarea.tsx +19 -29
  135. package/src/toaster.tsx +118 -86
  136. package/src/tooltip.tsx +21 -13
  137. package/tokens.css +79 -0
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var gui = require('@hanzo/gui');
4
5
  var React = require('react');
5
- var clsx = require('clsx');
6
- var tailwindMerge = require('tailwind-merge');
7
6
  var jsxRuntime = require('react/jsx-runtime');
8
7
 
9
8
  function _interopNamespace(e) {
@@ -26,13 +25,11 @@ function _interopNamespace(e) {
26
25
 
27
26
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
27
 
29
- function cn(...inputs) {
30
- return tailwindMerge.twMerge(clsx.clsx(inputs));
31
- }
32
28
  function formatDate(date) {
33
29
  const d = new Date(date);
34
30
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
35
31
  }
32
+ var MONO = { fontFamily: "monospace" };
36
33
  var OptionPositionCard = React__namespace.forwardRef(
37
34
  function OptionPositionCard2(props, ref) {
38
35
  const {
@@ -46,64 +43,76 @@ var OptionPositionCard = React__namespace.forwardRef(
46
43
  const isLong = position.quantity > 0;
47
44
  const isCall = position.type === "call";
48
45
  const isProfitable = position.pnl >= 0;
46
+ const pnlColor = isProfitable ? "var(--color-status-good)" : "var(--color-status-bad)";
49
47
  return /* @__PURE__ */ jsxRuntime.jsxs(
50
- "div",
48
+ gui.YStack,
51
49
  {
52
50
  ref,
53
- className: cn(
54
- "flex flex-col gap-2 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3",
55
- className
56
- ),
51
+ gap: 8,
52
+ borderRadius: 8,
53
+ borderWidth: 1,
54
+ borderColor: "var(--color-border-divider)",
55
+ backgroundColor: "var(--card)",
56
+ padding: 12,
57
+ className,
57
58
  ...rest,
58
59
  children: [
59
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
60
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
61
- "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
62
- // Call vs put is a rank difference, not a hue difference.
63
- isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
64
- ), children: [
65
- position.underlying,
66
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
67
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "uppercase", children: position.type === "call" ? "C" : "P" }),
68
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-zinc-500 font-normal", children: formatDate(position.expiration) })
69
- ] }) }),
70
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
71
- "text-xs font-semibold font-mono tabular-nums",
72
- isLong ? "text-emerald-400" : "text-red-400"
73
- ), children: [
74
- isLong ? "+" : "",
75
- position.quantity
76
- ] })
60
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", children: [
61
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(
62
+ gui.XStack,
63
+ {
64
+ alignItems: "center",
65
+ gap: 4,
66
+ borderRadius: 4,
67
+ paddingHorizontal: 6,
68
+ paddingVertical: 2,
69
+ backgroundColor: isCall ? "var(--secondary)" : "var(--muted)",
70
+ children: [
71
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.underlying }),
72
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
73
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.type === "call" ? "C" : "P" }),
74
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "400", color: "var(--color-text-secondary)", children: formatDate(position.expiration) })
75
+ ]
76
+ }
77
+ ) }),
78
+ /* @__PURE__ */ jsxRuntime.jsxs(
79
+ gui.Text,
80
+ {
81
+ fontSize: 12,
82
+ fontWeight: "600",
83
+ style: MONO,
84
+ fontVariant: ["tabular-nums"],
85
+ color: isLong ? "var(--color-status-good)" : "var(--color-status-bad)",
86
+ children: [
87
+ isLong ? "+" : "",
88
+ position.quantity
89
+ ]
90
+ }
91
+ )
77
92
  ] }),
78
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
79
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
80
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "Avg Cost" }),
81
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono tabular-nums text-xs text-zinc-300", children: [
93
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: 12, children: [
94
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, children: [
95
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Avg Cost" }),
96
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
82
97
  "$",
83
98
  position.avgCost.toFixed(2)
84
99
  ] })
85
100
  ] }),
86
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
87
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "Value" }),
88
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono tabular-nums text-xs text-zinc-300", children: [
101
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, children: [
102
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Value" }),
103
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
89
104
  "$",
90
105
  position.currentValue.toFixed(2)
91
106
  ] })
92
107
  ] }),
93
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end", children: [
94
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "P/L" }),
95
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
96
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
97
- "font-mono tabular-nums text-xs font-semibold",
98
- isProfitable ? "text-emerald-400" : "text-red-400"
99
- ), children: [
108
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: 2, alignItems: "flex-end", children: [
109
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "P/L" }),
110
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 4, children: [
111
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, children: [
100
112
  isProfitable ? "+" : "",
101
113
  position.pnl.toFixed(2)
102
114
  ] }),
103
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
104
- "font-mono tabular-nums text-[10px]",
105
- isProfitable ? "text-emerald-500/70" : "text-red-500/70"
106
- ), children: [
115
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
107
116
  "(",
108
117
  isProfitable ? "+" : "",
109
118
  position.pnlPercent.toFixed(1),
@@ -112,53 +121,47 @@ var OptionPositionCard = React__namespace.forwardRef(
112
121
  ] })
113
122
  ] })
114
123
  ] }),
115
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-t border-zinc-800/60 pt-2", children: [
116
- /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "text-blue-400" }),
117
- /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "text-purple-400" }),
118
- /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "text-red-400" }),
119
- /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "text-emerald-400" })
124
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 12, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
125
+ /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "var(--foreground)" }),
126
+ /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "var(--chart-1)" }),
127
+ /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "var(--chart-4)" }),
128
+ /* @__PURE__ */ jsxRuntime.jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "var(--chart-2)" })
120
129
  ] }),
121
- (onClose || onExercise || onRoll) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border-t border-zinc-800/60 pt-2", children: [
122
- onClose && /* @__PURE__ */ jsxRuntime.jsx(
123
- "button",
124
- {
125
- type: "button",
126
- onClick: () => onClose(position),
127
- 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",
128
- children: "Close"
129
- }
130
- ),
131
- onExercise && /* @__PURE__ */ jsxRuntime.jsx(
132
- "button",
133
- {
134
- type: "button",
135
- onClick: () => onExercise(position),
136
- 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",
137
- children: "Exercise"
138
- }
139
- ),
140
- onRoll && /* @__PURE__ */ jsxRuntime.jsx(
141
- "button",
142
- {
143
- type: "button",
144
- onClick: () => onRoll(position),
145
- 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",
146
- children: "Roll"
147
- }
148
- )
130
+ (onClose || onExercise || onRoll) && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 8, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
131
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onClose(position), children: "Close" }),
132
+ onExercise && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onExercise(position), children: "Exercise" }),
133
+ onRoll && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { onClick: () => onRoll(position), children: "Roll" })
149
134
  ] })
150
135
  ]
151
136
  }
152
137
  );
153
138
  }
154
139
  );
140
+ function ActionButton({ onClick, children }) {
141
+ return /* @__PURE__ */ jsxRuntime.jsx(
142
+ gui.XStack,
143
+ {
144
+ unstyled: true,
145
+ render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
146
+ onClick,
147
+ flex: 1,
148
+ alignItems: "center",
149
+ justifyContent: "center",
150
+ borderRadius: 6,
151
+ borderWidth: 0,
152
+ paddingHorizontal: 8,
153
+ paddingVertical: 4,
154
+ backgroundColor: "var(--color-button-subtle-bg)",
155
+ cursor: "pointer",
156
+ hoverStyle: { color: "var(--color-hover)" },
157
+ children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 12, fontWeight: "500", color: "var(--color-button-subtle-fg)", children })
158
+ }
159
+ );
160
+ }
155
161
  function GreekPill({ label, value, color }) {
156
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
157
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[10px] font-semibold", color), children: label }),
158
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
159
- "font-mono tabular-nums text-[11px]",
160
- value < 0 ? "text-red-400" : "text-zinc-400"
161
- ), children: value.toFixed(4) })
162
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 4, children: [
163
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, fontWeight: "600", color, children: label }),
164
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 11, style: MONO, fontVariant: ["tabular-nums"], color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)", children: value.toFixed(4) })
162
165
  ] });
163
166
  }
164
167
 
@@ -1,16 +1,13 @@
1
1
  "use client";
2
+ import { YStack, XStack, Text } from '@hanzo/gui';
2
3
  import * as React from 'react';
3
- import { clsx } from 'clsx';
4
- import { twMerge } from 'tailwind-merge';
5
4
  import { jsxs, jsx } from 'react/jsx-runtime';
6
5
 
7
- function cn(...inputs) {
8
- return twMerge(clsx(inputs));
9
- }
10
6
  function formatDate(date) {
11
7
  const d = new Date(date);
12
8
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
13
9
  }
10
+ var MONO = { fontFamily: "monospace" };
14
11
  var OptionPositionCard = React.forwardRef(
15
12
  function OptionPositionCard2(props, ref) {
16
13
  const {
@@ -24,64 +21,76 @@ var OptionPositionCard = React.forwardRef(
24
21
  const isLong = position.quantity > 0;
25
22
  const isCall = position.type === "call";
26
23
  const isProfitable = position.pnl >= 0;
24
+ const pnlColor = isProfitable ? "var(--color-status-good)" : "var(--color-status-bad)";
27
25
  return /* @__PURE__ */ jsxs(
28
- "div",
26
+ YStack,
29
27
  {
30
28
  ref,
31
- className: cn(
32
- "flex flex-col gap-2 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3",
33
- className
34
- ),
29
+ gap: 8,
30
+ borderRadius: 8,
31
+ borderWidth: 1,
32
+ borderColor: "var(--color-border-divider)",
33
+ backgroundColor: "var(--card)",
34
+ padding: 12,
35
+ className,
35
36
  ...rest,
36
37
  children: [
37
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
38
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs("span", { className: cn(
39
- "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
40
- // Call vs put is a rank difference, not a hue difference.
41
- isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
42
- ), children: [
43
- position.underlying,
44
- /* @__PURE__ */ jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
45
- /* @__PURE__ */ jsx("span", { className: "uppercase", children: position.type === "call" ? "C" : "P" }),
46
- /* @__PURE__ */ jsx("span", { className: "text-zinc-500 font-normal", children: formatDate(position.expiration) })
47
- ] }) }),
48
- /* @__PURE__ */ jsxs("span", { className: cn(
49
- "text-xs font-semibold font-mono tabular-nums",
50
- isLong ? "text-emerald-400" : "text-red-400"
51
- ), children: [
52
- isLong ? "+" : "",
53
- position.quantity
54
- ] })
38
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [
39
+ /* @__PURE__ */ jsx(XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsxs(
40
+ XStack,
41
+ {
42
+ alignItems: "center",
43
+ gap: 4,
44
+ borderRadius: 4,
45
+ paddingHorizontal: 6,
46
+ paddingVertical: 2,
47
+ backgroundColor: isCall ? "var(--secondary)" : "var(--muted)",
48
+ children: [
49
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.underlying }),
50
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
51
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.type === "call" ? "C" : "P" }),
52
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "400", color: "var(--color-text-secondary)", children: formatDate(position.expiration) })
53
+ ]
54
+ }
55
+ ) }),
56
+ /* @__PURE__ */ jsxs(
57
+ Text,
58
+ {
59
+ fontSize: 12,
60
+ fontWeight: "600",
61
+ style: MONO,
62
+ fontVariant: ["tabular-nums"],
63
+ color: isLong ? "var(--color-status-good)" : "var(--color-status-bad)",
64
+ children: [
65
+ isLong ? "+" : "",
66
+ position.quantity
67
+ ]
68
+ }
69
+ )
55
70
  ] }),
56
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
57
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
58
- /* @__PURE__ */ jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "Avg Cost" }),
59
- /* @__PURE__ */ jsxs("span", { className: "font-mono tabular-nums text-xs text-zinc-300", children: [
71
+ /* @__PURE__ */ jsxs(XStack, { gap: 12, children: [
72
+ /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
73
+ /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Avg Cost" }),
74
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
60
75
  "$",
61
76
  position.avgCost.toFixed(2)
62
77
  ] })
63
78
  ] }),
64
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
65
- /* @__PURE__ */ jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "Value" }),
66
- /* @__PURE__ */ jsxs("span", { className: "font-mono tabular-nums text-xs text-zinc-300", children: [
79
+ /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
80
+ /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Value" }),
81
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
67
82
  "$",
68
83
  position.currentValue.toFixed(2)
69
84
  ] })
70
85
  ] }),
71
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end", children: [
72
- /* @__PURE__ */ jsx("span", { className: "text-[10px] uppercase tracking-wider text-zinc-500", children: "P/L" }),
73
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
74
- /* @__PURE__ */ jsxs("span", { className: cn(
75
- "font-mono tabular-nums text-xs font-semibold",
76
- isProfitable ? "text-emerald-400" : "text-red-400"
77
- ), children: [
86
+ /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, alignItems: "flex-end", children: [
87
+ /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "P/L" }),
88
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
89
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, children: [
78
90
  isProfitable ? "+" : "",
79
91
  position.pnl.toFixed(2)
80
92
  ] }),
81
- /* @__PURE__ */ jsxs("span", { className: cn(
82
- "font-mono tabular-nums text-[10px]",
83
- isProfitable ? "text-emerald-500/70" : "text-red-500/70"
84
- ), children: [
93
+ /* @__PURE__ */ jsxs(Text, { fontSize: 10, style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
85
94
  "(",
86
95
  isProfitable ? "+" : "",
87
96
  position.pnlPercent.toFixed(1),
@@ -90,53 +99,47 @@ var OptionPositionCard = React.forwardRef(
90
99
  ] })
91
100
  ] })
92
101
  ] }),
93
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-t border-zinc-800/60 pt-2", children: [
94
- /* @__PURE__ */ jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "text-blue-400" }),
95
- /* @__PURE__ */ jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "text-purple-400" }),
96
- /* @__PURE__ */ jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "text-red-400" }),
97
- /* @__PURE__ */ jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "text-emerald-400" })
102
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 12, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
103
+ /* @__PURE__ */ jsx(GreekPill, { label: "\u0394", value: position.greeks.delta, color: "var(--foreground)" }),
104
+ /* @__PURE__ */ jsx(GreekPill, { label: "\u0393", value: position.greeks.gamma, color: "var(--chart-1)" }),
105
+ /* @__PURE__ */ jsx(GreekPill, { label: "\u0398", value: position.greeks.theta, color: "var(--chart-4)" }),
106
+ /* @__PURE__ */ jsx(GreekPill, { label: "\u03BD", value: position.greeks.vega, color: "var(--chart-2)" })
98
107
  ] }),
99
- (onClose || onExercise || onRoll) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-t border-zinc-800/60 pt-2", children: [
100
- onClose && /* @__PURE__ */ jsx(
101
- "button",
102
- {
103
- type: "button",
104
- onClick: () => onClose(position),
105
- 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",
106
- children: "Close"
107
- }
108
- ),
109
- onExercise && /* @__PURE__ */ jsx(
110
- "button",
111
- {
112
- type: "button",
113
- onClick: () => onExercise(position),
114
- 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",
115
- children: "Exercise"
116
- }
117
- ),
118
- onRoll && /* @__PURE__ */ jsx(
119
- "button",
120
- {
121
- type: "button",
122
- onClick: () => onRoll(position),
123
- 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",
124
- children: "Roll"
125
- }
126
- )
108
+ (onClose || onExercise || onRoll) && /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 8, borderTopWidth: 1, borderColor: "var(--color-border-divider)", paddingTop: 8, children: [
109
+ onClose && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onClose(position), children: "Close" }),
110
+ onExercise && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onExercise(position), children: "Exercise" }),
111
+ onRoll && /* @__PURE__ */ jsx(ActionButton, { onClick: () => onRoll(position), children: "Roll" })
127
112
  ] })
128
113
  ]
129
114
  }
130
115
  );
131
116
  }
132
117
  );
118
+ function ActionButton({ onClick, children }) {
119
+ return /* @__PURE__ */ jsx(
120
+ XStack,
121
+ {
122
+ unstyled: true,
123
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
124
+ onClick,
125
+ flex: 1,
126
+ alignItems: "center",
127
+ justifyContent: "center",
128
+ borderRadius: 6,
129
+ borderWidth: 0,
130
+ paddingHorizontal: 8,
131
+ paddingVertical: 4,
132
+ backgroundColor: "var(--color-button-subtle-bg)",
133
+ cursor: "pointer",
134
+ hoverStyle: { color: "var(--color-hover)" },
135
+ children: /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "500", color: "var(--color-button-subtle-fg)", children })
136
+ }
137
+ );
138
+ }
133
139
  function GreekPill({ label, value, color }) {
134
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
135
- /* @__PURE__ */ jsx("span", { className: cn("text-[10px] font-semibold", color), children: label }),
136
- /* @__PURE__ */ jsx("span", { className: cn(
137
- "font-mono tabular-nums text-[11px]",
138
- value < 0 ? "text-red-400" : "text-zinc-400"
139
- ), children: value.toFixed(4) })
140
+ return /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
141
+ /* @__PURE__ */ jsx(Text, { fontSize: 10, fontWeight: "600", color, children: label }),
142
+ /* @__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) })
140
143
  ] });
141
144
  }
142
145
 
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var gui = require('@hanzo/gui');
4
5
  var React = require('react');
5
- var clsx = require('clsx');
6
- var tailwindMerge = require('tailwind-merge');
7
6
  var jsxRuntime = require('react/jsx-runtime');
8
7
 
9
8
  function _interopNamespace(e) {
@@ -26,9 +25,6 @@ function _interopNamespace(e) {
26
25
 
27
26
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
27
 
29
- function cn(...inputs) {
30
- return tailwindMerge.twMerge(clsx.clsx(inputs));
31
- }
32
28
  function calcLegPnl(leg, price, multiplier) {
33
29
  const premium = leg.premium ?? 0;
34
30
  let intrinsic;
@@ -160,19 +156,21 @@ var PnlDiagram = React__namespace.forwardRef(
160
156
  chartH
161
157
  );
162
158
  return /* @__PURE__ */ jsxRuntime.jsxs(
163
- "div",
159
+ gui.View,
164
160
  {
165
161
  ref,
166
- className: cn("w-full", className),
162
+ unstyled: true,
163
+ width: "100%",
164
+ className,
167
165
  ...rest,
168
166
  children: [
169
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "w-full h-full min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsxs(
167
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { unstyled: true, ref: containerRef, width: "100%", height: "100%", minHeight: 200, children: /* @__PURE__ */ jsxRuntime.jsxs(
170
168
  "svg",
171
169
  {
172
170
  width,
173
171
  height,
174
172
  viewBox: `0 0 ${width} ${height}`,
175
- className: "select-none",
173
+ style: { userSelect: "none" },
176
174
  onMouseMove: handleMouseMove,
177
175
  onMouseLeave: handleMouseLeave,
178
176
  children: [
@@ -411,16 +409,18 @@ var PnlDiagram = React__namespace.forwardRef(
411
409
  ]
412
410
  }
413
411
  ) }),
414
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-4 px-2 pt-1", children: [
415
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
416
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-0.5 w-4 bg-zinc-200 rounded" }),
417
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-zinc-400", children: "Combined" })
412
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { flexWrap: "wrap", alignItems: "center", gap: 16, paddingHorizontal: 8, paddingTop: 4, children: [
413
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
414
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { height: 2, width: 16, borderRadius: 4, backgroundColor: "var(--color-gray-200)" }),
415
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: "Combined" })
418
416
  ] }),
419
- legs.map((leg, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
417
+ legs.map((leg, i) => /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
420
418
  /* @__PURE__ */ jsxRuntime.jsx(
421
- "div",
419
+ gui.View,
422
420
  {
423
- className: "h-0.5 w-4 rounded",
421
+ height: 2,
422
+ width: 16,
423
+ borderRadius: 4,
424
424
  style: {
425
425
  backgroundColor: LEG_COLORS[i % LEG_COLORS.length],
426
426
  opacity: 0.6,
@@ -428,7 +428,7 @@ var PnlDiagram = React__namespace.forwardRef(
428
428
  }
429
429
  }
430
430
  ),
431
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-zinc-500", children: [
431
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
432
432
  leg.action === "buy" ? "B" : "S",
433
433
  " ",
434
434
  leg.quantity,
@@ -438,9 +438,9 @@ var PnlDiagram = React__namespace.forwardRef(
438
438
  leg.type === "call" ? "C" : "P"
439
439
  ] })
440
440
  ] }, i)),
441
- breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
442
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
443
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-zinc-500", children: [
441
+ breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", gap: 6, children: [
442
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { width: 6, height: 6, borderRadius: 9999, style: { background: BREAKEVEN_COLOR } }),
443
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
444
444
  "BE: ",
445
445
  breakevens.map((b) => b.toFixed(1)).join(", ")
446
446
  ] })