@luxfi/ui 7.4.0 → 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 (130) hide show
  1. package/dist/avatar.cjs +7 -6
  2. package/dist/avatar.js +7 -5
  3. package/dist/badge.cjs +30 -32
  4. package/dist/badge.js +30 -32
  5. package/dist/bank.d.cts +3 -3
  6. package/dist/bank.d.ts +3 -3
  7. package/dist/checkbox.cjs +4 -4
  8. package/dist/checkbox.d.cts +3 -2
  9. package/dist/checkbox.d.ts +3 -2
  10. package/dist/checkbox.js +5 -4
  11. package/dist/chrome.cjs +950 -0
  12. package/dist/chrome.d.cts +93 -0
  13. package/dist/chrome.d.ts +93 -0
  14. package/dist/chrome.js +921 -0
  15. package/dist/drawer.cjs +86 -20
  16. package/dist/drawer.js +85 -19
  17. package/dist/expiration-selector.cjs +3 -2
  18. package/dist/expiration-selector.js +3 -2
  19. package/dist/greeks-display.cjs +6 -6
  20. package/dist/greeks-display.js +6 -6
  21. package/dist/gui.cjs +13 -0
  22. package/dist/gui.d.cts +2 -0
  23. package/dist/gui.d.ts +2 -0
  24. package/dist/gui.js +2 -0
  25. package/dist/heading.cjs +4 -2
  26. package/dist/heading.js +4 -2
  27. package/dist/iam.cjs +206 -0
  28. package/dist/iam.d.cts +65 -0
  29. package/dist/iam.d.ts +65 -0
  30. package/dist/iam.js +201 -0
  31. package/dist/icons.cjs +13 -0
  32. package/dist/icons.d.cts +1 -0
  33. package/dist/icons.d.ts +1 -0
  34. package/dist/icons.js +2 -0
  35. package/dist/identity.cjs +420 -0
  36. package/dist/identity.d.cts +64 -0
  37. package/dist/identity.d.ts +64 -0
  38. package/dist/identity.js +398 -0
  39. package/dist/index.cjs +1597 -833
  40. package/dist/index.d.cts +7 -3
  41. package/dist/index.d.ts +7 -3
  42. package/dist/index.js +1574 -828
  43. package/dist/input.cjs +3 -1
  44. package/dist/input.d.cts +3 -5
  45. package/dist/input.d.ts +3 -5
  46. package/dist/input.js +3 -1
  47. package/dist/lux.config.cjs +23 -2
  48. package/dist/lux.config.d.cts +28 -10
  49. package/dist/lux.config.d.ts +28 -10
  50. package/dist/lux.config.js +23 -2
  51. package/dist/menu.cjs +4 -4
  52. package/dist/menu.js +4 -4
  53. package/dist/next.cjs +99 -0
  54. package/dist/next.d.cts +29 -0
  55. package/dist/next.d.ts +29 -0
  56. package/dist/next.js +96 -0
  57. package/dist/option-chain.cjs +1 -1
  58. package/dist/option-chain.js +1 -1
  59. package/dist/option-position.cjs +2 -1
  60. package/dist/option-position.js +2 -1
  61. package/dist/pnl-diagram.cjs +8 -6
  62. package/dist/pnl-diagram.js +8 -6
  63. package/dist/progress.cjs +7 -6
  64. package/dist/progress.js +7 -5
  65. package/dist/provider.cjs +136 -4
  66. package/dist/provider.d.cts +15 -3
  67. package/dist/provider.d.ts +15 -3
  68. package/dist/provider.js +136 -5
  69. package/dist/radio.cjs +9 -7
  70. package/dist/radio.js +10 -7
  71. package/dist/separator.cjs +3 -1
  72. package/dist/separator.js +3 -1
  73. package/dist/slider.cjs +28 -16
  74. package/dist/slider.js +28 -15
  75. package/dist/strategy-builder.cjs +2 -1
  76. package/dist/strategy-builder.js +2 -1
  77. package/dist/switch.cjs +11 -12
  78. package/dist/switch.js +12 -12
  79. package/dist/tag.cjs +31 -33
  80. package/dist/tag.js +30 -32
  81. package/dist/textarea.cjs +3 -1
  82. package/dist/textarea.js +3 -1
  83. package/dist/tooltip.cjs +25 -27
  84. package/dist/tooltip.js +24 -26
  85. package/dist/use-narrow.cjs +46 -0
  86. package/dist/use-narrow.d.cts +12 -0
  87. package/dist/use-narrow.d.ts +12 -0
  88. package/dist/use-narrow.js +20 -0
  89. package/dist/vite.cjs +40 -0
  90. package/dist/vite.d.cts +29 -0
  91. package/dist/vite.d.ts +29 -0
  92. package/dist/vite.js +38 -0
  93. package/dist/white-label.cjs +132 -0
  94. package/dist/white-label.d.cts +59 -0
  95. package/dist/white-label.d.ts +59 -0
  96. package/dist/white-label.js +124 -0
  97. package/package.json +85 -19
  98. package/src/avatar.tsx +22 -16
  99. package/src/checkbox.tsx +15 -10
  100. package/src/chrome.tsx +459 -0
  101. package/src/drawer.tsx +83 -10
  102. package/src/expiration-selector.tsx +3 -2
  103. package/src/greeks-display.tsx +9 -6
  104. package/src/gui.ts +17 -0
  105. package/src/heading.tsx +12 -8
  106. package/src/iam.ts +170 -0
  107. package/src/icons.ts +18 -0
  108. package/src/identity.tsx +318 -0
  109. package/src/index.ts +44 -1
  110. package/src/input.tsx +13 -9
  111. package/src/lux.config.ts +16 -15
  112. package/src/menu.tsx +4 -4
  113. package/src/next.ts +142 -0
  114. package/src/option-chain.tsx +1 -1
  115. package/src/option-position.tsx +2 -1
  116. package/src/pnl-diagram.tsx +11 -6
  117. package/src/progress.tsx +15 -8
  118. package/src/provider.tsx +48 -7
  119. package/src/radio.tsx +15 -11
  120. package/src/separator.tsx +8 -3
  121. package/src/slider.tsx +35 -19
  122. package/src/strategy-builder.tsx +3 -2
  123. package/src/switch.tsx +17 -16
  124. package/src/textarea.tsx +8 -4
  125. package/src/tooltip.tsx +2 -21
  126. package/src/use-narrow.ts +40 -0
  127. package/src/vite.ts +78 -0
  128. package/src/white-label.ts +240 -0
  129. package/tokens.css +544 -319
  130. package/src/tokens.css +0 -438
package/dist/index.cjs CHANGED
@@ -3,26 +3,21 @@
3
3
 
4
4
  var gui = require('@hanzo/gui');
5
5
  var reactQuery = require('@tanstack/react-query');
6
- var React30 = require('react');
6
+ var React33 = require('react');
7
7
  var v5 = require('@hanzogui/config/v5');
8
+ var v5Css = require('@hanzogui/config/v5-css');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
10
  var clsx = require('clsx');
10
11
  var tailwindMerge = require('tailwind-merge');
12
+ var lucideReact = require('lucide-react');
13
+ var RadixDialog = require('@radix-ui/react-dialog');
14
+ var DropdownMenu = require('@radix-ui/react-dropdown-menu');
11
15
  var AccordionPrimitive = require('@radix-ui/react-accordion');
12
- var RadixAvatar = require('@radix-ui/react-avatar');
13
16
  var usehooks = require('@uidotdev/usehooks');
14
- var RadixCheckbox = require('@radix-ui/react-checkbox');
15
17
  var Collapsible = require('@radix-ui/react-collapsible');
16
- var RadixDialog = require('@radix-ui/react-dialog');
17
18
  var LabelPrimitive = require('@radix-ui/react-label');
18
19
  var esToolkit = require('es-toolkit');
19
- var DropdownMenu = require('@radix-ui/react-dropdown-menu');
20
- var lu = require('react-icons/lu');
21
- var RadixProgress = require('@radix-ui/react-progress');
22
- var RadixRadioGroup = require('@radix-ui/react-radio-group');
23
20
  var RadixSelect = require('@radix-ui/react-select');
24
- var RadixSlider = require('@radix-ui/react-slider');
25
- var RadixSwitch = require('@radix-ui/react-switch');
26
21
  var RadixTabs = require('@radix-ui/react-tabs');
27
22
  var sonner = require('sonner');
28
23
 
@@ -44,29 +39,141 @@ function _interopNamespace(e) {
44
39
  return Object.freeze(n);
45
40
  }
46
41
 
47
- var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
42
+ var React33__namespace = /*#__PURE__*/_interopNamespace(React33);
43
+ var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
44
+ var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
48
45
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
49
- var RadixAvatar__namespace = /*#__PURE__*/_interopNamespace(RadixAvatar);
50
- var RadixCheckbox__namespace = /*#__PURE__*/_interopNamespace(RadixCheckbox);
51
46
  var Collapsible__namespace = /*#__PURE__*/_interopNamespace(Collapsible);
52
- var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
53
47
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
54
- var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
55
- var RadixProgress__namespace = /*#__PURE__*/_interopNamespace(RadixProgress);
56
- var RadixRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RadixRadioGroup);
57
48
  var RadixSelect__namespace = /*#__PURE__*/_interopNamespace(RadixSelect);
58
- var RadixSlider__namespace = /*#__PURE__*/_interopNamespace(RadixSlider);
59
- var RadixSwitch__namespace = /*#__PURE__*/_interopNamespace(RadixSwitch);
60
49
  var RadixTabs__namespace = /*#__PURE__*/_interopNamespace(RadixTabs);
61
50
 
62
51
  // src/provider.tsx
52
+
53
+ // src/white-label.ts
63
54
  var LUX_BRAND = {
64
55
  lux: "#7000FF",
65
56
  zoo: "#6C5EFB",
66
57
  hanzo: "#EA580C",
67
- pars: "#1C3879"
58
+ pars: "#1C3879",
59
+ // bootno.de is its own white label with its own IdP (id.bootno.de) — accent
60
+ // taken from the bootnode console's own brand default, not invented here.
61
+ bootnode: "#3B82F6"
68
62
  };
69
63
  var PARS_GOLD = "#C8A45C";
64
+ var ORGS = {
65
+ lux: {
66
+ org: "lux",
67
+ name: "Lux",
68
+ domain: "lux.network",
69
+ iamDomain: "lux.id",
70
+ accent: LUX_BRAND.lux,
71
+ accentForeground: "#FFFFFF"
72
+ },
73
+ zoo: {
74
+ org: "zoo",
75
+ name: "Zoo",
76
+ domain: "zoo.ngo",
77
+ // Zoo's IdP is `id.zoo.network`, not a `zoo.id` apex — the one row in this
78
+ // table where the issuer is not `<org>.id`, and the one every hand-rolled
79
+ // per-app branding map got wrong.
80
+ iamDomain: "id.zoo.network",
81
+ accent: LUX_BRAND.zoo,
82
+ accentForeground: "#FFFFFF"
83
+ },
84
+ bootnode: {
85
+ org: "bootnode",
86
+ name: "Bootnode",
87
+ domain: "bootno.de",
88
+ iamDomain: "id.bootno.de",
89
+ accent: LUX_BRAND.lux,
90
+ accentForeground: "#FFFFFF"
91
+ },
92
+ hanzo: {
93
+ org: "hanzo",
94
+ name: "Hanzo",
95
+ domain: "hanzo.ai",
96
+ iamDomain: "hanzo.id",
97
+ accent: LUX_BRAND.hanzo,
98
+ accentForeground: "#FFFFFF"
99
+ },
100
+ pars: {
101
+ org: "pars",
102
+ name: "Pars",
103
+ domain: "pars.id",
104
+ iamDomain: "pars.id",
105
+ accent: LUX_BRAND.pars,
106
+ accentForeground: PARS_GOLD
107
+ }
108
+ };
109
+ var DOMAIN_ORG = [
110
+ ["lux.network", "lux"],
111
+ ["lux.cloud", "lux"],
112
+ ["lux.id", "lux"],
113
+ ["lux.finance", "lux"],
114
+ ["zoo.ngo", "zoo"],
115
+ ["zoo.network", "zoo"],
116
+ ["zoo.cloud", "zoo"],
117
+ ["zoo.id", "zoo"],
118
+ ["hanzo.ai", "hanzo"],
119
+ ["hanzo.cloud", "hanzo"],
120
+ ["hanzo.id", "hanzo"],
121
+ ["pars.id", "pars"],
122
+ ["parsdao.org", "pars"],
123
+ ["bootno.de", "bootnode", "platform"]
124
+ ];
125
+ var DEFAULT_ORG = "lux";
126
+ function normalizeHost(host) {
127
+ const noPort = host.trim().toLowerCase().split(":")[0] ?? "";
128
+ return noPort.replace(/\.$/, "");
129
+ }
130
+ function isUnder(host, domain) {
131
+ return host === domain || host.endsWith(`.${domain}`);
132
+ }
133
+ function matchDomain(host) {
134
+ let best;
135
+ for (const entry of DOMAIN_ORG) {
136
+ if (isUnder(host, entry[0]) && (!best || entry[0].length > best[0].length)) {
137
+ best = entry;
138
+ }
139
+ }
140
+ return best;
141
+ }
142
+ function appSlug(host, domain, apexApp) {
143
+ const sub = host === domain ? "" : host.slice(0, -(domain.length + 1));
144
+ const leftmost = sub.split(".")[0] ?? "";
145
+ if (leftmost && leftmost !== "www") return leftmost;
146
+ if (apexApp) return apexApp;
147
+ const label = domain.split(".")[0] ?? "";
148
+ const tld = domain.split(".").slice(1).join(".");
149
+ return tld.split(".")[0] || label;
150
+ }
151
+ function isLocal(host) {
152
+ return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "0.0.0.0" || host === "[::1]" || host.endsWith(".local");
153
+ }
154
+ function resolveWhiteLabel(host) {
155
+ const h = normalizeHost(host ?? "");
156
+ const match = h ? matchDomain(h) : void 0;
157
+ const org = match ? match[1] : DEFAULT_ORG;
158
+ const identity = ORGS[org];
159
+ const app = match ? appSlug(h, match[0], match[2]) : h && isLocal(h) ? "local" : "app";
160
+ return {
161
+ ...identity,
162
+ host: h,
163
+ app,
164
+ theme: `dark_${org}`,
165
+ issuer: `https://${identity.iamDomain}`,
166
+ clientId: `${org}-${app}`
167
+ };
168
+ }
169
+ function currentHost() {
170
+ return typeof window === "undefined" ? "" : window.location.host;
171
+ }
172
+ function orgIdentity(org) {
173
+ return ORGS[org];
174
+ }
175
+
176
+ // src/lux.config.ts
70
177
  var TRUE_BLACK = "#000000";
