@luxfi/ui 6.1.3 → 7.1.0

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 (241) hide show
  1. package/dist/accordion.cjs +213 -0
  2. package/dist/accordion.d.cts +74 -0
  3. package/dist/accordion.d.ts +74 -0
  4. package/dist/accordion.js +186 -0
  5. package/dist/alert.cjs +430 -0
  6. package/dist/alert.d.cts +30 -0
  7. package/dist/alert.d.ts +30 -0
  8. package/dist/alert.js +408 -0
  9. package/dist/avatar.cjs +149 -0
  10. package/dist/avatar.d.cts +25 -0
  11. package/dist/avatar.d.ts +25 -0
  12. package/dist/avatar.js +125 -0
  13. package/dist/badge.cjs +452 -0
  14. package/dist/badge.d.cts +19 -0
  15. package/dist/badge.d.ts +19 -0
  16. package/dist/badge.js +431 -0
  17. package/dist/bank.cjs +272 -0
  18. package/dist/bank.d.cts +76 -0
  19. package/dist/bank.d.ts +76 -0
  20. package/dist/bank.js +258 -0
  21. package/dist/button.cjs +578 -0
  22. package/dist/button.d.cts +55 -0
  23. package/dist/button.d.ts +55 -0
  24. package/dist/button.js +553 -0
  25. package/dist/checkbox.cjs +265 -0
  26. package/dist/checkbox.d.cts +31 -0
  27. package/dist/checkbox.d.ts +31 -0
  28. package/dist/checkbox.js +241 -0
  29. package/dist/close-button.cjs +92 -0
  30. package/dist/close-button.d.cts +9 -0
  31. package/dist/close-button.d.ts +9 -0
  32. package/dist/close-button.js +70 -0
  33. package/dist/collapsible.cjs +555 -0
  34. package/dist/collapsible.d.cts +23 -0
  35. package/dist/collapsible.d.ts +23 -0
  36. package/dist/collapsible.js +532 -0
  37. package/dist/color-mode.cjs +96 -0
  38. package/dist/color-mode.d.cts +25 -0
  39. package/dist/color-mode.d.ts +25 -0
  40. package/dist/color-mode.js +72 -0
  41. package/dist/dialog.cjs +295 -0
  42. package/dist/dialog.d.cts +65 -0
  43. package/dist/dialog.d.ts +65 -0
  44. package/dist/dialog.js +263 -0
  45. package/dist/drawer.cjs +231 -0
  46. package/dist/drawer.d.cts +36 -0
  47. package/dist/drawer.d.ts +36 -0
  48. package/dist/drawer.js +199 -0
  49. package/dist/empty-state.cjs +93 -0
  50. package/dist/empty-state.d.cts +13 -0
  51. package/dist/empty-state.d.ts +13 -0
  52. package/dist/empty-state.js +71 -0
  53. package/dist/expiration-selector.cjs +138 -0
  54. package/dist/expiration-selector.d.cts +16 -0
  55. package/dist/expiration-selector.d.ts +16 -0
  56. package/dist/expiration-selector.js +116 -0
  57. package/dist/field.cjs +183 -0
  58. package/dist/field.d.cts +24 -0
  59. package/dist/field.d.ts +24 -0
  60. package/dist/field.js +160 -0
  61. package/dist/greeks-display.cjs +114 -0
  62. package/dist/greeks-display.d.cts +14 -0
  63. package/dist/greeks-display.d.ts +14 -0
  64. package/dist/greeks-display.js +92 -0
  65. package/dist/heading.cjs +41 -0
  66. package/dist/heading.d.cts +10 -0
  67. package/dist/heading.d.ts +10 -0
  68. package/dist/heading.js +35 -0
  69. package/dist/icon-button.cjs +367 -0
  70. package/dist/icon-button.d.cts +33 -0
  71. package/dist/icon-button.d.ts +33 -0
  72. package/dist/icon-button.js +345 -0
  73. package/dist/image.cjs +425 -0
  74. package/dist/image.d.cts +57 -0
  75. package/dist/image.d.ts +57 -0
  76. package/dist/image.js +404 -0
  77. package/dist/index.cjs +7220 -0
  78. package/dist/index.d.cts +55 -0
  79. package/dist/index.d.ts +55 -0
  80. package/dist/index.js +7043 -0
  81. package/dist/input-group.cjs +155 -0
  82. package/dist/input-group.d.cts +17 -0
  83. package/dist/input-group.d.ts +17 -0
  84. package/dist/input-group.js +133 -0
  85. package/dist/input.cjs +65 -0
  86. package/dist/input.d.cts +11 -0
  87. package/dist/input.d.ts +11 -0
  88. package/dist/input.js +59 -0
  89. package/dist/link.cjs +483 -0
  90. package/dist/link.d.cts +37 -0
  91. package/dist/link.d.ts +37 -0
  92. package/dist/link.js +459 -0
  93. package/dist/menu.cjs +305 -0
  94. package/dist/menu.d.cts +84 -0
  95. package/dist/menu.d.ts +84 -0
  96. package/dist/menu.js +269 -0
  97. package/dist/option-chain.cjs +221 -0
  98. package/dist/option-chain.d.cts +37 -0
  99. package/dist/option-chain.d.ts +37 -0
  100. package/dist/option-chain.js +199 -0
  101. package/dist/option-position.cjs +164 -0
  102. package/dist/option-position.d.cts +29 -0
  103. package/dist/option-position.d.ts +29 -0
  104. package/dist/option-position.js +142 -0
  105. package/dist/pin-input.cjs +182 -0
  106. package/dist/pin-input.d.cts +25 -0
  107. package/dist/pin-input.d.ts +25 -0
  108. package/dist/pin-input.js +160 -0
  109. package/dist/pnl-diagram.cjs +453 -0
  110. package/dist/pnl-diagram.d.cts +11 -0
  111. package/dist/pnl-diagram.d.ts +11 -0
  112. package/dist/pnl-diagram.js +431 -0
  113. package/dist/popover.cjs +342 -0
  114. package/dist/popover.d.cts +73 -0
  115. package/dist/popover.d.ts +73 -0
  116. package/dist/popover.js +310 -0
  117. package/dist/progress-circle.cjs +152 -0
  118. package/dist/progress-circle.d.cts +47 -0
  119. package/dist/progress-circle.d.ts +47 -0
  120. package/dist/progress-circle.js +128 -0
  121. package/dist/progress.cjs +117 -0
  122. package/dist/progress.d.cts +28 -0
  123. package/dist/progress.d.ts +28 -0
  124. package/dist/progress.js +94 -0
  125. package/dist/provider.cjs +62 -0
  126. package/dist/provider.d.cts +7 -0
  127. package/dist/provider.d.ts +7 -0
  128. package/dist/provider.js +40 -0
  129. package/dist/radio.cjs +177 -0
  130. package/dist/radio.d.cts +53 -0
  131. package/dist/radio.d.ts +53 -0
  132. package/dist/radio.js +153 -0
  133. package/dist/rating.cjs +80 -0
  134. package/dist/rating.d.cts +14 -0
  135. package/dist/rating.d.ts +14 -0
  136. package/dist/rating.js +58 -0
  137. package/dist/select.cjs +644 -0
  138. package/dist/select.d.cts +130 -0
  139. package/dist/select.d.ts +130 -0
  140. package/dist/select.js +610 -0
  141. package/dist/separator.cjs +57 -0
  142. package/dist/separator.d.cts +13 -0
  143. package/dist/separator.d.ts +13 -0
  144. package/dist/separator.js +51 -0
  145. package/dist/skeleton.cjs +223 -0
  146. package/dist/skeleton.d.cts +60 -0
  147. package/dist/skeleton.d.ts +60 -0
  148. package/dist/skeleton.js +199 -0
  149. package/dist/slider.cjs +138 -0
  150. package/dist/slider.d.cts +24 -0
  151. package/dist/slider.d.ts +24 -0
  152. package/dist/slider.js +115 -0
  153. package/dist/strategy-builder.cjs +373 -0
  154. package/dist/strategy-builder.d.cts +26 -0
  155. package/dist/strategy-builder.d.ts +26 -0
  156. package/dist/strategy-builder.js +351 -0
  157. package/dist/switch.cjs +163 -0
  158. package/dist/switch.d.cts +27 -0
  159. package/dist/switch.d.ts +27 -0
  160. package/dist/switch.js +140 -0
  161. package/dist/table.cjs +897 -0
  162. package/dist/table.d.cts +107 -0
  163. package/dist/table.d.ts +107 -0
  164. package/dist/table.js +866 -0
  165. package/dist/tabs.cjs +240 -0
  166. package/dist/tabs.d.cts +78 -0
  167. package/dist/tabs.d.ts +78 -0
  168. package/dist/tabs.js +213 -0
  169. package/dist/tag.cjs +529 -0
  170. package/dist/tag.d.cts +21 -0
  171. package/dist/tag.d.ts +21 -0
  172. package/dist/tag.js +507 -0
  173. package/dist/textarea.cjs +65 -0
  174. package/dist/textarea.d.cts +11 -0
  175. package/dist/textarea.d.ts +11 -0
  176. package/dist/textarea.js +59 -0
  177. package/dist/toaster.cjs +99 -0
  178. package/dist/toaster.d.cts +29 -0
  179. package/dist/toaster.d.ts +29 -0
  180. package/dist/toaster.js +96 -0
  181. package/dist/tooltip.cjs +172 -0
  182. package/dist/tooltip.d.cts +38 -0
  183. package/dist/tooltip.d.ts +38 -0
  184. package/dist/tooltip.js +150 -0
  185. package/dist/utils.cjs +11 -0
  186. package/dist/utils.d.cts +5 -0
  187. package/dist/utils.d.ts +5 -0
  188. package/dist/utils.js +9 -0
  189. package/package.json +284 -89
  190. package/src/accordion.tsx +285 -0
  191. package/src/alert.tsx +221 -0
  192. package/src/avatar.tsx +174 -0
  193. package/src/badge.tsx +147 -0
  194. package/src/bank.tsx +325 -0
  195. package/src/button.tsx +477 -0
  196. package/src/checkbox.tsx +307 -0
  197. package/src/close-button.tsx +77 -0
  198. package/src/collapsible.tsx +126 -0
  199. package/src/color-mode.tsx +125 -0
  200. package/src/dialog.tsx +346 -0
  201. package/src/drawer.tsx +186 -0
  202. package/src/empty-state.tsx +97 -0
  203. package/src/expiration-selector.tsx +163 -0
  204. package/src/field.tsx +202 -0
  205. package/src/greeks-display.tsx +138 -0
  206. package/src/heading.tsx +44 -0
  207. package/src/icon-button.tsx +217 -0
  208. package/src/image.tsx +280 -0
  209. package/src/index.ts +267 -138
  210. package/src/input-group.tsx +159 -0
  211. package/src/input.tsx +60 -0
  212. package/src/link.tsx +326 -0
  213. package/src/menu.tsx +471 -0
  214. package/src/option-chain.tsx +261 -0
  215. package/src/option-position.tsx +200 -0
  216. package/src/pin-input.tsx +187 -0
  217. package/src/pnl-diagram.tsx +458 -0
  218. package/src/popover.tsx +386 -0
  219. package/src/progress-circle.tsx +180 -0
  220. package/src/progress.tsx +109 -0
  221. package/src/provider.tsx +12 -0
  222. package/src/radio.tsx +175 -0
  223. package/src/rating.tsx +79 -0
  224. package/src/select.tsx +696 -0
  225. package/src/separator.tsx +59 -0
  226. package/src/skeleton.tsx +254 -0
  227. package/src/slider.tsx +152 -0
  228. package/src/strategy-builder.tsx +466 -0
  229. package/src/switch.tsx +158 -0
  230. package/src/table.tsx +621 -0
  231. package/src/tabs.tsx +354 -0
  232. package/src/tag.tsx +159 -0
  233. package/src/textarea.tsx +60 -0
  234. package/src/toaster.tsx +117 -0
  235. package/src/tokens.css +438 -0
  236. package/src/tooltip.tsx +191 -0
  237. package/src/utils/cn.ts +7 -0
  238. package/src/utils.ts +6 -0
  239. package/tokens.css +438 -0
  240. package/LICENSE +0 -122
  241. package/README.md +0 -109
