@luxfi/ui 7.3.2 → 7.4.2

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 (154) hide show
  1. package/dist/alert.cjs +2 -2
  2. package/dist/alert.js +1 -1
  3. package/dist/avatar.cjs +7 -6
  4. package/dist/avatar.js +7 -5
  5. package/dist/badge.cjs +36 -38
  6. package/dist/badge.js +31 -33
  7. package/dist/bank.cjs +13 -13
  8. package/dist/bank.d.cts +31 -24
  9. package/dist/bank.d.ts +31 -24
  10. package/dist/bank.js +1 -1
  11. package/dist/button.cjs +3 -3
  12. package/dist/button.js +1 -1
  13. package/dist/checkbox.cjs +4 -4
  14. package/dist/checkbox.d.cts +3 -2
  15. package/dist/checkbox.d.ts +3 -2
  16. package/dist/checkbox.js +5 -4
  17. package/dist/chrome.cjs +950 -0
  18. package/dist/chrome.d.cts +93 -0
  19. package/dist/chrome.d.ts +93 -0
  20. package/dist/chrome.js +921 -0
  21. package/dist/close-button.cjs +2 -2
  22. package/dist/close-button.js +1 -1
  23. package/dist/dialog.cjs +13 -14
  24. package/dist/dialog.d.cts +58 -5
  25. package/dist/dialog.d.ts +58 -5
  26. package/dist/dialog.js +1 -2
  27. package/dist/drawer.cjs +87 -21
  28. package/dist/drawer.js +85 -19
  29. package/dist/expiration-selector.cjs +3 -2
  30. package/dist/expiration-selector.js +3 -2
  31. package/dist/greeks-display.cjs +6 -6
  32. package/dist/greeks-display.js +6 -6
  33. package/dist/gui.cjs +13 -0
  34. package/dist/gui.d.cts +2 -0
  35. package/dist/gui.d.ts +2 -0
  36. package/dist/gui.js +2 -0
  37. package/dist/heading.cjs +4 -2
  38. package/dist/heading.js +4 -2
  39. package/dist/iam.cjs +206 -0
  40. package/dist/iam.d.cts +65 -0
  41. package/dist/iam.d.ts +65 -0
  42. package/dist/iam.js +201 -0
  43. package/dist/icon-button.cjs +2 -2
  44. package/dist/icon-button.js +1 -1
  45. package/dist/icons.cjs +13 -0
  46. package/dist/icons.d.cts +1 -0
  47. package/dist/icons.d.ts +1 -0
  48. package/dist/icons.js +2 -0
  49. package/dist/identity.cjs +420 -0
  50. package/dist/identity.d.cts +64 -0
  51. package/dist/identity.d.ts +64 -0
  52. package/dist/identity.js +398 -0
  53. package/dist/index.cjs +1699 -860
  54. package/dist/index.d.cts +12 -4
  55. package/dist/index.d.ts +12 -4
  56. package/dist/index.js +1618 -802
  57. package/dist/input.cjs +13 -3
  58. package/dist/input.d.cts +6 -0
  59. package/dist/input.d.ts +6 -0
  60. package/dist/input.js +13 -3
  61. package/dist/lux.config.cjs +77 -0
  62. package/dist/lux.config.d.cts +433 -0
  63. package/dist/lux.config.d.ts +433 -0
  64. package/dist/lux.config.js +69 -0
  65. package/dist/menu.cjs +4 -4
  66. package/dist/menu.js +4 -4
  67. package/dist/next.cjs +99 -0
  68. package/dist/next.d.cts +29 -0
  69. package/dist/next.d.ts +29 -0
  70. package/dist/next.js +96 -0
  71. package/dist/option-chain.cjs +1 -1
  72. package/dist/option-chain.js +1 -1
  73. package/dist/option-position.cjs +2 -1
  74. package/dist/option-position.js +2 -1
  75. package/dist/pnl-diagram.cjs +8 -6
  76. package/dist/pnl-diagram.js +8 -6
  77. package/dist/popover.cjs +8 -9
  78. package/dist/popover.js +1 -2
  79. package/dist/progress.cjs +7 -6
  80. package/dist/progress.js +7 -5
  81. package/dist/provider.cjs +199 -5
  82. package/dist/provider.d.cts +16 -3
  83. package/dist/provider.d.ts +16 -3
  84. package/dist/provider.js +195 -6
  85. package/dist/radio.cjs +9 -7
  86. package/dist/radio.js +10 -7
  87. package/dist/separator.cjs +3 -1
  88. package/dist/separator.js +3 -1
  89. package/dist/slider.cjs +28 -16
  90. package/dist/slider.js +28 -15
  91. package/dist/strategy-builder.cjs +2 -1
  92. package/dist/strategy-builder.js +2 -1
  93. package/dist/switch.cjs +11 -12
  94. package/dist/switch.js +12 -12
  95. package/dist/tag.cjs +38 -41
  96. package/dist/tag.js +31 -34
  97. package/dist/textarea.cjs +13 -3
  98. package/dist/textarea.d.cts +2 -0
  99. package/dist/textarea.d.ts +2 -0
  100. package/dist/textarea.js +13 -3
  101. package/dist/tooltip.cjs +31 -33
  102. package/dist/tooltip.js +25 -27
  103. package/dist/use-narrow.cjs +46 -0
  104. package/dist/use-narrow.d.cts +12 -0
  105. package/dist/use-narrow.d.ts +12 -0
  106. package/dist/use-narrow.js +20 -0
  107. package/dist/vite.cjs +40 -0
  108. package/dist/vite.d.cts +29 -0
  109. package/dist/vite.d.ts +29 -0
  110. package/dist/vite.js +38 -0
  111. package/dist/white-label.cjs +132 -0
  112. package/dist/white-label.d.cts +59 -0
  113. package/dist/white-label.d.ts +59 -0
  114. package/dist/white-label.js +124 -0
  115. package/package.json +95 -17
  116. package/src/avatar.tsx +22 -16
  117. package/src/bank.tsx +2 -2
  118. package/src/button.tsx +1 -1
  119. package/src/checkbox.tsx +15 -10
  120. package/src/chrome.tsx +459 -0
  121. package/src/close-button.tsx +1 -1
  122. package/src/dialog.tsx +1 -1
  123. package/src/drawer.tsx +83 -10
  124. package/src/expiration-selector.tsx +3 -2
  125. package/src/greeks-display.tsx +9 -6
  126. package/src/gui.ts +17 -0
  127. package/src/heading.tsx +12 -8
  128. package/src/iam.ts +170 -0
  129. package/src/icon-button.tsx +1 -1
  130. package/src/icons.ts +18 -0
  131. package/src/identity.tsx +318 -0
  132. package/src/index.ts +50 -1
  133. package/src/input.tsx +24 -4
  134. package/src/lux.config.ts +82 -0
  135. package/src/menu.tsx +4 -4
  136. package/src/next.ts +142 -0
  137. package/src/option-chain.tsx +1 -1
  138. package/src/option-position.tsx +2 -1
  139. package/src/pnl-diagram.tsx +11 -6
  140. package/src/popover.tsx +1 -1
  141. package/src/progress.tsx +15 -8
  142. package/src/provider.tsx +92 -12
  143. package/src/radio.tsx +15 -11
  144. package/src/separator.tsx +8 -3
  145. package/src/slider.tsx +35 -19
  146. package/src/strategy-builder.tsx +3 -2
  147. package/src/switch.tsx +17 -16
  148. package/src/textarea.tsx +18 -4
  149. package/src/tooltip.tsx +4 -23
  150. package/src/use-narrow.ts +40 -0
  151. package/src/vite.ts +78 -0
  152. package/src/white-label.ts +240 -0
  153. package/tokens.css +544 -319
  154. package/src/tokens.css +0 -438
package/dist/index.js CHANGED
@@ -1,47 +1,1273 @@
1
1
  "use client";
2
- import { createGui, styled, View, Text } from '@hanzogui/core';
2
+ import { createGui, styled, View, Sheet, Avatar as Avatar$1, TooltipGroup, Tooltip as Tooltip$1, Checkbox, Dialog, H3, H2, H1, Input as Input$1, Popover, Progress as Progress$1, RadioGroup, Separator, Slider as Slider$1, Switch, TextArea, Text, GuiProvider } from '@hanzo/gui';
3
3
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4
+ import * as React33 from 'react';
5
+ import React33__default from 'react';
6
+ import { defaultConfig } from '@hanzogui/config/v5';
7
+ import { animations } from '@hanzogui/config/v5-css';
4
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
9
  import { clsx } from 'clsx';
6
10
  import { twMerge } from 'tailwind-merge';
11
+ import { Check, ChevronRight, ChevronsUpDown, Folder, LogOut, User, Settings, Menu, Building2 } from 'lucide-react';
12
+ import * as RadixDialog from '@radix-ui/react-dialog';
13
+ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
7
14
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
8
- import * as React29 from 'react';
9
- import React29__default from 'react';
10
- import * as RadixAvatar from '@radix-ui/react-avatar';
11
- import { TooltipGroup, Tooltip as Tooltip$1 } from '@hanzogui/tooltip';
12
15
  import { useClickAway, useDebounce } from '@uidotdev/usehooks';
13
- import * as RadixCheckbox from '@radix-ui/react-checkbox';
14
16
  import * as Collapsible from '@radix-ui/react-collapsible';
15
- import { Dialog } from '@hanzogui/dialog';
16
- import * as RadixDialog from '@radix-ui/react-dialog';
17
17
  import * as LabelPrimitive from '@radix-ui/react-label';
18
18
  import { debounce, throttle } from 'es-toolkit';
19
- import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
20
- import { LuCheck, LuChevronRight } from 'react-icons/lu';
21
- import { Popover } from '@hanzogui/popover';
22
- import * as RadixProgress from '@radix-ui/react-progress';
23
- import * as RadixRadioGroup from '@radix-ui/react-radio-group';
24
19
  import * as RadixSelect from '@radix-ui/react-select';
25
- import * as RadixSlider from '@radix-ui/react-slider';
26
- import * as RadixSwitch from '@radix-ui/react-switch';
27
20
  import * as RadixTabs from '@radix-ui/react-tabs';
28
21
  import { toast, Toaster as Toaster$1 } from 'sonner';
29
22
 
30
23
  // src/provider.tsx
31
- if (typeof window !== "undefined") {
32
- createGui({ settings: { autocompleteSpecificTokens: "except-special" } });
24
+
25
+ // src/white-label.ts
26
+ var LUX_BRAND = {
27
+ lux: "#7000FF",
28
+ zoo: "#6C5EFB",
29
+ hanzo: "#EA580C",
30
+ pars: "#1C3879",
31
+ // bootno.de is its own white label with its own IdP (id.bootno.de) — accent
32
+ // taken from the bootnode console's own brand default, not invented here.
33
+ bootnode: "#3B82F6"
34
+ };
35
+ var PARS_GOLD = "#C8A45C";
36
+ var ORGS = {
37
+ lux: {
38
+ org: "lux",
39
+ name: "Lux",
40
+ domain: "lux.network",
41
+ iamDomain: "lux.id",
42
+ accent: LUX_BRAND.lux,
43
+ accentForeground: "#FFFFFF"
44
+ },
45
+ zoo: {
46
+ org: "zoo",
47
+ name: "Zoo",
48
+ domain: "zoo.ngo",
49
+ // Zoo's IdP is `id.zoo.network`, not a `zoo.id` apex — the one row in this
50
+ // table where the issuer is not `<org>.id`, and the one every hand-rolled
51
+ // per-app branding map got wrong.
52
+ iamDomain: "id.zoo.network",
53
+ accent: LUX_BRAND.zoo,
54
+ accentForeground: "#FFFFFF"
55
+ },
56
+ bootnode: {
57
+ org: "bootnode",
58
+ name: "Bootnode",
59
+ domain: "bootno.de",
60
+ iamDomain: "id.bootno.de",
61
+ accent: LUX_BRAND.lux,
62
+ accentForeground: "#FFFFFF"
63
+ },
64
+ hanzo: {
65
+ org: "hanzo",
66
+ name: "Hanzo",
67
+ domain: "hanzo.ai",
68
+ iamDomain: "hanzo.id",
69
+ accent: LUX_BRAND.hanzo,
70
+ accentForeground: "#FFFFFF"
71
+ },
72
+ pars: {
73
+ org: "pars",
74
+ name: "Pars",
75
+ domain: "pars.id",
76
+ iamDomain: "pars.id",
77
+ accent: LUX_BRAND.pars,
78
+ accentForeground: PARS_GOLD
79
+ }
80
+ };
81
+ var DOMAIN_ORG = [
82
+ ["lux.network", "lux"],
83
+ ["lux.cloud", "lux"],
84
+ ["lux.id", "lux"],
85
+ ["lux.finance", "lux"],
86
+ ["zoo.ngo", "zoo"],
87
+ ["zoo.network", "zoo"],
88
+ ["zoo.cloud", "zoo"],
89
+ ["zoo.id", "zoo"],
90
+ ["hanzo.ai", "hanzo"],
91
+ ["hanzo.cloud", "hanzo"],
92
+ ["hanzo.id", "hanzo"],
93
+ ["pars.id", "pars"],
94
+ ["parsdao.org", "pars"],
95
+ ["bootno.de", "bootnode", "platform"]
96
+ ];
97
+ var DEFAULT_ORG = "lux";
98
+ function normalizeHost(host) {
99
+ const noPort = host.trim().toLowerCase().split(":")[0] ?? "";
100
+ return noPort.replace(/\.$/, "");
101
+ }
102
+ function isUnder(host, domain) {
103
+ return host === domain || host.endsWith(`.${domain}`);
104
+ }
105
+ function matchDomain(host) {
106
+ let best;
107
+ for (const entry of DOMAIN_ORG) {
108
+ if (isUnder(host, entry[0]) && (!best || entry[0].length > best[0].length)) {
109
+ best = entry;
110
+ }
111
+ }
112
+ return best;
113
+ }
114
+ function appSlug(host, domain, apexApp) {
115
+ const sub = host === domain ? "" : host.slice(0, -(domain.length + 1));
116
+ const leftmost = sub.split(".")[0] ?? "";
117
+ if (leftmost && leftmost !== "www") return leftmost;
118
+ if (apexApp) return apexApp;
119
+ const label = domain.split(".")[0] ?? "";
120
+ const tld = domain.split(".").slice(1).join(".");
121
+ return tld.split(".")[0] || label;
122
+ }
123
+ function isLocal(host) {
124
+ return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "0.0.0.0" || host === "[::1]" || host.endsWith(".local");
125
+ }
126
+ function resolveWhiteLabel(host) {
127
+ const h = normalizeHost(host ?? "");
128
+ const match = h ? matchDomain(h) : void 0;
129
+ const org = match ? match[1] : DEFAULT_ORG;
130
+ const identity = ORGS[org];
131
+ const app = match ? appSlug(h, match[0], match[2]) : h && isLocal(h) ? "local" : "app";
132
+ return {
133
+ ...identity,
134
+ host: h,
135
+ app,
136
+ theme: `dark_${org}`,
137
+ issuer: `https://${identity.iamDomain}`,
138
+ clientId: `${org}-${app}`
139
+ };
140
+ }
141
+ function currentHost() {
142
+ return typeof window === "undefined" ? "" : window.location.host;
33
143
  }
144
+ function orgIdentity(org) {
145
+ return ORGS[org];
146
+ }
147
+
148
+ // src/lux.config.ts
149
+ var TRUE_BLACK = "#000000";
150
+ var darkBase = {
151
+ ...defaultConfig.themes.dark,
152
+ background: TRUE_BLACK,
153
+ backgroundHover: "#0A0A0A",
154
+ backgroundPress: "#141414",
155
+ backgroundFocus: "#0A0A0A"
156
+ };
157
+ var brandTheme = (accent, extra = {}) => ({
158
+ ...darkBase,
159
+ accentBackground: accent,
160
+ accentColor: "#FFFFFF",
161
+ borderColorHover: accent,
162
+ colorHover: accent,
163
+ ...extra
164
+ });
165
+ var luxThemes = {
166
+ dark: darkBase,
167
+ dark_lux: brandTheme(LUX_BRAND.lux),
168
+ dark_zoo: brandTheme(LUX_BRAND.zoo),
169
+ dark_hanzo: brandTheme(LUX_BRAND.hanzo),
170
+ dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD }),
171
+ dark_bootnode: brandTheme(LUX_BRAND.bootnode)
172
+ };
173
+ var config = createGui({
174
+ ...defaultConfig,
175
+ animations,
176
+ settings: {
177
+ ...defaultConfig.settings,
178
+ onlyAllowShorthands: false
179
+ },
180
+ themes: {
181
+ ...defaultConfig.themes,
182
+ ...luxThemes
183
+ }
184
+ });
185
+ var lux_config_default = config;
34
186
  var defaultQueryClient = new QueryClient({
35
187
  defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
36
188
  });
