@luxfi/ui 7.3.2 → 7.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/alert.cjs +2 -2
  2. package/dist/alert.js +1 -1
  3. package/dist/avatar.cjs +7 -6
  4. package/dist/avatar.js +7 -5
  5. package/dist/badge.cjs +36 -38
  6. package/dist/badge.js +31 -33
  7. package/dist/bank.cjs +13 -13
  8. package/dist/bank.d.cts +31 -24
  9. package/dist/bank.d.ts +31 -24
  10. package/dist/bank.js +1 -1
  11. package/dist/button.cjs +3 -3
  12. package/dist/button.js +1 -1
  13. package/dist/checkbox.cjs +4 -4
  14. package/dist/checkbox.d.cts +3 -2
  15. package/dist/checkbox.d.ts +3 -2
  16. package/dist/checkbox.js +5 -4
  17. package/dist/chrome.cjs +950 -0
  18. package/dist/chrome.d.cts +93 -0
  19. package/dist/chrome.d.ts +93 -0
  20. package/dist/chrome.js +921 -0
  21. package/dist/close-button.cjs +2 -2
  22. package/dist/close-button.js +1 -1
  23. package/dist/dialog.cjs +13 -14
  24. package/dist/dialog.d.cts +58 -5
  25. package/dist/dialog.d.ts +58 -5
  26. package/dist/dialog.js +1 -2
  27. package/dist/drawer.cjs +87 -21
  28. package/dist/drawer.js +85 -19
  29. package/dist/expiration-selector.cjs +3 -2
  30. package/dist/expiration-selector.js +3 -2
  31. package/dist/greeks-display.cjs +6 -6
  32. package/dist/greeks-display.js +6 -6
  33. package/dist/gui.cjs +13 -0
  34. package/dist/gui.d.cts +2 -0
  35. package/dist/gui.d.ts +2 -0
  36. package/dist/gui.js +2 -0
  37. package/dist/heading.cjs +4 -2
  38. package/dist/heading.js +4 -2
  39. package/dist/iam.cjs +206 -0
  40. package/dist/iam.d.cts +65 -0
  41. package/dist/iam.d.ts +65 -0
  42. package/dist/iam.js +201 -0
  43. package/dist/icon-button.cjs +2 -2
  44. package/dist/icon-button.js +1 -1
  45. package/dist/icons.cjs +13 -0
  46. package/dist/icons.d.cts +1 -0
  47. package/dist/icons.d.ts +1 -0
  48. package/dist/icons.js +2 -0
  49. package/dist/identity.cjs +420 -0
  50. package/dist/identity.d.cts +64 -0
  51. package/dist/identity.d.ts +64 -0
  52. package/dist/identity.js +398 -0
  53. package/dist/index.cjs +1699 -860
  54. package/dist/index.d.cts +12 -4
  55. package/dist/index.d.ts +12 -4
  56. package/dist/index.js +1618 -802
  57. package/dist/input.cjs +13 -3
  58. package/dist/input.d.cts +6 -0
  59. package/dist/input.d.ts +6 -0
  60. package/dist/input.js +13 -3
  61. package/dist/lux.config.cjs +77 -0
  62. package/dist/lux.config.d.cts +433 -0
  63. package/dist/lux.config.d.ts +433 -0
  64. package/dist/lux.config.js +69 -0
  65. package/dist/menu.cjs +4 -4
  66. package/dist/menu.js +4 -4
  67. package/dist/next.cjs +99 -0
  68. package/dist/next.d.cts +29 -0
  69. package/dist/next.d.ts +29 -0
  70. package/dist/next.js +96 -0
  71. package/dist/option-chain.cjs +1 -1
  72. package/dist/option-chain.js +1 -1
  73. package/dist/option-position.cjs +2 -1
  74. package/dist/option-position.js +2 -1
  75. package/dist/pnl-diagram.cjs +8 -6
  76. package/dist/pnl-diagram.js +8 -6
  77. package/dist/popover.cjs +8 -9
  78. package/dist/popover.js +1 -2
  79. package/dist/progress.cjs +7 -6
  80. package/dist/progress.js +7 -5
  81. package/dist/provider.cjs +199 -5
  82. package/dist/provider.d.cts +16 -3
  83. package/dist/provider.d.ts +16 -3
  84. package/dist/provider.js +195 -6
  85. package/dist/radio.cjs +9 -7
  86. package/dist/radio.js +10 -7
  87. package/dist/separator.cjs +3 -1
  88. package/dist/separator.js +3 -1
  89. package/dist/slider.cjs +28 -16
  90. package/dist/slider.js +28 -15
  91. package/dist/strategy-builder.cjs +2 -1
  92. package/dist/strategy-builder.js +2 -1
  93. package/dist/switch.cjs +11 -12
  94. package/dist/switch.js +12 -12
  95. package/dist/tag.cjs +38 -41
  96. package/dist/tag.js +31 -34
  97. package/dist/textarea.cjs +13 -3
  98. package/dist/textarea.d.cts +2 -0
  99. package/dist/textarea.d.ts +2 -0
  100. package/dist/textarea.js +13 -3
  101. package/dist/tooltip.cjs +31 -33
  102. package/dist/tooltip.js +25 -27
  103. package/dist/use-narrow.cjs +46 -0
  104. package/dist/use-narrow.d.cts +12 -0
  105. package/dist/use-narrow.d.ts +12 -0
  106. package/dist/use-narrow.js +20 -0
  107. package/dist/vite.cjs +40 -0
  108. package/dist/vite.d.cts +29 -0
  109. package/dist/vite.d.ts +29 -0
  110. package/dist/vite.js +38 -0
  111. package/dist/white-label.cjs +132 -0
  112. package/dist/white-label.d.cts +59 -0
  113. package/dist/white-label.d.ts +59 -0
  114. package/dist/white-label.js +124 -0
  115. package/package.json +95 -17
  116. package/src/avatar.tsx +22 -16
  117. package/src/bank.tsx +2 -2
  118. package/src/button.tsx +1 -1
  119. package/src/checkbox.tsx +15 -10
  120. package/src/chrome.tsx +459 -0
  121. package/src/close-button.tsx +1 -1
  122. package/src/dialog.tsx +1 -1
  123. package/src/drawer.tsx +83 -10
  124. package/src/expiration-selector.tsx +3 -2
  125. package/src/greeks-display.tsx +9 -6
  126. package/src/gui.ts +17 -0
  127. package/src/heading.tsx +12 -8
  128. package/src/iam.ts +170 -0
  129. package/src/icon-button.tsx +1 -1
  130. package/src/icons.ts +18 -0
  131. package/src/identity.tsx +318 -0
  132. package/src/index.ts +50 -1
  133. package/src/input.tsx +24 -4
  134. package/src/lux.config.ts +82 -0
  135. package/src/menu.tsx +4 -4
  136. package/src/next.ts +142 -0
  137. package/src/option-chain.tsx +1 -1
  138. package/src/option-position.tsx +2 -1
  139. package/src/pnl-diagram.tsx +11 -6
  140. package/src/popover.tsx +1 -1
  141. package/src/progress.tsx +15 -8
  142. package/src/provider.tsx +92 -12
  143. package/src/radio.tsx +15 -11
  144. package/src/separator.tsx +8 -3
  145. package/src/slider.tsx +35 -19
  146. package/src/strategy-builder.tsx +3 -2
  147. package/src/switch.tsx +17 -16
  148. package/src/textarea.tsx +18 -4
  149. package/src/tooltip.tsx +4 -23
  150. package/src/use-narrow.ts +40 -0
  151. package/src/vite.ts +78 -0
  152. package/src/white-label.ts +240 -0
  153. package/tokens.css +544 -319
  154. package/src/tokens.css +0 -438