package/dist/table.cjs ADDED
@@ -0,0 +1,897 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var esToolkit = require('es-toolkit');
5
+ var React3 = require('react');
6
+ var clsx = require('clsx');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
29
+
30
+ // src/table.tsx
31
+ function cn(...inputs) {
32
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
33
+ }
34
+ var SHIM_PROPS = [
35
+ "w",
36
+ "h",
37
+ "minW",
38
+ "maxW",
39
+ "display",
40
+ "flexGrow",
41
+ "flexShrink",
42
+ "flexBasis",
43
+ "fontWeight",
44
+ "textStyle",
45
+ "borderRadius",
46
+ "alignSelf",
47
+ "alignItems",
48
+ "justifyContent",
49
+ "color",
50
+ "mt",
51
+ "mb",
52
+ "ml",
53
+ "mr",
54
+ "height",
55
+ "overflow",
56
+ "whiteSpace",
57
+ "textOverflow",
58
+ "textTransform",
59
+ "gap",
60
+ "gridTemplateColumns",
61
+ "minWidth",
62
+ "boxSize",
63
+ "py",
64
+ "px",
65
+ "p",
66
+ "hideBelow",
67
+ "fontSize",
68
+ "flexWrap",
69
+ "wordBreak",
70
+ "lineHeight",
71
+ "marginRight",
72
+ "position",
73
+ "background"
74
+ ];
75
+ var S = 4;
76
+ function dim(v) {
77
+ if (v == null) return void 0;
78
+ if (typeof v === "number") return `${v * S}px`;
79
+ if (typeof v === "string") return v;
80
+ if (typeof v === "object") {
81
+ const o = v;
82
+ return o.base ?? o.lg ?? o.xl ?? Object.values(o)[0];
83
+ }
84
+ return void 0;
85
+ }
86
+ function sp(v) {
87
+ if (v === void 0) return void 0;
88
+ return typeof v === "number" ? `${v * S}px` : v;
89
+ }
90
+ function shimToStyle(props) {
91
+ const s = {};
92
+ if (props.w !== void 0) s.width = dim(props.w);
93
+ if (props.h !== void 0) s.height = dim(props.h);
94
+ if (props.minW !== void 0) s.minWidth = dim(props.minW);
95
+ if (props.maxW !== void 0) s.maxWidth = dim(props.maxW);
96
+ if (props.display !== void 0) s.display = props.display;
97
+ if (props.flexGrow !== void 0) s.flexGrow = props.flexGrow;
98
+ if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
99
+ if (props.flexBasis !== void 0) s.flexBasis = props.flexBasis;
100
+ if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
101
+ if (props.borderRadius !== void 0) s.borderRadius = props.borderRadius;
102
+ if (props.alignSelf !== void 0) s.alignSelf = props.alignSelf;
103
+ if (props.alignItems !== void 0) s.alignItems = props.alignItems;
104
+ if (props.justifyContent !== void 0) s.justifyContent = props.justifyContent;
105
+ if (props.color !== void 0) s.color = props.color;
106
+ if (props.mt !== void 0) s.marginTop = sp(props.mt);
107
+ if (props.mb !== void 0) s.marginBottom = sp(props.mb);
108
+ if (props.ml !== void 0) s.marginLeft = sp(props.ml);
109
+ if (props.mr !== void 0) s.marginRight = sp(props.mr);
110
+ if (props.height !== void 0) s.height = props.height;
111
+ if (props.overflow !== void 0) s.overflow = props.overflow;
112
+ if (props.whiteSpace !== void 0) s.whiteSpace = props.whiteSpace;
113
+ if (props.textOverflow !== void 0) s.textOverflow = props.textOverflow;
114
+ if (props.textTransform !== void 0) s.textTransform = props.textTransform;
115
+ if (props.gap !== void 0) s.gap = sp(props.gap);
116
+ if (props.gridTemplateColumns !== void 0) s.gridTemplateColumns = props.gridTemplateColumns;
117
+ if (props.minWidth !== void 0) s.minWidth = props.minWidth;
118
+ if (props.boxSize !== void 0) {
119
+ const v = typeof props.boxSize === "number" ? `${props.boxSize * S}px` : props.boxSize;
120
+ s.width = v;
121
+ s.height = v;
122
+ }
123
+ if (props.py !== void 0) {
124
+ const v = sp(props.py);
125
+ s.paddingTop = v;
126
+ s.paddingBottom = v;
127
+ }
128
+ if (props.px !== void 0) {
129
+ const v = sp(props.px);
130
+ s.paddingLeft = v;
131
+ s.paddingRight = v;
132
+ }
133
+ if (props.p !== void 0) s.padding = sp(props.p);
134
+ if (props.fontSize !== void 0) s.fontSize = props.fontSize;
135
+ if (props.flexWrap !== void 0) s.flexWrap = props.flexWrap;
136
+ if (props.wordBreak !== void 0) s.wordBreak = props.wordBreak;
137
+ if (props.lineHeight !== void 0) s.lineHeight = props.lineHeight;
138
+ if (props.marginRight !== void 0) s.marginRight = props.marginRight;
139
+ if (props.position !== void 0) s.position = props.position;
140
+ if (props.background !== void 0) s.background = props.background;
141
+ return s;
142
+ }
143
+ function stripShims(props) {
144
+ const out = { ...props };
145
+ for (const k of SHIM_PROPS) delete out[k];
146
+ return out;
147
+ }
148
+ var SKELETON_CLASSES = [
149
+ "animate-skeleton-shimmer rounded-sm",
150
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
151
+ "bg-[length:200%_100%]"
152
+ ].join(" ");
153
+ var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
154
+ var Skeleton = React3__namespace.forwardRef(
155
+ function Skeleton2(props, ref) {
156
+ const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
157
+ const shimStyle = shimToStyle(props);
158
+ const mergedStyle = Object.keys(shimStyle).length > 0 || styleProp ? { ...shimStyle, ...styleProp } : void 0;
159
+ const hideBelowClass = props.hideBelow ? HIDE_BELOW_MAP[props.hideBelow] : void 0;
160
+ const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
161
+ const htmlRest = stripShims(allRest);
162
+ if (!loading) {
163
+ if (asChild && React3__namespace.isValidElement(children)) return children;
164
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
165
+ }
166
+ if (asChild && React3__namespace.isValidElement(children)) {
167
+ return /* @__PURE__ */ jsxRuntime.jsx(
168
+ Component,
169
+ {
170
+ ref,
171
+ "data-loading": true,
172
+ className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
173
+ style: mergedStyle,
174
+ ...htmlRest,
175
+ children
176
+ }
177
+ );
178
+ }
179
+ return /* @__PURE__ */ jsxRuntime.jsx(
180
+ Component,
181
+ {
182
+ ref,
183
+ "data-loading": true,
184
+ className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
185
+ style: mergedStyle,
186
+ ...htmlRest,
187
+ children
188
+ }
189
+ );
190
+ }
191
+ );
192
+ React3__namespace.forwardRef(
193
+ function SkeletonCircle2(props, ref) {
194
+ const { size = 40, loading = true, className, ...rest } = props;
195
+ const dimension = typeof size === "number" ? `${size}px` : size;
196
+ return /* @__PURE__ */ jsxRuntime.jsx(
197
+ Skeleton,
198
+ {
199
+ ref,
200
+ loading,
201
+ className: cn("rounded-full shrink-0", className),
202
+ style: { width: dimension, height: dimension, ...rest.style },
203
+ ...rest
204
+ }
205
+ );
206
+ }
207
+ );
208
+ React3__namespace.forwardRef(
209
+ function SkeletonText2(props, ref) {
210
+ const { noOfLines = 3, loading = true, className, ...rest } = props;
211
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
212
+ Skeleton,
213
+ {
214
+ loading,
215
+ className: cn("h-4", index === noOfLines - 1 && "max-w-[80%]")
216
+ },
217
+ index
218
+ )) });
219
+ }
220
+ );
221
+ var ArrowIcon = ({ className, style }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, style, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 3h6v6M17 3L7 13M14 11v6H3V6h6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
222
+ function stripUtmParams(url) {
223
+ try {
224
+ const urlObj = new URL(url);
225
+ for (const param of ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]) {
226
+ urlObj.searchParams.delete(param);
227
+ }
228
+ return urlObj.toString();
229
+ } catch {
230
+ return url;
231
+ }
232
+ }
233
+ var VARIANT_CLASSES = {
234
+ primary: cn(
235
+ "text-[var(--color-link-primary)]",
236
+ "hover:no-underline hover:text-[var(--color-link-primary-hover)]",
237
+ "data-[hover]:no-underline data-[hover]:text-[var(--color-link-primary-hover)]"
238
+ ),
239
+ secondary: cn(
240
+ "text-[var(--color-link-secondary)]",
241
+ "hover:no-underline hover:text-[var(--color-hover)]",
242
+ "data-[hover]:no-underline data-[hover]:text-[var(--color-hover)]"
243
+ ),
244
+ subtle: cn(
245
+ "text-[var(--color-link-subtle)]",
246
+ "hover:text-[var(--color-link-subtle-hover)] hover:underline hover:decoration-[var(--color-link-subtle-hover)]",
247
+ "data-[hover]:text-[var(--color-link-subtle-hover)] data-[hover]:underline data-[hover]:decoration-[var(--color-link-subtle-hover)]"
248
+ ),
249
+ underlaid: cn(
250
+ "text-[var(--color-link-primary)] bg-[var(--color-link-underlaid-bg)]",
251
+ "px-2 py-1.5 rounded-md text-sm",
252
+ "hover:text-[var(--color-link-primary-hover)] hover:no-underline",
253
+ "data-[hover]:text-[var(--color-link-primary-hover)] data-[hover]:no-underline"
254
+ ),
255
+ menu: cn(
256
+ "text-[var(--color-link-menu)]",
257
+ "hover:text-[var(--color-hover)] hover:no-underline",
258
+ "data-[hover]:text-[var(--color-hover)] data-[hover]:no-underline"
259
+ ),
260
+ navigation: cn(
261
+ "text-[var(--color-link-nav-fg)] bg-transparent",
262
+ "hover:text-[var(--color-link-nav-fg-hover)] hover:no-underline",
263
+ "data-[hover]:text-[var(--color-link-nav-fg-hover)] data-[hover]:no-underline",
264
+ "data-[selected]:text-[var(--color-link-nav-fg-selected)] data-[selected]:bg-[var(--color-link-nav-bg-selected)]",
265
+ "data-[active]:text-[var(--color-link-nav-fg-active)]"
266
+ ),
267
+ plain: cn(
268
+ "text-inherit",
269
+ "hover:no-underline",
270
+ "data-[hover]:no-underline"
271
+ )
272
+ };
273
+ var BASE_CLASSES = "inline-flex items-center gap-0 cursor-pointer data-[disabled]:cursor-not-allowed";
274
+ var LinkExternalIcon = ({ color }) => /* @__PURE__ */ jsxRuntime.jsx(
275
+ ArrowIcon,
276
+ {
277
+ className: cn(
278
+ "size-3 align-middle shrink-0",
279
+ "group-hover:text-inherit"
280
+ ),
281
+ style: color ? { color } : { color: "var(--color-icon-secondary)" },
282
+ "aria-hidden": "true"
283
+ }
284
+ );
285
+ var SPACING = 4;
286
+ function resolveSpacing(v) {
287
+ if (v === void 0) return void 0;
288
+ if (typeof v === "number") return `${v * SPACING}px`;
289
+ if (typeof v === "string") return v;
290
+ if (typeof v === "object" && v !== null) {
291
+ const base = v.base;
292
+ if (base !== void 0) return typeof base === "number" ? `${base * SPACING}px` : base;
293
+ const lg = v.lg;
294
+ if (lg !== void 0) return typeof lg === "number" ? `${lg * SPACING}px` : lg;
295
+ }
296
+ return void 0;
297
+ }
298
+ var Link = React3__namespace.default.forwardRef(
299
+ function Link2(props, ref) {
300
+ const {
301
+ external,
302
+ loading,
303
+ href,
304
+ children,
305
+ disabled,
306
+ noIcon,
307
+ iconColor,
308
+ variant = "primary",
309
+ className,
310
+ asChild: _asChild,
311
+ // Strip Next.js-specific props (accepted for compat, not used)
312
+ shallow: _shallow,
313
+ prefetch: _prefetch,
314
+ scroll: _scroll,
315
+ // Strip Chakra style props
316
+ fontWeight: _fontWeight,
317
+ whiteSpace: _whiteSpace,
318
+ wordBreak: _wordBreak,
319
+ textStyle: _textStyle,
320
+ ml: _ml,
321
+ mr: _mr,
322
+ display: _display,
323
+ alignItems: _alignItems,
324
+ flexShrink: _flexShrink,
325
+ minW: _minW,
326
+ justifyContent: _justifyContent,
327
+ position: _position,
328
+ ...rest
329
+ } = props;
330
+ const shimStyle = {};
331
+ if (_fontWeight !== void 0) shimStyle.fontWeight = _fontWeight;
332
+ if (_whiteSpace) shimStyle.whiteSpace = _whiteSpace;
333
+ if (_wordBreak) shimStyle.wordBreak = _wordBreak;
334
+ if (_ml !== void 0) shimStyle.marginLeft = resolveSpacing(_ml);
335
+ if (_mr !== void 0) shimStyle.marginRight = resolveSpacing(_mr);
336
+ if (_display) shimStyle.display = _display;
337
+ if (_alignItems) shimStyle.alignItems = _alignItems;
338
+ if (_flexShrink !== void 0) shimStyle.flexShrink = _flexShrink;
339
+ if (_minW !== void 0) shimStyle.minWidth = typeof _minW === "number" ? `${_minW * SPACING}px` : _minW;
340
+ if (_justifyContent) shimStyle.justifyContent = _justifyContent;
341
+ if (_position) shimStyle.position = _position;
342
+ const linkClasses = cn(BASE_CLASSES, VARIANT_CLASSES[variant], className);
343
+ const linkStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
344
+ if (external) {
345
+ const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
346
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
347
+ "a",
348
+ {
349
+ href: processedHref,
350
+ className: cn("group", linkClasses),
351
+ style: linkStyle,
352
+ target: "_blank",
353
+ rel: "noopener noreferrer",
354
+ ...disabled ? { "data-disabled": true } : {},
355
+ ...rest,
356
+ children: [
357
+ children,
358
+ !noIcon && /* @__PURE__ */ jsxRuntime.jsx(LinkExternalIcon, { color: iconColor })
359
+ ]
360
+ }
361
+ ) });
362
+ }
363
+ if (href) {
364
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
365
+ "a",
366
+ {
367
+ href,
368
+ className: linkClasses,
369
+ style: linkStyle,
370
+ ...disabled ? { "data-disabled": true } : {},
371
+ ...rest,
372
+ children
373
+ }
374
+ ) });
375
+ }
376
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
377
+ "span",
378
+ {
379
+ className: linkClasses,
380
+ ...disabled ? { "data-disabled": true } : {},
381
+ ...rest,
382
+ children
383
+ }
384
+ ) });
385
+ }
386
+ );
387
+ React3__namespace.default.forwardRef(
388
+ function LinkBox2(props, ref) {
389
+ const { className, ...rest } = props;
390
+ return /* @__PURE__ */ jsxRuntime.jsx(
391
+ "div",
392
+ {
393
+ ref,
394
+ className: cn("relative", className),
395
+ ...rest
396
+ }
397
+ );
398
+ }
399
+ );
400
+ React3__namespace.default.forwardRef(
401
+ function LinkOverlay2(props, ref) {
402
+ const {
403
+ children,
404
+ external,
405
+ loading,
406
+ href,
407
+ noIcon,
408
+ iconColor,
409
+ variant = "primary",
410
+ className,
411
+ disabled,
412
+ asChild: _asChild2,
413
+ shallow: _shallow2,
414
+ prefetch: _prefetch2,
415
+ scroll: _scroll2,
416
+ fontWeight: _fw2,
417
+ whiteSpace: _ws2,
418
+ wordBreak: _wb2,
419
+ textStyle: _ts2,
420
+ ml: _ml2,
421
+ mr: _mr2,
422
+ display: _d2,
423
+ alignItems: _ai2,
424
+ flexShrink: _fs2,
425
+ minW: _mw2,
426
+ justifyContent: _jc2,
427
+ position: _p2,
428
+ ...rest
429
+ } = props;
430
+ const overlayClasses = cn(
431
+ BASE_CLASSES,
432
+ VARIANT_CLASSES[variant],
433
+ // Static positioning with a ::before pseudo-element that covers the LinkBox
434
+ "static",
435
+ 'before:absolute before:inset-0 before:z-0 before:content-[""]',
436
+ className
437
+ );
438
+ if (external) {
439
+ const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
440
+ return /* @__PURE__ */ jsxRuntime.jsx(
441
+ "a",
442
+ {
443
+ ref,
444
+ href: loading ? void 0 : processedHref,
445
+ className: overlayClasses,
446
+ target: "_blank",
447
+ rel: "noopener noreferrer",
448
+ ...rest,
449
+ children: (children || !noIcon && href) && /* @__PURE__ */ jsxRuntime.jsxs(Skeleton, { display: "inline-flex", alignItems: "center", loading, maxW: "100%", h: "100%", children: [
450
+ children,
451
+ !noIcon && href && /* @__PURE__ */ jsxRuntime.jsx(LinkExternalIcon, { color: iconColor })
452
+ ] })
453
+ }
454
+ );
455
+ }
456
+ const content = children ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { display: "inline-flex", alignItems: "center", loading, maxW: "100%", h: "100%", children }) : null;
457
+ if (href) {
458
+ return /* @__PURE__ */ jsxRuntime.jsx(
459
+ "a",
460
+ {
461
+ ref,
462
+ href,
463
+ className: overlayClasses,
464
+ ...rest,
465
+ children: content
466
+ }
467
+ );
468
+ }
469
+ return /* @__PURE__ */ jsxRuntime.jsx(
470
+ "span",
471
+ {
472
+ ref,
473
+ className: overlayClasses,
474
+ ...rest,
475
+ children: content
476
+ }
477
+ );
478
+ }
479
+ );
480
+ var ArrowIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14M12 5l7 7-7 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
481
+ var SPACING_SCALE = 4;
482
+ function toPixels(value) {
483
+ if (value === void 0) return void 0;
484
+ if (typeof value === "string") return value;
485
+ return `${value * SPACING_SCALE}px`;
486
+ }
487
+ function extractStyles(props) {
488
+ const style = {};
489
+ const rest = {};
490
+ for (const [key, value] of Object.entries(props)) {
491
+ if (value === void 0) continue;
492
+ switch (key) {
493
+ case "width":
494
+ case "w":
495
+ style.width = value;
496
+ break;
497
+ case "minWidth":
498
+ case "minW":
499
+ style.minWidth = value;
500
+ break;
501
+ case "maxWidth":
502
+ case "maxW":
503
+ style.maxWidth = value;
504
+ break;
505
+ case "height":
506
+ case "h":
507
+ style.height = value;
508
+ break;
509
+ case "textAlign":
510
+ style.textAlign = value;
511
+ break;
512
+ case "verticalAlign":
513
+ style.verticalAlign = value;
514
+ break;
515
+ case "whiteSpace":
516
+ style.whiteSpace = value;
517
+ break;
518
+ case "wordBreak":
519
+ style.wordBreak = value;
520
+ break;
521
+ case "textTransform":
522
+ style.textTransform = value;
523
+ break;
524
+ case "fontSize":
525
+ style.fontSize = value;
526
+ break;
527
+ case "lineHeight":
528
+ style.lineHeight = value;
529
+ break;
530
+ case "animation":
531
+ style.animation = value;
532
+ break;
533
+ case "tableLayout":
534
+ style.tableLayout = value;
535
+ break;
536
+ case "p":
537
+ style.padding = toPixels(value);
538
+ break;
539
+ case "px": {
540
+ const px = toPixels(value);
541
+ style.paddingLeft = px;
542
+ style.paddingRight = px;
543
+ break;
544
+ }
545
+ case "py": {
546
+ const py = toPixels(value);
547
+ style.paddingTop = py;
548
+ style.paddingBottom = py;
549
+ break;
550
+ }
551
+ case "pr":
552
+ style.paddingRight = toPixels(value);
553
+ break;
554
+ case "pl":
555
+ style.paddingLeft = toPixels(value);
556
+ break;
557
+ case "pt":
558
+ style.paddingTop = toPixels(value);
559
+ break;
560
+ case "pb":
561
+ style.paddingBottom = toPixels(value);
562
+ break;
563
+ case "m":
564
+ style.margin = toPixels(value);
565
+ break;
566
+ case "mx": {
567
+ const mx = toPixels(value);
568
+ style.marginLeft = mx;
569
+ style.marginRight = mx;
570
+ break;
571
+ }
572
+ case "my": {
573
+ const my = toPixels(value);
574
+ style.marginTop = my;
575
+ style.marginBottom = my;
576
+ break;
577
+ }
578
+ case "mr":
579
+ style.marginRight = toPixels(value);
580
+ break;
581
+ case "ml":
582
+ style.marginLeft = toPixels(value);
583
+ break;
584
+ case "mt":
585
+ style.marginTop = toPixels(value);
586
+ break;
587
+ case "mb":
588
+ style.marginBottom = toPixels(value);
589
+ break;
590
+ case "position":
591
+ style.position = value;
592
+ break;
593
+ case "top":
594
+ style.top = typeof value === "number" ? `${value}px` : value;
595
+ break;
596
+ case "left":
597
+ style.left = typeof value === "number" ? `${value}px` : value;
598
+ break;
599
+ case "right":
600
+ style.right = typeof value === "number" ? `${value}px` : value;
601
+ break;
602
+ case "bottom":
603
+ style.bottom = typeof value === "number" ? `${value}px` : value;
604
+ break;
605
+ case "zIndex":
606
+ style.zIndex = value;
607
+ break;
608
+ case "backgroundColor":
609
+ if (typeof value === "string") {
610
+ style.backgroundColor = value;
611
+ }
612
+ break;
613
+ case "boxShadow":
614
+ style.boxShadow = value;
615
+ break;
616
+ case "alignItems":
617
+ style.alignItems = value;
618
+ break;
619
+ case "fontWeight":
620
+ style.fontWeight = value;
621
+ break;
622
+ case "color":
623
+ if (typeof value === "string") {
624
+ style.color = value;
625
+ }
626
+ break;
627
+ case "overflow":
628
+ style.overflow = value;
629
+ break;
630
+ case "borderBottomStyle":
631
+ style.borderBottomStyle = value;
632
+ break;
633
+ case "borderRadius":
634
+ style.borderRadius = value;
635
+ break;
636
+ case "display":
637
+ style.display = value;
638
+ break;
639
+ // Chakra pseudo-props: silently drop
640
+ case "_first":
641
+ case "_last":
642
+ break;
643
+ default:
644
+ rest[key] = value;
645
+ break;
646
+ }
647
+ }
648
+ return { style, rest };
649
+ }
650
+ function resolveResponsive(value) {
651
+ if (value === void 0 || value === null) return void 0;
652
+ if (typeof value === "string") return value;
653
+ if (typeof value === "number") return `${value}px`;
654
+ if (typeof value === "object" && value !== null && "base" in value) {
655
+ return value.base;
656
+ }
657
+ return void 0;
658
+ }
659
+ var TableRoot = React3__namespace.forwardRef(
660
+ function TableRoot2(props, ref) {
661
+ const { className, style: styleProp, children, ...other } = props;
662
+ const rawMinW = other.minWidth ?? other.minW;
663
+ const resolvedMinW = resolveResponsive(rawMinW);
664
+ if (resolvedMinW) {
665
+ other.minWidth = resolvedMinW;
666
+ delete other.minW;
667
+ }
668
+ const { style: extracted, rest } = extractStyles(other);
669
+ const merged = { ...extracted, ...styleProp };
670
+ return /* @__PURE__ */ jsxRuntime.jsx(
671
+ "table",
672
+ {
673
+ ref,
674
+ className: cn("w-full border-collapse text-sm", className),
675
+ style: merged,
676
+ ...rest,
677
+ children
678
+ }
679
+ );
680
+ }
681
+ );
682
+ var TableHeader = React3__namespace.forwardRef(
683
+ function TableHeader2(props, ref) {
684
+ const { className, style: styleProp, children, ...other } = props;
685
+ const { style: extracted, rest } = extractStyles(other);
686
+ const merged = { ...extracted, ...styleProp };
687
+ return /* @__PURE__ */ jsxRuntime.jsx(
688
+ "thead",
689
+ {
690
+ ref,
691
+ className: cn("", className),
692
+ style: merged,
693
+ ...rest,
694
+ children
695
+ }
696
+ );
697
+ }
698
+ );
699
+ var TableBody = React3__namespace.forwardRef(
700
+ function TableBody2(props, ref) {
701
+ const { className, style: styleProp, children, ...other } = props;
702
+ const { style: extracted, rest } = extractStyles(other);
703
+ const merged = { ...extracted, ...styleProp };
704
+ return /* @__PURE__ */ jsxRuntime.jsx(
705
+ "tbody",
706
+ {
707
+ ref,
708
+ className: cn("", className),
709
+ style: merged,
710
+ ...rest,
711
+ children
712
+ }
713
+ );
714
+ }
715
+ );
716
+ var TableRow = React3__namespace.forwardRef(
717
+ function TableRow2(props, ref) {
718
+ const { className, style: styleProp, children, ...other } = props;
719
+ const { style: extracted, rest } = extractStyles(other);
720
+ const merged = { ...extracted, ...styleProp };
721
+ return /* @__PURE__ */ jsxRuntime.jsx(
722
+ "tr",
723
+ {
724
+ ref,
725
+ className: cn("", className),
726
+ style: merged,
727
+ ...rest,
728
+ children
729
+ }
730
+ );
731
+ }
732
+ );
733
+ var TableCell = React3__namespace.forwardRef(
734
+ function TableCell2(props, ref) {
735
+ const { isNumeric, className, style: styleProp, children, ...other } = props;
736
+ const { style: extracted, rest } = extractStyles(other);
737
+ const merged = {
738
+ ...isNumeric ? { textAlign: "right" } : {},
739
+ ...extracted,
740
+ ...styleProp
741
+ };
742
+ return /* @__PURE__ */ jsxRuntime.jsx(
743
+ "td",
744
+ {
745
+ ref,
746
+ className: cn("px-3 py-2.5 align-top text-sm", className),
747
+ style: merged,
748
+ ...rest,
749
+ children
750
+ }
751
+ );
752
+ }
753
+ );
754
+ var TableColumnHeader = React3__namespace.forwardRef(
755
+ function TableColumnHeader2(props, ref) {
756
+ const { isNumeric, className, style: styleProp, children, ...other } = props;
757
+ const { style: extracted, rest } = extractStyles(other);
758
+ const merged = {
759
+ ...isNumeric ? { textAlign: "right" } : {},
760
+ ...extracted,
761
+ ...styleProp
762
+ };
763
+ return /* @__PURE__ */ jsxRuntime.jsx(
764
+ "th",
765
+ {
766
+ ref,
767
+ className: cn(
768
+ "px-3 py-2 text-xs font-semibold uppercase tracking-wider",
769
+ "bg-[var(--color-table-header-bg)] text-[var(--color-table-header-fg)]",
770
+ className
771
+ ),
772
+ style: merged,
773
+ ...rest,
774
+ children
775
+ }
776
+ );
777
+ }
778
+ );
779
+ var TableColumnHeaderSortable = (props) => {
780
+ const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
781
+ const handleSortToggle = React3__namespace.useCallback(() => {
782
+ onSortToggle(sortField);
783
+ }, [onSortToggle, sortField]);
784
+ const isActive = sortValue.includes(sortField);
785
+ const isAsc = sortValue.toLowerCase().includes("asc");
786
+ return /* @__PURE__ */ jsxRuntime.jsxs(TableColumnHeader, { ...rest, children: [
787
+ /* @__PURE__ */ jsxRuntime.jsxs(Link, { onClick: disabled ? void 0 : handleSortToggle, className: "relative", children: [
788
+ isActive && /* @__PURE__ */ jsxRuntime.jsx(
789
+ "span",
790
+ {
791
+ className: cn(
792
+ "absolute top-0 inline-flex h-full w-4 items-center",
793
+ indicatorPosition === "left" ? "-left-5" : "-right-5",
794
+ isAsc ? "-rotate-90" : "rotate-90"
795
+ ),
796
+ children: /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon2, { className: "h-4 w-4" })
797
+ }
798
+ ),
799
+ children
800
+ ] }),
801
+ contentAfter
802
+ ] });
803
+ };
804
+ var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
805
+ var TableHeaderSticky = (props) => {
806
+ const { top, children, className, style: styleProp, ...rest } = props;
807
+ const ref = React3__namespace.useRef(null);
808
+ const [isStuck, setIsStuck] = React3__namespace.useState(false);
809
+ const handleScroll = React3__namespace.useCallback(() => {
810
+ if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
811
+ setIsStuck(true);
812
+ } else {
813
+ setIsStuck(false);
814
+ }
815
+ }, [top]);
816
+ React3__namespace.useEffect(() => {
817
+ const throttledHandleScroll = esToolkit.throttle(handleScroll, 300);
818
+ window.addEventListener("scroll", throttledHandleScroll);
819
+ return () => {
820
+ window.removeEventListener("scroll", throttledHandleScroll);
821
+ };
822
+ }, [handleScroll]);
823
+ return /* @__PURE__ */ jsxRuntime.jsx(
824
+ TableHeader,
825
+ {
826
+ ref,
827
+ className: cn("sticky z-[1] bg-white dark:bg-black", className),
828
+ style: {
829
+ top: top ? `${top}px` : 0,
830
+ boxShadow: isStuck ? ACTION_BAR_SHADOW : "none",
831
+ ...styleProp
832
+ },
833
+ ...rest,
834
+ children
835
+ }
836
+ );
837
+ };
838
+ var TableCaption = React3__namespace.forwardRef(
839
+ function TableCaption2(props, ref) {
840
+ const { className, style: styleProp, children, ...other } = props;
841
+ const { style: extracted, rest } = extractStyles(other);
842
+ const merged = { ...extracted, ...styleProp };
843
+ return /* @__PURE__ */ jsxRuntime.jsx(
844
+ "caption",
845
+ {
846
+ ref,
847
+ className: cn("px-3 py-2 text-sm text-[var(--color-table-header-fg)]", className),
848
+ style: merged,
849
+ ...rest,
850
+ children
851
+ }
852
+ );
853
+ }
854
+ );
855
+ var TableFooter = React3__namespace.forwardRef(
856
+ function TableFooter2(props, ref) {
857
+ const { className, style: styleProp, children, ...other } = props;
858
+ const { style: extracted, rest } = extractStyles(other);
859
+ const merged = { ...extracted, ...styleProp };
860
+ return /* @__PURE__ */ jsxRuntime.jsx(
861
+ "tfoot",
862
+ {
863
+ ref,
864
+ className: cn("", className),
865
+ style: merged,
866
+ ...rest,
867
+ children
868
+ }
869
+ );
870
+ }
871
+ );
872
+ var TableScrollWrapper = React3__namespace.forwardRef(
873
+ function TableScrollWrapper2(props, ref) {
874
+ const { className, children, ...rest } = props;
875
+ return /* @__PURE__ */ jsxRuntime.jsx(
876
+ "div",
877
+ {
878
+ ref,
879
+ className: cn("w-full overflow-x-auto", className),
880
+ ...rest,
881
+ children
882
+ }
883
+ );
884
+ }
885
+ );
886
+
887
+ exports.TableBody = TableBody;
888
+ exports.TableCaption = TableCaption;
889
+ exports.TableCell = TableCell;
890
+ exports.TableColumnHeader = TableColumnHeader;
891
+ exports.TableColumnHeaderSortable = TableColumnHeaderSortable;
892
+ exports.TableFooter = TableFooter;
893
+ exports.TableHeader = TableHeader;
894
+ exports.TableHeaderSticky = TableHeaderSticky;
895
+ exports.TableRoot = TableRoot;
896
+ exports.TableRow = TableRow;
897
+ exports.TableScrollWrapper = TableScrollWrapper;