@psnext/design-system 1.0.0 → 1.1.0
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/README.md +30 -124
- package/dist/Stack.cjs +64 -0
- package/dist/Stack.cjs.map +1 -0
- package/dist/Stack.js +54 -0
- package/dist/Stack.js.map +1 -0
- package/dist/ThemeProvider.cjs +1886 -0
- package/dist/ThemeProvider.cjs.map +1 -0
- package/dist/ThemeProvider.d.cts +85 -0
- package/dist/ThemeProvider.d.cts.map +1 -0
- package/dist/ThemeProvider.d.ts +85 -0
- package/dist/ThemeProvider.d.ts.map +1 -0
- package/dist/ThemeProvider.js +1508 -0
- package/dist/ThemeProvider.js.map +1 -0
- package/dist/contexts/index.cjs +0 -60
- package/dist/contexts/index.d.cts +1 -23
- package/dist/contexts/index.d.ts +1 -23
- package/dist/contexts/index.js +1 -58
- package/dist/index.cjs +147 -72
- package/dist/index.d.cts +1009 -432
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1014 -437
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index2.d.cts +4 -16
- package/dist/index2.d.ts +4 -16
- package/dist/layouts/index.cjs +100 -12
- package/dist/layouts/index.cjs.map +1 -0
- package/dist/layouts/index.d.cts +70 -127
- package/dist/layouts/index.d.cts.map +1 -1
- package/dist/layouts/index.d.ts +70 -127
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +92 -2
- package/dist/layouts/index.js.map +1 -0
- package/dist/patterns/index.cjs +1004 -7254
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +381 -389
- package/dist/patterns/index.d.cts.map +1 -1
- package/dist/patterns/index.d.ts +378 -386
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +970 -7225
- package/dist/patterns/index.js.map +1 -1
- package/dist/primitives/index.cjs +135 -55
- package/dist/primitives/index.d.cts +3 -2
- package/dist/primitives/index.d.ts +3 -2
- package/dist/primitives/index.js +3 -5
- package/dist/primitives.cjs +3961 -1274
- package/dist/primitives.cjs.map +1 -1
- package/dist/primitives.js +3551 -1001
- package/dist/primitives.js.map +1 -1
- package/dist/styles/base.css +43 -0
- package/dist/styles/glass.css +75 -0
- package/dist/styles/index.css +43 -23
- package/dist/styles/semantic.css +107 -0
- package/dist/styles/theme.css +42 -24
- package/dist/styles/tokens/alpha.css +39 -0
- package/dist/styles/tokens/border-radius.css +17 -0
- package/dist/styles/tokens/chart-colors-dark.css +18 -0
- package/dist/styles/tokens/chart-colors-light.css +18 -0
- package/dist/styles/tokens/colors.css +251 -0
- package/dist/styles/tokens/mode-dark.css +101 -0
- package/dist/styles/tokens/mode-light.css +101 -0
- package/dist/styles/tokens/shadows.css +14 -0
- package/dist/styles/tokens/spacing.css +44 -0
- package/dist/styles/tokens/theme-bodhi.css +35 -0
- package/dist/styles/tokens/theme-slingshot.css +35 -0
- package/dist/styles/tokens/theme-sustain.css +35 -0
- package/dist/styles/tokens/typography.css +83 -0
- package/dist/utils.cjs +67 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.js +27 -0
- package/dist/utils.js.map +1 -0
- package/package.json +15 -41
- package/dist/AiChatPanel.cjs +0 -1603
- package/dist/AiChatPanel.cjs.map +0 -1
- package/dist/AiChatPanel.js +0 -1526
- package/dist/AiChatPanel.js.map +0 -1
- package/dist/BodhiLogo.cjs +0 -240
- package/dist/BodhiLogo.cjs.map +0 -1
- package/dist/BodhiLogo.js +0 -194
- package/dist/BodhiLogo.js.map +0 -1
- package/dist/Skeleton.cjs +0 -19
- package/dist/Skeleton.cjs.map +0 -1
- package/dist/Skeleton.js +0 -14
- package/dist/Skeleton.js.map +0 -1
- package/dist/SustainLogo.cjs +0 -415
- package/dist/SustainLogo.cjs.map +0 -1
- package/dist/SustainLogo.js +0 -378
- package/dist/SustainLogo.js.map +0 -1
- package/dist/contexts/index.cjs.map +0 -1
- package/dist/contexts/index.d.cts.map +0 -1
- package/dist/contexts/index.d.ts.map +0 -1
- package/dist/contexts/index.js.map +0 -1
- package/dist/index2.d.cts.map +0 -1
- package/dist/index2.d.ts.map +0 -1
- package/dist/layouts.cjs +0 -3245
- package/dist/layouts.cjs.map +0 -1
- package/dist/layouts.js +0 -3180
- package/dist/layouts.js.map +0 -1
- package/dist/styles/base/colors.css +0 -300
- package/dist/styles/base/component-tokens.css +0 -240
- package/dist/styles/base/elevation.css +0 -7
- package/dist/styles/base/fonts.css +0 -14
- package/dist/styles/base/global.css +0 -305
- package/dist/styles/base/radius.css +0 -22
- package/dist/styles/base/semantic-aliases.css +0 -53
- package/dist/styles/base/spacing.css +0 -33
- package/dist/styles/base/typography.css +0 -48
- package/dist/styles/generated/bodhi-vars.css +0 -34
- package/dist/styles/generated/dark.css +0 -87
- package/dist/styles/generated/light.css +0 -87
- package/dist/styles/generated/slingshot-vars.css +0 -34
- package/dist/styles/generated/sustain-vars.css +0 -34
- package/dist/styles/themes/bodhi.css +0 -166
- package/dist/styles/themes/slingshot.css +0 -144
- package/dist/styles/themes/sustain.css +0 -130
|
@@ -1,418 +1,410 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { o as Text, r as ThemeProduct, u as HeadingProps } from "../ThemeProvider.cjs";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { ReactNode } from "react";
|
|
7
|
+
import { Column, ColumnDef } from "@tanstack/react-table";
|
|
4
8
|
|
|
5
|
-
//#region src/patterns/
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
//#region src/patterns/DataTable/DataTable.d.ts
|
|
10
|
+
type DataTableProps<TData, TValue> = {
|
|
11
|
+
columns: ColumnDef<TData, TValue>[];
|
|
12
|
+
data: TData[];
|
|
13
|
+
/** Zebra-stripe the rows (default true). */
|
|
14
|
+
striped?: boolean;
|
|
15
|
+
/** Client-side pagination + page size (default true, 10). */
|
|
16
|
+
enablePagination?: boolean;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
};
|
|
19
|
+
declare function DataTable<TData, TValue>({
|
|
20
|
+
columns,
|
|
21
|
+
data,
|
|
22
|
+
striped,
|
|
23
|
+
enablePagination,
|
|
24
|
+
pageSize
|
|
25
|
+
}: DataTableProps<TData, TValue>): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare function DataTableColumnHeader<TData, TValue>({
|
|
27
|
+
column,
|
|
28
|
+
title,
|
|
29
|
+
className
|
|
30
|
+
}: {
|
|
31
|
+
column: Column<TData, TValue>;
|
|
32
|
+
title: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
8
35
|
//#endregion
|
|
9
|
-
//#region src/patterns/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
//#region src/patterns/Footer/Footer.d.ts
|
|
37
|
+
declare const footerBackgrounds: {
|
|
38
|
+
readonly none: "";
|
|
39
|
+
readonly muted: "bg-muted";
|
|
40
|
+
readonly glass: "bg-[var(--glass-light)] backdrop-blur-[var(--glass-blur)]";
|
|
41
|
+
};
|
|
42
|
+
declare function Footer({
|
|
43
|
+
className,
|
|
44
|
+
bordered,
|
|
45
|
+
background,
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<"footer"> & {
|
|
48
|
+
/** Add a subtle top border separating the footer from page content. */
|
|
49
|
+
bordered?: boolean;
|
|
50
|
+
/** Surface fill. `glass` is a translucent, blurred panel over the page background. */
|
|
51
|
+
background?: keyof typeof footerBackgrounds;
|
|
52
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
53
|
+
declare function FooterStart({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
57
|
+
declare function FooterCenter({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
61
|
+
declare function FooterEnd({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
65
|
+
declare function FooterPoweredBy({
|
|
66
|
+
className,
|
|
67
|
+
label,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<"div"> & {
|
|
71
|
+
/** Override the default "Powered by" label. */
|
|
72
|
+
label?: React.ReactNode;
|
|
73
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function FooterSeparator({
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
|
|
23
78
|
//#endregion
|
|
24
|
-
//#region src/patterns/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
name: string;
|
|
28
|
-
description: string;
|
|
29
|
-
permissions: number;
|
|
30
|
-
/** Which tab from the roles page: 'templates' | 'saved' */
|
|
31
|
-
source?: "templates" | "saved";
|
|
32
|
-
}
|
|
33
|
-
interface PlatformInfo {
|
|
79
|
+
//#region src/patterns/Header/types.d.ts
|
|
80
|
+
/** A node in the project hierarchy returned by the projects API. */
|
|
81
|
+
interface ProjectNode {
|
|
34
82
|
id: string;
|
|
35
|
-
label: string;
|
|
36
|
-
color: string;
|
|
37
|
-
bgColor: string;
|
|
38
|
-
textColor: string;
|
|
39
|
-
}
|
|
40
|
-
declare const PLATFORMS: PlatformInfo[];
|
|
41
|
-
interface AddNewRoleDrawerProps {
|
|
42
|
-
isOpen: boolean;
|
|
43
|
-
onClose: () => void;
|
|
44
|
-
onSave?: (role: {
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
permissions: string[];
|
|
48
|
-
platforms: string[];
|
|
49
|
-
}) => void;
|
|
50
|
-
/** Called when user duplicates a template into saved roles */
|
|
51
|
-
onDuplicate?: (role: {
|
|
52
|
-
name: string;
|
|
53
|
-
description: string;
|
|
54
|
-
permissions: string[];
|
|
55
|
-
platforms: string[];
|
|
56
|
-
}) => void;
|
|
57
|
-
/** Called when user deletes a role */
|
|
58
|
-
onDelete?: (roleId: string) => void;
|
|
59
|
-
/** When provided, opens in edit/view mode pre-populated with this role */
|
|
60
|
-
initialRole?: RoleData | null;
|
|
61
|
-
/** The currently-active platform tab on the roles page */
|
|
62
|
-
activePlatform?: string;
|
|
63
|
-
}
|
|
64
|
-
declare function AddNewRoleDrawer({
|
|
65
|
-
isOpen,
|
|
66
|
-
onClose,
|
|
67
|
-
onSave,
|
|
68
|
-
onDuplicate,
|
|
69
|
-
onDelete,
|
|
70
|
-
initialRole,
|
|
71
|
-
activePlatform
|
|
72
|
-
}: AddNewRoleDrawerProps): react_jsx_runtime266.JSX.Element;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/patterns/AddPortfolioDrawer/AddPortfolioDrawer.d.ts
|
|
75
|
-
interface PortfolioFormData {
|
|
76
83
|
name: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
importedResources: string[];
|
|
81
|
-
contextSourceId?: string;
|
|
84
|
+
children: ProjectNode[];
|
|
85
|
+
/** Ancestor context node — shown for orientation but not selectable. */
|
|
86
|
+
isContextOnly?: boolean;
|
|
82
87
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
/** Fully-qualified API endpoints. Built from `apiBaseUrl`; individually overridable. */
|
|
89
|
+
interface HeaderEndpoints {
|
|
90
|
+
token: string;
|
|
91
|
+
me: string;
|
|
92
|
+
logout: string;
|
|
93
|
+
projects: (clientId: string) => string;
|
|
94
|
+
credits: string;
|
|
87
95
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
96
|
+
/** A fetch-compatible function, so hosts/tests can inject their own (e.g. mocks). */
|
|
97
|
+
type Fetcher = typeof fetch;
|
|
98
|
+
interface HeaderProps {
|
|
99
|
+
/** API base URL with full domain, e.g. `https://dev.abc.com`. Studio-auth API host. */
|
|
100
|
+
apiBaseUrl: string;
|
|
101
|
+
/**
|
|
102
|
+
* Environment id used to read the session cookie `{environmentId}-sessionId`
|
|
103
|
+
* (a JWT) — the header decodes it to determine whether the user is logged in.
|
|
104
|
+
*/
|
|
105
|
+
environmentId: string;
|
|
106
|
+
/** Logo to show. Defaults to the active product from ThemeProvider. */
|
|
107
|
+
logoType?: ThemeProduct;
|
|
108
|
+
/** Show the read-only organisation pill. */
|
|
109
|
+
showOrg?: boolean;
|
|
110
|
+
/** Show the project picker (and the first-run selection overlay). */
|
|
111
|
+
showProjectDropdown?: boolean;
|
|
112
|
+
/** Show the profile menu (user email + logout). */
|
|
113
|
+
showProfile?: boolean;
|
|
114
|
+
/** Show the light/dark theme toggle. */
|
|
115
|
+
showThemeSwitcher?: boolean;
|
|
116
|
+
/** Show the remaining-credits pill (logged-in users only). */
|
|
117
|
+
showCredits?: boolean;
|
|
118
|
+
/** Page title shown next to the logo. Omitted when not provided. */
|
|
119
|
+
pageTitle?: string;
|
|
120
|
+
/**
|
|
121
|
+
* URL for the feedback action (message-square-share icon). When omitted the
|
|
122
|
+
* icon is hidden; when set, the icon renders and links here.
|
|
123
|
+
*/
|
|
124
|
+
feedbackUrl?: string;
|
|
125
|
+
/** Active org id from the host session; overrides the value from `/me`. */
|
|
126
|
+
clientId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* ESCAPE HATCH — avoid. Inject a pre-resolved access token to skip the header's
|
|
129
|
+
* own token fetch. The header is designed to resolve its own token from the
|
|
130
|
+
* session cookie; only reach for this when the host has *already* fetched a
|
|
131
|
+
* token and a duplicate round-trip is genuinely unacceptable. Misuse couples
|
|
132
|
+
* the header to host token lifecycle/refresh and can serve stale auth.
|
|
133
|
+
*/
|
|
134
|
+
_dangerouslyInjectAccessToken?: string;
|
|
135
|
+
/** Called when the user picks a project. */
|
|
136
|
+
onProjectChange?: (id: string) => void;
|
|
137
|
+
/** Called when the user closes the selection overlay. */
|
|
138
|
+
onCloseProjectOverlay?: () => void;
|
|
139
|
+
/** Node rendered between the logo and the project picker. */
|
|
140
|
+
logoAddon?: ReactNode;
|
|
141
|
+
className?: string;
|
|
142
|
+
/** Override individual endpoint paths (defaults derive from `apiBaseUrl`). */
|
|
143
|
+
endpoints?: Partial<Omit<HeaderEndpoints, "projects">> & {
|
|
144
|
+
projects?: (clientId: string) => string;
|
|
137
145
|
};
|
|
146
|
+
/** Custom fetch implementation (defaults to global `fetch`). Useful for tests/Storybook. */
|
|
147
|
+
fetcher?: Fetcher;
|
|
148
|
+
/** How long fetched data stays fresh before refetch, in ms. Default 5 min. */
|
|
149
|
+
staleTime?: number;
|
|
150
|
+
/** How long unused data is cached, in ms. Default 10 min. */
|
|
151
|
+
gcTime?: number;
|
|
138
152
|
}
|
|
139
|
-
|
|
140
|
-
declare const severityMap: Record<ActivityType, ActivitySeverity>;
|
|
141
|
-
interface ActivityContextValue {
|
|
142
|
-
activities: ActivityEvent[];
|
|
143
|
-
unreadCount: number;
|
|
144
|
-
pushActivity: (event: Omit<ActivityEvent, "id" | "timestamp">) => void;
|
|
145
|
-
markAllRead: () => void;
|
|
146
|
-
clearActivities: () => void;
|
|
147
|
-
panelExpanded: boolean;
|
|
148
|
-
setPanelExpanded: (v: boolean) => void;
|
|
149
|
-
filterType: ActivityFilterType;
|
|
150
|
-
setFilterType: (v: ActivityFilterType) => void;
|
|
151
|
-
filterResourceId: string | null;
|
|
152
|
-
setFilterResourceId: (v: string | null) => void;
|
|
153
|
-
}
|
|
154
|
-
declare function useActivity(): ActivityContextValue;
|
|
155
|
-
declare function ActivityProvider({
|
|
156
|
-
children
|
|
157
|
-
}: {
|
|
158
|
-
children: ReactNode;
|
|
159
|
-
}): react_jsx_runtime266.JSX.Element;
|
|
153
|
+
//# sourceMappingURL=types.d.ts.map
|
|
160
154
|
//#endregion
|
|
161
|
-
//#region src/patterns/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/** Toggle a panel (open if closed, close if already open) */
|
|
171
|
-
togglePanel: (panel: "activity" | "ai-chat") => void;
|
|
172
|
-
/** Whether the entire right sidebar (icons + panel) is visible */
|
|
173
|
-
sidebarVisible: boolean;
|
|
174
|
-
/** Show/hide the entire right sidebar */
|
|
175
|
-
setSidebarVisible: (visible: boolean) => void;
|
|
176
|
-
/** Pending message to be sent to AI chat when it opens */
|
|
177
|
-
pendingMessage: string | null;
|
|
178
|
-
/** Send a message to the AI chat panel (opens it automatically) */
|
|
179
|
-
sendToAIChat: (message: string) => void;
|
|
180
|
-
/** Clear the pending message (called by AI chat panel after consuming it) */
|
|
181
|
-
clearPendingMessage: () => void;
|
|
182
|
-
}
|
|
183
|
-
declare function RightPanelProvider({
|
|
184
|
-
children
|
|
155
|
+
//#region src/patterns/Header/Header.d.ts
|
|
156
|
+
/** The header bar shell — a sticky glass strip. */
|
|
157
|
+
declare function HeaderBar({
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
}: React.ComponentProps<"header">): react_jsx_runtime0.JSX.Element;
|
|
161
|
+
/** Product logo linking to its home, with a Suspense-safe fallback. */
|
|
162
|
+
declare function HeaderLogo({
|
|
163
|
+
brand
|
|
185
164
|
}: {
|
|
186
|
-
|
|
187
|
-
}):
|
|
188
|
-
|
|
165
|
+
brand: ThemeProduct;
|
|
166
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
167
|
+
/** Read-only organisation pill. */
|
|
168
|
+
declare function OrgPill({
|
|
169
|
+
name,
|
|
170
|
+
loading
|
|
171
|
+
}: {
|
|
172
|
+
name?: string;
|
|
173
|
+
loading?: boolean;
|
|
174
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
175
|
+
/** Light/dark toggle — defers to ThemeProvider. */
|
|
176
|
+
declare function ThemeToggle(): react_jsx_runtime0.JSX.Element;
|
|
177
|
+
/** Profile menu — avatar trigger with email + logout. */
|
|
178
|
+
declare function ProfileMenu({
|
|
179
|
+
email,
|
|
180
|
+
onLogout
|
|
181
|
+
}: {
|
|
182
|
+
email?: string;
|
|
183
|
+
onLogout: () => void;
|
|
184
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
185
|
+
/** Drop-in global header. Must be rendered inside a <ThemeProvider>. */
|
|
186
|
+
declare function Header(props: HeaderProps): react_jsx_runtime0.JSX.Element;
|
|
187
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
189
188
|
//#endregion
|
|
190
|
-
//#region src/patterns/
|
|
191
|
-
interface
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
//#region src/patterns/Header/ProjectPicker.d.ts
|
|
190
|
+
interface ProjectPickerProps {
|
|
191
|
+
projectsTree: ProjectNode[];
|
|
192
|
+
selectedProjectId: string;
|
|
193
|
+
selectedProjectName?: string;
|
|
194
|
+
onSelect: (id: string) => void;
|
|
195
|
+
projectLabel: string;
|
|
196
|
+
projectPlaceholder: string;
|
|
197
|
+
searchPlaceholder: string;
|
|
198
|
+
emptyStateText: string;
|
|
199
|
+
isLoading?: boolean;
|
|
197
200
|
}
|
|
198
|
-
declare function
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
declare function ProjectPicker({
|
|
202
|
+
projectsTree,
|
|
203
|
+
selectedProjectId,
|
|
204
|
+
selectedProjectName,
|
|
205
|
+
onSelect,
|
|
206
|
+
projectLabel,
|
|
207
|
+
projectPlaceholder,
|
|
208
|
+
searchPlaceholder,
|
|
209
|
+
emptyStateText,
|
|
210
|
+
isLoading
|
|
211
|
+
}: Readonly<ProjectPickerProps>): react_jsx_runtime0.JSX.Element;
|
|
205
212
|
//#endregion
|
|
206
|
-
//#region src/patterns/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
onToggle: () => void;
|
|
212
|
-
items: Array<{
|
|
213
|
-
title: string;
|
|
214
|
-
subtitle: string;
|
|
215
|
-
}>;
|
|
213
|
+
//#region src/patterns/Header/use-global-header.d.ts
|
|
214
|
+
/** Window event other modules can dispatch to show/hide the project dropdown. */
|
|
215
|
+
declare const TOGGLE_PROJECT_DROPDOWN_EVENT = "toggle-project-dropdown";
|
|
216
|
+
interface ToggleProjectDropdownDetail {
|
|
217
|
+
show: boolean;
|
|
216
218
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
onMouseLeave?: IconButtonMouseHandler;
|
|
219
|
+
interface GlobalHeaderState {
|
|
220
|
+
/** Whether a valid session cookie exists — when false, hide all user content. */
|
|
221
|
+
isAuthenticated: boolean;
|
|
222
|
+
userEmail: string | undefined;
|
|
223
|
+
organizationName: string | undefined;
|
|
224
|
+
projectsTree: ProjectNode[];
|
|
225
|
+
selectedProjectId: string;
|
|
226
|
+
selectedProjectName: string | undefined;
|
|
227
|
+
isProjectsLoading: boolean;
|
|
228
|
+
isOrgLoading: boolean;
|
|
229
|
+
/** Remaining credits for the user (undefined until loaded / when disabled). */
|
|
230
|
+
credits: number | undefined;
|
|
231
|
+
/** Where the credits pill links to (studio-auth `/user/activity`). */
|
|
232
|
+
creditsHref: string;
|
|
233
|
+
projectDropdownVisible: boolean;
|
|
234
|
+
/** True when the dropdown is on, the user is in, but no project is chosen yet. */
|
|
235
|
+
showOverlay: boolean;
|
|
236
|
+
selectProject: (id: string) => void;
|
|
237
|
+
logout: () => void;
|
|
237
238
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
239
|
+
type UseGlobalHeaderArgs = Pick<HeaderProps, "apiBaseUrl" | "environmentId" | "clientId" | "_dangerouslyInjectAccessToken" | "showProjectDropdown" | "showProfile" | "showOrg" | "showCredits" | "endpoints" | "fetcher" | "staleTime" | "gcTime" | "onProjectChange">;
|
|
240
|
+
declare function useGlobalHeader({
|
|
241
|
+
apiBaseUrl,
|
|
242
|
+
environmentId,
|
|
243
|
+
clientId,
|
|
244
|
+
_dangerouslyInjectAccessToken: injectedToken,
|
|
245
|
+
showProjectDropdown,
|
|
246
|
+
showProfile,
|
|
247
|
+
showOrg,
|
|
248
|
+
showCredits,
|
|
249
|
+
endpoints: endpointOverrides,
|
|
250
|
+
fetcher: fetcherProp,
|
|
251
|
+
staleTime,
|
|
252
|
+
gcTime,
|
|
253
|
+
onProjectChange
|
|
254
|
+
}: UseGlobalHeaderArgs): GlobalHeaderState;
|
|
248
255
|
//#endregion
|
|
249
|
-
//#region src/patterns/
|
|
250
|
-
interface
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
className?: string;
|
|
256
|
+
//#region src/patterns/Header/header-store.d.ts
|
|
257
|
+
interface HeaderSelection {
|
|
258
|
+
selectedProjectId: string;
|
|
259
|
+
selectedProjectName: string;
|
|
260
|
+
organizationName: string | undefined;
|
|
261
|
+
/** Remaining credits for the logged-in user (read-only here; set by the Header). */
|
|
262
|
+
credits: number | undefined;
|
|
263
|
+
/** Client/org the current selection + org belong to (for cross-org invalidation). */
|
|
264
|
+
clientId: string | undefined;
|
|
259
265
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
//#endregion
|
|
269
|
-
//#region src/patterns/InviteUsersDrawer/InviteUsersDrawer.d.ts
|
|
270
|
-
interface InviteUsersDrawerProps {
|
|
271
|
-
isOpen: boolean;
|
|
272
|
-
onClose: () => void;
|
|
273
|
-
onInvite?: (newUsers: {
|
|
274
|
-
name: string;
|
|
275
|
-
email: string;
|
|
276
|
-
platforms: string[];
|
|
277
|
-
}[]) => void;
|
|
278
|
-
}
|
|
279
|
-
declare function InviteUsersDrawer({
|
|
280
|
-
isOpen,
|
|
281
|
-
onClose,
|
|
282
|
-
onInvite
|
|
283
|
-
}: InviteUsersDrawerProps): react_jsx_runtime266.JSX.Element;
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region src/patterns/PageTransition/PageTransition.d.ts
|
|
286
|
-
interface PageTransitionProps {
|
|
287
|
-
children: ReactNode;
|
|
288
|
-
className?: string;
|
|
266
|
+
interface UseHeaderProjectResult {
|
|
267
|
+
selectedProjectId: string;
|
|
268
|
+
selectedProjectName: string | undefined;
|
|
269
|
+
organizationName: string | undefined;
|
|
270
|
+
/** Set the active project from outside the Header (by id). */
|
|
271
|
+
setProject: (id: string) => void;
|
|
272
|
+
/** Clear the active project (e.g. to re-prompt selection). */
|
|
273
|
+
clearProject: () => void;
|
|
289
274
|
}
|
|
290
275
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* creates a CSS stacking context — breaking `position: fixed` drawers inside the
|
|
295
|
-
* subtree. To fix this, the class is removed via `onAnimationEnd` as soon as the
|
|
296
|
-
* 200ms animation completes, destroying the stacking context and restoring normal
|
|
297
|
-
* fixed-positioning behaviour for all drawers / overlays.
|
|
276
|
+
* Read the current project/org and change the project from anywhere in the app —
|
|
277
|
+
* no need to be inside the <Header>. Reflects user selections made in the header
|
|
278
|
+
* and updates the header when changed here.
|
|
298
279
|
*/
|
|
299
|
-
declare function
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
280
|
+
declare function useHeaderProject(): UseHeaderProjectResult;
|
|
281
|
+
/** Read the logged-in user's remaining credits (read-only; the Header owns it). */
|
|
282
|
+
declare function useHeaderCredits(): number | undefined;
|
|
283
|
+
//# sourceMappingURL=header-store.d.ts.map
|
|
303
284
|
//#endregion
|
|
304
|
-
//#region src/patterns/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region src/patterns/ProjectBulkUploadDrawer/ProjectBulkUploadDrawer.d.ts
|
|
313
|
-
interface ParsedTreeNode {
|
|
314
|
-
id: string;
|
|
315
|
-
type: string;
|
|
316
|
-
name: string;
|
|
317
|
-
description: string;
|
|
318
|
-
admin: string;
|
|
319
|
-
parentName: string;
|
|
320
|
-
level: number;
|
|
321
|
-
isExpanded: boolean;
|
|
322
|
-
children: ParsedTreeNode[];
|
|
323
|
-
}
|
|
324
|
-
interface ProjectBulkUploadDrawerProps {
|
|
325
|
-
isOpen: boolean;
|
|
326
|
-
onClose: () => void;
|
|
327
|
-
onImport?: (nodes: ParsedTreeNode[]) => void;
|
|
328
|
-
}
|
|
329
|
-
declare function ProjectBulkUploadDrawer({
|
|
330
|
-
isOpen,
|
|
331
|
-
onClose,
|
|
332
|
-
onImport
|
|
333
|
-
}: ProjectBulkUploadDrawerProps): react_jsx_runtime266.JSX.Element | null;
|
|
285
|
+
//#region src/patterns/Header/session.d.ts
|
|
286
|
+
/** Read the raw session JWT from the `{environmentId}-sessionId` cookie. */
|
|
287
|
+
declare function getSessionToken(environmentId: string): string | null;
|
|
288
|
+
/** Decode a JWT payload without verifying the signature (display/expiry only). */
|
|
289
|
+
|
|
290
|
+
/** True when a valid, unexpired session cookie exists for the environment. */
|
|
291
|
+
declare function isSessionValid(environmentId: string): boolean;
|
|
334
292
|
//#endregion
|
|
335
|
-
//#region src/patterns/
|
|
336
|
-
|
|
337
|
-
title: string;
|
|
338
|
-
subtitle: string;
|
|
339
|
-
onClick?: () => void;
|
|
340
|
-
}
|
|
341
|
-
declare function ResourceTile({
|
|
342
|
-
title,
|
|
343
|
-
subtitle,
|
|
344
|
-
onClick
|
|
345
|
-
}: ResourceTileProps): react_jsx_runtime266.JSX.Element;
|
|
293
|
+
//#region src/patterns/Header/api.d.ts
|
|
294
|
+
declare function buildEndpoints(apiBaseUrl: string, overrides?: HeaderProps["endpoints"]): HeaderEndpoints;
|
|
346
295
|
//#endregion
|
|
347
|
-
//#region src/patterns/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
declare function RichCheckboxGroup({
|
|
363
|
-
group,
|
|
364
|
-
onToggle
|
|
365
|
-
}: RichCheckboxGroupProps): react_jsx_runtime266.JSX.Element;
|
|
296
|
+
//#region src/patterns/Header/labels.d.ts
|
|
297
|
+
/** Default UI strings. Spread-override via the Header `labels` prop if needed. */
|
|
298
|
+
declare const DEFAULT_LABELS: {
|
|
299
|
+
readonly orgLabel: "Org";
|
|
300
|
+
readonly projectLabel: "Project";
|
|
301
|
+
readonly projectPlaceholder: "Select project...";
|
|
302
|
+
readonly searchPlaceholder: "Search project";
|
|
303
|
+
readonly emptyStateText: "No projects found";
|
|
304
|
+
readonly profileMenuLabel: "Profile menu";
|
|
305
|
+
readonly logoutLabel: "Logout";
|
|
306
|
+
readonly overlayTitle: "Select a Project";
|
|
307
|
+
readonly overlayDescription: "Choose a project to get started. You can change it anytime from the header.";
|
|
308
|
+
};
|
|
309
|
+
type Labels = typeof DEFAULT_LABELS;
|
|
310
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
366
311
|
//#endregion
|
|
367
|
-
//#region src/patterns/
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
312
|
+
//#region src/patterns/MediaObject/MediaObject.d.ts
|
|
313
|
+
type MediaObjectProps = React.ComponentProps<"article"> & {
|
|
314
|
+
/** Add a CSS hover lift + shadow (no JS state). */
|
|
315
|
+
interactive?: boolean;
|
|
316
|
+
};
|
|
317
|
+
declare function MediaObject({
|
|
318
|
+
className,
|
|
319
|
+
interactive,
|
|
320
|
+
...props
|
|
321
|
+
}: MediaObjectProps): react_jsx_runtime0.JSX.Element;
|
|
322
|
+
type MediaObjectImageProps = React.ComponentProps<"img"> & {
|
|
323
|
+
alt: string;
|
|
324
|
+
};
|
|
325
|
+
declare function MediaObjectImage({
|
|
326
|
+
className,
|
|
327
|
+
alt,
|
|
328
|
+
...props
|
|
329
|
+
}: MediaObjectImageProps): react_jsx_runtime0.JSX.Element;
|
|
330
|
+
declare function MediaObjectIcon({
|
|
331
|
+
className,
|
|
332
|
+
...props
|
|
333
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
334
|
+
declare function MediaObjectContent({
|
|
335
|
+
className,
|
|
336
|
+
...props
|
|
337
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
338
|
+
type MediaObjectTitleProps = Omit<HeadingProps, "as"> & {
|
|
339
|
+
/** Heading size step passthrough (defaults to "4"). */
|
|
340
|
+
size?: HeadingProps["size"];
|
|
341
|
+
};
|
|
342
|
+
declare function MediaObjectTitle({
|
|
343
|
+
size,
|
|
344
|
+
...props
|
|
345
|
+
}: MediaObjectTitleProps): react_jsx_runtime0.JSX.Element;
|
|
346
|
+
declare function MediaObjectText({
|
|
347
|
+
...props
|
|
348
|
+
}: React.ComponentProps<typeof Text>): react_jsx_runtime0.JSX.Element;
|
|
349
|
+
declare function MediaObjectActions({
|
|
350
|
+
className,
|
|
351
|
+
...props
|
|
352
|
+
}: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
|
|
353
|
+
declare const mediaObjectGroupVariants: (props?: ({
|
|
354
|
+
columns?: 3 | 1 | 2 | 4 | null | undefined;
|
|
355
|
+
gap?: "sm" | "md" | "lg" | null | undefined;
|
|
356
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
357
|
+
type MediaObjectGroupProps = React.ComponentProps<"div"> & VariantProps<typeof mediaObjectGroupVariants>;
|
|
358
|
+
declare function MediaObjectGroup({
|
|
359
|
+
className,
|
|
360
|
+
columns,
|
|
361
|
+
gap,
|
|
362
|
+
...props
|
|
363
|
+
}: MediaObjectGroupProps): react_jsx_runtime0.JSX.Element;
|
|
373
364
|
//#endregion
|
|
374
|
-
//#region src/patterns/
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
className
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
activeTab,
|
|
389
|
-
onTabChange,
|
|
390
|
-
className
|
|
391
|
-
}: TabGroupProps): react_jsx_runtime266.JSX.Element;
|
|
365
|
+
//#region src/patterns/SectionCard/SectionCard.d.ts
|
|
366
|
+
type SectionCardProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
367
|
+
/** Section title rendered in the header. */
|
|
368
|
+
title: React.ReactNode;
|
|
369
|
+
/** Optional right-aligned action slot (e.g. a Button). */
|
|
370
|
+
action?: React.ReactNode;
|
|
371
|
+
};
|
|
372
|
+
declare function SectionCard({
|
|
373
|
+
title,
|
|
374
|
+
action,
|
|
375
|
+
className,
|
|
376
|
+
children,
|
|
377
|
+
...props
|
|
378
|
+
}: SectionCardProps): react_jsx_runtime0.JSX.Element;
|
|
392
379
|
//#endregion
|
|
393
|
-
//#region src/patterns/
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
declare function
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
380
|
+
//#region src/patterns/SectionHeading/SectionHeading.d.ts
|
|
381
|
+
type SectionHeadingProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
382
|
+
/** The main heading content. */
|
|
383
|
+
title: React.ReactNode;
|
|
384
|
+
/** Optional supporting copy rendered below the heading. */
|
|
385
|
+
subtitle?: React.ReactNode;
|
|
386
|
+
/** Optional small label rendered above the heading. */
|
|
387
|
+
eyebrow?: React.ReactNode;
|
|
388
|
+
/** Horizontal alignment of the block. Defaults to `center`. */
|
|
389
|
+
align?: "center" | "left";
|
|
390
|
+
/** Render the title with the brand gradient fill. */
|
|
391
|
+
gradient?: boolean;
|
|
392
|
+
/** Visual size of the title (Heading scale). Defaults to `1`. */
|
|
393
|
+
titleSize?: HeadingProps["size"];
|
|
394
|
+
/** Semantic element for the title. Defaults to `h2`. */
|
|
395
|
+
titleAs?: React.ElementType;
|
|
396
|
+
};
|
|
397
|
+
declare function SectionHeading({
|
|
398
|
+
title,
|
|
399
|
+
subtitle,
|
|
400
|
+
eyebrow,
|
|
401
|
+
align,
|
|
402
|
+
gradient,
|
|
403
|
+
titleSize,
|
|
404
|
+
titleAs,
|
|
405
|
+
className,
|
|
406
|
+
...props
|
|
407
|
+
}: SectionHeadingProps): react_jsx_runtime0.JSX.Element;
|
|
416
408
|
//#endregion
|
|
417
|
-
export {
|
|
409
|
+
export { type ColumnDef, DEFAULT_LABELS, DataTable, DataTableColumnHeader, Fetcher, Footer, FooterCenter, FooterEnd, FooterPoweredBy, FooterSeparator, FooterStart, GlobalHeaderState, Header, HeaderBar, HeaderEndpoints, HeaderLogo, HeaderProps, HeaderSelection, Labels, MediaObject, MediaObjectActions, MediaObjectContent, MediaObjectGroup, type MediaObjectGroupProps, MediaObjectIcon, MediaObjectImage, type MediaObjectImageProps, type MediaObjectProps, MediaObjectText, MediaObjectTitle, type MediaObjectTitleProps, OrgPill, ProfileMenu, ProjectNode, ProjectPicker, SectionCard, type SectionCardProps, SectionHeading, type SectionHeadingProps, TOGGLE_PROJECT_DROPDOWN_EVENT, ThemeToggle, ToggleProjectDropdownDetail, UseHeaderProjectResult, buildEndpoints, getSessionToken, isSessionValid, mediaObjectGroupVariants, useGlobalHeader, useHeaderCredits, useHeaderProject };
|
|
418
410
|
//# sourceMappingURL=index.d.cts.map
|