package/dist/next.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /** Every package `@hanzo/gui` re-exports — the engine, in full. */
2
+ declare const GUI_PACKAGES: string[];
3
+ interface WebpackConfig {
4
+ resolve?: {
5
+ alias?: Record<string, unknown>;
6
+ };
7
+ plugins?: Array<unknown>;
8
+ [key: string]: unknown;
9
+ }
10
+ /** The structural slice of a Next config this wrapper touches. */
11
+ interface LuxUiNextConfig {
12
+ transpilePackages?: Array<string>;
13
+ turbopack?: {
14
+ resolveAlias?: Record<string, string>;
15
+ [key: string]: unknown;
16
+ };
17
+ env?: Record<string, string>;
18
+ webpack?: (config: WebpackConfig, context: unknown) => WebpackConfig;
19
+ [key: string]: unknown;
20
+ }
21
+ /**
22
+ * Wrap a Next config so `@luxfi/ui` and the gui engine build.
23
+ *
24
+ * Additive: an existing `transpilePackages`, `turbopack.resolveAlias`,
25
+ * `env` and `webpack()` are all preserved and extended, never replaced.
26
+ */
27
+ declare function withLuxUi(config?: LuxUiNextConfig): LuxUiNextConfig;
28
+
29
+ export { GUI_PACKAGES, type LuxUiNextConfig, withLuxUi };
package/dist/next.js ADDED
@@ -0,0 +1,96 @@
1
+ // src/next.ts
2
+ var GUI_PACKAGES = [
3
+ "@hanzo/gui",
4
+ "@hanzogui/accordion",
5
+ "@hanzogui/adapt",
6
+ "@hanzogui/alert-dialog",
7
+ "@hanzogui/animate",
8
+ "@hanzogui/animate-presence",
9
+ "@hanzogui/avatar",
10
+ "@hanzogui/button",
11
+ "@hanzogui/card",
12
+ "@hanzogui/checkbox",
13
+ "@hanzogui/collapsible",
14
+ "@hanzogui/component-helpers",
15
+ "@hanzogui/compose-refs",
16
+ "@hanzogui/config",
17
+ "@hanzogui/context-menu",
18
+ "@hanzogui/core",
19
+ "@hanzogui/create-context",
20
+ "@hanzogui/create-menu",
21
+ "@hanzogui/dialog",
22
+ "@hanzogui/element",
23
+ "@hanzogui/elements",
24
+ "@hanzogui/font-size",
25
+ "@hanzogui/form",
26
+ "@hanzogui/group",
27
+ "@hanzogui/image",
28
+ "@hanzogui/input",
29
+ "@hanzogui/label",
30
+ "@hanzogui/list-item",
31
+ "@hanzogui/menu",
32
+ "@hanzogui/popover",
33
+ "@hanzogui/popper",
34
+ "@hanzogui/portal",
35
+ "@hanzogui/progress",
36
+ "@hanzogui/radio-group",
37
+ "@hanzogui/react-native-media-driver",
38
+ "@hanzogui/scroll-view",
39
+ "@hanzogui/select",
40
+ "@hanzogui/separator",
41
+ "@hanzogui/shapes",
42
+ "@hanzogui/sheet",
43
+ "@hanzogui/slider",
44
+ "@hanzogui/spacer",
45
+ "@hanzogui/spinner",
46
+ "@hanzogui/stacks",
47
+ "@hanzogui/switch",
48
+ "@hanzogui/tabs",
49
+ "@hanzogui/text",
50
+ "@hanzogui/theme",
51
+ "@hanzogui/toast",
52
+ "@hanzogui/toggle-group",
53
+ "@hanzogui/tooltip",
54
+ "@hanzogui/use-controllable-state",
55
+ "@hanzogui/use-debounce",
56
+ "@hanzogui/use-force-update",
57
+ "@hanzogui/use-window-dimensions",
58
+ "@hanzogui/visually-hidden",
59
+ "@hanzogui/web",
60
+ "@luxfi/ui"
61
+ ];
62
+ var DEFINES = {
63
+ "process.env.EXPO_OS": JSON.stringify("web"),
64
+ "process.env.IS_WEB": JSON.stringify("true")
65
+ };
66
+ function withLuxUi(config = {}) {
67
+ const userWebpack = config.webpack;
68
+ return {
69
+ ...config,
70
+ transpilePackages: [.../* @__PURE__ */ new Set([...config.transpilePackages ?? [], ...GUI_PACKAGES])],
71
+ turbopack: {
72
+ ...config.turbopack,
73
+ resolveAlias: {
74
+ "react-native": "react-native-web",
75
+ ...config.turbopack?.resolveAlias
76
+ }
77
+ },
78
+ // Next inlines `env` into the client bundle, which is how the engine's
79
+ // module-scope platform checks get their answer under Turbopack too.
80
+ env: { EXPO_OS: "web", IS_WEB: "true", ...config.env },
81
+ webpack(webpackConfig, context) {
82
+ const next = userWebpack ? userWebpack(webpackConfig, context) : webpackConfig;
83
+ next.resolve = {
84
+ ...next.resolve,
85
+ alias: { ...next.resolve?.alias, "react-native$": "react-native-web" }
86
+ };
87
+ const webpackModule = context?.webpack;
88
+ if (webpackModule?.DefinePlugin) {
89
+ next.plugins = [...next.plugins ?? [], new webpackModule.DefinePlugin(DEFINES)];
90
+ }
91
+ return next;
92
+ }
93
+ };
94
+ }
95
+
96
+ export { GUI_PACKAGES, withLuxUi };
@@ -179,7 +179,7 @@ var OptionChain = React__namespace.forwardRef(
179
179
  {
180
180
  className: cn(
181
181
  "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
182
- isATM ? "text-amber-400 bg-zinc-800/80" : "text-zinc-300"
182
+ isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
183
183
  ),
184
184
  children: fmt(row.strike)
185
185
  }
@@ -157,7 +157,7 @@ var OptionChain = React.forwardRef(
157
157
  {
158
158
  className: cn(
159
159
  "px-2 py-1 text-center font-mono tabular-nums text-xs font-semibold",
160
- isATM ? "text-amber-400 bg-zinc-800/80" : "text-zinc-300"
160
+ isATM ? "text-[var(--foreground)] bg-[var(--secondary)]" : "text-[var(--muted-foreground)]"
161
161
  ),
162
162
  children: fmt(row.strike)
163
163
  }
@@ -59,7 +59,8 @@ var OptionPositionCard = React__namespace.forwardRef(
59
59
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
60
60
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
61
61
  "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
62
- isCall ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
62
+ // Call vs put is a rank difference, not a hue difference.
63
+ isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
63
64
  ), children: [
64
65
  position.underlying,
65
66
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
@@ -37,7 +37,8 @@ var OptionPositionCard = React.forwardRef(
37
37
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
38
38
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs("span", { className: cn(
39
39
  "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-semibold",
40
- isCall ? "bg-blue-900/40 text-blue-400" : "bg-orange-900/40 text-orange-400"
40
+ // Call vs put is a rank difference, not a hue difference.
41
+ isCall ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
41
42
  ), children: [
42
43
  position.underlying,
43
44
  /* @__PURE__ */ jsx("span", { className: "font-mono tabular-nums", children: position.strike }),
@@ -54,7 +54,9 @@ function buildPath(points, vb, width, height) {
54
54
  });
55
55
  return parts.join(" ");
56
56
  }
57
- var LEG_COLORS = ["#6366f1", "#f59e0b", "#ec4899", "#06b6d4"];
57
+ var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
58
+ var BREAKEVEN_COLOR = "var(--chart-1)";
59
+ var BREAKEVEN_RING = "var(--background)";
58
60
  var PnlDiagram = React__namespace.forwardRef(
59
61
  function PnlDiagram2(props, ref) {
60
62
  const {
@@ -296,13 +298,13 @@ var PnlDiagram = React__namespace.forwardRef(
296
298
  }
297
299
  ),
298
300
  breakevens.map((be, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
299
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: "#fbbf24", stroke: "#18181b", strokeWidth: "1" }),
301
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: BREAKEVEN_COLOR, stroke: BREAKEVEN_RING, strokeWidth: "1" }),
300
302
  /* @__PURE__ */ jsxRuntime.jsx(
301
303
  "text",
302
304
  {
303
305
  x: scaleX(be),
304
306
  y: PADDING.top + chartH + 14,
305
- fill: "#fbbf24",
307
+ fill: BREAKEVEN_COLOR,
306
308
  fontSize: "8",
307
309
  fontFamily: "monospace",
308
310
  textAnchor: "middle",
@@ -343,7 +345,7 @@ var PnlDiagram = React__namespace.forwardRef(
343
345
  cy: scaleY(hoverPnl),
344
346
  r: "3",
345
347
  fill: hoverPnl >= 0 ? "#22c55e" : "#ef4444",
346
- stroke: "#18181b",
348
+ stroke: BREAKEVEN_RING,
347
349
  strokeWidth: "1"
348
350
  }
349
351
  ),
@@ -355,7 +357,7 @@ var PnlDiagram = React__namespace.forwardRef(
355
357
  width: "90",
356
358
  height: "28",
357
359
  rx: "3",
358
- fill: "#18181b",
360
+ fill: BREAKEVEN_RING,
359
361
  stroke: "#3f3f46",
360
362
  strokeWidth: "1"
361
363
  }
@@ -437,7 +439,7 @@ var PnlDiagram = React__namespace.forwardRef(
437
439
  ] })
438
440
  ] }, i)),
