@luxfi/ui 7.4.3 → 7.4.5

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 (125) hide show
  1. package/dist/iam.cjs +1 -1
  2. package/dist/iam.js +1 -1
  3. package/dist/identity.cjs +1 -1
  4. package/dist/identity.js +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +1 -1
  7. package/package.json +2 -2
  8. package/src/iam.ts +16 -2
  9. package/src/identity.tsx +6 -2
  10. package/src/provider.tsx +7 -0
  11. package/tokens.css +319 -613
  12. package/dist/accordion.d.cts +0 -74
  13. package/dist/accordion.d.ts +0 -74
  14. package/dist/alert.d.cts +0 -30
  15. package/dist/alert.d.ts +0 -30
  16. package/dist/avatar.d.cts +0 -25
  17. package/dist/avatar.d.ts +0 -25
  18. package/dist/badge.d.cts +0 -19
  19. package/dist/badge.d.ts +0 -19
  20. package/dist/bank.d.cts +0 -83
  21. package/dist/bank.d.ts +0 -83
  22. package/dist/button.d.cts +0 -55
  23. package/dist/button.d.ts +0 -55
  24. package/dist/checkbox.d.cts +0 -32
  25. package/dist/checkbox.d.ts +0 -32
  26. package/dist/chrome.d.cts +0 -93
  27. package/dist/chrome.d.ts +0 -93
  28. package/dist/close-button.d.cts +0 -9
  29. package/dist/close-button.d.ts +0 -9
  30. package/dist/collapsible.d.cts +0 -23
  31. package/dist/collapsible.d.ts +0 -23
  32. package/dist/color-mode.d.cts +0 -25
  33. package/dist/color-mode.d.ts +0 -25
  34. package/dist/dialog.d.cts +0 -118
  35. package/dist/dialog.d.ts +0 -118
  36. package/dist/drawer.d.cts +0 -36
  37. package/dist/drawer.d.ts +0 -36
  38. package/dist/empty-state.d.cts +0 -13
  39. package/dist/empty-state.d.ts +0 -13
  40. package/dist/expiration-selector.d.cts +0 -16
  41. package/dist/expiration-selector.d.ts +0 -16
  42. package/dist/field.d.cts +0 -24
  43. package/dist/field.d.ts +0 -24
  44. package/dist/greeks-display.d.cts +0 -14
  45. package/dist/greeks-display.d.ts +0 -14
  46. package/dist/gui.d.cts +0 -2
  47. package/dist/gui.d.ts +0 -2
  48. package/dist/heading.d.cts +0 -10
  49. package/dist/heading.d.ts +0 -10
  50. package/dist/iam.d.cts +0 -65
  51. package/dist/iam.d.ts +0 -65
  52. package/dist/icon-button.d.cts +0 -33
  53. package/dist/icon-button.d.ts +0 -33
  54. package/dist/icons.d.cts +0 -1
  55. package/dist/icons.d.ts +0 -1
  56. package/dist/identity.d.cts +0 -64
  57. package/dist/identity.d.ts +0 -64
  58. package/dist/image.d.cts +0 -57
  59. package/dist/image.d.ts +0 -57
  60. package/dist/index.d.cts +0 -64
  61. package/dist/index.d.ts +0 -64
  62. package/dist/input-group.d.cts +0 -17
  63. package/dist/input-group.d.ts +0 -17
  64. package/dist/input.d.cts +0 -17
  65. package/dist/input.d.ts +0 -17
  66. package/dist/link.d.cts +0 -37
  67. package/dist/link.d.ts +0 -37
  68. package/dist/lux.config.d.cts +0 -433
  69. package/dist/lux.config.d.ts +0 -433
  70. package/dist/menu.d.cts +0 -84
  71. package/dist/menu.d.ts +0 -84
  72. package/dist/next.d.cts +0 -32
  73. package/dist/next.d.ts +0 -32
  74. package/dist/option-chain.d.cts +0 -37
  75. package/dist/option-chain.d.ts +0 -37
  76. package/dist/option-position.d.cts +0 -29
  77. package/dist/option-position.d.ts +0 -29
  78. package/dist/pin-input.d.cts +0 -25
  79. package/dist/pin-input.d.ts +0 -25
  80. package/dist/pnl-diagram.d.cts +0 -11
  81. package/dist/pnl-diagram.d.ts +0 -11
  82. package/dist/popover.d.cts +0 -73
  83. package/dist/popover.d.ts +0 -73
  84. package/dist/progress-circle.d.cts +0 -47
  85. package/dist/progress-circle.d.ts +0 -47
  86. package/dist/progress.d.cts +0 -28
  87. package/dist/progress.d.ts +0 -28
  88. package/dist/provider.d.cts +0 -25
  89. package/dist/provider.d.ts +0 -25
  90. package/dist/radio.d.cts +0 -53
  91. package/dist/radio.d.ts +0 -53
  92. package/dist/rating.d.cts +0 -14
  93. package/dist/rating.d.ts +0 -14
  94. package/dist/select.d.cts +0 -130
  95. package/dist/select.d.ts +0 -130
  96. package/dist/separator.d.cts +0 -13
  97. package/dist/separator.d.ts +0 -13
  98. package/dist/skeleton.d.cts +0 -60
  99. package/dist/skeleton.d.ts +0 -60
  100. package/dist/slider.d.cts +0 -24
  101. package/dist/slider.d.ts +0 -24
  102. package/dist/strategy-builder.d.cts +0 -26
  103. package/dist/strategy-builder.d.ts +0 -26
  104. package/dist/switch.d.cts +0 -27
  105. package/dist/switch.d.ts +0 -27
  106. package/dist/table.d.cts +0 -107
  107. package/dist/table.d.ts +0 -107
  108. package/dist/tabs.d.cts +0 -78
  109. package/dist/tabs.d.ts +0 -78
  110. package/dist/tag.d.cts +0 -21
  111. package/dist/tag.d.ts +0 -21
  112. package/dist/textarea.d.cts +0 -13
  113. package/dist/textarea.d.ts +0 -13
  114. package/dist/toaster.d.cts +0 -29
  115. package/dist/toaster.d.ts +0 -29
  116. package/dist/tooltip.d.cts +0 -38
  117. package/dist/tooltip.d.ts +0 -38
  118. package/dist/use-narrow.d.cts +0 -12
  119. package/dist/use-narrow.d.ts +0 -12
  120. package/dist/utils.d.cts +0 -5
  121. package/dist/utils.d.ts +0 -5
  122. package/dist/vite.d.cts +0 -29
  123. package/dist/vite.d.ts +0 -29
  124. package/dist/white-label.d.cts +0 -59
  125. package/dist/white-label.d.ts +0 -59
