@zhama/tego-ui 0.0.0-stage → 1.36.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 (57) hide show
  1. package/LICENSE +172 -0
  2. package/assets/styles/tokens.css +1 -0
  3. package/dist/animations-FAPO43TO.css +1 -0
  4. package/dist/chunk-4MXE2PSC.js +1 -0
  5. package/dist/chunk-6HRT65AA.cjs +1 -0
  6. package/dist/chunk-6Z2BWV6F.js +1 -0
  7. package/dist/chunk-CRTE56HI.js +1 -0
  8. package/dist/chunk-ERURJLNK.cjs +1 -0
  9. package/dist/chunk-GZXKQ2K6.cjs +1 -0
  10. package/dist/chunk-H7AHFBEU.js +1 -0
  11. package/dist/chunk-M2GCF4FZ.cjs +1 -0
  12. package/dist/chunk-MTA2XHQG.cjs +1 -0
  13. package/dist/chunk-MVPRTW7Z.js +1 -0
  14. package/dist/chunk-NA5M3B4G.js +1 -0
  15. package/dist/chunk-ON32SVTM.cjs +1 -0
  16. package/dist/chunk-OS64HXLJ.js +1 -0
  17. package/dist/chunk-QPXIAUJD.js +1 -0
  18. package/dist/chunk-RWEJPTVG.cjs +1 -0
  19. package/dist/chunk-SHFR7LZH.js +1 -0
  20. package/dist/chunk-SLTTRXOU.cjs +1 -0
  21. package/dist/chunk-ULCTAAJ2.js +1 -0
  22. package/dist/chunk-UQZZ6WIZ.cjs +1 -0
  23. package/dist/chunk-YWPIPAUQ.cjs +1 -0
  24. package/dist/command-palette.cjs +1 -0
  25. package/dist/command-palette.d.cts +44 -0
  26. package/dist/command-palette.d.ts +44 -0
  27. package/dist/command-palette.js +1 -0
  28. package/dist/config-form/index.cjs +1 -0
  29. package/dist/config-form/index.d.cts +99 -0
  30. package/dist/config-form/index.d.ts +99 -0
  31. package/dist/config-form/index.js +1 -0
  32. package/dist/design-system/index.cjs +1 -0
  33. package/dist/design-system/index.d.cts +629 -0
  34. package/dist/design-system/index.d.ts +629 -0
  35. package/dist/design-system/index.js +1 -0
  36. package/dist/editors.cjs +1 -0
  37. package/dist/editors.d.cts +68 -0
  38. package/dist/editors.d.ts +68 -0
  39. package/dist/editors.js +1 -0
  40. package/dist/highlight-IORKDKTB.css +1 -0
  41. package/dist/index.cjs +2 -0
  42. package/dist/index.d.cts +3157 -0
  43. package/dist/index.d.ts +3157 -0
  44. package/dist/index.js +2 -0
  45. package/dist/styles-447PVICJ.css +1 -0
  46. package/dist/styles-FZ7XXKJP.css +1 -0
  47. package/dist/summary-charts.cjs +1 -0
  48. package/dist/summary-charts.d.cts +45 -0
  49. package/dist/summary-charts.d.ts +45 -0
  50. package/dist/summary-charts.js +1 -0
  51. package/dist/tag-input.cjs +1 -0
  52. package/dist/tag-input.d.cts +15 -0
  53. package/dist/tag-input.d.ts +15 -0
  54. package/dist/tag-input.js +1 -0
  55. package/package.json +122 -4
  56. package/tailwind-preset.cjs +1 -0
  57. package/README.md +0 -3
