@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,10 +1,9 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var gui = require('@hanzo/gui');
4
5
  var esToolkit = require('es-toolkit');
5
6
  var React = require('react');
6
- var clsx = require('clsx');
7
- var tailwindMerge = require('tailwind-merge');
8
7
  var jsxRuntime = require('react/jsx-runtime');
9
8
 
10
9
  function _interopNamespace(e) {
@@ -28,9 +27,14 @@ function _interopNamespace(e) {
28
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
28
 
30
29
  // src/input-group.tsx
31
- function cn(...inputs) {
32
- return tailwindMerge.twMerge(clsx.clsx(inputs));
33
- }
30
+ var ink = (children, Wrap = gui.Text, props = {}) => {
31
+ let hasText = false;
32
+ React.Children.forEach(children, (child) => {
33
+ if (typeof child === "string" || typeof child === "number") hasText = true;
34
+ });
35
+ if (!hasText) return children;
36
+ return React.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React.createElement(Wrap, props, child) : child);
37
+ };
34
38
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
35
39
  var InputGroup = React__namespace.forwardRef(
36
40
  function InputGroup2(props, ref) {
@@ -99,22 +103,30 @@ var InputGroup = React__namespace.forwardRef(
99
103
  const { className: startClassName, ...startRest } = startElementProps ?? {};
100
104
  const { className: endClassName, ...endRest } = endElementProps ?? {};
101
105
  return /* @__PURE__ */ jsxRuntime.jsxs(
102
- "div",
106
+ gui.XStack,
103
107
  {
104
108
  ref: combinedRef,
105
- className: cn("relative flex w-full items-center", className),
109
+ position: "relative",
110
+ width: "100%",
111
+ alignItems: "center",
112
+ className,
106
113
  ...rest,
107
114
  children: [
108
115
  startElement && /* @__PURE__ */ jsxRuntime.jsx(
109
- "div",
116
+ gui.XStack,
110
117
  {
111
118
  ref: startElementRef,
112
- className: cn(
113
- "pointer-events-none absolute inset-y-0 left-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
114
- startClassName
115
- ),
119
+ position: "absolute",
120
+ top: 0,
121
+ bottom: 0,
122
+ left: 0,
123
+ zIndex: 1,
124
+ alignItems: "center",
125
+ pointerEvents: "none",
126
+ style: { color: "var(--color-icon-secondary)" },
127
+ className: startClassName,
116
128
  ...startRest,
117
- children: startElement
129
+ children: ink(startElement)
118
130
  }
119
131
  ),
120
132
  React__namespace.Children.map(children, (child) => {
@@ -133,15 +145,20 @@ var InputGroup = React__namespace.forwardRef(
133
145
  });
134
146
  }),
135
147
  endElement && /* @__PURE__ */ jsxRuntime.jsx(
136
- "div",
148
+ gui.XStack,
137
149
  {
138
150
  ref: endElementRef,
139
- className: cn(
140
- "pointer-events-none absolute inset-y-0 right-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
141
- endClassName
142
- ),
151
+ position: "absolute",
152
+ top: 0,
153
+ bottom: 0,
154
+ right: 0,
155
+ zIndex: 1,
156
+ alignItems: "center",
157
+ pointerEvents: "none",
158
+ style: { color: "var(--color-icon-secondary)" },
159
+ className: endClassName,
143
160
  ...endRest,
144
- children: endElement
161
+ children: ink(endElement)
145
162
  }
146
163
  )
147
164
  ]
@@ -1,14 +1,19 @@
1
1
  "use client";
2
+ import { XStack, Text } from '@hanzo/gui';
2
3
  import { debounce } from 'es-toolkit';
3
4
  import * as React from 'react';
4
- import { clsx } from 'clsx';
5
- import { twMerge } from 'tailwind-merge';
5
+ import { Children, createElement } from 'react';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
7
 
8
8
  // src/input-group.tsx
9
- function cn(...inputs) {
10
- return twMerge(clsx(inputs));
11
- }
9
+ var ink = (children, Wrap = Text, props = {}) => {
10
+ let hasText = false;
11
+ Children.forEach(children, (child) => {
12
+ if (typeof child === "string" || typeof child === "number") hasText = true;
13
+ });
14
+ if (!hasText) return children;
15
+ return Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? createElement(Wrap, props, child) : child);
16
+ };
12
17
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
13
18
  var InputGroup = React.forwardRef(
14
19
  function InputGroup2(props, ref) {
@@ -77,22 +82,30 @@ var InputGroup = React.forwardRef(
77
82
  const { className: startClassName, ...startRest } = startElementProps ?? {};
78
83
  const { className: endClassName, ...endRest } = endElementProps ?? {};
79
84
  return /* @__PURE__ */ jsxs(
80
- "div",
85
+ XStack,
81
86
  {
82
87
  ref: combinedRef,
83
- className: cn("relative flex w-full items-center", className),
88
+ position: "relative",
89
+ width: "100%",
90
+ alignItems: "center",
91
+ className,
84
92
  ...rest,
85
93
  children: [
86
94
  startElement && /* @__PURE__ */ jsx(
87
- "div",
95
+ XStack,
88
96
  {
89
97
  ref: startElementRef,
90
- className: cn(
91
- "pointer-events-none absolute inset-y-0 left-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
92
- startClassName
93
- ),
98
+ position: "absolute",
99
+ top: 0,
100
+ bottom: 0,
101
+ left: 0,
102
+ zIndex: 1,
103
+ alignItems: "center",
104
+ pointerEvents: "none",
105
+ style: { color: "var(--color-icon-secondary)" },
106
+ className: startClassName,
94
107
  ...startRest,
95
- children: startElement
108
+ children: ink(startElement)
96
109
  }
97
110
  ),
98
111
  React.Children.map(children, (child) => {
@@ -111,15 +124,20 @@ var InputGroup = React.forwardRef(
111
124
  });
112
125
  }),
113
126
  endElement && /* @__PURE__ */ jsx(
114
- "div",
127
+ XStack,
115
128
  {
116
129
  ref: endElementRef,
117
- className: cn(
118
- "pointer-events-none absolute inset-y-0 right-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
119
- endClassName
120
- ),
130
+ position: "absolute",
131
+ top: 0,
132
+ bottom: 0,
133
+ right: 0,
134
+ zIndex: 1,
135
+ alignItems: "center",
136
+ pointerEvents: "none",
137
+ style: { color: "var(--color-icon-secondary)" },
138
+ className: endClassName,
121
139
  ...endRest,
122
- children: endElement
140
+ children: ink(endElement)
123
141
  }
124
142
  )
125
143
  ]
@@ -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 fmt(n, decimals = 2) {
33
29
  if (n === void 0 || n === null) return "-";
34
30
  return n.toFixed(decimals);
@@ -43,20 +39,55 @@ function fmtPct(n) {
43
39
  if (n === void 0 || n === null) return "-";
44
40
  return `${(n * 100).toFixed(1)}%`;
45
41
  }
42
+ var justify = (align) => align === "right" ? "flex-end" : align === "left" ? "flex-start" : "center";
46
43
  function QuoteCell({ value, highlight, align = "right", onClick, className }) {
47
44
  return /* @__PURE__ */ jsxRuntime.jsx(
48
- "td",
45
+ gui.View,
49
46
  {
50
- className: cn(
51
- "px-1.5 py-1 font-mono tabular-nums text-xs whitespace-nowrap",
52
- align === "right" ? "text-right" : "text-left",
53
- highlight && "text-zinc-100",
54
- !highlight && "text-zinc-400",
55
- onClick && "cursor-pointer hover:bg-zinc-700/50 transition-colors",
56
- className
57
- ),
47
+ unstyled: true,
48
+ render: /* @__PURE__ */ jsxRuntime.jsx("td", {}),
58
49
  onClick,
59
- children: value
50
+ paddingHorizontal: 6,
51
+ paddingVertical: 4,
52
+ cursor: onClick ? "pointer" : void 0,
53
+ transition: "quick",
54
+ hoverStyle: onClick ? { backgroundColor: "var(--color-popover-item-hover)" } : void 0,
55
+ style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
56
+ className,
57
+ children: /* @__PURE__ */ jsxRuntime.jsx(
58
+ gui.Text,
59
+ {
60
+ fontSize: 12,
61
+ style: { fontFamily: "monospace", whiteSpace: "nowrap" },
62
+ fontVariant: ["tabular-nums"],
63
+ color: highlight ? "var(--color-text-primary)" : "var(--color-text-secondary)",
64
+ children: value
65
+ }
66
+ )
67
+ }
68
+ );
69
+ }
70
+ function HeadCell({ children, colSpan, align = "center", size = "column", color }) {
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ gui.View,
73
+ {
74
+ unstyled: true,
75
+ render: colSpan ? /* @__PURE__ */ jsxRuntime.jsx("th", { colSpan }) : /* @__PURE__ */ jsxRuntime.jsx("th", {}),
76
+ paddingHorizontal: size === "group" ? 8 : 6,
77
+ paddingVertical: size === "group" ? 6 : 4,
78
+ style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
79
+ children: children != null && /* @__PURE__ */ jsxRuntime.jsx(
80
+ gui.Text,
81
+ {
82
+ fontSize: 10,
83
+ fontWeight: size === "group" ? "600" : "500",
84
+ textTransform: "uppercase",
85
+ letterSpacing: 0.5,
86
+ style: { whiteSpace: "nowrap" },
87
+ color: color ?? "var(--color-text-secondary)",
88
+ children
89
+ }
90
+ )
60
91
  }
61
92
  );
62
93
  }
@@ -87,71 +118,51 @@ var OptionChain = React__namespace.forwardRef(
87
118
  [onSelectContract]
88
119
  );
89
120
  return /* @__PURE__ */ jsxRuntime.jsx(
90
- "div",
121
+ gui.View,
91
122
  {
92
123
  ref,
93
- className: cn("w-full overflow-x-auto", className),
124
+ unstyled: true,
125
+ width: "100%",
126
+ overflowX: "auto",
127
+ className,
94
128
  ...rest,
95
- children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-xs", children: [
96
- /* @__PURE__ */ jsxRuntime.jsxs("thead", { children: [
97
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-zinc-800", children: [
98
- /* @__PURE__ */ jsxRuntime.jsx(
99
- "th",
100
- {
101
- colSpan: CALL_HEADERS.length,
102
- className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-emerald-400",
103
- children: "Calls"
104
- }
105
- ),
106
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-zinc-500", children: "Strike" }),
107
- /* @__PURE__ */ jsxRuntime.jsx(
108
- "th",
109
- {
110
- colSpan: PUT_HEADERS.length,
111
- className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-red-400",
112
- children: "Puts"
113
- }
114
- )
129
+ children: /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("table", {}), width: "100%", style: { borderCollapse: "collapse" }, children: [
130
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("thead", {}), children: [
131
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-border-divider)", children: [
132
+ /* @__PURE__ */ jsxRuntime.jsx(HeadCell, { colSpan: CALL_HEADERS.length, size: "group", color: "var(--color-status-good)", children: "Calls" }),
133
+ /* @__PURE__ */ jsxRuntime.jsx(HeadCell, { size: "group", children: "Strike" }),
134
+ /* @__PURE__ */ jsxRuntime.jsx(HeadCell, { colSpan: PUT_HEADERS.length, size: "group", color: "var(--color-status-bad)", children: "Puts" })
115
135
  ] }),
116
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-zinc-800/60", children: [
117
- CALL_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(
118
- "th",
119
- {
120
- className: "px-1.5 py-1 text-right text-[10px] font-medium uppercase tracking-wider text-zinc-500",
121
- children: h
122
- },
123
- `call-${h}`
124
- )),
125
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-center text-[10px] font-medium uppercase tracking-wider text-zinc-500" }),
136
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-popover-item-hover)", children: [
137
+ CALL_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(HeadCell, { align: "right", children: h }, `call-${h}`)),
138
+ /* @__PURE__ */ jsxRuntime.jsx(HeadCell, {}),
126
139
  PUT_HEADERS.map((h) => /* @__PURE__ */ jsxRuntime.jsx(
127
- "th",
140
+ HeadCell,
128
141
  {
129
- className: cn(
130
- "px-1.5 py-1 text-[10px] font-medium uppercase tracking-wider text-zinc-500",
131
- h === "Bid" || h === "Ask" || h === "Last" ? "text-left" : "text-right"
132
- ),
142
+ align: h === "Bid" || h === "Ask" || h === "Last" ? "left" : "right",
133
143
  children: h
134
144
  },
135
145
  `put-${h}`
136
146
  ))
137
147
  ] })
138
148
  ] }),
139
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: strikes.map((row) => {
149
+ /* @__PURE__ */ jsxRuntime.jsx(gui.View, { unstyled: true, render: /* @__PURE__ */ jsxRuntime.jsx("tbody", {}), children: strikes.map((row) => {
140
150
  const isATM = Math.abs(row.strike - spotPrice) <= (strikes.length > 1 ? Math.abs((strikes[1]?.strike ?? 0) - (strikes[0]?.strike ?? 0)) / 2 : 0.5);
141
151
  const callITM = row.strike < spotPrice;
142
152
  const putITM = row.strike > spotPrice;
143
153
  const c = row.call;
144
154
  const p = row.put;
155
+ 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";
145
156
  return /* @__PURE__ */ jsxRuntime.jsxs(
146
- "tr",
157
+ gui.View,
147
158
  {
148
- className: cn(
149
- "border-b border-zinc-800/30 transition-colors",
150
- isATM && "bg-zinc-800/60",
151
- !isATM && callITM && "bg-emerald-950/20",
152
- !isATM && putITM && "bg-red-950/20",
153
- !isATM && !callITM && !putITM && "hover:bg-zinc-800/30"
154
- ),
159
+ unstyled: true,
160
+ render: /* @__PURE__ */ jsxRuntime.jsx("tr", {}),
161
+ borderBottomWidth: 1,
162
+ borderColor: "color-mix(in srgb, var(--color-border-divider) 50%, transparent)",
163
+ transition: "quick",
164
+ backgroundColor: rowBg,
165
+ hoverStyle: isATM || callITM || putITM ? void 0 : { backgroundColor: "var(--color-popover-item-hover)" },
155
166
  children: [
156
167
  /* @__PURE__ */ jsxRuntime.jsx(
157
168
  QuoteCell,
@@ -175,13 +186,24 @@ var OptionChain = React__namespace.forwardRef(
175
186
  /* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmtPct(c?.iv) }),
176
187
  /* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmt(c?.delta, 3) }),
177
188
  /* @__PURE__ */ jsxRuntime.jsx(
178
- "td",
189
+ gui.View,
179
190
  {
180
- className: cn(
181
- "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
182
- isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
183
- ),
184
- children: fmt(row.strike)
191
+ unstyled: true,
192
+ render: /* @__PURE__ */ jsxRuntime.jsx("td", {}),
193
+ paddingHorizontal: 8,
194
+ paddingVertical: 4,
195
+ style: { display: "flex", alignItems: "center", justifyContent: "center" },
196
+ children: /* @__PURE__ */ jsxRuntime.jsx(
197
+ gui.Text,
198
+ {
199
+ fontSize: 12,
200
+ fontWeight: "600",
201
+ style: { fontFamily: "monospace" },
202
+ fontVariant: ["tabular-nums"],
203
+ color: isATM ? "var(--foreground)" : "var(--muted-foreground)",
204
+ children: fmt(row.strike)
205
+ }
206
+ )
185
207
  }
186
208
  ),
187
209
  /* @__PURE__ */ jsxRuntime.jsx(QuoteCell, { value: fmt(p?.delta, 3), align: "right" }),
@@ -1,12 +1,8 @@
1
1
  "use client";
2
+ import { View, 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 { jsx, jsxs } from 'react/jsx-runtime';
6
5
 
7
- function cn(...inputs) {
8
- return twMerge(clsx(inputs));
9
- }
10
6
  function fmt(n, decimals = 2) {
11
7
  if (n === void 0 || n === null) return "-";
12
8
  return n.toFixed(decimals);
@@ -21,20 +17,55 @@ function fmtPct(n) {
21
17
  if (n === void 0 || n === null) return "-";
22
18
  return `${(n * 100).toFixed(1)}%`;
23
19
  }
20
+ var justify = (align) => align === "right" ? "flex-end" : align === "left" ? "flex-start" : "center";
24
21
  function QuoteCell({ value, highlight, align = "right", onClick, className }) {
25
22
  return /* @__PURE__ */ jsx(
26
- "td",
23
+ View,
27
24
  {
28
- className: cn(
29
- "px-1.5 py-1 font-mono tabular-nums text-xs whitespace-nowrap",
30
- align === "right" ? "text-right" : "text-left",
31
- highlight && "text-zinc-100",
32
- !highlight && "text-zinc-400",
33
- onClick && "cursor-pointer hover:bg-zinc-700/50 transition-colors",
34
- className
35
- ),
25
+ unstyled: true,
26
+ render: /* @__PURE__ */ jsx("td", {}),
36
27
  onClick,
37
- children: value
28
+ paddingHorizontal: 6,
29
+ paddingVertical: 4,
30
+ cursor: onClick ? "pointer" : void 0,
31
+ transition: "quick",
32
+ hoverStyle: onClick ? { backgroundColor: "var(--color-popover-item-hover)" } : void 0,
33
+ style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
34
+ className,
35
+ children: /* @__PURE__ */ jsx(
36
+ Text,
37
+ {
38
+ fontSize: 12,
39
+ style: { fontFamily: "monospace", whiteSpace: "nowrap" },
40
+ fontVariant: ["tabular-nums"],
41
+ color: highlight ? "var(--color-text-primary)" : "var(--color-text-secondary)",
42
+ children: value
43
+ }
44
+ )
45
+ }
46
+ );
47
+ }
48
+ function HeadCell({ children, colSpan, align = "center", size = "column", color }) {
49
+ return /* @__PURE__ */ jsx(
50
+ View,
51
+ {
52
+ unstyled: true,
53
+ render: colSpan ? /* @__PURE__ */ jsx("th", { colSpan }) : /* @__PURE__ */ jsx("th", {}),
54
+ paddingHorizontal: size === "group" ? 8 : 6,
55
+ paddingVertical: size === "group" ? 6 : 4,
56
+ style: { display: "flex", alignItems: "center", justifyContent: justify(align) },
57
+ children: children != null && /* @__PURE__ */ jsx(
58
+ Text,
59
+ {
60
+ fontSize: 10,
61
+ fontWeight: size === "group" ? "600" : "500",
62
+ textTransform: "uppercase",
63
+ letterSpacing: 0.5,
64
+ style: { whiteSpace: "nowrap" },
65
+ color: color ?? "var(--color-text-secondary)",
66
+ children
67
+ }
68
+ )
38
69
  }
39
70
  );
40
71
  }
@@ -65,71 +96,51 @@ var OptionChain = React.forwardRef(
65
96
  [onSelectContract]
66
97
  );
67
98
  return /* @__PURE__ */ jsx(
68
- "div",
99
+ View,
69
100
  {
70
101
  ref,
71
- className: cn("w-full overflow-x-auto", className),
102
+ unstyled: true,
103
+ width: "100%",
104
+ overflowX: "auto",
105
+ className,
72
106
  ...rest,
73
- children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-xs", children: [
74
- /* @__PURE__ */ jsxs("thead", { children: [
75
- /* @__PURE__ */ jsxs("tr", { className: "border-b border-zinc-800", children: [
76
- /* @__PURE__ */ jsx(
77
- "th",
78
- {
79
- colSpan: CALL_HEADERS.length,
80
- className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-emerald-400",
81
- children: "Calls"
82
- }
83
- ),
84
- /* @__PURE__ */ jsx("th", { className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-zinc-500", children: "Strike" }),
85
- /* @__PURE__ */ jsx(
86
- "th",
87
- {
88
- colSpan: PUT_HEADERS.length,
89
- className: "px-2 py-1.5 text-center text-[10px] font-semibold uppercase tracking-wider text-red-400",
90
- children: "Puts"
91
- }
92
- )
107
+ children: /* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("table", {}), width: "100%", style: { borderCollapse: "collapse" }, children: [
108
+ /* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("thead", {}), children: [
109
+ /* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-border-divider)", children: [
110
+ /* @__PURE__ */ jsx(HeadCell, { colSpan: CALL_HEADERS.length, size: "group", color: "var(--color-status-good)", children: "Calls" }),
111
+ /* @__PURE__ */ jsx(HeadCell, { size: "group", children: "Strike" }),
112
+ /* @__PURE__ */ jsx(HeadCell, { colSpan: PUT_HEADERS.length, size: "group", color: "var(--color-status-bad)", children: "Puts" })
93
113
  ] }),
94
- /* @__PURE__ */ jsxs("tr", { className: "border-b border-zinc-800/60", children: [
95
- CALL_HEADERS.map((h) => /* @__PURE__ */ jsx(
96
- "th",
97
- {
98
- className: "px-1.5 py-1 text-right text-[10px] font-medium uppercase tracking-wider text-zinc-500",
99
- children: h
100
- },
101
- `call-${h}`
102
- )),
103
- /* @__PURE__ */ jsx("th", { className: "px-2 py-1 text-center text-[10px] font-medium uppercase tracking-wider text-zinc-500" }),
114
+ /* @__PURE__ */ jsxs(View, { unstyled: true, render: /* @__PURE__ */ jsx("tr", {}), borderBottomWidth: 1, borderColor: "var(--color-popover-item-hover)", children: [
115
+ CALL_HEADERS.map((h) => /* @__PURE__ */ jsx(HeadCell, { align: "right", children: h }, `call-${h}`)),
116
+ /* @__PURE__ */ jsx(HeadCell, {}),
104
117
  PUT_HEADERS.map((h) => /* @__PURE__ */ jsx(
105
- "th",
118
+ HeadCell,
106
119
  {
107
- className: cn(
108
- "px-1.5 py-1 text-[10px] font-medium uppercase tracking-wider text-zinc-500",
109
- h === "Bid" || h === "Ask" || h === "Last" ? "text-left" : "text-right"
110
- ),
120
+ align: h === "Bid" || h === "Ask" || h === "Last" ? "left" : "right",
111
121
  children: h
112
122
  },
113
123
  `put-${h}`
114
124
  ))
115
125
  ] })
116
126
  ] }),
117
- /* @__PURE__ */ jsx("tbody", { children: strikes.map((row) => {
127
+ /* @__PURE__ */ jsx(View, { unstyled: true, render: /* @__PURE__ */ jsx("tbody", {}), children: strikes.map((row) => {
118
128
  const isATM = Math.abs(row.strike - spotPrice) <= (strikes.length > 1 ? Math.abs((strikes[1]?.strike ?? 0) - (strikes[0]?.strike ?? 0)) / 2 : 0.5);
119
129
  const callITM = row.strike < spotPrice;
120
130
  const putITM = row.strike > spotPrice;
121
131
  const c = row.call;
122
132
  const p = row.put;
133
+ 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";
123
134
  return /* @__PURE__ */ jsxs(
124
- "tr",
135
+ View,
125
136
  {
126
- className: cn(
127
- "border-b border-zinc-800/30 transition-colors",
128
- isATM && "bg-zinc-800/60",
129
- !isATM && callITM && "bg-emerald-950/20",
130
- !isATM && putITM && "bg-red-950/20",
131
- !isATM && !callITM && !putITM && "hover:bg-zinc-800/30"
132
- ),
137
+ unstyled: true,
138
+ render: /* @__PURE__ */ jsx("tr", {}),
139
+ borderBottomWidth: 1,
140
+ borderColor: "color-mix(in srgb, var(--color-border-divider) 50%, transparent)",
141
+ transition: "quick",
142
+ backgroundColor: rowBg,
143
+ hoverStyle: isATM || callITM || putITM ? void 0 : { backgroundColor: "var(--color-popover-item-hover)" },
133
144
  children: [
134
145
  /* @__PURE__ */ jsx(
135
146
  QuoteCell,
@@ -153,13 +164,24 @@ var OptionChain = React.forwardRef(
153
164
  /* @__PURE__ */ jsx(QuoteCell, { value: fmtPct(c?.iv) }),
154
165
  /* @__PURE__ */ jsx(QuoteCell, { value: fmt(c?.delta, 3) }),
155
166
  /* @__PURE__ */ jsx(
156
- "td",
167
+ View,
157
168
  {
158
- className: cn(
159
- "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
160
- isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
161
- ),
162
- children: fmt(row.strike)
169
+ unstyled: true,
170
+ render: /* @__PURE__ */ jsx("td", {}),
171
+ paddingHorizontal: 8,
172
+ paddingVertical: 4,
173
+ style: { display: "flex", alignItems: "center", justifyContent: "center" },
174
+ children: /* @__PURE__ */ jsx(
175
+ Text,
176
+ {
177
+ fontSize: 12,
178
+ fontWeight: "600",
179
+ style: { fontFamily: "monospace" },
180
+ fontVariant: ["tabular-nums"],
181
+ color: isATM ? "var(--foreground)" : "var(--muted-foreground)",
182
+ children: fmt(row.strike)
183
+ }
184
+ )
163
185
  }
164
186
  ),
165
187
  /* @__PURE__ */ jsx(QuoteCell, { value: fmt(p?.delta, 3), align: "right" }),