package/dist/iam.cjs CHANGED
@@ -134,7 +134,7 @@ var IamError = class extends Error {
134
134
  };
135
135
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
136
136
  function isSignedOut(status, msg) {
137
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
137
+ return status === 401 || SIGNED_OUT.test(msg);
138
138
  }
139
139
  function iamBase(host) {
140
140
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/dist/iam.js CHANGED
@@ -132,7 +132,7 @@ var IamError = class extends Error {
132
132
  };
133
133
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
134
134
  function isSignedOut(status, msg) {
135
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
135
+ return status === 401 || SIGNED_OUT.test(msg);
136
136
  }
137
137
  function iamBase(host) {
138
138
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/dist/identity.cjs CHANGED
@@ -160,7 +160,7 @@ var IamError = class extends Error {
160
160
  };
161
161
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
162
162
  function isSignedOut(status, msg) {
163
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
163
+ return status === 401 || SIGNED_OUT.test(msg);
164
164
  }
165
165
  function iamBase(host) {
166
166
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/dist/identity.js CHANGED
@@ -139,7 +139,7 @@ var IamError = class extends Error {
139
139
  };
140
140
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
141
141
  function isSignedOut(status, msg) {
142
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
142
+ return status === 401 || SIGNED_OUT.test(msg);
143
143
  }
144
144
  function iamBase(host) {
145
145
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/dist/index.cjs CHANGED
@@ -288,7 +288,7 @@ var IamError = class extends Error {
288
288
  };
289
289
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
290
290
  function isSignedOut(status, msg) {
291
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
291
+ return status === 401 || SIGNED_OUT.test(msg);
292
292
  }
293
293
  function iamBase(host) {
294
294
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/dist/index.js CHANGED
@@ -260,7 +260,7 @@ var IamError = class extends Error {
260
260
  };
261
261
  var SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
262
262
  function isSignedOut(status, msg) {
263
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
263
+ return status === 401 || SIGNED_OUT.test(msg);
264
264
  }
265
265
  function iamBase(host) {
266
266
  const wl = typeof host === "object" && host !== null ? host : resolveWhiteLabel(host);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/ui",
3
- "version": "7.4.3",
3
+ "version": "7.4.5",
4
4
  "description": "Cross-platform DeFi UI components built on @hanzo/gui (Tamagui). Native mobile + web.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -313,7 +313,6 @@
313
313
  "@radix-ui/react-slider": "^1.3.6",
314
314
  "@radix-ui/react-switch": "^1.2.6",
315
315
  "@radix-ui/react-tabs": "^1.1.13",
316
- "@tanstack/react-query": "^5.76.0",
317
316
  "@uidotdev/usehooks": "^2.4.1",
318
317
  "clsx": "^2.1.1",
319
318
  "es-toolkit": "^1.31.0",
@@ -322,6 +321,7 @@
322
321
  "tailwind-merge": "^3.0.0"
323
322
  },
324
323
  "peerDependencies": {
324
+ "@tanstack/react-query": "^5.76.0",
325
325
  "@hanzo/gui": "^7.3.0",
326
326
  "@hanzogui/colors": "^7.3.0",
327
327
  "@hanzogui/config": "^7.3.0",
package/src/iam.ts CHANGED
@@ -70,11 +70,25 @@ export class IamError extends Error {
70
70
  }
71
71
  }
72
72
 
73
- /** IAM answers 401, or 200 with a sign-in message. Both mean "no session". */
73
+ /**
74
+ * "No session" — as opposed to "a session that may not do this".
75
+ *
76
+ * IAM says it two ways: 401, and (measured against lux.id) HTTP **200** with
77
+ * `{"status":"error","msg":"please sign in first"}`, which is what both a
78
+ * missing and a malformed bearer get. So the message has to be read, not just
79
+ * the status.
80
+ *
81
+ * 403 is deliberately NOT here. `get-organizations` answers 403 to an ordinary
82
+ * signed-in user — listing the tenant table is a super-admin read — and folding
83
+ * that into "signed out" logged the user out of the chrome: get-account had
84
+ * already succeeded, then the org read's 403 wiped the account and every
85
+ * switcher offered "Sign in" to somebody who was signed in. Forbidden means
86
+ * signed in and not allowed; the caller falls back to the org it can see.
87
+ */
74
88
  const SIGNED_OUT = /please sign in|authentication required|unauthorized/i;
75
89
 
76
90
  function isSignedOut(status: number, msg: string): boolean {
77
- return status === 401 || status === 403 || SIGNED_OUT.test(msg);
91
+ return status === 401 || SIGNED_OUT.test(msg);
78
92
  }
79
93
 
80
94
  /** The IAM API root for a host — `lux.cloud` → `https://lux.id/v1/iam`. */
package/src/identity.tsx CHANGED
@@ -181,8 +181,12 @@ export const IdentityProvider = ({
181
181
  return;
182
182
  }
183
183
  setAccount(me);
184
- // A member who cannot list the tenant table still has their OWN org:
185
- // fall back to the one the account names rather than showing nothing.
184
+ // A member who cannot list the tenant table still has their OWN org.
185
+ // `get-organizations` is a super-admin read and answers 403 to everyone
186
+ // else (measured on lux.id with a real z@lux.network bearer), so this is
187
+ // the COMMON path, not an edge case: fall back to the org the account
188
+ // itself names rather than showing an empty switcher — or, worse,
189
+ // treating the refusal as "not signed in".
186
190
  const rows = await iam.organizations(call).catch((e: unknown) => {
187
191
  if (e instanceof IamError && !e.unauthenticated) return [ { owner: 'admin', name: me.owner } ];
188
192
  throw e;
package/src/provider.tsx CHANGED
@@ -88,6 +88,13 @@ interface AppProviderProps {
88
88
 
89
89
  // AppProvider wraps GuiProvider (the @hanzogui engine, fed the Lux config) +
90
90
  // tanstack QueryClientProvider. One provider for every Lux surface.
91
+ //
92
+ // @tanstack/react-query is a PEER, not a dependency: it hands out a React
93
+ // context, and a second physical copy is a second context. When this package
94
+ // carried its own, a surface that also used wagmi got two — AppProvider
95
+ // published a client into one context and `useAccount` read the other, and the
96
+ // page died with "No QueryClient set" under a provider that was plainly there.
97
+ // A context library belongs to the app, once.
91
98
  export const AppProvider = ({
92
99
  children,
93
100
  queryClient,