@luxfi/ui 7.4.11 → 7.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/alert.cjs +68 -46
  2. package/dist/alert.js +69 -46
  3. package/dist/avatar.cjs +49 -47
  4. package/dist/avatar.js +52 -49
  5. package/dist/badge.cjs +82 -49
  6. package/dist/badge.js +83 -50
  7. package/dist/checkbox.cjs +42 -75
  8. package/dist/checkbox.js +43 -76
  9. package/dist/chrome.cjs +3 -7
  10. package/dist/chrome.js +3 -7
  11. package/dist/close-button.cjs +3 -7
  12. package/dist/close-button.js +3 -7
  13. package/dist/dialog.cjs +3 -7
  14. package/dist/dialog.js +3 -7
  15. package/dist/drawer.cjs +3 -7
  16. package/dist/drawer.js +3 -7
  17. package/dist/empty-state.cjs +13 -13
  18. package/dist/empty-state.js +13 -13
  19. package/dist/expiration-selector.cjs +58 -63
  20. package/dist/expiration-selector.js +58 -63
  21. package/dist/greeks-display.cjs +48 -39
  22. package/dist/greeks-display.js +48 -39
  23. package/dist/index.cjs +1053 -888
  24. package/dist/index.js +1054 -889
  25. package/dist/input-group.cjs +36 -19
  26. package/dist/input-group.js +37 -19
  27. package/dist/option-chain.cjs +89 -67
  28. package/dist/option-chain.js +89 -67
  29. package/dist/option-position.cjs +88 -85
  30. package/dist/option-position.js +88 -85
  31. package/dist/pin-input.cjs +30 -29
  32. package/dist/pin-input.js +30 -29
  33. package/dist/pnl-diagram.cjs +20 -20
  34. package/dist/pnl-diagram.js +20 -20
  35. package/dist/popover.cjs +3 -7
  36. package/dist/popover.js +3 -7
  37. package/dist/progress-circle.cjs +40 -22
  38. package/dist/progress-circle.d.cts +5 -5
  39. package/dist/progress-circle.d.ts +5 -5
  40. package/dist/progress-circle.js +41 -22
  41. package/dist/progress.cjs +15 -22
  42. package/dist/progress.d.cts +6 -6
  43. package/dist/progress.d.ts +6 -6
  44. package/dist/progress.js +15 -22
  45. package/dist/radio.cjs +35 -68
  46. package/dist/radio.d.cts +18 -18
  47. package/dist/radio.d.ts +18 -18
  48. package/dist/radio.js +36 -69
  49. package/dist/rating.cjs +15 -17
  50. package/dist/rating.js +15 -17
  51. package/dist/slider.cjs +33 -50
  52. package/dist/slider.js +34 -51
  53. package/dist/strategy-builder.cjs +194 -115
  54. package/dist/strategy-builder.js +194 -115
  55. package/dist/switch.cjs +48 -55
  56. package/dist/switch.js +49 -56
  57. package/dist/tag.cjs +115 -69
  58. package/dist/tag.js +116 -69
  59. package/dist/tooltip.cjs +28 -17
  60. package/dist/tooltip.js +30 -18
  61. package/package.json +1 -1
  62. package/src/alert.tsx +78 -45
  63. package/src/avatar.tsx +54 -38
  64. package/src/badge.tsx +65 -44
  65. package/src/checkbox.tsx +70 -89
  66. package/src/close-button.tsx +3 -8
  67. package/src/empty-state.tsx +21 -17
  68. package/src/expiration-selector.tsx +84 -66
  69. package/src/greeks-display.tsx +59 -51
  70. package/src/input-group.tsx +38 -24
  71. package/src/option-chain.tsx +154 -104
  72. package/src/option-position.tsx +143 -114
  73. package/src/pin-input.tsx +37 -29
  74. package/src/pnl-diagram.tsx +36 -28
  75. package/src/progress-circle.tsx +52 -28
  76. package/src/progress.tsx +17 -21
  77. package/src/radio.tsx +56 -76
  78. package/src/rating.tsx +22 -20
  79. package/src/slider.tsx +43 -45
  80. package/src/strategy-builder.tsx +260 -162
  81. package/src/switch.tsx +63 -64
  82. package/src/tag.tsx +89 -51
  83. package/src/tooltip.tsx +21 -13
  84. package/tokens.css +18 -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) {
@@ -27,23 +26,26 @@ function _interopNamespace(e) {
27
26
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
27
 
29
28
  // src/pin-input.tsx
30
- function cn(...inputs) {
31
- return tailwindMerge.twMerge(clsx.clsx(inputs));
32
- }
33
- var INPUT_BASE = [
34
- "w-10 h-10",
35
- "text-center text-sm font-medium",
36
- "border-2 rounded-md",
37
- "outline-none appearance-none",
38
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)]",
39
- "border-[var(--color-input-border)]",
40
- "placeholder:text-[var(--color-input-placeholder)]",
41
- "hover:border-[var(--color-input-border-hover)]",
42
- "focus:border-[var(--color-input-border-focus)] focus:shadow-md",
43
- "disabled:opacity-40"
44
- ].join(" ");
45
- var INPUT_FILLED = "border-[var(--color-input-border)]";
46
- var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
29
+ var BOX = {
30
+ width: 40,
31
+ height: 40,
32
+ textAlign: "center",
33
+ fontSize: 14,
34
+ fontWeight: 500,
35
+ borderRadius: 6,
36
+ borderWidth: 2,
37
+ borderStyle: "solid",
38
+ outlineWidth: 0,
39
+ backgroundColor: "var(--color-input-bg)",
40
+ color: "var(--color-input-fg)",
41
+ borderColor: "var(--color-input-border)",
42
+ hoverStyle: { borderColor: "var(--color-input-border-hover)" },
43
+ focusStyle: {
44
+ borderColor: "var(--color-input-border-focus)",
45
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
46
+ },
47
+ disabledStyle: { opacity: 0.4 }
48
+ };
47
49
  var PinInput = React__namespace.forwardRef(
48
50
  function PinInput2(props, ref) {
49
51
  const {
@@ -135,8 +137,8 @@ var PinInput = React__namespace.forwardRef(
135
137
  const onKeyDownAtIndex = React__namespace.useCallback((index) => (e) => {
136
138
  handleKeyDown(index, e);
137
139
  }, [handleKeyDown]);
138
- const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
139
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn("inline-flex items-center", attached ? "gap-0" : "gap-2", className), children: [
140
+ const boxBackground = bgColor ? `var(--color-${bgColor.replace(/\./g, "-")})` : BOX.backgroundColor;
141
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { ref: rootRef, alignItems: "center", gap: attached ? 0 : 8, className, children: [
140
142
  /* @__PURE__ */ jsxRuntime.jsx(
141
143
  "input",
142
144
  {
@@ -148,9 +150,10 @@ var PinInput = React__namespace.forwardRef(
148
150
  }
149
151
  ),
150
152
  Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
151
- "input",
153
+ gui.Input,
152
154
  {
153
155
  ref: setInputRef(index),
156
+ unstyled: true,
154
157
  type: "text",
155
158
  inputMode: "numeric",
156
159
  autoComplete: otp ? "one-time-code" : "off",
@@ -159,14 +162,12 @@ var PinInput = React__namespace.forwardRef(
159
162
  placeholder,
160
163
  disabled,
161
164
  "aria-invalid": invalid || void 0,
165
+ "data-invalid": invalid || void 0,
162
166
  value: values[index] || "",
163
- className: cn(
164
- INPUT_BASE,
165
- values[index] && INPUT_FILLED,
166
- invalid && INPUT_INVALID,
167
- attached && index > 0 && "-ml-0.5"
168
- ),
169
- style: bgStyle,
167
+ className: "lux-control",
168
+ ...BOX,
169
+ backgroundColor: boxBackground,
170
+ marginLeft: attached && index > 0 ? -2 : void 0,
170
171
  onInput: onInputAtIndex(index),
171
172
  onKeyDown: onKeyDownAtIndex(index),
172
173
  onPaste: handlePaste,