37
- var AppProvider = ({ children, queryClient }) => {
38
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient ?? defaultQueryClient, children });
189
+ var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
190
+ var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
191
+ var useFontBodyReset = () => {
192
+ React33__default.useInsertionEffect(() => {
193
+ if (typeof document === "undefined") return;
194
+ if (document.getElementById(FONT_BODY_RESET_ID)) return;
195
+ const style = document.createElement("style");
196
+ style.id = FONT_BODY_RESET_ID;
197
+ style.textContent = FONT_BODY_RESET_CSS;
198
+ document.head.appendChild(style);
199
+ }, []);
200
+ };
201
+ var WhiteLabelContext = React33__default.createContext(resolveWhiteLabel(""));
202
+ var useWhiteLabel = () => React33__default.useContext(WhiteLabelContext);
203
+ var useHostWhiteLabel = (host) => {
204
+ const [resolvedHost, setResolvedHost] = React33__default.useState(host ?? "");
205
+ React33__default.useEffect(() => {
206
+ if (host !== void 0) return;
207
+ const browserHost = currentHost();
208
+ if (browserHost) setResolvedHost(browserHost);
209
+ }, [host]);
210
+ return React33__default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
211
+ };
212
+ var AppProvider = ({
213
+ children,
214
+ queryClient,
215
+ host,
216
+ defaultTheme
217
+ }) => {
218
+ useFontBodyReset();
219
+ const whiteLabel = useHostWhiteLabel(host);
220
+ const theme = defaultTheme ?? whiteLabel.theme;
221
+ return /* @__PURE__ */ jsx(WhiteLabelContext.Provider, { value: whiteLabel, children: /* @__PURE__ */ jsx(GuiProvider, { config: lux_config_default, defaultTheme: theme, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient ?? defaultQueryClient, children }) }) });
222
+ };
223
+ function cn(...inputs) {
224
+ return twMerge(clsx(inputs));
225
+ }
226
+ var NARROW_PX = 640;
227
+ var TOUCH_PX = 1024;
228
+ function useBelow(px) {
229
+ const [below, setBelow] = React33.useState(false);
230
+ React33.useEffect(() => {
231
+ const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
232
+ const apply = () => setBelow(mql.matches);
233
+ apply();
234
+ mql.addEventListener("change", apply);
235
+ return () => mql.removeEventListener("change", apply);
236
+ }, [px]);
237
+ return below;
238
+ }
239
+ var useIsNarrow = () => useBelow(NARROW_PX);
240
+ var useIsTouch = () => useBelow(TOUCH_PX);
241
+
242
+ // src/iam.ts
243
+ var IamError = class extends Error {
244
+ constructor(message, status, unauthenticated) {
245
+ super(message);
246
+ this.name = "IamError";
247
+ this.status = status;
248
+ this.unauthenticated = unauthenticated;
249
+ }
250
+ };
251
+ var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
252
+ function isSignedOut(status, msg) {
253
+ return status === 401 || status === 403 || SIGNED_OUT.test(msg);
254
+ }
255
+ function iamBase(host) {
256
+ const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
257
+ return `${wl.issuer}/v1/iam`;
258
+ }
259
+ async function read(call, verb, params) {
260
+ const url = new URL(`${call.base}/${verb}`);
261
+ for (const [k, v] of Object.entries(params)) url.searchParams.set(k, String(v));
262
+ let res;
263
+ try {
264
+ res = await fetch(url.toString(), {
265
+ method: "GET",
266
+ // The bearer is the whole credential. IAM does not allow credentialed
267
+ // CORS, so sending cookies would only get the response blocked.
268
+ headers: call.token ? { Authorization: `Bearer ${call.token}` } : {},
269
+ signal: call.signal
270
+ });
271
+ } catch (e) {
272
+ throw new IamError(e instanceof Error ? e.message : "IAM unreachable", 0, false);
273
+ }
274
+ const body = await res.json().catch(() => ({}));
275
+ const msg = typeof body.msg === "string" ? body.msg : "";
276
+ if (!res.ok || body.status === "error") {
277
+ throw new IamError(msg || `IAM ${verb} failed (${res.status})`, res.status, isSignedOut(res.status, msg));
278
+ }
279
+ return body.data;
280
+ }
281
+ var IAM_PAGE_SIZE = 20;
282
+ var iam = {
283
+ /** The signed-in principal, or null when there is no session. */
284
+ async account(call) {
285
+ try {
286
+ const data = await read(call, "get-account", {});
287
+ return data && data.name ? data : null;
288
+ } catch (e) {
289
+ if (e instanceof IamError && e.unauthenticated) return null;
290
+ throw e;
291
+ }
292
+ },
293
+ /**
294
+ * One page of the orgs the principal can see. IAM scopes the read to the
295
+ * caller's authority, so a normal member gets their own org and a super
296
+ * admin gets the tenant list — the page never has to decide.
297
+ */
298
+ async organizations(call, page = 0, query = "", pageSize = IAM_PAGE_SIZE) {
299
+ const params = {
300
+ owner: "admin",
301
+ // IAM orgs live under the reserved `admin` owner
302
+ p: page + 1,
303
+ // the backend page is 1-based
304
+ pageSize,
305
+ sortField: "name",
306
+ sortOrder: "ascending"
307
+ };
308
+ const q = query.trim();
309
+ if (q) {
310
+ params.field = "name";
311
+ params.value = q;
312
+ }
313
+ return await read(call, "get-organizations", params) ?? [];
314
+ },
315
+ /** One organization by name. */
316
+ async organization(call, name) {
317
+ return await read(call, "get-organization", { id: `admin/${name}` }) ?? null;
318
+ },
319
+ /** Members of an organization. */
320
+ async users(call, org) {
321
+ return await read(call, "get-users", { owner: org }) ?? [];
322
+ },
323
+ /** The organization's projects — IAM keys this read by `organization`. */
324
+ async projects(call, org) {
325
+ return await read(call, "get-organization-projects", { organization: org }) ?? [];
326
+ }
327
+ };
328
+ var IAM_TOKEN_KEY = "hanzo_iam_access_token";
329
+ function storedToken() {
330
+ if (typeof window === "undefined") return null;
331
+ for (const store of [window.sessionStorage, window.localStorage]) {
332
+ try {
333
+ const t = store.getItem(IAM_TOKEN_KEY);
334
+ if (t) return t;
335
+ } catch {
336
+ }
337
+ }
338
+ return null;
339
+ }
340
+ function clearStoredTokens() {
341
+ if (typeof window === "undefined") return;
342
+ for (const store of [window.sessionStorage, window.localStorage]) {
343
+ try {
344
+ for (const k of ["access_token", "refresh_token", "id_token", "expires_at"]) {
345
+ store.removeItem(`hanzo_iam_${k}`);
346
+ }
347
+ } catch {
348
+ }
349
+ }
350
+ }
351
+ var defaultAuth = {};
352
+ var scopeKey = (host, kind) => `lux-ui:${kind}:${host}`;
353
+ function readScope(host, kind) {
354
+ if (typeof window === "undefined") return null;
355
+ try {
356
+ return window.localStorage.getItem(scopeKey(host, kind));
357
+ } catch {
358
+ return null;
359
+ }
360
+ }
361
+ function writeScope(host, kind, value) {
362
+ if (typeof window === "undefined") return;
363
+ try {
364
+ window.localStorage.setItem(scopeKey(host, kind), value);
365
+ } catch {
366
+ }
367
+ }
368
+ var IdentityContext = React33.createContext(null);
369
+ var IdentityProvider = ({
370
+ children,
371
+ auth = defaultAuth,
372
+ loginPath = "/login"
373
+ }) => {
374
+ const whiteLabel = useWhiteLabel();
375
+ const base = React33.useMemo(() => iamBase(whiteLabel), [whiteLabel]);
376
+ const [status, setStatus] = React33.useState("loading");
377
+ const [account, setAccount] = React33.useState(null);
378
+ const [orgs, setOrgs] = React33.useState([]);
379
+ const [projects, setProjects] = React33.useState([]);
380
+ const [error, setError] = React33.useState(null);
381
+ const [orgName, setOrgName] = React33.useState(null);
382
+ const [projectName, setProjectName] = React33.useState(null);
383
+ const [epoch, setEpoch] = React33.useState(0);
384
+ React33.useEffect(() => {
385
+ const ac = new AbortController();
386
+ let live = true;
387
+ void (async () => {
388
+ const token = await (auth.token ?? storedToken)();
389
+ if (!live) return;
390
+ if (!token) {
391
+ setStatus("anonymous");
392
+ setAccount(null);
393
+ setOrgs([]);
394
+ return;
395
+ }
396
+ const call = { base, token, signal: ac.signal };
397
+ try {
398
+ const me = await iam.account(call);
399
+ if (!live) return;
400
+ if (!me) {
401
+ setStatus("anonymous");
402
+ setAccount(null);
403
+ setOrgs([]);
404
+ return;
405
+ }
406
+ setAccount(me);
407
+ const rows = await iam.organizations(call).catch((e) => {
408
+ if (e instanceof IamError && !e.unauthenticated) return [{ owner: "admin", name: me.owner }];
409
+ throw e;
410
+ });
411
+ if (!live) return;
412
+ setOrgs(rows);
413
+ setStatus("ready");
414
+ setError(null);
415
+ } catch (e) {
416
+ if (!live || ac.signal.aborted) return;
417
+ if (e instanceof IamError && e.unauthenticated) {
418
+ setStatus("anonymous");
419
+ setAccount(null);
420
+ setOrgs([]);
421
+ return;
422
+ }
423
+ setStatus("error");
424
+ setError(e instanceof Error ? e.message : "Could not reach IAM.");
425
+ }
426
+ })();
427
+ return () => {
428
+ live = false;
429
+ ac.abort();
430
+ };
431
+ }, [base, auth, epoch]);
432
+ const org = React33.useMemo(() => {
433
+ if (orgs.length === 0) return null;
434
+ const saved = orgName ?? readScope(whiteLabel.host, "org");
435
+ return orgs.find((o) => o.name === saved) ?? orgs.find((o) => o.name === account?.owner) ?? orgs[0];
436
+ }, [orgs, orgName, account, whiteLabel.host]);
437
+ React33.useEffect(() => {
438
+ if (!org) {
439
+ setProjects([]);
440
+ return;
441
+ }
442
+ const ac = new AbortController();
443
+ let live = true;
444
+ void (async () => {
445
+ const token = await (auth.token ?? storedToken)();
446
+ if (!live || !token) return;
447
+ const rows = await iam.projects({ base, token, signal: ac.signal }, org.name).catch(() => []);
448
+ if (live) setProjects(rows);
449
+ })();
450
+ return () => {
451
+ live = false;
452
+ ac.abort();
453
+ };
454
+ }, [base, auth, org, epoch]);
455
+ const project = React33.useMemo(() => {
456
+ if (projects.length === 0) return null;
457
+ const saved = projectName ?? readScope(whiteLabel.host, "project");
458
+ return projects.find((p) => p.name === saved) ?? projects.find((p) => p.isDefault) ?? projects[0];
459
+ }, [projects, projectName, whiteLabel.host]);
460
+ const value = React33.useMemo(() => ({
461
+ status,
462
+ account,
463
+ orgs,
464
+ org,
465
+ projects,
466
+ project,
467
+ error,
468
+ whiteLabel,
469
+ setOrg: (name) => {
470
+ writeScope(whiteLabel.host, "org", name);
471
+ setOrgName(name);
472
+ setProjectName(null);
473
+ },
474
+ setProject: (name) => {
475
+ writeScope(whiteLabel.host, "project", name);
476
+ setProjectName(name);
477
+ },
478
+ signIn: () => {
479
+ if (auth.signIn) return auth.signIn();
480
+ if (typeof window !== "undefined") window.location.assign(loginPath);
481
+ },
482
+ signOut: () => {
483
+ if (auth.signOut) return auth.signOut();
484
+ clearStoredTokens();
485
+ if (typeof window !== "undefined") window.location.assign(loginPath);
486
+ },
487
+ reload: () => setEpoch((n) => n + 1)
488
+ }), [status, account, orgs, org, projects, project, error, whiteLabel, auth, loginPath]);
489
+ return /* @__PURE__ */ jsx(IdentityContext.Provider, { value, children });
490
+ };
491
+ function useIdentity() {
492
+ const ctx = React33.useContext(IdentityContext);
493
+ const whiteLabel = useWhiteLabel();
494
+ const fallback = React33.useMemo(() => ({
495
+ status: "anonymous",
496
+ account: null,
497
+ orgs: [],
498
+ org: null,
499
+ projects: [],
500
+ project: null,
501
+ error: null,
502
+ whiteLabel,
503
+ setOrg: () => void 0,
504
+ setProject: () => void 0,
505
+ signIn: () => {
506
+ if (typeof window !== "undefined") window.location.assign("/login");
507
+ },
508
+ signOut: () => void 0,
509
+ reload: () => void 0
510
+ }), [whiteLabel]);
511
+ return ctx ?? fallback;
512
+ }
513
+ var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
514
+ var CloseButtonFrame = styled(View, {
515
+ name: "LuxCloseButton",
516
+ render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Close" }),
517
+ role: "button",
518
+ cursor: "pointer",
519
+ display: "inline-flex",
520
+ alignItems: "center",
521
+ justifyContent: "center",
522
+ width: 20,
523
+ height: 20,
524
+ minWidth: 0,
525
+ flexShrink: 1,
526
+ padding: 0,
527
+ borderRadius: 4,
528
+ borderWidth: 0,
529
+ overflow: "hidden",
530
+ backgroundColor: "transparent",
531
+ hoverStyle: {
532
+ backgroundColor: "transparent"
533
+ },
534
+ variants: {
535
+ disabled: {
536
+ true: {
537
+ opacity: 0.4,
538
+ pointerEvents: "none"
539
+ }
540
+ }
541
+ }
542
+ });
543
+ var CLOSE_BUTTON_CLASSES = [
544
+ "text-[var(--closeButton-fg,currentColor)]",
545
+ "hover:text-[var(--hover-color,currentColor)]",
546
+ "disabled:opacity-40"
547
+ ].join(" ");
548
+ var CloseButton = React33.forwardRef(function CloseButton2(props, ref) {
549
+ const { variant: _variant, size: _size, className, children, ...rest } = props;
550
+ return /* @__PURE__ */ jsx(
551
+ CloseButtonFrame,
552
+ {
553
+ ref,
554
+ className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
555
+ ...rest,
556
+ children: children ?? /* @__PURE__ */ jsx(
557
+ "svg",
558
+ {
559
+ className: "size-5",
560
+ viewBox: "0 0 20 20",
561
+ fill: "none",
562
+ "aria-hidden": "true",
563
+ children: /* @__PURE__ */ jsx(
564
+ "path",
565
+ {
566
+ d: CLOSE_ICON_PATH,
567
+ fill: "currentColor"
568
+ }
569
+ )
570
+ }
571
+ )
572
+ }
573
+ );
574
+ });
575
+ var DrawerPlacementContext = React33.createContext("right");
576
+ var DrawerSizeContext = React33.createContext("md");
577
+ var DrawerStateContext = React33.createContext({
578
+ open: false,
579
+ setOpen: () => {
580
+ },
581
+ modal: true
582
+ });
583
+ var DrawerRoot = (props) => {
584
+ const {
585
+ children,
586
+ open,
587
+ defaultOpen,
588
+ onOpenChange,
589
+ placement = "right",
590
+ modal = true,
591
+ size = "md"
592
+ } = props;
593
+ const [uncontrolled, setUncontrolled] = React33.useState(defaultOpen ?? false);
594
+ const isControlled = open !== void 0;
595
+ const isOpen = isControlled ? open : uncontrolled;
596
+ const setOpen = React33.useCallback((nextOpen) => {
597
+ if (!isControlled) setUncontrolled(nextOpen);
598
+ onOpenChange?.({ open: nextOpen });
599
+ }, [isControlled, onOpenChange]);
600
+ const state = React33.useMemo(
601
+ () => ({ open: isOpen, setOpen, modal }),
602
+ [isOpen, setOpen, modal]
603
+ );
604
+ return /* @__PURE__ */ jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(
605
+ RadixDialog.Root,
606
+ {
607
+ open: isOpen,
608
+ onOpenChange: setOpen,
609
+ modal,
610
+ children
611
+ }
612
+ ) }) }) });
613
+ };
614
+ var PLACEMENT_CLASSES = {
615
+ right: [
616
+ "inset-y-0 right-0",
617
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
618
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
619
+ ].join(" "),
620
+ left: [
621
+ "inset-y-0 left-0",
622
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
623
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
624
+ ].join(" "),
625
+ top: [
626
+ "inset-x-0 top-0",
627
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
628
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
629
+ ].join(" "),
630
+ bottom: [
631
+ "inset-x-0 bottom-0",
632
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
633
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
634
+ ].join(" ")
635
+ };
636
+ var SIZE_CLASSES = {
637
+ right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
638
+ left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
639
+ top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
640
+ bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
641
+ };
642
+ var DrawerContent = React33.forwardRef(
643
+ function DrawerContent2(props, ref) {
644
+ const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
645
+ const placement = React33.useContext(DrawerPlacementContext);
646
+ const size = React33.useContext(DrawerSizeContext);
647
+ const { open, setOpen, modal } = React33.useContext(DrawerStateContext);
648
+ const isNarrow = useIsNarrow();
649
+ if (isNarrow) {
650
+ return /* @__PURE__ */ jsxs(
651
+ Sheet,
652
+ {
653
+ open,
654
+ onOpenChange: setOpen,
655
+ modal,
656
+ dismissOnSnapToBottom: true,
657
+ snapPointsMode: "percent",
658
+ snapPoints: [88],
659
+ transition: "medium",
660
+ children: [
661
+ backdrop && /* @__PURE__ */ jsx(
662
+ Sheet.Overlay,
663
+ {
664
+ transition: "lazy",
665
+ enterStyle: { opacity: 0 },
666
+ exitStyle: { opacity: 0 },
667
+ className: "bg-black/50"
668
+ }
669
+ ),
670
+ /* @__PURE__ */ jsx(Sheet.Handle, {}),
671
+ /* @__PURE__ */ jsx(
672
+ Sheet.Frame,
673
+ {
674
+ unstyled: true,
675
+ className: cn(
676
+ "flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
677
+ className
678
+ ),
679
+ ...rest,
680
+ children
681
+ }
682
+ )
683
+ ]
684
+ }
685
+ );
686
+ }
687
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
688
+ backdrop && /* @__PURE__ */ jsx(
689
+ RadixDialog.Overlay,
690
+ {
691
+ className: cn(
692
+ "fixed inset-0 z-50 bg-black/50",
693
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0",
694
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
695
+ )
696
+ }
697
+ ),
698
+ /* @__PURE__ */ jsx(
699
+ RadixDialog.Content,
700
+ {
701
+ ref,
702
+ className: cn(
703
+ "fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
704
+ PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
705
+ SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
706
+ className
707
+ ),
708
+ ...rest,
709
+ children
710
+ }
711
+ )
712
+ ] });
713
+ if (portalled) {
714
+ return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: portalRef?.current ?? void 0, children: content });
715
+ }
716
+ return content;
717
+ }
718
+ );
719
+ var DrawerCloseTrigger = React33.forwardRef(function DrawerCloseTrigger2(props, ref) {
720
+ return /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
721
+ CloseButton,
722
+ {
723
+ ref,
724
+ className: cn("absolute top-7 right-5", props.className),
725
+ ...props
726
+ }
727
+ ) });
728
+ });
729
+ var DrawerTrigger = (props) => {
730
+ const { asChild = true, ...rest } = props;
731
+ return /* @__PURE__ */ jsx(RadixDialog.Trigger, { asChild, ...rest });
732
+ };
733
+ var DrawerHeader = React33.forwardRef(
734
+ function DrawerHeader2({ className, ...props }, ref) {
735
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
736
+ }
737
+ );
738
+ var DrawerBody = React33.forwardRef(
739
+ function DrawerBody2({ className, ...props }, ref) {
740
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
741
+ }
742
+ );
743
+ var DrawerFooter = React33.forwardRef(
744
+ function DrawerFooter2({ className, ...props }, ref) {
745
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
746
+ }
747
+ );
748
+ var DrawerTitle = RadixDialog.Title;
749
+ var DrawerDescription = RadixDialog.Description;
750
+ var DrawerActionTrigger = RadixDialog.Close;
751
+ function parsePlacement(placement) {
752
+ if (!placement) {
753
+ return { side: "bottom", align: "start" };
754
+ }
755
+ const parts = placement.split("-");
756
+ const side = parts[0] ?? "bottom";
757
+ const alignPart = parts[1];
758
+ let align = "center";
759
+ if (alignPart === "start") {
760
+ align = "start";
761
+ } else if (alignPart === "end") {
762
+ align = "end";
763
+ }
764
+ return { side, align };
765
+ }
766
+ var PositioningContext = React33.createContext({
767
+ side: "bottom",
768
+ align: "start",
769
+ sideOffset: 4,
770
+ alignOffset: 0
771
+ });
772
+ var MenuRoot = (props) => {
773
+ const {
774
+ children,
775
+ open,
776
+ defaultOpen,
777
+ onOpenChange,
778
+ positioning,
779
+ modal = true,
780
+ // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
781
+ // mount/unmount automatically.
782
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
783
+ lazyMount: _lazyMount,
784
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
785
+ unmountOnExit: _unmountOnExit
786
+ } = props;
787
+ const mergedPositioning = {
788
+ placement: "bottom-start",
789
+ ...positioning,
790
+ offset: {
791
+ mainAxis: 4,
792
+ ...positioning?.offset
793
+ }
794
+ };
795
+ const { side, align } = parsePlacement(mergedPositioning.placement);
796
+ const positioningValue = React33.useMemo(() => ({
797
+ side,
798
+ align,
799
+ sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
800
+ alignOffset: mergedPositioning.offset?.crossAxis ?? 0
801
+ }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
802
+ const handleOpenChange = React33.useCallback((isOpen) => {
803
+ onOpenChange?.({ open: isOpen });
804
+ }, [onOpenChange]);
805
+ return /* @__PURE__ */ jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsx(
806
+ DropdownMenu.Root,
807
+ {
808
+ open,
809
+ defaultOpen,
810
+ onOpenChange: handleOpenChange,
811
+ modal,
812
+ children
813
+ }
814
+ ) });
815
+ };
816
+ var MenuTrigger = React33.forwardRef(function MenuTrigger2(props, ref) {
817
+ const { asChild = false, ...rest } = props;
818
+ return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild, ref, ...rest });
819
+ });
820
+ var MenuContent = React33.forwardRef(function MenuContent2(props, ref) {
821
+ const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
822
+ const positioning = React33.useContext(PositioningContext);
823
+ const mergedStyle = {
824
+ ...style,
825
+ ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
826
+ ...minW !== void 0 ? { minWidth: minW } : {}
827
+ };
828
+ const content = /* @__PURE__ */ jsx(
829
+ DropdownMenu.Content,
830
+ {
831
+ ref,
832
+ side: positioning.side,
833
+ align: positioning.align,
834
+ sideOffset: positioning.sideOffset,
835
+ alignOffset: positioning.alignOffset,
836
+ className: cn(
837
+ "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
838
+ "border border-[var(--color-popover-border,var(--color-border-divider))]",
839
+ "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
840
+ "shadow-[0_4px_12px_var(--color-popover-shadow)]",
841
+ "outline-none",
842
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
843
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
844
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
845
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
846
+ className
847
+ ),
848
+ style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
849
+ ...rest
850
+ }
851
+ );
852
+ if (!portalled) {
853
+ return content;
854
+ }
855
+ return /* @__PURE__ */ jsx(DropdownMenu.Portal, { container: portalRef?.current ?? void 0, children: content });
856
+ });
857
+ var MenuItem = React33.forwardRef(function MenuItem2(props, ref) {
858
+ const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
859
+ return /* @__PURE__ */ jsx(
860
+ DropdownMenu.Item,
861
+ {
862
+ ref,
863
+ asChild,
864
+ disabled,
865
+ onClick,
866
+ className: cn(
867
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
868
+ "outline-none transition-colors",
869
+ "text-[var(--color-text-primary,inherit)]",
870
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
871
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
872
+ className
873
+ ),
874
+ ...rest,
875
+ children
876
+ }
877
+ );
878
+ });
879
+ var MenuItemText = React33.forwardRef(function MenuItemText2(props, ref) {
880
+ const { className, ...rest } = props;
881
+ return /* @__PURE__ */ jsx("span", { ref, className: cn("flex-1", className), ...rest });
882
+ });
883
+ React33.forwardRef(function MenuItemCommand2(props, ref) {
884
+ const { className, ...rest } = props;
885
+ return /* @__PURE__ */ jsx(
886
+ "span",
887
+ {
888
+ ref,
889
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
890
+ ...rest
891
+ }
892
+ );
893
+ });
894
+ var MenuSeparator = React33.forwardRef(function MenuSeparator2(props, ref) {
895
+ const { className, ...rest } = props;
896
+ return /* @__PURE__ */ jsx(
897
+ DropdownMenu.Separator,
898
+ {
899
+ ref,
900
+ className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
901
+ ...rest
902
+ }
903
+ );
904
+ });
905
+ var MenuItemGroup = React33.forwardRef(function MenuItemGroup2(props, ref) {
906
+ const { title, children, className, ...rest } = props;
907
+ return /* @__PURE__ */ jsxs(DropdownMenu.Group, { ref, className, ...rest, children: [
908
+ title && /* @__PURE__ */ jsx(DropdownMenu.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
909
+ children
910
+ ] });
911
+ });
912
+ var MenuArrow = React33.forwardRef(function MenuArrow2(props, ref) {
913
+ const { className, ...rest } = props;
914
+ return /* @__PURE__ */ jsx(
915
+ DropdownMenu.Arrow,
916
+ {
917
+ ref,
918
+ className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
919
+ ...rest
920
+ }
921
+ );
922
+ });
923
+ var MenuCheckboxItem = React33.forwardRef(function MenuCheckboxItem2(props, ref) {
924
+ const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
925
+ return /* @__PURE__ */ jsxs(
926
+ DropdownMenu.CheckboxItem,
927
+ {
928
+ ref,
929
+ checked,
930
+ onCheckedChange,
931
+ onClick,
932
+ className: cn(
933
+ "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
934
+ "outline-none transition-colors",
935
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
936
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
937
+ className
938
+ ),
939
+ ...rest,
940
+ children: [
941
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
942
+ children
943
+ ]
944
+ }
945
+ );
946
+ });
947
+ var MenuRadioItemGroup = React33.forwardRef(function MenuRadioItemGroup2(props, ref) {
948
+ const { value, onValueChange, ...rest } = props;
949
+ return /* @__PURE__ */ jsx(
950
+ DropdownMenu.RadioGroup,
951
+ {
952
+ ref,
953
+ value,
954
+ onValueChange,
955
+ ...rest
956
+ }
957
+ );
958
+ });
959
+ var MenuRadioItem = React33.forwardRef(function MenuRadioItem2(props, ref) {
960
+ const { className, children, value, onClick, ...rest } = props;
961
+ const { value: _v, ...radixRest } = rest;
962
+ return /* @__PURE__ */ jsxs(
963
+ DropdownMenu.RadioItem,
964
+ {
965
+ ref,
966
+ value,
967
+ onClick,
968
+ className: cn(
969
+ "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
970
+ "outline-none transition-colors",
971
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
972
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
973
+ className
974
+ ),
975
+ children: [
976
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
977
+ /* @__PURE__ */ jsx("span", { children })
978
+ ]
979
+ }
980
+ );
981
+ });
982
+ React33.forwardRef(function MenuContextTrigger2(props, ref) {
983
+ const { asChild: _asChild, ...rest } = props;
984
+ return /* @__PURE__ */ jsx("span", { ref, ...rest });
985
+ });
986
+ var MenuTriggerItem = React33.forwardRef(function MenuTriggerItem2(props, ref) {
987
+ const { startIcon, children, className, ...rest } = props;
988
+ return /* @__PURE__ */ jsx(DropdownMenu.Sub, { children: /* @__PURE__ */ jsxs(
989
+ DropdownMenu.SubTrigger,
990
+ {
991
+ ref,
992
+ className: cn(
993
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
994
+ "outline-none transition-colors",
995
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
996
+ className
997
+ ),
998
+ ...rest,
999
+ children: [
1000
+ startIcon,
1001
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children }),
1002
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
1003
+ ]
1004
+ }
1005
+ ) });
1006
+ });
1007
+ function initials(label) {
1008
+ return label.split(/[\s._-]+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2).toUpperCase();
1009
+ }
1010
+ var Monogram = ({ label, logo }) => logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "h-5 w-5 shrink-0 rounded object-contain" }) : /* @__PURE__ */ jsx(
1011
+ "span",
1012
+ {
1013
+ "aria-hidden": "true",
1014
+ className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-[rgba(127,127,127,0.22)] text-[10px] font-bold",
1015
+ children: initials(label)
1016
+ }
1017
+ );
1018
+ var Row = ({ item, onDone, menu }) => {
1019
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
1020
+ item.icon,
1021
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: item.label }),
1022
+ item.hint ? /* @__PURE__ */ jsx("span", { className: "text-xs opacity-60", children: item.hint }) : null,
1023
+ item.selected ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }) : null
1024
+ ] });
1025
+ const className = cn(
1026
+ "flex w-full cursor-pointer select-none items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",
1027
+ "hover:bg-[rgba(127,127,127,0.14)]",
1028
+ item.danger && "text-[var(--color-text-error,#e5484d)]"
1029
+ );
1030
+ const activate = () => {
1031
+ onDone();
1032
+ item.onSelect?.();
1033
+ };
1034
+ const shared = {
1035
+ "data-testid": `chrome-item-${item.id}`,
1036
+ "aria-current": item.selected ? "true" : void 0,
1037
+ className
1038
+ };
1039
+ const control = item.href ? /* @__PURE__ */ jsx("a", { href: item.href, ...shared, onClick: onDone, children: body }) : /* @__PURE__ */ jsx("button", { type: "button", ...shared, onClick: activate, children: body });
1040
+ return menu ? /* @__PURE__ */ jsx(MenuItem, { value: item.id, asChild: true, children: control }) : control;
1041
+ };
1042
+ var Switcher = ({
1043
+ title,
1044
+ label,
1045
+ icon,
1046
+ items,
1047
+ footer = [],
1048
+ status = "ready",
1049
+ empty = "Nothing here yet.",
1050
+ onSignIn,
1051
+ signInLabel = "Sign in",
1052
+ error,
1053
+ align = "start",
1054
+ testId
1055
+ }) => {
1056
+ const [open, setOpen] = React33.useState(false);
1057
+ const narrow = useIsNarrow();
1058
+ const close = React33.useCallback(() => setOpen(false), []);
1059
+ const message = status === "loading" ? "Loading\u2026" : status === "error" ? error ?? "Could not reach IAM." : status === "anonymous" ? null : items.length === 0 ? empty : null;
1060
+ const rows = status === "anonymous" && onSignIn ? [{ id: "sign-in", label: signInLabel, icon: /* @__PURE__ */ jsx(User, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: onSignIn }] : status === "ready" ? items : [];
1061
+ const panel = (menu) => /* @__PURE__ */ jsxs(Fragment, { children: [
1062
+ /* @__PURE__ */ jsx("div", { className: "px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide opacity-55", children: title }),
1063
+ message ? /* @__PURE__ */ jsx("div", { "data-testid": "chrome-message", className: "px-2 py-2 text-sm opacity-70", children: message }) : null,
1064
+ rows.map((item) => /* @__PURE__ */ jsx(Row, { item, onDone: close, menu }, item.id)),
1065
+ footer.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1066
+ menu ? /* @__PURE__ */ jsx(MenuSeparator, { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }) : /* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }),
1067
+ footer.map((item) => /* @__PURE__ */ jsx(Row, { item, onDone: close, menu }, item.id))
1068
+ ] }) : null
1069
+ ] });
1070
+ const trigger = /* @__PURE__ */ jsxs(
1071
+ "button",
1072
+ {
1073
+ type: "button",
1074
+ "data-testid": testId,
1075
+ "aria-label": title,
1076
+ "aria-haspopup": "menu",
1077
+ "aria-expanded": open,
1078
+ className: cn(
1079
+ "flex max-w-[14rem] items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium",
1080
+ "hover:bg-[rgba(127,127,127,0.14)]"
1081
+ ),
1082
+ children: [
1083
+ icon,
1084
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: label }),
1085
+ /* @__PURE__ */ jsx(ChevronsUpDown, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0 opacity-60" })
1086
+ ]
1087
+ }
1088
+ );
1089
+ if (narrow) {
1090
+ return /* @__PURE__ */ jsxs(DrawerRoot, { open, onOpenChange: (d) => setOpen(d.open), placement: "bottom", size: "md", children: [
1091
+ React33.cloneElement(trigger, { onClick: () => setOpen(true) }),
1092
+ /* @__PURE__ */ jsxs(DrawerContent, { "data-testid": testId ? `${testId}-panel` : void 0, children: [
1093
+ /* @__PURE__ */ jsx(DrawerHeader, { children: /* @__PURE__ */ jsx(DrawerTitle, { children: title }) }),
1094
+ /* @__PURE__ */ jsx(DrawerBody, { children: panel(false) })
1095
+ ] })
1096
+ ] });
1097
+ }
1098
+ return /* @__PURE__ */ jsxs(
1099
+ MenuRoot,
1100
+ {
1101
+ open,
1102
+ onOpenChange: (d) => setOpen(d.open),
1103
+ positioning: { placement: align === "end" ? "bottom-end" : "bottom-start" },
1104
+ children: [
1105
+ /* @__PURE__ */ jsx(MenuTrigger, { asChild: true, children: trigger }),
1106
+ /* @__PURE__ */ jsx(MenuContent, { minW: "16rem", "data-testid": testId ? `${testId}-panel` : void 0, children: panel(true) })
1107
+ ]
1108
+ }
1109
+ );
1110
+ };
1111
+ var OrgSwitcher = () => {
1112
+ const id = useIdentity();
1113
+ return /* @__PURE__ */ jsx(
1114
+ Switcher,
1115
+ {
1116
+ testId: "org-switcher",
1117
+ title: "Organization",
1118
+ label: id.org?.displayName || id.org?.name || id.whiteLabel.name,
1119
+ icon: /* @__PURE__ */ jsx(Monogram, { label: id.org?.displayName || id.org?.name || id.whiteLabel.name, logo: id.org?.logo }),
1120
+ status: id.status,
1121
+ error: id.error,
1122
+ empty: "No organizations for this account.",
1123
+ onSignIn: id.signIn,
1124
+ signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
1125
+ items: id.orgs.map((o) => ({
1126
+ id: o.name,
1127
+ label: o.displayName || o.name,
1128
+ icon: /* @__PURE__ */ jsx(Monogram, { label: o.displayName || o.name, logo: o.logo }),
1129
+ selected: o.name === id.org?.name,
1130
+ onSelect: () => id.setOrg(o.name)
1131
+ }))
1132
+ }
1133
+ );
1134
+ };
1135
+ var ProjectSwitcher = () => {
1136
+ const id = useIdentity();
1137
+ if (id.status === "ready" && id.projects.length === 0) return null;
1138
+ return /* @__PURE__ */ jsx(
1139
+ Switcher,
1140
+ {
1141
+ testId: "project-switcher",
1142
+ title: "Project",
1143
+ label: id.project?.displayName || id.project?.name || "Project",
1144
+ icon: /* @__PURE__ */ jsx(Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1145
+ status: id.status,
1146
+ error: id.error,
1147
+ empty: "No projects in this organization.",
1148
+ onSignIn: id.signIn,
1149
+ items: id.projects.map((p) => ({
1150
+ id: p.name,
1151
+ label: p.displayName || p.name,
1152
+ icon: /* @__PURE__ */ jsx(Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1153
+ selected: p.name === id.project?.name,
1154
+ onSelect: () => id.setProject(p.name)
1155
+ }))
1156
+ }
1157
+ );
1158
+ };
1159
+ var UserMenu = ({ items = [] }) => {
1160
+ const id = useIdentity();
1161
+ const who = id.account?.displayName || id.account?.email || id.account?.name || "Account";
1162
+ return /* @__PURE__ */ jsx(
1163
+ Switcher,
1164
+ {
1165
+ testId: "user-menu",
1166
+ align: "end",
1167
+ title: id.status === "ready" ? who : "Account",
1168
+ label: id.status === "ready" ? who : "Sign in",
1169
+ icon: id.status === "ready" ? /* @__PURE__ */ jsx(Monogram, { label: who, logo: id.account?.avatar }) : /* @__PURE__ */ jsx(User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1170
+ status: id.status,
1171
+ error: id.error,
1172
+ onSignIn: id.signIn,
1173
+ signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
1174
+ items: [
1175
+ { id: "account", label: id.account?.email || who, icon: /* @__PURE__ */ jsx(User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) },
1176
+ ...items
1177
+ ],
1178
+ footer: id.status === "ready" ? [{ id: "sign-out", label: "Sign out", danger: true, icon: /* @__PURE__ */ jsx(LogOut, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: id.signOut }] : []
1179
+ }
1180
+ );
1181
+ };
1182
+ var SettingsMenu = ({ items = [], href = "/settings" }) => /* @__PURE__ */ jsx(
1183
+ Switcher,
1184
+ {
1185
+ testId: "settings-menu",
1186
+ align: "end",
1187
+ title: "Settings",
1188
+ label: "Settings",
1189
+ icon: /* @__PURE__ */ jsx(Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1190
+ items,
1191
+ empty: "No settings on this surface.",
1192
+ footer: [{ id: "all-settings", label: "All settings", href, icon: /* @__PURE__ */ jsx(Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) }]
1193
+ }
1194
+ );
1195
+ var AppNav = ({
1196
+ brand,
1197
+ home = "/",
1198
+ links = [],
1199
+ org = true,
1200
+ project = false,
1201
+ settings,
1202
+ userItems,
1203
+ children
1204
+ }) => {
1205
+ const id = useIdentity();
1206
+ const narrow = useIsNarrow();
1207
+ const [menu, setMenu] = React33.useState(false);
1208
+ return /* @__PURE__ */ jsx(
1209
+ "header",
1210
+ {
1211
+ "data-testid": "app-nav",
1212
+ className: "sticky top-0 z-50 border-b border-[var(--color-border-divider,rgba(127,127,127,0.25))] bg-[var(--color-bg-body,inherit)]",
1213
+ children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-14 max-w-7xl items-center gap-2 px-4", children: [
1214
+ narrow && links.length > 0 ? /* @__PURE__ */ jsxs(DrawerRoot, { open: menu, onOpenChange: (d) => setMenu(d.open), placement: "bottom", size: "md", children: [
1215
+ /* @__PURE__ */ jsx(
1216
+ "button",
1217
+ {
1218
+ type: "button",
1219
+ "aria-label": "Menu",
1220
+ "data-testid": "nav-menu",
1221
+ className: "rounded-md p-2 hover:bg-[rgba(127,127,127,0.14)]",
1222
+ onClick: () => setMenu(true),
1223
+ children: /* @__PURE__ */ jsx(Menu, { "aria-hidden": "true", className: "h-5 w-5" })
1224
+ }
1225
+ ),
1226
+ /* @__PURE__ */ jsxs(DrawerContent, { "data-testid": "nav-menu-panel", children: [
1227
+ /* @__PURE__ */ jsx(DrawerHeader, { children: /* @__PURE__ */ jsx(DrawerTitle, { children: "Menu" }) }),
1228
+ /* @__PURE__ */ jsx(DrawerBody, { children: links.map((l) => /* @__PURE__ */ jsx(
1229
+ "a",
1230
+ {
1231
+ href: l.href,
1232
+ onClick: () => setMenu(false),
1233
+ "aria-current": l.active ? "page" : void 0,
1234
+ className: "block rounded-md px-2 py-2.5 text-sm hover:bg-[rgba(127,127,127,0.14)]",
1235
+ children: l.label
1236
+ },
1237
+ l.href
1238
+ )) })
1239
+ ] })
1240
+ ] }) : null,
1241
+ /* @__PURE__ */ jsx("a", { href: home, className: "flex items-center gap-2 font-semibold tracking-tight", children: brand ?? /* @__PURE__ */ jsxs(Fragment, { children: [
1242
+ /* @__PURE__ */ jsx(Building2, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1243
+ id.whiteLabel.name
1244
+ ] }) }),
1245
+ org ? /* @__PURE__ */ jsx(OrgSwitcher, {}) : null,
1246
+ project ? /* @__PURE__ */ jsx(ProjectSwitcher, {}) : null,
1247
+ !narrow && links.length > 0 ? /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-1", children: links.map((l) => /* @__PURE__ */ jsx(
1248
+ "a",
1249
+ {
1250
+ href: l.href,
1251
+ "aria-current": l.active ? "page" : void 0,
1252
+ className: cn(
1253
+ "rounded-md px-3 py-1.5 text-sm font-medium",
1254
+ l.active ? "bg-[rgba(127,127,127,0.14)]" : "opacity-75 hover:opacity-100"
1255
+ ),
1256
+ children: l.label
1257
+ },
1258
+ l.href
1259
+ )) }) : null,
1260
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center justify-end gap-1", children: [
1261
+ children,
1262
+ settings ? /* @__PURE__ */ jsx(SettingsMenu, { items: settings }) : null,
1263
+ /* @__PURE__ */ jsx(UserMenu, { items: userItems })
1264
+ ] })
1265
+ ] })
1266
+ }
1267
+ );
39
1268
  };
