@kb-labs/studio-app 0.6.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 (168) hide show
  1. package/.env.example +10 -0
  2. package/README.md +74 -0
  3. package/UI-KIT-COMPONENTS.md +783 -0
  4. package/UI-KIT-PLAN.md +326 -0
  5. package/eslint-rules/no-direct-antd-import.js +151 -0
  6. package/eslint.config.ts +27 -0
  7. package/index.html +17 -0
  8. package/package.json +72 -0
  9. package/postcss.config.js +7 -0
  10. package/public/favicon.ico +0 -0
  11. package/public/favicon.svg +7 -0
  12. package/rspack.config.mjs +118 -0
  13. package/src/App.tsx +46 -0
  14. package/src/components/devtools/devtools-log-feed.module.css +165 -0
  15. package/src/components/devtools/devtools-log-feed.tsx +300 -0
  16. package/src/components/devtools/devtools-panel.module.css +121 -0
  17. package/src/components/devtools/devtools-panel.tsx +115 -0
  18. package/src/components/empty-state.tsx +28 -0
  19. package/src/components/error-boundary.tsx +210 -0
  20. package/src/components/health-banner.module.css +103 -0
  21. package/src/components/health-banner.tsx +134 -0
  22. package/src/components/health-indicator.tsx +12 -0
  23. package/src/components/page-header.tsx +49 -0
  24. package/src/components/page-transition.tsx +24 -0
  25. package/src/components/role-switcher.tsx +148 -0
  26. package/src/components/run-badge.tsx +13 -0
  27. package/src/components/ui/icons.tsx +509 -0
  28. package/src/components/ui/index.ts +25 -0
  29. package/src/components/ui/kb-config-provider.tsx +130 -0
  30. package/src/components/ui/kb-header.module.css +51 -0
  31. package/src/components/ui/kb-header.tsx +112 -0
  32. package/src/components/ui/kb-notification-bell.module.css +103 -0
  33. package/src/components/ui/kb-notification-bell.tsx +199 -0
  34. package/src/components/ui/kb-page-layout.tsx +66 -0
  35. package/src/components/ui/kb-quick-search.module.css +86 -0
  36. package/src/components/ui/kb-quick-search.tsx +196 -0
  37. package/src/components/ui/kb-sidebar.module.css +47 -0
  38. package/src/components/ui/kb-sidebar.tsx +196 -0
  39. package/src/components/ui/kb-stat-card.module.css +21 -0
  40. package/src/components/ui/kb-stat-card.tsx +22 -0
  41. package/src/components/ui/kb-stat-grid.tsx +22 -0
  42. package/src/components/ui/kb-status-bar.module.css +49 -0
  43. package/src/components/ui/kb-status-bar.tsx +145 -0
  44. package/src/components/ui/kb-system-health-indicator.tsx +229 -0
  45. package/src/components/ui/kb-theme-toggle.tsx +42 -0
  46. package/src/components/ui/theme-adapter.ts +812 -0
  47. package/src/components/ui/theme-transition-overlay.tsx +70 -0
  48. package/src/components/ui/utils.ts +6 -0
  49. package/src/components/widget-error-boundary.tsx +172 -0
  50. package/src/config/env.ts +5 -0
  51. package/src/config/feature-flags.ts +482 -0
  52. package/src/config/studio.config.schema.ts +88 -0
  53. package/src/config/studio.config.ts +84 -0
  54. package/src/env.d.ts +23 -0
  55. package/src/hooks/use-command-palette.ts +6 -0
  56. package/src/hooks/use-devtools-store.ts +25 -0
  57. package/src/hooks/use-feature-flags.ts +101 -0
  58. package/src/index.css +10 -0
  59. package/src/layouts/dashboard-grid.tsx +122 -0
  60. package/src/layouts/index.ts +12 -0
  61. package/src/layouts/two-pane.tsx +134 -0
  62. package/src/main.tsx +15 -0
  63. package/src/modules/analytics/components/analytics-daily-stats-chart.tsx +257 -0
  64. package/src/modules/analytics/components/analytics-date-range-picker.tsx +121 -0
  65. package/src/modules/analytics/pages/analytics-cache-page.tsx +285 -0
  66. package/src/modules/analytics/pages/analytics-embeddings-page.tsx +274 -0
  67. package/src/modules/analytics/pages/analytics-events-page.tsx +425 -0
  68. package/src/modules/analytics/pages/analytics-llm-page.tsx +434 -0
  69. package/src/modules/analytics/pages/analytics-overview-page.tsx +336 -0
  70. package/src/modules/analytics/pages/analytics-page.tsx +20 -0
  71. package/src/modules/analytics/pages/analytics-storage-page.tsx +344 -0
  72. package/src/modules/analytics/pages/analytics-vectorstore-page.tsx +279 -0
  73. package/src/modules/analytics/routes/index.tsx +133 -0
  74. package/src/modules/analytics/utils/formatters.test.ts +148 -0
  75. package/src/modules/analytics/utils/formatters.ts +100 -0
  76. package/src/modules/auth/pages/login-page.module.css +113 -0
  77. package/src/modules/auth/pages/login-page.tsx +80 -0
  78. package/src/modules/auth/routes/index.tsx +24 -0
  79. package/src/modules/dashboard/components/ActivityTimelineWidget.tsx +199 -0
  80. package/src/modules/dashboard/components/AiInsightsWidget.tsx +358 -0
  81. package/src/modules/dashboard/components/AnimatedMetricCard.css +88 -0
  82. package/src/modules/dashboard/components/AnimatedMetricCard.tsx +125 -0
  83. package/src/modules/dashboard/components/HeroMetricCard.css +114 -0
  84. package/src/modules/dashboard/components/HeroMetricCard.tsx +152 -0
  85. package/src/modules/dashboard/components/HeroMetricsWidget.tsx +146 -0
  86. package/src/modules/dashboard/components/SystemResourcesWidget.tsx +197 -0
  87. package/src/modules/dashboard/components/dashboard-empty.tsx +22 -0
  88. package/src/modules/dashboard/components/dashboard-kpis-widget.tsx +59 -0
  89. package/src/modules/dashboard/components/dashboard-kpis.tsx +13 -0
  90. package/src/modules/dashboard/components/dashboard-latency-percentiles-widget.tsx +85 -0
  91. package/src/modules/dashboard/components/dashboard-metrics-widget.tsx +78 -0
  92. package/src/modules/dashboard/components/dashboard-plugins-widget.tsx +67 -0
  93. package/src/modules/dashboard/components/dashboard-requests-widget.tsx +62 -0
  94. package/src/modules/dashboard/layouts/dashboard-layout.tsx +16 -0
  95. package/src/modules/dashboard/pages/ai-insights-page.tsx +563 -0
  96. package/src/modules/dashboard/pages/dashboard-animations.css +317 -0
  97. package/src/modules/dashboard/pages/dashboard-page.tsx +13 -0
  98. package/src/modules/dashboard/routes/index.tsx +70 -0
  99. package/src/modules/observability/pages/devkit-page.tsx +263 -0
  100. package/src/modules/observability/pages/incident-detail-page.tsx +571 -0
  101. package/src/modules/observability/pages/incidents-page.tsx +370 -0
  102. package/src/modules/observability/pages/log-detail-page.tsx +508 -0
  103. package/src/modules/observability/pages/logs-page.tsx +1129 -0
  104. package/src/modules/observability/pages/prometheus-metrics-page.tsx +486 -0
  105. package/src/modules/observability/pages/state-broker-page.tsx +229 -0
  106. package/src/modules/observability/pages/system-events-page.tsx +255 -0
  107. package/src/modules/observability/routes/index.tsx +133 -0
  108. package/src/modules/plugins/components/marketplace-card.tsx +153 -0
  109. package/src/modules/plugins/components/plugin-ai-assistant-modal.tsx +374 -0
  110. package/src/modules/plugins/components/plugin-card.tsx +136 -0
  111. package/src/modules/plugins/components/plugin-detail/capabilities-summary.tsx +101 -0
  112. package/src/modules/plugins/components/plugin-detail/cli-commands-table.tsx +101 -0
  113. package/src/modules/plugins/components/plugin-detail/index.ts +7 -0
  114. package/src/modules/plugins/components/plugin-detail/jobs-table.tsx +64 -0
  115. package/src/modules/plugins/components/plugin-detail/permissions/env-permissions.tsx +30 -0
  116. package/src/modules/plugins/components/plugin-detail/permissions/filesystem-permissions.tsx +68 -0
  117. package/src/modules/plugins/components/plugin-detail/permissions/index.ts +6 -0
  118. package/src/modules/plugins/components/plugin-detail/permissions/network-permissions.tsx +43 -0
  119. package/src/modules/plugins/components/plugin-detail/permissions/platform-services.tsx +242 -0
  120. package/src/modules/plugins/components/plugin-detail/permissions/resource-quotas.tsx +96 -0
  121. package/src/modules/plugins/components/plugin-detail/permissions/shell-permissions.tsx +55 -0
  122. package/src/modules/plugins/components/plugin-detail/permissions-view.tsx +47 -0
  123. package/src/modules/plugins/components/plugin-detail/plugin-header.tsx +169 -0
  124. package/src/modules/plugins/components/plugin-detail/rest-routes-table.tsx +159 -0
  125. package/src/modules/plugins/components/plugin-detail/workflows-table.tsx +40 -0
  126. package/src/modules/plugins/components/plugin-grid.tsx +20 -0
  127. package/src/modules/plugins/components/plugin-table.tsx +178 -0
  128. package/src/modules/plugins/pages/marketplace-page.tsx +200 -0
  129. package/src/modules/plugins/pages/plugin-detail-page.tsx +1145 -0
  130. package/src/modules/plugins/routes/index.tsx +48 -0
  131. package/src/modules/plugins/utils/index.ts +1 -0
  132. package/src/modules/plugins/utils/schema-helpers.ts +21 -0
  133. package/src/modules/settings/components/api-routes-viewer.tsx +415 -0
  134. package/src/modules/settings/components/appearance-settings.tsx +200 -0
  135. package/src/modules/settings/components/configuration-settings.tsx +321 -0
  136. package/src/modules/settings/components/data-privacy-settings.tsx +111 -0
  137. package/src/modules/settings/components/experimental-settings.tsx +243 -0
  138. package/src/modules/settings/components/navigation-settings.tsx +198 -0
  139. package/src/modules/settings/components/notifications-settings.tsx +40 -0
  140. package/src/modules/settings/pages/settings-page.tsx +298 -0
  141. package/src/modules/settings/routes/index.tsx +47 -0
  142. package/src/pages/README-assistant.md +91 -0
  143. package/src/pages/login-page.tsx +177 -0
  144. package/src/pages/not-found-page.tsx +85 -0
  145. package/src/providers/auth-provider.tsx +40 -0
  146. package/src/providers/command-palette-provider.tsx +193 -0
  147. package/src/providers/data-sources-provider.tsx +27 -0
  148. package/src/providers/devtools-provider.tsx +72 -0
  149. package/src/providers/navigation-items-provider.tsx +38 -0
  150. package/src/providers/registry-v2-provider.tsx +93 -0
  151. package/src/providers/settings-provider.tsx +158 -0
  152. package/src/router.tsx +302 -0
  153. package/src/routes/helpers.tsx +25 -0
  154. package/src/routes/plugin-page-v2.tsx +52 -0
  155. package/src/routes/types.ts +18 -0
  156. package/src/styles/antd-overrides.css +211 -0
  157. package/src/styles/base.css +190 -0
  158. package/src/styles/settings.css +75 -0
  159. package/src/styles/variables.css +94 -0
  160. package/src/utils/analytics.ts +183 -0
  161. package/src/utils/apply-navigation-categories.ts +83 -0
  162. package/src/utils/commands.ts +252 -0
  163. package/src/utils/export.ts +174 -0
  164. package/src/utils/format-date.ts +166 -0
  165. package/src/utils/logger.ts +110 -0
  166. package/tailwind.config.ts +13 -0
  167. package/tsconfig.json +13 -0
  168. package/vitest-setup.ts +1 -0