71
178
  var darkBase = {
72
179
  ...v5.defaultConfig.themes.dark,
@@ -88,48 +195,1107 @@ var luxThemes = {
88
195
  dark_lux: brandTheme(LUX_BRAND.lux),
89
196
  dark_zoo: brandTheme(LUX_BRAND.zoo),
90
197
  dark_hanzo: brandTheme(LUX_BRAND.hanzo),
91
- dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD })
198
+ dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD }),
199
+ dark_bootnode: brandTheme(LUX_BRAND.bootnode)
200
+ };
201
+ var config = gui.createGui({
202
+ ...v5.defaultConfig,
203
+ animations: v5Css.animations,
204
+ settings: {
205
+ ...v5.defaultConfig.settings,
206
+ onlyAllowShorthands: false
207
+ },
208
+ themes: {
209
+ ...v5.defaultConfig.themes,
210
+ ...luxThemes
211
+ }
212
+ });
213
+ var lux_config_default = config;
214
+ var defaultQueryClient = new reactQuery.QueryClient({
215
+ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
216
+ });
217
+ var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
218
+ var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
219
+ var useFontBodyReset = () => {
220
+ React33__namespace.default.useInsertionEffect(() => {
221
+ if (typeof document === "undefined") return;
222
+ if (document.getElementById(FONT_BODY_RESET_ID)) return;
223
+ const style = document.createElement("style");
224
+ style.id = FONT_BODY_RESET_ID;
225
+ style.textContent = FONT_BODY_RESET_CSS;
226
+ document.head.appendChild(style);
227
+ }, []);
228
+ };
229
+ var WhiteLabelContext = React33__namespace.default.createContext(resolveWhiteLabel(""));
230
+ var useWhiteLabel = () => React33__namespace.default.useContext(WhiteLabelContext);
231
+ var useHostWhiteLabel = (host) => {
232
+ const [resolvedHost, setResolvedHost] = React33__namespace.default.useState(host ?? "");
233
+ React33__namespace.default.useEffect(() => {
234
+ if (host !== void 0) return;
235
+ const browserHost = currentHost();
236
+ if (browserHost) setResolvedHost(browserHost);
237
+ }, [host]);
238
+ return React33__namespace.default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
239
+ };
240
+ var AppProvider = ({
241
+ children,
242
+ queryClient,
243
+ host,
244
+ defaultTheme
245
+ }) => {
246
+ useFontBodyReset();
247
+ const whiteLabel = useHostWhiteLabel(host);
248
+ const theme = defaultTheme ?? whiteLabel.theme;
249
+ return /* @__PURE__ */ jsxRuntime.jsx(WhiteLabelContext.Provider, { value: whiteLabel, children: /* @__PURE__ */ jsxRuntime.jsx(gui.GuiProvider, { config: lux_config_default, defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children }) }) });
250
+ };
251
+ function cn(...inputs) {
252
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
253
+ }
254
+ var NARROW_PX = 640;
255
+ var TOUCH_PX = 1024;
256
+ function useBelow(px) {
257
+ const [below, setBelow] = React33__namespace.useState(false);
258
+ React33__namespace.useEffect(() => {
259
+ const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
260
+ const apply = () => setBelow(mql.matches);
261
+ apply();
262
+ mql.addEventListener("change", apply);
263
+ return () => mql.removeEventListener("change", apply);
264
+ }, [px]);
265
+ return below;
266
+ }
267
+ var useIsNarrow = () => useBelow(NARROW_PX);
268
+ var useIsTouch = () => useBelow(TOUCH_PX);
269
+
270
+ // src/iam.ts
271
+ var IamError = class extends Error {
272
+ constructor(message, status, unauthenticated) {
273
+ super(message);
274
+ this.name = "IamError";
275
+ this.status = status;
276
+ this.unauthenticated = unauthenticated;
277
+ }
278
+ };
279
+ var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
280
+ function isSignedOut(status, msg) {
281
+ return status === 401 || status === 403 || SIGNED_OUT.test(msg);
282
+ }
283
+ function iamBase(host) {
284
+ const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
285
+ return `${wl.issuer}/v1/iam`;
286
+ }
287
+ async function read(call, verb, params) {
288
+ const url = new URL(`${call.base}/${verb}`);
289
+ for (const [k, v] of Object.entries(params)) url.searchParams.set(k, String(v));
290
+ let res;
291
+ try {
292
+ res = await fetch(url.toString(), {
293
+ method: "GET",
294
+ // The bearer is the whole credential. IAM does not allow credentialed
295
+ // CORS, so sending cookies would only get the response blocked.
296
+ headers: call.token ? { Authorization: `Bearer ${call.token}` } : {},
297
+ signal: call.signal
298
+ });
299
+ } catch (e) {
300
+ throw new IamError(e instanceof Error ? e.message : "IAM unreachable", 0, false);
301
+ }
302
+ const body = await res.json().catch(() => ({}));
303
+ const msg = typeof body.msg === "string" ? body.msg : "";
304
+ if (!res.ok || body.status === "error") {
305
+ throw new IamError(msg || `IAM ${verb} failed (${res.status})`, res.status, isSignedOut(res.status, msg));
306
+ }
307
+ return body.data;
308
+ }
309
+ var IAM_PAGE_SIZE = 20;
310
+ var iam = {
311
+ /** The signed-in principal, or null when there is no session. */
312
+ async account(call) {
313
+ try {
314
+ const data = await read(call, "get-account", {});
315
+ return data && data.name ? data : null;
316
+ } catch (e) {
317
+ if (e instanceof IamError && e.unauthenticated) return null;
318
+ throw e;
319
+ }
320
+ },
321
+ /**
322
+ * One page of the orgs the principal can see. IAM scopes the read to the
323
+ * caller's authority, so a normal member gets their own org and a super
324
+ * admin gets the tenant list — the page never has to decide.
325
+ */
326
+ async organizations(call, page = 0, query = "", pageSize = IAM_PAGE_SIZE) {
327
+ const params = {
328
+ owner: "admin",
329
+ // IAM orgs live under the reserved `admin` owner
330
+ p: page + 1,
331
+ // the backend page is 1-based
332
+ pageSize,
333
+ sortField: "name",
334
+ sortOrder: "ascending"
335
+ };
336
+ const q = query.trim();
337
+ if (q) {
338
+ params.field = "name";
339
+ params.value = q;
340
+ }
341
+ return await read(call, "get-organizations", params) ?? [];
342
+ },
343
+ /** One organization by name. */
344
+ async organization(call, name) {
345
+ return await read(call, "get-organization", { id: `admin/${name}` }) ?? null;
346
+ },
347
+ /** Members of an organization. */
348
+ async users(call, org) {
349
+ return await read(call, "get-users", { owner: org }) ?? [];
350
+ },
351
+ /** The organization's projects — IAM keys this read by `organization`. */
352
+ async projects(call, org) {
353
+ return await read(call, "get-organization-projects", { organization: org }) ?? [];
354
+ }
355
+ };
356
+ var IAM_TOKEN_KEY = "hanzo_iam_access_token";
357
+ function storedToken() {
358
+ if (typeof window === "undefined") return null;
359
+ for (const store of [window.sessionStorage, window.localStorage]) {
360
+ try {
361
+ const t = store.getItem(IAM_TOKEN_KEY);
362
+ if (t) return t;
363
+ } catch {
364
+ }
365
+ }
366
+ return null;
367
+ }
368
+ function clearStoredTokens() {
369
+ if (typeof window === "undefined") return;
370
+ for (const store of [window.sessionStorage, window.localStorage]) {
371
+ try {
372
+ for (const k of ["access_token", "refresh_token", "id_token", "expires_at"]) {
373
+ store.removeItem(`hanzo_iam_${k}`);
374
+ }
375
+ } catch {
376
+ }
377
+ }
378
+ }
379
+ var defaultAuth = {};
380
+ var scopeKey = (host, kind) => `lux-ui:${kind}:${host}`;
381
+ function readScope(host, kind) {
382
+ if (typeof window === "undefined") return null;
383
+ try {
384
+ return window.localStorage.getItem(scopeKey(host, kind));
385
+ } catch {
386
+ return null;
387
+ }
388
+ }
389
+ function writeScope(host, kind, value) {
390
+ if (typeof window === "undefined") return;
391
+ try {
392
+ window.localStorage.setItem(scopeKey(host, kind), value);
393
+ } catch {
394
+ }
395
+ }
396
+ var IdentityContext = React33__namespace.createContext(null);
397
+ var IdentityProvider = ({
398
+ children,
399
+ auth = defaultAuth,
400
+ loginPath = "/login"
401
+ }) => {
402
+ const whiteLabel = useWhiteLabel();
403
+ const base = React33__namespace.useMemo(() => iamBase(whiteLabel), [whiteLabel]);
404
+ const [status, setStatus] = React33__namespace.useState("loading");
405
+ const [account, setAccount] = React33__namespace.useState(null);
406
+ const [orgs, setOrgs] = React33__namespace.useState([]);
407
+ const [projects, setProjects] = React33__namespace.useState([]);
408
+ const [error, setError] = React33__namespace.useState(null);
409
+ const [orgName, setOrgName] = React33__namespace.useState(null);
410
+ const [projectName, setProjectName] = React33__namespace.useState(null);
411
+ const [epoch, setEpoch] = React33__namespace.useState(0);
412
+ React33__namespace.useEffect(() => {
413
+ const ac = new AbortController();
414
+ let live = true;
415
+ void (async () => {
416
+ const token = await (auth.token ?? storedToken)();
417
+ if (!live) return;
418
+ if (!token) {
419
+ setStatus("anonymous");
420
+ setAccount(null);
421
+ setOrgs([]);
422
+ return;
423
+ }
424
+ const call = { base, token, signal: ac.signal };
425
+ try {
426
+ const me = await iam.account(call);
427
+ if (!live) return;
428
+ if (!me) {
429
+ setStatus("anonymous");
430
+ setAccount(null);
431
+ setOrgs([]);
432
+ return;
433
+ }
434
+ setAccount(me);
435
+ const rows = await iam.organizations(call).catch((e) => {
436
+ if (e instanceof IamError && !e.unauthenticated) return [{ owner: "admin", name: me.owner }];
437
+ throw e;
438
+ });
439
+ if (!live) return;
440
+ setOrgs(rows);
441
+ setStatus("ready");
442
+ setError(null);
443
+ } catch (e) {
444
+ if (!live || ac.signal.aborted) return;
445
+ if (e instanceof IamError && e.unauthenticated) {
446
+ setStatus("anonymous");
447
+ setAccount(null);
448
+ setOrgs([]);
449
+ return;
450
+ }
451
+ setStatus("error");
452
+ setError(e instanceof Error ? e.message : "Could not reach IAM.");
453
+ }
454
+ })();
455
+ return () => {
456
+ live = false;
457
+ ac.abort();
458
+ };
459
+ }, [base, auth, epoch]);
460
+ const org = React33__namespace.useMemo(() => {
461
+ if (orgs.length === 0) return null;
462
+ const saved = orgName ?? readScope(whiteLabel.host, "org");
463
+ return orgs.find((o) => o.name === saved) ?? orgs.find((o) => o.name === account?.owner) ?? orgs[0];
464
+ }, [orgs, orgName, account, whiteLabel.host]);
465
+ React33__namespace.useEffect(() => {
466
+ if (!org) {
467
+ setProjects([]);
468
+ return;
469
+ }
470
+ const ac = new AbortController();
471
+ let live = true;
472
+ void (async () => {
473
+ const token = await (auth.token ?? storedToken)();
474
+ if (!live || !token) return;
475
+ const rows = await iam.projects({ base, token, signal: ac.signal }, org.name).catch(() => []);
476
+ if (live) setProjects(rows);
477
+ })();
478
+ return () => {
479
+ live = false;
480
+ ac.abort();
481
+ };
482
+ }, [base, auth, org, epoch]);
483
+ const project = React33__namespace.useMemo(() => {
484
+ if (projects.length === 0) return null;
485
+ const saved = projectName ?? readScope(whiteLabel.host, "project");
486
+ return projects.find((p) => p.name === saved) ?? projects.find((p) => p.isDefault) ?? projects[0];
487
+ }, [projects, projectName, whiteLabel.host]);
488
+ const value = React33__namespace.useMemo(() => ({
489
+ status,
490
+ account,
491
+ orgs,
492
+ org,
493
+ projects,
494
+ project,
495
+ error,
496
+ whiteLabel,
497
+ setOrg: (name) => {
498
+ writeScope(whiteLabel.host, "org", name);
499
+ setOrgName(name);
500
+ setProjectName(null);
501
+ },
502
+ setProject: (name) => {
503
+ writeScope(whiteLabel.host, "project", name);
504
+ setProjectName(name);
505
+ },
506
+ signIn: () => {
507
+ if (auth.signIn) return auth.signIn();
508
+ if (typeof window !== "undefined") window.location.assign(loginPath);
509
+ },
510
+ signOut: () => {
511
+ if (auth.signOut) return auth.signOut();
512
+ clearStoredTokens();
513
+ if (typeof window !== "undefined") window.location.assign(loginPath);
514
+ },
515
+ reload: () => setEpoch((n) => n + 1)
516
+ }), [status, account, orgs, org, projects, project, error, whiteLabel, auth, loginPath]);
517
+ return /* @__PURE__ */ jsxRuntime.jsx(IdentityContext.Provider, { value, children });
518
+ };
519
+ function useIdentity() {
520
+ const ctx = React33__namespace.useContext(IdentityContext);
521
+ const whiteLabel = useWhiteLabel();
522
+ const fallback = React33__namespace.useMemo(() => ({
523
+ status: "anonymous",
524
+ account: null,
525
+ orgs: [],
526
+ org: null,
527
+ projects: [],
528
+ project: null,
529
+ error: null,
530
+ whiteLabel,
531
+ setOrg: () => void 0,
532
+ setProject: () => void 0,
533
+ signIn: () => {
534
+ if (typeof window !== "undefined") window.location.assign("/login");
535
+ },
536
+ signOut: () => void 0,
537
+ reload: () => void 0
538
+ }), [whiteLabel]);
539
+ return ctx ?? fallback;
540
+ }
541
+ 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";
542
+ var CloseButtonFrame = gui.styled(gui.View, {
543
+ name: "LuxCloseButton",
544
+ render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
545
+ role: "button",
546
+ cursor: "pointer",
547
+ display: "inline-flex",
548
+ alignItems: "center",
549
+ justifyContent: "center",
550
+ width: 20,
551
+ height: 20,
552
+ minWidth: 0,
553
+ flexShrink: 1,
554
+ padding: 0,
555
+ borderRadius: 4,
556
+ borderWidth: 0,
557
+ overflow: "hidden",
558
+ backgroundColor: "transparent",
559
+ hoverStyle: {
560
+ backgroundColor: "transparent"
561
+ },
562
+ variants: {
563
+ disabled: {
564
+ true: {
565
+ opacity: 0.4,
566
+ pointerEvents: "none"
567
+ }
568
+ }
569
+ }
570
+ });
571
+ var CLOSE_BUTTON_CLASSES = [
572
+ "text-[var(--closeButton-fg,currentColor)]",
573
+ "hover:text-[var(--hover-color,currentColor)]",
574
+ "disabled:opacity-40"
575
+ ].join(" ");
576
+ var CloseButton = React33__namespace.forwardRef(function CloseButton2(props, ref) {
577
+ const { variant: _variant, size: _size, className, children, ...rest } = props;
578
+ return /* @__PURE__ */ jsxRuntime.jsx(
579
+ CloseButtonFrame,
580
+ {
581
+ ref,
582
+ className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
583
+ ...rest,
584
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
585
+ "svg",
586
+ {
587
+ className: "size-5",
588
+ viewBox: "0 0 20 20",
589
+ fill: "none",
590
+ "aria-hidden": "true",
591
+ children: /* @__PURE__ */ jsxRuntime.jsx(
592
+ "path",
593
+ {
594
+ d: CLOSE_ICON_PATH,
595
+ fill: "currentColor"
596
+ }
597
+ )
598
+ }
599
+ )
600
+ }
601
+ );
602
+ });
603
+ var DrawerPlacementContext = React33__namespace.createContext("right");
604
+ var DrawerSizeContext = React33__namespace.createContext("md");
605
+ var DrawerStateContext = React33__namespace.createContext({
606
+ open: false,
607
+ setOpen: () => {
608
+ },
609
+ modal: true
610
+ });
611
+ var DrawerRoot = (props) => {
612
+ const {
613
+ children,
614
+ open,
615
+ defaultOpen,
616
+ onOpenChange,
617
+ placement = "right",
618
+ modal = true,
619
+ size = "md"
620
+ } = props;
621
+ const [uncontrolled, setUncontrolled] = React33__namespace.useState(defaultOpen ?? false);
622
+ const isControlled = open !== void 0;
623
+ const isOpen = isControlled ? open : uncontrolled;
624
+ const setOpen = React33__namespace.useCallback((nextOpen) => {
625
+ if (!isControlled) setUncontrolled(nextOpen);
626
+ onOpenChange?.({ open: nextOpen });
627
+ }, [isControlled, onOpenChange]);
628
+ const state = React33__namespace.useMemo(
629
+ () => ({ open: isOpen, setOpen, modal }),
630
+ [isOpen, setOpen, modal]
631
+ );
632
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxRuntime.jsx(
633
+ RadixDialog__namespace.Root,
634
+ {
635
+ open: isOpen,
636
+ onOpenChange: setOpen,
637
+ modal,
638
+ children
639
+ }
640
+ ) }) }) });
641
+ };
642
+ var PLACEMENT_CLASSES = {
643
+ right: [
644
+ "inset-y-0 right-0",
645
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
646
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
647
+ ].join(" "),
648
+ left: [
649
+ "inset-y-0 left-0",
650
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
651
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
652
+ ].join(" "),
653
+ top: [
654
+ "inset-x-0 top-0",
655
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
656
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
657
+ ].join(" "),
658
+ bottom: [
659
+ "inset-x-0 bottom-0",
660
+ "data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
661
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
662
+ ].join(" ")
663
+ };
664
+ var SIZE_CLASSES = {
665
+ right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
666
+ left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
667
+ top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
668
+ bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
669
+ };
670
+ var DrawerContent = React33__namespace.forwardRef(
671
+ function DrawerContent2(props, ref) {
672
+ const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
673
+ const placement = React33__namespace.useContext(DrawerPlacementContext);
674
+ const size = React33__namespace.useContext(DrawerSizeContext);
675
+ const { open, setOpen, modal } = React33__namespace.useContext(DrawerStateContext);
676
+ const isNarrow = useIsNarrow();
677
+ if (isNarrow) {
678
+ return /* @__PURE__ */ jsxRuntime.jsxs(
679
+ gui.Sheet,
680
+ {
681
+ open,
682
+ onOpenChange: setOpen,
683
+ modal,
684
+ dismissOnSnapToBottom: true,
685
+ snapPointsMode: "percent",
686
+ snapPoints: [88],
687
+ transition: "medium",
688
+ children: [
689
+ backdrop && /* @__PURE__ */ jsxRuntime.jsx(
690
+ gui.Sheet.Overlay,
691
+ {
692
+ transition: "lazy",
693
+ enterStyle: { opacity: 0 },
694
+ exitStyle: { opacity: 0 },
695
+ className: "bg-black/50"
696
+ }
697
+ ),
698
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Sheet.Handle, {}),
699
+ /* @__PURE__ */ jsxRuntime.jsx(
700
+ gui.Sheet.Frame,
701
+ {
702
+ unstyled: true,
703
+ className: cn(
704
+ "flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
705
+ className
706
+ ),
707
+ ...rest,
708
+ children
709
+ }
710
+ )
711
+ ]
712
+ }
713
+ );
714
+ }
715
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
716
+ backdrop && /* @__PURE__ */ jsxRuntime.jsx(
717
+ RadixDialog__namespace.Overlay,
718
+ {
719
+ className: cn(
720
+ "fixed inset-0 z-50 bg-black/50",
721
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0",
722
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
723
+ )
724
+ }
725
+ ),
726
+ /* @__PURE__ */ jsxRuntime.jsx(
727
+ RadixDialog__namespace.Content,
728
+ {
729
+ ref,
730
+ className: cn(
731
+ "fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
732
+ PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
733
+ SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
734
+ className
735
+ ),
736
+ ...rest,
737
+ children
738
+ }
739
+ )
740
+ ] });
741
+ if (portalled) {
742
+ return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
743
+ }
744
+ return content;
745
+ }
746
+ );
747
+ var DrawerCloseTrigger = React33__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
748
+ return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
749
+ CloseButton,
750
+ {
751
+ ref,
752
+ className: cn("absolute top-7 right-5", props.className),
753
+ ...props
754
+ }
755
+ ) });
756
+ });
757
+ var DrawerTrigger = (props) => {
758
+ const { asChild = true, ...rest } = props;
759
+ return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
760
+ };
761
+ var DrawerHeader = React33__namespace.forwardRef(
762
+ function DrawerHeader2({ className, ...props }, ref) {
763
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
764
+ }
765
+ );
766
+ var DrawerBody = React33__namespace.forwardRef(
767
+ function DrawerBody2({ className, ...props }, ref) {
768
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
769
+ }
770
+ );
771
+ var DrawerFooter = React33__namespace.forwardRef(
772
+ function DrawerFooter2({ className, ...props }, ref) {
773
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
774
+ }
775
+ );
776
+ var DrawerTitle = RadixDialog__namespace.Title;
777
+ var DrawerDescription = RadixDialog__namespace.Description;
778
+ var DrawerActionTrigger = RadixDialog__namespace.Close;
779
+ function parsePlacement(placement) {
780
+ if (!placement) {
781
+ return { side: "bottom", align: "start" };
782
+ }
783
+ const parts = placement.split("-");
784
+ const side = parts[0] ?? "bottom";
785
+ const alignPart = parts[1];
786
+ let align = "center";
787
+ if (alignPart === "start") {
788
+ align = "start";
789
+ } else if (alignPart === "end") {
790
+ align = "end";
791
+ }
792
+ return { side, align };
793
+ }
794
+ var PositioningContext = React33__namespace.createContext({
795
+ side: "bottom",
796
+ align: "start",
797
+ sideOffset: 4,
798
+ alignOffset: 0
799
+ });
800
+ var MenuRoot = (props) => {
801
+ const {
802
+ children,
803
+ open,
804
+ defaultOpen,
805
+ onOpenChange,
806
+ positioning,
807
+ modal = true,
808
+ // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
809
+ // mount/unmount automatically.
810
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
811
+ lazyMount: _lazyMount,
812
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
813
+ unmountOnExit: _unmountOnExit
814
+ } = props;
815
+ const mergedPositioning = {
816
+ placement: "bottom-start",
817
+ ...positioning,
818
+ offset: {
819
+ mainAxis: 4,
820
+ ...positioning?.offset
821
+ }
822
+ };
823
+ const { side, align } = parsePlacement(mergedPositioning.placement);
824
+ const positioningValue = React33__namespace.useMemo(() => ({
825
+ side,
826
+ align,
827
+ sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
828
+ alignOffset: mergedPositioning.offset?.crossAxis ?? 0
829
+ }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
830
+ const handleOpenChange = React33__namespace.useCallback((isOpen) => {
831
+ onOpenChange?.({ open: isOpen });
832
+ }, [onOpenChange]);
833
+ return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
834
+ DropdownMenu__namespace.Root,
835
+ {
836
+ open,
837
+ defaultOpen,
838
+ onOpenChange: handleOpenChange,
839
+ modal,
840
+ children
841
+ }
842
+ ) });
843
+ };
844
+ var MenuTrigger = React33__namespace.forwardRef(function MenuTrigger2(props, ref) {
845
+ const { asChild = false, ...rest } = props;
846
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
847
+ });
848
+ var MenuContent = React33__namespace.forwardRef(function MenuContent2(props, ref) {
849
+ const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
850
+ const positioning = React33__namespace.useContext(PositioningContext);
851
+ const mergedStyle = {
852
+ ...style,
853
+ ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
854
+ ...minW !== void 0 ? { minWidth: minW } : {}
855
+ };
856
+ const content = /* @__PURE__ */ jsxRuntime.jsx(
857
+ DropdownMenu__namespace.Content,
858
+ {
859
+ ref,
860
+ side: positioning.side,
861
+ align: positioning.align,
862
+ sideOffset: positioning.sideOffset,
863
+ alignOffset: positioning.alignOffset,
864
+ className: cn(
865
+ "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
866
+ "border border-[var(--color-popover-border,var(--color-border-divider))]",
867
+ "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
868
+ "shadow-[0_4px_12px_var(--color-popover-shadow)]",
869
+ "outline-none",
870
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
871
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
872
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
873
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
874
+ className
875
+ ),
876
+ style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
877
+ ...rest
878
+ }
879
+ );
880
+ if (!portalled) {
881
+ return content;
882
+ }
883
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
884
+ });
885
+ var MenuItem = React33__namespace.forwardRef(function MenuItem2(props, ref) {
886
+ const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
887
+ return /* @__PURE__ */ jsxRuntime.jsx(
888
+ DropdownMenu__namespace.Item,
889
+ {
890
+ ref,
891
+ asChild,
892
+ disabled,
893
+ onClick,
894
+ className: cn(
895
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
896
+ "outline-none transition-colors",
897
+ "text-[var(--color-text-primary,inherit)]",
898
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
899
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
900
+ className
901
+ ),
902
+ ...rest,
903
+ children
904
+ }
905
+ );
906
+ });
907
+ var MenuItemText = React33__namespace.forwardRef(function MenuItemText2(props, ref) {
908
+ const { className, ...rest } = props;
909
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
910
+ });
911
+ React33__namespace.forwardRef(function MenuItemCommand2(props, ref) {
912
+ const { className, ...rest } = props;
913
+ return /* @__PURE__ */ jsxRuntime.jsx(
914
+ "span",
915
+ {
916
+ ref,
917
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
918
+ ...rest
919
+ }
920
+ );
921
+ });
922
+ var MenuSeparator = React33__namespace.forwardRef(function MenuSeparator2(props, ref) {
923
+ const { className, ...rest } = props;
924
+ return /* @__PURE__ */ jsxRuntime.jsx(
925
+ DropdownMenu__namespace.Separator,
926
+ {
927
+ ref,
928
+ className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
929
+ ...rest
930
+ }
931
+ );
932
+ });
933
+ var MenuItemGroup = React33__namespace.forwardRef(function MenuItemGroup2(props, ref) {
934
+ const { title, children, className, ...rest } = props;
935
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
936
+ title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
937
+ children
938
+ ] });
939
+ });
940
+ var MenuArrow = React33__namespace.forwardRef(function MenuArrow2(props, ref) {
941
+ const { className, ...rest } = props;
942
+ return /* @__PURE__ */ jsxRuntime.jsx(
943
+ DropdownMenu__namespace.Arrow,
944
+ {
945
+ ref,
946
+ className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
947
+ ...rest
948
+ }
949
+ );
950
+ });
951
+ var MenuCheckboxItem = React33__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
952
+ const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
953
+ return /* @__PURE__ */ jsxRuntime.jsxs(
954
+ DropdownMenu__namespace.CheckboxItem,
955
+ {
956
+ ref,
957
+ checked,
958
+ onCheckedChange,
959
+ onClick,
960
+ className: cn(
961
+ "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
962
+ "outline-none transition-colors",
963
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
964
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
965
+ className
966
+ ),
967
+ ...rest,
968
+ children: [
969
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
970
+ children
971
+ ]
972
+ }
973
+ );
974
+ });
975
+ var MenuRadioItemGroup = React33__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
976
+ const { value, onValueChange, ...rest } = props;
977
+ return /* @__PURE__ */ jsxRuntime.jsx(
978
+ DropdownMenu__namespace.RadioGroup,
979
+ {
980
+ ref,
981
+ value,
982
+ onValueChange,
983
+ ...rest
984
+ }
985
+ );
986
+ });
987
+ var MenuRadioItem = React33__namespace.forwardRef(function MenuRadioItem2(props, ref) {
988
+ const { className, children, value, onClick, ...rest } = props;
989
+ const { value: _v, ...radixRest } = rest;
990
+ return /* @__PURE__ */ jsxRuntime.jsxs(
991
+ DropdownMenu__namespace.RadioItem,
992
+ {
993
+ ref,
994
+ value,
995
+ onClick,
996
+ className: cn(
997
+ "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
998
+ "outline-none transition-colors",
999
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
1000
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1001
+ className
1002
+ ),
1003
+ children: [
1004
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
1005
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
1006
+ ]
1007
+ }
1008
+ );
1009
+ });
1010
+ React33__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
1011
+ const { asChild: _asChild, ...rest } = props;
1012
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
1013
+ });
1014
+ var MenuTriggerItem = React33__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
1015
+ const { startIcon, children, className, ...rest } = props;
1016
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1017
+ DropdownMenu__namespace.SubTrigger,
1018
+ {
1019
+ ref,
1020
+ className: cn(
1021
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
1022
+ "outline-none transition-colors",
1023
+ "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
1024
+ className
1025
+ ),
1026
+ ...rest,
1027
+ children: [
1028
+ startIcon,
1029
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
1030
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
1031
+ ]
1032
+ }
1033
+ ) });
1034
+ });
1035
+ function initials(label) {
1036
+ return label.split(/[\s._-]+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2).toUpperCase();
1037
+ }
1038
+ var Monogram = ({ label, logo }) => logo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "", className: "h-5 w-5 shrink-0 rounded object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(
1039
+ "span",
1040
+ {
1041
+ "aria-hidden": "true",
1042
+ className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-[rgba(127,127,127,0.22)] text-[10px] font-bold",
1043
+ children: initials(label)
1044
+ }
1045
+ );
1046
+ var Row = ({ item, onDone, menu }) => {
1047
+ const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1048
+ item.icon,
1049
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: item.label }),
1050
+ item.hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs opacity-60", children: item.hint }) : null,
1051
+ item.selected ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }) : null
1052
+ ] });
1053
+ const className = cn(
1054
+ "flex w-full cursor-pointer select-none items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",
1055
+ "hover:bg-[rgba(127,127,127,0.14)]",
1056
+ item.danger && "text-[var(--color-text-error,#e5484d)]"
1057
+ );
1058
+ const activate = () => {
1059
+ onDone();
1060
+ item.onSelect?.();
1061
+ };
1062
+ const shared = {
1063
+ "data-testid": `chrome-item-${item.id}`,
1064
+ "aria-current": item.selected ? "true" : void 0,
1065
+ className
1066
+ };
1067
+ const control = item.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, ...shared, onClick: onDone, children: body }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", ...shared, onClick: activate, children: body });
1068
+ return menu ? /* @__PURE__ */ jsxRuntime.jsx(MenuItem, { value: item.id, asChild: true, children: control }) : control;
1069
+ };
1070
+ var Switcher = ({
1071
+ title,
1072
+ label,
1073
+ icon,
1074
+ items,
1075
+ footer = [],
1076
+ status = "ready",
1077
+ empty = "Nothing here yet.",
1078
+ onSignIn,
1079
+ signInLabel = "Sign in",
1080
+ error,
1081
+ align = "start",
1082
+ testId
1083
+ }) => {
1084
+ const [open, setOpen] = React33__namespace.useState(false);
1085
+ const narrow = useIsNarrow();
1086
+ const close = React33__namespace.useCallback(() => setOpen(false), []);
1087
+ const message = status === "loading" ? "Loading\u2026" : status === "error" ? error ?? "Could not reach IAM." : status === "anonymous" ? null : items.length === 0 ? empty : null;
1088
+ const rows = status === "anonymous" && onSignIn ? [{ id: "sign-in", label: signInLabel, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: onSignIn }] : status === "ready" ? items : [];
1089
+ const panel = (menu) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1090
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide opacity-55", children: title }),
1091
+ message ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "chrome-message", className: "px-2 py-2 text-sm opacity-70", children: message }) : null,
1092
+ rows.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Row, { item, onDone: close, menu }, item.id)),
1093
+ footer.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1094
+ menu ? /* @__PURE__ */ jsxRuntime.jsx(MenuSeparator, { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-[var(--color-border-divider,rgba(127,127,127,0.25))]" }),
1095
+ footer.map((item) => /* @__PURE__ */ jsxRuntime.jsx(Row, { item, onDone: close, menu }, item.id))
1096
+ ] }) : null
1097
+ ] });
1098
+ const trigger = /* @__PURE__ */ jsxRuntime.jsxs(
1099
+ "button",
1100
+ {
1101
+ type: "button",
1102
+ "data-testid": testId,
1103
+ "aria-label": title,
1104
+ "aria-haspopup": "menu",
1105
+ "aria-expanded": open,
1106
+ className: cn(
1107
+ "flex max-w-[14rem] items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium",
1108
+ "hover:bg-[rgba(127,127,127,0.14)]"
1109
+ ),
1110
+ children: [
1111
+ icon,
1112
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }),
1113
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { "aria-hidden": "true", className: "h-3.5 w-3.5 shrink-0 opacity-60" })
1114
+ ]
1115
+ }
1116
+ );
1117
+ if (narrow) {
1118
+ return /* @__PURE__ */ jsxRuntime.jsxs(DrawerRoot, { open, onOpenChange: (d) => setOpen(d.open), placement: "bottom", size: "md", children: [
1119
+ React33__namespace.cloneElement(trigger, { onClick: () => setOpen(true) }),
1120
+ /* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { "data-testid": testId ? `${testId}-panel` : void 0, children: [
1121
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: title }) }),
1122
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerBody, { children: panel(false) })
1123
+ ] })
1124
+ ] });
1125
+ }
1126
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1127
+ MenuRoot,
1128
+ {
1129
+ open,
1130
+ onOpenChange: (d) => setOpen(d.open),
1131
+ positioning: { placement: align === "end" ? "bottom-end" : "bottom-start" },
1132
+ children: [
1133
+ /* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { asChild: true, children: trigger }),
1134
+ /* @__PURE__ */ jsxRuntime.jsx(MenuContent, { minW: "16rem", "data-testid": testId ? `${testId}-panel` : void 0, children: panel(true) })
1135
+ ]
1136
+ }
1137
+ );
1138
+ };
1139
+ var OrgSwitcher = () => {
1140
+ const id = useIdentity();
1141
+ return /* @__PURE__ */ jsxRuntime.jsx(
1142
+ Switcher,
1143
+ {
1144
+ testId: "org-switcher",
1145
+ title: "Organization",
1146
+ label: id.org?.displayName || id.org?.name || id.whiteLabel.name,
1147
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: id.org?.displayName || id.org?.name || id.whiteLabel.name, logo: id.org?.logo }),
1148
+ status: id.status,
1149
+ error: id.error,
1150
+ empty: "No organizations for this account.",
1151
+ onSignIn: id.signIn,
1152
+ signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
1153
+ items: id.orgs.map((o) => ({
1154
+ id: o.name,
1155
+ label: o.displayName || o.name,
1156
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: o.displayName || o.name, logo: o.logo }),
1157
+ selected: o.name === id.org?.name,
1158
+ onSelect: () => id.setOrg(o.name)
1159
+ }))
1160
+ }
1161
+ );
1162
+ };
1163
+ var ProjectSwitcher = () => {
1164
+ const id = useIdentity();
1165
+ if (id.status === "ready" && id.projects.length === 0) return null;
1166
+ return /* @__PURE__ */ jsxRuntime.jsx(
1167
+ Switcher,
1168
+ {
1169
+ testId: "project-switcher",
1170
+ title: "Project",
1171
+ label: id.project?.displayName || id.project?.name || "Project",
1172
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1173
+ status: id.status,
1174
+ error: id.error,
1175
+ empty: "No projects in this organization.",
1176
+ onSignIn: id.signIn,
1177
+ items: id.projects.map((p) => ({
1178
+ id: p.name,
1179
+ label: p.displayName || p.name,
1180
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Folder, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1181
+ selected: p.name === id.project?.name,
1182
+ onSelect: () => id.setProject(p.name)
1183
+ }))
1184
+ }
1185
+ );
92
1186
  };
