@luxfi/ui 7.4.5 → 7.4.7

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 (159) hide show
  1. package/dist/accordion.d.cts +74 -0
  2. package/dist/accordion.d.ts +74 -0
  3. package/dist/alert.cjs +3 -7
  4. package/dist/alert.d.cts +30 -0
  5. package/dist/alert.d.ts +30 -0
  6. package/dist/alert.js +3 -7
  7. package/dist/auth.cjs +481 -0
  8. package/dist/auth.d.cts +80 -0
  9. package/dist/auth.d.ts +80 -0
  10. package/dist/auth.js +456 -0
  11. package/dist/avatar.d.cts +25 -0
  12. package/dist/avatar.d.ts +25 -0
  13. package/dist/badge.cjs +4 -8
  14. package/dist/badge.d.cts +19 -0
  15. package/dist/badge.d.ts +19 -0
  16. package/dist/badge.js +4 -8
  17. package/dist/bank.d.cts +83 -0
  18. package/dist/bank.d.ts +83 -0
  19. package/dist/button.cjs +3 -7
  20. package/dist/button.d.cts +55 -0
  21. package/dist/button.d.ts +55 -0
  22. package/dist/button.js +3 -7
  23. package/dist/checkbox.d.cts +32 -0
  24. package/dist/checkbox.d.ts +32 -0
  25. package/dist/chrome.d.cts +93 -0
  26. package/dist/chrome.d.ts +93 -0
  27. package/dist/close-button.d.cts +9 -0
  28. package/dist/close-button.d.ts +9 -0
  29. package/dist/collapsible.cjs +3 -7
  30. package/dist/collapsible.d.cts +23 -0
  31. package/dist/collapsible.d.ts +23 -0
  32. package/dist/collapsible.js +3 -7
  33. package/dist/color-mode.d.cts +25 -0
  34. package/dist/color-mode.d.ts +25 -0
  35. package/dist/dialog.d.cts +118 -0
  36. package/dist/dialog.d.ts +118 -0
  37. package/dist/drawer.d.cts +36 -0
  38. package/dist/drawer.d.ts +36 -0
  39. package/dist/empty-state.d.cts +13 -0
  40. package/dist/empty-state.d.ts +13 -0
  41. package/dist/expiration-selector.d.cts +16 -0
  42. package/dist/expiration-selector.d.ts +16 -0
  43. package/dist/field.d.cts +24 -0
  44. package/dist/field.d.ts +24 -0
  45. package/dist/greeks-display.d.cts +14 -0
  46. package/dist/greeks-display.d.ts +14 -0
  47. package/dist/gui.d.cts +2 -0
  48. package/dist/gui.d.ts +2 -0
  49. package/dist/heading.d.cts +10 -0
  50. package/dist/heading.d.ts +10 -0
  51. package/dist/iam.d.cts +65 -0
  52. package/dist/iam.d.ts +65 -0
  53. package/dist/icon-button.cjs +3 -7
  54. package/dist/icon-button.d.cts +33 -0
  55. package/dist/icon-button.d.ts +33 -0
  56. package/dist/icon-button.js +3 -7
  57. package/dist/icons.cjs +0 -1
  58. package/dist/icons.d.cts +1 -0
  59. package/dist/icons.d.ts +1 -0
  60. package/dist/icons.js +0 -1
  61. package/dist/identity.d.cts +64 -0
  62. package/dist/identity.d.ts +64 -0
  63. package/dist/image.cjs +3 -7
  64. package/dist/image.d.cts +57 -0
  65. package/dist/image.d.ts +57 -0
  66. package/dist/image.js +3 -7
  67. package/dist/index.cjs +9 -8
  68. package/dist/index.d.cts +64 -0
  69. package/dist/index.d.ts +64 -0
  70. package/dist/index.js +9 -9
  71. package/dist/input-group.d.cts +17 -0
  72. package/dist/input-group.d.ts +17 -0
  73. package/dist/input.d.cts +17 -0
  74. package/dist/input.d.ts +17 -0
  75. package/dist/link.cjs +3 -7
  76. package/dist/link.d.cts +37 -0
  77. package/dist/link.d.ts +37 -0
  78. package/dist/link.js +3 -7
  79. package/dist/lux.config.d.cts +433 -0
  80. package/dist/lux.config.d.ts +433 -0
  81. package/dist/menu.d.cts +84 -0
  82. package/dist/menu.d.ts +84 -0
  83. package/dist/next.cjs +11 -1
  84. package/dist/next.d.cts +32 -0
  85. package/dist/next.d.ts +32 -0
  86. package/dist/next.js +11 -1
  87. package/dist/option-chain.d.cts +37 -0
  88. package/dist/option-chain.d.ts +37 -0
  89. package/dist/option-position.d.cts +29 -0
  90. package/dist/option-position.d.ts +29 -0
  91. package/dist/pin-input.d.cts +25 -0
  92. package/dist/pin-input.d.ts +25 -0
  93. package/dist/pnl-diagram.d.cts +11 -0
  94. package/dist/pnl-diagram.d.ts +11 -0
  95. package/dist/popover.d.cts +73 -0
  96. package/dist/popover.d.ts +73 -0
  97. package/dist/progress-circle.d.cts +47 -0
  98. package/dist/progress-circle.d.ts +47 -0
  99. package/dist/progress.d.cts +28 -0
  100. package/dist/progress.d.ts +28 -0
  101. package/dist/provider.d.cts +25 -0
  102. package/dist/provider.d.ts +25 -0
  103. package/dist/radio.d.cts +53 -0
  104. package/dist/radio.d.ts +53 -0
  105. package/dist/rating.d.cts +14 -0
  106. package/dist/rating.d.ts +14 -0
  107. package/dist/select.cjs +3 -7
  108. package/dist/select.d.cts +130 -0
  109. package/dist/select.d.ts +130 -0
  110. package/dist/select.js +3 -7
  111. package/dist/separator.d.cts +13 -0
  112. package/dist/separator.d.ts +13 -0
  113. package/dist/skeleton.cjs +8 -7
  114. package/dist/skeleton.d.cts +76 -0
  115. package/dist/skeleton.d.ts +76 -0
  116. package/dist/skeleton.js +8 -8
  117. package/dist/slider.d.cts +24 -0
  118. package/dist/slider.d.ts +24 -0
  119. package/dist/strategy-builder.d.cts +26 -0
  120. package/dist/strategy-builder.d.ts +26 -0
  121. package/dist/switch.d.cts +27 -0
  122. package/dist/switch.d.ts +27 -0
  123. package/dist/table.cjs +3 -7
  124. package/dist/table.d.cts +107 -0
  125. package/dist/table.d.ts +107 -0
  126. package/dist/table.js +3 -7
  127. package/dist/tabs.d.cts +78 -0
  128. package/dist/tabs.d.ts +78 -0
  129. package/dist/tag.cjs +4 -8
  130. package/dist/tag.d.cts +21 -0
  131. package/dist/tag.d.ts +21 -0
  132. package/dist/tag.js +4 -8
  133. package/dist/textarea.d.cts +13 -0
  134. package/dist/textarea.d.ts +13 -0
  135. package/dist/toaster.d.cts +29 -0
  136. package/dist/toaster.d.ts +29 -0
  137. package/dist/tooltip.cjs +1 -1
  138. package/dist/tooltip.d.cts +38 -0
  139. package/dist/tooltip.d.ts +38 -0
  140. package/dist/tooltip.js +1 -1
  141. package/dist/use-narrow.d.cts +12 -0
  142. package/dist/use-narrow.d.ts +12 -0
  143. package/dist/utils.d.cts +5 -0
  144. package/dist/utils.d.ts +5 -0
  145. package/dist/vite.cjs +4 -3
  146. package/dist/vite.d.cts +29 -0
  147. package/dist/vite.d.ts +29 -0
  148. package/dist/vite.js +4 -3
  149. package/dist/white-label.d.cts +59 -0
  150. package/dist/white-label.d.ts +59 -0
  151. package/package.json +12 -2
  152. package/src/auth.tsx +198 -0
  153. package/src/engine.ts +24 -3
  154. package/src/index.ts +1 -1
  155. package/src/next.ts +10 -0
  156. package/src/skeleton.tsx +36 -7
  157. package/src/tooltip.tsx +13 -5
  158. package/src/vite.ts +4 -9
  159. package/tokens.css +828 -317
