@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.
Files changed (115) hide show
  1. package/README.md +30 -124
  2. package/dist/Stack.cjs +64 -0
  3. package/dist/Stack.cjs.map +1 -0
  4. package/dist/Stack.js +54 -0
  5. package/dist/Stack.js.map +1 -0
  6. package/dist/ThemeProvider.cjs +1886 -0
  7. package/dist/ThemeProvider.cjs.map +1 -0
  8. package/dist/ThemeProvider.d.cts +85 -0
  9. package/dist/ThemeProvider.d.cts.map +1 -0
  10. package/dist/ThemeProvider.d.ts +85 -0
  11. package/dist/ThemeProvider.d.ts.map +1 -0
  12. package/dist/ThemeProvider.js +1508 -0
  13. package/dist/ThemeProvider.js.map +1 -0
  14. package/dist/contexts/index.cjs +0 -60
  15. package/dist/contexts/index.d.cts +1 -23
  16. package/dist/contexts/index.d.ts +1 -23
  17. package/dist/contexts/index.js +1 -58
  18. package/dist/index.cjs +147 -72
  19. package/dist/index.d.cts +1009 -432
  20. package/dist/index.d.cts.map +1 -1
  21. package/dist/index.d.ts +1014 -437
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +6 -7
  24. package/dist/index2.d.cts +4 -16
  25. package/dist/index2.d.ts +4 -16
  26. package/dist/layouts/index.cjs +100 -12
  27. package/dist/layouts/index.cjs.map +1 -0
  28. package/dist/layouts/index.d.cts +70 -127
  29. package/dist/layouts/index.d.cts.map +1 -1
  30. package/dist/layouts/index.d.ts +70 -127
  31. package/dist/layouts/index.d.ts.map +1 -1
  32. package/dist/layouts/index.js +92 -2
  33. package/dist/layouts/index.js.map +1 -0
  34. package/dist/patterns/index.cjs +1004 -7254
  35. package/dist/patterns/index.cjs.map +1 -1
  36. package/dist/patterns/index.d.cts +381 -389
  37. package/dist/patterns/index.d.cts.map +1 -1
  38. package/dist/patterns/index.d.ts +378 -386
  39. package/dist/patterns/index.d.ts.map +1 -1
  40. package/dist/patterns/index.js +970 -7225
  41. package/dist/patterns/index.js.map +1 -1
  42. package/dist/primitives/index.cjs +135 -55
  43. package/dist/primitives/index.d.cts +3 -2
  44. package/dist/primitives/index.d.ts +3 -2
  45. package/dist/primitives/index.js +3 -5
  46. package/dist/primitives.cjs +3961 -1274
  47. package/dist/primitives.cjs.map +1 -1
  48. package/dist/primitives.js +3551 -1001
  49. package/dist/primitives.js.map +1 -1
  50. package/dist/styles/base.css +43 -0
  51. package/dist/styles/glass.css +75 -0
  52. package/dist/styles/index.css +43 -23
  53. package/dist/styles/semantic.css +107 -0
  54. package/dist/styles/theme.css +42 -24
  55. package/dist/styles/tokens/alpha.css +39 -0
  56. package/dist/styles/tokens/border-radius.css +17 -0
  57. package/dist/styles/tokens/chart-colors-dark.css +18 -0
  58. package/dist/styles/tokens/chart-colors-light.css +18 -0
  59. package/dist/styles/tokens/colors.css +251 -0
  60. package/dist/styles/tokens/mode-dark.css +101 -0
  61. package/dist/styles/tokens/mode-light.css +101 -0
  62. package/dist/styles/tokens/shadows.css +14 -0
  63. package/dist/styles/tokens/spacing.css +44 -0
  64. package/dist/styles/tokens/theme-bodhi.css +35 -0
  65. package/dist/styles/tokens/theme-slingshot.css +35 -0
  66. package/dist/styles/tokens/theme-sustain.css +35 -0
  67. package/dist/styles/tokens/typography.css +83 -0
  68. package/dist/utils.cjs +67 -0
  69. package/dist/utils.cjs.map +1 -0
  70. package/dist/utils.js +27 -0
  71. package/dist/utils.js.map +1 -0
  72. package/package.json +15 -41
  73. package/dist/AiChatPanel.cjs +0 -1603
  74. package/dist/AiChatPanel.cjs.map +0 -1
  75. package/dist/AiChatPanel.js +0 -1526
  76. package/dist/AiChatPanel.js.map +0 -1
  77. package/dist/BodhiLogo.cjs +0 -240
  78. package/dist/BodhiLogo.cjs.map +0 -1
  79. package/dist/BodhiLogo.js +0 -194
  80. package/dist/BodhiLogo.js.map +0 -1
  81. package/dist/Skeleton.cjs +0 -19
  82. package/dist/Skeleton.cjs.map +0 -1
  83. package/dist/Skeleton.js +0 -14
  84. package/dist/Skeleton.js.map +0 -1
  85. package/dist/SustainLogo.cjs +0 -415
  86. package/dist/SustainLogo.cjs.map +0 -1
  87. package/dist/SustainLogo.js +0 -378
  88. package/dist/SustainLogo.js.map +0 -1
  89. package/dist/contexts/index.cjs.map +0 -1
  90. package/dist/contexts/index.d.cts.map +0 -1
  91. package/dist/contexts/index.d.ts.map +0 -1
  92. package/dist/contexts/index.js.map +0 -1
  93. package/dist/index2.d.cts.map +0 -1
  94. package/dist/index2.d.ts.map +0 -1
  95. package/dist/layouts.cjs +0 -3245
  96. package/dist/layouts.cjs.map +0 -1
  97. package/dist/layouts.js +0 -3180
  98. package/dist/layouts.js.map +0 -1
  99. package/dist/styles/base/colors.css +0 -300
  100. package/dist/styles/base/component-tokens.css +0 -240
  101. package/dist/styles/base/elevation.css +0 -7
  102. package/dist/styles/base/fonts.css +0 -14
  103. package/dist/styles/base/global.css +0 -305
  104. package/dist/styles/base/radius.css +0 -22
  105. package/dist/styles/base/semantic-aliases.css +0 -53
  106. package/dist/styles/base/spacing.css +0 -33
  107. package/dist/styles/base/typography.css +0 -48
  108. package/dist/styles/generated/bodhi-vars.css +0 -34
  109. package/dist/styles/generated/dark.css +0 -87
  110. package/dist/styles/generated/light.css +0 -87
  111. package/dist/styles/generated/slingshot-vars.css +0 -34
  112. package/dist/styles/generated/sustain-vars.css +0 -34
  113. package/dist/styles/themes/bodhi.css +0 -166
  114. package/dist/styles/themes/slingshot.css +0 -144
  115. package/dist/styles/themes/sustain.css +0 -130