@@ -0,0 +1,629 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ /**
4
+ * Design Tokens - TeGo-OS 设计系统 v2.0
5
+ *
6
+ * 设计原则:
7
+ * 1. 专业紧凑:提高信息密度,减少装饰
8
+ * 2. 视觉层次:限制在 5 种字体大小
9
+ * 3. 一致性:统一的间距、圆角、动画
10
+ */
11
+ /**
12
+ * 字体排版系统 - 紧凑版
13
+ * 整体减小一个级别,提高信息密度
14
+ */
15
+ declare const typography: {
16
+ readonly heading1: "text-lg font-semibold tracking-tight";
17
+ readonly heading2: "text-[15px] font-medium leading-tight";
18
+ readonly body: "text-sm";
19
+ readonly bodyMedium: "text-sm font-medium";
20
+ readonly bodyBold: "text-sm font-semibold";
21
+ readonly small: "text-[13px]";
22
+ readonly smallMedium: "text-[13px] font-medium";
23
+ readonly caption: "text-xs";
24
+ readonly captionMuted: "text-xs text-muted-foreground";
25
+ };
26
+ /**
27
+ * 间距系统 - 平衡版
28
+ * 适中的间距,兼顾信息密度和可读性
29
+ */
30
+ declare const spacing: {
31
+ readonly xs: {
32
+ readonly y: "space-y-1.5";
33
+ readonly x: "space-x-1.5";
34
+ readonly gap: "gap-1.5";
35
+ readonly p: "p-1.5";
36
+ readonly px: "px-2";
37
+ readonly py: "py-1.5";
38
+ readonly pt: "pt-1.5";
39
+ readonly pb: "pb-1.5";
40
+ readonly pl: "pl-1.5";
41
+ readonly pr: "pr-1.5";
42
+ readonly mx: "mx-1.5";
43
+ readonly my: "my-1.5";
44
+ readonly ml: "ml-1.5";
45
+ readonly mr: "mr-1.5";
46
+ readonly mt: "mt-1.5";
47
+ readonly mb: "mb-1.5";
48
+ readonly left: "left-1.5";
49
+ readonly right: "right-1.5";
50
+ readonly top: "top-1.5";
51
+ readonly bottom: "bottom-1.5";
52
+ };
53
+ readonly sm: {
54
+ readonly y: "space-y-3";
55
+ readonly x: "space-x-3";
56
+ readonly gap: "gap-3";
57
+ readonly p: "p-3";
58
+ readonly px: "px-3";
59
+ readonly py: "py-2";
60
+ readonly pt: "pt-3";
61
+ readonly pb: "pb-3";
62
+ readonly pl: "pl-3";
63
+ readonly pr: "pr-3";
64
+ readonly mx: "mx-3";
65
+ readonly my: "my-3";
66
+ readonly ml: "ml-3";
67
+ readonly mr: "mr-3";
68
+ readonly mt: "mt-3";
69
+ readonly mb: "mb-3";
70
+ readonly left: "left-3";
71
+ readonly right: "right-3";
72
+ readonly top: "top-3";
73
+ readonly bottom: "bottom-3";
74
+ };
75
+ readonly md: {
76
+ readonly y: "space-y-4";
77
+ readonly x: "space-x-4";
78
+ readonly gap: "gap-4";
79
+ readonly p: "p-4";
80
+ readonly px: "px-4";
81
+ readonly py: "py-3";
82
+ readonly pt: "pt-4";
83
+ readonly pb: "pb-4";
84
+ readonly pl: "pl-4";
85
+ readonly pr: "pr-4";
86
+ readonly mx: "mx-4";
87
+ readonly my: "my-4";
88
+ readonly ml: "ml-4";
89
+ readonly mr: "mr-4";
90
+ readonly mt: "mt-4";
91
+ readonly mb: "mb-4";
92
+ readonly left: "left-4";
93
+ readonly right: "right-4";
94
+ readonly top: "top-4";
95
+ readonly bottom: "bottom-4";
96
+ };
97
+ readonly lg: {
98
+ readonly y: "space-y-5";
99
+ readonly x: "space-x-5";
100
+ readonly gap: "gap-5";
101
+ readonly p: "p-5";
102
+ readonly px: "px-5";
103
+ readonly py: "py-4";
104
+ readonly pt: "pt-5";
105
+ readonly pb: "pb-5";
106
+ readonly pl: "pl-5";
107
+ readonly pr: "pr-5";
108
+ readonly mx: "mx-5";
109
+ readonly my: "my-5";
110
+ readonly ml: "ml-5";
111
+ readonly mr: "mr-5";
112
+ readonly mt: "mt-5";
113
+ readonly mb: "mb-5";
114
+ readonly left: "left-5";
115
+ readonly right: "right-5";
116
+ readonly top: "top-5";
117
+ readonly bottom: "bottom-5";
118
+ };
119
+ readonly xl: {
120
+ readonly y: "space-y-6";
121
+ readonly x: "space-x-6";
122
+ readonly gap: "gap-6";
123
+ readonly p: "p-6";
124
+ readonly px: "px-6";
125
+ readonly py: "py-5";
126
+ readonly pt: "pt-6";
127
+ readonly pb: "pb-6";
128
+ readonly pl: "pl-6";
129
+ readonly pr: "pr-6";
130
+ readonly mx: "mx-6";
131
+ readonly my: "my-6";
132
+ readonly ml: "ml-6";
133
+ readonly mr: "mr-6";
134
+ readonly mt: "mt-6";
135
+ readonly mb: "mb-6";
136
+ readonly left: "left-6";
137
+ readonly right: "right-6";
138
+ readonly top: "top-6";
139
+ readonly bottom: "bottom-6";
140
+ };
141
+ };
142
+ /**
143
+ * 圆角系统 - 更小更专业
144
+ */
145
+ declare const radius: {
146
+ readonly none: "rounded-none";
147
+ readonly sm: "rounded";
148
+ readonly md: "rounded-md";
149
+ readonly lg: "rounded-lg";
150
+ readonly full: "rounded-full";
151
+ };
152
+ /**
153
+ * 阴影系统 - 适度阴影
154
+ */
155
+ declare const shadows: {
156
+ readonly none: "";
157
+ readonly sm: "shadow";
158
+ readonly md: "shadow-md";
159
+ readonly lg: "shadow-lg";
160
+ };
161
+ /**
162
+ * 颜色语义系统
163
+ * 使用语义化的颜色名称,便于维护
164
+ */
165
+ declare const colors: {
166
+ readonly primary: "bg-primary text-primary-foreground";
167
+ readonly primaryHover: "hover:bg-primary/90";
168
+ readonly primaryMuted: "bg-primary/10 text-primary";
169
+ readonly secondary: "bg-secondary text-secondary-foreground";
170
+ readonly secondaryHover: "hover:bg-secondary/80";
171
+ readonly success: "bg-success text-success-foreground";
172
+ readonly successHover: "hover:bg-success/90";
173
+ readonly successMuted: "bg-success/10 text-success";
174
+ readonly warning: "bg-warning text-warning-foreground";
175
+ readonly warningHover: "hover:bg-warning/90";
176
+ readonly warningMuted: "bg-warning/10 text-warning";
177
+ readonly destructive: "bg-destructive text-destructive-foreground";
178
+ readonly destructiveHover: "hover:bg-destructive/90";
179
+ readonly destructiveMuted: "bg-destructive/10 text-destructive";
180
+ readonly muted: "bg-muted text-muted-foreground";
181
+ readonly mutedHover: "hover:bg-muted/80";
182
+ readonly accent: "bg-accent text-accent-foreground";
183
+ readonly accentHover: "hover:bg-accent/80";
184
+ };
185
+ /**
186
+ * 中性表层系统 - 用于 sidebar / 列表 / 面板的层级与交互态
187
+ *
188
+ * 目的:给"背景 → 浮起 → hover → selected"以及"边框 / 分隔线"一组
189
+ * 明确、克制的中性梯度,避免到处用主品牌色(浅紫)做选中/hover 背景,
190
+ * 把品牌色留给关键状态与主操作。全部基于主题 CSS 变量,自动适配深色模式。
191
+ */
192
+ declare const surfaces: {
193
+ readonly base: "bg-background";
194
+ readonly raised: "bg-muted/30";
195
+ readonly hover: "hover:bg-muted/50";
196
+ readonly selected: "bg-muted/60";
197
+ readonly border: "border-border/60";
198
+ readonly divider: "bg-border/40";
199
+ };
200
+ /**
201
+ * 聊天气泡 - 自己发出的消息(与员工的对话、工作会话共用)
202
+ */
203
+ declare const chatBubbles: {
204
+ readonly user: "border border-primary/20 bg-primary-soft text-foreground shadow-[0_10px_28px_-24px_hsl(var(--primary)/0.65)]";
205
+ };
206
+ /**
207
+ * 过渡动画 - 更快响应
208
+ */
209
+ declare const transitions: {
210
+ readonly fast: "transition-colors duration-100 ease-out";
211
+ readonly normal: "transition-all duration-150 ease-out";
212
+ readonly slow: "transition-all duration-200 ease-out";
213
+ };
214
+ /**
215
+ * 交互效果 - 简化,减少视觉噪音
216
+ */
217
+ declare const interactions: {
218
+ readonly hoverHighlight: "hover:bg-accent/50 transition-colors duration-100 ease-out";
219
+ readonly hoverShadow: "hover:shadow-sm transition-shadow duration-150 ease-out";
220
+ readonly clickable: "cursor-pointer active:scale-[0.98] active:opacity-90 transition-all duration-100 ease-out";
221
+ readonly cardHover: "hover:border-border/80 hover:shadow-sm transition-all duration-150 ease-out";
222
+ };
223
+ /**
224
+ * 布局相关
225
+ */
226
+ declare const layout: {
227
+ readonly container: "layout-responsive container-responsive";
228
+ readonly grid: {
229
+ readonly stats: "stats-grid";
230
+ readonly actions: "actions-grid";
231
+ readonly agents: "agents-grid";
232
+ readonly default: "grid-responsive";
233
+ };
234
+ readonly card: "card-responsive";
235
+ };
236
+ /**
237
+ * 状态样式
238
+ */
239
+ declare const states: {
240
+ readonly disabled: "opacity-50 cursor-not-allowed";
241
+ readonly loading: "opacity-70 cursor-wait";
242
+ readonly error: "border-destructive bg-destructive/10";
243
+ readonly success: "border-success bg-success/10";
244
+ };
245
+ /**
246
+ * 组合助手函数
247
+ * 用于快速组合多个 design tokens
248
+ */
249
+ declare function combineTokens(...tokens: string[]): string;
250
+ /**
251
+ * 响应式断点辅助
252
+ */
253
+ declare const breakpoints: {
254
+ readonly sm: "640px";
255
+ readonly md: "768px";
256
+ readonly lg: "1024px";
257
+ readonly xl: "1280px";
258
+ readonly '2xl': "1536px";
259
+ };
260
+ /**
261
+ * 常用组合样式
262
+ */
263
+ declare const presets: {
264
+ readonly pageTitle: string;
265
+ readonly sectionTitle: string;
266
+ readonly cardTitle: string;
267
+ readonly buttonPrimary: string;
268
+ readonly interactiveCard: string;
269
+ readonly input: string;
270
+ };
271
+ /**
272
+ * 导出所有 tokens
273
+ */
274
+ declare const designTokens: {
275
+ readonly typography: {
276
+ readonly heading1: "text-lg font-semibold tracking-tight";
277
+ readonly heading2: "text-[15px] font-medium leading-tight";
278
+ readonly body: "text-sm";
279
+ readonly bodyMedium: "text-sm font-medium";
280
+ readonly bodyBold: "text-sm font-semibold";
281
+ readonly small: "text-[13px]";
282
+ readonly smallMedium: "text-[13px] font-medium";
283
+ readonly caption: "text-xs";
284
+ readonly captionMuted: "text-xs text-muted-foreground";
285
+ };
286
+ readonly spacing: {
287
+ readonly xs: {
288
+ readonly y: "space-y-1.5";
289
+ readonly x: "space-x-1.5";
290
+ readonly gap: "gap-1.5";
291
+ readonly p: "p-1.5";
292
+ readonly px: "px-2";
293
+ readonly py: "py-1.5";
294
+ readonly pt: "pt-1.5";
295
+ readonly pb: "pb-1.5";
296
+ readonly pl: "pl-1.5";
297
+ readonly pr: "pr-1.5";
298
+ readonly mx: "mx-1.5";
299
+ readonly my: "my-1.5";
300
+ readonly ml: "ml-1.5";
301
+ readonly mr: "mr-1.5";
302
+ readonly mt: "mt-1.5";
303
+ readonly mb: "mb-1.5";
304
+ readonly left: "left-1.5";
305
+ readonly right: "right-1.5";
306
+ readonly top: "top-1.5";
307
+ readonly bottom: "bottom-1.5";
308
+ };
309
+ readonly sm: {
310
+ readonly y: "space-y-3";
311
+ readonly x: "space-x-3";
312
+ readonly gap: "gap-3";
313
+ readonly p: "p-3";
314
+ readonly px: "px-3";
315
+ readonly py: "py-2";
316
+ readonly pt: "pt-3";
317
+ readonly pb: "pb-3";
318
+ readonly pl: "pl-3";
319
+ readonly pr: "pr-3";
320
+ readonly mx: "mx-3";
321
+ readonly my: "my-3";
322
+ readonly ml: "ml-3";
323
+ readonly mr: "mr-3";
324
+ readonly mt: "mt-3";
325
+ readonly mb: "mb-3";
326
+ readonly left: "left-3";
327
+ readonly right: "right-3";
328
+ readonly top: "top-3";
329
+ readonly bottom: "bottom-3";
330
+ };
331
+ readonly md: {
332
+ readonly y: "space-y-4";
333
+ readonly x: "space-x-4";
334
+ readonly gap: "gap-4";
335
+ readonly p: "p-4";
336
+ readonly px: "px-4";
337
+ readonly py: "py-3";
338
+ readonly pt: "pt-4";
339
+ readonly pb: "pb-4";
340
+ readonly pl: "pl-4";
341
+ readonly pr: "pr-4";
342
+ readonly mx: "mx-4";
343
+ readonly my: "my-4";
344
+ readonly ml: "ml-4";
345
+ readonly mr: "mr-4";
346
+ readonly mt: "mt-4";
347
+ readonly mb: "mb-4";
348
+ readonly left: "left-4";
349
+ readonly right: "right-4";
350
+ readonly top: "top-4";
351
+ readonly bottom: "bottom-4";
352
+ };
353
+ readonly lg: {
354
+ readonly y: "space-y-5";
355
+ readonly x: "space-x-5";
356
+ readonly gap: "gap-5";
357
+ readonly p: "p-5";
358
+ readonly px: "px-5";
359
+ readonly py: "py-4";
360
+ readonly pt: "pt-5";
361
+ readonly pb: "pb-5";
362
+ readonly pl: "pl-5";
363
+ readonly pr: "pr-5";
364
+ readonly mx: "mx-5";
365
+ readonly my: "my-5";
366
+ readonly ml: "ml-5";
367
+ readonly mr: "mr-5";
368
+ readonly mt: "mt-5";
369
+ readonly mb: "mb-5";
370
+ readonly left: "left-5";
371
+ readonly right: "right-5";
372
+ readonly top: "top-5";
373
+ readonly bottom: "bottom-5";
374
+ };
375
+ readonly xl: {
376
+ readonly y: "space-y-6";
377
+ readonly x: "space-x-6";
378
+ readonly gap: "gap-6";
379
+ readonly p: "p-6";
380
+ readonly px: "px-6";
381
+ readonly py: "py-5";
382
+ readonly pt: "pt-6";
383
+ readonly pb: "pb-6";
384
+ readonly pl: "pl-6";
385
+ readonly pr: "pr-6";
386
+ readonly mx: "mx-6";
387
+ readonly my: "my-6";
388
+ readonly ml: "ml-6";
389
+ readonly mr: "mr-6";
390
+ readonly mt: "mt-6";
391
+ readonly mb: "mb-6";
392
+ readonly left: "left-6";
393
+ readonly right: "right-6";
394
+ readonly top: "top-6";
395
+ readonly bottom: "bottom-6";
396
+ };
397
+ };
398
+ readonly radius: {
399
+ readonly none: "rounded-none";
400
+ readonly sm: "rounded";
401
+ readonly md: "rounded-md";
402
+ readonly lg: "rounded-lg";
403
+ readonly full: "rounded-full";
404
+ };
405
+ readonly shadows: {
406
+ readonly none: "";
407
+ readonly sm: "shadow";
408
+ readonly md: "shadow-md";
409
+ readonly lg: "shadow-lg";
410
+ };
411
+ readonly colors: {
412
+ readonly primary: "bg-primary text-primary-foreground";
413
+ readonly primaryHover: "hover:bg-primary/90";
414
+ readonly primaryMuted: "bg-primary/10 text-primary";
415
+ readonly secondary: "bg-secondary text-secondary-foreground";
416
+ readonly secondaryHover: "hover:bg-secondary/80";
417
+ readonly success: "bg-success text-success-foreground";
418
+ readonly successHover: "hover:bg-success/90";
419
+ readonly successMuted: "bg-success/10 text-success";
420
+ readonly warning: "bg-warning text-warning-foreground";
421
+ readonly warningHover: "hover:bg-warning/90";
422
+ readonly warningMuted: "bg-warning/10 text-warning";
423
+ readonly destructive: "bg-destructive text-destructive-foreground";
424
+ readonly destructiveHover: "hover:bg-destructive/90";
425
+ readonly destructiveMuted: "bg-destructive/10 text-destructive";
426
+ readonly muted: "bg-muted text-muted-foreground";
427
+ readonly mutedHover: "hover:bg-muted/80";
428
+ readonly accent: "bg-accent text-accent-foreground";
429
+ readonly accentHover: "hover:bg-accent/80";
430
+ };
431
+ readonly surfaces: {
432
+ readonly base: "bg-background";
433
+ readonly raised: "bg-muted/30";
434
+ readonly hover: "hover:bg-muted/50";
435
+ readonly selected: "bg-muted/60";
436
+ readonly border: "border-border/60";
437
+ readonly divider: "bg-border/40";
438
+ };
439
+ readonly chatBubbles: {
440
+ readonly user: "border border-primary/20 bg-primary-soft text-foreground shadow-[0_10px_28px_-24px_hsl(var(--primary)/0.65)]";
441
+ };
442
+ readonly transitions: {
443
+ readonly fast: "transition-colors duration-100 ease-out";
444
+ readonly normal: "transition-all duration-150 ease-out";
445
+ readonly slow: "transition-all duration-200 ease-out";
446
+ };
447
+ readonly interactions: {
448
+ readonly hoverHighlight: "hover:bg-accent/50 transition-colors duration-100 ease-out";
449
+ readonly hoverShadow: "hover:shadow-sm transition-shadow duration-150 ease-out";
450
+ readonly clickable: "cursor-pointer active:scale-[0.98] active:opacity-90 transition-all duration-100 ease-out";
451
+ readonly cardHover: "hover:border-border/80 hover:shadow-sm transition-all duration-150 ease-out";
452
+ };
453
+ readonly layout: {
454
+ readonly container: "layout-responsive container-responsive";
455
+ readonly grid: {
456
+ readonly stats: "stats-grid";
457
+ readonly actions: "actions-grid";
458
+ readonly agents: "agents-grid";
459
+ readonly default: "grid-responsive";
460
+ };
461
+ readonly card: "card-responsive";
462
+ };
463
+ readonly states: {
464
+ readonly disabled: "opacity-50 cursor-not-allowed";
465
+ readonly loading: "opacity-70 cursor-wait";
466
+ readonly error: "border-destructive bg-destructive/10";
467
+ readonly success: "border-success bg-success/10";
468
+ };
469
+ readonly presets: {
470
+ readonly pageTitle: string;
471
+ readonly sectionTitle: string;
472
+ readonly cardTitle: string;
473
+ readonly buttonPrimary: string;
474
+ readonly interactiveCard: string;
475
+ readonly input: string;
476
+ };
477
+ readonly breakpoints: {
478
+ readonly sm: "640px";
479
+ readonly md: "768px";
480
+ readonly lg: "1024px";
481
+ readonly xl: "1280px";
482
+ readonly '2xl': "1536px";
483
+ };
484
+ };
485
+
486
+ /**
487
+ * Design System 实用工具函数
488
+ *
489
+ * 提供类型安全的设计系统辅助函数
490
+ */
491
+
492
+ /**
493
+ * 合并 Tailwind CSS 类名
494
+ * 与现有的 cn 函数保持一致
495
+ */
496
+ declare function cn(...inputs: ClassValue[]): string;
497
+ /**
498
+ * 获取响应式间距类名
499
+ * @param size 间距大小: xs, sm, md, lg, xl
500
+ * @param type 间距类型: y, x, gap, p, px, py
501
+ */
502
+ declare function getSpacing(size: keyof typeof designTokens.spacing, type: keyof (typeof designTokens.spacing)['sm']): string;
503
+ /**
504
+ * 获取字体样式类名
505
+ * @param variant 字体变体
506
+ */
507
+ declare function getTypography(variant: keyof typeof designTokens.typography): string;
508
+ /**
509
+ * 获取状态样式
510
+ * @param state 状态类型
511
+ */
512
+ declare function getStateStyle(state: keyof typeof designTokens.states): string;
513
+ /**
514
+ * 构建卡片样式
515
+ * @param options 卡片选项
516
+ */
517
+ declare function buildCardClass(options: {
518
+ interactive?: boolean;
519
+ shadow?: keyof typeof designTokens.shadows;
520
+ radius?: keyof typeof designTokens.radius;
521
+ className?: string;
522
+ }): string;
523
+ /**
524
+ * 构建按钮样式
525
+ * @param options 按钮选项
526
+ */
527
+ declare function buildButtonClass(options: {
528
+ variant?: 'primary' | 'secondary' | 'destructive' | 'ghost' | 'outline';
529
+ size?: 'sm' | 'md' | 'lg';
530
+ className?: string;
531
+ }): string;
532
+ /**
533
+ * 构建输入框样式
534
+ * @param options 输入框选项
535
+ */
536
+ declare function buildInputClass(options: {
537
+ error?: boolean;
538
+ disabled?: boolean;
539
+ className?: string;
540
+ }): string;
541
+ /**
542
+ * 构建徽章样式
543
+ * @param options 徽章选项
544
+ */
545
+ declare function buildBadgeClass(options: {
546
+ variant?: 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'outline';
547
+ className?: string;
548
+ }): string;
549
+ /**
550
+ * 构建网格布局样式
551
+ * @param type 网格类型
552
+ */
553
+ declare function buildGridClass(type: keyof typeof designTokens.layout.grid): string;
554
+ /**
555
+ * 响应式容器样式
556
+ */
557
+ declare function getContainerClass(): string;
558
+ /**
559
+ * 图标尺寸助手
560
+ */
561
+ declare const iconSizes: {
562
+ readonly xs: "h-3 w-3";
563
+ readonly sm: "h-4 w-4";
564
+ readonly md: "h-5 w-5";
565
+ readonly lg: "h-6 w-6";
566
+ readonly xl: "h-8 w-8";
567
+ readonly '2xl': "h-10 w-10";
568
+ };
569
+ /**
570
+ * 获取图标尺寸
571
+ */
572
+ declare function getIconSize(size: keyof typeof iconSizes): string;
573
+ /**
574
+ * 状态颜色映射
575
+ */
576
+ declare function getStatusColor(status: string): string;
577
+ /**
578
+ * 获取状态徽章变体
579
+ */
580
+ declare function getStatusBadgeVariant(status: string): 'default' | 'secondary' | 'success' | 'warning' | 'destructive';
581
+ /**
582
+ * 构建表格样式
583
+ */
584
+ declare function buildTableClass(options?: {
585
+ className?: string;
586
+ }): string;
587
+ /**
588
+ * 截断文本样式
589
+ */
590
+ declare const truncate: {
591
+ readonly single: "truncate";
592
+ readonly double: "line-clamp-2";
593
+ readonly triple: "line-clamp-3";
594
+ };
595
+ /**
596
+ * 获取截断样式
597
+ */
598
+ declare function getTruncateClass(lines: keyof typeof truncate): string;
599
+ /**
600
+ * 动画预设
601
+ */
602
+ declare const animations: {
603
+ readonly fadeIn: "animate-in fade-in duration-200";
604
+ readonly fadeOut: "animate-out fade-out duration-200";
605
+ readonly slideInFromRight: "animate-in slide-in-from-right duration-300";
606
+ readonly slideInFromLeft: "animate-in slide-in-from-left duration-300";
607
+ readonly slideInFromTop: "animate-in slide-in-from-top duration-300";
608
+ readonly slideInFromBottom: "animate-in slide-in-from-bottom duration-300";
609
+ readonly spin: "animate-spin";
610
+ readonly pulse: "animate-pulse";
611
+ };
612
+ /**
613
+ * 获取动画类名
614
+ */
615
+ declare function getAnimation(animation: keyof typeof animations): string;
616
+ /**
617
+ * 聚焦环样式
618
+ */
619
+ declare const focusRing = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
620
+ /**
621
+ * 构建可聚焦元素样式
622
+ */
623
+ declare function buildFocusableClass(className?: string): string;
624
+ /**
625
+ * 骨架屏样式
626
+ */
627
+ declare function buildSkeletonClass(className?: string): string;
628
+
629
+ export { animations, breakpoints, buildBadgeClass, buildButtonClass, buildCardClass, buildFocusableClass, buildGridClass, buildInputClass, buildSkeletonClass, buildTableClass, chatBubbles, cn, colors, combineTokens, designTokens, focusRing, getAnimation, getContainerClass, getIconSize, getSpacing, getStateStyle, getStatusBadgeVariant, getStatusColor, getTruncateClass, getTypography, iconSizes, interactions, layout, presets, radius, shadows, spacing, states, surfaces, transitions, truncate, typography };
@@ -0,0 +1 @@
1
+ export{animations,breakpoints,buildBadgeClass,buildButtonClass,buildCardClass,buildFocusableClass,buildGridClass,buildInputClass,buildSkeletonClass,buildTableClass,chatBubbles,cn,colors,combineTokens,designTokens,focusRing,getAnimation,getContainerClass,getIconSize,getSpacing,getStateStyle,getStatusBadgeVariant,getStatusColor,getTruncateClass,getTypography,iconSizes,interactions,layout,presets,radius,shadows,spacing,states,surfaces,transitions,truncate,typography}from"../chunk-6Z2BWV6F.js";import"../chunk-QPXIAUJD.js";
@@ -0,0 +1 @@
1
+ "use strict";var O=Object.defineProperty;var a=(e,r)=>O(e,"name",{value:r,configurable:!0});var chunkGZXKQ2K6_cjs=require("./chunk-GZXKQ2K6.cjs"),chunkM2GCF4FZ_cjs=require("./chunk-M2GCF4FZ.cjs"),chunkERURJLNK_cjs=require("./chunk-ERURJLNK.cjs"),chunkYWPIPAUQ_cjs=require("./chunk-YWPIPAUQ.cjs");require("./chunk-6HRT65AA.cjs");var ace=require("ace-builds/src-noconflict/ace"),React2=require("react"),AceEditor=require("react-ace");require("ace-builds/src-noconflict/mode-javascript"),require("ace-builds/src-noconflict/mode-typescript"),require("ace-builds/src-noconflict/mode-json"),require("ace-builds/src-noconflict/mode-json5"),require("ace-builds/src-noconflict/mode-yaml"),require("ace-builds/src-noconflict/mode-html"),require("ace-builds/src-noconflict/mode-css"),require("ace-builds/src-noconflict/mode-markdown"),require("ace-builds/src-noconflict/mode-python"),require("ace-builds/src-noconflict/mode-xml"),require("ace-builds/src-noconflict/mode-sql"),require("ace-builds/src-noconflict/mode-text"),require("ace-builds/src-noconflict/theme-github"),require("ace-builds/src-noconflict/theme-monokai"),require("ace-builds/src-noconflict/ext-language_tools"),require("ace-builds/src-noconflict/ext-beautify");var jsxRuntime=require("react/jsx-runtime"),lucideReact=require("lucide-react");function _interopDefault(e){return e&&e.__esModule?e:{default:e}}a(_interopDefault,"_interopDefault");var ace__default=_interopDefault(ace),React2__default=_interopDefault(React2),AceEditor__default=_interopDefault(AceEditor),beautifyCommand={name:"beautify",bindKey:{win:"Ctrl-Shift-B",mac:"Command-Shift-B"},exec:a(e=>{ace__default.default.require("ace/ext/beautify").beautify(e.session)},"exec")},CodeEditor=React2.forwardRef(({value:e="",onChange:r,language:m="javascript",theme:s,height:x="200px",width:c="100%",placeholder:f="Enter your code here...",readOnly:u=!1,disabled:n=!1,className:R,fontSize:L=14,showGutter:E=!0,showPrintMargin:w=!1,highlightActiveLine:D=!0,enableBasicAutocompletion:J=!0,enableLiveAutocompletion:d=!1,enableSnippets:j=!0,tabSize:C=2,name:i="code-editor",wrapEnabled:p=!1,onLoad:T,onCursorChange:l,annotations:N,markers:F,commands:S,...M},v)=>{const[_,h]=React2.useState("github");React2.useEffect(()=>{const b=document.documentElement.classList.contains("dark")||window.matchMedia("(prefers-color-scheme: dark)").matches;h(b?"monokai":"github");const k=new MutationObserver(()=>{const t=document.documentElement.classList.contains("dark");h(t?"monokai":"github")});k.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const y=window.matchMedia("(prefers-color-scheme: dark)"),q=a(()=>{!document.documentElement.classList.contains("light")&&!document.documentElement.classList.contains("dark")&&h(y.matches?"monokai":"github")},"handleChange2");return y.addEventListener("change",q),()=>{k.disconnect(),y.removeEventListener("change",q)}},[]);const g=s||_,A=a(b=>{r&&!n&&!u&&r(b)},"handleChange");return jsxRuntime.jsx("div",{ref:v,className:chunkYWPIPAUQ_cjs.cn("relative overflow-hidden rounded-md border border-input","focus-within:border-ring focus-within:ring-1 focus-within:ring-ring",n&&"cursor-not-allowed bg-muted opacity-50",R),...M,children:jsxRuntime.jsx(AceEditor__default.default,{mode:m,theme:g,name:i,value:e,onChange:A,fontSize:L,showGutter:E,showPrintMargin:w,highlightActiveLine:D,height:typeof x=="number"?`${x}px`:x,width:typeof c=="number"?`${c}px`:c,readOnly:u||n,placeholder:f,wrapEnabled:p,onLoad:T,onCursorChange:l,annotations:N,markers:F,commands:[beautifyCommand,...S??[]],setOptions:{enableBasicAutocompletion:J,enableLiveAutocompletion:d,enableSnippets:j,showLineNumbers:E,tabSize:C,useWorker:!1},style:{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'},editorProps:{$blockScrolling:!0}})})});CodeEditor.displayName="CodeEditor";function formatJSON(e){try{const r=JSON.parse(e);return{formatted:JSON.stringify(r,null,2)}}catch(r){return{formatted:e,error:r instanceof Error?r.message:"Invalid JSON format"}}}a(formatJSON,"formatJSON");function formatYAML(e){return{formatted:e}}a(formatYAML,"formatYAML");function validateJSON(e){if(!e.trim())return{valid:!0};try{return JSON.parse(e),{valid:!0}}catch(r){return{valid:!1,error:r instanceof Error?r.message:"Invalid JSON format"}}}a(validateJSON,"validateJSON");function ConfigEditor({value:e="",onChange:r,onValidate:m,language:s="json",showToolbar:x=!0,showFormatButton:c=!0,showCopyButton:f=!0,showClearButton:u=!0,showValidateButton:n=!1,enableAutoValidation:R=!0,formatOnMount:L=!1,validateOnChange:E=!0,className:w,toolbarClassName:D,errorClassName:J,onToolbarActionsChange:d,height:j="400px",...C}){const[i,p]=React2.useState(e),[T,l]=React2.useState(null),[N,F]=React2.useState(!1),[S,M]=React2.useState(!1);React2__default.default.useEffect(()=>{L&&e&&h()},[]),React2__default.default.useEffect(()=>{p(e)},[e]);const v=React2.useCallback(t=>{if(m){const o=m(t);return l(o.valid?null:o.error||"Validation failed"),o}if(s==="json"){const o=validateJSON(t);return l(o.valid?null:o.error||null),o}return l(null),{valid:!0}},[s,m]),_=React2.useCallback(t=>{p(t);const o=E?v(t):{valid:!0};r&&r(t,o.valid)},[r,v,E]),h=React2.useCallback(()=>{M(!0);try{let t;if(s==="json")t=formatJSON(i);else if(s==="yaml")t=formatYAML(i);else{l("Format not supported for this language");return}t.error?l(t.error):(p(t.formatted),r&&r(t.formatted,!0),l(null))}finally{setTimeout(()=>M(!1),500)}},[i,s,r]),g=React2.useCallback(async()=>{try{await navigator.clipboard.writeText(i),F(!0),setTimeout(()=>F(!1),2e3)}catch(t){console.error("Failed to copy:",t)}},[i]),A=React2.useCallback(()=>{const t=s==="json"?"{}":"";p(t),l(null),r&&r(t,!0)},[s,r]),b=React2.useCallback(()=>{v(i)},[v,i]),k=React2.useMemo(()=>!c&&!f&&!u&&!n?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&(s==="json"||s==="yaml")&&jsxRuntime.jsxs(chunkERURJLNK_cjs.Tooltip,{children:[jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(chunkM2GCF4FZ_cjs.Button,{variant:"ghost",size:"sm",onClick:h,disabled:S,className:"h-7 px-2",children:[jsxRuntime.jsx(lucideReact.WrapText,{className:"h-3.5 w-3.5"}),jsxRuntime.jsx("span",{className:"ml-1.5 text-xs",children:"\u683C\u5F0F\u5316"})]})}),jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipContent,{children:jsxRuntime.jsx("p",{children:"\u683C\u5F0F\u5316\u4EE3\u7801"})})]}),n&&jsxRuntime.jsxs(chunkERURJLNK_cjs.Tooltip,{children:[jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(chunkM2GCF4FZ_cjs.Button,{variant:"ghost",size:"sm",onClick:b,className:"h-7 px-2",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3.5 w-3.5"}),jsxRuntime.jsx("span",{className:"ml-1.5 text-xs",children:"\u9A8C\u8BC1"})]})}),jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipContent,{children:jsxRuntime.jsx("p",{children:"\u9A8C\u8BC1\u4EE3\u7801\u683C\u5F0F"})})]}),f&&jsxRuntime.jsxs(chunkERURJLNK_cjs.Tooltip,{children:[jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(chunkM2GCF4FZ_cjs.Button,{variant:"ghost",size:"sm",onClick:g,className:"h-7 px-2",children:[N?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-success"}):jsxRuntime.jsx(lucideReact.Copy,{className:"h-3.5 w-3.5"}),jsxRuntime.jsx("span",{className:"ml-1.5 text-xs",children:N?"\u5DF2\u590D\u5236":"\u590D\u5236"})]})}),jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipContent,{children:jsxRuntime.jsx("p",{children:"\u590D\u5236\u5230\u526A\u8D34\u677F"})})]}),u&&jsxRuntime.jsxs(chunkERURJLNK_cjs.Tooltip,{children:[jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(chunkM2GCF4FZ_cjs.Button,{variant:"ghost",size:"sm",onClick:A,className:"h-7 px-2 text-destructive hover:text-destructive",children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"h-3.5 w-3.5"}),jsxRuntime.jsx("span",{className:"ml-1.5 text-xs",children:"\u6E05\u7A7A"})]})}),jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipContent,{children:jsxRuntime.jsx("p",{children:"\u6E05\u7A7A\u5185\u5BB9"})})]})]}),[N,A,g,h,b,S,s,u,f,c,n]);React2__default.default.useEffect(()=>{if(d)return d(k),()=>d(null)},[d,k]);const y=React2.useMemo(()=>x&&!d&&(c||f||u||n),[x,c,f,u,n,d]),q=typeof j=="string"&&(j==="100%"||j==="auto");return jsxRuntime.jsxs("div",{className:chunkYWPIPAUQ_cjs.cn("flex flex-col gap-2",q&&"h-full overflow-hidden",w),children:[y&&jsxRuntime.jsx(chunkERURJLNK_cjs.TooltipProvider,{children:jsxRuntime.jsx("div",{className:chunkYWPIPAUQ_cjs.cn("flex shrink-0 items-center justify-end gap-1 rounded-md border bg-muted/30 p-1",D),children:k})}),q?jsxRuntime.jsx("div",{className:"min-h-0 flex-1",children:jsxRuntime.jsx(CodeEditor,{value:i,onChange:_,language:s,height:"100%",className:"h-full [&>.ace_editor]:!h-full",...C})}):jsxRuntime.jsx(CodeEditor,{value:i,onChange:_,language:s,height:j,...C}),T&&R&&jsxRuntime.jsxs(chunkGZXKQ2K6_cjs.Alert,{variant:"destructive",className:chunkYWPIPAUQ_cjs.cn("mt-2 shrink-0",J),children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4"}),jsxRuntime.jsx(chunkGZXKQ2K6_cjs.AlertDescription,{children:T})]})]})}a(ConfigEditor,"ConfigEditor"),ConfigEditor.displayName="ConfigEditor";var MarkdownEditor=React2.forwardRef(({placeholder:e="Write markdown...",...r},m)=>jsxRuntime.jsx(CodeEditor,{ref:m,language:"markdown",placeholder:e,...r}));MarkdownEditor.displayName="MarkdownEditor",exports.CodeEditor=CodeEditor,exports.ConfigEditor=ConfigEditor,exports.MarkdownEditor=MarkdownEditor;