@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.
- package/dist/accordion.d.cts +74 -0
- package/dist/accordion.d.ts +74 -0
- package/dist/alert.cjs +3 -7
- package/dist/alert.d.cts +30 -0
- package/dist/alert.d.ts +30 -0
- package/dist/alert.js +3 -7
- package/dist/auth.cjs +481 -0
- package/dist/auth.d.cts +80 -0
- package/dist/auth.d.ts +80 -0
- package/dist/auth.js +456 -0
- package/dist/avatar.d.cts +25 -0
- package/dist/avatar.d.ts +25 -0
- package/dist/badge.cjs +4 -8
- package/dist/badge.d.cts +19 -0
- package/dist/badge.d.ts +19 -0
- package/dist/badge.js +4 -8
- package/dist/bank.d.cts +83 -0
- package/dist/bank.d.ts +83 -0
- package/dist/button.cjs +3 -7
- package/dist/button.d.cts +55 -0
- package/dist/button.d.ts +55 -0
- package/dist/button.js +3 -7
- package/dist/checkbox.d.cts +32 -0
- package/dist/checkbox.d.ts +32 -0
- package/dist/chrome.d.cts +93 -0
- package/dist/chrome.d.ts +93 -0
- package/dist/close-button.d.cts +9 -0
- package/dist/close-button.d.ts +9 -0
- package/dist/collapsible.cjs +3 -7
- package/dist/collapsible.d.cts +23 -0
- package/dist/collapsible.d.ts +23 -0
- package/dist/collapsible.js +3 -7
- package/dist/color-mode.d.cts +25 -0
- package/dist/color-mode.d.ts +25 -0
- package/dist/dialog.d.cts +118 -0
- package/dist/dialog.d.ts +118 -0
- package/dist/drawer.d.cts +36 -0
- package/dist/drawer.d.ts +36 -0
- package/dist/empty-state.d.cts +13 -0
- package/dist/empty-state.d.ts +13 -0
- package/dist/expiration-selector.d.cts +16 -0
- package/dist/expiration-selector.d.ts +16 -0
- package/dist/field.d.cts +24 -0
- package/dist/field.d.ts +24 -0
- package/dist/greeks-display.d.cts +14 -0
- package/dist/greeks-display.d.ts +14 -0
- package/dist/gui.d.cts +2 -0
- package/dist/gui.d.ts +2 -0
- package/dist/heading.d.cts +10 -0
- package/dist/heading.d.ts +10 -0
- package/dist/iam.d.cts +65 -0
- package/dist/iam.d.ts +65 -0
- package/dist/icon-button.cjs +3 -7
- package/dist/icon-button.d.cts +33 -0
- package/dist/icon-button.d.ts +33 -0
- package/dist/icon-button.js +3 -7
- package/dist/icons.cjs +0 -1
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +0 -1
- package/dist/identity.d.cts +64 -0
- package/dist/identity.d.ts +64 -0
- package/dist/image.cjs +3 -7
- package/dist/image.d.cts +57 -0
- package/dist/image.d.ts +57 -0
- package/dist/image.js +3 -7
- package/dist/index.cjs +9 -8
- package/dist/index.d.cts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +9 -9
- package/dist/input-group.d.cts +17 -0
- package/dist/input-group.d.ts +17 -0
- package/dist/input.d.cts +17 -0
- package/dist/input.d.ts +17 -0
- package/dist/link.cjs +3 -7
- package/dist/link.d.cts +37 -0
- package/dist/link.d.ts +37 -0
- package/dist/link.js +3 -7
- package/dist/lux.config.d.cts +433 -0
- package/dist/lux.config.d.ts +433 -0
- package/dist/menu.d.cts +84 -0
- package/dist/menu.d.ts +84 -0
- package/dist/next.cjs +11 -1
- package/dist/next.d.cts +32 -0
- package/dist/next.d.ts +32 -0
- package/dist/next.js +11 -1
- package/dist/option-chain.d.cts +37 -0
- package/dist/option-chain.d.ts +37 -0
- package/dist/option-position.d.cts +29 -0
- package/dist/option-position.d.ts +29 -0
- package/dist/pin-input.d.cts +25 -0
- package/dist/pin-input.d.ts +25 -0
- package/dist/pnl-diagram.d.cts +11 -0
- package/dist/pnl-diagram.d.ts +11 -0
- package/dist/popover.d.cts +73 -0
- package/dist/popover.d.ts +73 -0
- package/dist/progress-circle.d.cts +47 -0
- package/dist/progress-circle.d.ts +47 -0
- package/dist/progress.d.cts +28 -0
- package/dist/progress.d.ts +28 -0
- package/dist/provider.d.cts +25 -0
- package/dist/provider.d.ts +25 -0
- package/dist/radio.d.cts +53 -0
- package/dist/radio.d.ts +53 -0
- package/dist/rating.d.cts +14 -0
- package/dist/rating.d.ts +14 -0
- package/dist/select.cjs +3 -7
- package/dist/select.d.cts +130 -0
- package/dist/select.d.ts +130 -0
- package/dist/select.js +3 -7
- package/dist/separator.d.cts +13 -0
- package/dist/separator.d.ts +13 -0
- package/dist/skeleton.cjs +8 -7
- package/dist/skeleton.d.cts +76 -0
- package/dist/skeleton.d.ts +76 -0
- package/dist/skeleton.js +8 -8
- package/dist/slider.d.cts +24 -0
- package/dist/slider.d.ts +24 -0
- package/dist/strategy-builder.d.cts +26 -0
- package/dist/strategy-builder.d.ts +26 -0
- package/dist/switch.d.cts +27 -0
- package/dist/switch.d.ts +27 -0
- package/dist/table.cjs +3 -7
- package/dist/table.d.cts +107 -0
- package/dist/table.d.ts +107 -0
- package/dist/table.js +3 -7
- package/dist/tabs.d.cts +78 -0
- package/dist/tabs.d.ts +78 -0
- package/dist/tag.cjs +4 -8
- package/dist/tag.d.cts +21 -0
- package/dist/tag.d.ts +21 -0
- package/dist/tag.js +4 -8
- package/dist/textarea.d.cts +13 -0
- package/dist/textarea.d.ts +13 -0
- package/dist/toaster.d.cts +29 -0
- package/dist/toaster.d.ts +29 -0
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.cts +38 -0
- package/dist/tooltip.d.ts +38 -0
- package/dist/tooltip.js +1 -1
- package/dist/use-narrow.d.cts +12 -0
- package/dist/use-narrow.d.ts +12 -0
- package/dist/utils.d.cts +5 -0
- package/dist/utils.d.ts +5 -0
- package/dist/vite.cjs +4 -3
- package/dist/vite.d.cts +29 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.js +4 -3
- package/dist/white-label.d.cts +59 -0
- package/dist/white-label.d.ts +59 -0
- package/package.json +12 -2
- package/src/auth.tsx +198 -0
- package/src/engine.ts +24 -3
- package/src/index.ts +1 -1
- package/src/next.ts +10 -0
- package/src/skeleton.tsx +36 -7
- package/src/tooltip.tsx +13 -5
- package/src/vite.ts +4 -9
- 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 };
|
package/dist/icon-button.cjs
CHANGED
|
@@ -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, "
|
|
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 ? "
|
|
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 };
|
package/dist/icon-button.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 = 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, "
|
|
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 ? "
|
|
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
package/dist/icons.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'lucide-react';
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'lucide-react';
|
package/dist/icons.js
CHANGED
|
@@ -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, "
|
|
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 ? "
|
|
179
|
+
className: cn(SKELETON_CLASSES, children ? "[&_*]:invisible" : "min-h-5", cls),
|
|
184
180
|
style: mergedStyle,
|
|
185
181
|
...htmlRest,
|
|
186
182
|
children
|
package/dist/image.d.cts
ADDED
|
@@ -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.d.ts
ADDED
|
@@ -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, "
|
|
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 ? "
|
|
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, "
|
|
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 ? "
|
|
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 ? {
|
|
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;
|