@kb-labs/studio-app 0.7.0 → 2.9.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 (175) hide show
  1. package/dist/index.html +1 -0
  2. package/dist/main.80b70197.css +2 -0
  3. package/dist/main.80b70197.css.map +1 -0
  4. package/dist/main.ad42ef4a.js +522 -0
  5. package/dist/main.ad42ef4a.js.map +1 -0
  6. package/dist/mf-manifest.json +241 -0
  7. package/dist/mf-stats.json +271 -0
  8. package/package.json +56 -39
  9. package/server.js +68 -0
  10. package/.env.example +0 -10
  11. package/UI-KIT-COMPONENTS.md +0 -783
  12. package/UI-KIT-PLAN.md +0 -326
  13. package/eslint-rules/no-direct-antd-import.js +0 -151
  14. package/eslint.config.ts +0 -27
  15. package/index.html +0 -17
  16. package/postcss.config.js +0 -7
  17. package/public/favicon.ico +0 -0
  18. package/rspack.config.mjs +0 -118
  19. package/src/App.tsx +0 -46
  20. package/src/components/devtools/devtools-log-feed.module.css +0 -165
  21. package/src/components/devtools/devtools-log-feed.tsx +0 -300
  22. package/src/components/devtools/devtools-panel.module.css +0 -121
  23. package/src/components/devtools/devtools-panel.tsx +0 -115
  24. package/src/components/empty-state.tsx +0 -28
  25. package/src/components/error-boundary.tsx +0 -210
  26. package/src/components/health-banner.module.css +0 -103
  27. package/src/components/health-banner.tsx +0 -134
  28. package/src/components/health-indicator.tsx +0 -12
  29. package/src/components/page-header.tsx +0 -49
  30. package/src/components/page-transition.tsx +0 -24
  31. package/src/components/role-switcher.tsx +0 -148
  32. package/src/components/run-badge.tsx +0 -13
  33. package/src/components/ui/icons.tsx +0 -509
  34. package/src/components/ui/index.ts +0 -25
  35. package/src/components/ui/kb-config-provider.tsx +0 -130
  36. package/src/components/ui/kb-header.module.css +0 -51
  37. package/src/components/ui/kb-header.tsx +0 -112
  38. package/src/components/ui/kb-notification-bell.module.css +0 -103
  39. package/src/components/ui/kb-notification-bell.tsx +0 -199
  40. package/src/components/ui/kb-page-layout.tsx +0 -66
  41. package/src/components/ui/kb-quick-search.module.css +0 -86
  42. package/src/components/ui/kb-quick-search.tsx +0 -196
  43. package/src/components/ui/kb-sidebar.module.css +0 -47
  44. package/src/components/ui/kb-sidebar.tsx +0 -196
  45. package/src/components/ui/kb-stat-card.module.css +0 -21
  46. package/src/components/ui/kb-stat-card.tsx +0 -22
  47. package/src/components/ui/kb-stat-grid.tsx +0 -22
  48. package/src/components/ui/kb-status-bar.module.css +0 -49
  49. package/src/components/ui/kb-status-bar.tsx +0 -145
  50. package/src/components/ui/kb-system-health-indicator.tsx +0 -229
  51. package/src/components/ui/kb-theme-toggle.tsx +0 -42
  52. package/src/components/ui/theme-adapter.ts +0 -812
  53. package/src/components/ui/theme-transition-overlay.tsx +0 -70
  54. package/src/components/ui/utils.ts +0 -6
  55. package/src/components/widget-error-boundary.tsx +0 -172
  56. package/src/config/env.ts +0 -5
  57. package/src/config/feature-flags.ts +0 -482
  58. package/src/config/studio.config.schema.ts +0 -88
  59. package/src/config/studio.config.ts +0 -84
  60. package/src/env.d.ts +0 -23
  61. package/src/hooks/use-command-palette.ts +0 -6
  62. package/src/hooks/use-devtools-store.ts +0 -25
  63. package/src/hooks/use-feature-flags.ts +0 -101
  64. package/src/index.css +0 -10
  65. package/src/layouts/dashboard-grid.tsx +0 -122
  66. package/src/layouts/index.ts +0 -12
  67. package/src/layouts/two-pane.tsx +0 -134
  68. package/src/main.tsx +0 -15
  69. package/src/modules/analytics/components/analytics-daily-stats-chart.tsx +0 -257
  70. package/src/modules/analytics/components/analytics-date-range-picker.tsx +0 -121
  71. package/src/modules/analytics/pages/analytics-cache-page.tsx +0 -285
  72. package/src/modules/analytics/pages/analytics-embeddings-page.tsx +0 -274
  73. package/src/modules/analytics/pages/analytics-events-page.tsx +0 -425
  74. package/src/modules/analytics/pages/analytics-llm-page.tsx +0 -434
  75. package/src/modules/analytics/pages/analytics-overview-page.tsx +0 -336
  76. package/src/modules/analytics/pages/analytics-page.tsx +0 -20
  77. package/src/modules/analytics/pages/analytics-storage-page.tsx +0 -344
  78. package/src/modules/analytics/pages/analytics-vectorstore-page.tsx +0 -279
  79. package/src/modules/analytics/routes/index.tsx +0 -133
  80. package/src/modules/analytics/utils/formatters.test.ts +0 -148
  81. package/src/modules/analytics/utils/formatters.ts +0 -100
  82. package/src/modules/auth/pages/login-page.module.css +0 -113
  83. package/src/modules/auth/pages/login-page.tsx +0 -80
  84. package/src/modules/auth/routes/index.tsx +0 -24
  85. package/src/modules/dashboard/components/ActivityTimelineWidget.tsx +0 -199
  86. package/src/modules/dashboard/components/AiInsightsWidget.tsx +0 -358
  87. package/src/modules/dashboard/components/AnimatedMetricCard.css +0 -88
  88. package/src/modules/dashboard/components/AnimatedMetricCard.tsx +0 -125
  89. package/src/modules/dashboard/components/HeroMetricCard.css +0 -114
  90. package/src/modules/dashboard/components/HeroMetricCard.tsx +0 -152
  91. package/src/modules/dashboard/components/HeroMetricsWidget.tsx +0 -146
  92. package/src/modules/dashboard/components/SystemResourcesWidget.tsx +0 -197
  93. package/src/modules/dashboard/components/dashboard-empty.tsx +0 -22
  94. package/src/modules/dashboard/components/dashboard-kpis-widget.tsx +0 -59
  95. package/src/modules/dashboard/components/dashboard-kpis.tsx +0 -13
  96. package/src/modules/dashboard/components/dashboard-latency-percentiles-widget.tsx +0 -85
  97. package/src/modules/dashboard/components/dashboard-metrics-widget.tsx +0 -78
  98. package/src/modules/dashboard/components/dashboard-plugins-widget.tsx +0 -67
  99. package/src/modules/dashboard/components/dashboard-requests-widget.tsx +0 -62
  100. package/src/modules/dashboard/layouts/dashboard-layout.tsx +0 -16
  101. package/src/modules/dashboard/pages/ai-insights-page.tsx +0 -563
  102. package/src/modules/dashboard/pages/dashboard-animations.css +0 -317
  103. package/src/modules/dashboard/pages/dashboard-page.tsx +0 -13
  104. package/src/modules/dashboard/routes/index.tsx +0 -70
  105. package/src/modules/observability/pages/devkit-page.tsx +0 -263
  106. package/src/modules/observability/pages/incident-detail-page.tsx +0 -571
  107. package/src/modules/observability/pages/incidents-page.tsx +0 -370
  108. package/src/modules/observability/pages/log-detail-page.tsx +0 -508
  109. package/src/modules/observability/pages/logs-page.tsx +0 -1129
  110. package/src/modules/observability/pages/prometheus-metrics-page.tsx +0 -486
  111. package/src/modules/observability/pages/state-broker-page.tsx +0 -229
  112. package/src/modules/observability/pages/system-events-page.tsx +0 -255
  113. package/src/modules/observability/routes/index.tsx +0 -133
  114. package/src/modules/plugins/components/marketplace-card.tsx +0 -153
  115. package/src/modules/plugins/components/plugin-ai-assistant-modal.tsx +0 -374
  116. package/src/modules/plugins/components/plugin-card.tsx +0 -136
  117. package/src/modules/plugins/components/plugin-detail/capabilities-summary.tsx +0 -101
  118. package/src/modules/plugins/components/plugin-detail/cli-commands-table.tsx +0 -101
  119. package/src/modules/plugins/components/plugin-detail/index.ts +0 -7
  120. package/src/modules/plugins/components/plugin-detail/jobs-table.tsx +0 -64
  121. package/src/modules/plugins/components/plugin-detail/permissions/env-permissions.tsx +0 -30
  122. package/src/modules/plugins/components/plugin-detail/permissions/filesystem-permissions.tsx +0 -68
  123. package/src/modules/plugins/components/plugin-detail/permissions/index.ts +0 -6
  124. package/src/modules/plugins/components/plugin-detail/permissions/network-permissions.tsx +0 -43
  125. package/src/modules/plugins/components/plugin-detail/permissions/platform-services.tsx +0 -242
  126. package/src/modules/plugins/components/plugin-detail/permissions/resource-quotas.tsx +0 -96
  127. package/src/modules/plugins/components/plugin-detail/permissions/shell-permissions.tsx +0 -55
  128. package/src/modules/plugins/components/plugin-detail/permissions-view.tsx +0 -47
  129. package/src/modules/plugins/components/plugin-detail/plugin-header.tsx +0 -169
  130. package/src/modules/plugins/components/plugin-detail/rest-routes-table.tsx +0 -159
  131. package/src/modules/plugins/components/plugin-detail/workflows-table.tsx +0 -40
  132. package/src/modules/plugins/components/plugin-grid.tsx +0 -20
  133. package/src/modules/plugins/components/plugin-table.tsx +0 -178
  134. package/src/modules/plugins/pages/marketplace-page.tsx +0 -200
  135. package/src/modules/plugins/pages/plugin-detail-page.tsx +0 -1145
  136. package/src/modules/plugins/routes/index.tsx +0 -48
  137. package/src/modules/plugins/utils/index.ts +0 -1
  138. package/src/modules/plugins/utils/schema-helpers.ts +0 -21
  139. package/src/modules/settings/components/api-routes-viewer.tsx +0 -415
  140. package/src/modules/settings/components/appearance-settings.tsx +0 -200
  141. package/src/modules/settings/components/configuration-settings.tsx +0 -321
  142. package/src/modules/settings/components/data-privacy-settings.tsx +0 -111
  143. package/src/modules/settings/components/experimental-settings.tsx +0 -243
  144. package/src/modules/settings/components/navigation-settings.tsx +0 -198
  145. package/src/modules/settings/components/notifications-settings.tsx +0 -40
  146. package/src/modules/settings/pages/settings-page.tsx +0 -298
  147. package/src/modules/settings/routes/index.tsx +0 -47
  148. package/src/pages/README-assistant.md +0 -91
  149. package/src/pages/login-page.tsx +0 -177
  150. package/src/pages/not-found-page.tsx +0 -85
  151. package/src/providers/auth-provider.tsx +0 -40
  152. package/src/providers/command-palette-provider.tsx +0 -193
  153. package/src/providers/data-sources-provider.tsx +0 -27
  154. package/src/providers/devtools-provider.tsx +0 -72
  155. package/src/providers/navigation-items-provider.tsx +0 -38
  156. package/src/providers/registry-v2-provider.tsx +0 -93
  157. package/src/providers/settings-provider.tsx +0 -158
  158. package/src/router.tsx +0 -302
  159. package/src/routes/helpers.tsx +0 -25
  160. package/src/routes/plugin-page-v2.tsx +0 -52
  161. package/src/routes/types.ts +0 -18
  162. package/src/styles/antd-overrides.css +0 -211
  163. package/src/styles/base.css +0 -190
  164. package/src/styles/settings.css +0 -75
  165. package/src/styles/variables.css +0 -94
  166. package/src/utils/analytics.ts +0 -183
  167. package/src/utils/apply-navigation-categories.ts +0 -83
  168. package/src/utils/commands.ts +0 -252
  169. package/src/utils/export.ts +0 -174
  170. package/src/utils/format-date.ts +0 -166
  171. package/src/utils/logger.ts +0 -110
  172. package/tailwind.config.ts +0 -13
  173. package/tsconfig.json +0 -13
  174. package/vitest-setup.ts +0 -1
  175. /package/{public → dist}/favicon.svg +0 -0