93
- var config = gui.createGui({
94
- ...v5.defaultConfig,
95
- settings: {
96
- ...v5.defaultConfig.settings,
97
- onlyAllowShorthands: false
98
- },
99
- themes: {
100
- ...v5.defaultConfig.themes,
101
- ...luxThemes
102
- }
103
- });
104
- var lux_config_default = config;
105
- var defaultQueryClient = new reactQuery.QueryClient({
106
- defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
107
- });
108
- var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
109
- var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
110
- var useFontBodyReset = () => {
111
- React30__namespace.default.useInsertionEffect(() => {
112
- if (typeof document === "undefined") return;
113
- if (document.getElementById(FONT_BODY_RESET_ID)) return;
114
- const style = document.createElement("style");
115
- style.id = FONT_BODY_RESET_ID;
116
- style.textContent = FONT_BODY_RESET_CSS;
117
- document.head.appendChild(style);
118
- }, []);
1187
+ var UserMenu = ({ items = [] }) => {
1188
+ const id = useIdentity();
1189
+ const who = id.account?.displayName || id.account?.email || id.account?.name || "Account";
1190
+ return /* @__PURE__ */ jsxRuntime.jsx(
1191
+ Switcher,
1192
+ {
1193
+ testId: "user-menu",
1194
+ align: "end",
1195
+ title: id.status === "ready" ? who : "Account",
1196
+ label: id.status === "ready" ? who : "Sign in",
1197
+ icon: id.status === "ready" ? /* @__PURE__ */ jsxRuntime.jsx(Monogram, { label: who, logo: id.account?.avatar }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1198
+ status: id.status,
1199
+ error: id.error,
1200
+ onSignIn: id.signIn,
1201
+ signInLabel: `Sign in with ${id.whiteLabel.iamDomain}`,
1202
+ items: [
1203
+ { id: "account", label: id.account?.email || who, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) },
1204
+ ...items
1205
+ ],
1206
+ footer: id.status === "ready" ? [{ id: "sign-out", label: "Sign out", danger: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { "aria-hidden": "true", className: "h-4 w-4" }), onSelect: id.signOut }] : []
1207
+ }
1208
+ );
119
1209
  };
120
- var AppProvider = ({
121
- children,
122
- queryClient,
123
- defaultTheme = "dark_lux"
1210
+ var SettingsMenu = ({ items = [], href = "/settings" }) => /* @__PURE__ */ jsxRuntime.jsx(
1211
+ Switcher,
1212
+ {
1213
+ testId: "settings-menu",
1214
+ align: "end",
1215
+ title: "Settings",
1216
+ label: "Settings",
1217
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1218
+ items,
1219
+ empty: "No settings on this surface.",
1220
+ footer: [{ id: "all-settings", label: "All settings", href, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }) }]
1221
+ }
1222
+ );
1223
+ var AppNav = ({
1224
+ brand,
1225
+ home = "/",
1226
+ links = [],
1227
+ org = true,
1228
+ project = false,
1229
+ settings,
1230
+ userItems,
1231
+ children
124
1232
  }) => {
125
- useFontBodyReset();
126
- return /* @__PURE__ */ jsxRuntime.jsx(gui.GuiProvider, { config: lux_config_default, defaultTheme, children: /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children }) });
1233
+ const id = useIdentity();
1234
+ const narrow = useIsNarrow();
1235
+ const [menu, setMenu] = React33__namespace.useState(false);
1236
+ return /* @__PURE__ */ jsxRuntime.jsx(
1237
+ "header",
1238
+ {
1239
+ "data-testid": "app-nav",
1240
+ 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)]",
1241
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex h-14 max-w-7xl items-center gap-2 px-4", children: [
1242
+ narrow && links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(DrawerRoot, { open: menu, onOpenChange: (d) => setMenu(d.open), placement: "bottom", size: "md", children: [
1243
+ /* @__PURE__ */ jsxRuntime.jsx(
1244
+ "button",
1245
+ {
1246
+ type: "button",
1247
+ "aria-label": "Menu",
1248
+ "data-testid": "nav-menu",
1249
+ className: "rounded-md p-2 hover:bg-[rgba(127,127,127,0.14)]",
1250
+ onClick: () => setMenu(true),
1251
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { "aria-hidden": "true", className: "h-5 w-5" })
1252
+ }
1253
+ ),
1254
+ /* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { "data-testid": "nav-menu-panel", children: [
1255
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: "Menu" }) }),
1256
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerBody, { children: links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
1257
+ "a",
1258
+ {
1259
+ href: l.href,
1260
+ onClick: () => setMenu(false),
1261
+ "aria-current": l.active ? "page" : void 0,
1262
+ className: "block rounded-md px-2 py-2.5 text-sm hover:bg-[rgba(127,127,127,0.14)]",
1263
+ children: l.label
1264
+ },
1265
+ l.href
1266
+ )) })
1267
+ ] })
1268
+ ] }) : null,
1269
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: home, className: "flex items-center gap-2 font-semibold tracking-tight", children: brand ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1270
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { "aria-hidden": "true", className: "h-4 w-4 opacity-70" }),
1271
+ id.whiteLabel.name
1272
+ ] }) }),
1273
+ org ? /* @__PURE__ */ jsxRuntime.jsx(OrgSwitcher, {}) : null,
1274
+ project ? /* @__PURE__ */ jsxRuntime.jsx(ProjectSwitcher, {}) : null,
1275
+ !narrow && links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "flex items-center gap-1", children: links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(
1276
+ "a",
1277
+ {
1278
+ href: l.href,
1279
+ "aria-current": l.active ? "page" : void 0,
1280
+ className: cn(
1281
+ "rounded-md px-3 py-1.5 text-sm font-medium",
1282
+ l.active ? "bg-[rgba(127,127,127,0.14)]" : "opacity-75 hover:opacity-100"
1283
+ ),
1284
+ children: l.label
1285
+ },
1286
+ l.href
1287
+ )) }) : null,
1288
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center justify-end gap-1", children: [
1289
+ children,
1290
+ settings ? /* @__PURE__ */ jsxRuntime.jsx(SettingsMenu, { items: settings }) : null,
1291
+ /* @__PURE__ */ jsxRuntime.jsx(UserMenu, { items: userItems })
1292
+ ] })
1293
+ ] })
1294
+ }
1295
+ );
127
1296
  };
128
- function cn(...inputs) {
129
- return tailwindMerge.twMerge(clsx.clsx(inputs));
130
- }
131
1297
  var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