439
441
  breakevens.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
440
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full bg-amber-400" }),
442
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
441
443
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-zinc-500", children: [
442
444
  "BE: ",
443
445
  breakevens.map((b) => b.toFixed(1)).join(", ")
@@ -32,7 +32,9 @@ function buildPath(points, vb, width, height) {
32
32
  });
33
33
  return parts.join(" ");
34
34
  }
35
- var LEG_COLORS = ["#6366f1", "#f59e0b", "#ec4899", "#06b6d4"];
35
+ var LEG_COLORS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)"];
36
+ var BREAKEVEN_COLOR = "var(--chart-1)";
37
+ var BREAKEVEN_RING = "var(--background)";
36
38
  var PnlDiagram = React.forwardRef(
37
39
  function PnlDiagram2(props, ref) {
38
40
  const {
@@ -274,13 +276,13 @@ var PnlDiagram = React.forwardRef(
274
276
  }
275
277
  ),
276
278
  breakevens.map((be, i) => /* @__PURE__ */ jsxs("g", { children: [
277
- /* @__PURE__ */ jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: "#fbbf24", stroke: "#18181b", strokeWidth: "1" }),
279
+ /* @__PURE__ */ jsx("circle", { cx: scaleX(be), cy: zeroY, r: "3", fill: BREAKEVEN_COLOR, stroke: BREAKEVEN_RING, strokeWidth: "1" }),
278
280
  /* @__PURE__ */ jsx(
279
281
  "text",
280
282
  {
281
283
  x: scaleX(be),
282
284
  y: PADDING.top + chartH + 14,
283
- fill: "#fbbf24",
285
+ fill: BREAKEVEN_COLOR,
284
286
  fontSize: "8",
285
287
  fontFamily: "monospace",
286
288
  textAnchor: "middle",
@@ -321,7 +323,7 @@ var PnlDiagram = React.forwardRef(
321
323
  cy: scaleY(hoverPnl),
322
324
  r: "3",
323
325
  fill: hoverPnl >= 0 ? "#22c55e" : "#ef4444",
324
- stroke: "#18181b",
326
+ stroke: BREAKEVEN_RING,
325
327
  strokeWidth: "1"
326
328
  }
327
329
  ),
@@ -333,7 +335,7 @@ var PnlDiagram = React.forwardRef(
333
335
  width: "90",
334
336
  height: "28",
335
337
  rx: "3",
336
- fill: "#18181b",
338
+ fill: BREAKEVEN_RING,
337
339
  stroke: "#3f3f46",
338
340
  strokeWidth: "1"
339
341
  }
@@ -415,7 +417,7 @@ var PnlDiagram = React.forwardRef(
415
417
  ] })
416
418
  ] }, i)),