@@ -1,418 +1,410 @@
1
- import * as react0 from "react";
2
- import { CSSProperties, MouseEvent, ReactNode } from "react";
1
+ import { o as Text, r as ThemeProduct, u as HeadingProps } from "../ThemeProvider.js";
2
+ import * as React from "react";
3
+ import { ReactNode } from "react";
3
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+ import { VariantProps } from "class-variance-authority";
6
+ import { Column, ColumnDef } from "@tanstack/react-table";
7
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
4
8
 
5
- //#region src/patterns/AccountProjectSwitcher/AccountProjectSwitcher.d.ts
6
- declare function AccountProjectSwitcher(): react_jsx_runtime0.JSX.Element;
7
- //# sourceMappingURL=AccountProjectSwitcher.d.ts.map
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/AddContextDrawer/AddContextDrawer.d.ts
10
- interface AddContextDrawerProps {
11
- isOpen: boolean;
12
- onClose: () => void;
13
- resourceTitle: string;
14
- /** Optional callback fired when the user confirms "Add Resource" on step 3 */
15
- onAdd?: (resourceTitle: string) => void;
16
- }
17
- declare function AddContextDrawer({
18
- isOpen,
19
- onClose,
20
- resourceTitle,
21
- onAdd
22
- }: AddContextDrawerProps): react_jsx_runtime0.JSX.Element | null;
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/AddNewRoleDrawer/AddNewRoleDrawer.d.ts
25
- interface RoleData {
26
- id?: string;
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_runtime0.JSX.Element;
73
- //#endregion
74
- //#region src/patterns/AddPortfolioDrawer/AddPortfolioDrawer.d.ts
75
- interface PortfolioFormData {
76
83
  name: string;
77
- description: string;
78
- selectedProjects: string[];
79
- resourceMode: "import" | "new";
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
- interface AddPortfolioDrawerProps {
84
- isOpen: boolean;
85
- onClose: () => void;
86
- onSubmit: (data: PortfolioFormData) => void;
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
- declare function AddPortfolioDrawer({
89
- isOpen,
90
- onClose,
91
- onSubmit
92
- }: AddPortfolioDrawerProps): react0.ReactPortal | null;
93
- //#endregion
94
- //#region src/patterns/AiChatPanel/AiChatPanel.d.ts
95
- declare const defaultSuggestedPrompts: string[];
96
- declare const defaultMockResponses: Record<string, string>;
97
- declare const defaultFallbackResponse = "Thanks for your question! I can help with navigating the platform, understanding roles & permissions, managing users, and reviewing activity logs. Could you provide a bit more detail so I can assist you better?";
98
- declare function AIChatPanel({
99
- onClose,
100
- suggestedPrompts,
101
- mockResponses,
102
- fallbackResponse
103
- }: {
104
- onClose: () => void;
105
- suggestedPrompts?: string[];
106
- mockResponses?: Record<string, string>;
107
- fallbackResponse?: string;
108
- }): react_jsx_runtime0.JSX.Element;
109
- //# sourceMappingURL=AiChatPanel.d.ts.map
110
- //#endregion
111
- //#region src/patterns/AiChatPanel/activity-context.d.ts
112
- type ActivityType = "context_added" | "analyzing_started" | "analyzing_complete" | "ingestion_started" | "ingestion_complete" | "error_detected" | "token_expired" | "sync_triggered";
113
- type ActivitySeverity = "info" | "success" | "warning" | "error";
114
- type ActivityFilterType = "all" | "errors" | "token_expired" | "warnings" | null;
115
- interface ActivityEvent {
116
- id: string;
117
- type: ActivityType;
118
- severity: ActivitySeverity;
119
- title: string;
120
- source: string;
121
- category: string;
122
- description: string;
123
- timestamp: Date;
124
- metadata?: {
125
- resourceId?: string;
126
- phase?: string;
127
- progress?: number;
128
- filesCount?: number;
129
- errorsCount?: number;
130
- completedCount?: number;
131
- pendingCount?: number;
132
- activeRepoCount?: number;
133
- tokenExpiredCount?: number;
134
- eta?: string;
135
- errorDetails?: string[];
136
- repositories?: string[];
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
- declare const activityTypeLabels: Record<ActivityType, string>;
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
153
+ //# sourceMappingURL=types.d.ts.map
154
+ //#endregion
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
157
164
  }: {
158
- children: ReactNode;
165
+ brand: ThemeProduct;
159
166
  }): react_jsx_runtime0.JSX.Element;
160
- //#endregion
161
- //#region src/patterns/AiChatPanel/right-panel-context.d.ts
162
- type RightPanelType = "activity" | "ai-chat" | null;
163
- interface RightPanelContextValue {
164
- /** Which panel is currently open (null = collapsed icons only) */
165
- activePanel: RightPanelType;
166
- /** Open a specific panel */
167
- openPanel: (panel: "activity" | "ai-chat") => void;
168
- /** Close whatever panel is open */
169
- closePanel: () => void;
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
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
185
181
  }: {
186
- children: ReactNode;
182
+ email?: string;
183
+ onLogout: () => void;
187
184
  }): react_jsx_runtime0.JSX.Element;
188
- declare function useRightPanel(): RightPanelContextValue;
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/AlertDialog/AlertDialog.d.ts
191
- interface AlertDialogProps {
192
- isOpen: boolean;
193
- onCancel: () => void;
194
- onConfirm: () => void;
195
- title?: string;
196
- description?: string;
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 AlertDialog({
199
- isOpen,
200
- onCancel,
201
- onConfirm,
202
- title,
203
- description
204
- }: AlertDialogProps): react0.ReactPortal | null;
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/CategorySection/CategorySection.d.ts
207
- interface CategorySectionProps {
208
- id: string;
209
- title: string;
210
- isOpen: boolean;
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
- declare function CategorySection({
218
- id,
219
- title,
220
- isOpen,
221
- onToggle,
222
- items
223
- }: CategorySectionProps): react_jsx_runtime0.JSX.Element;
224
- //#endregion
225
- //#region src/patterns/IconButton/IconButton.d.ts
226
- type IconButtonVariant = "default" | "ghost" | "danger";
227
- type IconButtonMouseHandler = (e: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
228
- interface IconButtonProps {
229
- children: ReactNode;
230
- onClick?: IconButtonMouseHandler;
231
- variant?: IconButtonVariant;
232
- className?: string;
233
- as?: "button" | "div";
234
- style?: CSSProperties;
235
- onMouseEnter?: IconButtonMouseHandler;
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
- declare function IconButton({
239
- children,
240
- onClick,
241
- variant,
242
- className,
243
- as,
244
- style,
245
- onMouseEnter,
246
- onMouseLeave
247
- }: IconButtonProps): react_jsx_runtime0.JSX.Element;
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/InfoBanner/InfoBanner.d.ts
250
- interface InfoBannerProps {
251
- title: string;
252
- description?: string;
253
- /** If false, hides the dismiss (X) button. Default true. */
254
- dismissible?: boolean;
255
- /** External control: if provided, overrides internal state */
256
- visible?: boolean;
257
- onDismiss?: () => void;
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
- declare function InfoBanner({
261
- title,
262
- description,
263
- dismissible,
264
- visible,
265
- onDismiss,
266
- className
267
- }: InfoBannerProps): react_jsx_runtime0.JSX.Element | null;
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_runtime0.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
- * Wraps a page with a fade-up entrance animation.
292
- *
293
- * IMPORTANT: The `animate-page-enter` class uses `transform: translateY(...)` which
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 PageTransition({
300
- children,
301
- className
302
- }: PageTransitionProps): react_jsx_runtime0.JSX.Element;
303
- //#endregion
304
- //#region src/patterns/ProductSwitcher/ProductSwitcher.d.ts
305
- interface ProductSwitcherProps {
306
- isDarkMode: boolean;
307
- }
308
- declare function ProductSwitcher({
309
- isDarkMode
310
- }: ProductSwitcherProps): react_jsx_runtime0.JSX.Element;
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
311
284
  //#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_runtime0.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/ResourceTile/ResourceTile.d.ts
336
- interface ResourceTileProps {
337
- title: string;
338
- subtitle: string;
339
- onClick?: () => void;
340
- }
341
- declare function ResourceTile({
342
- title,
343
- subtitle,
344
- onClick
345
- }: ResourceTileProps): react_jsx_runtime0.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/RichCheckboxGroup/RichCheckboxGroup.d.ts
348
- interface RichCheckboxItem {
349
- id: string;
350
- label: string;
351
- checked: boolean;
352
- }
353
- interface RichCheckboxGroupData {
354
- id: string;
355
- label: string;
356
- items: RichCheckboxItem[];
357
- }
358
- interface RichCheckboxGroupProps {
359
- group: RichCheckboxGroupData;
360
- onToggle: (groupId: string, itemId: string) => void;
361
- }
362
- declare function RichCheckboxGroup({
363
- group,
364
- onToggle
365
- }: RichCheckboxGroupProps): react_jsx_runtime0.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/SkeletonLayouts/SkeletonLayouts.d.ts
368
- declare function TableRowSkeleton(): react_jsx_runtime0.JSX.Element;
369
- declare function CardSkeleton(): react_jsx_runtime0.JSX.Element;
370
- declare function UserListItemSkeleton(): react_jsx_runtime0.JSX.Element;
371
- declare function PageHeaderSkeleton(): react_jsx_runtime0.JSX.Element;
372
- //# sourceMappingURL=SkeletonLayouts.d.ts.map
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/TabGroup/TabGroup.d.ts
375
- interface Tab {
376
- id: string;
377
- label: string;
378
- }
379
- interface TabGroupProps {
380
- tabs: Tab[];
381
- activeTab: string;
382
- onTabChange: (tabId: string) => void;
383
- /** Optional className on the outer container */
384
- className?: string;
385
- }
386
- declare function TabGroup({
387
- tabs,
388
- activeTab,
389
- onTabChange,
390
- className
391
- }: TabGroupProps): react_jsx_runtime0.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/ViewEditUserDrawer/ViewEditUserDrawer.d.ts
394
- interface UserData {
395
- id: string;
396
- name: string;
397
- email: string;
398
- platform: string;
399
- status: string;
400
- statusVariant: "pending" | "active" | "inactive" | "invited";
401
- requestedBy: string;
402
- requestDate: string;
403
- }
404
- interface ViewEditUserDrawerProps {
405
- isOpen: boolean;
406
- onClose: () => void;
407
- user: UserData | null;
408
- onSave?: (user: UserData) => void;
409
- }
410
- declare function ViewEditUserDrawer({
411
- isOpen,
412
- onClose,
413
- user,
414
- onSave
415
- }: ViewEditUserDrawerProps): react_jsx_runtime0.JSX.Element;
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 { AIChatPanel, AccountProjectSwitcher, ActivityEvent, ActivityFilterType, ActivityProvider, ActivitySeverity, ActivityType, AddContextDrawer, AddNewRoleDrawer, AddPortfolioDrawer, AlertDialog, CardSkeleton, CategorySection, IconButton, InfoBanner, InviteUsersDrawer, PLATFORMS, PageHeaderSkeleton, PageTransition, ParsedTreeNode, PlatformInfo, PortfolioFormData, ProductSwitcher, ProjectBulkUploadDrawer, ResourceTile, RichCheckboxGroup, RichCheckboxGroupData, RichCheckboxItem, RightPanelProvider, RightPanelType, RoleData, Tab, TabGroup, TableRowSkeleton, UserListItemSkeleton, ViewEditUserDrawer, activityTypeLabels, defaultFallbackResponse, defaultMockResponses, defaultSuggestedPrompts, severityMap, useActivity, useRightPanel };
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.ts.map