132
- var AccordionRoot = React30__namespace.forwardRef(
1298
+ var AccordionRoot = React33__namespace.forwardRef(
133
1299
  function AccordionRoot2(props, ref) {
134
1300
  const {
135
1301
  multiple: _multiple,
@@ -148,7 +1314,7 @@ var AccordionRoot = React30__namespace.forwardRef(
148
1314
  borderRadius: _borderRadius,
149
1315
  ...rest
150
1316
  } = props;
151
- const handleValueChange = React30__namespace.useCallback(
1317
+ const handleValueChange = React33__namespace.useCallback(
152
1318
  (next) => {
153
1319
  onValueChange?.({ value: next });
154
1320
  },
@@ -176,7 +1342,7 @@ var AccordionRoot = React30__namespace.forwardRef(
176
1342
  );
177
1343
  }
178
1344
  );
179
- var AccordionItem = React30__namespace.forwardRef(
1345
+ var AccordionItem = React33__namespace.forwardRef(
180
1346
  function AccordionItem2(props, ref) {
181
1347
  const { className, as: _as, _first, _last, display: _display, ...rest } = props;
182
1348
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -192,7 +1358,7 @@ var AccordionItem = React30__namespace.forwardRef(
192
1358
  );
193
1359
  }
194
1360
  );
195
- var AccordionItemTrigger = React30__namespace.forwardRef(function AccordionItemTrigger2(props, ref) {
1361
+ var AccordionItemTrigger = React33__namespace.forwardRef(function AccordionItemTrigger2(props, ref) {
196
1362
  const {
197
1363
  children,
198
1364
  indicatorPlacement: indicatorPlacementProp,
@@ -257,7 +1423,7 @@ var AccordionItemTrigger = React30__namespace.forwardRef(function AccordionItemT
257
1423
  }
258
1424
  ) }) });
259
1425
  });
260
- var AccordionItemContent = React30__namespace.forwardRef(function AccordionItemContent2(props, ref) {
1426
+ var AccordionItemContent = React33__namespace.forwardRef(function AccordionItemContent2(props, ref) {
261
1427
  const { className, children, pb: _pb, pr: _pr, pl: _pl, w: _w, display: _display, flexDir: _flexDir, rowGap: _rowGap, ...rest } = props;
262
1428
  return /* @__PURE__ */ jsxRuntime.jsx(
263
1429
  AccordionPrimitive__namespace.Content,
@@ -275,11 +1441,11 @@ var AccordionItemContent = React30__namespace.forwardRef(function AccordionItemC
275
1441
  );
276
1442
  });
277
1443
  function useAccordion(items) {
278
- const [value, setValue] = React30__namespace.useState([]);
279
- const onValueChange = React30__namespace.useCallback(({ value: value2 }) => {
1444
+ const [value, setValue] = React33__namespace.useState([]);
1445
+ const onValueChange = React33__namespace.useCallback(({ value: value2 }) => {
280
1446
  setValue(value2);
281
1447
  }, []);
282
- const scrollToItemFromUrl = React30__namespace.useCallback(() => {
1448
+ const scrollToItemFromUrl = React33__namespace.useCallback(() => {
283
1449
  const hash = window.location.hash.replace("#", "");
284
1450
  if (!hash) {
285
1451
  return;
@@ -293,7 +1459,7 @@ function useAccordion(items) {
293
1459
  setValue([itemToScroll.id]);
294
1460
  }
295
1461
  }, [items]);
296
- return React30__namespace.useMemo(() => {
1462
+ return React33__namespace.useMemo(() => {
297
1463
  return {
298
1464
  value,
299
1465
  onValueChange,
@@ -301,68 +1467,6 @@ function useAccordion(items) {
301
1467
  };
302
1468
  }, [value, onValueChange, scrollToItemFromUrl]);
303
1469
  }
304
- 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";
305
- var CloseButtonFrame = gui.styled(gui.View, {
306
- name: "LuxCloseButton",
307
- render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
308
- role: "button",
309
- cursor: "pointer",
310
- display: "inline-flex",
311
- alignItems: "center",
312
- justifyContent: "center",
313
- width: 20,
314
- height: 20,
315
- minWidth: 0,
316
- flexShrink: 1,
317
- padding: 0,
318
- borderRadius: 4,
319
- borderWidth: 0,
320
- overflow: "hidden",
321
- backgroundColor: "transparent",
322
- hoverStyle: {
323
- backgroundColor: "transparent"
324
- },
325
- variants: {
326
- disabled: {
327
- true: {
328
- opacity: 0.4,
329
- pointerEvents: "none"
330
- }
331
- }
332
- }
333
- });
334
- var CLOSE_BUTTON_CLASSES = [
335
- "text-[var(--closeButton-fg,currentColor)]",
336
- "hover:text-[var(--hover-color,currentColor)]",
337
- "disabled:opacity-40"
338
- ].join(" ");
339
- var CloseButton = React30__namespace.forwardRef(function CloseButton2(props, ref) {
340
- const { variant: _variant, size: _size, className, children, ...rest } = props;
341
- return /* @__PURE__ */ jsxRuntime.jsx(
342
- CloseButtonFrame,
343
- {
344
- ref,
345
- className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
346
- ...rest,
347
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
348
- "svg",
349
- {
350
- className: "size-5",
351
- viewBox: "0 0 20 20",
352
- fill: "none",
353
- "aria-hidden": "true",
354
- children: /* @__PURE__ */ jsxRuntime.jsx(
355
- "path",
356
- {
357
- d: CLOSE_ICON_PATH,
358
- fill: "currentColor"
359
- }
360
- )
361
- }
362
- )
363
- }
364
- );
365
- });
366
1470
  var SHIM_PROPS = [
367
1471
  "w",
368
1472
  "h",
@@ -483,7 +1587,7 @@ var SKELETON_CLASSES = [
483
1587
  "bg-[length:200%_100%]"
484
1588
  ].join(" ");
485
1589
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
486
- var Skeleton = React30__namespace.forwardRef(
1590
+ var Skeleton = React33__namespace.forwardRef(
487
1591
  function Skeleton2(props, ref) {
488
1592
  const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
489
1593
  const shimStyle = shimToStyle(props);
@@ -492,10 +1596,10 @@ var Skeleton = React30__namespace.forwardRef(
492
1596
  const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
493
1597
  const htmlRest = stripShims(allRest);
494
1598
  if (!loading) {
495
- if (asChild && React30__namespace.isValidElement(children)) return children;
1599
+ if (asChild && React33__namespace.isValidElement(children)) return children;
496
1600
  return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
497
1601
  }
498
- if (asChild && React30__namespace.isValidElement(children)) {
1602
+ if (asChild && React33__namespace.isValidElement(children)) {
499
1603
  return /* @__PURE__ */ jsxRuntime.jsx(
500
1604
  Component,
501
1605
  {
@@ -521,7 +1625,7 @@ var Skeleton = React30__namespace.forwardRef(
521
1625
  );
522
1626
  }
523
1627
  );
524
- var SkeletonCircle = React30__namespace.forwardRef(
1628
+ var SkeletonCircle = React33__namespace.forwardRef(
525
1629
  function SkeletonCircle2(props, ref) {
526
1630
  const { size = 40, loading = true, className, ...rest } = props;
527
1631
  const dimension = typeof size === "number" ? `${size}px` : size;
@@ -537,7 +1641,7 @@ var SkeletonCircle = React30__namespace.forwardRef(
537
1641
  );
538
1642
  }
539
1643
  );
540
- var SkeletonText = React30__namespace.forwardRef(
1644
+ var SkeletonText = React33__namespace.forwardRef(
541
1645
  function SkeletonText2(props, ref) {
542
1646
  const { noOfLines = 3, loading = true, className, ...rest } = props;
543
1647
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -559,7 +1663,7 @@ var STATUS_CLASSES = {
559
1663
  success: "bg-[var(--color-alert-bg-success)]",
560
1664
  error: "bg-[var(--color-alert-bg-error)]"
561
1665
  };
562
- var SIZE_CLASSES = {
1666
+ var SIZE_CLASSES2 = {
563
1667
  sm: "gap-2 px-2 py-2 text-xs",
564
1668
  md: "gap-2 px-3 py-2 text-base"
565
1669
  };
@@ -567,7 +1671,7 @@ var INDICATOR_SIZE_CLASSES = {
567
1671
  sm: "w-5 h-5 my-0",
568
1672
  md: "w-5 h-5 my-[2px]"
569
1673
  };
570
- var Alert = React30__namespace.forwardRef(
1674
+ var Alert = React33__namespace.forwardRef(
571
1675
  function Alert2(props, ref) {
572
1676
  const {
573
1677
  title,
@@ -592,7 +1696,7 @@ var Alert = React30__namespace.forwardRef(
592
1696
  if (_mb !== void 0) shimStyle.marginBottom = typeof _mb === "number" ? `${_mb * 4}px` : _mb;
593
1697
  if (_mt !== void 0) shimStyle.marginTop = typeof _mt === "number" ? `${_mt * 4}px` : _mt;
594
1698
  const alertStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
595
- const [isOpen, setIsOpen] = React30__namespace.useState(true);
1699
+ const [isOpen, setIsOpen] = React33__namespace.useState(true);
596
1700
  const resolvedSize = size ?? "md";
597
1701
  const defaultIcon = /* @__PURE__ */ jsxRuntime.jsx(IndicatorIcon2, { className: "w-5 h-5" });
598
1702
  const iconElement = (() => {
@@ -607,7 +1711,7 @@ var Alert = React30__namespace.forwardRef(
607
1711
  INDICATOR_SIZE_CLASSES[resolvedSize]
608
1712
  ), children: icon || defaultIcon });
609
1713
  })();
610
- const handleClose = React30__namespace.useCallback(() => {
1714
+ const handleClose = React33__namespace.useCallback(() => {
611
1715
  setIsOpen(false);
612
1716
  onClose?.();
613
1717
  }, [onClose]);
@@ -638,7 +1742,7 @@ var Alert = React30__namespace.forwardRef(
638
1742
  "div",
639
1743
  {
640
1744
  ref,
641
- className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className),
1745
+ className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES2[resolvedSize], className),
642
1746
  style: alertStyle,
643
1747
  ...alertRest,
644
1748
  children: [
@@ -668,7 +1772,7 @@ var Alert = React30__namespace.forwardRef(
668
1772
  ) });
669
1773
  }
670
1774
  );
671
- var SIZE_CLASSES2 = {
1775
+ var SIZE_CLASSES3 = {
672
1776
  xs: "h-6 w-6 text-[10px]",
673
1777
  sm: "h-8 w-8 text-xs",
674
1778
  md: "h-10 w-10 text-sm",
@@ -683,11 +1787,11 @@ var VARIANT_CLASSES = {
683
1787
  };
684
1788
  var DEFAULT_SIZE = "md";
685
1789
  var DEFAULT_VARIANT = "subtle";
686
- var AvatarGroupContext = React30__namespace.createContext({});
1790
+ var AvatarGroupContext = React33__namespace.createContext({});
687
1791
  function useAvatarGroupContext() {
688
- return React30__namespace.useContext(AvatarGroupContext);
1792
+ return React33__namespace.useContext(AvatarGroupContext);
689
1793
  }
690
- var Avatar = React30__namespace.forwardRef(
1794
+ var Avatar = React33__namespace.forwardRef(
691
1795
  function Avatar2(props, ref) {
692
1796
  const group = useAvatarGroupContext();
693
1797
  const {
@@ -708,12 +1812,13 @@ var Avatar = React30__namespace.forwardRef(
708
1812
  const variant = variantProp ?? group.variant ?? DEFAULT_VARIANT;
709
1813
  const isBorderless = borderless ?? group.borderless ?? false;
710
1814
  return /* @__PURE__ */ jsxRuntime.jsxs(
711
- RadixAvatar__namespace.Root,
1815
+ gui.Avatar,
712
1816
  {
713
1817
  ref,
1818
+ unstyled: true,
714
1819
  className: cn(
715
1820
  "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
716
- SIZE_CLASSES2[size],
1821
+ SIZE_CLASSES3[size],
717
1822
  VARIANT_CLASSES[variant],
718
1823
  !isBorderless && "ring-2 ring-white dark:ring-gray-900",
719
1824
  className
@@ -721,8 +1826,8 @@ var Avatar = React30__namespace.forwardRef(
721
1826
  ...rest,
722
1827
  children: [
723
1828
  /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { name, icon, children: fallback }),
724
- /* @__PURE__ */ jsxRuntime.jsx(
725
- RadixAvatar__namespace.Image,
1829
+ src != null && /* @__PURE__ */ jsxRuntime.jsx(
1830
+ gui.Avatar.Image,
726
1831
  {
727
1832
  className: "h-full w-full rounded-[inherit] object-cover",
728
1833
  src,
@@ -737,13 +1842,14 @@ var Avatar = React30__namespace.forwardRef(
737
1842
  );
738
1843
  }
739
1844
  );
740
- var AvatarFallback = React30__namespace.forwardRef(
1845
+ var AvatarFallback = React33__namespace.forwardRef(
741
1846
  function AvatarFallback2(props, ref) {
742
1847
  const { name, icon, children, className, ...rest } = props;
743
1848
  return /* @__PURE__ */ jsxRuntime.jsxs(
744
- RadixAvatar__namespace.Fallback,
1849
+ gui.Avatar.Fallback,
745
1850
  {
746
1851
  ref,
1852
+ unstyled: true,
747
1853
  className: cn(
748
1854
  "flex h-full w-full items-center justify-center font-medium",
749
1855
  className
@@ -764,10 +1870,10 @@ function getInitials(name) {
764
1870
  const lastName = names.length > 1 ? names[names.length - 1] : "";
765
1871
  return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
766
1872
  }
767
- var AvatarGroup = React30__namespace.forwardRef(
1873
+ var AvatarGroup = React33__namespace.forwardRef(
768
1874
  function AvatarGroup2(props, ref) {
769
1875
  const { size, variant, borderless, className, ...rest } = props;
770
- const contextValue = React30__namespace.useMemo(
1876
+ const contextValue = React33__namespace.useMemo(
771
1877
  () => ({ size, variant, borderless }),
772
1878
  [size, variant, borderless]
773
1879
  );
@@ -781,26 +1887,11 @@ var AvatarGroup = React30__namespace.forwardRef(
781
1887
  ) });
782
1888
  }
783
1889
  );
784
- var LG_BREAKPOINT = 1024;
785
- function useIsMobile() {
786
- const [isMobile, setIsMobile] = React30__namespace.useState(() => {
787
- if (typeof window === "undefined") return false;
788
- return window.innerWidth < LG_BREAKPOINT;
789
- });
790
- React30__namespace.useEffect(() => {
791
- const mql = window.matchMedia(`(max-width: ${LG_BREAKPOINT - 1}px)`);
792
- const handler = (e) => setIsMobile(e.matches);
793
- setIsMobile(mql.matches);
794
- mql.addEventListener("change", handler);
795
- return () => mql.removeEventListener("change", handler);
796
- }, []);
797
- return isMobile;
798
- }
799
1890
  function mapPlacement(p) {
800
1891
  if (!p) return void 0;
801
1892
  return p;
802
1893
  }
803
- var Tooltip = React30__namespace.forwardRef(
1894
+ var Tooltip = React33__namespace.forwardRef(
804
1895
  function Tooltip2(props, ref) {
805
1896
  const {
806
1897
  showArrow: showArrowProp,
@@ -819,28 +1910,28 @@ var Tooltip = React30__namespace.forwardRef(
819
1910
  interactive,
820
1911
  positioning
821
1912
  } = props;
822
- const [open, setOpen] = React30__namespace.useState(defaultOpen);
823
- const timeoutRef = React30__namespace.useRef(null);
824
- const isMobile = useIsMobile();
825
- const handleOpenChange = React30__namespace.useCallback((nextOpen) => {
1913
+ const [open, setOpen] = React33__namespace.useState(defaultOpen);
1914
+ const timeoutRef = React33__namespace.useRef(null);
1915
+ const isMobile = useIsTouch();
1916
+ const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
826
1917
  setOpen(nextOpen);
827
1918
  onOpenChange?.({ open: nextOpen });
828
1919
  }, [onOpenChange]);
829
- const handleOpenChangeManual = React30__namespace.useCallback((nextOpen) => {
1920
+ const handleOpenChangeManual = React33__namespace.useCallback((nextOpen) => {
830
1921
  timeoutRef.current && window.clearTimeout(timeoutRef.current);
831
1922
  timeoutRef.current = window.setTimeout(() => {
832
1923
  setOpen(nextOpen);
833
1924
  onOpenChange?.({ open: nextOpen });
834
1925
  }, nextOpen ? openDelay : closeDelay);
835
1926
  }, [closeDelay, openDelay, onOpenChange]);
836
- const handleClickAway = React30__namespace.useCallback(() => {
1927
+ const handleClickAway = React33__namespace.useCallback(() => {
837
1928
  handleOpenChangeManual(false);
838
1929
  }, [handleOpenChangeManual]);
839
1930
  const triggerRef = usehooks.useClickAway(handleClickAway);
840
- const handleTriggerClick = React30__namespace.useCallback(() => {
1931
+ const handleTriggerClick = React33__namespace.useCallback(() => {
841
1932
  handleOpenChangeManual(!open);
842
1933
  }, [handleOpenChangeManual, open]);
843
- const handleContentClick = React30__namespace.useCallback((event) => {
1934
+ const handleContentClick = React33__namespace.useCallback((event) => {
844
1935
  event.stopPropagation();
845
1936
  if (interactive) {
846
1937
  const closestLink = event.target?.closest("a");
@@ -849,7 +1940,7 @@ var Tooltip = React30__namespace.forwardRef(
849
1940
  }
850
1941
  }
851
1942
  }, [interactive, handleOpenChangeManual]);
852
- React30__namespace.useEffect(() => {
1943
+ React33__namespace.useEffect(() => {
853
1944
  return () => {
854
1945
  if (timeoutRef.current) {
855
1946
  clearTimeout(timeoutRef.current);
@@ -921,7 +2012,7 @@ function TruncatedTextTooltip({ label, children }) {
921
2012
  return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
922
2013
  }
923
2014
  var BASE_CLASSES = "inline-flex items-center rounded-sm gap-1 font-medium w-fit max-w-full whitespace-nowrap select-text";
924
- var SIZE_CLASSES3 = {
2015
+ var SIZE_CLASSES4 = {
925
2016
  sm: "text-xs p-1 h-[18px] min-h-[18px]",
926
2017
  md: "text-sm px-1 py-0.5 min-h-6",
927
2018
  lg: "text-sm px-2 py-1 min-h-7 font-semibold"
@@ -951,7 +2042,7 @@ var COLOR_PALETTE_CLASSES = {
951
2042
  bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
952
2043
  };
953
2044
  var S2 = 4;
954
- var Badge = React30__namespace.default.forwardRef(
2045
+ var Badge = React33__namespace.default.forwardRef(
955
2046
  function Badge2(props, ref) {
956
2047
  const {
957
2048
  loading,
@@ -991,7 +2082,7 @@ var Badge = React30__namespace.default.forwardRef(
991
2082
  ref,
992
2083
  className: cn(
993
2084
  BASE_CLASSES,
994
- SIZE_CLASSES3[size],
2085
+ SIZE_CLASSES4[size],
995
2086
  COLOR_PALETTE_CLASSES[colorPalette],
996
2087
  className
997
2088
  ),
@@ -1200,7 +2291,7 @@ function buildShimStyle(props) {
1200
2291
  if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
1201
2292
  return Object.keys(s).length > 0 ? s : void 0;
1202
2293
  }
1203
- var Button = React30__namespace.forwardRef(
2294
+ var Button = React33__namespace.forwardRef(
1204
2295
  function Button2(props, ref) {
1205
2296
  const {
1206
2297
  className,
@@ -1291,7 +2382,7 @@ var Button = React30__namespace.forwardRef(
1291
2382
  return button;
1292
2383
  }
1293
2384
  );
1294
- var SIZE_CLASSES4 = {
2385
+ var SIZE_CLASSES5 = {
1295
2386
  "2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
1296
2387
  xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
1297
2388
  sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
@@ -1300,9 +2391,9 @@ var SIZE_CLASSES4 = {
1300
2391
  function buttonVariants(opts) {
1301
2392
  const v = opts?.variant ?? "solid";
1302
2393
  const s = opts?.size ?? "md";
1303
- return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES4[s] ?? ""].filter(Boolean).join(" ");
2394
+ return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES5[s] ?? ""].filter(Boolean).join(" ");
1304
2395
  }
1305
- var ButtonGroup = React30__namespace.forwardRef(
2396
+ var ButtonGroup = React33__namespace.forwardRef(
1306
2397
  function ButtonGroup2(props, ref) {
1307
2398
  const { className, ...rest } = props;
1308
2399
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1316,7 +2407,7 @@ var ButtonGroup = React30__namespace.forwardRef(
1316
2407
  );
1317
2408
  }
1318
2409
  );
1319
- var ButtonGroupRadio = React30__namespace.forwardRef(
2410
+ var ButtonGroupRadio = React33__namespace.forwardRef(
1320
2411
  function ButtonGroupRadio2(props, ref) {
1321
2412
  const {
1322
2413
  children,
@@ -1328,24 +2419,24 @@ var ButtonGroupRadio = React30__namespace.forwardRef(
1328
2419
  className,
1329
2420
  ...rest
1330
2421
  } = props;
1331
- const firstChildValue = React30__namespace.useMemo(() => {
2422
+ const firstChildValue = React33__namespace.useMemo(() => {
1332
2423
  const firstChild = Array.isArray(children) ? children[0] : void 0;
1333
2424
  return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
1334
2425
  }, [children]);
1335
- const [value, setValue] = React30__namespace.useState(defaultValue ?? firstChildValue);
1336
- const handleItemClick = React30__namespace.useCallback((event) => {
2426
+ const [value, setValue] = React33__namespace.useState(defaultValue ?? firstChildValue);
2427
+ const handleItemClick = React33__namespace.useCallback((event) => {
1337
2428
  const v = event.currentTarget.value;
1338
2429
  setValue(v);
1339
2430
  onChange?.(v);
1340
2431
  }, [onChange]);
1341
- const clonedChildren = React30__namespace.Children.map(children, (child) => {
1342
- return React30__namespace.cloneElement(child, {
2432
+ const clonedChildren = React33__namespace.Children.map(children, (child) => {
2433
+ return React33__namespace.cloneElement(child, {
1343
2434
  onClick: handleItemClick,
1344
2435
  selected: value === child.props.value,
1345
2436
  variant
1346
2437
  });
1347
2438
  });
1348
- const childrenLength = React30__namespace.Children.count(children);
2439
+ const childrenLength = React33__namespace.Children.count(children);
1349
2440
  return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxRuntime.jsx(
1350
2441
  "div",
1351
2442
  {
@@ -1365,11 +2456,11 @@ var ButtonGroupRadio = React30__namespace.forwardRef(
1365
2456
  );
1366
2457
  var NOOP = () => {
1367
2458
  };
1368
- var CheckboxGroupContext = React30__namespace.createContext(null);
2459
+ var CheckboxGroupContext = React33__namespace.createContext(null);
1369
2460
  function useCheckboxGroupContext() {
1370
- return React30__namespace.useContext(CheckboxGroupContext);
2461
+ return React33__namespace.useContext(CheckboxGroupContext);
1371
2462
  }
1372
- var CheckboxGroupBase = React30__namespace.forwardRef(
2463
+ var CheckboxGroupBase = React33__namespace.forwardRef(
1373
2464
  function CheckboxGroup(props, ref) {
1374
2465
  const {
1375
2466
  children,
@@ -1381,10 +2472,10 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
1381
2472
  className,
1382
2473
  ...rest
1383
2474
  } = props;
1384
- const [uncontrolledValue, setUncontrolledValue] = React30__namespace.useState(defaultValue ?? []);
2475
+ const [uncontrolledValue, setUncontrolledValue] = React33__namespace.useState(defaultValue ?? []);
1385
2476
  const isControlled = controlledValue !== void 0;
1386
2477
  const value = isControlled ? controlledValue : uncontrolledValue;
1387
- const toggle = React30__namespace.useCallback(
2478
+ const toggle = React33__namespace.useCallback(
1388
2479
  (itemValue) => {
1389
2480
  const next = value.includes(itemValue) ? value.filter((v) => v !== itemValue) : [...value, itemValue];
1390
2481
  if (!isControlled) {
@@ -1394,12 +2485,12 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
1394
2485
  },
1395
2486
  [value, isControlled, onValueChange]
1396
2487
  );
1397
- React30__namespace.useEffect(() => {
2488
+ React33__namespace.useEffect(() => {
1398
2489
  if (isControlled) {
1399
2490
  setUncontrolledValue(controlledValue);
1400
2491
  }
1401
2492
  }, [isControlled, controlledValue]);
1402
- const ctx = React30__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
2493
+ const ctx = React33__namespace.useMemo(() => ({ value, toggle }), [value, toggle]);
1403
2494
  return /* @__PURE__ */ jsxRuntime.jsx(CheckboxGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
1404
2495
  "div",
1405
2496
  {
@@ -1417,7 +2508,7 @@ var CheckboxGroupBase = React30__namespace.forwardRef(
1417
2508
  }
1418
2509
  );
1419
2510
  var CheckboxGroup2 = CheckboxGroupBase;
1420
- var SIZE_CLASSES5 = {
2511
+ var SIZE_CLASSES6 = {
1421
2512
  sm: {
1422
2513
  root: "gap-1.5",
1423
2514
  control: "h-3.5 w-3.5 rounded-sm",
@@ -1457,7 +2548,7 @@ var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
1457
2548
  children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0H12V2H0V0Z", fill: "currentColor" })
1458
2549
  }
1459
2550
  );
1460
- var CheckboxBase = React30__namespace.forwardRef(
2551
+ var CheckboxBase = React33__namespace.forwardRef(
1461
2552
  function Checkbox(props, ref) {
1462
2553
  const {
1463
2554
  icon,
@@ -1478,8 +2569,8 @@ var CheckboxBase = React30__namespace.forwardRef(
1478
2569
  ...rest
1479
2570
  } = props;
1480
2571
  const group = useCheckboxGroupContext();
1481
- const hiddenInputRef = React30__namespace.useRef(null);
1482
- const setHiddenInputRef = React30__namespace.useCallback(
2572
+ const hiddenInputRef = React33__namespace.useRef(null);
2573
+ const setHiddenInputRef = React33__namespace.useCallback(
1483
2574
  (node) => {
1484
2575
  hiddenInputRef.current = node;
1485
2576
  if (typeof ref === "function") {
@@ -1492,7 +2583,7 @@ var CheckboxBase = React30__namespace.forwardRef(
1492
2583
  );
1493
2584
  const isInGroup = group !== null && value !== void 0;
1494
2585
  const groupChecked = isInGroup ? group.value.includes(value) : void 0;
1495
- const [internalChecked, setInternalChecked] = React30__namespace.useState(
2586
+ const [internalChecked, setInternalChecked] = React33__namespace.useState(
1496
2587
  defaultChecked ?? false
1497
2588
  );
1498
2589
  const isControlled = checkedProp !== void 0 || isInGroup;
@@ -1504,7 +2595,7 @@ var CheckboxBase = React30__namespace.forwardRef(
1504
2595
  } else {
1505
2596
  checkedState = internalChecked;
1506
2597
  }
1507
- const handleCheckedChange = React30__namespace.useCallback(
2598
+ const handleCheckedChange = React33__namespace.useCallback(
1508
2599
  (nextChecked) => {
1509
2600
  if (readOnly) return;
1510
2601
  if (!isControlled) {
@@ -1527,7 +2618,7 @@ var CheckboxBase = React30__namespace.forwardRef(
1527
2618
  },
1528
2619
  [readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
1529
2620
  );
1530
- const sizeClasses2 = SIZE_CLASSES5[size];
2621
+ const sizeClasses2 = SIZE_CLASSES6[size];
1531
2622
  return /* @__PURE__ */ jsxRuntime.jsxs(
1532
2623
  "label",
1533
2624
  {
@@ -1545,8 +2636,9 @@ var CheckboxBase = React30__namespace.forwardRef(
1545
2636
  ...rest,
1546
2637
  children: [
1547
2638
  /* @__PURE__ */ jsxRuntime.jsx(
1548
- RadixCheckbox__namespace.Root,
2639
+ gui.Checkbox,
1549
2640
  {
2641
+ unstyled: true,
1550
2642
  checked: checkedState,
1551
2643
  onCheckedChange: handleCheckedChange,
1552
2644
  disabled: disabled || readOnly,
@@ -1564,7 +2656,7 @@ var CheckboxBase = React30__namespace.forwardRef(
1564
2656
  "transition-colors duration-150",
1565
2657
  sizeClasses2.control
1566
2658
  ),
1567
- children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(RadixCheckbox__namespace.Indicator, { className: cn("flex items-center justify-center", sizeClasses2.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, { className: sizeClasses2.icon }) : /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: sizeClasses2.icon }) })
2659
+ children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(gui.Checkbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses2.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, { className: sizeClasses2.icon }) : /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: sizeClasses2.icon }) })
1568
2660
  }
1569
2661
  ),
1570
2662
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1668,7 +2760,7 @@ function resolveSpacing(v) {
1668
2760
  }
1669
2761
  return void 0;
1670
2762
  }
1671
- var Link = React30__namespace.default.forwardRef(
2763
+ var Link = React33__namespace.default.forwardRef(
1672
2764
  function Link2(props, ref) {
1673
2765
  const {
1674
2766
  external,
@@ -1757,7 +2849,7 @@ var Link = React30__namespace.default.forwardRef(
1757
2849
  ) });
1758
2850
  }
1759
2851
  );
1760
- var LinkBox = React30__namespace.default.forwardRef(
2852
+ var LinkBox = React33__namespace.default.forwardRef(
1761
2853
  function LinkBox2(props, ref) {
1762
2854
  const { className, ...rest } = props;
1763
2855
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1770,7 +2862,7 @@ var LinkBox = React30__namespace.default.forwardRef(
1770
2862
  );
1771
2863
  }
1772
2864
  );
1773
- var LinkOverlay = React30__namespace.default.forwardRef(
2865
+ var LinkOverlay = React33__namespace.default.forwardRef(
1774
2866
  function LinkOverlay2(props, ref) {
1775
2867
  const {
1776
2868
  children,
@@ -1851,8 +2943,8 @@ var LinkOverlay = React30__namespace.default.forwardRef(
1851
2943
  }
1852
2944
  );
1853
2945
  function useUpdateEffect(effect, deps) {
1854
- const isFirstMount = React30__namespace.default.useRef(true);
1855
- React30__namespace.default.useEffect(() => {
2946
+ const isFirstMount = React33__namespace.default.useRef(true);
2947
+ React33__namespace.default.useEffect(() => {
1856
2948
  if (isFirstMount.current) {
1857
2949
  isFirstMount.current = false;
1858
2950
  return;
@@ -1869,8 +2961,8 @@ function scrollToElement(id) {
1869
2961
  var CUT_ID = "CollapsibleDetails";
1870
2962
  var CollapsibleDetails = (props) => {
1871
2963
  const { children, id = CUT_ID, onClick, isExpanded: isExpandedProp = false, text: textProp, loading, noScroll, ...rest } = props;
1872
- const [isExpanded, setIsExpanded] = React30__namespace.default.useState(isExpandedProp);
1873
- const handleClick = React30__namespace.default.useCallback((event) => {
2964
+ const [isExpanded, setIsExpanded] = React33__namespace.default.useState(isExpandedProp);
2965
+ const handleClick = React33__namespace.default.useCallback((event) => {
1874
2966
  setIsExpanded((flag) => !flag);
1875
2967
  if (!noScroll) {
1876
2968
  scrollToElement(id);
@@ -1901,11 +2993,11 @@ var CollapsibleDetails = (props) => {
1901
2993
  var CollapsibleList = (props) => {
1902
2994
  const CUT_LENGTH = 3;
1903
2995
  const { items, renderItem, triggerProps, cutLength = CUT_LENGTH, text: textProp, defaultExpanded = false, className, ...rest } = props;
1904
- const [isExpanded, setIsExpanded] = React30__namespace.default.useState(defaultExpanded);
1905
- React30__namespace.default.useEffect(() => {
2996
+ const [isExpanded, setIsExpanded] = React33__namespace.default.useState(defaultExpanded);
2997
+ React33__namespace.default.useEffect(() => {
1906
2998
  setIsExpanded(defaultExpanded);
1907
2999
  }, [defaultExpanded]);
1908
- const handleToggle = React30__namespace.default.useCallback(() => {
3000
+ const handleToggle = React33__namespace.default.useCallback(() => {
1909
3001
  setIsExpanded((flag) => !flag);
1910
3002
  }, []);
1911
3003
  const text = isExpanded ? textProp?.[1] ?? "Hide" : textProp?.[0] ?? "Show all";
@@ -1922,10 +3014,10 @@ var CollapsibleList = (props) => {
1922
3014
  ) })
1923
3015
  ] }) });
1924
3016
  };
1925
- var ColorModeContext = React30__namespace.createContext(void 0);
3017
+ var ColorModeContext = React33__namespace.createContext(void 0);
1926
3018
  function ColorModeProvider(props) {
1927
3019
  const { children, defaultTheme = "light", value: controlledValue, onValueChange } = props;
1928
- const [internalMode, setInternalMode] = React30__namespace.useState(() => {
3020
+ const [internalMode, setInternalMode] = React33__namespace.useState(() => {
1929
3021
  if (controlledValue === "dark" || controlledValue === "light") {
1930
3022
  return controlledValue;
1931
3023
  }
@@ -1935,7 +3027,7 @@ function ColorModeProvider(props) {
1935
3027
  return defaultTheme === "dark" ? "dark" : "light";
1936
3028
  });
1937
3029
  const colorMode = controlledValue === "dark" || controlledValue === "light" ? controlledValue : internalMode;
1938
- const setColorMode = React30__namespace.useCallback((mode) => {
3030
+ const setColorMode = React33__namespace.useCallback((mode) => {
1939
3031
  const resolved = mode === "dark" ? "dark" : "light";
1940
3032
  setInternalMode(resolved);
1941
3033
  onValueChange?.(resolved);
@@ -1944,19 +3036,19 @@ function ColorModeProvider(props) {
1944
3036
  document.documentElement.classList.toggle("light", resolved === "light");
1945
3037
  }
1946
3038
  }, [onValueChange]);
1947
- const toggleColorMode = React30__namespace.useCallback(() => {
3039
+ const toggleColorMode = React33__namespace.useCallback(() => {
1948
3040
  setColorMode(colorMode === "dark" ? "light" : "dark");
1949
3041
  }, [colorMode, setColorMode]);
1950
- const ctx = React30__namespace.useMemo(
3042
+ const ctx = React33__namespace.useMemo(
1951
3043
  () => ({ colorMode, setColorMode, toggleColorMode }),
1952
3044
  [colorMode, setColorMode, toggleColorMode]
1953
3045
  );
1954
3046
  return /* @__PURE__ */ jsxRuntime.jsx(ColorModeContext.Provider, { value: ctx, children });
1955
3047
  }
1956
3048
  function useColorMode() {
1957
- const ctx = React30__namespace.useContext(ColorModeContext);
3049
+ const ctx = React33__namespace.useContext(ColorModeContext);
1958
3050
  if (!ctx) {
1959
- const [mode, setMode] = React30__namespace.useState(() => {
3051
+ const [mode, setMode] = React33__namespace.useState(() => {
1960
3052
  if (typeof document !== "undefined" && document.documentElement.classList.contains("dark")) {
1961
3053
  return "dark";
1962
3054
  }
@@ -2000,9 +3092,9 @@ function BackToButton({ onClick }) {
2000
3092
  }
2001
3093
  );
2002
3094
  }
2003
- var DialogSizeContext = React30__namespace.createContext({ size: "md" });
3095
+ var DialogSizeContext = React33__namespace.createContext({ size: "md" });
2004
3096
  function useDialogSizeContext() {
2005
- return React30__namespace.useContext(DialogSizeContext);
3097
+ return React33__namespace.useContext(DialogSizeContext);
2006
3098
  }
2007
3099
  var CONTENT_SIZE_MAP = {
2008
3100
  sm: "max-w-[400px]",
@@ -2034,13 +3126,13 @@ var DialogRoot = ({
2034
3126
  modal = true
2035
3127
  // motionPreset is intentionally unused -- kept for API compat
2036
3128
  }) => {
2037
- const handleOpenChange = React30__namespace.useCallback(
3129
+ const handleOpenChange = React33__namespace.useCallback(
2038
3130
  (nextOpen) => {
2039
3131
  onOpenChange?.({ open: nextOpen });
2040
3132
  },
2041
3133
  [onOpenChange]
2042
3134
  );
2043
- const ctx = React30__namespace.useMemo(() => ({ size }), [size]);
3135
+ const ctx = React33__namespace.useMemo(() => ({ size }), [size]);
2044
3136
  return /* @__PURE__ */ jsxRuntime.jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
2045
3137
  gui.Dialog,
2046
3138
  {
@@ -2052,7 +3144,7 @@ var DialogRoot = ({
2052
3144
  }
2053
3145
  ) });
2054
3146
  };
2055
- var DialogContent = React30__namespace.forwardRef(function DialogContent2(props, ref) {
3147
+ var DialogContent = React33__namespace.forwardRef(function DialogContent2(props, ref) {
2056
3148
  const {
2057
3149
  children,
2058
3150
  portalled: _portalled = true,
@@ -2109,11 +3201,11 @@ var DialogContent = React30__namespace.forwardRef(function DialogContent2(props,
2109
3201
  )
2110
3202
  ] });
2111
3203
  });
2112
- var DialogCloseTrigger = React30__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
3204
+ var DialogCloseTrigger = React33__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
2113
3205
  const { className, ...rest } = props;
2114
3206
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
2115
3207
  });
2116
- var DialogHeader = React30__namespace.forwardRef(function DialogHeader2(props, ref) {
3208
+ var DialogHeader = React33__namespace.forwardRef(function DialogHeader2(props, ref) {
2117
3209
  const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
2118
3210
  const startElement = startElementProp ?? (onBackToClick ? /* @__PURE__ */ jsxRuntime.jsx(BackToButton, { onClick: onBackToClick }) : void 0);
2119
3211
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2143,7 +3235,7 @@ var DialogHeader = React30__namespace.forwardRef(function DialogHeader2(props, r
2143
3235
  }
2144
3236
  );
2145
3237
  });
2146
- var DialogBody = React30__namespace.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
3238
+ var DialogBody = React33__namespace.forwardRef(function DialogBody2({ className, pt, display, flexDir, style: styleProp, ...props }, ref) {
2147
3239
  const bodyStyle = {
2148
3240
  ...styleProp,
2149
3241
  ...pt !== void 0 ? { paddingTop: typeof pt === "number" ? `${pt * 4}px` : pt } : {},
@@ -2160,7 +3252,7 @@ var DialogBody = React30__namespace.forwardRef(function DialogBody2({ className,
2160
3252
  }
2161
3253
  );
2162
3254
  });
2163
- var DialogFooter = React30__namespace.forwardRef(function DialogFooter2({ className, ...props }, ref) {
3255
+ var DialogFooter = React33__namespace.forwardRef(function DialogFooter2({ className, ...props }, ref) {
2164
3256
  return /* @__PURE__ */ jsxRuntime.jsx(
2165
3257
  "div",
2166
3258
  {
@@ -2172,138 +3264,15 @@ var DialogFooter = React30__namespace.forwardRef(function DialogFooter2({ classN
2172
3264
  });
2173
3265
  var DialogBackdrop = gui.Dialog.Overlay;
2174
3266
  var DialogTitle = gui.Dialog.Title;
2175
- var DialogDescription = gui.Dialog.Description;
2176
- var DialogTrigger = gui.Dialog.Trigger;
2177
- var DialogActionTrigger = gui.Dialog.Close;
2178
- var DrawerPlacementContext = React30__namespace.createContext("right");
2179
- var DrawerSizeContext = React30__namespace.createContext("md");
2180
- var DrawerRoot = (props) => {
2181
- const {
2182
- children,
2183
- open,
2184
- defaultOpen,
2185
- onOpenChange,
2186
- placement = "right",
2187
- modal = true,
2188
- size = "md"
2189
- } = props;
2190
- const handleOpenChange = React30__namespace.useCallback((nextOpen) => {
2191
- onOpenChange?.({ open: nextOpen });
2192
- }, [onOpenChange]);
2193
- return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
2194
- RadixDialog__namespace.Root,
2195
- {
2196
- open,
2197
- defaultOpen,
2198
- onOpenChange: handleOpenChange,
2199
- modal,
2200
- children
2201
- }
2202
- ) }) });
2203
- };
2204
- var PLACEMENT_CLASSES = {
2205
- right: [
2206
- "inset-y-0 right-0",
2207
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
2208
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
2209
- ].join(" "),
2210
- left: [
2211
- "inset-y-0 left-0",
2212
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
2213
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
2214
- ].join(" "),
2215
- top: [
2216
- "inset-x-0 top-0",
2217
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
2218
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
2219
- ].join(" "),
2220
- bottom: [
2221
- "inset-x-0 bottom-0",
2222
- "data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
2223
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
2224
- ].join(" ")
2225
- };
2226
- var SIZE_CLASSES6 = {
2227
- right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
2228
- left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
2229
- top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
2230
- bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
2231
- };
2232
- var DrawerContent = React30__namespace.forwardRef(
2233
- function DrawerContent2(props, ref) {
2234
- const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
2235
- const placement = React30__namespace.useContext(DrawerPlacementContext);
2236
- const size = React30__namespace.useContext(DrawerSizeContext);
2237
- const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2238
- backdrop && /* @__PURE__ */ jsxRuntime.jsx(
2239
- RadixDialog__namespace.Overlay,
2240
- {
2241
- className: cn(
2242
- "fixed inset-0 z-50 bg-black/50",
2243
- "data-[state=open]:animate-in data-[state=open]:fade-in-0",
2244
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
2245
- )
2246
- }
2247
- ),
2248
- /* @__PURE__ */ jsxRuntime.jsx(
2249
- RadixDialog__namespace.Content,
2250
- {
2251
- ref,
2252
- className: cn(
2253
- "fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
2254
- PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
2255
- SIZE_CLASSES6[placement]?.[size] ?? SIZE_CLASSES6.right?.md,
2256
- className
2257
- ),
2258
- ...rest,
2259
- children
2260
- }
2261
- )
2262
- ] });
2263
- if (portalled) {
2264
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
2265
- }
2266
- return content;
2267
- }
2268
- );
2269
- var DrawerCloseTrigger = React30__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
2270
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2271
- CloseButton,
2272
- {
2273
- ref,
2274
- className: cn("absolute top-7 right-5", props.className),
2275
- ...props
2276
- }
2277
- ) });
2278
- });
2279
- var DrawerTrigger = (props) => {
2280
- const { asChild = true, ...rest } = props;
2281
- return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
2282
- };
2283
- var DrawerHeader = React30__namespace.forwardRef(
2284
- function DrawerHeader2({ className, ...props }, ref) {
2285
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
2286
- }
2287
- );
2288
- var DrawerBody = React30__namespace.forwardRef(
2289
- function DrawerBody2({ className, ...props }, ref) {
2290
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
2291
- }
2292
- );
2293
- var DrawerFooter = React30__namespace.forwardRef(
2294
- function DrawerFooter2({ className, ...props }, ref) {
2295
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
2296
- }
2297
- );
2298
- var DrawerTitle = RadixDialog__namespace.Title;
2299
- var DrawerDescription = RadixDialog__namespace.Description;
2300
- var DrawerActionTrigger = RadixDialog__namespace.Close;
3267
+ var DialogDescription = gui.Dialog.Description;
3268
+ var DialogTrigger = gui.Dialog.Trigger;
3269
+ var DialogActionTrigger = gui.Dialog.Close;
2301
3270
  var apos = "\u2019";
2302
3271
  function upperFirst(str) {
2303
3272
  return str.charAt(0).toUpperCase() + str.slice(1);
2304
3273
  }
2305
3274
  var ICONS = {};
2306
- var EmptyState = React30__namespace.forwardRef(
3275
+ var EmptyState = React33__namespace.forwardRef(
2307
3276
  function EmptyState2(props, ref) {
2308
3277
  const { title, description, term, type = "query", icon, children, className, ...rest } = props;
2309
3278
  const titleContent = (() => {
@@ -2363,7 +3332,7 @@ function getComponentDisplayName(type) {
2363
3332
  if ("displayName" in type) return type.displayName;
2364
3333
  return void 0;
2365
3334
  }
2366
- var Field = React30__namespace.forwardRef(
3335
+ var Field = React33__namespace.forwardRef(
2367
3336
  function Field2(props, ref) {
2368
3337
  const {
2369
3338
  label,
@@ -2415,14 +3384,14 @@ var Field = React30__namespace.forwardRef(
2415
3384
  }
2416
3385
  );
2417
3386
  const helperTextElement = helperText ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-xs text-[var(--color-text-secondary,theme(colors.gray.400))]", children: helperText }) : null;
2418
- const child2 = React30__namespace.Children.only(children);
3387
+ const child2 = React33__namespace.Children.only(children);
2419
3388
  const isInputGroup = getComponentDisplayName(child2.type) === "InputGroup";
2420
3389
  if (isInputGroup) {
2421
- const inputElement2 = React30__namespace.cloneElement(
2422
- React30__namespace.Children.only(child2.props.children),
3390
+ const inputElement2 = React33__namespace.cloneElement(
3391
+ React33__namespace.Children.only(child2.props.children),
2423
3392
  injectedProps2
2424
3393
  );
2425
- const groupInputElement = React30__namespace.cloneElement(
3394
+ const groupInputElement = React33__namespace.cloneElement(
2426
3395
  child2,
2427
3396
  {},
2428
3397
  inputElement2,
@@ -2445,7 +3414,7 @@ var Field = React30__namespace.forwardRef(
2445
3414
  }
2446
3415
  );
2447
3416
  }
2448
- const inputElement = React30__namespace.cloneElement(child2, injectedProps2);
3417
+ const inputElement = React33__namespace.cloneElement(child2, injectedProps2);
2449
3418
  return /* @__PURE__ */ jsxRuntime.jsxs(
2450
3419
  "div",
2451
3420
  {
@@ -2467,8 +3436,8 @@ var Field = React30__namespace.forwardRef(
2467
3436
  const injectedProps = {
2468
3437
  size
2469
3438
  };
2470
- const child = React30__namespace.Children.only(children);
2471
- const clonedChild = React30__namespace.cloneElement(child, injectedProps);
3439
+ const child = React33__namespace.Children.only(children);
3440
+ const clonedChild = React33__namespace.cloneElement(child, injectedProps);
2472
3441
  return /* @__PURE__ */ jsxRuntime.jsxs(
2473
3442
  "div",
2474
3443
  {
@@ -2504,22 +3473,23 @@ var Field = React30__namespace.forwardRef(
2504
3473
  );
2505
3474
  }
2506
3475
  );
2507
- var LEVEL_TAG = { "1": "h1", "2": "h2", "3": "h3" };
3476
+ var LEVEL_TAG = { "1": gui.H1, "2": gui.H2, "3": gui.H3 };
2508
3477
  var LEVEL_CLASSES = {
2509
3478
  "1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
2510
3479
  "2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
2511
3480
  "3": "text-[14px] leading-[20px] font-semibold lg:text-[18px] lg:leading-[24px] lg:font-medium"
2512
3481
  };
2513
3482
  var BASE_CLASSES4 = "font-heading text-heading";
2514
- var Heading = React30__namespace.default.forwardRef(
3483
+ var Heading = React33__namespace.default.forwardRef(
2515
3484
  function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
2516
- const Tag3 = level ? LEVEL_TAG[level] : "h2";
3485
+ const Tag3 = level ? LEVEL_TAG[level] : gui.H2;
2517
3486
  const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
2518
3487
  const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
2519
3488
  return /* @__PURE__ */ jsxRuntime.jsx(
2520
3489
  Tag3,
2521
3490
  {
2522
3491
  ref,
3492
+ unstyled: true,
2523
3493
  className: cn(BASE_CLASSES4, levelClasses, className),
2524
3494
  style: mergedStyle,
2525
3495
  ...rest
@@ -2597,7 +3567,7 @@ var ICON_SIZE_CLASSES = {
2597
3567
  md: "[&_svg]:size-5"
2598
3568
  };
2599
3569
  var SP2 = 4;
2600
- var IconButton = React30__namespace.forwardRef(
3570
+ var IconButton = React33__namespace.forwardRef(
2601
3571
  function IconButton2(props, ref) {
2602
3572
  const {
2603
3573
  size,
@@ -2648,7 +3618,7 @@ var IconButton = React30__namespace.forwardRef(
2648
3618
  ref,
2649
3619
  size,
2650
3620
  disabled: !loadingSkeleton && (loading || disabled) || void 0,
2651
- render: _as ? React30__namespace.createElement(_as) : void 0,
3621
+ render: _as ? React33__namespace.createElement(_as) : void 0,
2652
3622
  className: combinedClassName,
2653
3623
  style: mergedStyle,
2654
3624
  ...expanded ? { "data-expanded": true } : {},
@@ -2819,31 +3789,31 @@ function extractStyleProps(props) {
2819
3789
  }
2820
3790
  return { styleProps, rest };
2821
3791
  }
2822
- var Image2 = React30__namespace.default.forwardRef(
2823
- function Image3(props, ref) {
3792
+ var Image = React33__namespace.default.forwardRef(
3793
+ function Image2(props, ref) {
2824
3794
  const { fallback, src, onLoad, onError, skeletonWidth, skeletonHeight, alt, className, style: styleProp, ...allRest } = props;
2825
3795
  const { styleProps, rest: extraProps } = extractStyleProps(allRest);
2826
- const [loading, setLoading] = React30__namespace.default.useState(true);
2827
- const [error, setError] = React30__namespace.default.useState(false);
2828
- const handleLoadError = React30__namespace.default.useCallback((event) => {
3796
+ const [loading, setLoading] = React33__namespace.default.useState(true);
3797
+ const [error, setError] = React33__namespace.default.useState(false);
3798
+ const handleLoadError = React33__namespace.default.useCallback((event) => {
2829
3799
  setError(true);
2830
3800
  setLoading(false);
2831
3801
  onError?.(event);
2832
3802
  }, [onError]);
2833
- const handleLoadSuccess = React30__namespace.default.useCallback((event) => {
3803
+ const handleLoadSuccess = React33__namespace.default.useCallback((event) => {
2834
3804
  setLoading(false);
2835
3805
  onLoad?.(event);
2836
3806
  }, [onLoad]);
2837
3807
  const passthroughProps = allRest;
2838
3808
  if (!src && fallback) {
2839
- if (React30__namespace.default.isValidElement(fallback)) {
2840
- return React30__namespace.default.cloneElement(fallback, passthroughProps);
3809
+ if (React33__namespace.default.isValidElement(fallback)) {
3810
+ return React33__namespace.default.cloneElement(fallback, passthroughProps);
2841
3811
  }
2842
3812
  return fallback;
2843
3813
  }
2844
3814
  if (error) {
2845
- if (React30__namespace.default.isValidElement(fallback)) {
2846
- return React30__namespace.default.cloneElement(fallback, passthroughProps);
3815
+ if (React33__namespace.default.isValidElement(fallback)) {
3816
+ return React33__namespace.default.cloneElement(fallback, passthroughProps);
2847
3817
  }
2848
3818
  return fallback;
2849
3819
  }
@@ -2899,9 +3869,9 @@ var INPUT_VARIANT_CLASSES = {
2899
3869
  filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
2900
3870
  unstyled: "border-0 bg-transparent p-0 h-auto"
2901
3871
  };
2902
- var Input = React30__namespace.default.forwardRef(
3872
+ var Input = React33__namespace.default.forwardRef(
2903
3873
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
2904
- const handleChange = React30__namespace.default.useCallback(
3874
+ const handleChange = React33__namespace.default.useCallback(
2905
3875
  (event) => {
2906
3876
  onChange?.(event);
2907
3877
  onChangeText?.(event.target.value);
@@ -2909,9 +3879,10 @@ var Input = React30__namespace.default.forwardRef(
2909
3879
  [onChange, onChangeText]
2910
3880
  );
2911
3881
  return /* @__PURE__ */ jsxRuntime.jsx(
2912
- "input",
3882
+ gui.Input,
2913
3883
  {
2914
3884
  ref,
3885
+ unstyled: true,
2915
3886
  className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
2916
3887
  ...rest,
2917
3888
  onChange: handleChange
@@ -2925,7 +3896,7 @@ function getComponentDisplayName2(type) {
2925
3896
  if ("displayName" in type) return type.displayName;
2926
3897
  return void 0;
2927
3898
  }
2928
- var InputGroup = React30__namespace.forwardRef(
3899
+ var InputGroup = React33__namespace.forwardRef(
2929
3900
  function InputGroup2(props, ref) {
2930
3901
  const {
2931
3902
  startElement,
@@ -2938,11 +3909,11 @@ var InputGroup = React30__namespace.forwardRef(
2938
3909
  className,
2939
3910
  ...rest
2940
3911
  } = props;
2941
- const startElementRef = React30__namespace.useRef(null);
2942
- const endElementRef = React30__namespace.useRef(null);
2943
- const groupRef = React30__namespace.useRef(null);
2944
- const [inlinePaddings, setInlinePaddings] = React30__namespace.useState();
2945
- const calculateInlinePaddings = React30__namespace.useCallback(() => {
3912
+ const startElementRef = React33__namespace.useRef(null);
3913
+ const endElementRef = React33__namespace.useRef(null);
3914
+ const groupRef = React33__namespace.useRef(null);
3915
+ const [inlinePaddings, setInlinePaddings] = React33__namespace.useState();
3916
+ const calculateInlinePaddings = React33__namespace.useCallback(() => {
2946
3917
  const startWidth = startElementRef.current?.getBoundingClientRect().width ?? 0;
2947
3918
  const endWidth = endElementRef.current?.getBoundingClientRect().width ?? 0;
2948
3919
  setInlinePaddings({
@@ -2950,7 +3921,7 @@ var InputGroup = React30__namespace.forwardRef(
2950
3921
  end: endWidth
2951
3922
  });
2952
3923
  }, []);
2953
- React30__namespace.useEffect(() => {
3924
+ React33__namespace.useEffect(() => {
2954
3925
  if (!groupRef.current) return;
2955
3926
  let timeoutId;
2956
3927
  const intersectionObserver = new IntersectionObserver(
@@ -2970,7 +3941,7 @@ var InputGroup = React30__namespace.forwardRef(
2970
3941
  }
2971
3942
  };
2972
3943
  }, [calculateInlinePaddings]);
2973
- React30__namespace.useEffect(() => {
3944
+ React33__namespace.useEffect(() => {
2974
3945
  calculateInlinePaddings();
2975
3946
  const resizeHandler = esToolkit.debounce(calculateInlinePaddings, 300);
2976
3947
  const resizeObserver = new ResizeObserver(resizeHandler);
@@ -2981,7 +3952,7 @@ var InputGroup = React30__namespace.forwardRef(
2981
3952
  resizeObserver.disconnect();
2982
3953
  };
2983
3954
  }, [calculateInlinePaddings]);
2984
- const combinedRef = React30__namespace.useCallback((node) => {
3955
+ const combinedRef = React33__namespace.useCallback((node) => {
2985
3956
  groupRef.current = node;
2986
3957
  if (typeof ref === "function") {
2987
3958
  ref(node);
@@ -3010,11 +3981,11 @@ var InputGroup = React30__namespace.forwardRef(
3010
3981
  children: startElement
3011
3982
  }
3012
3983
  ),
3013
- React30__namespace.Children.map(children, (child) => {
3984
+ React33__namespace.Children.map(children, (child) => {
3014
3985
  if (getComponentDisplayName2(child.type) !== "FieldInput") {
3015
3986
  return child;
3016
3987
  }
3017
- return React30__namespace.cloneElement(child, {
3988
+ return React33__namespace.cloneElement(child, {
3018
3989
  ...startElement && { ps: startOffset ?? (inlinePaddings?.start ? `${inlinePaddings.start}px` : void 0) },
3019
3990
  ...endElement && { pe: endOffset ?? (inlinePaddings?.end ? `${inlinePaddings.end}px` : void 0) },
3020
3991
  // hide input value and placeholder for the first render
@@ -3040,262 +4011,6 @@ var InputGroup = React30__namespace.forwardRef(
3040
4011
  }
3041
4012
  );
3042
4013
  InputGroup.displayName = "InputGroup";
3043
- function parsePlacement(placement) {
3044
- if (!placement) {
3045
- return { side: "bottom", align: "start" };
3046
- }
3047
- const parts = placement.split("-");
3048
- const side = parts[0] ?? "bottom";
3049
- const alignPart = parts[1];
3050
- let align = "center";
3051
- if (alignPart === "start") {
3052
- align = "start";
3053
- } else if (alignPart === "end") {
3054
- align = "end";
3055
- }
3056
- return { side, align };
3057
- }
3058
- var PositioningContext = React30__namespace.createContext({
3059
- side: "bottom",
3060
- align: "start",
3061
- sideOffset: 4,
3062
- alignOffset: 0
3063
- });
3064
- var MenuRoot = (props) => {
3065
- const {
3066
- children,
3067
- open,
3068
- defaultOpen,
3069
- onOpenChange,
3070
- positioning,
3071
- modal = true,
3072
- // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
3073
- // mount/unmount automatically.
3074
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3075
- lazyMount: _lazyMount,
3076
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3077
- unmountOnExit: _unmountOnExit
3078
- } = props;
3079
- const mergedPositioning = {
3080
- placement: "bottom-start",
3081
- ...positioning,
3082
- offset: {
3083
- mainAxis: 4,
3084
- ...positioning?.offset
3085
- }
3086
- };
3087
- const { side, align } = parsePlacement(mergedPositioning.placement);
3088
- const positioningValue = React30__namespace.useMemo(() => ({
3089
- side,
3090
- align,
3091
- sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
3092
- alignOffset: mergedPositioning.offset?.crossAxis ?? 0
3093
- }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
3094
- const handleOpenChange = React30__namespace.useCallback((isOpen) => {
3095
- onOpenChange?.({ open: isOpen });
3096
- }, [onOpenChange]);
3097
- return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
3098
- DropdownMenu__namespace.Root,
3099
- {
3100
- open,
3101
- defaultOpen,
3102
- onOpenChange: handleOpenChange,
3103
- modal,
3104
- children
3105
- }
3106
- ) });
3107
- };
3108
- var MenuTrigger = React30__namespace.forwardRef(function MenuTrigger2(props, ref) {
3109
- const { asChild = false, ...rest } = props;
3110
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
3111
- });
3112
- var MenuContent = React30__namespace.forwardRef(function MenuContent2(props, ref) {
3113
- const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
3114
- const positioning = React30__namespace.useContext(PositioningContext);
3115
- const mergedStyle = {
3116
- ...style,
3117
- ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
3118
- ...minW !== void 0 ? { minWidth: minW } : {}
3119
- };
3120
- const content = /* @__PURE__ */ jsxRuntime.jsx(
3121
- DropdownMenu__namespace.Content,
3122
- {
3123
- ref,
3124
- side: positioning.side,
3125
- align: positioning.align,
3126
- sideOffset: positioning.sideOffset,
3127
- alignOffset: positioning.alignOffset,
3128
- className: cn(
3129
- "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
3130
- "border border-[var(--color-popover-border,var(--color-border-divider))]",
3131
- "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
3132
- "shadow-[0_4px_12px_var(--color-popover-shadow)]",
3133
- "outline-none",
3134
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
3135
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
3136
- "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
3137
- "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3138
- className
3139
- ),
3140
- style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
3141
- ...rest
3142
- }
3143
- );
3144
- if (!portalled) {
3145
- return content;
3146
- }
3147
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
3148
- });
3149
- var MenuItem = React30__namespace.forwardRef(function MenuItem2(props, ref) {
3150
- const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
3151
- return /* @__PURE__ */ jsxRuntime.jsx(
3152
- DropdownMenu__namespace.Item,
3153
- {
3154
- ref,
3155
- asChild,
3156
- disabled,
3157
- onClick,
3158
- className: cn(
3159
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
3160
- "outline-none transition-colors",
3161
- "text-[var(--color-text-primary,inherit)]",
3162
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3163
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3164
- className
3165
- ),
3166
- ...rest,
3167
- children
3168
- }
3169
- );
3170
- });
3171
- var MenuItemText = React30__namespace.forwardRef(function MenuItemText2(props, ref) {
3172
- const { className, ...rest } = props;
3173
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
3174
- });
3175
- React30__namespace.forwardRef(function MenuItemCommand2(props, ref) {
3176
- const { className, ...rest } = props;
3177
- return /* @__PURE__ */ jsxRuntime.jsx(
3178
- "span",
3179
- {
3180
- ref,
3181
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
3182
- ...rest
3183
- }
3184
- );
3185
- });
3186
- var MenuSeparator = React30__namespace.forwardRef(function MenuSeparator2(props, ref) {
3187
- const { className, ...rest } = props;
3188
- return /* @__PURE__ */ jsxRuntime.jsx(
3189
- DropdownMenu__namespace.Separator,
3190
- {
3191
- ref,
3192
- className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
3193
- ...rest
3194
- }
3195
- );
3196
- });
3197
- var MenuItemGroup = React30__namespace.forwardRef(function MenuItemGroup2(props, ref) {
3198
- const { title, children, className, ...rest } = props;
3199
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
3200
- title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
3201
- children
3202
- ] });
3203
- });
3204
- var MenuArrow = React30__namespace.forwardRef(function MenuArrow2(props, ref) {
3205
- const { className, ...rest } = props;
3206
- return /* @__PURE__ */ jsxRuntime.jsx(
3207
- DropdownMenu__namespace.Arrow,
3208
- {
3209
- ref,
3210
- className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
3211
- ...rest
3212
- }
3213
- );
3214
- });
3215
- var MenuCheckboxItem = React30__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
3216
- const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
3217
- return /* @__PURE__ */ jsxRuntime.jsxs(
3218
- DropdownMenu__namespace.CheckboxItem,
3219
- {
3220
- ref,
3221
- checked,
3222
- onCheckedChange,
3223
- onClick,
3224
- className: cn(
3225
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
3226
- "outline-none transition-colors",
3227
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3228
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3229
- className
3230
- ),
3231
- ...rest,
3232
- children: [
3233
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuCheck, { className: "h-4 w-4" }) }) }),
3234
- children
3235
- ]
3236
- }
3237
- );
3238
- });
3239
- var MenuRadioItemGroup = React30__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
3240
- const { value, onValueChange, ...rest } = props;
3241
- return /* @__PURE__ */ jsxRuntime.jsx(
3242
- DropdownMenu__namespace.RadioGroup,
3243
- {
3244
- ref,
3245
- value,
3246
- onValueChange,
3247
- ...rest
3248
- }
3249
- );
3250
- });
3251
- var MenuRadioItem = React30__namespace.forwardRef(function MenuRadioItem2(props, ref) {
3252
- const { className, children, value, onClick, ...rest } = props;
3253
- const { value: _v, ...radixRest } = rest;
3254
- return /* @__PURE__ */ jsxRuntime.jsxs(
3255
- DropdownMenu__namespace.RadioItem,
3256
- {
3257
- ref,
3258
- value,
3259
- onClick,
3260
- className: cn(
3261
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
3262
- "outline-none transition-colors",
3263
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3264
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3265
- className
3266
- ),
3267
- children: [
3268
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuCheck, { className: "h-4 w-4" }) }) }),
3269
- /* @__PURE__ */ jsxRuntime.jsx("span", { children })
3270
- ]
3271
- }
3272
- );
3273
- });
3274
- React30__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
3275
- const { asChild: _asChild, ...rest } = props;
3276
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
3277
- });
3278
- var MenuTriggerItem = React30__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
3279
- const { startIcon, children, className, ...rest } = props;
3280
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
3281
- DropdownMenu__namespace.SubTrigger,
3282
- {
3283
- ref,
3284
- className: cn(
3285
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
3286
- "outline-none transition-colors",
3287
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
3288
- className
3289
- ),
3290
- ...rest,
3291
- children: [
3292
- startIcon,
3293
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
3294
- /* @__PURE__ */ jsxRuntime.jsx(lu.LuChevronRight, { className: "h-4 w-4" })
3295
- ]
3296
- }
3297
- ) });
3298
- });
3299
4014
  var INPUT_BASE2 = [
3300
4015
  "w-10 h-10",
3301
4016
  "text-center text-sm font-medium",
@@ -3310,7 +4025,7 @@ var INPUT_BASE2 = [
3310
4025
  ].join(" ");
3311
4026
  var INPUT_FILLED = "border-[var(--color-input-border)]";
3312
4027
  var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
3313
- var PinInput = React30__namespace.forwardRef(
4028
+ var PinInput = React33__namespace.forwardRef(
3314
4029
  function PinInput2(props, ref) {
3315
4030
  const {
3316
4031
  count = 6,
@@ -3328,12 +4043,12 @@ var PinInput = React30__namespace.forwardRef(
3328
4043
  bgColor,
3329
4044
  className
3330
4045
  } = props;
3331
- const inputRefs = React30__namespace.useRef([]);
3332
- const values = React30__namespace.useMemo(
4046
+ const inputRefs = React33__namespace.useRef([]);
4047
+ const values = React33__namespace.useMemo(
3333
4048
  () => controlledValue ?? Array.from({ length: count }).fill(""),
3334
4049
  [controlledValue, count]
3335
4050
  );
3336
- const updateValue = React30__namespace.useCallback((index, char) => {
4051
+ const updateValue = React33__namespace.useCallback((index, char) => {
3337
4052
  const next = [...values];
3338
4053
  next[index] = char;
3339
4054
  onValueChange?.({ value: next });
@@ -3341,11 +4056,11 @@ var PinInput = React30__namespace.forwardRef(
3341
4056
  onValueComplete?.({ value: next });
3342
4057
  }
3343
4058
  }, [values, onValueChange, onValueComplete]);
3344
- const focusInput = React30__namespace.useCallback((index) => {
4059
+ const focusInput = React33__namespace.useCallback((index) => {
3345
4060
  const clamped = Math.max(0, Math.min(index, count - 1));
3346
4061
  inputRefs.current[clamped]?.focus();
3347
4062
  }, [count]);
3348
- const handleInput = React30__namespace.useCallback((index, e) => {
4063
+ const handleInput = React33__namespace.useCallback((index, e) => {
3349
4064
  const target = e.currentTarget;
3350
4065
  const char = target.value.slice(-1);
3351
4066
  updateValue(index, char);
@@ -3353,7 +4068,7 @@ var PinInput = React30__namespace.forwardRef(
3353
4068
  focusInput(index + 1);
3354
4069
  }
3355
4070
  }, [count, updateValue, focusInput]);
3356
- const handleKeyDown = React30__namespace.useCallback((index, e) => {
4071
+ const handleKeyDown = React33__namespace.useCallback((index, e) => {
3357
4072
  if (e.key === "Backspace") {
3358
4073
  if (values[index]) {
3359
4074
  updateValue(index, "");
@@ -3370,7 +4085,7 @@ var PinInput = React30__namespace.forwardRef(
3370
4085
  e.preventDefault();
3371
4086
  }
3372
4087
  }, [count, values, updateValue, focusInput]);
3373
- const handlePaste = React30__namespace.useCallback((e) => {
4088
+ const handlePaste = React33__namespace.useCallback((e) => {
3374
4089
  e.preventDefault();
3375
4090
  const pasted = e.clipboardData.getData("text/plain").trim();
3376
4091
  if (!pasted) {
@@ -3387,18 +4102,18 @@ var PinInput = React30__namespace.forwardRef(
3387
4102
  }
3388
4103
  focusInput(Math.min(chars.length, count - 1));
3389
4104
  }, [count, values, onValueChange, onValueComplete, focusInput]);
3390
- const handleFocus = React30__namespace.useCallback((e) => {
4105
+ const handleFocus = React33__namespace.useCallback((e) => {
3391
4106
  e.currentTarget.select();
3392
4107
  }, []);
3393
- const handleNoop = React30__namespace.useCallback(() => {
4108
+ const handleNoop = React33__namespace.useCallback(() => {
3394
4109
  }, []);
3395
- const setInputRef = React30__namespace.useCallback((index) => (el) => {
4110
+ const setInputRef = React33__namespace.useCallback((index) => (el) => {
3396
4111
  inputRefs.current[index] = el;
3397
4112
  }, []);
3398
- const onInputAtIndex = React30__namespace.useCallback((index) => (e) => {
4113
+ const onInputAtIndex = React33__namespace.useCallback((index) => (e) => {
3399
4114
  handleInput(index, e);
3400
4115
  }, [handleInput]);
3401
- const onKeyDownAtIndex = React30__namespace.useCallback((index) => (e) => {
4116
+ const onKeyDownAtIndex = React33__namespace.useCallback((index) => (e) => {
3402
4117
  handleKeyDown(index, e);
3403
4118
  }, [handleKeyDown]);
3404
4119
  const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
@@ -3459,7 +4174,7 @@ function parsePlacement2(placement) {
3459
4174
  }
3460
4175
  return { side, align };
3461
4176
  }
3462
- var PositioningContext2 = React30__namespace.createContext({
4177
+ var PositioningContext2 = React33__namespace.createContext({
3463
4178
  side: "bottom",
3464
4179
  align: "start",
3465
4180
  sideOffset: 4,
@@ -3493,7 +4208,7 @@ var PopoverRoot = (props) => {
3493
4208
  }
3494
4209
  };
3495
4210
  const { side, align } = parsePlacement2(mergedPositioning.placement);
3496
- const positioningValue = React30__namespace.useMemo(() => ({
4211
+ const positioningValue = React33__namespace.useMemo(() => ({
3497
4212
  side,
3498
4213
  align,
3499
4214
  sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
@@ -3510,7 +4225,7 @@ var PopoverRoot = (props) => {
3510
4225
  autoFocus,
3511
4226
  closeOnInteractOutside
3512
4227
  ]);
3513
- const handleOpenChange = React30__namespace.useCallback((isOpen) => {
4228
+ const handleOpenChange = React33__namespace.useCallback((isOpen) => {
3514
4229
  onOpenChange?.({ open: isOpen });
3515
4230
  }, [onOpenChange]);
3516
4231
  const placement = mergedPositioning.placement ?? "bottom-start";
@@ -3528,11 +4243,11 @@ var PopoverRoot = (props) => {
3528
4243
  }
3529
4244
  ) });
3530
4245
  };
3531
- var PopoverTrigger = React30__namespace.forwardRef(function PopoverTrigger2(props, ref) {
4246
+ var PopoverTrigger = React33__namespace.forwardRef(function PopoverTrigger2(props, ref) {
3532
4247
  const { asChild = true, ...rest } = props;
3533
4248
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
3534
4249
  });
3535
- var PopoverContent = React30__namespace.forwardRef(function PopoverContent2(props, ref) {
4250
+ var PopoverContent = React33__namespace.forwardRef(function PopoverContent2(props, ref) {
3536
4251
  const { portalled = true, portalRef: _portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
3537
4252
  const resolvedW = typeof w === "object" ? w.base ?? w.lg : w;
3538
4253
  const contentStyle = {
@@ -3563,7 +4278,7 @@ var PopoverContent = React30__namespace.forwardRef(function PopoverContent2(prop
3563
4278
  }
3564
4279
  );
3565
4280
  });
3566
- var PopoverArrow = React30__namespace.forwardRef(function PopoverArrow2(props, ref) {
4281
+ var PopoverArrow = React33__namespace.forwardRef(function PopoverArrow2(props, ref) {
3567
4282
  const { className, ...rest } = props;
3568
4283
  return /* @__PURE__ */ jsxRuntime.jsx(
3569
4284
  gui.Popover.Arrow,
@@ -3575,7 +4290,7 @@ var PopoverArrow = React30__namespace.forwardRef(function PopoverArrow2(props, r
3575
4290
  }
3576
4291
  );
3577
4292
  });
3578
- var PopoverCloseTrigger = React30__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
4293
+ var PopoverCloseTrigger = React33__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
3579
4294
  const { className, ...rest } = props;
3580
4295
  return /* @__PURE__ */ jsxRuntime.jsx(
3581
4296
  gui.Popover.Close,
@@ -3589,14 +4304,14 @@ var PopoverCloseTrigger = React30__namespace.forwardRef(function PopoverCloseTri
3589
4304
  }
3590
4305
  );
3591
4306
  });
3592
- var PopoverCloseTriggerWrapper = React30__namespace.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
4307
+ var PopoverCloseTriggerWrapper = React33__namespace.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
3593
4308
  const { disabled, children, ...rest } = props;
3594
4309
  if (disabled) {
3595
4310
  return children;
3596
4311
  }
3597
4312
  return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Close, { ref, ...rest, asChild: true, children });
3598
4313
  });
3599
- var PopoverBody = React30__namespace.forwardRef(function PopoverBody2(props, ref) {
4314
+ var PopoverBody = React33__namespace.forwardRef(function PopoverBody2(props, ref) {
3600
4315
  const {
3601
4316
  className,
3602
4317
  style: styleProp,
@@ -3634,7 +4349,7 @@ var PopoverBody = React30__namespace.forwardRef(function PopoverBody2(props, ref
3634
4349
  }
3635
4350
  );
3636
4351
  });
3637
- var PopoverHeader = React30__namespace.forwardRef(function PopoverHeader2(props, ref) {
4352
+ var PopoverHeader = React33__namespace.forwardRef(function PopoverHeader2(props, ref) {
3638
4353
  const { className, ...rest } = props;
3639
4354
  return /* @__PURE__ */ jsxRuntime.jsx(
3640
4355
  "div",
@@ -3645,7 +4360,7 @@ var PopoverHeader = React30__namespace.forwardRef(function PopoverHeader2(props,
3645
4360
  }
3646
4361
  );
3647
4362
  });
3648
- var PopoverFooter = React30__namespace.forwardRef(function PopoverFooter2(props, ref) {
4363
+ var PopoverFooter = React33__namespace.forwardRef(function PopoverFooter2(props, ref) {
3649
4364
  const { className, ...rest } = props;
3650
4365
  return /* @__PURE__ */ jsxRuntime.jsx(
3651
4366
  "div",
@@ -3656,7 +4371,7 @@ var PopoverFooter = React30__namespace.forwardRef(function PopoverFooter2(props,
3656
4371
  }
3657
4372
  );
3658
4373
  });
3659
- var PopoverTitle = React30__namespace.forwardRef(function PopoverTitle2(props, ref) {
4374
+ var PopoverTitle = React33__namespace.forwardRef(function PopoverTitle2(props, ref) {
3660
4375
  const { className, ...rest } = props;
3661
4376
  return /* @__PURE__ */ jsxRuntime.jsx(
3662
4377
  "h3",
@@ -3667,7 +4382,7 @@ var PopoverTitle = React30__namespace.forwardRef(function PopoverTitle2(props, r
3667
4382
  }
3668
4383
  );
3669
4384
  });
3670
- var PopoverDescription = React30__namespace.forwardRef(function PopoverDescription2(props, ref) {
4385
+ var PopoverDescription = React33__namespace.forwardRef(function PopoverDescription2(props, ref) {
3671
4386
  const { className, ...rest } = props;
3672
4387
  return /* @__PURE__ */ jsxRuntime.jsx(
3673
4388
  "p",
@@ -3689,7 +4404,7 @@ function normalizeValue(value, min, max) {
3689
4404
  if (max <= min) return 0;
3690
4405
  return Math.round((value - min) / (max - min) * 100);
3691
4406
  }
3692
- var Progress = React30__namespace.forwardRef(
4407
+ var Progress = React33__namespace.forwardRef(
3693
4408
  function Progress2(props, ref) {
3694
4409
  const {
3695
4410
  value,
@@ -3729,10 +4444,11 @@ var Progress = React30__namespace.forwardRef(
3729
4444
  style: rootStyle,
3730
4445
  ...rest,
3731
4446
  children: /* @__PURE__ */ jsxRuntime.jsx(
3732
- RadixProgress__namespace.Root,
4447
+ gui.Progress,
3733
4448
  {
3734
4449
  value: percent,
3735
4450
  max: 100,
4451
+ unstyled: true,
3736
4452
  className: cn(
3737
4453
  "w-full overflow-hidden rounded-full",
3738
4454
  "bg-[var(--color-progress-track)]",
@@ -3741,14 +4457,15 @@ var Progress = React30__namespace.forwardRef(
3741
4457
  ),
3742
4458
  style: trackStyle,
3743
4459
  children: /* @__PURE__ */ jsxRuntime.jsx(
3744
- RadixProgress__namespace.Indicator,
4460
+ gui.Progress.Indicator,
3745
4461
  {
4462
+ unstyled: true,
4463
+ transition: "slow",
3746
4464
  className: cn(
3747
- "h-full rounded-full transition-transform duration-500 ease-out",
4465
+ "h-full rounded-full",
3748
4466
  !color && "bg-[var(--color-progress-indicator)]"
3749
4467
  ),
3750
4468
  style: {
3751
- width: `${percent}%`,
3752
4469
  ...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
3753
4470
  }
3754
4471
  }
@@ -3766,12 +4483,12 @@ var SIZE_MAP = {
3766
4483
  lg: { size: 48, thickness: 7, textClass: "text-sm" },
3767
4484
  xl: { size: 64, thickness: 8, textClass: "text-sm" }
3768
4485
  };
3769
- var Ctx = React30__namespace.createContext({
4486
+ var Ctx = React33__namespace.createContext({
3770
4487
  value: 0,
3771
4488
  size: "md",
3772
4489
  colorPalette: "blue"
3773
4490
  });
3774
- var ProgressCircleRoot = React30__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
4491
+ var ProgressCircleRoot = React33__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
3775
4492
  const {
3776
4493
  value = 0,
3777
4494
  size = "md",
@@ -3780,7 +4497,7 @@ var ProgressCircleRoot = React30__namespace.forwardRef(function ProgressCircleRo
3780
4497
  children,
3781
4498
  ...rest
3782
4499
  } = props;
3783
- const ctx = React30__namespace.useMemo(
4500
+ const ctx = React33__namespace.useMemo(
3784
4501
  () => ({ value: value ?? null, size, colorPalette }),
3785
4502
  [value, size, colorPalette]
3786
4503
  );
@@ -3798,9 +4515,9 @@ var ProgressCircleRoot = React30__namespace.forwardRef(function ProgressCircleRo
3798
4515
  }
3799
4516
  ) });
3800
4517
  });
3801
- var ProgressCircleRing = React30__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
4518
+ var ProgressCircleRing = React33__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
3802
4519
  const { trackColor, cap, color, className, ...rest } = props;
3803
- const { value, size: sizeKey } = React30__namespace.useContext(Ctx);
4520
+ const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
3804
4521
  const { size, thickness } = SIZE_MAP[sizeKey];
3805
4522
  const radius = size / 2 - thickness / 2;
3806
4523
  const circumference = 2 * Math.PI * radius;
@@ -3855,9 +4572,9 @@ var ProgressCircleRing = React30__namespace.forwardRef(function ProgressCircleRi
3855
4572
  }
3856
4573
  );
3857
4574
  });
3858
- var ProgressCircleValueText = React30__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
4575
+ var ProgressCircleValueText = React33__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
3859
4576
  const { className, children, ...rest } = props;
3860
- const { value, size: sizeKey } = React30__namespace.useContext(Ctx);
4577
+ const { value, size: sizeKey } = React33__namespace.useContext(Ctx);
3861
4578
  const { textClass } = SIZE_MAP[sizeKey];
3862
4579
  return /* @__PURE__ */ jsxRuntime.jsx(
3863
4580
  "div",
@@ -3901,8 +4618,8 @@ var SIZE_CLASSES8 = {
3901
4618
  label: "text-base"
3902
4619
  }
3903
4620
  };
3904
- var RadioSizeContext = React30__namespace.createContext("md");
3905
- var RadioGroupBase = React30__namespace.forwardRef(
4621
+ var RadioSizeContext = React33__namespace.createContext("md");
4622
+ var RadioGroupBase = React33__namespace.forwardRef(
3906
4623
  function RadioGroup2(props, ref) {
3907
4624
  const {
3908
4625
  children,
@@ -3911,7 +4628,8 @@ var RadioGroupBase = React30__namespace.forwardRef(
3911
4628
  disabled = false,
3912
4629
  readOnly = false,
3913
4630
  orientation = "vertical",
3914
- loop = true,
4631
+ // `loop` was a Radix-only knob; gui's roving focus always wraps.
4632
+ loop: _loop = true,
3915
4633
  defaultValue,
3916
4634
  value,
3917
4635
  onValueChange,
@@ -3919,7 +4637,7 @@ var RadioGroupBase = React30__namespace.forwardRef(
3919
4637
  className,
3920
4638
  ...rest
3921
4639
  } = props;
3922
- const handleValueChange = React30__namespace.useCallback(
4640
+ const handleValueChange = React33__namespace.useCallback(
3923
4641
  (nextValue) => {
3924
4642
  if (readOnly) return;
3925
4643
  onValueChange?.({ value: nextValue });
@@ -3927,14 +4645,14 @@ var RadioGroupBase = React30__namespace.forwardRef(
3927
4645
  [readOnly, onValueChange]
3928
4646
  );
3929
4647
  return /* @__PURE__ */ jsxRuntime.jsx(RadioSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
3930
- RadixRadioGroup__namespace.Root,
4648
+ gui.RadioGroup,
3931
4649
  {
3932
4650
  ref,
4651
+ unstyled: true,
3933
4652
  name,
3934
4653
  required,
3935
4654
  disabled: disabled || readOnly,
3936
4655
  orientation,
3937
- loop,
3938
4656
  defaultValue,
3939
4657
  value: value ?? void 0,
3940
4658
  onValueChange: handleValueChange,
@@ -3952,10 +4670,10 @@ var RadioGroupBase = React30__namespace.forwardRef(
3952
4670
  var RadioGroup3 = RadioGroupBase;
3953
4671
  var NOOP2 = () => {
3954
4672
  };
3955
- var RadioBase = React30__namespace.forwardRef(
4673
+ var RadioBase = React33__namespace.forwardRef(
3956
4674
  function Radio(props, ref) {
3957
4675
  const { children, inputProps, rootRef, value, disabled, className, ...rest } = props;
3958
- const size = React30__namespace.useContext(RadioSizeContext);
4676
+ const size = React33__namespace.useContext(RadioSizeContext);
3959
4677
  const sizeClasses2 = SIZE_CLASSES8[size];
3960
4678
  return /* @__PURE__ */ jsxRuntime.jsxs(
3961
4679
  "label",
@@ -3971,8 +4689,9 @@ var RadioBase = React30__namespace.forwardRef(
3971
4689
  ...rest,
3972
4690
  children: [
3973
4691
  /* @__PURE__ */ jsxRuntime.jsx(
3974
- RadixRadioGroup__namespace.Item,
4692
+ gui.RadioGroup.Item,
3975
4693
  {
4694
+ unstyled: true,
3976
4695
  value,
3977
4696
  disabled,
3978
4697
  className: cn(
@@ -3984,8 +4703,9 @@ var RadioBase = React30__namespace.forwardRef(
3984
4703
  sizeClasses2.control
3985
4704
  ),
3986
4705
  children: /* @__PURE__ */ jsxRuntime.jsx(
3987
- RadixRadioGroup__namespace.Indicator,
4706
+ gui.RadioGroup.Indicator,
3988
4707
  {
4708
+ unstyled: true,
3989
4709
  className: cn(
3990
4710
  "block rounded-full bg-gray-800 dark:bg-white",
3991
4711
  sizeClasses2.indicator
@@ -4017,23 +4737,23 @@ var RadioBase = React30__namespace.forwardRef(
4017
4737
  var Radio2 = RadioBase;
4018
4738
  var StarFilledIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.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" }) });
4019
4739
  var StarOutlineIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.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" }) });
4020
- var Rating = React30__namespace.forwardRef(
4740
+ var Rating = React33__namespace.forwardRef(
4021
4741
  function Rating2(props, ref) {
4022
4742
  const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
4023
- const [value, setValue] = React30__namespace.useState(defaultValue);
4024
- const [hoveredIndex, setHoveredIndex] = React30__namespace.useState(-1);
4743
+ const [value, setValue] = React33__namespace.useState(defaultValue);
4744
+ const [hoveredIndex, setHoveredIndex] = React33__namespace.useState(-1);
4025
4745
  const highlightedIndex = hoveredIndex >= 0 && !readOnly ? hoveredIndex + 1 : value;
4026
4746
  const label = Array.isArray(labelProp) ? labelProp[highlightedIndex - 1] : labelProp;
4027
- const handleClick = React30__namespace.useCallback((index) => () => {
4747
+ const handleClick = React33__namespace.useCallback((index) => () => {
4028
4748
  if (readOnly) return;
4029
4749
  setValue(index);
4030
4750
  onValueChange?.({ value: index });
4031
4751
  }, [readOnly, onValueChange]);
4032
- const handleMouseEnter = React30__namespace.useCallback((index) => () => {
4752
+ const handleMouseEnter = React33__namespace.useCallback((index) => () => {
4033
4753
  if (readOnly) return;
4034
4754
  setHoveredIndex(index);
4035
4755
  }, [readOnly]);
4036
- const handleMouseLeave = React30__namespace.useCallback(() => {
4756
+ const handleMouseLeave = React33__namespace.useCallback(() => {
4037
4757
  setHoveredIndex(-1);
4038
4758
  }, []);
4039
4759
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("inline-flex items-center gap-1", className), ...rest, children: [
@@ -4067,8 +4787,8 @@ function createListCollection(config2) {
4067
4787
  var ArrowIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
4068
4788
  var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.667 5L7.5 14.167 3.333 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
4069
4789
  function FilterInput({ placeholder, initialValue = "", onChange }) {
4070
- const [value, setValue] = React30__namespace.useState(initialValue);
4071
- const handleChange = React30__namespace.useCallback((e) => {
4790
+ const [value, setValue] = React33__namespace.useState(initialValue);
4791
+ const handleChange = React33__namespace.useCallback((e) => {
4072
4792
  setValue(e.target.value);
4073
4793
  onChange?.(e.target.value);
4074
4794
  }, [onChange]);
@@ -4087,15 +4807,15 @@ function FilterInput({ placeholder, initialValue = "", onChange }) {
4087
4807
  }
4088
4808
  );
4089
4809
  }
4090
- var SelectInternalContext = React30__namespace.createContext(null);
4810
+ var SelectInternalContext = React33__namespace.createContext(null);
4091
4811
  function useSelectInternalContext() {
4092
- const ctx = React30__namespace.useContext(SelectInternalContext);
4812
+ const ctx = React33__namespace.useContext(SelectInternalContext);
4093
4813
  if (!ctx) {
4094
4814
  throw new Error("Select compound components must be rendered inside <SelectRoot>");
4095
4815
  }
4096
4816
  return ctx;
4097
4817
  }
4098
- var SelectRoot = React30__namespace.forwardRef(
4818
+ var SelectRoot = React33__namespace.forwardRef(
4099
4819
  function SelectRoot2(props, ref) {
4100
4820
  const {
4101
4821
  children,
@@ -4126,21 +4846,21 @@ var SelectRoot = React30__namespace.forwardRef(
4126
4846
  hideFrom: _hideFrom
4127
4847
  } = props;
4128
4848
  const collection = collectionProp ?? createListCollection({ items: [] });
4129
- const [internalValue, setInternalValue] = React30__namespace.useState(defaultValueArr ?? []);
4849
+ const [internalValue, setInternalValue] = React33__namespace.useState(defaultValueArr ?? []);
4130
4850
  const currentValue = valueProp ?? internalValue;
4131
- const selectedItems = React30__namespace.useMemo(() => {
4851
+ const selectedItems = React33__namespace.useMemo(() => {
4132
4852
  return currentValue.map((v) => collection.items.find((item) => item.value === v)).filter(Boolean);
4133
4853
  }, [currentValue, collection.items]);
4134
- const [open, setOpen] = React30__namespace.useState(defaultOpen ?? false);
4854
+ const [open, setOpen] = React33__namespace.useState(defaultOpen ?? false);
4135
4855
  const isOpen = openProp ?? open;
4136
- const handleOpenChange = React30__namespace.useCallback((nextOpen) => {
4856
+ const handleOpenChange = React33__namespace.useCallback((nextOpen) => {
4137
4857
  setOpen(nextOpen);
4138
4858
  onOpenChange?.(nextOpen);
4139
4859
  if (!nextOpen) {
4140
4860
  onInteractOutside?.();
4141
4861
  }
4142
4862
  }, [onOpenChange, onInteractOutside]);
4143
- const handleRadixValueChange = React30__namespace.useCallback((radixValue) => {
4863
+ const handleRadixValueChange = React33__namespace.useCallback((radixValue) => {
4144
4864
  const nextArr = [radixValue];
4145
4865
  if (!valueProp) {
4146
4866
  setInternalValue(nextArr);
@@ -4148,7 +4868,7 @@ var SelectRoot = React30__namespace.forwardRef(
4148
4868
  const items = collection.items.filter((item) => nextArr.includes(item.value));
4149
4869
  onValueChangeProp?.({ value: nextArr, items });
4150
4870
  }, [valueProp, collection.items, onValueChangeProp]);
4151
- const ctxValue = React30__namespace.useMemo(() => ({
4871
+ const ctxValue = React33__namespace.useMemo(() => ({
4152
4872
  value: currentValue,
4153
4873
  selectedItems,
4154
4874
  collection,
@@ -4168,7 +4888,7 @@ var SelectRoot = React30__namespace.forwardRef(
4168
4888
  if (typeof v === "string") return v;
4169
4889
  return v.base ?? v.lg ?? Object.values(v)[0];
4170
4890
  };
4171
- const inlineStyle = React30__namespace.useMemo(() => {
4891
+ const inlineStyle = React33__namespace.useMemo(() => {
4172
4892
  const s = { ...style };
4173
4893
  const rw = resolveVal(w);
4174
4894
  if (rw) s.width = rw;
@@ -4206,7 +4926,7 @@ var SelectRoot = React30__namespace.forwardRef(
4206
4926
  ) });
4207
4927
  }
4208
4928
  );
4209
- var SelectControl = React30__namespace.forwardRef(
4929
+ var SelectControl = React33__namespace.forwardRef(
4210
4930
  function SelectControl2(props, ref) {
4211
4931
  const { children, noIndicator, triggerProps, loading, defaultValue } = props;
4212
4932
  const ctx = useSelectInternalContext();
@@ -4243,11 +4963,11 @@ var SelectControl = React30__namespace.forwardRef(
4243
4963
  return trigger;
4244
4964
  }
4245
4965
  );
4246
- var SelectClearTrigger = React30__namespace.forwardRef(
4966
+ var SelectClearTrigger = React33__namespace.forwardRef(
4247
4967
  function SelectClearTrigger2(props, ref) {
4248
4968
  const { className, ...rest } = props;
4249
4969
  const ctx = useSelectInternalContext();
4250
- const handleClick = React30__namespace.useCallback(() => {
4970
+ const handleClick = React33__namespace.useCallback(() => {
4251
4971
  ctx.onValueChange({ value: [], items: [] });
4252
4972
  }, [ctx]);
4253
4973
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4264,7 +4984,7 @@ var SelectClearTrigger = React30__namespace.forwardRef(
4264
4984
  );
4265
4985
  }
4266
4986
  );
4267
- var SelectContent = React30__namespace.forwardRef(
4987
+ var SelectContent = React33__namespace.forwardRef(
4268
4988
  function SelectContent2(props, ref) {
4269
4989
  const { portalled = true, portalRef, children, className, ...rest } = props;
4270
4990
  const content = /* @__PURE__ */ jsxRuntime.jsx(
@@ -4291,7 +5011,7 @@ var SelectContent = React30__namespace.forwardRef(
4291
5011
  return content;
4292
5012
  }
4293
5013
  );
4294
- var SelectItem = React30__namespace.forwardRef(
5014
+ var SelectItem = React33__namespace.forwardRef(
4295
5015
  function SelectItem2(props, ref) {
4296
5016
  const { item, children, className, ...rest } = props;
4297
5017
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4319,7 +5039,7 @@ var SelectItem = React30__namespace.forwardRef(
4319
5039
  );
4320
5040
  }
4321
5041
  );
4322
- var SelectValueText = React30__namespace.forwardRef(
5042
+ var SelectValueText = React33__namespace.forwardRef(
4323
5043
  function SelectValueText2(props, ref) {
4324
5044
  const { children, size, required, invalid, errorText, mode, className, style, placeholder: placeholderProp, ...rest } = props;
4325
5045
  const ctx = useSelectInternalContext();
@@ -4375,7 +5095,7 @@ var SelectValueText = React30__namespace.forwardRef(
4375
5095
  );
4376
5096
  }
4377
5097
  );
4378
- var SelectItemGroup = React30__namespace.forwardRef(
5098
+ var SelectItemGroup = React33__namespace.forwardRef(
4379
5099
  function SelectItemGroup2(props, ref) {
4380
5100
  const { children, label, className, ...rest } = props;
4381
5101
  return /* @__PURE__ */ jsxRuntime.jsxs(RadixSelect__namespace.Group, { ref, className: cn("py-1", className), ...rest, children: [
@@ -4386,7 +5106,7 @@ var SelectItemGroup = React30__namespace.forwardRef(
4386
5106
  );
4387
5107
  var SelectLabel = RadixSelect__namespace.Label;
4388
5108
  var SelectItemText = RadixSelect__namespace.ItemText;
4389
- var Select = React30__namespace.forwardRef((props, ref) => {
5109
+ var Select = React33__namespace.forwardRef((props, ref) => {
4390
5110
  const { collection, placeholder, portalled = true, loading, errorText, contentProps, contentHeader, itemFilter, mode, ...rest } = props;
4391
5111
  return /* @__PURE__ */ jsxRuntime.jsxs(
4392
5112
  SelectRoot,
@@ -4408,7 +5128,7 @@ var Select = React30__namespace.forwardRef((props, ref) => {
4408
5128
  ) }),
4409
5129
  /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { portalled, ...contentProps, children: [
4410
5130
  contentHeader,
4411
- collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React30__namespace.Fragment, { children: [
5131
+ collection.items.filter(itemFilter ?? (() => true)).map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React33__namespace.Fragment, { children: [
4412
5132
  /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { item, children: item.renderLabel ? item.renderLabel("item") : item.label }),
4413
5133
  item.afterElement
4414
5134
  ] }, item.value))
@@ -4417,19 +5137,19 @@ var Select = React30__namespace.forwardRef((props, ref) => {
4417
5137
  }
4418
5138
  );
4419
5139
  });
4420
- var SelectAsync = React30__namespace.forwardRef((props, ref) => {
5140
+ var SelectAsync = React33__namespace.forwardRef((props, ref) => {
4421
5141
  const { placeholder, portalled = true, loading, loadOptions, extraControls, onValueChange, errorText, mode, contentHeader, ...rest } = props;
4422
- const [collection, setCollection] = React30__namespace.useState(createListCollection({ items: [] }));
4423
- const [inputValue, setInputValue] = React30__namespace.useState("");
4424
- const [value, setValue] = React30__namespace.useState([]);
5142
+ const [collection, setCollection] = React33__namespace.useState(createListCollection({ items: [] }));
5143
+ const [inputValue, setInputValue] = React33__namespace.useState("");
5144
+ const [value, setValue] = React33__namespace.useState([]);
4425
5145
  const debouncedInputValue = usehooks.useDebounce(inputValue, 300);
4426
- React30__namespace.useEffect(() => {
5146
+ React33__namespace.useEffect(() => {
4427
5147
  loadOptions(debouncedInputValue, value).then(setCollection);
4428
5148
  }, [debouncedInputValue, loadOptions, value]);
4429
- const handleFilterChange = React30__namespace.useCallback((val) => {
5149
+ const handleFilterChange = React33__namespace.useCallback((val) => {
4430
5150
  setInputValue(val);
4431
5151
  }, []);
4432
- const handleValueChange = React30__namespace.useCallback(({ value: v, items }) => {
5152
+ const handleValueChange = React33__namespace.useCallback(({ value: v, items }) => {
4433
5153
  setValue(v);
4434
5154
  onValueChange?.({ value: v, items });
4435
5155
  }, [onValueChange]);
@@ -4488,13 +5208,14 @@ var VERTICAL_SIZE_CLASSES = {
4488
5208
  md: "border-l-2",
4489
5209
  lg: "border-l-[3px]"
4490
5210
  };
4491
- var Separator2 = React30__namespace.default.forwardRef(
5211
+ var Separator2 = React33__namespace.default.forwardRef(
4492
5212
  function Separator3({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
4493
5213
  const isVertical = orientation === "vertical";
4494
5214
  return /* @__PURE__ */ jsxRuntime.jsx(
4495
- "hr",
5215
+ gui.Separator,
4496
5216
  {
4497
5217
  ref,
5218
+ vertical: isVertical,
4498
5219
  role: "separator",
4499
5220
  "aria-orientation": orientation,
4500
5221
  className: cn(
@@ -4510,9 +5231,7 @@ var Separator2 = React30__namespace.default.forwardRef(
4510
5231
  );
4511
5232
  }
4512
5233
  );
4513
- var THUMB_SIZE = 20;
4514
- var TRACK_HEIGHT = 6;
4515
- var Slider = React30__namespace.forwardRef(
5234
+ var Slider = React33__namespace.forwardRef(
4516
5235
  function Slider2(props, ref) {
4517
5236
  const {
4518
5237
  marks: marksProp,
@@ -4524,7 +5243,7 @@ var Slider = React30__namespace.forwardRef(
4524
5243
  max = 100,
4525
5244
  step,
4526
5245
  disabled,
4527
- orientation,
5246
+ orientation = "horizontal",
4528
5247
  name,
4529
5248
  onValueChange,
4530
5249
  onValueCommit,
@@ -4536,6 +5255,14 @@ var Slider = React30__namespace.forwardRef(
4536
5255
  return mark;
4537
5256
  });
4538
5257
  const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
5258
+ const latest = React33__namespace.useRef(value ?? defaultValue ?? []);
5259
+ const handleValueChange = React33__namespace.useCallback((next) => {
5260
+ latest.current = next;
5261
+ onValueChange?.(next);
5262
+ }, [onValueChange]);
5263
+ const handleSlideEnd = React33__namespace.useCallback(() => {
5264
+ onValueCommit?.(latest.current);
5265
+ }, [onValueCommit]);
4539
5266
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
4540
5267
  label && !showValue && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-text-secondary", children: label }),
4541
5268
  label && showValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -4543,9 +5270,10 @@ var Slider = React30__namespace.forwardRef(
4543
5270
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary", children: (value ?? defaultValue ?? [])?.join(", ") })
4544
5271
  ] }),
4545
5272
  /* @__PURE__ */ jsxRuntime.jsxs(
4546
- RadixSlider__namespace.Root,
5273
+ gui.Slider,
4547
5274
  {
4548
5275
  ref,
5276
+ unstyled: true,
4549
5277
  className: cn(
4550
5278
  "relative flex w-full touch-none select-none items-center",
4551
5279
  hasMarkLabel && "mb-6"
@@ -4558,24 +5286,30 @@ var Slider = React30__namespace.forwardRef(
4558
5286
  disabled,
4559
5287
  orientation,
4560
5288
  name,
4561
- onValueChange,
4562
- onValueCommit,
5289
+ onValueChange: handleValueChange,
5290
+ onSlideEnd: handleSlideEnd,
4563
5291
  children: [
4564
5292
  /* @__PURE__ */ jsxRuntime.jsx(
4565
- RadixSlider__namespace.Track,
5293
+ gui.Slider.Track,
4566
5294
  {
4567
- className: cn(
4568
- "relative grow rounded-full bg-border-divider",
4569
- `h-[${TRACK_HEIGHT}px]`
4570
- ),
4571
- children: /* @__PURE__ */ jsxRuntime.jsx(RadixSlider__namespace.Range, { className: "absolute h-full rounded-full bg-link-primary" })
5295
+ unstyled: true,
5296
+ className: "relative grow h-1.5 rounded-full bg-border-divider",
5297
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5298
+ gui.Slider.TrackActive,
5299
+ {
5300
+ unstyled: true,
5301
+ className: "absolute h-full rounded-full bg-link-primary"
5302
+ }
5303
+ )
4572
5304
  }
4573
5305
  ),
4574
5306
  resolvedValue?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
4575
- RadixSlider__namespace.Thumb,
5307
+ gui.Slider.Thumb,
4576
5308
  {
5309
+ index,
5310
+ unstyled: true,
4577
5311
  className: cn(
4578
- `block h-[${THUMB_SIZE}px] w-[${THUMB_SIZE}px]`,
5312
+ "block h-5 w-5",
4579
5313
  "rounded-full border-2 border-link-primary bg-white",
4580
5314
  "shadow-sm transition-colors",
4581
5315
  "hover:border-link-primary-hover",
@@ -4617,21 +5351,21 @@ var NOOP3 = () => {
4617
5351
  var SIZE_CLASSES9 = {
4618
5352
  sm: {
4619
5353
  root: "h-4 w-7",
4620
- thumb: "h-3 w-3 data-[state=checked]:translate-x-3",
5354
+ thumb: "h-3 w-3",
4621
5355
  label: "text-xs"
4622
5356
  },
4623
5357
  md: {
4624
5358
  root: "h-5 w-9",
4625
- thumb: "h-4 w-4 data-[state=checked]:translate-x-4",
5359
+ thumb: "h-4 w-4",
4626
5360
  label: "text-sm"
4627
5361
  },
4628
5362
  lg: {
4629
5363
  root: "h-6 w-11",
4630
- thumb: "h-5 w-5 data-[state=checked]:translate-x-5",
5364
+ thumb: "h-5 w-5",
4631
5365
  label: "text-base"
4632
5366
  }
4633
5367
  };
4634
- var SwitchBase = React30__namespace.forwardRef(
5368
+ var SwitchBase = React33__namespace.forwardRef(
4635
5369
  function Switch(props, ref) {
4636
5370
  const {
4637
5371
  inputProps,
@@ -4650,17 +5384,15 @@ var SwitchBase = React30__namespace.forwardRef(
4650
5384
  className,
4651
5385
  ...rest
4652
5386
  } = props;
4653
- const [internalChecked, setInternalChecked] = React30__namespace.useState(defaultChecked ?? false);
5387
+ const [internalChecked, setInternalChecked] = React33__namespace.useState(defaultChecked ?? false);
4654
5388
  const isControlled = checkedProp !== void 0;
4655
5389
  const checkedState = isControlled ? checkedProp : internalChecked;
4656
- const handleCheckedChange = React30__namespace.useCallback(
5390
+ const handleCheckedChange = React33__namespace.useCallback(
4657
5391
  (nextChecked) => {
4658
5392
  if (!isControlled) {
4659
5393
  setInternalChecked(nextChecked);
4660
5394
  }
4661
- if (onCheckedChange) {
4662
- onCheckedChange({ checked: nextChecked });
4663
- }
5395
+ onCheckedChange?.({ checked: nextChecked });
4664
5396
  },
4665
5397
  [isControlled, onCheckedChange]
4666
5398
  );
@@ -4681,8 +5413,9 @@ var SwitchBase = React30__namespace.forwardRef(
4681
5413
  ...rest,
4682
5414
  children: [
4683
5415
  /* @__PURE__ */ jsxRuntime.jsxs(
4684
- RadixSwitch__namespace.Root,
5416
+ gui.Switch,
4685
5417
  {
5418
+ unstyled: true,
4686
5419
  checked: checkedState,
4687
5420
  onCheckedChange: handleCheckedChange,
4688
5421
  disabled,
@@ -4697,12 +5430,13 @@ var SwitchBase = React30__namespace.forwardRef(
4697
5430
  children: [
4698
5431
  trackLabel && /* @__PURE__ */ jsxRuntime.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 }),
4699
5432
  /* @__PURE__ */ jsxRuntime.jsx(
4700
- RadixSwitch__namespace.Thumb,
5433
+ gui.Switch.Thumb,
4701
5434
  {
5435
+ unstyled: true,
5436
+ "data-thumb": true,
5437
+ transition: "quicker",
4702
5438
  className: cn(
4703
5439
  "block rounded-full bg-white shadow-sm",
4704
- "transition-transform duration-200",
4705
- "translate-x-0.5",
4706
5440
  sizeClasses2.thumb
4707
5441
  ),
4708
5442
  children: thumbLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center h-full w-full text-[8px]", children: checkedState ? thumbLabel.on : thumbLabel.off })
@@ -4918,7 +5652,7 @@ function resolveResponsive(value) {
4918
5652
  }
4919
5653
  return void 0;
4920
5654
  }
4921
- var TableRoot = React30__namespace.forwardRef(
5655
+ var TableRoot = React33__namespace.forwardRef(
4922
5656
  function TableRoot2(props, ref) {
4923
5657
  const { className, style: styleProp, children, ...other } = props;
4924
5658
  const rawMinW = other.minWidth ?? other.minW;
@@ -4941,7 +5675,7 @@ var TableRoot = React30__namespace.forwardRef(
4941
5675
  );
4942
5676
  }
4943
5677
  );
4944
- var TableHeader = React30__namespace.forwardRef(
5678
+ var TableHeader = React33__namespace.forwardRef(
4945
5679
  function TableHeader2(props, ref) {
4946
5680
  const { className, style: styleProp, children, ...other } = props;
4947
5681
  const { style: extracted, rest } = extractStyles(other);
@@ -4958,7 +5692,7 @@ var TableHeader = React30__namespace.forwardRef(
4958
5692
  );
4959
5693
  }
4960
5694
  );
4961
- var TableBody = React30__namespace.forwardRef(
5695
+ var TableBody = React33__namespace.forwardRef(
4962
5696
  function TableBody2(props, ref) {
4963
5697
  const { className, style: styleProp, children, ...other } = props;
4964
5698
  const { style: extracted, rest } = extractStyles(other);
@@ -4975,7 +5709,7 @@ var TableBody = React30__namespace.forwardRef(
4975
5709
  );
4976
5710
  }
4977
5711
  );
4978
- var TableRow = React30__namespace.forwardRef(
5712
+ var TableRow = React33__namespace.forwardRef(
4979
5713
  function TableRow2(props, ref) {
4980
5714
  const { className, style: styleProp, children, ...other } = props;
4981
5715
  const { style: extracted, rest } = extractStyles(other);
@@ -4992,7 +5726,7 @@ var TableRow = React30__namespace.forwardRef(
4992
5726
  );
4993
5727
  }
4994
5728
  );
4995
- var TableCell = React30__namespace.forwardRef(
5729
+ var TableCell = React33__namespace.forwardRef(
4996
5730
  function TableCell2(props, ref) {
4997
5731
  const { isNumeric, className, style: styleProp, children, ...other } = props;
4998
5732
  const { style: extracted, rest } = extractStyles(other);
@@ -5013,7 +5747,7 @@ var TableCell = React30__namespace.forwardRef(
5013
5747
  );
5014
5748
  }
5015
5749
  );
5016
- var TableColumnHeader = React30__namespace.forwardRef(
5750
+ var TableColumnHeader = React33__namespace.forwardRef(
5017
5751
  function TableColumnHeader2(props, ref) {
5018
5752
  const { isNumeric, className, style: styleProp, children, ...other } = props;
5019
5753
  const { style: extracted, rest } = extractStyles(other);
@@ -5040,7 +5774,7 @@ var TableColumnHeader = React30__namespace.forwardRef(
5040
5774
  );
5041
5775
  var TableColumnHeaderSortable = (props) => {
5042
5776
  const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
5043
- const handleSortToggle = React30__namespace.useCallback(() => {
5777
+ const handleSortToggle = React33__namespace.useCallback(() => {
5044
5778
  onSortToggle(sortField);
5045
5779
  }, [onSortToggle, sortField]);
5046
5780
  const isActive = sortValue.includes(sortField);
@@ -5066,16 +5800,16 @@ var TableColumnHeaderSortable = (props) => {
5066
5800
  var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
5067
5801
  var TableHeaderSticky = (props) => {
5068
5802
  const { top, children, className, style: styleProp, ...rest } = props;
5069
- const ref = React30__namespace.useRef(null);
5070
- const [isStuck, setIsStuck] = React30__namespace.useState(false);
5071
- const handleScroll = React30__namespace.useCallback(() => {
5803
+ const ref = React33__namespace.useRef(null);
5804
+ const [isStuck, setIsStuck] = React33__namespace.useState(false);
5805
+ const handleScroll = React33__namespace.useCallback(() => {
5072
5806
  if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
5073
5807
  setIsStuck(true);
5074
5808
  } else {
5075
5809
  setIsStuck(false);
5076
5810
  }
5077
5811
  }, [top]);
5078
- React30__namespace.useEffect(() => {
5812
+ React33__namespace.useEffect(() => {
5079
5813
  const throttledHandleScroll = esToolkit.throttle(handleScroll, 300);
5080
5814
  window.addEventListener("scroll", throttledHandleScroll);
5081
5815
  return () => {
@@ -5097,7 +5831,7 @@ var TableHeaderSticky = (props) => {
5097
5831
  }
5098
5832
  );
5099
5833
  };
5100
- var TableCaption = React30__namespace.forwardRef(
5834
+ var TableCaption = React33__namespace.forwardRef(
5101
5835
  function TableCaption2(props, ref) {
5102
5836
  const { className, style: styleProp, children, ...other } = props;
5103
5837
  const { style: extracted, rest } = extractStyles(other);
@@ -5114,7 +5848,7 @@ var TableCaption = React30__namespace.forwardRef(
5114
5848
  );
5115
5849
  }
5116
5850
  );
5117
- var TableFooter = React30__namespace.forwardRef(
5851
+ var TableFooter = React33__namespace.forwardRef(
5118
5852
  function TableFooter2(props, ref) {
5119
5853
  const { className, style: styleProp, children, ...other } = props;
5120
5854
  const { style: extracted, rest } = extractStyles(other);
@@ -5131,7 +5865,7 @@ var TableFooter = React30__namespace.forwardRef(
5131
5865
  );
5132
5866
  }
5133
5867
  );
5134
- var TableScrollWrapper = React30__namespace.forwardRef(
5868
+ var TableScrollWrapper = React33__namespace.forwardRef(
5135
5869
  function TableScrollWrapper2(props, ref) {
5136
5870
  const { className, children, ...rest } = props;
5137
5871
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5150,7 +5884,7 @@ var ROOT_SIZE_CLASSES = {
5150
5884
  md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
5151
5885
  free: ""
5152
5886
  };
5153
- var TabsRoot = React30__namespace.forwardRef(
5887
+ var TabsRoot = React33__namespace.forwardRef(
5154
5888
  function TabsRoot2(props, ref) {
5155
5889
  const {
5156
5890
  variant = "solid",
@@ -5162,7 +5896,7 @@ var TabsRoot = React30__namespace.forwardRef(
5162
5896
  className,
5163
5897
  ...rest
5164
5898
  } = props;
5165
- const handleValueChange = React30__namespace.useCallback(
5899
+ const handleValueChange = React33__namespace.useCallback(
5166
5900
  (value) => {
5167
5901
  if (!onValueChange) return;
5168
5902
  onValueChange({ value });
@@ -5187,7 +5921,7 @@ var TabsRoot = React30__namespace.forwardRef(
5187
5921
  );
5188
5922
  }
5189
5923
  );
5190
- var TabsList = React30__namespace.forwardRef(
5924
+ var TabsList = React33__namespace.forwardRef(
5191
5925
  function TabsList2(props, ref) {
5192
5926
  const {
5193
5927
  className,
@@ -5241,7 +5975,7 @@ var TRIGGER_VARIANT_CLASSES = {
5241
5975
  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",
5242
5976
  unstyled: ""
5243
5977
  };
5244
- var TabsTrigger = React30__namespace.forwardRef(
5978
+ var TabsTrigger = React33__namespace.forwardRef(
5245
5979
  function TabsTrigger2(props, ref) {
5246
5980
  const {
5247
5981
  className,
@@ -5261,7 +5995,7 @@ var TabsTrigger = React30__namespace.forwardRef(
5261
5995
  visibility: _visibility,
5262
5996
  ...rest
5263
5997
  } = props;
5264
- const internalRef = React30__namespace.useRef(null);
5998
+ const internalRef = React33__namespace.useRef(null);
5265
5999
  const mergedRef = useMergedRef(ref, internalRef);
5266
6000
  const { variant, size, fitted } = useTabsContext(internalRef);
5267
6001
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5281,7 +6015,7 @@ var TabsTrigger = React30__namespace.forwardRef(
5281
6015
  );
5282
6016
  }
5283
6017
  );
5284
- var TabsContent = React30__namespace.forwardRef(
6018
+ var TabsContent = React33__namespace.forwardRef(
5285
6019
  function TabsContent2(props, ref) {
5286
6020
  const { className, padding: _padding, ...rest } = props;
5287
6021
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5315,8 +6049,8 @@ var TabsCounter = ({ count }) => {
5315
6049
  );
5316
6050
  };
5317
6051
  function useTabsContext(triggerRef) {
5318
- const [ctx, setCtx] = React30__namespace.useState({ variant: "solid", size: "md", fitted: false });
5319
- React30__namespace.useEffect(() => {
6052
+ const [ctx, setCtx] = React33__namespace.useState({ variant: "solid", size: "md", fitted: false });
6053
+ React33__namespace.useEffect(() => {
5320
6054
  const el = triggerRef.current;
5321
6055
  if (!el) return;
5322
6056
  const root = el.closest("[data-variant]");
@@ -5330,7 +6064,7 @@ function useTabsContext(triggerRef) {
5330
6064
  return ctx;
5331
6065
  }
5332
6066
  function useMergedRef(...refs) {
5333
- return React30__namespace.useCallback(
6067
+ return React33__namespace.useCallback(
5334
6068
  (instance) => {
5335
6069
  for (const ref of refs) {
5336
6070
  if (!ref) continue;
@@ -5368,7 +6102,7 @@ var TAG_SELECTED_CLASSES = [
5368
6102
  "hover:opacity-76"
5369
6103
  ].join(" ");
5370
6104
  var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
5371
- var Tag = React30__namespace.forwardRef(
6105
+ var Tag = React33__namespace.forwardRef(
5372
6106
  function Tag2(props, ref) {
5373
6107
  const {
5374
6108
  variant,
@@ -5455,9 +6189,9 @@ var TEXTAREA_VARIANT_CLASSES = {
5455
6189
  filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
5456
6190
  unstyled: "border-0 bg-transparent p-0"
5457
6191
  };
5458
- var Textarea = React30__namespace.default.forwardRef(
6192
+ var Textarea = React33__namespace.default.forwardRef(
5459
6193
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
5460
- const handleChange = React30__namespace.default.useCallback(
6194
+ const handleChange = React33__namespace.default.useCallback(
5461
6195
  (event) => {
5462
6196
  onChange?.(event);
5463
6197
  onChangeText?.(event.target.value);
@@ -5465,9 +6199,10 @@ var Textarea = React30__namespace.default.forwardRef(
5465
6199
  [onChange, onChangeText]
5466
6200
  );
5467
6201
  return /* @__PURE__ */ jsxRuntime.jsx(
5468
- "textarea",
6202
+ gui.TextArea,
5469
6203
  {
5470
6204
  ref,
6205
+ unstyled: true,
5471
6206
  className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
5472
6207
  ...rest,
5473
6208
  onChange: handleChange
@@ -5599,7 +6334,7 @@ function QuoteCell({ value, highlight, align = "right", onClick, className }) {
5599
6334
  }
5600
6335
  var CALL_HEADERS = ["Bid", "Ask", "Last", "Vol", "OI", "IV", "Delta"];
5601
6336
  var PUT_HEADERS = ["Delta", "IV", "OI", "Vol", "Last", "Ask", "Bid"];
5602
- var OptionChain = React30__namespace.forwardRef(
6337
+ var OptionChain = React33__namespace.forwardRef(
5603
6338
  function OptionChain2(props, ref) {
5604
6339
  const {
5605
6340
  symbol: _symbol,
@@ -5610,7 +6345,7 @@ var OptionChain = React30__namespace.forwardRef(
5610
6345
  className,
5611
6346
  ...rest
5612
6347
  } = props;
5613
- const handleClick = React30__namespace.useCallback(
6348
+ const handleClick = React33__namespace.useCallback(
5614
6349
  (quote, type, strike) => {
5615
6350
  if (!quote || !onSelectContract) return;
5616
6351
  onSelectContract({
@@ -5716,7 +6451,7 @@ var OptionChain = React30__namespace.forwardRef(
5716
6451
  {
5717
6452
  className: cn(
5718
6453
  "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
5719
- isATM ? "text-amber-400 bg-zinc-800/80" : "text-zinc-300"
6454
+ isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
5720
6455
  ),
5721
6456
  children: fmt(row.strike)
5722
6457
  }
@@ -5755,12 +6490,12 @@ var OptionChain = React30__namespace.forwardRef(
5755
6490
  }
5756
6491
  );
5757
6492
  var GREEKS = [
5758
- { key: "delta", label: "Delta", symbol: "\u0394", color: "text-blue-400", barColor: "bg-blue-500", decimals: 4, maxMagnitude: 1 },
5759
- { key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-purple-400", barColor: "bg-purple-500", decimals: 4, maxMagnitude: 0.1 },
5760
- { key: "theta", label: "Theta", symbol: "\u0398", color: "text-red-400", barColor: "bg-red-500", decimals: 4, maxMagnitude: 1 },
5761
- { key: "vega", label: "Vega", symbol: "\u03BD", color: "text-emerald-400", barColor: "bg-emerald-500", decimals: 4, maxMagnitude: 1 },
5762
- { key: "rho", label: "Rho", symbol: "\u03C1", color: "text-orange-400", barColor: "bg-orange-500", decimals: 4, maxMagnitude: 1 },
5763
- { key: "iv", label: "IV", symbol: "\u03C3", color: "text-amber-400", barColor: "bg-amber-500", decimals: 1, maxMagnitude: 100 }
6493
+ { key: "delta", label: "Delta", symbol: "\u0394", color: "text-[var(--foreground)]", barColor: "bg-[var(--foreground)]", decimals: 4, maxMagnitude: 1 },
6494
+ { key: "gamma", label: "Gamma", symbol: "\u0393", color: "text-[var(--chart-1)]", barColor: "bg-[var(--chart-1)]", decimals: 4, maxMagnitude: 0.1 },
6495
+ { key: "theta", label: "Theta", symbol: "\u0398", color: "text-[var(--chart-4)]", barColor: "bg-[var(--chart-4)]", decimals: 4, maxMagnitude: 1 },
6496
+ { key: "vega", label: "Vega", symbol: "\u03BD", color: "text-[var(--chart-2)]", barColor: "bg-[var(--chart-2)]", decimals: 4, maxMagnitude: 1 },
6497
+ { key: "rho", label: "Rho", symbol: "\u03C1", color: "text-[var(--chart-3)]", barColor: "bg-[var(--chart-3)]", decimals: 4, maxMagnitude: 1 },
6498
+ { key: "iv", label: "IV", symbol: "\u03C3", color: "text-[var(--chart-5)]", barColor: "bg-[var(--chart-5)]", decimals: 1, maxMagnitude: 100 }
5764
6499
  ];
5765
6500
  function GreekItem({ def, value, compact }) {
5766
6501
  const magnitude = Math.min(Math.abs(value) / def.maxMagnitude, 1);
@@ -5790,7 +6525,7 @@ function GreekItem({ def, value, compact }) {
5790
6525
  }
5791
6526
  );
5792
6527
  }
5793
- var GreeksDisplay = React30__namespace.forwardRef(
6528
+ var GreeksDisplay = React33__namespace.forwardRef(
5794
6529
  function GreeksDisplay2(props, ref) {
5795
6530
  const {
5796
6531
  delta,
@@ -5967,7 +6702,8 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
5967
6702
  type: "button",
5968
6703
  className: cn(
5969
6704
  "px-2 py-0.5 rounded text-xs font-medium transition-colors",
5970
- leg.type === "call" ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
6705
+ // Call vs put is a rank difference, not a hue difference.
6706
+ leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
5971
6707
  ),
5972
6708
  onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
5973
6709
  children: leg.type === "call" ? "CALL" : "PUT"
@@ -6021,7 +6757,7 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
6021
6757
  )
6022
6758
  ] });
6023
6759
  }
6024
- var StrategyBuilder = React30__namespace.forwardRef(
6760
+ var StrategyBuilder = React33__namespace.forwardRef(
6025
6761
  function StrategyBuilder2(props, ref) {
6026
6762
  const {
6027
6763
  underlying,
@@ -6033,12 +6769,12 @@ var StrategyBuilder = React30__namespace.forwardRef(
6033
6769
  ...rest
6034
6770
  } = props;
6035
6771
  const defaultExp = expirations[0] ?? "";
6036
- const [strategyType, setStrategyType] = React30__namespace.useState("bull_call_spread");
6037
- const [legs, setLegs] = React30__namespace.useState(() => {
6772
+ const [strategyType, setStrategyType] = React33__namespace.useState("bull_call_spread");
6773
+ const [legs, setLegs] = React33__namespace.useState(() => {
6038
6774
  const preset = STRATEGY_PRESETS.find((p) => p.value === "bull_call_spread");
6039
6775
  return preset ? preset.buildLegs(strikes, spotPrice, defaultExp) : [];
6040
6776
  });
6041
- const handleStrategyChange = React30__namespace.useCallback(
6777
+ const handleStrategyChange = React33__namespace.useCallback(
6042
6778
  (e) => {
6043
6779
  const type = e.target.value;
6044
6780
  setStrategyType(type);
@@ -6049,7 +6785,7 @@ var StrategyBuilder = React30__namespace.forwardRef(
6049
6785
  },
6050
6786
  [strikes, spotPrice, defaultExp]
6051
6787
  );
6052
- const handleLegChange = React30__namespace.useCallback(
6788
+ const handleLegChange = React33__namespace.useCallback(
6053
6789
  (index, leg) => {
6054
6790
  setLegs((prev) => {
6055
6791
  const next = [...prev];
@@ -6059,13 +6795,13 @@ var StrategyBuilder = React30__namespace.forwardRef(
6059
6795
  },
6060
6796
  []
6061
6797
  );
6062
- const handleLegRemove = React30__namespace.useCallback(
6798
+ const handleLegRemove = React33__namespace.useCallback(
6063
6799
  (index) => {
6064
6800
  setLegs((prev) => prev.filter((_, i) => i !== index));
6065
6801
  },
6066
6802
  []
6067
6803
  );
6068
- const handleAddLeg = React30__namespace.useCallback(() => {
6804
+ const handleAddLeg = React33__namespace.useCallback(() => {
6069
6805
  if (legs.length >= 4) return;
6070
6806
  const atm = findATM(strikes, spotPrice);
6071
6807
  setLegs((prev) => [
@@ -6073,14 +6809,14 @@ var StrategyBuilder = React30__namespace.forwardRef(
6073
6809
  { action: "buy", type: "call", strike: atm, expiration: defaultExp, quantity: 1 }
6074
6810
  ]);
6075
6811
  }, [legs.length, strikes, spotPrice, defaultExp]);
6076
- const netPremium = React30__namespace.useMemo(() => {
6812
+ const netPremium = React33__namespace.useMemo(() => {
6077
6813
  return legs.reduce((sum, leg) => {
6078
6814
  if (leg.premium === void 0) return sum;
6079
6815
  const sign = leg.action === "buy" ? -1 : 1;
6080
6816
  return sum + sign * leg.premium * leg.quantity;
6081
6817
  }, 0);
6082
6818
  }, [legs]);
6083
- const handleSubmit = React30__namespace.useCallback(() => {
6819
+ const handleSubmit = React33__namespace.useCallback(() => {
6084
6820
  if (!onSubmit || legs.length === 0) return;
6085
6821
  onSubmit({
6086
6822
  type: strategyType,
@@ -6200,8 +6936,10 @@ function buildPath(points, vb, width, height) {
6200
6936
  });
6201
6937
  return parts.join(" ");
6202
6938
  }
6203
- var LEG_COLORS = ["#6366f1", "#f59e0b", "#ec4899", "#06b6d4"];
6204
- var PnlDiagram = React30__namespace.forwardRef(
6939
+ var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
6940
+ var BREAKEVEN_COLOR = "var(--chart-1)";
6941
+ var BREAKEVEN_RING = "var(--background)";
6942
+ var PnlDiagram = React33__namespace.forwardRef(
6205
6943
  function PnlDiagram2(props, ref) {
6206
6944
  const {
6207
6945
  legs,
@@ -6210,10 +6948,10 @@ var PnlDiagram = React30__namespace.forwardRef(
6210
6948
  className,
6211
6949
  ...rest
6212
6950
  } = props;
6213
- const containerRef = React30__namespace.useRef(null);
6214
- const [hoverX, setHoverX] = React30__namespace.useState(null);
6215
- const [dims, setDims] = React30__namespace.useState({ width: 600, height: 240 });
6216
- React30__namespace.useEffect(() => {
6951
+ const containerRef = React33__namespace.useRef(null);
6952
+ const [hoverX, setHoverX] = React33__namespace.useState(null);
6953
+ const [dims, setDims] = React33__namespace.useState({ width: 600, height: 240 });
6954
+ React33__namespace.useEffect(() => {
6217
6955
  const el = containerRef.current;
6218
6956
  if (!el) return;
6219
6957
  const observer = new ResizeObserver((entries) => {
@@ -6236,7 +6974,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6236
6974
  const xMax = maxStrike + range * 0.3;
6237
6975
  const SAMPLES = 200;
6238
6976
  const step = (xMax - xMin) / SAMPLES;
6239
- const combinedPoints = React30__namespace.useMemo(() => {
6977
+ const combinedPoints = React33__namespace.useMemo(() => {
6240
6978
  const pts = [];
6241
6979
  for (let i = 0; i <= SAMPLES; i++) {
6242
6980
  const price = xMin + i * step;
@@ -6244,7 +6982,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6244
6982
  }
6245
6983
  return pts;
6246
6984
  }, [legs, multiplier, xMin, step]);
6247
- const legPointSets = React30__namespace.useMemo(() => {
6985
+ const legPointSets = React33__namespace.useMemo(() => {
6248
6986
  return legs.map((leg) => {
6249
6987
  const pts = [];
6250
6988
  for (let i = 0; i <= SAMPLES; i++) {
@@ -6265,7 +7003,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6265
7003
  const chartH = height - PADDING.top - PADDING.bottom;
6266
7004
  const scaleX = (x) => PADDING.left + (x - vb.xMin) / (vb.xMax - vb.xMin) * chartW;
6267
7005
  const scaleY = (y) => PADDING.top + chartH - (y - vb.yMin) / (vb.yMax - vb.yMin) * chartH;
6268
- const breakevens = React30__namespace.useMemo(() => {
7006
+ const breakevens = React33__namespace.useMemo(() => {
6269
7007
  const pts = [];
6270
7008
  for (let i = 1; i < combinedPoints.length; i++) {
6271
7009
  const prev = combinedPoints[i - 1];
@@ -6282,7 +7020,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6282
7020
  const maxGainPoint = combinedPoints.find((p) => p.y === maxGain);
6283
7021
  const maxLossPoint = combinedPoints.find((p) => p.y === maxLoss);
6284
7022
  const zeroY = scaleY(0);
6285
- const handleMouseMove = React30__namespace.useCallback(
7023
+ const handleMouseMove = React33__namespace.useCallback(
6286
7024
  (e) => {
6287
7025
  const rect = e.currentTarget.getBoundingClientRect();
6288
7026
  const mouseX = e.clientX - rect.left;
@@ -6295,7 +7033,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6295
7033
  },
6296
7034
  [vb.xMin, vb.xMax, chartW]
6297
7035
  );
6298
- const handleMouseLeave = React30__namespace.useCallback(() => setHoverX(null), []);
7036
+ const handleMouseLeave = React33__namespace.useCallback(() => setHoverX(null), []);
6299
7037
  const hoverPnl = hoverX !== null ? calcTotalPnl(legs, hoverX, multiplier) : null;
6300
7038
  buildPath(
6301
7039
  combinedPoints.map((p) => ({ x: scaleX(p.x), y: scaleY(p.y) })).map((p) => ({ x: p.x - PADDING.left, y: p.y - PADDING.top })),
@@ -6442,13 +7180,13 @@ var PnlDiagram = React30__namespace.forwardRef(
6442
7180
  }
6443
7181
  ),
6444
7182
  breakevens.map((be, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
6445
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: "#fbbf24", stroke: "#18181b", strokeWidth: "1" }),
7183
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: BREAKEVEN_COLOR, stroke: BREAKEVEN_RING, strokeWidth: "1" }),
6446
7184
  /* @__PURE__ */ jsxRuntime.jsx(
6447
7185
  "text",
6448
7186
  {
6449
7187
  x: scaleX(be),
6450
7188
  y: PADDING.top + chartH + 14,
6451
- fill: "#fbbf24",
7189
+ fill: BREAKEVEN_COLOR,
6452
7190
  fontSize: "8",
6453
7191
  fontFamily: "monospace",
6454
7192
  textAnchor: "middle",
@@ -6489,7 +7227,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6489
7227
  cy: scaleY(hoverPnl),
6490
7228
  r: "3",
6491
7229
  fill: hoverPnl >= 0 ? "#22c55e" : "#ef4444",
6492
- stroke: "#18181b",
7230
+ stroke: BREAKEVEN_RING,
6493
7231
  strokeWidth: "1"
6494
7232
  }
6495
7233
  ),
@@ -6501,7 +7239,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6501
7239
  width: "90",
6502
7240
  height: "28",
6503
7241
  rx: "3",
6504
- fill: "#18181b",
7242
+ fill: BREAKEVEN_RING,
6505
7243
  stroke: "#3f3f46",
6506
7244
  strokeWidth: "1"
6507
7245
  }
@@ -6583,7 +7321,7 @@ var PnlDiagram = React30__namespace.forwardRef(
6583
7321
  ] })
6584
7322
  ] }, i)),
6585
7323
  breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
6586
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full bg-amber-400" }),
7324
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
6587
7325
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-zinc-500", children: [
6588
7326
  "BE: ",
6589
7327
  breakevens.map((b) => b.toFixed(1)).join(", ")
@@ -6599,7 +7337,7 @@ function formatDate(date) {
6599
7337
  const d = new Date(date);
6600
7338
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
6601
7339
  }
6602
- var OptionPositionCard = React30__namespace.forwardRef(
7340
+ var OptionPositionCard = React33__namespace.forwardRef(
6603
7341
  function OptionPositionCard2(props, ref) {
6604
7342
  const {
6605
7343
  position,
@@ -6625,7 +7363,8 @@ var OptionPositionCard = React30__namespace.forwardRef(
6625
7363
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
6626
7364
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
6627
7365
  "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
6628
- isCall ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
7366
+ // Call vs put is a rank difference, not a hue difference.
7367
+ isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
6629
7368
  ), children: [
6630
7369
  position.underlying,
6631
7370
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
@@ -6751,8 +7490,9 @@ function ExpirationPill({ exp, isSelected, onClick }) {
6751
7490
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium whitespace-nowrap", children: formatExpDate(exp.date) }),
6752
7491
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
6753
7492
  "font-mono tabular-nums text-[10px]",
6754
- isSelected ? "text-blue-400/70" : "text-zinc-600",
6755
- exp.dte <= 7 && !isSelected && "text-amber-600"
7493
+ isSelected ? "text-[var(--foreground)]" : "text-[var(--muted-foreground)]",
7494
+ // Near expiry is a notice, and a notice in Lux is the loudest neutral.
7495
+ exp.dte <= 7 && !isSelected && "text-[var(--color-status-warn)]"
6756
7496
  ), children: [
6757
7497
  exp.dte,
6758
7498
  "d"
@@ -6761,7 +7501,7 @@ function ExpirationPill({ exp, isSelected, onClick }) {
6761
7501
  }
6762
7502
  );
6763
7503
  }
6764
- var ExpirationSelector = React30__namespace.forwardRef(
7504
+ var ExpirationSelector = React33__namespace.forwardRef(
6765
7505
  function ExpirationSelector2(props, ref) {
6766
7506
  const {
6767
7507
  expirations,
@@ -6771,8 +7511,8 @@ var ExpirationSelector = React30__namespace.forwardRef(
6771
7511
  className,
6772
7512
  ...rest
6773
7513
  } = props;
6774
- const scrollRef = React30__namespace.useRef(null);
6775
- React30__namespace.useEffect(() => {
7514
+ const scrollRef = React33__namespace.useRef(null);
7515
+ React33__namespace.useEffect(() => {
6776
7516
  const container = scrollRef.current;
6777
7517
  if (!container) return;
6778
7518
  const selectedEl = container.querySelector('[data-selected="true"]');
@@ -7089,6 +7829,7 @@ exports.AccordionItemContent = AccordionItemContent;
7089
7829
  exports.AccordionItemTrigger = AccordionItemTrigger;
7090
7830
  exports.AccordionRoot = AccordionRoot;
7091
7831
  exports.Alert = Alert;
7832
+ exports.AppNav = AppNav;
7092
7833
  exports.AppProvider = AppProvider;
7093
7834
  exports.Avatar = Avatar;
7094
7835
  exports.AvatarGroup = AvatarGroup;
@@ -7114,6 +7855,7 @@ exports.CloseButton = CloseButton;
7114
7855
  exports.CollapsibleDetails = CollapsibleDetails;
7115
7856
  exports.CollapsibleList = CollapsibleList;
7116
7857
  exports.ColorModeProvider = ColorModeProvider;
7858
+ exports.DEFAULT_ORG = DEFAULT_ORG;
7117
7859
  exports.DialogActionTrigger = DialogActionTrigger;
7118
7860
  exports.DialogBackdrop = DialogBackdrop;
7119
7861
  exports.DialogBody = DialogBody;
@@ -7140,8 +7882,11 @@ exports.ExpirationSelector = ExpirationSelector;
7140
7882
  exports.Field = Field;
7141
7883
  exports.GreeksDisplay = GreeksDisplay;
7142
7884
  exports.Heading = Heading;
7885
+ exports.IAM_PAGE_SIZE = IAM_PAGE_SIZE;
7886
+ exports.IamError = IamError;
7143
7887
  exports.IconButton = IconButton;
7144
- exports.Image = Image2;
7888
+ exports.IdentityProvider = IdentityProvider;
7889
+ exports.Image = Image;
7145
7890
  exports.Input = Input;
7146
7891
  exports.InputGroup = InputGroup;
7147
7892
  exports.LUX_BRAND = LUX_BRAND;
@@ -7161,8 +7906,10 @@ exports.MenuRoot = MenuRoot;
7161
7906
  exports.MenuSeparator = MenuSeparator;
7162
7907
  exports.MenuTrigger = MenuTrigger;
7163
7908
  exports.MenuTriggerItem = MenuTriggerItem;
7909
+ exports.NARROW_PX = NARROW_PX;
7164
7910
  exports.OptionChain = OptionChain;
7165
7911
  exports.OptionPositionCard = OptionPositionCard;
7912
+ exports.OrgSwitcher = OrgSwitcher;
7166
7913
  exports.PARS_GOLD = PARS_GOLD;
7167
7914
  exports.PinInput = PinInput;
7168
7915
  exports.PnlDiagram = PnlDiagram;
@@ -7181,6 +7928,7 @@ exports.Progress = Progress;
7181
7928
  exports.ProgressCircleRing = ProgressCircleRing;
7182
7929
  exports.ProgressCircleRoot = ProgressCircleRoot;
7183
7930
  exports.ProgressCircleValueText = ProgressCircleValueText;
7931
+ exports.ProjectSwitcher = ProjectSwitcher;
7184
7932
  exports.Radio = Radio2;
7185
7933
  exports.RadioGroup = RadioGroup3;
7186
7934
  exports.Rating = Rating;
@@ -7196,12 +7944,15 @@ exports.SelectLabel = SelectLabel;
7196
7944
  exports.SelectRoot = SelectRoot;
7197
7945
  exports.SelectValueText = SelectValueText;
7198
7946
  exports.Separator = Separator2;
7947
+ exports.SettingsMenu = SettingsMenu;
7199
7948
  exports.Skeleton = Skeleton;
7200
7949
  exports.SkeletonCircle = SkeletonCircle;
7201
7950
  exports.SkeletonText = SkeletonText;
7202
7951
  exports.Slider = Slider;
7203
7952
  exports.StrategyBuilder = StrategyBuilder;
7204
7953
  exports.Switch = Switch2;
7954
+ exports.Switcher = Switcher;
7955
+ exports.TOUCH_PX = TOUCH_PX;
7205
7956
  exports.TableBody = TableBody;
7206
7957
  exports.TableCaption = TableCaption;
7207
7958
  exports.TableCell = TableCell;
@@ -7222,14 +7973,27 @@ exports.Tag = Tag;
7222
7973
  exports.Textarea = Textarea;
7223
7974
  exports.Toaster = Toaster;
7224
7975
  exports.Tooltip = Tooltip;
7976
+ exports.UserMenu = UserMenu;
7225
7977
  exports.bankColors = bankColors;
7226
7978
  exports.buttonVariants = buttonVariants;
7227
7979
  exports.cn = cn;
7228
7980
  exports.config = config;
7229
7981
  exports.createListCollection = createListCollection;
7982
+ exports.currentHost = currentHost;
7230
7983
  exports.guiConfig = lux_config_default;
7984
+ exports.iam = iam;
7985
+ exports.iamBase = iamBase;
7986
+ exports.initials = initials;
7231
7987
  exports.luxThemes = luxThemes;
7988
+ exports.orgIdentity = orgIdentity;
7989
+ exports.orgs = ORGS;
7990
+ exports.resolveWhiteLabel = resolveWhiteLabel;
7232
7991
  exports.toaster = toaster;
7233
7992
  exports.useAccordion = useAccordion;
7993
+ exports.useBelow = useBelow;
7234
7994
  exports.useColorMode = useColorMode;
7235
7995
  exports.useColorModeValue = useColorModeValue;
7996
+ exports.useIdentity = useIdentity;
7997
+ exports.useIsNarrow = useIsNarrow;
7998
+ exports.useIsTouch = useIsTouch;
7999
+ exports.useWhiteLabel = useWhiteLabel;