package/dist/iam.d.cts ADDED
@@ -0,0 +1,65 @@
1
+ import { WhiteLabel } from './white-label.cjs';
2
+
3
+ /** A signed-in principal, as IAM describes it. */
4
+ interface IamAccount {
5
+ readonly owner: string;
6
+ readonly name: string;
7
+ readonly displayName?: string;
8
+ readonly email?: string;
9
+ readonly avatar?: string;
10
+ readonly isAdmin?: boolean;
11
+ }
12
+ /** An organization the principal can see. */
13
+ interface IamOrg {
14
+ readonly owner: string;
15
+ readonly name: string;
16
+ readonly displayName?: string;
17
+ readonly logo?: string;
18
+ }
19
+ /** A project inside an organization (IAM's Org → Workspace → Project tier). */
20
+ interface IamProject {
21
+ readonly owner: string;
22
+ readonly name: string;
23
+ readonly displayName?: string;
24
+ readonly organization?: string;
25
+ readonly workspace?: string;
26
+ readonly isDefault?: boolean;
27
+ }
28
+ /**
29
+ * A refusal from IAM, carrying enough to tell "not signed in" apart from
30
+ * "signed in, and the answer is genuinely empty" — the distinction a switcher
31
+ * has to render honestly.
32
+ */
33
+ declare class IamError extends Error {
34
+ readonly status: number;
35
+ readonly unauthenticated: boolean;
36
+ constructor(message: string, status: number, unauthenticated: boolean);
37
+ }
38
+ /** The IAM API root for a host — `lux.cloud` → `https://lux.id/v1/iam`. */
39
+ declare function iamBase(host?: string | null | WhiteLabel): string;
40
+ /** How a read reaches IAM: where, and with whose bearer. */
41
+ interface IamCall {
42
+ readonly base: string;
43
+ readonly token?: string | null;
44
+ readonly signal?: AbortSignal;
45
+ }
46
+ /** Rows per page for the org list — small first paint, more on demand. */
47
+ declare const IAM_PAGE_SIZE = 20;
48
+ declare const iam: {
49
+ /** The signed-in principal, or null when there is no session. */
50
+ account(call: IamCall): Promise<IamAccount | null>;
51
+ /**
52
+ * One page of the orgs the principal can see. IAM scopes the read to the
53
+ * caller's authority, so a normal member gets their own org and a super
54
+ * admin gets the tenant list — the page never has to decide.
55
+ */
56
+ organizations(call: IamCall, page?: number, query?: string, pageSize?: number): Promise<Array<IamOrg>>;
57
+ /** One organization by name. */
58
+ organization(call: IamCall, name: string): Promise<IamOrg | null>;
59
+ /** Members of an organization. */
60
+ users(call: IamCall, org: string): Promise<Array<IamAccount>>;
61
+ /** The organization's projects — IAM keys this read by `organization`. */
62
+ projects(call: IamCall, org: string): Promise<Array<IamProject>>;
63
+ };
64
+
65
+ export { IAM_PAGE_SIZE, type IamAccount, type IamCall, IamError, type IamOrg, type IamProject, iam, iamBase };
package/dist/iam.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { WhiteLabel } from './white-label.js';
2
+
3
+ /** A signed-in principal, as IAM describes it. */
4
+ interface IamAccount {
5
+ readonly owner: string;
6
+ readonly name: string;
7
+ readonly displayName?: string;
8
+ readonly email?: string;
9
+ readonly avatar?: string;
10
+ readonly isAdmin?: boolean;
11
+ }
12
+ /** An organization the principal can see. */
13
+ interface IamOrg {
14
+ readonly owner: string;
15
+ readonly name: string;
16
+ readonly displayName?: string;
17
+ readonly logo?: string;
18
+ }
19
+ /** A project inside an organization (IAM's Org → Workspace → Project tier). */
20
+ interface IamProject {
21
+ readonly owner: string;
22
+ readonly name: string;
23
+ readonly displayName?: string;
24
+ readonly organization?: string;
25
+ readonly workspace?: string;
26
+ readonly isDefault?: boolean;
27
+ }
28
+ /**
29
+ * A refusal from IAM, carrying enough to tell "not signed in" apart from
30
+ * "signed in, and the answer is genuinely empty" — the distinction a switcher
31
+ * has to render honestly.
32
+ */
33
+ declare class IamError extends Error {
34
+ readonly status: number;
35
+ readonly unauthenticated: boolean;
36
+ constructor(message: string, status: number, unauthenticated: boolean);
37
+ }
38
+ /** The IAM API root for a host — `lux.cloud` → `https://lux.id/v1/iam`. */
39
+ declare function iamBase(host?: string | null | WhiteLabel): string;
40
+ /** How a read reaches IAM: where, and with whose bearer. */
41
+ interface IamCall {
42
+ readonly base: string;
43
+ readonly token?: string | null;
44
+ readonly signal?: AbortSignal;
45
+ }
46
+ /** Rows per page for the org list — small first paint, more on demand. */
47
+ declare const IAM_PAGE_SIZE = 20;
48
+ declare const iam: {
49
+ /** The signed-in principal, or null when there is no session. */
50
+ account(call: IamCall): Promise<IamAccount | null>;
51
+ /**
52
+ * One page of the orgs the principal can see. IAM scopes the read to the
53
+ * caller's authority, so a normal member gets their own org and a super
54
+ * admin gets the tenant list — the page never has to decide.
55
+ */
56
+ organizations(call: IamCall, page?: number, query?: string, pageSize?: number): Promise<Array<IamOrg>>;
57
+ /** One organization by name. */
58
+ organization(call: IamCall, name: string): Promise<IamOrg | null>;
59
+ /** Members of an organization. */
60
+ users(call: IamCall, org: string): Promise<Array<IamAccount>>;
61
+ /** The organization's projects — IAM keys this read by `organization`. */
62
+ projects(call: IamCall, org: string): Promise<Array<IamProject>>;
63
+ };
64
+
65
+ export { IAM_PAGE_SIZE, type IamAccount, type IamCall, IamError, type IamOrg, type IamProject, iam, iamBase };
@@ -145,11 +145,7 @@ function stripShims(props) {
145
145
  for (const k of SHIM_PROPS) delete out[k];
146
146
  return out;
147
147
  }