40
- function cn(...inputs) {
41
- return twMerge(clsx(inputs));
42
- }
43
1269
  var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
44
- var AccordionRoot = React29.forwardRef(
1270
+ var AccordionRoot = React33.forwardRef(
45
1271
  function AccordionRoot2(props, ref) {
46
1272
  const {
47
1273
  multiple: _multiple,
@@ -60,7 +1286,7 @@ var AccordionRoot = React29.forwardRef(
60
1286
  borderRadius: _borderRadius,
61
1287
  ...rest
62
1288
  } = props;
63
- const handleValueChange = React29.useCallback(
1289
+ const handleValueChange = React33.useCallback(
64
1290
  (next) => {
65
1291
  onValueChange?.({ value: next });
66
1292
  },
@@ -88,7 +1314,7 @@ var AccordionRoot = React29.forwardRef(
88
1314
  );
89
1315
  }
90
1316
  );
91
- var AccordionItem = React29.forwardRef(
1317
+ var AccordionItem = React33.forwardRef(
92
1318
  function AccordionItem2(props, ref) {
93
1319
  const { className, as: _as, _first, _last, display: _display, ...rest } = props;
94
1320
  return /* @__PURE__ */ jsx(
@@ -104,7 +1330,7 @@ var AccordionItem = React29.forwardRef(
104
1330
  );
105
1331
  }
106
1332
  );
107
- var AccordionItemTrigger = React29.forwardRef(function AccordionItemTrigger2(props, ref) {
1333
+ var AccordionItemTrigger = React33.forwardRef(function AccordionItemTrigger2(props, ref) {
108
1334
  const {
109
1335
  children,
110
1336
  indicatorPlacement: indicatorPlacementProp,
@@ -169,7 +1395,7 @@ var AccordionItemTrigger = React29.forwardRef(function AccordionItemTrigger2(pro
169
1395
  }
170
1396
  ) }) });
171
1397
  });
172
- var AccordionItemContent = React29.forwardRef(function AccordionItemContent2(props, ref) {
1398
+ var AccordionItemContent = React33.forwardRef(function AccordionItemContent2(props, ref) {
173
1399
  const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
174
1400
  return /* @__PURE__ */ jsx(
175
1401
  AccordionPrimitive.Content,
@@ -187,11 +1413,11 @@ var AccordionItemContent = React29.forwardRef(function AccordionItemContent2(pro
187
1413
  );
188
1414
  });
189
1415
  function useAccordion(items) {
190
- const [value, setValue] = React29.useState([]);
191
- const onValueChange = React29.useCallback(({ value: value2 }) => {
1416
+ const [value, setValue] = React33.useState([]);
1417
+ const onValueChange = React33.useCallback(({ value: value2 }) => {
192
1418
  setValue(value2);
193
1419
  }, []);
194
- const scrollToItemFromUrl = React29.useCallback(() => {
1420
+ const scrollToItemFromUrl = React33.useCallback(() => {
195
1421
  const hash = window.location.hash.replace("#", "");
196
1422
  if (!hash) {
197
1423
  return;
@@ -205,7 +1431,7 @@ function useAccordion(items) {
205
1431
  setValue([itemToScroll.id]);
206
1432
  }
207
1433
  }, [items]);
208
- return React29.useMemo(() => {
1434
+ return React33.useMemo(() => {
209
1435
  return {
210
1436
  value,
211
1437
  onValueChange,
@@ -213,68 +1439,6 @@ function useAccordion(items) {
213
1439
  };
214
1440
  }, [value, onValueChange, scrollToItemFromUrl]);
215
1441
  }
216
- var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
217
- var CloseButtonFrame = styled(View, {
218
- name: "LuxCloseButton",
219
- render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Close" }),
220
- role: "button",
221
- cursor: "pointer",
222
- display: "inline-flex",
223
- alignItems: "center",
224
- justifyContent: "center",
225
- width: 20,
226
- height: 20,
227
- minWidth: 0,
228
- flexShrink: 1,
229
- padding: 0,
230
- borderRadius: 4,
231
- borderWidth: 0,
232
- overflow: "hidden",
233
- backgroundColor: "transparent",
234
- hoverStyle: {
235
- backgroundColor: "transparent"
236
- },
237
- variants: {
238
- disabled: {
239
- true: {
240
- opacity: 0.4,
241
- pointerEvents: "none"
242
- }
243
- }
244
- }
245
- });
246
- var CLOSE_BUTTON_CLASSES = [
247
- "text-[var(--closeButton-fg,currentColor)]",
248
- "hover:text-[var(--hover-color,currentColor)]",
249
- "disabled:opacity-40"
250
- ].join(" ");
251
- var CloseButton = React29.forwardRef(function CloseButton2(props, ref) {
252
- const { variant: _variant, size: _size, className, children, ...rest } = props;
253
- return /* @__PURE__ */ jsx(
254
- CloseButtonFrame,
255
- {
256
- ref,
257
- className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
258
- ...rest,
259
- children: children ?? /* @__PURE__ */ jsx(
260
- "svg",
261
- {
262
- className: "size-5",
263
- viewBox: "0 0 20 20",
264
- fill: "none",
265
- "aria-hidden": "true",
266
- children: /* @__PURE__ */ jsx(
267
- "path",
268
- {
269
- d: CLOSE_ICON_PATH,
270
- fill: "currentColor"
271
- }
272
- )
273
- }
274
- )
275
- }
276
- );
277
- });
278
1442
  var SHIM_PROPS = [
279
1443
  "w",
280
1444
  "h",
@@ -395,7 +1559,7 @@ var SKELETON_CLASSES = [
395
1559
  "bg-[length:200%_100%]"
396
1560
  ].join(" ");
397
1561
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
398
- var Skeleton = React29.forwardRef(
1562
+ var Skeleton = React33.forwardRef(
399
1563
  function Skeleton2(props, ref) {
400
1564
  const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
401
1565
  const shimStyle = shimToStyle(props);
@@ -404,10 +1568,10 @@ var Skeleton = React29.forwardRef(
404
1568
  const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
405
1569
  const htmlRest = stripShims(allRest);
406
1570
  if (!loading) {
407
- if (asChild && React29.isValidElement(children)) return children;
1571
+ if (asChild && React33.isValidElement(children)) return children;
408
1572
  return /* @__PURE__ */ jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
409
1573
  }
410
- if (asChild && React29.isValidElement(children)) {
1574
+ if (asChild && React33.isValidElement(children)) {
411
1575
  return /* @__PURE__ */ jsx(
412
1576
  Component,
413
1577
  {
@@ -433,7 +1597,7 @@ var Skeleton = React29.forwardRef(
433
1597
  );
434
1598
  }
435
1599
  );
436
- var SkeletonCircle = React29.forwardRef(
1600
+ var SkeletonCircle = React33.forwardRef(
437
1601
  function SkeletonCircle2(props, ref) {
438
1602
  const { size = 40, loading = true, className, ...rest } = props;
439
1603
  const dimension = typeof size === "number" ? `${size}px` : size;
@@ -449,7 +1613,7 @@ var SkeletonCircle = React29.forwardRef(
449
1613
  );
450
1614
  }
451
1615
  );
452
- var SkeletonText = React29.forwardRef(
1616
+ var SkeletonText = React33.forwardRef(
453
1617
  function SkeletonText2(props, ref) {
454
1618
  const { noOfLines = 3, loading = true, className, ...rest } = props;
455
1619
  return /* @__PURE__ */ jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsx(
@@ -471,7 +1635,7 @@ var STATUS_CLASSES = {
471
1635
  success: "bg-[var(--color-alert-bg-success)]",
472
1636
  error: "bg-[var(--color-alert-bg-error)]"
473
1637
  };
474
- var SIZE_CLASSES = {
1638
+ var SIZE_CLASSES2 = {
475
1639
  sm: "gap-2 px-2 py-2 text-xs",
476
1640
  md: "gap-2 px-3 py-2 text-base"
477
1641
  };
@@ -479,7 +1643,7 @@ var INDICATOR_SIZE_CLASSES = {
479
1643
  sm: "w-5 h-5 my-0",
480
1644
  md: "w-5 h-5 my-[2px]"
481
1645
  };
482
- var Alert = React29.forwardRef(
1646
+ var Alert = React33.forwardRef(
483
1647
  function Alert2(props, ref) {
484
1648
  const {
485
1649
  title,
@@ -504,7 +1668,7 @@ var Alert = React29.forwardRef(
504
1668
  if (_mb !== void 0) shimStyle.marginBottom = typeof _mb === "number" ? `${_mb * 4}px` : _mb;
505
1669
  if (_mt !== void 0) shimStyle.marginTop = typeof _mt === "number" ? `${_mt * 4}px` : _mt;
506
1670
  const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
507
- const [isOpen, setIsOpen] = React29.useState(true);
1671
+ const [isOpen, setIsOpen] = React33.useState(true);
508
1672
  const resolvedSize = size ?? "md";
509
1673
  const defaultIcon = /* @__PURE__ */ jsx(IndicatorIcon2, { className: "w-5 h-5" });
510
1674
  const iconElement = (() => {
@@ -519,7 +1683,7 @@ var Alert = React29.forwardRef(
519
1683
  INDICATOR_SIZE_CLASSES[resolvedSize]
520
1684
  ), children: icon || defaultIcon });
521
1685
  })();
522
- const handleClose = React29.useCallback(() => {
1686
+ const handleClose = React33.useCallback(() => {
523
1687
  setIsOpen(false);
524
1688
  onClose?.();
525
1689
  }, [onClose]);
@@ -550,7 +1714,7 @@ var Alert = React29.forwardRef(
550
1714
  "div",
551
1715
  {
552
1716
  ref,
553
- className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className),
1717
+ className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES2[resolvedSize], className),
554
1718
  style: alertStyle,
555
1719
  ...alertRest,
556
1720
  children: [
@@ -580,7 +1744,7 @@ var Alert = React29.forwardRef(
580
1744
  ) });
581
1745
  }
582
1746
  );
583
- var SIZE_CLASSES2 = {
1747
+ var SIZE_CLASSES3 = {
584
1748
  xs: "h-6 w-6 text-[10px]",
585
1749
  sm: "h-8 w-8 text-xs",
586
1750
  md: "h-10 w-10 text-sm",
@@ -595,11 +1759,11 @@ var VARIANT_CLASSES = {
595
1759
  };
596
1760
  var DEFAULT_SIZE = "md";
597
1761
  var DEFAULT_VARIANT = "subtle";
598
- var AvatarGroupContext = React29.createContext({});
1762
+ var AvatarGroupContext = React33.createContext({});
599
1763
  function useAvatarGroupContext() {
600
- return React29.useContext(AvatarGroupContext);
1764
+ return React33.useContext(AvatarGroupContext);
601
1765
  }
602
- var Avatar = React29.forwardRef(
1766
+ var Avatar = React33.forwardRef(
603
1767
  function Avatar2(props, ref) {
604
1768
  const group = useAvatarGroupContext();
605
1769
  const {
@@ -620,12 +1784,13 @@ var Avatar = React29.forwardRef(
620
1784
  const variant = variantProp ?? group.variant ?? DEFAULT_VARIANT;
621
1785
  const isBorderless = borderless ?? group.borderless ?? false;
622
1786
  return /* @__PURE__ */ jsxs(
623
- RadixAvatar.Root,
1787
+ Avatar$1,
624
1788
  {
625
1789
  ref,
1790
+ unstyled: true,
626
1791
  className: cn(
627
1792
  "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
628
- SIZE_CLASSES2[size],
1793
+ SIZE_CLASSES3[size],
629
1794
  VARIANT_CLASSES[variant],
630
1795
  !isBorderless && "ring-2 ring-white dark:ring-gray-900",
631
1796
  className
@@ -633,8 +1798,8 @@ var Avatar = React29.forwardRef(
633
1798
  ...rest,
634
1799
  children: [
635
1800
  /* @__PURE__ */ jsx(AvatarFallback, { name, icon, children: fallback }),
636
- /* @__PURE__ */ jsx(
637
- RadixAvatar.Image,
1801
+ src != null && /* @__PURE__ */ jsx(
1802
+ Avatar$1.Image,
638
1803
  {
639
1804
  className: "h-full w-full rounded-[inherit] object-cover",
640
1805
  src,
@@ -649,13 +1814,14 @@ var Avatar = React29.forwardRef(
649
1814
  );
650
1815
  }
651
1816
  );
652
- var AvatarFallback = React29.forwardRef(
1817
+ var AvatarFallback = React33.forwardRef(
653
1818
  function AvatarFallback2(props, ref) {
654
1819
  const { name, icon, children, className, ...rest } = props;
655
1820
  return /* @__PURE__ */ jsxs(
656
- RadixAvatar.Fallback,
1821
+ Avatar$1.Fallback,
657
1822
  {
658
1823
  ref,
1824
+ unstyled: true,
659
1825
  className: cn(
660
1826
  "flex h-full w-full items-center justify-center font-medium",
661
1827
  className
@@ -676,10 +1842,10 @@ function getInitials(name) {
676
1842
  const lastName = names.length > 1 ? names[names.length - 1] : "";
677
1843
  return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
678
1844
  }
679
- var AvatarGroup = React29.forwardRef(
1845
+ var AvatarGroup = React33.forwardRef(
680
1846
  function AvatarGroup2(props, ref) {
681
1847
  const { size, variant, borderless, className, ...rest } = props;
682
- const contextValue = React29.useMemo(
1848
+ const contextValue = React33.useMemo(
683
1849
  () => ({ size, variant, borderless }),
684
1850
  [size, variant, borderless]
685
1851
  );
@@ -693,26 +1859,11 @@ var AvatarGroup = React29.forwardRef(
693
1859
  ) });
694
1860
  }
695
1861
  );
696
- var LG_BREAKPOINT = 1024;
697
- function useIsMobile() {
698
- const [isMobile, setIsMobile] = React29.useState(() => {
699
- if (typeof window === "undefined") return false;
700
- return window.innerWidth < LG_BREAKPOINT;
701
- });
702
- React29.useEffect(() => {
703
- const mql = window.matchMedia(`(max-width: ${LG_BREAKPOINT - 1}px)`);
704
- const handler = (e) => setIsMobile(e.matches);
705
- setIsMobile(mql.matches);
706
- mql.addEventListener("change", handler);
707
- return () => mql.removeEventListener("change", handler);
708
- }, []);
709
- return isMobile;
710
- }
711
1862
  function mapPlacement(p) {
712
1863
  if (!p) return void 0;
713
1864
  return p;
714
1865
  }
715
- var Tooltip = React29.forwardRef(
1866
+ var Tooltip = React33.forwardRef(
716
1867
  function Tooltip2(props, ref) {
717
1868
  const {
718
1869
  showArrow: showArrowProp,
@@ -731,28 +1882,28 @@ var Tooltip = React29.forwardRef(
731
1882
  interactive,
732
1883
  positioning
733
1884
  } = props;
734
- const [open, setOpen] = React29.useState(defaultOpen);
735
- const timeoutRef = React29.useRef(null);
736
- const isMobile = useIsMobile();
737
- const handleOpenChange = React29.useCallback((nextOpen) => {
1885
+ const [open, setOpen] = React33.useState(defaultOpen);
1886
+ const timeoutRef = React33.useRef(null);
1887
+ const isMobile = useIsTouch();
1888
+ const handleOpenChange = React33.useCallback((nextOpen) => {
738
1889
  setOpen(nextOpen);
739
1890
  onOpenChange?.({ open: nextOpen });
740
1891
  }, [onOpenChange]);
741
- const handleOpenChangeManual = React29.useCallback((nextOpen) => {
1892
+ const handleOpenChangeManual = React33.useCallback((nextOpen) => {
742
1893
  timeoutRef.current && window.clearTimeout(timeoutRef.current);
743
1894
  timeoutRef.current = window.setTimeout(() => {
744
1895
  setOpen(nextOpen);
745
1896
  onOpenChange?.({ open: nextOpen });
746
1897
  }, nextOpen ? openDelay : closeDelay);
747
1898
  }, [closeDelay, openDelay, onOpenChange]);
748
- const handleClickAway = React29.useCallback(() => {
1899
+ const handleClickAway = React33.useCallback(() => {
749
1900
  handleOpenChangeManual(false);
750
1901
  }, [handleOpenChangeManual]);
751
1902
  const triggerRef = useClickAway(handleClickAway);
752
- const handleTriggerClick = React29.useCallback(() => {
1903
+ const handleTriggerClick = React33.useCallback(() => {
753
1904
  handleOpenChangeManual(!open);
754
1905
  }, [handleOpenChangeManual, open]);
755
- const handleContentClick = React29.useCallback((event) => {
1906
+ const handleContentClick = React33.useCallback((event) => {
756
1907
  event.stopPropagation();
757
1908
  if (interactive) {
758
1909
  const closestLink = event.target?.closest("a");
@@ -761,7 +1912,7 @@ var Tooltip = React29.forwardRef(
761
1912
  }
762
1913
  }
763
1914
  }, [interactive, handleOpenChangeManual]);
764
- React29.useEffect(() => {
1915
+ React33.useEffect(() => {
765
1916
  return () => {
766
1917
  if (timeoutRef.current) {
767
1918
  clearTimeout(timeoutRef.current);
@@ -833,7 +1984,7 @@ function TruncatedTextTooltip({ label, children }) {
833
1984
  return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
834
1985
  }
835
1986
  var BASE_CLASSES = "inline-flex items-center rounded-sm gap-1 font-medium w-fit max-w-full whitespace-nowrap select-text";
836
- var SIZE_CLASSES3 = {
1987
+ var SIZE_CLASSES4 = {
837
1988
  sm: "text-xs p-1 h-[18px] min-h-[18px]",
838
1989
  md: "text-sm px-1 py-0.5 min-h-6",
839
1990
  lg: "text-sm px-2 py-1 min-h-7 font-semibold"
@@ -863,7 +2014,7 @@ var COLOR_PALETTE_CLASSES = {
863
2014
  bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
864
2015
  };
865
2016
  var S2 = 4;
866
- var Badge = React29__default.forwardRef(
2017
+ var Badge = React33__default.forwardRef(
867
2018
  function Badge2(props, ref) {
868
2019
  const {
869
2020
  loading,
@@ -903,7 +2054,7 @@ var Badge = React29__default.forwardRef(
903
2054
  ref,
904
2055
  className: cn(
905
2056
  BASE_CLASSES,
906
- SIZE_CLASSES3[size],
2057
+ SIZE_CLASSES4[size],
907
2058
  COLOR_PALETTE_CLASSES[colorPalette],
908
2059
  className
909
2060
  ),
@@ -1112,7 +2263,7 @@ function buildShimStyle(props) {
1112
2263
  if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
1113
2264
  return Object.keys(s).length > 0 ? s : void 0;
1114
2265
  }
1115
- var Button = React29.forwardRef(
2266
+ var Button = React33.forwardRef(
1116
2267
  function Button2(props, ref) {
1117
2268
  const {
1118
2269
  className,
@@ -1203,7 +2354,7 @@ var Button = React29.forwardRef(
1203
2354
  return button;
1204
2355
  }
1205
2356
  );
1206
- var SIZE_CLASSES4 = {
2357
+ var SIZE_CLASSES5 = {
1207
2358
  "2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
1208
2359
  xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
1209
2360
  sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
@@ -1212,9 +2363,9 @@ var SIZE_CLASSES4 = {
1212
2363
  function buttonVariants(opts) {
1213
2364
  const v = opts?.variant ?? "solid";
1214
2365
  const s = opts?.size ?? "md";
1215
- return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES4[s] ?? ""].filter(Boolean).join(" ");
2366
+ return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES5[s] ?? ""].filter(Boolean).join(" ");
1216
2367
  }
1217
- var ButtonGroup = React29.forwardRef(
2368
+ var ButtonGroup = React33.forwardRef(
1218
2369
  function ButtonGroup2(props, ref) {
1219
2370
  const { className, ...rest } = props;
1220
2371
  return /* @__PURE__ */ jsx(
@@ -1228,7 +2379,7 @@ var ButtonGroup = React29.forwardRef(
1228
2379
  );
1229
2380
  }
1230
2381
  );
1231
- var ButtonGroupRadio = React29.forwardRef(
2382
+ var ButtonGroupRadio = React33.forwardRef(
1232
2383
  function ButtonGroupRadio2(props, ref) {
1233
2384
  const {
1234
2385
  children,
@@ -1240,24 +2391,24 @@ var ButtonGroupRadio = React29.forwardRef(
1240
2391
  className,
1241
2392
  ...rest
1242
2393
  } = props;
1243
- const firstChildValue = React29.useMemo(() => {
2394
+ const firstChildValue = React33.useMemo(() => {
1244
2395
  const firstChild = Array.isArray(children) ? children[0] : void 0;
1245
2396
  return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
1246
2397
  }, [children]);
1247
- const [value, setValue] = React29.useState(defaultValue ?? firstChildValue);
1248
- const handleItemClick = React29.useCallback((event) => {
2398
+ const [value, setValue] = React33.useState(defaultValue ?? firstChildValue);
2399
+ const handleItemClick = React33.useCallback((event) => {
1249
2400
  const v = event.currentTarget.value;
1250
2401
  setValue(v);
1251
2402
  onChange?.(v);
1252
2403
  }, [onChange]);
1253
- const clonedChildren = React29.Children.map(children, (child) => {
1254
- return React29.cloneElement(child, {
2404
+ const clonedChildren = React33.Children.map(children, (child) => {
2405
+ return React33.cloneElement(child, {
1255
2406
  onClick: handleItemClick,
1256
2407
  selected: value === child.props.value,
1257
2408
  variant
1258
2409
  });
1259
2410
  });
1260
- const childrenLength = React29.Children.count(children);
2411
+ const childrenLength = React33.Children.count(children);
1261
2412
  return /* @__PURE__ */ jsx(Skeleton, { loading, children: /* @__PURE__ */ jsx(
1262
2413
  "div",
1263
2414
  {
@@ -1277,11 +2428,11 @@ var ButtonGroupRadio = React29.forwardRef(
1277
2428
  );
1278
2429
  var NOOP = () => {
1279
2430
  };
1280
- var CheckboxGroupContext = React29.createContext(null);
2431
+ var CheckboxGroupContext = React33.createContext(null);
1281
2432
  function useCheckboxGroupContext() {
1282
- return React29.useContext(CheckboxGroupContext);
2433
+ return React33.useContext(CheckboxGroupContext);
1283
2434
  }
1284
- var CheckboxGroupBase = React29.forwardRef(
2435
+ var CheckboxGroupBase = React33.forwardRef(
1285
2436
  function CheckboxGroup(props, ref) {
1286
2437
  const {
1287
2438
  children,
@@ -1293,10 +2444,10 @@ var CheckboxGroupBase = React29.forwardRef(
1293
2444
  className,
1294
2445
  ...rest
1295
2446
  } = props;
1296
- const [uncontrolledValue, setUncontrolledValue] = React29.useState(defaultValue ?? []);
2447
+ const [uncontrolledValue, setUncontrolledValue] = React33.useState(defaultValue ?? []);
1297
2448
  const isControlled = controlledValue !== void 0;
1298
2449
  const value = isControlled ? controlledValue : uncontrolledValue;
1299
- const toggle = React29.useCallback(
2450
+ const toggle = React33.useCallback(
1300
2451
  (itemValue) => {
1301
2452
  const next = value.includes(itemValue) ? value.filter((v) => v !== itemValue) : [...value, itemValue];
1302
2453
  if (!isControlled) {
@@ -1306,12 +2457,12 @@ var CheckboxGroupBase = React29.forwardRef(
1306
2457
  },
1307
2458
  [value, isControlled, onValueChange]
1308
2459
  );
1309
- React29.useEffect(() => {
2460
+ React33.useEffect(() => {
1310
2461
  if (isControlled) {
1311
2462
  setUncontrolledValue(controlledValue);
1312
2463
  }
1313
2464
  }, [isControlled, controlledValue]);
1314
- const ctx = React29.useMemo(() => ({ value, toggle }), [value, toggle]);
2465
+ const ctx = React33.useMemo(() => ({ value, toggle }), [value, toggle]);
1315
2466
  return /* @__PURE__ */ jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
1316
2467
  "div",
1317
2468
  {
@@ -1329,7 +2480,7 @@ var CheckboxGroupBase = React29.forwardRef(
1329
2480
  }
1330
2481
  );
1331
2482
  var CheckboxGroup2 = CheckboxGroupBase;
1332
- var SIZE_CLASSES5 = {
2483
+ var SIZE_CLASSES6 = {
1333
2484
  sm: {
1334
2485
  root: "gap-1.5",
1335
2486
  control: "h-3.5 w-3.5 rounded-sm",
@@ -1369,8 +2520,8 @@ var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsx(
1369
2520
  children: /* @__PURE__ */ jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
1370
2521
  }
1371
2522
  );
1372
- var CheckboxBase = React29.forwardRef(
1373
- function Checkbox(props, ref) {
2523
+ var CheckboxBase = React33.forwardRef(
2524
+ function Checkbox$1(props, ref) {
1374
2525
  const {
1375
2526
  icon,
1376
2527
  children,
@@ -1390,8 +2541,8 @@ var CheckboxBase = React29.forwardRef(
1390
2541
  ...rest
1391
2542
  } = props;
1392
2543
  const group = useCheckboxGroupContext();
1393
- const hiddenInputRef = React29.useRef(null);
1394
- const setHiddenInputRef = React29.useCallback(
2544
+ const hiddenInputRef = React33.useRef(null);
2545
+ const setHiddenInputRef = React33.useCallback(
1395
2546
  (node) => {
1396
2547
  hiddenInputRef.current = node;
1397
2548
  if (typeof ref === "function") {
@@ -1404,7 +2555,7 @@ var CheckboxBase = React29.forwardRef(
1404
2555
  );
1405
2556
  const isInGroup = group !== null && value !== void 0;
1406
2557
  const groupChecked = isInGroup ? group.value.includes(value) : void 0;
1407
- const [internalChecked, setInternalChecked] = React29.useState(
2558
+ const [internalChecked, setInternalChecked] = React33.useState(
1408
2559
  defaultChecked ?? false
1409
2560
  );
1410
2561
  const isControlled = checkedProp !== void 0 || isInGroup;
@@ -1416,7 +2567,7 @@ var CheckboxBase = React29.forwardRef(
1416
2567
  } else {
1417
2568
  checkedState = internalChecked;
1418
2569
  }
1419
- const handleCheckedChange = React29.useCallback(
2570
+ const handleCheckedChange = React33.useCallback(
1420
2571
  (nextChecked) => {
1421
2572
  if (readOnly) return;
1422
2573
  if (!isControlled) {
@@ -1439,7 +2590,7 @@ var CheckboxBase = React29.forwardRef(
1439
2590
  },
1440
2591
  [readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
1441
2592
  );
1442
- const sizeClasses2 = SIZE_CLASSES5[size];
2593
+ const sizeClasses2 = SIZE_CLASSES6[size];
1443
2594
  return /* @__PURE__ */ jsxs(
1444
2595
  "label",
1445
2596
  {
@@ -1457,8 +2608,9 @@ var CheckboxBase = React29.forwardRef(
1457
2608
  ...rest,
1458
2609
  children: [
1459
2610
  /* @__PURE__ */ jsx(
1460
- RadixCheckbox.Root,
2611
+ Checkbox,
1461
2612
  {
2613
+ unstyled: true,
1462
2614
  checked: checkedState,
1463
2615
  onCheckedChange: handleCheckedChange,
1464
2616
  disabled: disabled || readOnly,
@@ -1476,7 +2628,7 @@ var CheckboxBase = React29.forwardRef(
1476
2628
  "transition-colors duration-150",
1477
2629
  sizeClasses2.control
1478
2630
  ),
1479
- children: icon ?? /* @__PURE__ */ jsx(RadixCheckbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses2.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsx(IndeterminateIcon, { className: sizeClasses2.icon }) : /* @__PURE__ */ jsx(CheckIcon, { className: sizeClasses2.icon }) })
2631
+ children: icon ?? /* @__PURE__ */ jsx(Checkbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses2.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsx(IndeterminateIcon, { className: sizeClasses2.icon }) : /* @__PURE__ */ jsx(CheckIcon, { className: sizeClasses2.icon }) })
1480
2632
  }
1481
2633
  ),
1482
2634
  /* @__PURE__ */ jsx(
@@ -1580,7 +2732,7 @@ function resolveSpacing(v) {
1580
2732
  }
1581
2733
  return void 0;
1582
2734
  }
1583
- var Link = React29__default.forwardRef(
2735
+ var Link = React33__default.forwardRef(
1584
2736
  function Link2(props, ref) {
1585
2737
  const {
1586
2738
  external,
@@ -1669,7 +2821,7 @@ var Link = React29__default.forwardRef(
1669
2821
  ) });
1670
2822
  }
1671
2823
  );
1672
- var LinkBox = React29__default.forwardRef(
2824
+ var LinkBox = React33__default.forwardRef(
1673
2825
  function LinkBox2(props, ref) {
1674
2826
  const { className, ...rest } = props;
1675
2827
  return /* @__PURE__ */ jsx(
@@ -1682,7 +2834,7 @@ var LinkBox = React29__default.forwardRef(
1682
2834
  );
1683
2835
  }
1684
2836
  );
1685
- var LinkOverlay = React29__default.forwardRef(
2837
+ var LinkOverlay = React33__default.forwardRef(
1686
2838
  function LinkOverlay2(props, ref) {
1687
2839
  const {
1688
2840
  children,
@@ -1763,8 +2915,8 @@ var LinkOverlay = React29__default.forwardRef(
1763
2915
  }
1764
2916
  );
1765
2917
  function useUpdateEffect(effect, deps) {
1766
- const isFirstMount = React29__default.useRef(true);
1767
- React29__default.useEffect(() => {
2918
+ const isFirstMount = React33__default.useRef(true);
2919
+ React33__default.useEffect(() => {
1768
2920
  if (isFirstMount.current) {
1769
2921
  isFirstMount.current = false;
1770
2922
  return;
@@ -1781,8 +2933,8 @@ function scrollToElement(id) {
1781
2933
  var CUT_ID = "CollapsibleDetails";
1782
2934
  var CollapsibleDetails = (props) => {
1783
2935
  const { children, id = CUT_ID, onClick, isExpanded: isExpandedProp = false, text: textProp, loading, noScroll, ...rest } = props;
1784
- const [isExpanded, setIsExpanded] = React29__default.useState(isExpandedProp);
1785
- const handleClick = React29__default.useCallback((event) => {
2936
+ const [isExpanded, setIsExpanded] = React33__default.useState(isExpandedProp);
2937
+ const handleClick = React33__default.useCallback((event) => {
1786
2938
  setIsExpanded((flag) => !flag);
1787
2939
  if (!noScroll) {
1788
2940
  scrollToElement(id);
@@ -1813,11 +2965,11 @@ var CollapsibleDetails = (props) => {
1813
2965
  var CollapsibleList = (props) => {
1814
2966
  const CUT_LENGTH = 3;
1815
2967
  const { items, renderItem, triggerProps, cutLength = CUT_LENGTH, text: textProp, defaultExpanded = false, className, ...rest } = props;
1816
- const [isExpanded, setIsExpanded] = React29__default.useState(defaultExpanded);
1817
- React29__default.useEffect(() => {
2968
+ const [isExpanded, setIsExpanded] = React33__default.useState(defaultExpanded);
2969
+ React33__default.useEffect(() => {
1818
2970
  setIsExpanded(defaultExpanded);
1819
2971
  }, [defaultExpanded]);
1820
- const handleToggle = React29__default.useCallback(() => {
2972
+ const handleToggle = React33__default.useCallback(() => {
1821
2973
  setIsExpanded((flag) => !flag);
1822
2974
  }, []);
1823
2975
  const text = isExpanded ? textProp?.[1] ?? "Hide" : textProp?.[0] ?? "Show all";
@@ -1834,10 +2986,10 @@ var CollapsibleList = (props) => {
1834
2986
  ) })
1835
2987
  ] }) });
1836
2988
  };
1837
- var ColorModeContext = React29.createContext(void 0);
2989
+ var ColorModeContext = React33.createContext(void 0);
1838
2990
  function ColorModeProvider(props) {
1839
2991
  const { children, defaultTheme = "light", value: controlledValue, onValueChange } = props;
1840
- const [internalMode, setInternalMode] = React29.useState(() => {
2992
+ const [internalMode, setInternalMode] = React33.useState(() => {
1841
2993
  if (controlledValue === "dark" || controlledValue === "light") {
1842
2994
  return controlledValue;
1843
2995
  }
@@ -1847,7 +2999,7 @@ function ColorModeProvider(props) {
1847
2999
  return defaultTheme === "dark" ? "dark" : "light";
1848
3000
  });
1849
3001
  const colorMode = controlledValue === "dark" || controlledValue === "light" ? controlledValue : internalMode;
1850
- const setColorMode = React29.useCallback((mode) => {
3002
+ const setColorMode = React33.useCallback((mode) => {
1851
3003
  const resolved = mode === "dark" ? "dark" : "light";
1852
3004
  setInternalMode(resolved);
1853
3005
  onValueChange?.(resolved);
@@ -1856,19 +3008,19 @@ function ColorModeProvider(props) {
1856
3008
  document.documentElement.classList.toggle("light", resolved === "light");
1857
3009
  }
1858
3010
  }, [onValueChange]);
1859
- const toggleColorMode = React29.useCallback(() => {
3011
+ const toggleColorMode = React33.useCallback(() => {
1860
3012
  setColorMode(colorMode === "dark" ? "light" : "dark");
1861
3013
  }, [colorMode, setColorMode]);
1862
- const ctx = React29.useMemo(
3014
+ const ctx = React33.useMemo(
1863
3015
  () => ({ colorMode, setColorMode, toggleColorMode }),
1864
3016
  [colorMode, setColorMode, toggleColorMode]
1865
3017
  );
1866
3018
  return /* @__PURE__ */ jsx(ColorModeContext.Provider, { value: ctx, children });
1867
3019
  }
1868
3020
  function useColorMode() {
1869
- const ctx = React29.useContext(ColorModeContext);
3021
+ const ctx = React33.useContext(ColorModeContext);
1870
3022
  if (!ctx) {
1871
- const [mode, setMode] = React29.useState(() => {
3023
+ const [mode, setMode] = React33.useState(() => {
1872
3024
  if (typeof document !== "undefined" && document.documentElement.classList.contains("dark")) {
1873
3025
  return "dark";
1874
3026
  }
@@ -1912,9 +3064,9 @@ function BackToButton({ onClick }) {
1912
3064
  }
1913
3065
  );
1914
3066
  }
1915
- var DialogSizeContext = React29.createContext({ size: "md" });
3067
+ var DialogSizeContext = React33.createContext({ size: "md" });
1916
3068
  function useDialogSizeContext() {
1917
- return React29.useContext(DialogSizeContext);
3069
+ return React33.useContext(DialogSizeContext);
1918
3070
  }
1919
3071
  var CONTENT_SIZE_MAP = {
1920
3072
  sm: "max-w-[400px]",
@@ -1946,13 +3098,13 @@ var DialogRoot = ({
1946
3098
  modal = true
1947
3099
  // motionPreset is intentionally unused -- kept for API compat
1948
3100
  }) => {
1949
- const handleOpenChange = React29.useCallback(
3101
+ const handleOpenChange = React33.useCallback(
1950
3102
  (nextOpen) => {
1951
3103
  onOpenChange?.({ open: nextOpen });
1952
3104
  },
1953
3105
  [onOpenChange]
1954
3106
  );
1955
- const ctx = React29.useMemo(() => ({ size }), [size]);
3107
+ const ctx = React33.useMemo(() => ({ size }), [size]);
1956
3108
  return /* @__PURE__ */ jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
1957
3109
  Dialog,
1958
3110
  {
@@ -1964,7 +3116,7 @@ var DialogRoot = ({
1964
3116
  }
1965
3117
  ) });
1966
3118
  };
1967
- var DialogContent = React29.forwardRef(function DialogContent2(props, ref) {
3119
+ var DialogContent = React33.forwardRef(function DialogContent2(props, ref) {
1968
3120
  const {
1969
3121
  children,
1970
3122
  portalled: _portalled = true,
@@ -2021,11 +3173,11 @@ var DialogContent = React29.forwardRef(function DialogContent2(props, ref) {
2021
3173
  )
2022
3174
  ] });
2023
3175
  });
2024
- var DialogCloseTrigger = React29.forwardRef(function DialogCloseTrigger2(props, ref) {
3176
+ var DialogCloseTrigger = React33.forwardRef(function DialogCloseTrigger2(props, ref) {
2025
3177
  const { className, ...rest } = props;
2026
3178
  return /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
2027
3179
  });
2028
- var DialogHeader = React29.forwardRef(function DialogHeader2(props, ref) {
3180
+ var DialogHeader = React33.forwardRef(function DialogHeader2(props, ref) {
2029
3181
  const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
2030
3182
  const startElement = startElementProp ?? (onBackToClick ? /* @__PURE__ */ jsx(BackToButton, { onClick: onBackToClick }) : void 0);
2031
3183
  return /* @__PURE__ */ jsxs(
@@ -2055,7 +3207,7 @@ var DialogHeader = React29.forwardRef(function DialogHeader2(props, ref) {
2055
3207
  }
2056
3208
  );
2057
3209
  });
2058
- var DialogBody = React29.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
3210
+ var DialogBody = React33.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
2059
3211
  const bodyStyle = {
2060
3212
  ...styleProp,
2061
3213
  ...pt !== void 0 ? { paddingTop: typeof pt === "number" ? `${pt * 4}px` : pt } : {},
@@ -2072,7 +3224,7 @@ var DialogBody = React29.forwardRef(function DialogBody2({ className, pt, displa
2072
3224
  }
2073
3225
  );
2074
3226
  });
2075
- var DialogFooter = React29.forwardRef(function DialogFooter2({ className, ...props }, ref) {
3227
+ var DialogFooter = React33.forwardRef(function DialogFooter2({ className, ...props }, ref) {
2076
3228
  return /* @__PURE__ */ jsx(
2077
3229
  "div",
2078
3230
  {
@@ -2087,135 +3239,12 @@ var DialogTitle = Dialog.Title;
2087
3239
  var DialogDescription = Dialog.Description;
2088
3240
  var DialogTrigger = Dialog.Trigger;
2089
3241
  var DialogActionTrigger = Dialog.Close;
2090
- var DrawerPlacementContext = React29.createContext("right");
2091
- var DrawerSizeContext = React29.createContext("md");
2092
- var DrawerRoot = (props) => {
2093
- const {
2094
- children,
2095
- open,
2096
- defaultOpen,
2097
- onOpenChange,
2098
- placement = "right",
2099
- modal = true,
2100
- size = "md"
2101
- } = props;
2102
- const handleOpenChange = React29.useCallback((nextOpen) => {
2103
- onOpenChange?.({ open: nextOpen });
2104
- }, [onOpenChange]);
2105
- return /* @__PURE__ */ jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
2106
- RadixDialog.Root,
2107
- {
2108
- open,
2109
- defaultOpen,
2110
- onOpenChange: handleOpenChange,
2111
- modal,
2112
- children
2113
- }
2114
- ) }) });
2115
- };
2116
- var PLACEMENT_CLASSES = {
2117
- right: [
2118
- "inset-y-0 right-0",
2119
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
2120
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
2121
- ].join(" "),
2122
- left: [
2123
- "inset-y-0 left-0",
2124
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
2125
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
2126
- ].join(" "),
2127
- top: [
2128
- "inset-x-0 top-0",
2129
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
2130
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
2131
- ].join(" "),
2132
- bottom: [
2133
- "inset-x-0 bottom-0",
2134
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
2135
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
2136
- ].join(" ")
2137
- };
2138
- var SIZE_CLASSES6 = {
2139
- right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
2140
- left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
2141
- top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
2142
- bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
2143
- };
2144
- var DrawerContent = React29.forwardRef(
2145
- function DrawerContent2(props, ref) {
2146
- const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
2147
- const placement = React29.useContext(DrawerPlacementContext);
2148
- const size = React29.useContext(DrawerSizeContext);
2149
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
2150
- backdrop && /* @__PURE__ */ jsx(
2151
- RadixDialog.Overlay,
2152
- {
2153
- className: cn(
2154
- "fixed inset-0 z-50 bg-black/50",
2155
- "data-[state=open]:animate-in data-[state=open]:fade-in-0",
2156
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
2157
- )
2158
- }
2159
- ),
2160
- /* @__PURE__ */ jsx(
2161
- RadixDialog.Content,
2162
- {
2163
- ref,
2164
- className: cn(
2165
- "fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
2166
- PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
2167
- SIZE_CLASSES6[placement]?.[size] ?? SIZE_CLASSES6.right?.md,
2168
- className
2169
- ),
2170
- ...rest,
2171
- children
2172
- }
2173
- )
2174
- ] });
2175
- if (portalled) {
2176
- return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: portalRef?.current ?? void 0, children: content });
2177
- }
2178
- return content;
2179
- }
2180
- );
2181
- var DrawerCloseTrigger = React29.forwardRef(function DrawerCloseTrigger2(props, ref) {
2182
- return /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
2183
- CloseButton,
2184
- {
2185
- ref,
2186
- className: cn("absolute top-7 right-5", props.className),
2187
- ...props
2188
- }
2189
- ) });
2190
- });
2191
- var DrawerTrigger = (props) => {
2192
- const { asChild = true, ...rest } = props;
2193
- return /* @__PURE__ */ jsx(RadixDialog.Trigger, { asChild, ...rest });
2194
- };
2195
- var DrawerHeader = React29.forwardRef(
2196
- function DrawerHeader2({ className, ...props }, ref) {
2197
- return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
2198
- }
2199
- );
2200
- var DrawerBody = React29.forwardRef(
2201
- function DrawerBody2({ className, ...props }, ref) {
2202
- return /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
2203
- }
2204
- );
2205
- var DrawerFooter = React29.forwardRef(
2206
- function DrawerFooter2({ className, ...props }, ref) {
2207
- return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
2208
- }
2209
- );
2210
- var DrawerTitle = RadixDialog.Title;
2211
- var DrawerDescription = RadixDialog.Description;
2212
- var DrawerActionTrigger = RadixDialog.Close;
2213
3242
  var apos = "\u2019";
2214
3243
  function upperFirst(str) {
2215
3244
  return str.charAt(0).toUpperCase() + str.slice(1);
2216
3245
  }
2217
3246
  var ICONS = {};
2218
- var EmptyState = React29.forwardRef(
3247
+ var EmptyState = React33.forwardRef(
2219
3248
  function EmptyState2(props, ref) {
2220
3249
  const { title, description, term, type = "query", icon, children, className, ...rest } = props;
2221
3250
  const titleContent = (() => {
@@ -2275,7 +3304,7 @@ function getComponentDisplayName(type) {
2275
3304
  if ("displayName" in type) return type.displayName;
2276
3305
  return void 0;
2277
3306
  }
2278
- var Field = React29.forwardRef(
3307
+ var Field = React33.forwardRef(
2279
3308
  function Field2(props, ref) {
2280
3309
  const {
2281
3310
  label,
@@ -2327,14 +3356,14 @@ var Field = React29.forwardRef(
2327
3356
  }
2328
3357
  );
2329
3358
  const helperTextElement = helperText ? /* @__PURE__ */ jsx("p", { className: "mt-1.5 text-xs text-[var(--color-text-secondary,theme(colors.gray.400))]", children: helperText }) : null;
2330
- const child2 = React29.Children.only(children);
3359
+ const child2 = React33.Children.only(children);
2331
3360
  const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
2332
3361
  if (isInputGroup) {
2333
- const inputElement2 = React29.cloneElement(
2334
- React29.Children.only(child2.props.children),
3362
+ const inputElement2 = React33.cloneElement(
3363
+ React33.Children.only(child2.props.children),
2335
3364
  injectedProps2
2336
3365
  );
2337
- const groupInputElement = React29.cloneElement(
3366
+ const groupInputElement = React33.cloneElement(
2338
3367
  child2,
2339
3368
  {},
2340
3369
  inputElement2,
@@ -2357,7 +3386,7 @@ var Field = React29.forwardRef(
2357
3386
  }
2358
3387
  );
2359
3388
  }
2360
- const inputElement = React29.cloneElement(child2, injectedProps2);
3389
+ const inputElement = React33.cloneElement(child2, injectedProps2);
2361
3390
  return /* @__PURE__ */ jsxs(
2362
3391
  "div",
2363
3392
  {
@@ -2379,8 +3408,8 @@ var Field = React29.forwardRef(
2379
3408
  const injectedProps = {
2380
3409
  size
2381
3410
  };
2382
- const child = React29.Children.only(children);
2383
- const clonedChild = React29.cloneElement(child, injectedProps);
3411
+ const child = React33.Children.only(children);
3412
+ const clonedChild = React33.cloneElement(child, injectedProps);
2384
3413
  return /* @__PURE__ */ jsxs(
2385
3414
  "div",
2386
3415
  {
@@ -2416,22 +3445,23 @@ var Field = React29.forwardRef(
2416
3445
  );
2417
3446
  }
2418
3447
  );
2419
- var LEVEL_TAG = { "1": "h1", "2": "h2", "3": "h3" };
3448
+ var LEVEL_TAG = { "1": H1, "2": H2, "3": H3 };
2420
3449
  var LEVEL_CLASSES = {
2421
3450
  "1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
2422
3451
  "2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
2423
3452
  "3": "text-[14px] leading-[20px] font-semibold lg:text-[18px] lg:leading-[24px] lg:font-medium"
2424
3453
  };
2425
3454
  var BASE_CLASSES4 = "font-heading text-heading";
2426
- var Heading = React29__default.forwardRef(
3455
+ var Heading = React33__default.forwardRef(
2427
3456
  function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
2428
- const Tag3 = level ? LEVEL_TAG[level] : "h2";
3457
+ const Tag3 = level ? LEVEL_TAG[level] : H2;
2429
3458
  const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
2430
3459
  const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
2431
3460
  return /* @__PURE__ */ jsx(
2432
3461
  Tag3,
2433
3462
  {
2434
3463
  ref,
3464
+ unstyled: true,
2435
3465
  className: cn(BASE_CLASSES4, levelClasses, className),
2436
3466
  style: mergedStyle,
2437
3467
  ...rest
@@ -2509,7 +3539,7 @@ var ICON_SIZE_CLASSES = {
2509
3539
  md: "[&_svg]:size-5"
2510
3540
  };
2511
3541
  var SP2 = 4;
2512
- var IconButton = React29.forwardRef(
3542
+ var IconButton = React33.forwardRef(
2513
3543
  function IconButton2(props, ref) {
2514
3544
  const {
2515
3545
  size,
@@ -2560,7 +3590,7 @@ var IconButton = React29.forwardRef(
2560
3590
  ref,
2561
3591
  size,
2562
3592
  disabled: !loadingSkeleton && (loading || disabled) || void 0,
2563
- render: _as ? React29.createElement(_as) : void 0,
3593
+ render: _as ? React33.createElement(_as) : void 0,
2564
3594
  className: combinedClassName,
2565
3595
  style: mergedStyle,
2566
3596
  ...expanded ? { "data-expanded": true } : {},
@@ -2731,31 +3761,31 @@ function extractStyleProps(props) {
2731
3761
  }
2732
3762
  return { styleProps, rest };
2733
3763
  }
2734
- var Image2 = React29__default.forwardRef(
2735
- function Image3(props, ref) {
3764
+ var Image = React33__default.forwardRef(
3765
+ function Image2(props, ref) {
2736
3766
  const { fallback, src, onLoad, onError, skeletonWidth, skeletonHeight, alt, className, style: styleProp, ...allRest } = props;
2737
3767
  const { styleProps, rest: extraProps } = extractStyleProps(allRest);
2738
- const [loading, setLoading] = React29__default.useState(true);
2739
- const [error, setError] = React29__default.useState(false);
2740
- const handleLoadError = React29__default.useCallback((event) => {
3768
+ const [loading, setLoading] = React33__default.useState(true);
3769
+ const [error, setError] = React33__default.useState(false);
3770
+ const handleLoadError = React33__default.useCallback((event) => {
2741
3771
  setError(true);
2742
3772
  setLoading(false);
2743
3773
  onError?.(event);
2744
3774
  }, [onError]);
2745
- const handleLoadSuccess = React29__default.useCallback((event) => {
3775
+ const handleLoadSuccess = React33__default.useCallback((event) => {
2746
3776
  setLoading(false);
2747
3777
  onLoad?.(event);
2748
3778
  }, [onLoad]);
2749
3779
  const passthroughProps = allRest;
2750
3780
  if (!src && fallback) {
2751
- if (React29__default.isValidElement(fallback)) {
2752
- return React29__default.cloneElement(fallback, passthroughProps);
3781
+ if (React33__default.isValidElement(fallback)) {
3782
+ return React33__default.cloneElement(fallback, passthroughProps);
2753
3783
  }
2754
3784
  return fallback;
2755
3785
  }
2756
3786
  if (error) {
2757
- if (React29__default.isValidElement(fallback)) {
2758
- return React29__default.cloneElement(fallback, passthroughProps);
3787
+ if (React33__default.isValidElement(fallback)) {
3788
+ return React33__default.cloneElement(fallback, passthroughProps);
2759
3789
  }
2760
3790
  return fallback;
2761
3791
  }
@@ -2811,14 +3841,23 @@ var INPUT_VARIANT_CLASSES = {
2811
3841
  filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
2812
3842
  unstyled: "border-0 bg-transparent p-0 h-auto"
2813
3843
  };
2814
- var Input = React29__default.forwardRef(
2815
- ({ size = "md", variant = "outline", className, ...rest }, ref) => {
3844
+ var Input = React33__default.forwardRef(
3845
+ ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
3846
+ const handleChange = React33__default.useCallback(
3847
+ (event) => {
3848
+ onChange?.(event);
3849
+ onChangeText?.(event.target.value);
3850
+ },
3851
+ [onChange, onChangeText]
3852
+ );
2816
3853
  return /* @__PURE__ */ jsx(
2817
- "input",
3854
+ Input$1,
2818
3855
  {
2819
3856
  ref,
3857
+ unstyled: true,
2820
3858
  className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
2821
- ...rest
3859
+ ...rest,
3860
+ onChange: handleChange
2822
3861
  }
2823
3862
  );
2824
3863
  }
@@ -2829,7 +3868,7 @@ function getComponentDisplayName2(type) {
2829
3868
  if ("displayName" in type) return type.displayName;
2830
3869
  return void 0;
2831
3870
  }
2832
- var InputGroup = React29.forwardRef(
3871
+ var InputGroup = React33.forwardRef(
2833
3872
  function InputGroup2(props, ref) {
2834
3873
  const {
2835
3874
  startElement,
@@ -2842,11 +3881,11 @@ var InputGroup = React29.forwardRef(
2842
3881
  className,
2843
3882
  ...rest
2844
3883
  } = props;
2845
- const startElementRef = React29.useRef(null);
2846
- const endElementRef = React29.useRef(null);
2847
- const groupRef = React29.useRef(null);
2848
- const [inlinePaddings, setInlinePaddings] = React29.useState();
2849
- const calculateInlinePaddings = React29.useCallback(() => {
3884
+ const startElementRef = React33.useRef(null);
3885
+ const endElementRef = React33.useRef(null);
3886
+ const groupRef = React33.useRef(null);
3887
+ const [inlinePaddings, setInlinePaddings] = React33.useState();
3888
+ const calculateInlinePaddings = React33.useCallback(() => {
2850
3889
  const startWidth = startElementRef.current?.getBoundingClientRect().width ?? 0;
2851
3890
  const endWidth = endElementRef.current?.getBoundingClientRect().width ?? 0;
2852
3891
  setInlinePaddings({
@@ -2854,7 +3893,7 @@ var InputGroup = React29.forwardRef(
2854
3893
  end: endWidth
2855
3894
  });
2856
3895
  }, []);
2857
- React29.useEffect(() => {
3896
+ React33.useEffect(() => {
2858
3897
  if (!groupRef.current) return;
2859
3898
  let timeoutId;
2860
3899
  const intersectionObserver = new IntersectionObserver(
@@ -2874,7 +3913,7 @@ var InputGroup = React29.forwardRef(
2874
3913
  }
2875
3914
  };
2876
3915
  }, [calculateInlinePaddings]);
2877
- React29.useEffect(() => {
3916
+ React33.useEffect(() => {
2878
3917
  calculateInlinePaddings();
2879
3918
  const resizeHandler = debounce(calculateInlinePaddings, 300);
2880
3919
  const resizeObserver = new ResizeObserver(resizeHandler);
@@ -2885,7 +3924,7 @@ var InputGroup = React29.forwardRef(
2885
3924
  resizeObserver.disconnect();
2886
3925
  };
2887
3926
  }, [calculateInlinePaddings]);
2888
- const combinedRef = React29.useCallback((node) => {
3927
+ const combinedRef = React33.useCallback((node) => {
2889
3928
  groupRef.current = node;
2890
3929
  if (typeof ref === "function") {
2891
3930
  ref(node);
@@ -2914,11 +3953,11 @@ var InputGroup = React29.forwardRef(
2914
3953
  children: startElement
2915
3954
  }
2916
3955
  ),
2917
- React29.Children.map(children, (child) => {
3956
+ React33.Children.map(children, (child) => {
2918
3957
  if (getComponentDisplayName2(child.type) !== "FieldInput") {
2919
3958
  return child;
2920
3959
  }
2921
- return React29.cloneElement(child, {
3960
+ return React33.cloneElement(child, {
2922
3961
  ...startElement && { ps: startOffset ?? (inlinePaddings?.start ? `${inlinePaddings.start}px` : void 0) },
2923
3962
  ...endElement && { pe: endOffset ?? (inlinePaddings?.end ? `${inlinePaddings.end}px` : void 0) },
2924
3963
  // hide input value and placeholder for the first render
@@ -2944,262 +3983,6 @@ var InputGroup = React29.forwardRef(
2944
3983
  }
2945
3984
  );
2946
3985
  InputGroup.displayName = "InputGroup";
2947
- function parsePlacement(placement) {
2948
- if (!placement) {
2949
- return { side: "bottom", align: "start" };
2950
- }
2951
- const parts = placement.split("-");
2952
- const side = parts[0] ?? "bottom";
2953
- const alignPart = parts[1];
2954
- let align = "center";
2955
- if (alignPart === "start") {
2956
- align = "start";
2957
- } else if (alignPart === "end") {
2958
- align = "end";
2959
- }
2960
- return { side, align };
2961
- }
2962
- var PositioningContext = React29.createContext({
2963
- side: "bottom",
2964
- align: "start",
2965
- sideOffset: 4,
2966
- alignOffset: 0
2967
- });
2968
- var MenuRoot = (props) => {
2969
- const {
2970
- children,
2971
- open,
2972
- defaultOpen,
2973
- onOpenChange,
2974
- positioning,
2975
- modal = true,
2976
- // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
2977
- // mount/unmount automatically.
2978
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2979
- lazyMount: _lazyMount,
2980
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2981
- unmountOnExit: _unmountOnExit
2982
- } = props;
2983
- const mergedPositioning = {
2984
- placement: "bottom-start",
2985
- ...positioning,
2986
- offset: {
2987
- mainAxis: 4,
2988
- ...positioning?.offset
2989
- }
2990
- };
2991
- const { side, align } = parsePlacement(mergedPositioning.placement);
2992
- const positioningValue = React29.useMemo(() => ({
2993
- side,
2994
- align,
2995
- sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
2996
- alignOffset: mergedPositioning.offset?.crossAxis ?? 0
2997
- }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
2998
- const handleOpenChange = React29.useCallback((isOpen) => {
2999
- onOpenChange?.({ open: isOpen });
3000
- }, [onOpenChange]);
3001
- return /* @__PURE__ */ jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsx(
3002
- DropdownMenu.Root,
3003
- {
3004
- open,
3005
- defaultOpen,
3006
- onOpenChange: handleOpenChange,
3007
- modal,
3008
- children
3009
- }
3010
- ) });
3011
- };
3012
- var MenuTrigger = React29.forwardRef(function MenuTrigger2(props, ref) {
3013
- const { asChild = false, ...rest } = props;
3014
- return /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild, ref, ...rest });
3015
- });
3016
- var MenuContent = React29.forwardRef(function MenuContent2(props, ref) {
3017
- const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
3018
- const positioning = React29.useContext(PositioningContext);
3019
- const mergedStyle = {
3020
- ...style,
3021
- ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
3022
- ...minW !== void 0 ? { minWidth: minW } : {}
3023
- };
3024
- const content = /* @__PURE__ */ jsx(
3025
- DropdownMenu.Content,
3026
- {
3027
- ref,
3028
- side: positioning.side,
3029
- align: positioning.align,
3030
- sideOffset: positioning.sideOffset,
3031
- alignOffset: positioning.alignOffset,
3032
- className: cn(
3033
- "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
3034
- "border border-[var(--color-popover-border,var(--color-border-divider))]",
3035
- "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
3036
- "shadow-[0_4px_12px_var(--color-popover-shadow)]",
3037
- "outline-none",
3038
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
3039
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
3040
- "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
3041
- "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3042
- className
3043
- ),
3044
- style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
3045
- ...rest
3046
- }
3047
- );
3048
- if (!portalled) {
3049
- return content;
3050
- }
3051
- return /* @__PURE__ */ jsx(DropdownMenu.Portal, { container: portalRef?.current ?? void 0, children: content });
3052
- });
3053
- var MenuItem = React29.forwardRef(function MenuItem2(props, ref) {
3054
- const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
3055
- return /* @__PURE__ */ jsx(
3056
- DropdownMenu.Item,
3057
- {
3058
- ref,
3059
- asChild,
3060
- disabled,
3061
- onClick,
3062
- className: cn(
3063
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
3064
- "outline-none transition-colors",
3065
- "text-[var(--color-text-primary,inherit)]",
3066
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3067
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3068
- className
3069
- ),
3070
- ...rest,
3071
- children
3072
- }
3073
- );
3074
- });
3075
- var MenuItemText = React29.forwardRef(function MenuItemText2(props, ref) {
3076
- const { className, ...rest } = props;
3077
- return /* @__PURE__ */ jsx("span", { ref, className: cn("flex-1", className), ...rest });
3078
- });
3079
- React29.forwardRef(function MenuItemCommand2(props, ref) {
3080
- const { className, ...rest } = props;
3081
- return /* @__PURE__ */ jsx(
3082
- "span",
3083
- {
3084
- ref,
3085
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
3086
- ...rest
3087
- }
3088
- );
3089
- });
3090
- var MenuSeparator = React29.forwardRef(function MenuSeparator2(props, ref) {
3091
- const { className, ...rest } = props;
3092
- return /* @__PURE__ */ jsx(
3093
- DropdownMenu.Separator,
3094
- {
3095
- ref,
3096
- className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
3097
- ...rest
3098
- }
3099
- );
3100
- });
3101
- var MenuItemGroup = React29.forwardRef(function MenuItemGroup2(props, ref) {
3102
- const { title, children, className, ...rest } = props;
3103
- return /* @__PURE__ */ jsxs(DropdownMenu.Group, { ref, className, ...rest, children: [
3104
- title && /* @__PURE__ */ jsx(DropdownMenu.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
3105
- children
3106
- ] });
3107
- });
3108
- var MenuArrow = React29.forwardRef(function MenuArrow2(props, ref) {
3109
- const { className, ...rest } = props;
3110
- return /* @__PURE__ */ jsx(
3111
- DropdownMenu.Arrow,
3112
- {
3113
- ref,
3114
- className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
3115
- ...rest
3116
- }
3117
- );
3118
- });
3119
- var MenuCheckboxItem = React29.forwardRef(function MenuCheckboxItem2(props, ref) {
3120
- const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
3121
- return /* @__PURE__ */ jsxs(
3122
- DropdownMenu.CheckboxItem,
3123
- {
3124
- ref,
3125
- checked,
3126
- onCheckedChange,
3127
- onClick,
3128
- className: cn(
3129
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
3130
- "outline-none transition-colors",
3131
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3132
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3133
- className
3134
- ),
3135
- ...rest,
3136
- children: [
3137
- /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(LuCheck, { className: "h-4 w-4" }) }) }),
3138
- children
3139
- ]
3140
- }
3141
- );
3142
- });
3143
- var MenuRadioItemGroup = React29.forwardRef(function MenuRadioItemGroup2(props, ref) {
3144
- const { value, onValueChange, ...rest } = props;
3145
- return /* @__PURE__ */ jsx(
3146
- DropdownMenu.RadioGroup,
3147
- {
3148
- ref,
3149
- value,
3150
- onValueChange,
3151
- ...rest
3152
- }
3153
- );
3154
- });
3155
- var MenuRadioItem = React29.forwardRef(function MenuRadioItem2(props, ref) {
3156
- const { className, children, value, onClick, ...rest } = props;
3157
- const { value: _v, ...radixRest } = rest;
3158
- return /* @__PURE__ */ jsxs(
3159
- DropdownMenu.RadioItem,
3160
- {
3161
- ref,
3162
- value,
3163
- onClick,
3164
- className: cn(
3165
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
3166
- "outline-none transition-colors",
3167
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3168
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3169
- className
3170
- ),
3171
- children: [
3172
- /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(LuCheck, { className: "h-4 w-4" }) }) }),
3173
- /* @__PURE__ */ jsx("span", { children })
3174
- ]
3175
- }
3176
- );
3177
- });
3178
- React29.forwardRef(function MenuContextTrigger2(props, ref) {
3179
- const { asChild: _asChild, ...rest } = props;
3180
- return /* @__PURE__ */ jsx("span", { ref, ...rest });
3181
- });
3182
- var MenuTriggerItem = React29.forwardRef(function MenuTriggerItem2(props, ref) {
3183
- const { startIcon, children, className, ...rest } = props;
3184
- return /* @__PURE__ */ jsx(DropdownMenu.Sub, { children: /* @__PURE__ */ jsxs(
3185
- DropdownMenu.SubTrigger,
3186
- {
3187
- ref,
3188
- className: cn(
3189
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
3190
- "outline-none transition-colors",
3191
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3192
- className
3193
- ),
3194
- ...rest,
3195
- children: [
3196
- startIcon,
3197
- /* @__PURE__ */ jsx("span", { className: "flex-1", children }),
3198
- /* @__PURE__ */ jsx(LuChevronRight, { className: "h-4 w-4" })
3199
- ]
3200
- }
3201
- ) });
3202
- });
3203
3986
  var INPUT_BASE2 = [
3204
3987
  "w-10 h-10",
3205
3988
  "text-center text-sm font-medium",
@@ -3214,7 +3997,7 @@ var INPUT_BASE2 = [
3214
3997
  ].join(" ");
3215
3998
  var INPUT_FILLED = "border-[var(--color-input-border)]";
3216
3999
  var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
3217
- var PinInput = React29.forwardRef(
4000
+ var PinInput = React33.forwardRef(
3218
4001
  function PinInput2(props, ref) {
3219
4002
  const {
3220
4003
  count = 6,
@@ -3232,12 +4015,12 @@ var PinInput = React29.forwardRef(
3232
4015
  bgColor,
3233
4016
  className
3234
4017
  } = props;
3235
- const inputRefs = React29.useRef([]);
3236
- const values = React29.useMemo(
4018
+ const inputRefs = React33.useRef([]);
4019
+ const values = React33.useMemo(
3237
4020
  () => controlledValue ?? Array.from({ length: count }).fill(""),
3238
4021
  [controlledValue, count]
3239
4022
  );
3240
- const updateValue = React29.useCallback((index, char) => {
4023
+ const updateValue = React33.useCallback((index, char) => {
3241
4024
  const next = [...values];
3242
4025
  next[index] = char;
3243
4026
  onValueChange?.({ value: next });
@@ -3245,11 +4028,11 @@ var PinInput = React29.forwardRef(
3245
4028
  onValueComplete?.({ value: next });
3246
4029
  }
3247
4030
  }, [values, onValueChange, onValueComplete]);
3248
- const focusInput = React29.useCallback((index) => {
4031
+ const focusInput = React33.useCallback((index) => {
3249
4032
  const clamped = Math.max(0, Math.min(index, count - 1));
3250
4033
  inputRefs.current[clamped]?.focus();
3251
4034
  }, [count]);
3252
- const handleInput = React29.useCallback((index, e) => {
4035
+ const handleInput = React33.useCallback((index, e) => {
3253
4036
  const target = e.currentTarget;
3254
4037
  const char = target.value.slice(-1);
3255
4038
  updateValue(index, char);
@@ -3257,7 +4040,7 @@ var PinInput = React29.forwardRef(
3257
4040
  focusInput(index + 1);
3258
4041
  }
3259
4042
  }, [count, updateValue, focusInput]);
3260
- const handleKeyDown = React29.useCallback((index, e) => {
4043
+ const handleKeyDown = React33.useCallback((index, e) => {
3261
4044
  if (e.key === "Backspace") {
3262
4045
  if (values[index]) {
3263
4046
  updateValue(index, "");
@@ -3274,7 +4057,7 @@ var PinInput = React29.forwardRef(
3274
4057
  e.preventDefault();
3275
4058
  }
3276
4059
  }, [count, values, updateValue, focusInput]);
3277
- const handlePaste = React29.useCallback((e) => {
4060
+ const handlePaste = React33.useCallback((e) => {
3278
4061
  e.preventDefault();
3279
4062
  const pasted = e.clipboardData.getData("text/plain").trim();
3280
4063
  if (!pasted) {
@@ -3291,18 +4074,18 @@ var PinInput = React29.forwardRef(
3291
4074
  }
3292
4075
  focusInput(Math.min(chars.length, count - 1));
3293
4076
  }, [count, values, onValueChange, onValueComplete, focusInput]);
3294
- const handleFocus = React29.useCallback((e) => {
4077
+ const handleFocus = React33.useCallback((e) => {
3295
4078
  e.currentTarget.select();
3296
4079
  }, []);
3297
- const handleNoop = React29.useCallback(() => {
4080
+ const handleNoop = React33.useCallback(() => {
3298
4081
  }, []);
3299
- const setInputRef = React29.useCallback((index) => (el) => {
4082
+ const setInputRef = React33.useCallback((index) => (el) => {
3300
4083
  inputRefs.current[index] = el;
3301
4084
  }, []);
3302
- const onInputAtIndex = React29.useCallback((index) => (e) => {
4085
+ const onInputAtIndex = React33.useCallback((index) => (e) => {
3303
4086
  handleInput(index, e);
3304
4087
  }, [handleInput]);
3305
- const onKeyDownAtIndex = React29.useCallback((index) => (e) => {
4088
+ const onKeyDownAtIndex = React33.useCallback((index) => (e) => {
3306
4089
  handleKeyDown(index, e);
3307
4090
  }, [handleKeyDown]);
3308
4091
  const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
@@ -3363,7 +4146,7 @@ function parsePlacement2(placement) {
3363
4146
  }
3364
4147
  return { side, align };
3365
4148
  }
3366
- var PositioningContext2 = React29.createContext({
4149
+ var PositioningContext2 = React33.createContext({
3367
4150
  side: "bottom",
3368
4151
  align: "start",
3369
4152
  sideOffset: 4,
@@ -3397,7 +4180,7 @@ var PopoverRoot = (props) => {
3397
4180
  }
3398
4181
  };
3399
4182
  const { side, align } = parsePlacement2(mergedPositioning.placement);
3400
- const positioningValue = React29.useMemo(() => ({
4183
+ const positioningValue = React33.useMemo(() => ({
3401
4184
  side,
3402
4185
  align,
3403
4186
  sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
@@ -3414,7 +4197,7 @@ var PopoverRoot = (props) => {
3414
4197
  autoFocus,
3415
4198
  closeOnInteractOutside
3416
4199
  ]);
3417
- const handleOpenChange = React29.useCallback((isOpen) => {
4200
+ const handleOpenChange = React33.useCallback((isOpen) => {
3418
4201
  onOpenChange?.({ open: isOpen });
3419
4202
  }, [onOpenChange]);
3420
4203
  const placement = mergedPositioning.placement ?? "bottom-start";
@@ -3432,11 +4215,11 @@ var PopoverRoot = (props) => {
3432
4215
  }
3433
4216
  ) });
3434
4217
  };
3435
- var PopoverTrigger = React29.forwardRef(function PopoverTrigger2(props, ref) {
4218
+ var PopoverTrigger = React33.forwardRef(function PopoverTrigger2(props, ref) {
3436
4219
  const { asChild = true, ...rest } = props;
3437
4220
  return /* @__PURE__ */ jsx(Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
3438
4221
  });
3439
- var PopoverContent = React29.forwardRef(function PopoverContent2(props, ref) {
4222
+ var PopoverContent = React33.forwardRef(function PopoverContent2(props, ref) {
3440
4223
  const { portalled = true, portalRef: _portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
3441
4224
  const resolvedW = typeof w === "object" ? w.base ?? w.lg : w;
3442
4225
  const contentStyle = {
@@ -3467,7 +4250,7 @@ var PopoverContent = React29.forwardRef(function PopoverContent2(props, ref) {
3467
4250
  }
3468
4251
  );
3469
4252
  });
3470
- var PopoverArrow = React29.forwardRef(function PopoverArrow2(props, ref) {
4253
+ var PopoverArrow = React33.forwardRef(function PopoverArrow2(props, ref) {
3471
4254
  const { className, ...rest } = props;
3472
4255
  return /* @__PURE__ */ jsx(
3473
4256
  Popover.Arrow,
@@ -3479,7 +4262,7 @@ var PopoverArrow = React29.forwardRef(function PopoverArrow2(props, ref) {
3479
4262
  }
3480
4263
  );
3481
4264
  });
3482
- var PopoverCloseTrigger = React29.forwardRef(function PopoverCloseTrigger2(props, ref) {
4265
+ var PopoverCloseTrigger = React33.forwardRef(function PopoverCloseTrigger2(props, ref) {
3483
4266
  const { className, ...rest } = props;
3484
4267
  return /* @__PURE__ */ jsx(
3485
4268
  Popover.Close,
@@ -3493,14 +4276,14 @@ var PopoverCloseTrigger = React29.forwardRef(function PopoverCloseTrigger2(props
3493
4276
  }
3494
4277
  );
3495
4278
  });
3496
- var PopoverCloseTriggerWrapper = React29.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
4279
+ var PopoverCloseTriggerWrapper = React33.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
3497
4280
  const { disabled, children, ...rest } = props;
3498
4281
  if (disabled) {
3499
4282
  return children;
3500
4283
  }
3501
4284
  return /* @__PURE__ */ jsx(Popover.Close, { ref, ...rest, asChild: true, children });
3502
4285
  });
3503
- var PopoverBody = React29.forwardRef(function PopoverBody2(props, ref) {
4286
+ var PopoverBody = React33.forwardRef(function PopoverBody2(props, ref) {
3504
4287
  const {
3505
4288
  className,
3506
4289
  style: styleProp,
@@ -3538,7 +4321,7 @@ var PopoverBody = React29.forwardRef(function PopoverBody2(props, ref) {
3538
4321
  }
3539
4322
  );
3540
4323
  });
3541
- var PopoverHeader = React29.forwardRef(function PopoverHeader2(props, ref) {
4324
+ var PopoverHeader = React33.forwardRef(function PopoverHeader2(props, ref) {
3542
4325
  const { className, ...rest } = props;
3543
4326
  return /* @__PURE__ */ jsx(
3544
4327
  "div",
@@ -3549,7 +4332,7 @@ var PopoverHeader = React29.forwardRef(function PopoverHeader2(props, ref) {
3549
4332
  }
3550
4333
  );
3551
4334
  });
3552
- var PopoverFooter = React29.forwardRef(function PopoverFooter2(props, ref) {
4335
+ var PopoverFooter = React33.forwardRef(function PopoverFooter2(props, ref) {
3553
4336
  const { className, ...rest } = props;
3554
4337
  return /* @__PURE__ */ jsx(
3555
4338
  "div",
@@ -3560,7 +4343,7 @@ var PopoverFooter = React29.forwardRef(function PopoverFooter2(props, ref) {
3560
4343
  }
3561
4344
  );
3562
4345
  });
3563
- var PopoverTitle = React29.forwardRef(function PopoverTitle2(props, ref) {
4346
+ var PopoverTitle = React33.forwardRef(function PopoverTitle2(props, ref) {
3564
4347
  const { className, ...rest } = props;
3565
4348
  return /* @__PURE__ */ jsx(
3566
4349
  "h3",
@@ -3571,7 +4354,7 @@ var PopoverTitle = React29.forwardRef(function PopoverTitle2(props, ref) {
3571
4354
  }
3572
4355
  );
3573
4356
  });
3574
- var PopoverDescription = React29.forwardRef(function PopoverDescription2(props, ref) {
4357
+ var PopoverDescription = React33.forwardRef(function PopoverDescription2(props, ref) {
3575
4358
  const { className, ...rest } = props;
3576
4359
  return /* @__PURE__ */ jsx(
3577
4360
  "p",
@@ -3593,7 +4376,7 @@ function normalizeValue(value, min, max) {
3593
4376
  if (max <= min) return 0;
3594
4377
  return Math.round((value - min) / (max - min) * 100);
3595
4378
  }
3596
- var Progress = React29.forwardRef(
4379
+ var Progress = React33.forwardRef(
3597
4380
  function Progress2(props, ref) {
3598
4381
  const {
3599
4382
  value,
@@ -3633,10 +4416,11 @@ var Progress = React29.forwardRef(
3633
4416
  style: rootStyle,
3634
4417
  ...rest,
3635
4418
  children: /* @__PURE__ */ jsx(
3636
- RadixProgress.Root,
4419
+ Progress$1,
3637
4420
  {
3638
4421
  value: percent,
3639
4422
  max: 100,
4423
+ unstyled: true,
3640
4424
  className: cn(
3641
4425
  "w-full overflow-hidden rounded-full",
3642
4426
  "bg-[var(--color-progress-track)]",
@@ -3645,14 +4429,15 @@ var Progress = React29.forwardRef(
3645
4429
  ),
3646
4430
  style: trackStyle,
3647
4431
  children: /* @__PURE__ */ jsx(
3648
- RadixProgress.Indicator,
4432
+ Progress$1.Indicator,
3649
4433
  {
4434
+ unstyled: true,
4435
+ transition: "slow",
3650
4436
  className: cn(
3651
- "h-full rounded-full transition-transform duration-500 ease-out",
4437
+ "h-full rounded-full",
3652
4438
  !color && "bg-[var(--color-progress-indicator)]"
3653
4439
  ),
3654
4440
  style: {
3655
- width: `${percent}%`,
3656
4441
  ...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
3657
4442
  }
3658
4443
  }
@@ -3670,12 +4455,12 @@ var SIZE_MAP = {
3670
4455
  lg: { size: 48, thickness: 7, textClass: "text-sm" },
3671
4456
  xl: { size: 64, thickness: 8, textClass: "text-sm" }
3672
4457
  };
3673
- var Ctx = React29.createContext({
4458
+ var Ctx = React33.createContext({
3674
4459
  value: 0,
3675
4460
  size: "md",
3676
4461
  colorPalette: "blue"
3677
4462
  });
3678
- var ProgressCircleRoot = React29.forwardRef(function ProgressCircleRoot2(props, ref) {
4463
+ var ProgressCircleRoot = React33.forwardRef(function ProgressCircleRoot2(props, ref) {
3679
4464
  const {
3680
4465
  value = 0,
3681
4466
  size = "md",
@@ -3684,7 +4469,7 @@ var ProgressCircleRoot = React29.forwardRef(function ProgressCircleRoot2(props,
3684
4469
  children,
3685
4470
  ...rest
3686
4471
  } = props;
3687
- const ctx = React29.useMemo(
4472
+ const ctx = React33.useMemo(
3688
4473
  () => ({ value: value ?? null, size, colorPalette }),
3689
4474
  [value, size, colorPalette]
3690
4475
  );
@@ -3702,9 +4487,9 @@ var ProgressCircleRoot = React29.forwardRef(function ProgressCircleRoot2(props,
3702
4487
  }
3703
4488
  ) });
3704
4489
  });
3705
- var ProgressCircleRing = React29.forwardRef(function ProgressCircleRing2(props, ref) {
4490
+ var ProgressCircleRing = React33.forwardRef(function ProgressCircleRing2(props, ref) {
3706
4491
  const { trackColor, cap, color, className, ...rest } = props;
3707
- const { value, size: sizeKey } = React29.useContext(Ctx);
4492
+ const { value, size: sizeKey } = React33.useContext(Ctx);
3708
4493
  const { size, thickness } = SIZE_MAP[sizeKey];
3709
4494
  const radius = size / 2 - thickness / 2;
3710
4495
  const circumference = 2 * Math.PI * radius;
@@ -3759,9 +4544,9 @@ var ProgressCircleRing = React29.forwardRef(function ProgressCircleRing2(props,
3759
4544
  }
3760
4545
  );
3761
4546
  });
3762
- var ProgressCircleValueText = React29.forwardRef(function ProgressCircleValueText2(props, ref) {
4547
+ var ProgressCircleValueText = React33.forwardRef(function ProgressCircleValueText2(props, ref) {
3763
4548
  const { className, children, ...rest } = props;
3764
- const { value, size: sizeKey } = React29.useContext(Ctx);
4549
+ const { value, size: sizeKey } = React33.useContext(Ctx);
3765
4550
  const { textClass } = SIZE_MAP[sizeKey];
3766
4551
  return /* @__PURE__ */ jsx(
3767
4552
  "div",
@@ -3805,8 +4590,8 @@ var SIZE_CLASSES8 = {
3805
4590
  label: "text-base"
3806
4591
  }
3807
4592
  };
3808
- var RadioSizeContext = React29.createContext("md");
3809
- var RadioGroupBase = React29.forwardRef(
4593
+ var RadioSizeContext = React33.createContext("md");
4594
+ var RadioGroupBase = React33.forwardRef(
3810
4595
  function RadioGroup2(props, ref) {
3811
4596
  const {
3812
4597
  children,
@@ -3815,7 +4600,8 @@ var RadioGroupBase = React29.forwardRef(
3815
4600
  disabled = false,
3816
4601
  readOnly = false,
3817
4602
  orientation = "vertical",
3818
- loop = true,
4603
+ // `loop` was a Radix-only knob; gui's roving focus always wraps.
4604
+ loop: _loop = true,
3819
4605
  defaultValue,
3820
4606
  value,
3821
4607
  onValueChange,
@@ -3823,7 +4609,7 @@ var RadioGroupBase = React29.forwardRef(
3823
4609
  className,
3824
4610
  ...rest
3825
4611
  } = props;
3826
- const handleValueChange = React29.useCallback(
4612
+ const handleValueChange = React33.useCallback(
3827
4613
  (nextValue) => {
3828
4614
  if (readOnly) return;
3829
4615
  onValueChange?.({ value: nextValue });
@@ -3831,14 +4617,14 @@ var RadioGroupBase = React29.forwardRef(
3831
4617
  [readOnly, onValueChange]
3832
4618
  );
3833
4619
  return /* @__PURE__ */ jsx(RadioSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
3834
- RadixRadioGroup.Root,
4620
+ RadioGroup,
3835
4621
  {
3836
4622
  ref,
4623
+ unstyled: true,
3837
4624
  name,
3838
4625
  required,
3839
4626
  disabled: disabled || readOnly,
3840
4627
  orientation,
3841
- loop,
3842
4628
  defaultValue,
3843
4629
  value: value ?? void 0,
3844
4630
  onValueChange: handleValueChange,
@@ -3856,10 +4642,10 @@ var RadioGroupBase = React29.forwardRef(
3856
4642
  var RadioGroup3 = RadioGroupBase;
3857
4643
  var NOOP2 = () => {
3858
4644
  };
3859
- var RadioBase = React29.forwardRef(
4645
+ var RadioBase = React33.forwardRef(
3860
4646
  function Radio(props, ref) {
3861
4647
  const { children, inputProps, rootRef, value, disabled, className, ...rest } = props;
3862
- const size = React29.useContext(RadioSizeContext);
4648
+ const size = React33.useContext(RadioSizeContext);
3863
4649
  const sizeClasses2 = SIZE_CLASSES8[size];
3864
4650
  return /* @__PURE__ */ jsxs(
3865
4651
  "label",
@@ -3875,8 +4661,9 @@ var RadioBase = React29.forwardRef(
3875
4661
  ...rest,
3876
4662
  children: [
3877
4663
  /* @__PURE__ */ jsx(
3878
- RadixRadioGroup.Item,
4664
+ RadioGroup.Item,
3879
4665
  {
4666
+ unstyled: true,
3880
4667
  value,
3881
4668
  disabled,
3882
4669
  className: cn(
@@ -3888,8 +4675,9 @@ var RadioBase = React29.forwardRef(
3888
4675
  sizeClasses2.control
3889
4676
  ),
3890
4677
  children: /* @__PURE__ */ jsx(
3891
- RadixRadioGroup.Indicator,
4678
+ RadioGroup.Indicator,
3892
4679
  {
4680
+ unstyled: true,
3893
4681
  className: cn(
3894
4682
  "block rounded-full bg-gray-800 dark:bg-white",
3895
4683
  sizeClasses2.indicator
@@ -3921,23 +4709,23 @@ var RadioBase = React29.forwardRef(
3921
4709
  var Radio2 = RadioBase;
3922
4710
  var StarFilledIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
3923
4711
  var StarOutlineIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
3924
- var Rating = React29.forwardRef(
4712
+ var Rating = React33.forwardRef(
3925
4713
  function Rating2(props, ref) {
3926
4714
  const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
3927
- const [value, setValue] = React29.useState(defaultValue);
3928
- const [hoveredIndex, setHoveredIndex] = React29.useState(-1);
4715
+ const [value, setValue] = React33.useState(defaultValue);
4716
+ const [hoveredIndex, setHoveredIndex] = React33.useState(-1);
3929
4717
  const highlightedIndex = hoveredIndex >= 0 && !readOnly ? hoveredIndex + 1 : value;
3930
4718
  const label = Array.isArray(labelProp) ? labelProp[highlightedIndex - 1] : labelProp;
3931
- const handleClick = React29.useCallback((index) => () => {
4719
+ const handleClick = React33.useCallback((index) => () => {
3932
4720
  if (readOnly) return;
3933
4721
  setValue(index);
3934
4722
  onValueChange?.({ value: index });
3935
4723
  }, [readOnly, onValueChange]);
3936
- const handleMouseEnter = React29.useCallback((index) => () => {
4724
+ const handleMouseEnter = React33.useCallback((index) => () => {
3937
4725
  if (readOnly) return;
3938
4726
  setHoveredIndex(index);
3939
4727
  }, [readOnly]);
3940
- const handleMouseLeave = React29.useCallback(() => {
4728
+ const handleMouseLeave = React33.useCallback(() => {
3941
4729
  setHoveredIndex(-1);
3942
4730
  }, []);
3943
4731
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("inline-flex items-center gap-1", className), ...rest, children: [
@@ -3965,14 +4753,14 @@ var Rating = React29.forwardRef(
3965
4753
  ] });
3966
4754
  }
3967
4755
  );
3968
- function createListCollection(config) {
3969
- return { items: config.items };
4756
+ function createListCollection(config2) {
4757
+ return { items: config2.items };
3970
4758
  }
3971
4759
  var ArrowIcon2 = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
3972
4760
  var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M16.667 5L7.5 14.167 3.333 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
3973
4761
  function FilterInput({ placeholder, initialValue = "", onChange }) {
3974
- const [value, setValue] = React29.useState(initialValue);
3975
- const handleChange = React29.useCallback((e) => {
4762
+ const [value, setValue] = React33.useState(initialValue);
4763
+ const handleChange = React33.useCallback((e) => {
3976
4764
  setValue(e.target.value);
3977
4765
  onChange?.(e.target.value);
3978
4766
  }, [onChange]);
@@ -3991,15 +4779,15 @@ function FilterInput({ placeholder, initialValue = "", onChange }) {
3991
4779
  }
3992
4780
  );
3993
4781
  }
3994
- var SelectInternalContext = React29.createContext(null);
4782
+ var SelectInternalContext = React33.createContext(null);
3995
4783
  function useSelectInternalContext() {
3996
- const ctx = React29.useContext(SelectInternalContext);
4784
+ const ctx = React33.useContext(SelectInternalContext);
3997
4785
  if (!ctx) {
3998
4786
  throw new Error("Select compound components must be rendered inside <SelectRoot>");
3999
4787
  }
4000
4788
  return ctx;
4001
4789
  }
4002
- var SelectRoot = React29.forwardRef(
4790
+ var SelectRoot = React33.forwardRef(
4003
4791
  function SelectRoot2(props, ref) {
4004
4792
  const {
4005
4793
  children,
@@ -4030,21 +4818,21 @@ var SelectRoot = React29.forwardRef(
4030
4818
  hideFrom: _hideFrom
4031
4819
  } = props;
4032
4820
  const collection = collectionProp ?? createListCollection({ items: [] });
4033
- const [internalValue, setInternalValue] = React29.useState(defaultValueArr ?? []);
4821
+ const [internalValue, setInternalValue] = React33.useState(defaultValueArr ?? []);
4034
4822
  const currentValue = valueProp ?? internalValue;
4035
- const selectedItems = React29.useMemo(() => {
4823
+ const selectedItems = React33.useMemo(() => {
4036
4824
  return currentValue.map((v) => collection.items.find((item) => item.value === v)).filter(Boolean);
4037
4825
  }, [currentValue, collection.items]);
4038
- const [open, setOpen] = React29.useState(defaultOpen ?? false);
4826
+ const [open, setOpen] = React33.useState(defaultOpen ?? false);
4039
4827
  const isOpen = openProp ?? open;
4040
- const handleOpenChange = React29.useCallback((nextOpen) => {
4828
+ const handleOpenChange = React33.useCallback((nextOpen) => {
4041
4829
  setOpen(nextOpen);
4042
4830
  onOpenChange?.(nextOpen);
4043
4831
  if (!nextOpen) {
4044
4832
  onInteractOutside?.();
4045
4833
  }
4046
4834
  }, [onOpenChange, onInteractOutside]);
4047
- const handleRadixValueChange = React29.useCallback((radixValue) => {
4835
+ const handleRadixValueChange = React33.useCallback((radixValue) => {
4048
4836
  const nextArr = [radixValue];
4049
4837
  if (!valueProp) {
4050
4838
  setInternalValue(nextArr);
@@ -4052,7 +4840,7 @@ var SelectRoot = React29.forwardRef(
4052
4840
  const items = collection.items.filter((item) => nextArr.includes(item.value));
4053
4841
  onValueChangeProp?.({ value: nextArr, items });
4054
4842
  }, [valueProp, collection.items, onValueChangeProp]);
4055
- const ctxValue = React29.useMemo(() => ({
4843
+ const ctxValue = React33.useMemo(() => ({
4056
4844
  value: currentValue,
4057
4845
  selectedItems,
4058
4846
  collection,
@@ -4072,7 +4860,7 @@ var SelectRoot = React29.forwardRef(
4072
4860
  if (typeof v === "string") return v;
4073
4861
  return v.base ?? v.lg ?? Object.values(v)[0];
4074
4862
  };
4075
- const inlineStyle = React29.useMemo(() => {
4863
+ const inlineStyle = React33.useMemo(() => {
4076
4864
  const s = { ...style };
4077
4865
  const rw = resolveVal(w);
4078
4866
  if (rw) s.width = rw;
@@ -4110,7 +4898,7 @@ var SelectRoot = React29.forwardRef(
4110
4898
  ) });
4111
4899
  }
4112
4900
  );
4113
- var SelectControl = React29.forwardRef(
4901
+ var SelectControl = React33.forwardRef(
4114
4902
  function SelectControl2(props, ref) {
4115
4903
  const { children, noIndicator, triggerProps, loading, defaultValue } = props;
4116
4904
  const ctx = useSelectInternalContext();
@@ -4147,11 +4935,11 @@ var SelectControl = React29.forwardRef(
4147
4935
  return trigger;
4148
4936
  }
4149
4937
  );
4150
- var SelectClearTrigger = React29.forwardRef(
4938
+ var SelectClearTrigger = React33.forwardRef(
4151
4939
  function SelectClearTrigger2(props, ref) {
4152
4940
  const { className, ...rest } = props;
4153
4941
  const ctx = useSelectInternalContext();
4154
- const handleClick = React29.useCallback(() => {
4942
+ const handleClick = React33.useCallback(() => {
4155
4943
  ctx.onValueChange({ value: [], items: [] });
4156
4944
  }, [ctx]);
4157
4945
  return /* @__PURE__ */ jsx(
@@ -4168,7 +4956,7 @@ var SelectClearTrigger = React29.forwardRef(
4168
4956
  );
4169
4957
  }
4170
4958
  );
4171
- var SelectContent = React29.forwardRef(
4959
+ var SelectContent = React33.forwardRef(
4172
4960
  function SelectContent2(props, ref) {
4173
4961
  const { portalled = true, portalRef, children, className, ...rest } = props;
4174
4962
  const content = /* @__PURE__ */ jsx(
@@ -4195,7 +4983,7 @@ var SelectContent = React29.forwardRef(
4195
4983
  return content;
4196
4984
  }
4197
4985
  );
4198
- var SelectItem = React29.forwardRef(
4986
+ var SelectItem = React33.forwardRef(
4199
4987
  function SelectItem2(props, ref) {
4200
4988
  const { item, children, className, ...rest } = props;
4201
4989
  return /* @__PURE__ */ jsxs(
@@ -4223,7 +5011,7 @@ var SelectItem = React29.forwardRef(
4223
5011
  );
4224
5012
  }
4225
5013
  );
4226
- var SelectValueText = React29.forwardRef(
5014
+ var SelectValueText = React33.forwardRef(
4227
5015
  function SelectValueText2(props, ref) {
4228
5016
  const { children, size, required, invalid, errorText, mode, className, style, placeholder: placeholderProp, ...rest } = props;
4229
5017
  const ctx = useSelectInternalContext();
@@ -4279,7 +5067,7 @@ var SelectValueText = React29.forwardRef(
4279
5067
  );
4280
5068
  }
4281
5069
  );
4282
- var SelectItemGroup = React29.forwardRef(
5070
+ var SelectItemGroup = React33.forwardRef(
4283
5071
  function SelectItemGroup2(props, ref) {
4284
5072
  const { children, label, className, ...rest } = props;
4285
5073
  return /* @__PURE__ */ jsxs(RadixSelect.Group, { ref, className: cn("py-1", className), ...rest, children: [
@@ -4290,7 +5078,7 @@ var SelectItemGroup = React29.forwardRef(
4290
5078
  );
4291
5079
  var SelectLabel = RadixSelect.Label;
4292
5080
  var SelectItemText = RadixSelect.ItemText;
4293
- var Select = React29.forwardRef((props, ref) => {
5081
+ var Select = React33.forwardRef((props, ref) => {
4294
5082
  const { collection, placeholder, portalled = true, loading, errorText, contentProps, contentHeader, itemFilter, mode, ...rest } = props;
4295
5083
  return /* @__PURE__ */ jsxs(
4296
5084
  SelectRoot,
@@ -4312,7 +5100,7 @@ var Select = React29.forwardRef((props, ref) => {
4312
5100
  ) }),
4313
5101
  /* @__PURE__ */ jsxs(SelectContent, { portalled, ...contentProps, children: [
4314
5102
  contentHeader,
4315
- collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
5103
+ collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
4316
5104
  /* @__PURE__ */ jsx(SelectItem, { item, children: item.renderLabel ? item.renderLabel("item") : item.label }),
4317
5105
  item.afterElement
4318
5106
  ] }, item.value))
@@ -4321,19 +5109,19 @@ var Select = React29.forwardRef((props, ref) => {
4321
5109
  }
4322
5110
  );
4323
5111
  });
4324
- var SelectAsync = React29.forwardRef((props, ref) => {
5112
+ var SelectAsync = React33.forwardRef((props, ref) => {
4325
5113
  const { placeholder, portalled = true, loading, loadOptions, extraControls, onValueChange, errorText, mode, contentHeader, ...rest } = props;
4326
- const [collection, setCollection] = React29.useState(createListCollection({ items: [] }));
4327
- const [inputValue, setInputValue] = React29.useState("");
4328
- const [value, setValue] = React29.useState([]);
5114
+ const [collection, setCollection] = React33.useState(createListCollection({ items: [] }));
5115
+ const [inputValue, setInputValue] = React33.useState("");
5116
+ const [value, setValue] = React33.useState([]);
4329
5117
  const debouncedInputValue = useDebounce(inputValue, 300);
4330
- React29.useEffect(() => {
5118
+ React33.useEffect(() => {
4331
5119
  loadOptions(debouncedInputValue, value).then(setCollection);
4332
5120
  }, [debouncedInputValue, loadOptions, value]);
4333
- const handleFilterChange = React29.useCallback((val) => {
5121
+ const handleFilterChange = React33.useCallback((val) => {
4334
5122
  setInputValue(val);
4335
5123
  }, []);
4336
- const handleValueChange = React29.useCallback(({ value: v, items }) => {
5124
+ const handleValueChange = React33.useCallback(({ value: v, items }) => {
4337
5125
  setValue(v);
4338
5126
  onValueChange?.({ value: v, items });
4339
5127
  }, [onValueChange]);
@@ -4392,13 +5180,14 @@ var VERTICAL_SIZE_CLASSES = {
4392
5180
  md: "border-l-2",
4393
5181
  lg: "border-l-[3px]"
4394
5182
  };
4395
- var Separator2 = React29__default.forwardRef(
5183
+ var Separator2 = React33__default.forwardRef(
4396
5184
  function Separator3({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
4397
5185
  const isVertical = orientation === "vertical";
4398
5186
  return /* @__PURE__ */ jsx(
4399
- "hr",
5187
+ Separator,
4400
5188
  {
4401
5189
  ref,
5190
+ vertical: isVertical,
4402
5191
  role: "separator",
4403
5192
  "aria-orientation": orientation,
4404
5193
  className: cn(
@@ -4414,9 +5203,7 @@ var Separator2 = React29__default.forwardRef(
4414
5203
  );
4415
5204
  }
4416
5205
  );
4417
- var THUMB_SIZE = 20;
4418
- var TRACK_HEIGHT = 6;
4419
- var Slider = React29.forwardRef(
5206
+ var Slider = React33.forwardRef(
4420
5207
  function Slider2(props, ref) {
4421
5208
  const {
4422
5209
  marks: marksProp,
@@ -4428,7 +5215,7 @@ var Slider = React29.forwardRef(
4428
5215
  max = 100,
4429
5216
  step,
4430
5217
  disabled,
4431
- orientation,
5218
+ orientation = "horizontal",
4432
5219
  name,
4433
5220
  onValueChange,
4434
5221
  onValueCommit,
@@ -4440,6 +5227,14 @@ var Slider = React29.forwardRef(
4440
5227
  return mark;
4441
5228
  });
4442
5229
  const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
5230
+ const latest = React33.useRef(value ?? defaultValue ?? []);
5231
+ const handleValueChange = React33.useCallback((next) => {
5232
+ latest.current = next;
5233
+ onValueChange?.(next);
5234
+ }, [onValueChange]);
5235
+ const handleSlideEnd = React33.useCallback(() => {
5236
+ onValueCommit?.(latest.current);
5237
+ }, [onValueCommit]);
4443
5238
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
4444
5239
  label && !showValue && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-text-secondary", children: label }),
4445
5240
  label && showValue && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4447,9 +5242,10 @@ var Slider = React29.forwardRef(
4447
5242
  /* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary", children: (value ?? defaultValue ?? [])?.join(", ") })
4448
5243
  ] }),
4449
5244
  /* @__PURE__ */ jsxs(
4450
- RadixSlider.Root,
5245
+ Slider$1,
4451
5246
  {
4452
5247
  ref,
5248
+ unstyled: true,
4453
5249
  className: cn(
4454
5250
  "relative flex w-full touch-none select-none items-center",
4455
5251
  hasMarkLabel && "mb-6"
@@ -4462,24 +5258,30 @@ var Slider = React29.forwardRef(
4462
5258
  disabled,
4463
5259
  orientation,
4464
5260
  name,
4465
- onValueChange,
4466
- onValueCommit,
5261
+ onValueChange: handleValueChange,
5262
+ onSlideEnd: handleSlideEnd,
4467
5263
  children: [
4468
5264
  /* @__PURE__ */ jsx(
4469
- RadixSlider.Track,
5265
+ Slider$1.Track,
4470
5266
  {
4471
- className: cn(
4472
- "relative grow rounded-full bg-border-divider",
4473
- `h-[${TRACK_HEIGHT}px]`
4474
- ),
4475
- children: /* @__PURE__ */ jsx(RadixSlider.Range, { className: "absolute h-full rounded-full bg-link-primary" })
5267
+ unstyled: true,
5268
+ className: "relative grow h-1.5 rounded-full bg-border-divider",
5269
+ children: /* @__PURE__ */ jsx(
5270
+ Slider$1.TrackActive,
5271
+ {
5272
+ unstyled: true,
5273
+ className: "absolute h-full rounded-full bg-link-primary"
5274
+ }
5275
+ )
4476
5276
  }
4477
5277
  ),
4478
5278
  resolvedValue?.map((_, index) => /* @__PURE__ */ jsx(
4479
- RadixSlider.Thumb,
5279
+ Slider$1.Thumb,
4480
5280
  {
5281
+ index,
5282
+ unstyled: true,
4481
5283
  className: cn(
4482
- `block h-[${THUMB_SIZE}px] w-[${THUMB_SIZE}px]`,
5284
+ "block h-5 w-5",
4483
5285
  "rounded-full border-2 border-link-primary bg-white",
4484
5286
  "shadow-sm transition-colors",
4485
5287
  "hover:border-link-primary-hover",
@@ -4521,22 +5323,22 @@ var NOOP3 = () => {
4521
5323
  var SIZE_CLASSES9 = {
4522
5324
  sm: {
4523
5325
  root: "h-4 w-7",
4524
- thumb: "h-3 w-3 data-[state=checked]:translate-x-3",
5326
+ thumb: "h-3 w-3",
4525
5327
  label: "text-xs"
4526
5328
  },
4527
5329
  md: {
4528
5330
  root: "h-5 w-9",
4529
- thumb: "h-4 w-4 data-[state=checked]:translate-x-4",
5331
+ thumb: "h-4 w-4",
4530
5332
  label: "text-sm"
4531
5333
  },
4532
5334
  lg: {
4533
5335
  root: "h-6 w-11",
4534
- thumb: "h-5 w-5 data-[state=checked]:translate-x-5",
5336
+ thumb: "h-5 w-5",
4535
5337
  label: "text-base"
4536
5338
  }
4537
5339
  };
4538
- var SwitchBase = React29.forwardRef(
4539
- function Switch(props, ref) {
5340
+ var SwitchBase = React33.forwardRef(
5341
+ function Switch$1(props, ref) {
4540
5342
  const {
4541
5343
  inputProps,
4542
5344
  children,
@@ -4554,17 +5356,15 @@ var SwitchBase = React29.forwardRef(
4554
5356
  className,
4555
5357
  ...rest
4556
5358
  } = props;
4557
- const [internalChecked, setInternalChecked] = React29.useState(defaultChecked ?? false);
5359
+ const [internalChecked, setInternalChecked] = React33.useState(defaultChecked ?? false);
4558
5360
  const isControlled = checkedProp !== void 0;
4559
5361
  const checkedState = isControlled ? checkedProp : internalChecked;
4560
- const handleCheckedChange = React29.useCallback(
5362
+ const handleCheckedChange = React33.useCallback(
4561
5363
  (nextChecked) => {
4562
5364
  if (!isControlled) {
4563
5365
  setInternalChecked(nextChecked);
4564
5366
  }
4565
- if (onCheckedChange) {
4566
- onCheckedChange({ checked: nextChecked });
4567
- }
5367
+ onCheckedChange?.({ checked: nextChecked });
4568
5368
  },
4569
5369
  [isControlled, onCheckedChange]
4570
5370
  );
@@ -4585,8 +5385,9 @@ var SwitchBase = React29.forwardRef(
4585
5385
  ...rest,
4586
5386
  children: [
4587
5387
  /* @__PURE__ */ jsxs(
4588
- RadixSwitch.Root,
5388
+ Switch,
4589
5389
  {
5390
+ unstyled: true,
4590
5391
  checked: checkedState,
4591
5392
  onCheckedChange: handleCheckedChange,
4592
5393
  disabled,
@@ -4601,12 +5402,13 @@ var SwitchBase = React29.forwardRef(
4601
5402
  children: [
4602
5403
  trackLabel && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-bold text-white pointer-events-none", children: checkedState ? trackLabel.on : trackLabel.off }),
4603
5404
  /* @__PURE__ */ jsx(
4604
- RadixSwitch.Thumb,
5405
+ Switch.Thumb,
4605
5406
  {
5407
+ unstyled: true,
5408
+ "data-thumb": true,
5409
+ transition: "quicker",
4606
5410
  className: cn(
4607
5411
  "block rounded-full bg-white shadow-sm",
4608
- "transition-transform duration-200",
4609
- "translate-x-0.5",
4610
5412
  sizeClasses2.thumb
4611
5413
  ),
4612
5414
  children: thumbLabel && /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center h-full w-full text-[8px]", children: checkedState ? thumbLabel.on : thumbLabel.off })
@@ -4822,7 +5624,7 @@ function resolveResponsive(value) {
4822
5624
  }
4823
5625
  return void 0;
4824
5626
  }
4825
- var TableRoot = React29.forwardRef(
5627
+ var TableRoot = React33.forwardRef(
4826
5628
  function TableRoot2(props, ref) {
4827
5629
  const { className, style: styleProp, children, ...other } = props;
4828
5630
  const rawMinW = other.minWidth ?? other.minW;
@@ -4845,7 +5647,7 @@ var TableRoot = React29.forwardRef(
4845
5647
  );
4846
5648
  }
4847
5649
  );
4848
- var TableHeader = React29.forwardRef(
5650
+ var TableHeader = React33.forwardRef(
4849
5651
  function TableHeader2(props, ref) {
4850
5652
  const { className, style: styleProp, children, ...other } = props;
4851
5653
  const { style: extracted, rest } = extractStyles(other);
@@ -4862,7 +5664,7 @@ var TableHeader = React29.forwardRef(
4862
5664
  );
4863
5665
  }
4864
5666
  );
4865
- var TableBody = React29.forwardRef(
5667
+ var TableBody = React33.forwardRef(
4866
5668
  function TableBody2(props, ref) {
4867
5669
  const { className, style: styleProp, children, ...other } = props;
4868
5670
  const { style: extracted, rest } = extractStyles(other);
@@ -4879,7 +5681,7 @@ var TableBody = React29.forwardRef(
4879
5681
  );
4880
5682
  }
4881
5683
  );
4882
- var TableRow = React29.forwardRef(
5684
+ var TableRow = React33.forwardRef(
4883
5685
  function TableRow2(props, ref) {
4884
5686
  const { className, style: styleProp, children, ...other } = props;
4885
5687
  const { style: extracted, rest } = extractStyles(other);
@@ -4896,7 +5698,7 @@ var TableRow = React29.forwardRef(
4896
5698
  );
4897
5699
  }
4898
5700
  );
4899
- var TableCell = React29.forwardRef(
5701
+ var TableCell = React33.forwardRef(
4900
5702
  function TableCell2(props, ref) {
4901
5703
  const { isNumeric, className, style: styleProp, children, ...other } = props;
4902
5704
  const { style: extracted, rest } = extractStyles(other);
@@ -4917,7 +5719,7 @@ var TableCell = React29.forwardRef(
4917
5719
  );
4918
5720
  }
4919
5721
  );
4920
- var TableColumnHeader = React29.forwardRef(
5722
+ var TableColumnHeader = React33.forwardRef(
4921
5723
  function TableColumnHeader2(props, ref) {
4922
5724
  const { isNumeric, className, style: styleProp, children, ...other } = props;
4923
5725
  const { style: extracted, rest } = extractStyles(other);
@@ -4944,7 +5746,7 @@ var TableColumnHeader = React29.forwardRef(
4944
5746
  );
4945
5747
  var TableColumnHeaderSortable = (props) => {
4946
5748
  const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
4947
- const handleSortToggle = React29.useCallback(() => {
5749
+ const handleSortToggle = React33.useCallback(() => {
4948
5750
  onSortToggle(sortField);
4949
5751
  }, [onSortToggle, sortField]);
4950
5752
  const isActive = sortValue.includes(sortField);
@@ -4970,16 +5772,16 @@ var TableColumnHeaderSortable = (props) => {
4970
5772
  var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
4971
5773
  var TableHeaderSticky = (props) => {
4972
5774
  const { top, children, className, style: styleProp, ...rest } = props;
4973
- const ref = React29.useRef(null);
4974
- const [isStuck, setIsStuck] = React29.useState(false);
4975
- const handleScroll = React29.useCallback(() => {
5775
+ const ref = React33.useRef(null);
5776
+ const [isStuck, setIsStuck] = React33.useState(false);
5777
+ const handleScroll = React33.useCallback(() => {
4976
5778
  if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
4977
5779
  setIsStuck(true);
4978
5780
  } else {
4979
5781
  setIsStuck(false);
4980
5782
  }
4981
5783
  }, [top]);
4982
- React29.useEffect(() => {
5784
+ React33.useEffect(() => {
4983
5785
  const throttledHandleScroll = throttle(handleScroll, 300);
4984
5786
  window.addEventListener("scroll", throttledHandleScroll);
4985
5787
  return () => {
@@ -5001,7 +5803,7 @@ var TableHeaderSticky = (props) => {
5001
5803
  }
5002
5804
  );
5003
5805
  };
5004
- var TableCaption = React29.forwardRef(
5806
+ var TableCaption = React33.forwardRef(
5005
5807
  function TableCaption2(props, ref) {
5006
5808
  const { className, style: styleProp, children, ...other } = props;
5007
5809
  const { style: extracted, rest } = extractStyles(other);
@@ -5018,7 +5820,7 @@ var TableCaption = React29.forwardRef(
5018
5820
  );
5019
5821
  }
5020
5822
  );
5021
- var TableFooter = React29.forwardRef(
5823
+ var TableFooter = React33.forwardRef(
5022
5824
  function TableFooter2(props, ref) {
5023
5825
  const { className, style: styleProp, children, ...other } = props;
5024
5826
  const { style: extracted, rest } = extractStyles(other);
@@ -5035,7 +5837,7 @@ var TableFooter = React29.forwardRef(
5035
5837
  );
5036
5838
  }
5037
5839
  );
5038
- var TableScrollWrapper = React29.forwardRef(
5840
+ var TableScrollWrapper = React33.forwardRef(
5039
5841
  function TableScrollWrapper2(props, ref) {
5040
5842
  const { className, children, ...rest } = props;
5041
5843
  return /* @__PURE__ */ jsx(
@@ -5054,7 +5856,7 @@ var ROOT_SIZE_CLASSES = {
5054
5856
  md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
5055
5857
  free: ""
5056
5858
  };
5057
- var TabsRoot = React29.forwardRef(
5859
+ var TabsRoot = React33.forwardRef(
5058
5860
  function TabsRoot2(props, ref) {
5059
5861
  const {
5060
5862
  variant = "solid",
@@ -5066,7 +5868,7 @@ var TabsRoot = React29.forwardRef(
5066
5868
  className,
5067
5869
  ...rest
5068
5870
  } = props;
5069
- const handleValueChange = React29.useCallback(
5871
+ const handleValueChange = React33.useCallback(
5070
5872
  (value) => {
5071
5873
  if (!onValueChange) return;
5072
5874
  onValueChange({ value });
@@ -5091,7 +5893,7 @@ var TabsRoot = React29.forwardRef(
5091
5893
  );
5092
5894
  }
5093
5895
  );
5094
- var TabsList = React29.forwardRef(
5896
+ var TabsList = React33.forwardRef(
5095
5897
  function TabsList2(props, ref) {
5096
5898
  const {
5097
5899
  className,
@@ -5145,7 +5947,7 @@ var TRIGGER_VARIANT_CLASSES = {
5145
5947
  segmented: "bg-transparent text-text-primary border-2 border-solid border-selected-control-bg hover:text-hover data-[state=active]:text-selected-control-text data-[state=active]:bg-selected-control-bg data-[state=active]:border-selected-control-bg data-[state=active]:hover:text-selected-control-text",
5146
5948
  unstyled: ""
5147
5949
  };
5148
- var TabsTrigger = React29.forwardRef(
5950
+ var TabsTrigger = React33.forwardRef(
5149
5951
  function TabsTrigger2(props, ref) {
5150
5952
  const {
5151
5953
  className,
@@ -5165,7 +5967,7 @@ var TabsTrigger = React29.forwardRef(
5165
5967
  visibility: _visibility,
5166
5968
  ...rest
5167
5969
  } = props;
5168
- const internalRef = React29.useRef(null);
5970
+ const internalRef = React33.useRef(null);
5169
5971
  const mergedRef = useMergedRef(ref, internalRef);
5170
5972
  const { variant, size, fitted } = useTabsContext(internalRef);
5171
5973
  return /* @__PURE__ */ jsx(
@@ -5185,7 +5987,7 @@ var TabsTrigger = React29.forwardRef(
5185
5987
  );
5186
5988
  }
5187
5989
  );
5188
- var TabsContent = React29.forwardRef(
5990
+ var TabsContent = React33.forwardRef(
5189
5991
  function TabsContent2(props, ref) {
5190
5992
  const { className, padding: _padding, ...rest } = props;
5191
5993
  return /* @__PURE__ */ jsx(
@@ -5219,8 +6021,8 @@ var TabsCounter = ({ count }) => {
5219
6021
  );
5220
6022
  };
5221
6023
  function useTabsContext(triggerRef) {
5222
- const [ctx, setCtx] = React29.useState({ variant: "solid", size: "md", fitted: false });
5223
- React29.useEffect(() => {
6024
+ const [ctx, setCtx] = React33.useState({ variant: "solid", size: "md", fitted: false });
6025
+ React33.useEffect(() => {
5224
6026
  const el = triggerRef.current;
5225
6027
  if (!el) return;
5226
6028
  const root = el.closest("[data-variant]");
@@ -5234,7 +6036,7 @@ function useTabsContext(triggerRef) {
5234
6036
  return ctx;
5235
6037
  }
5236
6038
  function useMergedRef(...refs) {
5237
- return React29.useCallback(
6039
+ return React33.useCallback(
5238
6040
  (instance) => {
5239
6041
  for (const ref of refs) {
5240
6042
  if (!ref) continue;
@@ -5272,7 +6074,7 @@ var TAG_SELECTED_CLASSES = [
5272
6074
  "hover:opacity-76"
5273
6075
  ].join(" ");
5274
6076
  var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
5275
- var Tag = React29.forwardRef(
6077
+ var Tag = React33.forwardRef(
5276
6078
  function Tag2(props, ref) {
5277
6079
  const {
5278
6080
  variant,
@@ -5359,14 +6161,23 @@ var TEXTAREA_VARIANT_CLASSES = {
5359
6161
  filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
5360
6162
  unstyled: "border-0 bg-transparent p-0"
5361
6163
  };
5362
- var Textarea = React29__default.forwardRef(
5363
- ({ size = "md", variant = "outline", className, ...rest }, ref) => {
6164
+ var Textarea = React33__default.forwardRef(
6165
+ ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
6166
+ const handleChange = React33__default.useCallback(
6167
+ (event) => {
6168
+ onChange?.(event);
6169
+ onChangeText?.(event.target.value);
6170
+ },
6171
+ [onChange, onChangeText]
6172
+ );
5364
6173
  return /* @__PURE__ */ jsx(
5365
- "textarea",
6174
+ TextArea,
5366
6175
  {
5367
6176
  ref,
6177
+ unstyled: true,
5368
6178
  className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
5369
- ...rest
6179
+ ...rest,
6180
+ onChange: handleChange
5370
6181
  }
5371
6182
  );
5372
6183
  }
@@ -5495,7 +6306,7 @@ function QuoteCell({ value, highlight, align = "right", onClick, className }) {
5495
6306
  }
5496
6307
  var CALL_HEADERS = ["Bid", "Ask", "Last", "Vol", "OI", "IV", "Delta"];
5497
6308
  var PUT_HEADERS = ["Delta", "IV", "OI", "Vol", "Last", "Ask", "Bid"];
5498
- var OptionChain = React29.forwardRef(
6309
+ var OptionChain = React33.forwardRef(
5499
6310
  function OptionChain2(props, ref) {
5500
6311
  const {
5501
6312
  symbol: _symbol,
@@ -5506,7 +6317,7 @@ var OptionChain = React29.forwardRef(
5506
6317
  className,
5507
6318
  ...rest
5508
6319
  } = props;
5509
- const handleClick = React29.useCallback(
6320
+ const handleClick = React33.useCallback(
5510
6321
  (quote, type, strike) => {
5511
6322
  if (!quote || !onSelectContract) return;
5512
6323
  onSelectContract({
@@ -5612,7 +6423,7 @@ var OptionChain = React29.forwardRef(
5612
6423
  {
5613
6424
  className: cn(
5614
6425
  "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
5615
- isATM ? "text-amber-400 bg-zinc-800/80" : "text-zinc-300"
6426
+ isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
5616
6427
  ),
5617
6428
  children: fmt(row.strike)
5618
6429
  }
@@ -5651,12 +6462,12 @@ var OptionChain = React29.forwardRef(
5651
6462
  }
5652
6463
  );
5653
6464
  var GREEKS = [
5654
- { key: "delta", label: "Delta", symbol: "\u0394", color: "text-blue-400", barColor: "bg-blue-500", decimals: 4, maxMagnitude: 1 },
5655
- { key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-purple-400", barColor: "bg-purple-500", decimals: 4, maxMagnitude: 0.1 },
5656
- { key: "theta", label: "Theta", symbol: "\u0398", color: "text-red-400", barColor: "bg-red-500", decimals: 4, maxMagnitude: 1 },
5657
- { key: "vega", label: "Vega", symbol: "\u03BD", color: "text-emerald-400", barColor: "bg-emerald-500", decimals: 4, maxMagnitude: 1 },
5658
- { key: "rho", label: "Rho", symbol: "\u03C1", color: "text-orange-400", barColor: "bg-orange-500", decimals: 4, maxMagnitude: 1 },
5659
- { key: "iv", label: "IV", symbol: "\u03C3", color: "text-amber-400", barColor: "bg-amber-500", decimals: 1, maxMagnitude: 100 }
6465
+ { key: "delta", label: "Delta", symbol: "\u0394", color: "text-[var(--foreground)]", barColor: "bg-[var(--foreground)]", decimals: 4, maxMagnitude: 1 },
6466
+ { key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-[var(--chart-1)]", barColor: "bg-[var(--chart-1)]", decimals: 4, maxMagnitude: 0.1 },
6467
+ { key: "theta", label: "Theta", symbol: "\u0398", color: "text-[var(--chart-4)]", barColor: "bg-[var(--chart-4)]", decimals: 4, maxMagnitude: 1 },
6468
+ { key: "vega", label: "Vega", symbol: "\u03BD", color: "text-[var(--chart-2)]", barColor: "bg-[var(--chart-2)]", decimals: 4, maxMagnitude: 1 },
6469
+ { key: "rho", label: "Rho", symbol: "\u03C1", color: "text-[var(--chart-3)]", barColor: "bg-[var(--chart-3)]", decimals: 4, maxMagnitude: 1 },
6470
+ { key: "iv", label: "IV", symbol: "\u03C3", color: "text-[var(--chart-5)]", barColor: "bg-[var(--chart-5)]", decimals: 1, maxMagnitude: 100 }
5660
6471
  ];
5661
6472
  function GreekItem({ def, value, compact }) {
5662
6473
  const magnitude = Math.min(Math.abs(value) / def.maxMagnitude, 1);
@@ -5686,7 +6497,7 @@ function GreekItem({ def, value, compact }) {
5686
6497
  }
5687
6498
  );
5688
6499
  }
5689
- var GreeksDisplay = React29.forwardRef(
6500
+ var GreeksDisplay = React33.forwardRef(
5690
6501
  function GreeksDisplay2(props, ref) {
5691
6502
  const {
5692
6503
  delta,
@@ -5863,7 +6674,8 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
5863
6674
  type: "button",
5864
6675
  className: cn(
5865
6676
  "px-2 py-0.5 rounded text-xs font-medium transition-colors",
5866
- leg.type === "call" ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
6677
+ // Call vs put is a rank difference, not a hue difference.
6678
+ leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
5867
6679
  ),
5868
6680
  onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
5869
6681
  children: leg.type === "call" ? "CALL" : "PUT"
@@ -5917,7 +6729,7 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
5917
6729
  )
5918
6730
  ] });
5919
6731
  }
5920
- var StrategyBuilder = React29.forwardRef(
6732
+ var StrategyBuilder = React33.forwardRef(
5921
6733
  function StrategyBuilder2(props, ref) {
5922
6734
  const {
5923
6735
  underlying,
@@ -5929,12 +6741,12 @@ var StrategyBuilder = React29.forwardRef(
5929
6741
  ...rest
5930
6742
  } = props;
5931
6743
  const defaultExp = expirations[0] ?? "";
5932
- const [strategyType, setStrategyType] = React29.useState("bull_call_spread");
5933
- const [legs, setLegs] = React29.useState(() => {
6744
+ const [strategyType, setStrategyType] = React33.useState("bull_call_spread");
6745
+ const [legs, setLegs] = React33.useState(() => {
5934
6746
  const preset = STRATEGY_PRESETS.find((p) => p.value === "bull_call_spread");
5935
6747
  return preset ? preset.buildLegs(strikes, spotPrice, defaultExp) : [];
5936
6748
  });
5937
- const handleStrategyChange = React29.useCallback(
6749
+ const handleStrategyChange = React33.useCallback(
5938
6750
  (e) => {
5939
6751
  const type = e.target.value;
5940
6752
  setStrategyType(type);
@@ -5945,7 +6757,7 @@ var StrategyBuilder = React29.forwardRef(
5945
6757
  },
5946
6758
  [strikes, spotPrice, defaultExp]
5947
6759
  );
5948
- const handleLegChange = React29.useCallback(
6760
+ const handleLegChange = React33.useCallback(
5949
6761
  (index, leg) => {
5950
6762
  setLegs((prev) => {
5951
6763
  const next = [...prev];
@@ -5955,13 +6767,13 @@ var StrategyBuilder = React29.forwardRef(
5955
6767
  },
5956
6768
  []
5957
6769
  );
5958
- const handleLegRemove = React29.useCallback(
6770
+ const handleLegRemove = React33.useCallback(
5959
6771
  (index) => {
5960
6772
  setLegs((prev) => prev.filter((_, i) => i !== index));
5961
6773
  },
5962
6774
  []
5963
6775
  );
5964
- const handleAddLeg = React29.useCallback(() => {
6776
+ const handleAddLeg = React33.useCallback(() => {
5965
6777
  if (legs.length >= 4) return;
5966
6778
  const atm = findATM(strikes, spotPrice);
5967
6779
  setLegs((prev) => [
@@ -5969,14 +6781,14 @@ var StrategyBuilder = React29.forwardRef(
5969
6781
  { action: "buy", type: "call", strike: atm, expiration: defaultExp, quantity: 1 }
5970
6782
  ]);
5971
6783
  }, [legs.length, strikes, spotPrice, defaultExp]);
5972
- const netPremium = React29.useMemo(() => {
6784
+ const netPremium = React33.useMemo(() => {
5973
6785
  return legs.reduce((sum, leg) => {
5974
6786
  if (leg.premium === void 0) return sum;
5975
6787
  const sign = leg.action === "buy" ? -1 : 1;
5976
6788
  return sum + sign * leg.premium * leg.quantity;
5977
6789
  }, 0);
5978
6790
  }, [legs]);
5979
- const handleSubmit = React29.useCallback(() => {
6791
+ const handleSubmit = React33.useCallback(() => {
5980
6792
  if (!onSubmit || legs.length === 0) return;
5981
6793
  onSubmit({
5982
6794
  type: strategyType,
@@ -6096,8 +6908,10 @@ function buildPath(points, vb, width, height) {
6096
6908
  });
6097
6909
  return parts.join(" ");
6098
6910
  }
6099
- var LEG_COLORS = ["#6366f1", "#f59e0b", "#ec4899", "#06b6d4"];
6100
- var PnlDiagram = React29.forwardRef(
6911
+ var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
6912
+ var BREAKEVEN_COLOR = "var(--chart-1)";
6913
+ var BREAKEVEN_RING = "var(--background)";
6914
+ var PnlDiagram = React33.forwardRef(
6101
6915
  function PnlDiagram2(props, ref) {
6102
6916
  const {
6103
6917
  legs,
@@ -6106,10 +6920,10 @@ var PnlDiagram = React29.forwardRef(
6106
6920
  className,
6107
6921
  ...rest
6108
6922
  } = props;
6109
- const containerRef = React29.useRef(null);
6110
- const [hoverX, setHoverX] = React29.useState(null);
6111
- const [dims, setDims] = React29.useState({ width: 600, height: 240 });
6112
- React29.useEffect(() => {
6923
+ const containerRef = React33.useRef(null);
6924
+ const [hoverX, setHoverX] = React33.useState(null);
6925
+ const [dims, setDims] = React33.useState({ width: 600, height: 240 });
6926
+ React33.useEffect(() => {
6113
6927
  const el = containerRef.current;
6114
6928
  if (!el) return;
6115
6929
  const observer = new ResizeObserver((entries) => {
@@ -6132,7 +6946,7 @@ var PnlDiagram = React29.forwardRef(
6132
6946
  const xMax = maxStrike + range * 0.3;
6133
6947
  const SAMPLES = 200;
6134
6948
  const step = (xMax - xMin) / SAMPLES;
6135
- const combinedPoints = React29.useMemo(() => {
6949
+ const combinedPoints = React33.useMemo(() => {
6136
6950
  const pts = [];
6137
6951
  for (let i = 0; i <= SAMPLES; i++) {
6138
6952
  const price = xMin + i * step;
@@ -6140,7 +6954,7 @@ var PnlDiagram = React29.forwardRef(
6140
6954
  }
6141
6955
  return pts;
6142
6956
  }, [legs, multiplier, xMin, step]);
6143
- const legPointSets = React29.useMemo(() => {
6957
+ const legPointSets = React33.useMemo(() => {
6144
6958
  return legs.map((leg) => {
6145
6959
  const pts = [];
6146
6960
  for (let i = 0; i <= SAMPLES; i++) {
@@ -6161,7 +6975,7 @@ var PnlDiagram = React29.forwardRef(
6161
6975
  const chartH = height - PADDING.top - PADDING.bottom;
6162
6976
  const scaleX = (x) => PADDING.left + (x - vb.xMin) / (vb.xMax - vb.xMin) * chartW;
6163
6977
  const scaleY = (y) => PADDING.top + chartH - (y - vb.yMin) / (vb.yMax - vb.yMin) * chartH;
6164
- const breakevens = React29.useMemo(() => {
6978
+ const breakevens = React33.useMemo(() => {
6165
6979
  const pts = [];
6166
6980
  for (let i = 1; i < combinedPoints.length; i++) {
6167
6981
  const prev = combinedPoints[i - 1];
@@ -6178,7 +6992,7 @@ var PnlDiagram = React29.forwardRef(
6178
6992
  const maxGainPoint = combinedPoints.find((p) => p.y === maxGain);
6179
6993
  const maxLossPoint = combinedPoints.find((p) => p.y === maxLoss);
6180
6994
  const zeroY = scaleY(0);
6181
- const handleMouseMove = React29.useCallback(
6995
+ const handleMouseMove = React33.useCallback(
6182
6996
  (e) => {
6183
6997
  const rect = e.currentTarget.getBoundingClientRect();
6184
6998
  const mouseX = e.clientX - rect.left;
@@ -6191,7 +7005,7 @@ var PnlDiagram = React29.forwardRef(
6191
7005
  },
6192
7006
  [vb.xMin, vb.xMax, chartW]
6193
7007
  );
6194
- const handleMouseLeave = React29.useCallback(() => setHoverX(null), []);
7008
+ const handleMouseLeave = React33.useCallback(() => setHoverX(null), []);
6195
7009
  const hoverPnl = hoverX !== null ? calcTotalPnl(legs, hoverX, multiplier) : null;
6196
7010
  buildPath(
6197
7011
  combinedPoints.map((p) => ({ x: scaleX(p.x), y: scaleY(p.y) })).map((p) => ({ x: p.x - PADDING.left, y: p.y - PADDING.top })),
@@ -6338,13 +7152,13 @@ var PnlDiagram = React29.forwardRef(
6338
7152
  }
6339
7153
  ),
6340
7154
  breakevens.map((be, i) => /* @__PURE__ */ jsxs("g", { children: [
6341
- /* @__PURE__ */ jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: "#fbbf24", stroke: "#18181b", strokeWidth: "1" }),
7155
+ /* @__PURE__ */ jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: BREAKEVEN_COLOR, stroke: BREAKEVEN_RING, strokeWidth: "1" }),
6342
7156
  /* @__PURE__ */ jsx(
6343
7157
  "text",
6344
7158
  {
6345
7159
  x: scaleX(be),
6346
7160
  y: PADDING.top + chartH + 14,
6347
- fill: "#fbbf24",
7161
+ fill: BREAKEVEN_COLOR,
6348
7162
  fontSize: "8",
6349
7163
  fontFamily: "monospace",
6350
7164
  textAnchor: "middle",
@@ -6385,7 +7199,7 @@ var PnlDiagram = React29.forwardRef(
6385
7199
  cy: scaleY(hoverPnl),
6386
7200
  r: "3",
6387
7201
  fill: hoverPnl >= 0 ? "#22c55e" : "#ef4444",
6388
- stroke: "#18181b",
7202
+ stroke: BREAKEVEN_RING,
6389
7203
  strokeWidth: "1"
6390
7204
  }
6391
7205
  ),
@@ -6397,7 +7211,7 @@ var PnlDiagram = React29.forwardRef(
6397
7211
  width: "90",
6398
7212
  height: "28",
6399
7213
  rx: "3",
6400
- fill: "#18181b",
7214
+ fill: BREAKEVEN_RING,
6401
7215
  stroke: "#3f3f46",
6402
7216
  strokeWidth: "1"
6403
7217
  }
@@ -6479,7 +7293,7 @@ var PnlDiagram = React29.forwardRef(
6479
7293
  ] })
6480
7294
  ] }, i)),
6481
7295
  breakevens.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
6482
- /* @__PURE__ */ jsx("div", { className: "h-1.5 w-1.5 rounded-full bg-amber-400" }),
7296
+ /* @__PURE__ */ jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
6483
7297
  /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-zinc-500", children: [
6484
7298
  "BE: ",
6485
7299
  breakevens.map((b) => b.toFixed(1)).join(", ")
@@ -6495,7 +7309,7 @@ function formatDate(date) {
6495
7309
  const d = new Date(date);
6496
7310
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
6497
7311
  }
6498
- var OptionPositionCard = React29.forwardRef(
7312
+ var OptionPositionCard = React33.forwardRef(
6499
7313
  function OptionPositionCard2(props, ref) {
6500
7314
  const {
6501
7315
  position,
@@ -6521,7 +7335,8 @@ var OptionPositionCard = React29.forwardRef(
6521
7335
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
6522
7336
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs("span", { className: cn(
6523
7337
  "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
6524
- isCall ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
7338
+ // Call vs put is a rank difference, not a hue difference.
7339
+ isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
6525
7340
  ), children: [
6526
7341
  position.underlying,
6527
7342
  /* @__PURE__ */ jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
@@ -6647,8 +7462,9 @@ function ExpirationPill({ exp, isSelected, onClick }) {
6647
7462
  /* @__PURE__ */ jsx("span", { className: "font-medium whitespace-nowrap", children: formatExpDate(exp.date) }),
6648
7463
  /* @__PURE__ */ jsxs("span", { className: cn(
6649
7464
  "font-mono tabular-nums text-[10px]",
6650
- isSelected ? "text-blue-400/70" : "text-zinc-600",
6651
- exp.dte <= 7 && !isSelected && "text-amber-600"
7465
+ isSelected ? "text-[var(--foreground)]" : "text-[var(--muted-foreground)]",
7466
+ // Near expiry is a notice, and a notice in Lux is the loudest neutral.
7467
+ exp.dte <= 7 && !isSelected && "text-[var(--color-status-warn)]"
6652
7468
  ), children: [
6653
7469
  exp.dte,
6654
7470
  "d"
@@ -6657,7 +7473,7 @@ function ExpirationPill({ exp, isSelected, onClick }) {
6657
7473
  }
6658
7474
  );
6659
7475
  }
6660
- var ExpirationSelector = React29.forwardRef(
7476
+ var ExpirationSelector = React33.forwardRef(
6661
7477
  function ExpirationSelector2(props, ref) {
6662
7478
  const {
6663
7479
  expirations,
@@ -6667,8 +7483,8 @@ var ExpirationSelector = React29.forwardRef(
6667
7483
  className,
6668
7484
  ...rest
6669
7485
  } = props;
6670
- const scrollRef = React29.useRef(null);
6671
- React29.useEffect(() => {
7486
+ const scrollRef = React33.useRef(null);
7487
+ React33.useEffect(() => {
6672
7488
  const container = scrollRef.current;
6673
7489
  if (!container) return;
6674
7490
  const selectedEl = container.querySelector('[data-selected="true"]');
@@ -6980,4 +7796,4 @@ var BankPage = styled(View, {
6980
7796
  padding: 16
6981
7797
  });
6982
7798
 
6983
- export { AccordionItem, AccordionItemContent, AccordionItemTrigger, AccordionRoot, Alert, AppProvider, Avatar, AvatarGroup, Badge, BankAlert, BankAlertText, BankButton, BankButtonText, BankCard, BankDivider, BankField, BankHeading, BankInput, BankPage, BankPinBox, BankText, Button, ButtonGroup, ButtonGroupRadio, Checkbox2 as Checkbox, CheckboxGroup2 as CheckboxGroup, CloseButton, CollapsibleDetails, CollapsibleList, ColorModeProvider, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, DrawerActionTrigger, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerRoot, DrawerTitle, DrawerTrigger, EmptyState, ExpirationSelector, Field, GreeksDisplay, Heading, IconButton, Image2 as Image, Input, InputGroup, Link, LinkBox, LinkExternalIcon, LinkOverlay, MenuArrow, MenuCheckboxItem, MenuContent, MenuItem, MenuItemGroup, MenuItemText, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuSeparator, MenuTrigger, MenuTriggerItem, OptionChain, OptionPositionCard, PinInput, PnlDiagram, PopoverArrow, PopoverBody, PopoverCloseTrigger, PopoverCloseTriggerWrapper, PopoverContent, PopoverDescription, PopoverFooter, PopoverHeader, PopoverRoot, PopoverTitle, PopoverTrigger, Progress, ProgressCircleRing, ProgressCircleRoot, ProgressCircleValueText, Radio2 as Radio, RadioGroup3 as RadioGroup, Rating, Select, SelectAsync, SelectClearTrigger, SelectContent, SelectControl, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectValueText, Separator2 as Separator, Skeleton, SkeletonCircle, SkeletonText, Slider, StrategyBuilder, Switch2 as Switch, TableBody, TableCaption, TableCell, TableColumnHeader, TableColumnHeaderSortable, TableFooter, TableHeader, TableHeaderSticky, TableRoot, TableRow, TableScrollWrapper, TabsContent, TabsCounter, TabsList, TabsRoot, TabsTrigger, Tag, Textarea, Toaster, Tooltip, bankColors, buttonVariants, cn, createListCollection, toaster, useAccordion, useColorMode, useColorModeValue };
7799
+ export { AccordionItem, AccordionItemContent, AccordionItemTrigger, AccordionRoot, Alert, AppNav, AppProvider, Avatar, AvatarGroup, Badge, BankAlert, BankAlertText, BankButton, BankButtonText, BankCard, BankDivider, BankField, BankHeading, BankInput, BankPage, BankPinBox, BankText, Button, ButtonGroup, ButtonGroupRadio, Checkbox2 as Checkbox, CheckboxGroup2 as CheckboxGroup, CloseButton, CollapsibleDetails, CollapsibleList, ColorModeProvider, DEFAULT_ORG, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, DrawerActionTrigger, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerRoot, DrawerTitle, DrawerTrigger, EmptyState, ExpirationSelector, Field, GreeksDisplay, Heading, IAM_PAGE_SIZE, IamError, IconButton, IdentityProvider, Image, Input, InputGroup, LUX_BRAND, Link, LinkBox, LinkExternalIcon, LinkOverlay, MenuArrow, MenuCheckboxItem, MenuContent, MenuItem, MenuItemGroup, MenuItemText, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuSeparator, MenuTrigger, MenuTriggerItem, NARROW_PX, OptionChain, OptionPositionCard, OrgSwitcher, PARS_GOLD, PinInput, PnlDiagram, PopoverArrow, PopoverBody, PopoverCloseTrigger, PopoverCloseTriggerWrapper, PopoverContent, PopoverDescription, PopoverFooter, PopoverHeader, PopoverRoot, PopoverTitle, PopoverTrigger, Progress, ProgressCircleRing, ProgressCircleRoot, ProgressCircleValueText, ProjectSwitcher, Radio2 as Radio, RadioGroup3 as RadioGroup, Rating, Select, SelectAsync, SelectClearTrigger, SelectContent, SelectControl, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectValueText, Separator2 as Separator, SettingsMenu, Skeleton, SkeletonCircle, SkeletonText, Slider, StrategyBuilder, Switch2 as Switch, Switcher, TOUCH_PX, TableBody, TableCaption, TableCell, TableColumnHeader, TableColumnHeaderSortable, TableFooter, TableHeader, TableHeaderSticky, TableRoot, TableRow, TableScrollWrapper, TabsContent, TabsCounter, TabsList, TabsRoot, TabsTrigger, Tag, Textarea, Toaster, Tooltip, UserMenu, bankColors, buttonVariants, cn, config, createListCollection, currentHost, lux_config_default as guiConfig, iam, iamBase, initials, luxThemes, orgIdentity, ORGS as orgs, resolveWhiteLabel, toaster, useAccordion, useBelow, useColorMode, useColorModeValue, useIdentity, useIsNarrow, useIsTouch, useWhiteLabel };