@@ -1,783 +0,0 @@
1
- # KB Labs Studio UI Kit - Component List
2
-
3
- ## 🎯 Required Components (User-Specified)
4
-
5
- ### Core Components
6
-
7
- 1. **UICard** - Card container with header/footer
8
- 2. **UITitle** - Page/section titles with hierarchy
9
- 3. **UIPage** - Page layout wrapper with consistent structure
10
- 4. **UIBadge** - Status indicators and labels
11
- 5. **UITable** - Data table with sorting/filtering
12
- 6. **UIButton** - Action buttons with variants
13
- 7. **UITabs** - Tab navigation
14
- 8. **UIMarkdownViewer** - Markdown content renderer
15
- 9. **UIModal** - Modal dialogs
16
- 10. **UIHeader** - Page header (title + description + breadcrumbs)
17
- 11. **UIText** - Typography component
18
-
19
- ### Form Components
20
-
21
- 12. **UIInput** - Text input
22
- 13. **UISelect** - Dropdown select
23
- 14. **UICheckbox** - Checkbox input
24
- 15. **UICheckboxGroup** - Checkbox group
25
- 16. **UISwitch** - Toggle switch
26
- 17. **UIDatePicker** - Date/time picker
27
- 18. **UIForm** - Form wrapper with validation
28
-
29
- ## 📊 Additional Components (Based on Current Usage)
30
-
31
- ### Layout & Structure
32
-
33
- 19. **UIStack** - Vertical/horizontal spacing layout
34
- 20. **UIFlex** - Flexbox layout primitive
35
- 21. **UIBox** - Box model primitive with spacing
36
- 22. **UIGrid** - Grid layout (Row/Col wrapper)
37
- 23. **UISpacer** - Spacing component
38
- 24. **UIDivider** - Section divider
39
-
40
- ### Display & Feedback
41
-
42
- 25. **UIMetricCard** - Metric display with trend ✅ (exists)
43
- 26. **UIAlert** - Alert/notification messages
44
- 27. **UIEmptyState** - Empty state placeholder
45
- 28. **UIErrorState** - Error display
46
- 29. **UISkeleton** - Loading skeleton
47
- 30. **UITag** - Label/category tag
48
- 31. **UITooltip** - Tooltip overlay
49
-
50
- ### Navigation
51
-
52
- 32. **UIBreadcrumb** - Breadcrumb navigation
53
- 33. **UIMenu** - Navigation menu
54
- 34. **UIStepper** - Step indicator
55
-
56
- ### Data Display
57
-
58
- 35. **UITimeline** - Timeline component
59
- 36. **UIList** - List component
60
- 37. **UICollapse** - Collapsible sections
61
- 38. **UITree** - Tree view
62
-
63
- ## 🏗️ Component Implementation Plan
64
-
65
- ### Phase 1: Primitives & Utilities ✅ (Complete)
66
- - ✅ UIBox (Box.tsx) - spacing primitive
67
- - ✅ UIFlex (Flex.tsx) - flexbox primitive
68
- - ✅ UIText (Text.tsx) - typography primitive
69
-
70
- ### Phase 2: Core UI Components (Priority 1)
71
-
72
- #### 2.1 UICard
73
- ```typescript
74
- // apps/studio/src/ui/UICard.tsx
75
- export interface UICardProps {
76
- title?: string;
77
- subtitle?: string;
78
- extra?: React.ReactNode;
79
- footer?: React.ReactNode;
80
- bordered?: boolean;
81
- hoverable?: boolean;
82
- loading?: boolean;
83
- size?: 'small' | 'default';
84
- children: React.ReactNode;
85
- }
86
-
87
- export function UICard({ title, subtitle, extra, footer, bordered, hoverable, loading, size, children }: UICardProps) {
88
- const { token } = useToken();
89
-
90
- return (
91
- <Card size={size} bordered={bordered} hoverable={hoverable} loading={loading}>
92
- {(title || extra) && (
93
- <Box mb={3}>
94
- <Flex justify="between" align="center">
95
- {title && (
96
- <Box>
97
- <Text size="lg" weight="semibold" as="div">{title}</Text>
98
- {subtitle && <Text size="sm" color="secondary">{subtitle}</Text>}
99
- </Box>
100
- )}
101
- {extra}
102
- </Flex>
103
- </Box>
104
- )}
105
- <Box>{children}</Box>
106
- {footer && (
107
- <Box mt={3} pt={3} style={{ borderTop: `1px solid ${token.colorBorder}` }}>
108
- {footer}
109
- </Box>
110
- )}
111
- </Card>
112
- );
113
- }
114
- ```
115
-
116
- #### 2.2 UITitle
117
- ```typescript
118
- // apps/studio/src/ui/UITitle.tsx
119
- export type UITitleLevel = 1 | 2 | 3 | 4 | 5;
120
-
121
- export interface UITitleProps {
122
- level?: UITitleLevel;
123
- children: React.ReactNode;
124
- subtitle?: string;
125
- className?: string;
126
- }
127
-
128
- export function UITitle({ level = 1, children, subtitle, className }: UITitleProps) {
129
- return (
130
- <Box mb={subtitle ? 2 : 3}>
131
- <AntTitle level={level} className={className} style={{ margin: 0 }}>
132
- {children}
133
- </AntTitle>
134
- {subtitle && (
135
- <Text size="base" color="secondary" as="div" style={{ marginTop: spacing[1] }}>
136
- {subtitle}
137
- </Text>
138
- )}
139
- </Box>
140
- );
141
- }
142
- ```
143
-
144
- #### 2.3 UIPage
145
- ```typescript
146
- // apps/studio/src/ui/UIPage.tsx
147
- export interface UIPageProps {
148
- title?: string;
149
- description?: string;
150
- breadcrumbs?: { label: string; href?: string }[];
151
- extra?: React.ReactNode;
152
- children: React.ReactNode;
153
- maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
154
- }
155
-
156
- export function UIPage({ title, description, breadcrumbs, extra, children, maxWidth = 'xl' }: UIPageProps) {
157
- const maxWidthMap = {
158
- sm: '640px',
159
- md: '768px',
160
- lg: '1024px',
161
- xl: '1280px',
162
- full: '100%',
163
- };
164
-
165
- return (
166
- <Box p={6} style={{ maxWidth: maxWidthMap[maxWidth], margin: '0 auto' }}>
167
- {breadcrumbs && <UIBreadcrumb items={breadcrumbs} />}
168
- {(title || description || extra) && (
169
- <UIHeader title={title} description={description} extra={extra} />
170
- )}
171
- <Box mt={6}>{children}</Box>
172
- </Box>
173
- );
174
- }
175
- ```
176
-
177
- #### 2.4 UIHeader
178
- ```typescript
179
- // apps/studio/src/ui/UIHeader.tsx
180
- export interface UIHeaderProps {
181
- title?: string;
182
- description?: string;
183
- extra?: React.ReactNode;
184
- }
185
-
186
- export function UIHeader({ title, description, extra }: UIHeaderProps) {
187
- return (
188
- <Box mb={6}>
189
- <Flex justify="between" align="start" gap={4}>
190
- <Box>
191
- {title && <UITitle level={1}>{title}</UITitle>}
192
- {description && (
193
- <Text size="base" color="secondary" as="div" style={{ marginTop: spacing[2] }}>
194
- {description}
195
- </Text>
196
- )}
197
- </Box>
198
- {extra && <Box>{extra}</Box>}
199
- </Flex>
200
- </Box>
201
- );
202
- }
203
- ```
204
-
205
- #### 2.5 UIBadge
206
- ```typescript
207
- // apps/studio/src/ui/UIBadge.tsx (already exists, enhance)
208
- export type UIBadgeVariant = 'success' | 'warning' | 'error' | 'info' | 'default';
209
-
210
- export interface UIBadgeProps {
211
- variant?: UIBadgeVariant;
212
- children?: React.ReactNode;
213
- count?: number;
214
- dot?: boolean;
215
- }
216
-
217
- export function UIBadge({ variant = 'default', children, count, dot }: UIBadgeProps) {
218
- const { token } = useToken();
219
-
220
- const colorMap: Record<UIBadgeVariant, string> = {
221
- success: token.colorSuccess,
222
- warning: token.colorWarning,
223
- error: token.colorError,
224
- info: token.colorInfo,
225
- default: token.colorTextSecondary,
226
- };
227
-
228
- if (count !== undefined || dot) {
229
- return <AntBadge count={count} dot={dot} color={colorMap[variant]}>{children}</AntBadge>;
230
- }
231
-
232
- if (children) {
233
- return <AntBadge color={colorMap[variant]} text={children} />;
234
- }
235
-
236
- return <AntBadge status={statusMap[variant]} />;
237
- }
238
- ```
239
-
240
- #### 2.6 UIButton
241
- ```typescript
242
- // apps/studio/src/ui/UIButton.tsx
243
- export type UIButtonVariant = 'primary' | 'default' | 'dashed' | 'text' | 'link';
244
- export type UIButtonSize = 'small' | 'middle' | 'large';
245
- export type UIButtonType = 'default' | 'danger';
246
-
247
- export interface UIButtonProps {
248
- variant?: UIButtonVariant;
249
- size?: UIButtonSize;
250
- danger?: boolean;
251
- icon?: React.ReactNode;
252
- loading?: boolean;
253
- disabled?: boolean;
254
- block?: boolean;
255
- onClick?: () => void;
256
- children?: React.ReactNode;
257
- }
258
-
259
- export function UIButton({ variant = 'default', size = 'middle', danger, icon, loading, disabled, block, onClick, children }: UIButtonProps) {
260
- return (
261
- <AntButton
262
- type={variant}
263
- size={size}
264
- danger={danger}
265
- icon={icon}
266
- loading={loading}
267
- disabled={disabled}
268
- block={block}
269
- onClick={onClick}
270
- >
271
- {children}
272
- </AntButton>
273
- );
274
- }
275
- ```
276
-
277
- ### Phase 3: Data & Navigation Components (Priority 2)
278
-
279
- #### 3.1 UITable
280
- ```typescript
281
- // apps/studio/src/ui/UITable.tsx
282
- export interface UITableColumn<T> {
283
- key: string;
284
- title: string;
285
- dataIndex?: keyof T;
286
- render?: (value: any, record: T, index: number) => React.ReactNode;
287
- sorter?: boolean;
288
- width?: number | string;
289
- }
290
-
291
- export interface UITableProps<T> {
292
- columns: UITableColumn<T>[];
293
- data: T[];
294
- loading?: boolean;
295
- pagination?: boolean | PaginationProps;
296
- rowKey?: string | ((record: T) => string);
297
- onRow?: (record: T) => void;
298
- }
299
-
300
- export function UITable<T extends Record<string, any>>({ columns, data, loading, pagination, rowKey, onRow }: UITableProps<T>) {
301
- return (
302
- <AntTable
303
- columns={columns}
304
- dataSource={data}
305
- loading={loading}
306
- pagination={pagination}
307
- rowKey={rowKey}
308
- onRow={onRow ? (record) => ({ onClick: () => onRow(record) }) : undefined}
309
- />
310
- );
311
- }
312
- ```
313
-
314
- #### 3.2 UITabs
315
- ```typescript
316
- // apps/studio/src/ui/UITabs.tsx
317
- export interface UITabItem {
318
- key: string;
319
- label: string;
320
- icon?: React.ReactNode;
321
- children: React.ReactNode;
322
- disabled?: boolean;
323
- }
324
-
325
- export interface UITabsProps {
326
- items: UITabItem[];
327
- defaultActiveKey?: string;
328
- activeKey?: string;
329
- onChange?: (key: string) => void;
330
- type?: 'line' | 'card';
331
- }
332
-
333
- export function UITabs({ items, defaultActiveKey, activeKey, onChange, type = 'line' }: UITabsProps) {
334
- return (
335
- <AntTabs
336
- type={type}
337
- defaultActiveKey={defaultActiveKey}
338
- activeKey={activeKey}
339
- onChange={onChange}
340
- items={items.map(item => ({
341
- key: item.key,
342
- label: (
343
- <Flex align="center" gap={2}>
344
- {item.icon}
345
- <span>{item.label}</span>
346
- </Flex>
347
- ),
348
- children: item.children,
349
- disabled: item.disabled,
350
- }))}
351
- />
352
- );
353
- }
354
- ```
355
-
356
- #### 3.3 UIBreadcrumb
357
- ```typescript
358
- // apps/studio/src/ui/UIBreadcrumb.tsx
359
- export interface UIBreadcrumbItem {
360
- label: string;
361
- href?: string;
362
- icon?: React.ReactNode;
363
- }
364
-
365
- export interface UIBreadcrumbProps {
366
- items: UIBreadcrumbItem[];
367
- }
368
-
369
- export function UIBreadcrumb({ items }: UIBreadcrumbProps) {
370
- return (
371
- <AntBreadcrumb
372
- items={items.map(item => ({
373
- title: (
374
- <Flex align="center" gap={1}>
375
- {item.icon}
376
- <span>{item.label}</span>
377
- </Flex>
378
- ),
379
- href: item.href,
380
- }))}
381
- />
382
- );
383
- }
384
- ```
385
-
386
- #### 3.4 UIModal
387
- ```typescript
388
- // apps/studio/src/ui/UIModal.tsx
389
- export interface UIModalProps {
390
- open: boolean;
391
- title?: string;
392
- onOk?: () => void;
393
- onCancel?: () => void;
394
- okText?: string;
395
- cancelText?: string;
396
- width?: number | string;
397
- footer?: React.ReactNode | null;
398
- children: React.ReactNode;
399
- }
400
-
401
- export function UIModal({ open, title, onOk, onCancel, okText, cancelText, width, footer, children }: UIModalProps) {
402
- return (
403
- <AntModal
404
- open={open}
405
- title={title}
406
- onOk={onOk}
407
- onCancel={onCancel}
408
- okText={okText}
409
- cancelText={cancelText}
410
- width={width}
411
- footer={footer}
412
- >
413
- {children}
414
- </AntModal>
415
- );
416
- }
417
- ```
418
-
419
- ### Phase 4: Form Components (Priority 3)
420
-
421
- #### 4.1 UIForm
422
- ```typescript
423
- // apps/studio/src/ui/UIForm.tsx
424
- export interface UIFormProps {
425
- layout?: 'horizontal' | 'vertical' | 'inline';
426
- onFinish?: (values: any) => void;
427
- onFinishFailed?: (errorInfo: any) => void;
428
- initialValues?: Record<string, any>;
429
- children: React.ReactNode;
430
- }
431
-
432
- export function UIForm({ layout = 'vertical', onFinish, onFinishFailed, initialValues, children }: UIFormProps) {
433
- return (
434
- <AntForm
435
- layout={layout}
436
- onFinish={onFinish}
437
- onFinishFailed={onFinishFailed}
438
- initialValues={initialValues}
439
- >
440
- {children}
441
- </AntForm>
442
- );
443
- }
444
-
445
- // Export Form.Item as UIFormItem
446
- export const UIFormItem = AntForm.Item;
447
- ```
448
-
449
- #### 4.2 UIInput
450
- ```typescript
451
- // apps/studio/src/ui/UIInput.tsx
452
- export interface UIInputProps {
453
- value?: string;
454
- defaultValue?: string;
455
- placeholder?: string;
456
- disabled?: boolean;
457
- prefix?: React.ReactNode;
458
- suffix?: React.ReactNode;
459
- onChange?: (value: string) => void;
460
- onPressEnter?: () => void;
461
- }
462
-
463
- export function UIInput({ value, defaultValue, placeholder, disabled, prefix, suffix, onChange, onPressEnter }: UIInputProps) {
464
- return (
465
- <AntInput
466
- value={value}
467
- defaultValue={defaultValue}
468
- placeholder={placeholder}
469
- disabled={disabled}
470
- prefix={prefix}
471
- suffix={suffix}
472
- onChange={(e) => onChange?.(e.target.value)}
473
- onPressEnter={onPressEnter}
474
- />
475
- );
476
- }
477
-
478
- // Export variants
479
- export const UIInputPassword = AntInput.Password;
480
- export const UIInputTextArea = AntInput.TextArea;
481
- export const UIInputSearch = AntInput.Search;
482
- ```
483
-
484
- #### 4.3 UISelect
485
- ```typescript
486
- // apps/studio/src/ui/UISelect.tsx
487
- export interface UISelectOption {
488
- label: string;
489
- value: string | number;
490
- icon?: React.ReactNode;
491
- disabled?: boolean;
492
- }
493
-
494
- export interface UISelectProps {
495
- options: UISelectOption[];
496
- value?: string | number;
497
- defaultValue?: string | number;
498
- placeholder?: string;
499
- disabled?: boolean;
500
- loading?: boolean;
501
- allowClear?: boolean;
502
- showSearch?: boolean;
503
- onChange?: (value: string | number) => void;
504
- }
505
-
506
- export function UISelect({ options, value, defaultValue, placeholder, disabled, loading, allowClear, showSearch, onChange }: UISelectProps) {
507
- return (
508
- <AntSelect
509
- value={value}
510
- defaultValue={defaultValue}
511
- placeholder={placeholder}
512
- disabled={disabled}
513
- loading={loading}
514
- allowClear={allowClear}
515
- showSearch={showSearch}
516
- onChange={onChange}
517
- options={options.map(opt => ({
518
- label: opt.icon ? (
519
- <Flex align="center" gap={2}>
520
- {opt.icon}
521
- <span>{opt.label}</span>
522
- </Flex>
523
- ) : opt.label,
524
- value: opt.value,
525
- disabled: opt.disabled,
526
- }))}
527
- />
528
- );
529
- }
530
- ```
531
-
532
- #### 4.4-4.6 Other Form Components
533
- ```typescript
534
- // UICheckbox, UISwitch, UIDatePicker - similar wrappers around Ant Design components
535
- ```
536
-
537
- ### Phase 5: Display & Feedback Components (Priority 4)
538
-
539
- #### 5.1 UIMarkdownViewer
540
- ```typescript
541
- // apps/studio/src/ui/UIMarkdownViewer.tsx
542
- import ReactMarkdown from 'react-markdown';
543
- import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
544
- import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
545
-
546
- export interface UIMarkdownViewerProps {
547
- content: string;
548
- className?: string;
549
- }
550
-
551
- export function UIMarkdownViewer({ content, className }: UIMarkdownViewerProps) {
552
- const { token } = useToken();
553
-
554
- return (
555
- <Box className={className}>
556
- <ReactMarkdown
557
- components={{
558
- code({ node, inline, className, children, ...props }) {
559
- const match = /language-(\w+)/.exec(className || '');
560
- return !inline && match ? (
561
- <SyntaxHighlighter
562
- style={vscDarkPlus}
563
- language={match[1]}
564
- PreTag="div"
565
- {...props}
566
- >
567
- {String(children).replace(/\n$/, '')}
568
- </SyntaxHighlighter>
569
- ) : (
570
- <code className={className} {...props}>
571
- {children}
572
- </code>
573
- );
574
- },
575
- }}
576
- >
577
- {content}
578
- </ReactMarkdown>
579
- </Box>
580
- );
581
- }
582
- ```
583
-
584
- #### 5.2 UIAlert
585
- ```typescript
586
- // apps/studio/src/ui/UIAlert.tsx
587
- export type UIAlertType = 'success' | 'info' | 'warning' | 'error';
588
-
589
- export interface UIAlertProps {
590
- type?: UIAlertType;
591
- message: string;
592
- description?: string;
593
- closable?: boolean;
594
- onClose?: () => void;
595
- showIcon?: boolean;
596
- }
597
-
598
- export function UIAlert({ type = 'info', message, description, closable, onClose, showIcon }: UIAlertProps) {
599
- return (
600
- <AntAlert
601
- type={type}
602
- message={message}
603
- description={description}
604
- closable={closable}
605
- onClose={onClose}
606
- showIcon={showIcon}
607
- />
608
- );
609
- }
610
- ```
611
-
612
- #### 5.3 UIEmptyState
613
- ```typescript
614
- // apps/studio/src/ui/UIEmptyState.tsx
615
- export interface UIEmptyStateProps {
616
- title?: string;
617
- description?: string;
618
- icon?: React.ReactNode;
619
- action?: React.ReactNode;
620
- }
621
-
622
- export function UIEmptyState({ title, description, icon, action }: UIEmptyStateProps) {
623
- return (
624
- <Box p={8} style={{ textAlign: 'center' }}>
625
- {icon && <Box mb={3}>{icon}</Box>}
626
- {title && <Text size="lg" weight="semibold" as="div">{title}</Text>}
627
- {description && <Text size="sm" color="secondary" as="div" style={{ marginTop: spacing[2] }}>{description}</Text>}
628
- {action && <Box mt={4}>{action}</Box>}
629
- </Box>
630
- );
631
- }
632
- ```
633
-
634
- ### Phase 6: Layout & Utility Components (Priority 5)
635
-
636
- #### 6.1 UIStack
637
- ```typescript
638
- // apps/studio/src/ui/UIStack.tsx
639
- export type UIStackDirection = 'vertical' | 'horizontal';
640
- export type UIStackSpacing = SpacingValue;
641
-
642
- export interface UIStackProps {
643
- direction?: UIStackDirection;
644
- spacing?: UIStackSpacing;
645
- align?: 'start' | 'end' | 'center' | 'stretch';
646
- children: React.ReactNode;
647
- }
648
-
649
- export function UIStack({ direction = 'vertical', spacing = 2, align, children }: UIStackProps) {
650
- return (
651
- <Flex
652
- direction={direction === 'vertical' ? 'column' : 'row'}
653
- gap={spacing}
654
- align={align}
655
- >
656
- {children}
657
- </Flex>
658
- );
659
- }
660
- ```
661
-
662
- #### 6.2 UITag
663
- ```typescript
664
- // apps/studio/src/ui/UITag.tsx
665
- export type UITagVariant = 'success' | 'warning' | 'error' | 'info' | 'default' | 'neutral';
666
-
667
- export interface UITagProps {
668
- variant?: UITagVariant;
669
- children: React.ReactNode;
670
- closable?: boolean;
671
- onClose?: () => void;
672
- }
673
-
674
- export function UITag({ variant = 'default', children, closable, onClose }: UITagProps) {
675
- const { token } = useToken();
676
-
677
- const colorMap: Record<UITagVariant, string> = {
678
- success: token.colorSuccess,
679
- warning: token.colorWarning,
680
- error: token.colorError,
681
- info: token.colorInfo,
682
- default: token.colorPrimary,
683
- neutral: token.colorTextSecondary,
684
- };
685
-
686
- return <AntTag color={colorMap[variant]} closable={closable} onClose={onClose}>{children}</AntTag>;
687
- }
688
- ```
689
-
690
- ## 📦 Export Structure
691
-
692
- ```typescript
693
- // apps/studio/src/ui/index.ts
694
- // Primitives
695
- export * from './Text'; // UIText
696
- export * from './Box'; // UIBox
697
- export * from './Flex'; // UIFlex
698
-
699
- // Core Components
700
- export * from './UICard';
701
- export * from './UITitle';
702
- export * from './UIPage';
703
- export * from './UIHeader';
704
- export * from './UIBadge';
705
- export * from './UIButton';
706
-
707
- // Data & Navigation
708
- export * from './UITable';
709
- export * from './UITabs';
710
- export * from './UIBreadcrumb';
711
- export * from './UIModal';
712
-
713
- // Form Components
714
- export * from './UIForm';
715
- export * from './UIInput';
716
- export * from './UISelect';
717
- export * from './UICheckbox';
718
- export * from './UISwitch';
719
- export * from './UIDatePicker';
720
-
721
- // Display & Feedback
722
- export * from './UIMarkdownViewer';
723
- export * from './UIAlert';
724
- export * from './UIEmptyState';
725
- export * from './UIErrorState';
726
- export * from './UISkeleton';
727
- export * from './UITag';
728
-
729
- // Layout & Utility
730
- export * from './UIStack';
731
- export * from './UIDivider';
732
- export * from './UIGrid';
733
-
734
- // Complex Components
735
- export * from './MetricCard'; // UIMetricCard
736
- ```
737
-
738
- ## ✅ Implementation Checklist
739
-
740
- ### Phase 1: Primitives ✅
741
- - [x] UIText (Text.tsx)
742
- - [x] UIBox (Box.tsx)
743
- - [x] UIFlex (Flex.tsx)
744
-
745
- ### Phase 2: Core UI (Next)
746
- - [ ] UICard
747
- - [ ] UITitle
748
- - [ ] UIPage
749
- - [ ] UIHeader
750
- - [ ] UIBadge (enhance existing Badge.tsx)
751
- - [ ] UIButton
752
-
753
- ### Phase 3: Data & Navigation
754
- - [ ] UITable
755
- - [ ] UITabs
756
- - [ ] UIBreadcrumb
757
- - [ ] UIModal
758
-
759
- ### Phase 4: Form Components
760
- - [ ] UIForm + UIFormItem
761
- - [ ] UIInput (+ variants)
762
- - [ ] UISelect
763
- - [ ] UICheckbox
764
- - [ ] UISwitch
765
- - [ ] UIDatePicker
766
-
767
- ### Phase 5: Display & Feedback
768
- - [ ] UIMarkdownViewer
769
- - [ ] UIAlert
770
- - [ ] UIEmptyState
771
- - [ ] UIErrorState
772
- - [ ] UISkeleton
773
- - [ ] UITag
774
-
775
- ### Phase 6: Layout & Utility
776
- - [ ] UIStack
777
- - [ ] UIDivider
778
- - [ ] UIGrid
779
-
780
- ---
781
-
782
- **Created**: 2026-01-27
783
- **Next**: Implement Phase 2 - Core UI Components