417
419
  breakevens.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
418
- /* @__PURE__ */ jsx("div", { className: "h-1.5 w-1.5 rounded-full bg-amber-400" }),
420
+ /* @__PURE__ */ jsx("div", { className: "h-1.5 w-1.5 rounded-full", style: { background: BREAKEVEN_COLOR } }),
419
421
  /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-zinc-500", children: [
420
422
  "BE: ",
421
423
  breakevens.map((b) => b.toFixed(1)).join(", ")
package/dist/popover.cjs CHANGED
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var popover = require('@hanzogui/popover');
4
+ var gui = require('@hanzo/gui');
5
5
  var React2 = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
8
- var core = require('@hanzogui/core');
9
8
  var jsxRuntime = require('react/jsx-runtime');
10
9
 
11
10
  function _interopNamespace(e) {
@@ -33,7 +32,7 @@ function cn(...inputs) {
33
32
  return tailwindMerge.twMerge(clsx.clsx(inputs));
34
33
  }
35
34
  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";
36
- var CloseButtonFrame = core.styled(core.View, {
35
+ var CloseButtonFrame = gui.styled(gui.View, {
37
36
  name: "LuxCloseButton",
38
37
  render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
39
38
  role: "button",
@@ -166,7 +165,7 @@ var PopoverRoot = (props) => {
166
165
  const placement = mergedPositioning.placement ?? "bottom-start";
167
166
  const offset = mergedPositioning.offset?.mainAxis ?? 4;
168
167
  return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
169
- popover.Popover,
168
+ gui.Popover,
170
169
  {
171
170
  open,
172
171
  defaultOpen,
@@ -180,7 +179,7 @@ var PopoverRoot = (props) => {
180
179
  };
181
180
  var PopoverTrigger = React2__namespace.forwardRef(function PopoverTrigger2(props, ref) {
182
181
  const { asChild = true, ...rest } = props;
183
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
182
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: asChild ? "except-style" : void 0, ref, ...rest });
184
183
  });
185
184
  var PopoverContent = React2__namespace.forwardRef(function PopoverContent2(props, ref) {
186
185
  const { portalled = true, portalRef: _portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
@@ -193,7 +192,7 @@ var PopoverContent = React2__namespace.forwardRef(function PopoverContent2(props
193
192
  ...paddingTop !== void 0 ? { paddingTop: typeof paddingTop === "number" ? `${paddingTop * 4}px` : paddingTop } : {}
194
193
  };
195
194
  return /* @__PURE__ */ jsxRuntime.jsx(
196
- popover.Popover.Content,
195
+ gui.Popover.Content,
197
196
  {
198
197
  ref,
199
198
  unstyled: true,
@@ -216,7 +215,7 @@ var PopoverContent = React2__namespace.forwardRef(function PopoverContent2(props
216
215
  var PopoverArrow = React2__namespace.forwardRef(function PopoverArrow2(props, ref) {
217
216
  const { className, ...rest } = props;
218
217
  return /* @__PURE__ */ jsxRuntime.jsx(
219
- popover.Popover.Arrow,
218
+ gui.Popover.Arrow,
220
219
  {
221
220
  ref,
222
221
  unstyled: true,
@@ -228,7 +227,7 @@ var PopoverArrow = React2__namespace.forwardRef(function PopoverArrow2(props, re
228
227
  var PopoverCloseTrigger = React2__namespace.forwardRef(function PopoverCloseTrigger2(props, ref) {
229
228
  const { className, ...rest } = props;
230
229
  return /* @__PURE__ */ jsxRuntime.jsx(
231
- popover.Popover.Close,
230
+ gui.Popover.Close,
232
231
  {
233
232
  unstyled: true,
234
233
  className: cn("absolute top-1 right-1", className),
@@ -244,7 +243,7 @@ var PopoverCloseTriggerWrapper = React2__namespace.forwardRef(function PopoverCl
244
243
  if (disabled) {
245
244
  return children;
246
245
  }
247
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Close, { ref, ...rest, asChild: true, children });
246
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Close, { ref, ...rest, asChild: true, children });
248
247
  });
249
248
  var PopoverBody = React2__namespace.forwardRef(function PopoverBody2(props, ref) {
250
249
  const {
package/dist/popover.js CHANGED
@@ -1,9 +1,8 @@
1
1
  "use client";
2
- import { Popover } from '@hanzogui/popover';
2
+ import { styled, View, Popover } from '@hanzo/gui';
3
3
  import * as React2 from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
- import { styled, View } from '@hanzogui/core';
7
6
  import { jsx } from 'react/jsx-runtime';
8
7
 
9
8
  // src/popover.tsx
package/dist/progress.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var RadixProgress = require('@radix-ui/react-progress');
4
+ var gui = require('@hanzo/gui');
5
5
  var React = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
@@ -25,7 +25,6 @@ function _interopNamespace(e) {
25
25
  return Object.freeze(n);
26
26
  }
27
27
 
28
- var RadixProgress__namespace = /*#__PURE__*/_interopNamespace(RadixProgress);
29
28
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
29
 
31
30
  // src/progress.tsx
@@ -83,10 +82,11 @@ var Progress = React__namespace.forwardRef(
83
82
  style: rootStyle,
84
83
  ...rest,
85
84
  children: /* @__PURE__ */ jsxRuntime.jsx(
86
- RadixProgress__namespace.Root,
85
+ gui.Progress,
87
86
  {
88
87
  value: percent,
89
88
  max: 100,
89
+ unstyled: true,
90
90
  className: cn(
91
91
  "w-full overflow-hidden rounded-full",
92
92
  "bg-[var(--color-progress-track)]",
@@ -95,14 +95,15 @@ var Progress = React__namespace.forwardRef(
95
95
  ),
96
96
  style: trackStyle,
97
97
  children: /* @__PURE__ */ jsxRuntime.jsx(
98
- RadixProgress__namespace.Indicator,
98
+ gui.Progress.Indicator,
99
99
  {
100
+ unstyled: true,
101
+ transition: "slow",
100
102
  className: cn(
101
- "h-full rounded-full transition-transform duration-500 ease-out",
103
+ "h-full rounded-full",
102
104
  !color && "bg-[var(--color-progress-indicator)]"
103
105
  ),
104
106
  style: {
105
- width: `${percent}%`,
106
107
  ...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
107
108
  }
108
109
  }
package/dist/progress.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import * as RadixProgress from '@radix-ui/react-progress';
2
+ import { Progress as Progress$1 } from '@hanzo/gui';
3
3
  import * as React from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
@@ -60,10 +60,11 @@ var Progress = React.forwardRef(
60
60
  style: rootStyle,
61
61
  ...rest,
62
62
  children: /* @__PURE__ */ jsx(
63
- RadixProgress.Root,
63
+ Progress$1,
64
64
  {
65
65
  value: percent,
66
66
  max: 100,
67
+ unstyled: true,
67
68
  className: cn(
68
69
  "w-full overflow-hidden rounded-full",
69
70
  "bg-[var(--color-progress-track)]",
@@ -72,14 +73,15 @@ var Progress = React.forwardRef(
72
73
  ),
73
74
  style: trackStyle,
74
75
  children: /* @__PURE__ */ jsx(
75
- RadixProgress.Indicator,
76
+ Progress$1.Indicator,
76
77
  {
78
+ unstyled: true,
79
+ transition: "slow",
77
80
  className: cn(
78
- "h-full rounded-full transition-transform duration-500 ease-out",
81
+ "h-full rounded-full",
79
82
  !color && "bg-[var(--color-progress-indicator)]"
80
83
  ),
81
84
  style: {
82
- width: `${percent}%`,
83
85
  ...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
84
86
  }
85
87
  }
package/dist/provider.cjs CHANGED
@@ -1,18 +1,211 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var core = require('@hanzogui/core');
4
+ var gui = require('@hanzo/gui');
5
5
  var reactQuery = require('@tanstack/react-query');
6
+ var React = require('react');
7
+ var v5 = require('@hanzogui/config/v5');
8
+ var v5Css = require('@hanzogui/config/v5-css');
6
9
  var jsxRuntime = require('react/jsx-runtime');
7
10
 
8
- if (typeof window !== "undefined") {
9
- core.createGui({ settings: { autocompleteSpecificTokens: "except-special" } });
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefault(React);
14
+
15
+ // src/white-label.ts
16
+ var LUX_BRAND = {
17
+ lux: "#7000FF",
18
+ zoo: "#6C5EFB",
19
+ hanzo: "#EA580C",
20
+ pars: "#1C3879",
21
+ // bootno.de is its own white label with its own IdP (id.bootno.de) — accent
22
+ // taken from the bootnode console's own brand default, not invented here.
23
+ bootnode: "#3B82F6"
24
+ };
25
+ var PARS_GOLD = "#C8A45C";
26
+ var ORGS = {
27
+ lux: {
28
+ org: "lux",
29
+ name: "Lux",
30
+ domain: "lux.network",
31
+ iamDomain: "lux.id",
32
+ accent: LUX_BRAND.lux,
33
+ accentForeground: "#FFFFFF"
34
+ },
35
+ zoo: {
36
+ org: "zoo",
37
+ name: "Zoo",
38
+ domain: "zoo.ngo",
39
+ // Zoo's IdP is `id.zoo.network`, not a `zoo.id` apex — the one row in this
40
+ // table where the issuer is not `<org>.id`, and the one every hand-rolled
41
+ // per-app branding map got wrong.
42
+ iamDomain: "id.zoo.network",
43
+ accent: LUX_BRAND.zoo,
44
+ accentForeground: "#FFFFFF"
45
+ },
46
+ bootnode: {
47
+ org: "bootnode",
48
+ name: "Bootnode",
49
+ domain: "bootno.de",
50
+ iamDomain: "id.bootno.de",
51
+ accent: LUX_BRAND.lux,
52
+ accentForeground: "#FFFFFF"
53
+ },
54
+ hanzo: {
55
+ org: "hanzo",
56
+ name: "Hanzo",
57
+ domain: "hanzo.ai",
58
+ iamDomain: "hanzo.id",
59
+ accent: LUX_BRAND.hanzo,
60
+ accentForeground: "#FFFFFF"
61
+ },
62
+ pars: {
63
+ org: "pars",
64
+ name: "Pars",
65
+ domain: "pars.id",
66
+ iamDomain: "pars.id",
67
+ accent: LUX_BRAND.pars,
68
+ accentForeground: PARS_GOLD
69
+ }
70
+ };
71
+ var DOMAIN_ORG = [
72
+ ["lux.network", "lux"],
73
+ ["lux.cloud", "lux"],
74
+ ["lux.id", "lux"],
75
+ ["lux.finance", "lux"],
76
+ ["zoo.ngo", "zoo"],
77
+ ["zoo.network", "zoo"],
78
+ ["zoo.cloud", "zoo"],
79
+ ["zoo.id", "zoo"],
80
+ ["hanzo.ai", "hanzo"],
81
+ ["hanzo.cloud", "hanzo"],
82
+ ["hanzo.id", "hanzo"],
83
+ ["pars.id", "pars"],
84
+ ["parsdao.org", "pars"],
85
+ ["bootno.de", "bootnode", "platform"]
86
+ ];
87
+ var DEFAULT_ORG = "lux";
88
+ function normalizeHost(host) {
89
+ const noPort = host.trim().toLowerCase().split(":")[0] ?? "";
90
+ return noPort.replace(/\.$/, "");
91
+ }
92
+ function isUnder(host, domain) {
93
+ return host === domain || host.endsWith(`.${domain}`);
94
+ }
95
+ function matchDomain(host) {
96
+ let best;
97
+ for (const entry of DOMAIN_ORG) {
98
+ if (isUnder(host, entry[0]) && (!best || entry[0].length > best[0].length)) {
99
+ best = entry;
100
+ }
101
+ }
102
+ return best;
103
+ }
104
+ function appSlug(host, domain, apexApp) {
105
+ const sub = host === domain ? "" : host.slice(0, -(domain.length + 1));
106
+ const leftmost = sub.split(".")[0] ?? "";
107
+ if (leftmost && leftmost !== "www") return leftmost;
108
+ if (apexApp) return apexApp;
109
+ const label = domain.split(".")[0] ?? "";
110
+ const tld = domain.split(".").slice(1).join(".");
111
+ return tld.split(".")[0] || label;
112
+ }
113
+ function isLocal(host) {
114
+ return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "0.0.0.0" || host === "[::1]" || host.endsWith(".local");
115
+ }
116
+ function resolveWhiteLabel(host) {
117
+ const h = normalizeHost(host ?? "");
118
+ const match = h ? matchDomain(h) : void 0;
119
+ const org = match ? match[1] : DEFAULT_ORG;
120
+ const identity = ORGS[org];
121
+ const app = match ? appSlug(h, match[0], match[2]) : h && isLocal(h) ? "local" : "app";
122
+ return {
123
+ ...identity,
124
+ host: h,
125
+ app,
126
+ theme: `dark_${org}`,
127
+ issuer: `https://${identity.iamDomain}`,
128
+ clientId: `${org}-${app}`
129
+ };
10
130
  }
131
+ function currentHost() {
132
+ return typeof window === "undefined" ? "" : window.location.host;
133
+ }
134
+
135
+ // src/lux.config.ts
136
+ var TRUE_BLACK = "#000000";
137
+ var darkBase = {
138
+ ...v5.defaultConfig.themes.dark,
139
+ background: TRUE_BLACK,
140
+ backgroundHover: "#0A0A0A",
141
+ backgroundPress: "#141414",
142
+ backgroundFocus: "#0A0A0A"
143
+ };
144
+ var brandTheme = (accent, extra = {}) => ({
145
+ ...darkBase,
146
+ accentBackground: accent,
147
+ accentColor: "#FFFFFF",
148
+ borderColorHover: accent,
149
+ colorHover: accent,
150
+ ...extra
151
+ });
152
+ var luxThemes = {
153
+ dark: darkBase,
154
+ dark_lux: brandTheme(LUX_BRAND.lux),
155
+ dark_zoo: brandTheme(LUX_BRAND.zoo),
156
+ dark_hanzo: brandTheme(LUX_BRAND.hanzo),
157
+ dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD }),
158
+ dark_bootnode: brandTheme(LUX_BRAND.bootnode)
159
+ };
160
+ var config = gui.createGui({
161
+ ...v5.defaultConfig,
162
+ animations: v5Css.animations,
163
+ settings: {
164
+ ...v5.defaultConfig.settings,
165
+ onlyAllowShorthands: false
166
+ },
167
+ themes: {
168
+ ...v5.defaultConfig.themes,
169
+ ...luxThemes
170
+ }
171
+ });
172
+ var lux_config_default = config;
11
173
  var defaultQueryClient = new reactQuery.QueryClient({
12
174
  defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 3e4 } }
13
175
  });
14
- var AppProvider = ({ children, queryClient }) => {
15
- return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children });
176
+ var FONT_BODY_RESET_ID = "lux-ui-font-body-reset";
177
+ var FONT_BODY_RESET_CSS = "body .font_body{line-height:1.5}";
178
+ var useFontBodyReset = () => {
179
+ React__default.default.useInsertionEffect(() => {
180
+ if (typeof document === "undefined") return;
181
+ if (document.getElementById(FONT_BODY_RESET_ID)) return;
182
+ const style = document.createElement("style");
183
+ style.id = FONT_BODY_RESET_ID;
184
+ style.textContent = FONT_BODY_RESET_CSS;
185
+ document.head.appendChild(style);
186
+ }, []);
187
+ };
188
+ var WhiteLabelContext = React__default.default.createContext(resolveWhiteLabel(""));
189
+ var useWhiteLabel = () => React__default.default.useContext(WhiteLabelContext);
190
+ var useHostWhiteLabel = (host) => {
191
+ const [resolvedHost, setResolvedHost] = React__default.default.useState(host ?? "");
192
+ React__default.default.useEffect(() => {
193
+ if (host !== void 0) return;
194
+ const browserHost = currentHost();
195
+ if (browserHost) setResolvedHost(browserHost);
196
+ }, [host]);
197
+ return React__default.default.useMemo(() => resolveWhiteLabel(resolvedHost), [resolvedHost]);
198
+ };
199
+ var AppProvider = ({
200
+ children,
201
+ queryClient,
202
+ host,
203
+ defaultTheme
204
+ }) => {
205
+ useFontBodyReset();
206
+ const whiteLabel = useHostWhiteLabel(host);
207
+ const theme = defaultTheme ?? whiteLabel.theme;
208
+ 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 }) }) });
16
209
  };
17
210
 
18
211
  Object.defineProperty(exports, "QueryClient", {
@@ -36,3 +229,4 @@ Object.defineProperty(exports, "useQueryClient", {
36
229
  get: function () { return reactQuery.useQueryClient; }
37
230
  });
38
231
  exports.AppProvider = AppProvider;
232
+ exports.useWhiteLabel = useWhiteLabel;