148
- var SKELETON_CLASSES = [
149
- "animate-skeleton-shimmer rounded-sm",
150
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
151
- "bg-[length:200%_100%]"
152
- ].join(" ");
148
+ var SKELETON_CLASSES = "lux-skeleton rounded-sm";
153
149
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
154
150
  var Skeleton = React__namespace.forwardRef(
155
151
  function Skeleton2(props, ref) {
@@ -169,7 +165,7 @@ var Skeleton = React__namespace.forwardRef(
169
165
  {
170
166
  ref,
171
167
  "data-loading": true,
172
- className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
168
+ className: cn(SKELETON_CLASSES, "[&_*]:invisible", cls),
173
169
  style: mergedStyle,
174
170
  ...htmlRest,
175
171
  children
@@ -181,7 +177,7 @@ var Skeleton = React__namespace.forwardRef(
181
177
  {
182
178
  ref,
183
179
  "data-loading": true,
184
- className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
180
+ className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
185
181
  style: mergedStyle,
186
182
  ...htmlRest,
187
183
  children
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+
3
+ type Variant = 'plain' | 'icon_secondary' | 'icon_background' | 'link' | 'dropdown' | 'pagination';
4
+ type Size = '2xs' | '2xs_alt' | 'md';
5
+ interface IconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size'> {
6
+ /** Visual variant */
7
+ variant?: Variant;
8
+ /** Icon-button size */
9
+ size?: Size;
10
+ /** Show a loading spinner (disables button) */
11
+ loading?: boolean;
12
+ /** Render a skeleton placeholder instead of the button */
13
+ loadingSkeleton?: boolean;
14
+ /** Maps to data-expanded for popover trigger styling */
15
+ expanded?: boolean;
16
+ /** Maps to data-selected for toggle styling */
17
+ selected?: boolean;
18
+ /** Maps to data-highlighted */
19
+ highlighted?: boolean;
20
+ /** Polymorphic element type (e.g. "div") */
21
+ as?: React.ElementType;
22
+ boxSize?: number | string;
23
+ color?: string;
24
+ px?: string | number;
25
+ borderRadius?: string;
26
+ ml?: number | string;
27
+ mr?: number | string;
28
+ _hover?: Record<string, string>;
29
+ _expanded?: Record<string, string>;
30
+ }
31
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
32
+
33
+ export { IconButton, type IconButtonProps };
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+
3
+ type Variant = 'plain' | 'icon_secondary' | 'icon_background' | 'link' | 'dropdown' | 'pagination';
4
+ type Size = '2xs' | '2xs_alt' | 'md';
5
+ interface IconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size'> {
6
+ /** Visual variant */
7
+ variant?: Variant;
8
+ /** Icon-button size */
9
+ size?: Size;
10
+ /** Show a loading spinner (disables button) */
11
+ loading?: boolean;
12
+ /** Render a skeleton placeholder instead of the button */
13
+ loadingSkeleton?: boolean;
14
+ /** Maps to data-expanded for popover trigger styling */
15
+ expanded?: boolean;
16
+ /** Maps to data-selected for toggle styling */
17
+ selected?: boolean;
18
+ /** Maps to data-highlighted */
19
+ highlighted?: boolean;
20
+ /** Polymorphic element type (e.g. "div") */
21
+ as?: React.ElementType;
22
+ boxSize?: number | string;
23
+ color?: string;
24
+ px?: string | number;
25
+ borderRadius?: string;
26
+ ml?: number | string;
27
+ mr?: number | string;
28
+ _hover?: Record<string, string>;
29
+ _expanded?: Record<string, string>;
30
+ }
31
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
32
+
33
+ export { IconButton, type IconButtonProps };
@@ -123,11 +123,7 @@ function stripShims(props) {
123
123
  for (const k of SHIM_PROPS) delete out[k];
124
124
  return out;
125
125
  }
126
- var SKELETON_CLASSES = [
127
- "animate-skeleton-shimmer rounded-sm",
128
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
129
- "bg-[length:200%_100%]"
130
- ].join(" ");
126
+ var SKELETON_CLASSES = "lux-skeleton rounded-sm";
131
127
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
132
128
  var Skeleton = React.forwardRef(
133
129
  function Skeleton2(props, ref) {
@@ -147,7 +143,7 @@ var Skeleton = React.forwardRef(
147
143
  {
148
144
  ref,
149
145
  "data-loading": true,
150
- className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
146
+ className: cn(SKELETON_CLASSES, "[&_*]:invisible", cls),
151
147
  style: mergedStyle,
152
148
  ...htmlRest,
153
149
  children
@@ -159,7 +155,7 @@ var Skeleton = React.forwardRef(
159
155
  {
160
156
  ref,
161
157
  "data-loading": true,
162
- className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
158
+ className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
163
159
  style: mergedStyle,
164
160
  ...htmlRest,
165
161
  children
package/dist/icons.cjs CHANGED
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  'use strict';
3
2
 
4
3
  var lucideReact = require('lucide-react');
@@ -0,0 +1 @@
1
+ export * from 'lucide-react';
@@ -0,0 +1 @@
1
+ export * from 'lucide-react';
package/dist/icons.js CHANGED
@@ -1,2 +1 @@
1
- "use client";
2
1
  export * from 'lucide-react';
@@ -0,0 +1,64 @@
1
+ import * as React from 'react';
2
+ import { IamAccount, IamOrg, IamProject } from './iam.cjs';
3
+ import { WhiteLabel } from './white-label.cjs';
4
+
5
+ type IdentityStatus = 'loading' | 'anonymous' | 'ready' | 'error';
6
+ /**
7
+ * How the chrome gets a bearer and moves the user in and out of a session.
8
+ *
9
+ * Credentials are `@hanzo/iam`'s job, not the design system's — so this is the
10
+ * seam, and a surface using the SDK supplies only the two verbs:
11
+ *
12
+ * auth={{ signIn: () => void startLogin(), signOut: () => void logout() }}
13
+ *
14
+ * The bearer itself needs no wiring: the default reads the SDK's own token
15
+ * store, so there is exactly one token and one refresh timer per surface.
16
+ */
17
+ interface IdentityAuth {
18
+ /** The IAM access token. Defaults to the `@hanzo/iam` SDK's token store. */
19
+ readonly token?: () => string | null | Promise<string | null>;
20
+ /** Start a sign-in. */
21
+ readonly signIn?: () => void;
22
+ /** End the session. */
23
+ readonly signOut?: () => void;
24
+ }
25
+ interface Identity {
26
+ readonly status: IdentityStatus;
27
+ /** The signed-in principal, or null. */
28
+ readonly account: IamAccount | null;
29
+ /** Organizations the principal can act in. */
30
+ readonly orgs: ReadonlyArray<IamOrg>;
31
+ /** The organization the surface is currently scoped to, or null. */
32
+ readonly org: IamOrg | null;
33
+ /** Projects in the current organization. */
34
+ readonly projects: ReadonlyArray<IamProject>;
35
+ /** The project the surface is currently scoped to, or null. */
36
+ readonly project: IamProject | null;
37
+ /** Why the reads failed, when status is 'error'. */
38
+ readonly error: string | null;
39
+ /** Host-resolved brand, theme, issuer and IAM client. */
40
+ readonly whiteLabel: WhiteLabel;
41
+ readonly setOrg: (name: string) => void;
42
+ readonly setProject: (name: string) => void;
43
+ readonly signIn: () => void;
44
+ readonly signOut: () => void;
45
+ readonly reload: () => void;
46
+ }
47
+ interface IdentityProviderProps {
48
+ readonly children: React.ReactNode;
49
+ /** Bearer + sign-in/out. Defaults to the `@hanzo/iam` token store. */
50
+ readonly auth?: IdentityAuth;
51
+ /** Where sign-in goes when `auth.signIn` is not supplied. */
52
+ readonly loginPath?: string;
53
+ }
54
+ declare const IdentityProvider: ({ children, auth, loginPath, }: IdentityProviderProps) => React.ReactElement;
55
+ /**
56
+ * The current identity.
57
+ *
58
+ * Outside an `<IdentityProvider>` this reports `anonymous` rather than
59
+ * throwing: chrome that renders before a surface has wired identity should
60
+ * offer sign-in, not crash the page.
61
+ */
62
+ declare function useIdentity(): Identity;
63
+
64
+ export { type Identity, type IdentityAuth, IdentityProvider, type IdentityProviderProps, type IdentityStatus, useIdentity };
@@ -0,0 +1,64 @@
1
+ import * as React from 'react';
2
+ import { IamAccount, IamOrg, IamProject } from './iam.js';
3
+ import { WhiteLabel } from './white-label.js';
4
+
5
+ type IdentityStatus = 'loading' | 'anonymous' | 'ready' | 'error';
6
+ /**
7
+ * How the chrome gets a bearer and moves the user in and out of a session.
8
+ *
9
+ * Credentials are `@hanzo/iam`'s job, not the design system's — so this is the
10
+ * seam, and a surface using the SDK supplies only the two verbs:
11
+ *
12
+ * auth={{ signIn: () => void startLogin(), signOut: () => void logout() }}
13
+ *
14
+ * The bearer itself needs no wiring: the default reads the SDK's own token
15
+ * store, so there is exactly one token and one refresh timer per surface.
16
+ */
17
+ interface IdentityAuth {
18
+ /** The IAM access token. Defaults to the `@hanzo/iam` SDK's token store. */
19
+ readonly token?: () => string | null | Promise<string | null>;
20
+ /** Start a sign-in. */
21
+ readonly signIn?: () => void;
22
+ /** End the session. */
23
+ readonly signOut?: () => void;
24
+ }
25
+ interface Identity {
26
+ readonly status: IdentityStatus;
27
+ /** The signed-in principal, or null. */
28
+ readonly account: IamAccount | null;
29
+ /** Organizations the principal can act in. */
30
+ readonly orgs: ReadonlyArray<IamOrg>;
31
+ /** The organization the surface is currently scoped to, or null. */
32
+ readonly org: IamOrg | null;
33
+ /** Projects in the current organization. */
34
+ readonly projects: ReadonlyArray<IamProject>;
35
+ /** The project the surface is currently scoped to, or null. */
36
+ readonly project: IamProject | null;
37
+ /** Why the reads failed, when status is 'error'. */
38
+ readonly error: string | null;
39
+ /** Host-resolved brand, theme, issuer and IAM client. */
40
+ readonly whiteLabel: WhiteLabel;
41
+ readonly setOrg: (name: string) => void;
42
+ readonly setProject: (name: string) => void;
43
+ readonly signIn: () => void;
44
+ readonly signOut: () => void;
45
+ readonly reload: () => void;
46
+ }
47
+ interface IdentityProviderProps {
48
+ readonly children: React.ReactNode;
49
+ /** Bearer + sign-in/out. Defaults to the `@hanzo/iam` token store. */
50
+ readonly auth?: IdentityAuth;
51
+ /** Where sign-in goes when `auth.signIn` is not supplied. */
52
+ readonly loginPath?: string;
53
+ }
54
+ declare const IdentityProvider: ({ children, auth, loginPath, }: IdentityProviderProps) => React.ReactElement;
55
+ /**
56
+ * The current identity.
57
+ *
58
+ * Outside an `<IdentityProvider>` this reports `anonymous` rather than
59
+ * throwing: chrome that renders before a surface has wired identity should
60
+ * offer sign-in, not crash the page.
61
+ */
62
+ declare function useIdentity(): Identity;
63
+
64
+ export { type Identity, type IdentityAuth, IdentityProvider, type IdentityProviderProps, type IdentityStatus, useIdentity };
package/dist/image.cjs CHANGED
@@ -144,11 +144,7 @@ function stripShims(props) {
144
144
  for (const k of SHIM_PROPS) delete out[k];
145
145
  return out;
146
146
  }
147
- var SKELETON_CLASSES = [
148
- "animate-skeleton-shimmer rounded-sm",
149
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
150
- "bg-[length:200%_100%]"
151
- ].join(" ");
147
+ var SKELETON_CLASSES = "lux-skeleton rounded-sm";
152
148
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
153
149
  var Skeleton = React2__namespace.forwardRef(
154
150
  function Skeleton2(props, ref) {
@@ -168,7 +164,7 @@ var Skeleton = React2__namespace.forwardRef(
168
164
  {
169
165
  ref,
170
166
  "data-loading": true,
171
- className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
167
+ className: cn(SKELETON_CLASSES, "[&_*]:invisible", cls),
172
168
  style: mergedStyle,
173
169
  ...htmlRest,
174
170
  children
@@ -180,7 +176,7 @@ var Skeleton = React2__namespace.forwardRef(
180
176
  {
181
177
  ref,
182
178
  "data-loading": true,
183
- className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
179
+ className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
184
180
  style: mergedStyle,
185
181
  ...htmlRest,
186
182
  children
@@ -0,0 +1,57 @@
1
+ import React__default from 'react';
2
+
3
+ type CSSValue = string | number | undefined;
4
+ type ResponsiveValue<T> = T | {
5
+ base?: T;
6
+ sm?: T;
7
+ md?: T;
8
+ lg?: T;
9
+ xl?: T;
10
+ _light?: T;
11
+ _dark?: T;
12
+ };
13
+ interface StyleProps {
14
+ boxSize?: CSSValue;
15
+ borderRadius?: CSSValue;
16
+ width?: CSSValue;
17
+ w?: ResponsiveValue<CSSValue>;
18
+ height?: CSSValue;
19
+ h?: ResponsiveValue<CSSValue>;
20
+ maxW?: CSSValue;
21
+ maxH?: CSSValue;
22
+ minW?: CSSValue;
23
+ mr?: CSSValue;
24
+ mb?: CSSValue;
25
+ ml?: CSSValue;
26
+ mt?: CSSValue;
27
+ mx?: CSSValue;
28
+ my?: CSSValue;
29
+ marginRight?: CSSValue;
30
+ display?: CSSValue;
31
+ position?: CSSValue;
32
+ top?: CSSValue;
33
+ left?: ResponsiveValue<CSSValue>;
34
+ right?: CSSValue;
35
+ bottom?: CSSValue;
36
+ zIndex?: CSSValue;
37
+ objectFit?: CSSValue;
38
+ objectPosition?: CSSValue;
39
+ flexShrink?: CSSValue;
40
+ overflow?: CSSValue;
41
+ cursor?: CSSValue;
42
+ }
43
+ interface ImageProps extends StyleProps {
44
+ readonly className?: string;
45
+ readonly src?: string;
46
+ readonly alt?: string;
47
+ readonly style?: React__default.CSSProperties;
48
+ readonly fallback?: React__default.ReactNode;
49
+ readonly onClick?: React__default.MouseEventHandler<HTMLImageElement>;
50
+ readonly onLoad?: React__default.ReactEventHandler<HTMLImageElement>;
51
+ readonly onError?: React__default.ReactEventHandler<HTMLImageElement>;
52
+ readonly skeletonWidth?: CSSValue;
53
+ readonly skeletonHeight?: CSSValue;
54
+ }
55
+ declare const Image: React__default.ForwardRefExoticComponent<ImageProps & React__default.RefAttributes<HTMLImageElement>>;
56
+
57
+ export { Image, type ImageProps };
@@ -0,0 +1,57 @@
1
+ import React__default from 'react';
2
+
3
+ type CSSValue = string | number | undefined;
4
+ type ResponsiveValue<T> = T | {
5
+ base?: T;
6
+ sm?: T;
7
+ md?: T;
8
+ lg?: T;
9
+ xl?: T;
10
+ _light?: T;
11
+ _dark?: T;
12
+ };
13
+ interface StyleProps {
14
+ boxSize?: CSSValue;
15
+ borderRadius?: CSSValue;
16
+ width?: CSSValue;
17
+ w?: ResponsiveValue<CSSValue>;
18
+ height?: CSSValue;
19
+ h?: ResponsiveValue<CSSValue>;
20
+ maxW?: CSSValue;
21
+ maxH?: CSSValue;
22
+ minW?: CSSValue;
23
+ mr?: CSSValue;
24
+ mb?: CSSValue;
25
+ ml?: CSSValue;
26
+ mt?: CSSValue;
27
+ mx?: CSSValue;
28
+ my?: CSSValue;
29
+ marginRight?: CSSValue;
30
+ display?: CSSValue;
31
+ position?: CSSValue;
32
+ top?: CSSValue;
33
+ left?: ResponsiveValue<CSSValue>;
34
+ right?: CSSValue;
35
+ bottom?: CSSValue;
36
+ zIndex?: CSSValue;
37
+ objectFit?: CSSValue;
38
+ objectPosition?: CSSValue;
39
+ flexShrink?: CSSValue;
40
+ overflow?: CSSValue;
41
+ cursor?: CSSValue;
42
+ }
43
+ interface ImageProps extends StyleProps {
44
+ readonly className?: string;
45
+ readonly src?: string;
46
+ readonly alt?: string;
47
+ readonly style?: React__default.CSSProperties;
48
+ readonly fallback?: React__default.ReactNode;
49
+ readonly onClick?: React__default.MouseEventHandler<HTMLImageElement>;
50
+ readonly onLoad?: React__default.ReactEventHandler<HTMLImageElement>;
51
+ readonly onError?: React__default.ReactEventHandler<HTMLImageElement>;
52
+ readonly skeletonWidth?: CSSValue;
53
+ readonly skeletonHeight?: CSSValue;
54
+ }
55
+ declare const Image: React__default.ForwardRefExoticComponent<ImageProps & React__default.RefAttributes<HTMLImageElement>>;
56
+
57
+ export { Image, type ImageProps };
package/dist/image.js CHANGED
@@ -123,11 +123,7 @@ function stripShims(props) {
123
123
  for (const k of SHIM_PROPS) delete out[k];
124
124
  return out;
125
125
  }
126
- var SKELETON_CLASSES = [
127
- "animate-skeleton-shimmer rounded-sm",
128
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
129
- "bg-[length:200%_100%]"
130
- ].join(" ");
126
+ var SKELETON_CLASSES = "lux-skeleton rounded-sm";
131
127
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
132
128
  var Skeleton = React2.forwardRef(
133
129
  function Skeleton2(props, ref) {
@@ -147,7 +143,7 @@ var Skeleton = React2.forwardRef(
147
143
  {
148
144
  ref,
149
145
  "data-loading": true,
150
- className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
146
+ className: cn(SKELETON_CLASSES, "[&_*]:invisible", cls),
151
147
  style: mergedStyle,
152
148
  ...htmlRest,
153
149
  children
@@ -159,7 +155,7 @@ var Skeleton = React2.forwardRef(
159
155
  {
160
156
  ref,
161
157
  "data-loading": true,
162
- className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
158
+ className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
163
159
  style: mergedStyle,
164
160
  ...htmlRest,
165
161
  children
package/dist/index.cjs CHANGED
@@ -1591,11 +1591,7 @@ function stripShims(props) {
1591
1591
  for (const k of SHIM_PROPS) delete out[k];
1592
1592
  return out;
1593
1593
  }
1594
- var SKELETON_CLASSES = [
1595
- "animate-skeleton-shimmer rounded-sm",
1596
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
1597
- "bg-[length:200%_100%]"
1598
- ].join(" ");
1594
+ var SKELETON_CLASSES = "lux-skeleton rounded-sm";
1599
1595
  var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
1600
1596
  var Skeleton = React33__namespace.forwardRef(
1601
1597
  function Skeleton2(props, ref) {
@@ -1615,7 +1611,7 @@ var Skeleton = React33__namespace.forwardRef(
1615
1611
  {
1616
1612
  ref,
1617
1613
  "data-loading": true,
1618
- className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
1614
+ className: cn(SKELETON_CLASSES, "[&_*]:invisible", cls),
1619
1615
  style: mergedStyle,
1620
1616
  ...htmlRest,
1621
1617
  children
@@ -1627,7 +1623,7 @@ var Skeleton = React33__namespace.forwardRef(
1627
1623
  {
1628
1624
  ref,
1629
1625
  "data-loading": true,
1630
- className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
1626
+ className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
1631
1627
  style: mergedStyle,
1632
1628
  ...htmlRest,
1633
1629
  children
@@ -1664,6 +1660,10 @@ var SkeletonText = React33__namespace.forwardRef(
1664
1660
  )) });
1665
1661
  }
1666
1662
  );
1663
+ function LoadingBar({ loading = true }) {
1664
+ if (!loading) return null;
1665
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lux-loading", role: "progressbar", "aria-busy": "true", "aria-label": "Loading" });
1666
+ }
1667
1667
  var IndicatorIcon2 = ({ 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", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm.75-11.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 10a.75.75 0 011.5 0v3a.75.75 0 01-1.5 0v-3z" }) });
1668
1668
  var ALERT_BASE = "w-full flex items-start relative rounded text-[var(--color-alert-fg)]";
1669
1669
  var STATUS_CLASSES = {
@@ -1978,7 +1978,7 @@ var Tooltip = React33__namespace.forwardRef(
1978
1978
  {
1979
1979
  ref: triggerRef,
1980
1980
  asChild: true,
1981
- ...isMobile ? { onPress: handleTriggerClick } : {},
1981
+ ...isMobile ? { onClick: handleTriggerClick } : {},
1982
1982
  ...triggerProps,
1983
1983
  children
1984
1984
  }
@@ -7904,6 +7904,7 @@ exports.Link = Link;
7904
7904
  exports.LinkBox = LinkBox;
7905
7905
  exports.LinkExternalIcon = LinkExternalIcon;
7906
7906
  exports.LinkOverlay = LinkOverlay;
7907
+ exports.LoadingBar = LoadingBar;
7907
7908
  exports.MenuArrow = MenuArrow;
7908
7909
  exports.MenuCheckboxItem = MenuCheckboxItem;
7909
7910
  exports.MenuContent = MenuContent;