@@ -0,0 +1,509 @@
1
+ /**
2
+ * Icon utilities for rendering Ant Design icons by name
3
+ *
4
+ * This module provides a curated set of ~100 icons for plugin developers.
5
+ * All icons are tree-shaken properly and only included if used.
6
+ */
7
+
8
+ import * as React from 'react';
9
+
10
+ // Import curated icon set for plugin developers
11
+ import {
12
+ // Navigation & Layout
13
+ HomeOutlined,
14
+ DashboardOutlined,
15
+ MenuOutlined,
16
+ AppstoreOutlined,
17
+ LayoutOutlined,
18
+ SettingOutlined,
19
+ UnorderedListOutlined,
20
+ OrderedListOutlined,
21
+
22
+ // Actions & Controls
23
+ PlayCircleOutlined,
24
+ PauseCircleOutlined,
25
+ StopOutlined,
26
+ ReloadOutlined,
27
+ SyncOutlined,
28
+ PlusOutlined,
29
+ MinusOutlined,
30
+ CloseOutlined,
31
+ CheckOutlined,
32
+ EditOutlined,
33
+ DeleteOutlined,
34
+ SaveOutlined,
35
+ DownloadOutlined,
36
+ UploadOutlined,
37
+ ExportOutlined,
38
+ ImportOutlined,
39
+ CopyOutlined,
40
+ SearchOutlined,
41
+ FilterOutlined,
42
+ ArrowUpOutlined,
43
+ ArrowDownOutlined,
44
+ ArrowLeftOutlined,
45
+ ArrowRightOutlined,
46
+
47
+ // Status & Alerts
48
+ CheckCircleOutlined,
49
+ CloseCircleOutlined,
50
+ ExclamationCircleOutlined,
51
+ InfoCircleOutlined,
52
+ WarningOutlined,
53
+ QuestionCircleOutlined,
54
+ LoadingOutlined,
55
+ SyncOutlined as SpinOutlined,
56
+
57
+ // Files & Folders
58
+ FileOutlined,
59
+ FileTextOutlined,
60
+ FileImageOutlined,
61
+ FilePdfOutlined,
62
+ FileWordOutlined,
63
+ FileExcelOutlined,
64
+ FolderOutlined,
65
+ FolderOpenOutlined,
66
+
67
+ // Development & Code
68
+ CodeOutlined,
69
+ BugOutlined,
70
+ ApiOutlined,
71
+ ConsoleSqlOutlined,
72
+ FunctionOutlined,
73
+ DeploymentUnitOutlined,
74
+ BranchesOutlined,
75
+ NodeIndexOutlined,
76
+
77
+ // Git & Version Control
78
+ GithubOutlined,
79
+ GitlabOutlined,
80
+ PullRequestOutlined,
81
+ MergeCellsOutlined,
82
+
83
+ // Data & Analytics
84
+ DatabaseOutlined,
85
+ TableOutlined,
86
+ BarChartOutlined,
87
+ LineChartOutlined,
88
+ PieChartOutlined,
89
+ AreaChartOutlined,
90
+ DotChartOutlined,
91
+
92
+ // Communication
93
+ MailOutlined,
94
+ MessageOutlined,
95
+ CommentOutlined,
96
+ NotificationOutlined,
97
+ BellOutlined,
98
+
99
+ // Users & Teams
100
+ UserOutlined,
101
+ TeamOutlined,
102
+ UsergroupAddOutlined,
103
+ ContactsOutlined,
104
+
105
+ // Time & Calendar
106
+ ClockCircleOutlined,
107
+ CalendarOutlined,
108
+ HistoryOutlined,
109
+ FieldTimeOutlined,
110
+
111
+ // Media & Visual
112
+ PictureOutlined,
113
+ CameraOutlined,
114
+ VideoCameraOutlined,
115
+ EyeOutlined,
116
+ EyeInvisibleOutlined,
117
+
118
+ // Network & Cloud
119
+ CloudOutlined,
120
+ CloudDownloadOutlined,
121
+ CloudUploadOutlined,
122
+ GlobalOutlined,
123
+ WifiOutlined,
124
+ ApiOutlined as LinkOutlined,
125
+
126
+ // Security
127
+ LockOutlined,
128
+ UnlockOutlined,
129
+ SafetyOutlined,
130
+ SafetyCertificateOutlined,
131
+ KeyOutlined,
132
+
133
+ // Tools & Utilities
134
+ ToolOutlined,
135
+ BuildOutlined,
136
+ ExperimentOutlined,
137
+ RocketOutlined,
138
+ RobotOutlined,
139
+ ThunderboltOutlined,
140
+ FireOutlined,
141
+ BulbOutlined,
142
+
143
+ // Misc
144
+ StarOutlined,
145
+ HeartOutlined,
146
+ TrophyOutlined,
147
+ GiftOutlined,
148
+ AimOutlined,
149
+ FlagOutlined,
150
+ TagOutlined,
151
+ BookOutlined,
152
+ MoreOutlined,
153
+ EllipsisOutlined,
154
+ RightOutlined,
155
+ LeftOutlined,
156
+ UpOutlined,
157
+ DownOutlined,
158
+ } from '@ant-design/icons';
159
+
160
+ /**
161
+ * Registry of all available icons for plugin developers.
162
+ * This is the complete list of icons that can be used in plugin manifests.
163
+ */
164
+ export const AVAILABLE_ICONS: Record<string, React.ComponentType<any>> = {
165
+ // Navigation & Layout
166
+ HomeOutlined,
167
+ DashboardOutlined,
168
+ MenuOutlined,
169
+ AppstoreOutlined,
170
+ LayoutOutlined,
171
+ SettingOutlined,
172
+ UnorderedListOutlined,
173
+ OrderedListOutlined,
174
+
175
+ // Actions & Controls
176
+ PlayCircleOutlined,
177
+ PauseCircleOutlined,
178
+ StopOutlined,
179
+ ReloadOutlined,
180
+ SyncOutlined,
181
+ PlusOutlined,
182
+ MinusOutlined,
183
+ CloseOutlined,
184
+ CheckOutlined,
185
+ EditOutlined,
186
+ DeleteOutlined,
187
+ SaveOutlined,
188
+ DownloadOutlined,
189
+ UploadOutlined,
190
+ ExportOutlined,
191
+ ImportOutlined,
192
+ CopyOutlined,
193
+ SearchOutlined,
194
+ FilterOutlined,
195
+ ArrowUpOutlined,
196
+ ArrowDownOutlined,
197
+ ArrowLeftOutlined,
198
+ ArrowRightOutlined,
199
+
200
+ // Status & Alerts
201
+ CheckCircleOutlined,
202
+ CloseCircleOutlined,
203
+ ExclamationCircleOutlined,
204
+ InfoCircleOutlined,
205
+ WarningOutlined,
206
+ QuestionCircleOutlined,
207
+ LoadingOutlined,
208
+ SpinOutlined,
209
+
210
+ // Files & Folders
211
+ FileOutlined,
212
+ FileTextOutlined,
213
+ FileImageOutlined,
214
+ FilePdfOutlined,
215
+ FileWordOutlined,
216
+ FileExcelOutlined,
217
+ FolderOutlined,
218
+ FolderOpenOutlined,
219
+
220
+ // Development & Code
221
+ CodeOutlined,
222
+ BugOutlined,
223
+ ApiOutlined,
224
+ ConsoleSqlOutlined,
225
+ FunctionOutlined,
226
+ DeploymentUnitOutlined,
227
+ BranchesOutlined,
228
+ NodeIndexOutlined,
229
+
230
+ // Git & Version Control
231
+ GithubOutlined,
232
+ GitlabOutlined,
233
+ PullRequestOutlined,
234
+ MergeCellsOutlined,
235
+
236
+ // Data & Analytics
237
+ DatabaseOutlined,
238
+ TableOutlined,
239
+ BarChartOutlined,
240
+ LineChartOutlined,
241
+ PieChartOutlined,
242
+ AreaChartOutlined,
243
+ DotChartOutlined,
244
+
245
+ // Communication
246
+ MailOutlined,
247
+ MessageOutlined,
248
+ CommentOutlined,
249
+ NotificationOutlined,
250
+ BellOutlined,
251
+
252
+ // Users & Teams
253
+ UserOutlined,
254
+ TeamOutlined,
255
+ UsergroupAddOutlined,
256
+ ContactsOutlined,
257
+
258
+ // Time & Calendar
259
+ ClockCircleOutlined,
260
+ CalendarOutlined,
261
+ HistoryOutlined,
262
+ FieldTimeOutlined,
263
+
264
+ // Media & Visual
265
+ PictureOutlined,
266
+ CameraOutlined,
267
+ VideoCameraOutlined,
268
+ EyeOutlined,
269
+ EyeInvisibleOutlined,
270
+
271
+ // Network & Cloud
272
+ CloudOutlined,
273
+ CloudDownloadOutlined,
274
+ CloudUploadOutlined,
275
+ GlobalOutlined,
276
+ WifiOutlined,
277
+ LinkOutlined,
278
+
279
+ // Security
280
+ LockOutlined,
281
+ UnlockOutlined,
282
+ SafetyOutlined,
283
+ SafetyCertificateOutlined,
284
+ KeyOutlined,
285
+
286
+ // Tools & Utilities
287
+ ToolOutlined,
288
+ BuildOutlined,
289
+ ExperimentOutlined,
290
+ RocketOutlined,
291
+ RobotOutlined,
292
+ ThunderboltOutlined,
293
+ FireOutlined,
294
+ BulbOutlined,
295
+
296
+ // Misc
297
+ StarOutlined,
298
+ HeartOutlined,
299
+ TrophyOutlined,
300
+ GiftOutlined,
301
+ AimOutlined,
302
+ FlagOutlined,
303
+ TagOutlined,
304
+ BookOutlined,
305
+ MoreOutlined,
306
+ EllipsisOutlined,
307
+ RightOutlined,
308
+ LeftOutlined,
309
+ UpOutlined,
310
+ DownOutlined,
311
+ };
312
+
313
+ /**
314
+ * Get icon component by name.
315
+ * Only icons from AVAILABLE_ICONS registry are supported.
316
+ *
317
+ * @param iconName - Icon name from the available icons list
318
+ * @returns Icon component or null if not found
319
+ *
320
+ * @example
321
+ * ```tsx
322
+ * const IconComponent = getIconComponent('HomeOutlined');
323
+ * if (IconComponent) {
324
+ * return <IconComponent />;
325
+ * }
326
+ * ```
327
+ */
328
+ export function getIconComponent(iconName?: string): React.ComponentType<any> | null {
329
+ if (!iconName) {return null;}
330
+
331
+ const icon = AVAILABLE_ICONS[iconName];
332
+ if (!icon) {
333
+ console.warn(`Icon "${iconName}" is not available. Check AVAILABLE_ICONS registry.`);
334
+ return null;
335
+ }
336
+
337
+ return icon;
338
+ }
339
+
340
+ /**
341
+ * Render icon by name.
342
+ *
343
+ * @param iconName - Icon name from the available icons list
344
+ * @param props - Icon props (style, className, etc.)
345
+ * @returns Rendered icon element or null if not found
346
+ *
347
+ * @example
348
+ * ```tsx
349
+ * // Simple usage
350
+ * {renderIcon('HomeOutlined')}
351
+ *
352
+ * // With props
353
+ * {renderIcon('SettingOutlined', { style: { fontSize: 20 } })}
354
+ * ```
355
+ */
356
+ export function renderIcon(iconName?: string, props?: any): React.ReactElement | null {
357
+ const IconComponent = getIconComponent(iconName);
358
+ if (!IconComponent) {return null;}
359
+ return <IconComponent {...props} />;
360
+ }
361
+
362
+ /**
363
+ * Get list of all available icon names.
364
+ * Useful for documentation and validation.
365
+ */
366
+ export function getAvailableIconNames(): string[] {
367
+ return Object.keys(AVAILABLE_ICONS).sort();
368
+ }
369
+
370
+ // Re-export all icons for direct import
371
+ export {
372
+ // Navigation & Layout
373
+ HomeOutlined,
374
+ DashboardOutlined,
375
+ MenuOutlined,
376
+ AppstoreOutlined,
377
+ LayoutOutlined,
378
+ SettingOutlined,
379
+ UnorderedListOutlined,
380
+ OrderedListOutlined,
381
+
382
+ // Actions & Controls
383
+ PlayCircleOutlined,
384
+ PauseCircleOutlined,
385
+ StopOutlined,
386
+ ReloadOutlined,
387
+ SyncOutlined,
388
+ PlusOutlined,
389
+ MinusOutlined,
390
+ CloseOutlined,
391
+ CheckOutlined,
392
+ EditOutlined,
393
+ DeleteOutlined,
394
+ SaveOutlined,
395
+ DownloadOutlined,
396
+ UploadOutlined,
397
+ ExportOutlined,
398
+ ImportOutlined,
399
+ CopyOutlined,
400
+ SearchOutlined,
401
+ FilterOutlined,
402
+ ArrowUpOutlined,
403
+ ArrowDownOutlined,
404
+ ArrowLeftOutlined,
405
+ ArrowRightOutlined,
406
+
407
+ // Status & Alerts
408
+ CheckCircleOutlined,
409
+ CloseCircleOutlined,
410
+ ExclamationCircleOutlined,
411
+ InfoCircleOutlined,
412
+ WarningOutlined,
413
+ QuestionCircleOutlined,
414
+ LoadingOutlined,
415
+
416
+ // Files & Folders
417
+ FileOutlined,
418
+ FileTextOutlined,
419
+ FileImageOutlined,
420
+ FilePdfOutlined,
421
+ FileWordOutlined,
422
+ FileExcelOutlined,
423
+ FolderOutlined,
424
+ FolderOpenOutlined,
425
+
426
+ // Development & Code
427
+ CodeOutlined,
428
+ BugOutlined,
429
+ ApiOutlined,
430
+ ConsoleSqlOutlined,
431
+ FunctionOutlined,
432
+ DeploymentUnitOutlined,
433
+ BranchesOutlined,
434
+
435
+ // Git & Version Control
436
+ GithubOutlined,
437
+ GitlabOutlined,
438
+ PullRequestOutlined,
439
+ MergeCellsOutlined,
440
+
441
+ // Data & Analytics
442
+ DatabaseOutlined,
443
+ TableOutlined,
444
+ BarChartOutlined,
445
+ LineChartOutlined,
446
+ PieChartOutlined,
447
+ AreaChartOutlined,
448
+ DotChartOutlined,
449
+
450
+ // Communication
451
+ MailOutlined,
452
+ MessageOutlined,
453
+ CommentOutlined,
454
+ NotificationOutlined,
455
+ BellOutlined,
456
+
457
+ // Users & Teams
458
+ UserOutlined,
459
+ TeamOutlined,
460
+ UsergroupAddOutlined,
461
+ ContactsOutlined,
462
+
463
+ // Time & Calendar
464
+ ClockCircleOutlined,
465
+ CalendarOutlined,
466
+ HistoryOutlined,
467
+ FieldTimeOutlined,
468
+
469
+ // Media & Visual
470
+ PictureOutlined,
471
+ CameraOutlined,
472
+ VideoCameraOutlined,
473
+ EyeOutlined,
474
+ EyeInvisibleOutlined,
475
+
476
+ // Network & Cloud
477
+ CloudOutlined,
478
+ CloudDownloadOutlined,
479
+ CloudUploadOutlined,
480
+ GlobalOutlined,
481
+ WifiOutlined,
482
+
483
+ // Security
484
+ LockOutlined,
485
+ UnlockOutlined,
486
+ SafetyOutlined,
487
+ SafetyCertificateOutlined,
488
+ KeyOutlined,
489
+
490
+ // Tools & Utilities
491
+ ToolOutlined,
492
+ BuildOutlined,
493
+ ExperimentOutlined,
494
+ RocketOutlined,
495
+ RobotOutlined,
496
+ ThunderboltOutlined,
497
+ FireOutlined,
498
+ BulbOutlined,
499
+
500
+ // Misc
501
+ StarOutlined,
502
+ HeartOutlined,
503
+ TrophyOutlined,
504
+ GiftOutlined,
505
+ AimOutlined,
506
+ FlagOutlined,
507
+ TagOutlined,
508
+ BookOutlined,
509
+ };
@@ -0,0 +1,25 @@
1
+ // Theme & Config
2
+ export { KBConfigProvider, useKBTheme, type ThemeMode, type KBConfigProviderProps } from './kb-config-provider';
3
+ export { ThemeTransitionOverlay, type ThemeTransitionOverlayProps } from './theme-transition-overlay';
4
+ export { KBThemeToggle } from './kb-theme-toggle';
5
+
6
+ // Layout Components
7
+ export { KBHeader, type KBHeaderProps } from './kb-header';
8
+ export { KBSidebar, type KBSidebarProps, type NavigationItem } from './kb-sidebar';
9
+ export { KBPageLayout, type KBPageLayoutProps } from './kb-page-layout';
10
+
11
+ // Status & Notification Components
12
+ export { KBStatusBar, StatusBarItem, StatusBarPresets, type KBStatusBarProps, type StatusBarItemProps } from './kb-status-bar';
13
+ export { KBSystemHealthIndicator, type KBSystemHealthIndicatorProps, type SystemHealthData } from './kb-system-health-indicator';
14
+ export { KBNotificationBell, type KBNotificationBellProps, type LogNotification } from './kb-notification-bell';
15
+
16
+ // Search & UI Components
17
+ export { KBQuickSearch, type KBQuickSearchProps, type SearchableItem } from './kb-quick-search';
18
+
19
+ // Page & Section Components
20
+ export { KBStatCard, type KBStatCardProps } from './kb-stat-card';
21
+ export { KBStatGrid, type KBStatGridProps } from './kb-stat-grid';
22
+
23
+ // Icons & Utils
24
+ export * from './icons';
25
+ export { cn } from './utils';
@@ -0,0 +1,130 @@
1
+ import * as React from 'react';
2
+ import { ConfigProvider } from 'antd';
3
+ import type { ConfigProviderProps, ThemeConfig } from 'antd';
4
+ import { getAntDesignTokens, getAntDesignComponents } from '@kb-labs/studio-hooks';
5
+ import { ThemeTransitionOverlay } from './theme-transition-overlay';
6
+
7
+ export type ThemeMode = 'light' | 'dark' | 'auto';
8
+
9
+ export interface KBConfigProviderProps extends Omit<ConfigProviderProps, 'theme'> {
10
+ defaultTheme?: ThemeMode;
11
+ storageKey?: string;
12
+ children: React.ReactNode;
13
+ }
14
+
15
+ const KBConfigProviderContext = React.createContext<{
16
+ theme: ThemeMode;
17
+ setTheme: (theme: ThemeMode) => void;
18
+ }>({
19
+ theme: 'light',
20
+ setTheme: () => {},
21
+ });
22
+
23
+ export function KBConfigProvider({
24
+ defaultTheme = 'light',
25
+ storageKey = 'studio-ui-theme',
26
+ children,
27
+ ...configProps
28
+ }: KBConfigProviderProps) {
29
+ // Get initial theme
30
+ const getInitialTheme = (): ThemeMode => {
31
+ if (typeof window === 'undefined') {return defaultTheme;}
32
+ const stored = localStorage.getItem(storageKey) as ThemeMode;
33
+ return stored || defaultTheme;
34
+ };
35
+
36
+ const [theme, setThemeState] = React.useState<ThemeMode>(getInitialTheme);
37
+ const [showOverlay, setShowOverlay] = React.useState(false);
38
+ const [overlayTheme, setOverlayTheme] = React.useState<ThemeMode>(theme);
39
+ const [isInitialMount, setIsInitialMount] = React.useState(true);
40
+
41
+ // Get actual theme for tokens (auto -> system preference)
42
+ const actualTheme = React.useMemo(() => {
43
+ if (typeof window === 'undefined') {return theme === 'auto' ? 'light' : theme;}
44
+ return theme === 'auto'
45
+ ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
46
+ : theme;
47
+ }, [theme]);
48
+
49
+ // Apply theme class SYNCHRONOUSLY on mount and theme change
50
+ // This ensures CSS variables are correct before tokens are computed
51
+ React.useLayoutEffect(() => {
52
+ if (typeof window === 'undefined') {return;}
53
+
54
+ const root = document.documentElement;
55
+ root.classList.remove('light', 'dark');
56
+ root.classList.add(actualTheme);
57
+ root.setAttribute('data-theme', actualTheme);
58
+ }, [actualTheme]);
59
+
60
+ // Store theme in localStorage (non-blocking)
61
+ React.useEffect(() => {
62
+ if (typeof window === 'undefined') {return;}
63
+ localStorage.setItem(storageKey, theme);
64
+ }, [theme, storageKey]);
65
+
66
+ // Mark initial mount as complete after first render
67
+ React.useEffect(() => {
68
+ setIsInitialMount(false);
69
+ }, []);
70
+
71
+ const setTheme = React.useCallback((newTheme: ThemeMode) => {
72
+ // Skip overlay on initial mount
73
+ if (isInitialMount) {
74
+ setThemeState(newTheme);
75
+ return;
76
+ }
77
+
78
+ // Show overlay with new theme label
79
+ setOverlayTheme(newTheme);
80
+ setShowOverlay(true);
81
+
82
+ // Wait for overlay to slide down (300ms)
83
+ setTimeout(() => {
84
+ // Change theme while overlay covers the screen
85
+ setThemeState(newTheme);
86
+
87
+ // Hold overlay to let color transition finish (150ms transition + 100ms buffer)
88
+ setTimeout(() => {
89
+ // Slide overlay back up
90
+ setShowOverlay(false);
91
+ }, 250);
92
+ }, 300);
93
+ }, [isInitialMount]);
94
+
95
+ // Tokens now use CSS variables via var() - no need to recompute
96
+ const tokens = React.useMemo(() => getAntDesignTokens(), []);
97
+ const components = React.useMemo(() => getAntDesignComponents(), []);
98
+ // Don't use algorithm - it would invert colors again
99
+ // CSS variables already handle theme switching via .light/.dark classes
100
+ // const algorithm = React.useMemo(() => getThemeAlgorithm(theme), [theme]);
101
+
102
+ const value = React.useMemo(() => ({ theme, setTheme }), [theme, setTheme]);
103
+
104
+ const themeConfig: ThemeConfig = React.useMemo(
105
+ () => ({
106
+ token: tokens,
107
+ components: components,
108
+ // algorithm: algorithm, // Disabled - CSS variables handle theme
109
+ }),
110
+ [tokens, components]
111
+ );
112
+
113
+ return (
114
+ <KBConfigProviderContext.Provider value={value}>
115
+ <ConfigProvider theme={themeConfig} {...configProps}>
116
+ {children}
117
+ <ThemeTransitionOverlay show={showOverlay} theme={overlayTheme} />
118
+ </ConfigProvider>
119
+ </KBConfigProviderContext.Provider>
120
+ );
121
+ }
122
+
123
+ export function useKBTheme() {
124
+ const context = React.useContext(KBConfigProviderContext);
125
+ if (context === undefined) {
126
+ throw new Error('useKBTheme must be used within KBConfigProvider');
127
+ }
128
+ return context;
129
+ }
130
+
@@ -0,0 +1,51 @@
1
+ .header {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ padding: 0 16px;
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ z-index: var(--z-header);
11
+ height: 64px;
12
+ background-color: var(--bg-secondary);
13
+ color: var(--text-primary);
14
+ border-bottom: none;
15
+ box-shadow: 0 1px 0 var(--border-primary), 0 2px 8px rgba(0, 0, 0, 0.04);
16
+ transition: padding-left 0.2s;
17
+ }
18
+
19
+ .logo {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 8px;
23
+ font-size: 18px;
24
+ font-weight: bold;
25
+ color: var(--text-primary);
26
+ text-decoration: none;
27
+ }
28
+
29
+ .actions {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 4px;
33
+ }
34
+
35
+ .actionBtn {
36
+ height: 32px !important;
37
+ display: flex !important;
38
+ align-items: center !important;
39
+ }
40
+
41
+ .userBtn {
42
+ height: 32px !important;
43
+ display: flex !important;
44
+ align-items: center !important;
45
+ gap: 6px !important;
46
+ padding: 0 8px !important;
47
+ }
48
+
49
+ .userName {
50
+ font-size: 13px;
51
+ }