@icen.ai/ui 0.8.0 → 0.8.1

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 (106) hide show
  1. package/AGENTS.md +15 -9
  2. package/README.md +8 -3
  3. package/dist/base.css +4 -3
  4. package/dist/behaviors/accordion.d.mts +5 -2
  5. package/dist/behaviors/accordion.mjs +36 -11
  6. package/dist/behaviors/ai-chat.d.mts +3 -1
  7. package/dist/behaviors/ai-chat.mjs +66 -43
  8. package/dist/behaviors/ai-composer.d.mts +28 -3
  9. package/dist/behaviors/ai-composer.mjs +291 -209
  10. package/dist/behaviors/ai-core.d.mts +9 -4
  11. package/dist/behaviors/ai-core.mjs +21 -8
  12. package/dist/behaviors/ai-diff.d.mts +2 -2
  13. package/dist/behaviors/ai-diff.mjs +172 -41
  14. package/dist/behaviors/ai-panel.d.mts +11 -8
  15. package/dist/behaviors/ai-panel.mjs +185 -110
  16. package/dist/behaviors/ai-provider.mjs +54 -48
  17. package/dist/behaviors/ai-tool.d.mts +12 -4
  18. package/dist/behaviors/ai-tool.mjs +311 -263
  19. package/dist/behaviors/ai-tools.d.mts +9 -6
  20. package/dist/behaviors/ai-tools.mjs +259 -155
  21. package/dist/behaviors/back-top.mjs +16 -1
  22. package/dist/behaviors/carousel.d.mts +5 -2
  23. package/dist/behaviors/carousel.mjs +53 -26
  24. package/dist/behaviors/charts.d.mts +68 -22
  25. package/dist/behaviors/charts.mjs +221 -150
  26. package/dist/behaviors/command-palette.d.mts +40 -6
  27. package/dist/behaviors/command-palette.mjs +143 -15
  28. package/dist/behaviors/context-menu.d.mts +21 -4
  29. package/dist/behaviors/context-menu.mjs +122 -38
  30. package/dist/behaviors/controls.d.mts +59 -0
  31. package/dist/behaviors/controls.mjs +601 -0
  32. package/dist/behaviors/copy.d.mts +5 -2
  33. package/dist/behaviors/copy.mjs +37 -12
  34. package/dist/behaviors/datatable.d.mts +12 -0
  35. package/dist/behaviors/datatable.mjs +226 -43
  36. package/dist/behaviors/date-picker.d.mts +2 -2
  37. package/dist/behaviors/date-picker.mjs +171 -32
  38. package/dist/behaviors/dropdown.d.mts +6 -2
  39. package/dist/behaviors/dropdown.mjs +164 -25
  40. package/dist/behaviors/events.d.mts +330 -0
  41. package/dist/behaviors/events.mjs +208 -0
  42. package/dist/behaviors/input.mjs +25 -12
  43. package/dist/behaviors/modal.d.mts +24 -5
  44. package/dist/behaviors/modal.mjs +76 -10
  45. package/dist/behaviors/nav.d.mts +1 -1
  46. package/dist/behaviors/nav.mjs +33 -7
  47. package/dist/behaviors/notification.d.mts +20 -4
  48. package/dist/behaviors/notification.mjs +53 -73
  49. package/dist/behaviors/popover.d.mts +39 -3
  50. package/dist/behaviors/popover.mjs +90 -4
  51. package/dist/behaviors/select.d.mts +4 -2
  52. package/dist/behaviors/select.mjs +161 -24
  53. package/dist/behaviors/sidebar.d.mts +5 -2
  54. package/dist/behaviors/sidebar.mjs +43 -13
  55. package/dist/behaviors/slider.d.mts +5 -2
  56. package/dist/behaviors/slider.mjs +54 -43
  57. package/dist/behaviors/split-pane.d.mts +6 -2
  58. package/dist/behaviors/split-pane.mjs +62 -21
  59. package/dist/behaviors/tabs.d.mts +3 -2
  60. package/dist/behaviors/tabs.mjs +65 -14
  61. package/dist/behaviors/tag-input.d.mts +5 -2
  62. package/dist/behaviors/tag-input.mjs +61 -21
  63. package/dist/behaviors/theme.d.mts +13 -2
  64. package/dist/behaviors/theme.mjs +48 -4
  65. package/dist/behaviors/toast.d.mts +30 -8
  66. package/dist/behaviors/toast.mjs +74 -7
  67. package/dist/behaviors/tree.d.mts +5 -2
  68. package/dist/behaviors/tree.mjs +38 -15
  69. package/dist/behaviors/upload.mjs +21 -23
  70. package/dist/cli.mjs +1 -1
  71. package/dist/components/ai-panel.css +1 -1
  72. package/dist/components/ai-tool-call.mjs +1 -1
  73. package/dist/components/badge.css +1 -1
  74. package/dist/components/breadcrumb.css +0 -32
  75. package/dist/components/chart-calendar.mjs +1 -2
  76. package/dist/components/chart-pie.css +0 -6
  77. package/dist/components/charts.css +1 -1
  78. package/dist/components/content.css +3 -16
  79. package/dist/components/datatable.css +1 -1
  80. package/dist/components/date-picker.css +1 -1
  81. package/dist/components/notification.css +2 -3
  82. package/dist/components/pagination.css +3 -1
  83. package/dist/components/pagination.mjs +1 -0
  84. package/dist/components/rating.mjs +1 -0
  85. package/dist/components/segmented.css +9 -1
  86. package/dist/components/segmented.mjs +1 -1
  87. package/dist/components/select.css +67 -4
  88. package/dist/components/steps.css +13 -3
  89. package/dist/components/steps.mjs +1 -0
  90. package/dist/components/switch.css +3 -1
  91. package/dist/components/switch.mjs +1 -0
  92. package/dist/components/table.mjs +1 -0
  93. package/dist/components/tabs.css +23 -0
  94. package/dist/components/tag-input.css +1 -6
  95. package/dist/components/upload.css +0 -15
  96. package/dist/index.d.mts +12 -10
  97. package/dist/index.mjs +2700 -1460
  98. package/dist/registry.json +42 -13
  99. package/dist/retro-effects.css +3 -16
  100. package/dist/tokens/retro-effects.css +3 -16
  101. package/dist/tokens/style-profiles.css +3 -2
  102. package/dist/tokens/typography.css +2 -0
  103. package/dist/tokens.css +5 -2
  104. package/dist/ui.css +138 -98
  105. package/docs/spec/ai-native.md +7 -4
  106. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icen.ai/ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "tokens": [
5
5
  "colors.css",
6
6
  "style-profiles.css",
@@ -83,10 +83,12 @@
83
83
  "charts",
84
84
  "command-palette",
85
85
  "context-menu",
86
+ "controls",
86
87
  "copy",
87
88
  "datatable",
88
89
  "date-picker",
89
90
  "dropdown",
91
+ "events",
90
92
  "input",
91
93
  "modal",
92
94
  "nav",
@@ -163,13 +165,20 @@
163
165
  "init": "initTagInput"
164
166
  },
165
167
  "switch": {
166
- "css": "switch.css"
168
+ "css": "switch.css",
169
+ "behavior": "controls",
170
+ "init": "initSwitch",
171
+ "exports": [
172
+ "initSwitch"
173
+ ]
167
174
  },
168
175
  "segmented": {
169
176
  "css": "segmented.css",
170
- "behavior": "input",
177
+ "behavior": "controls",
171
178
  "exports": [
172
- "initInput"
179
+ "initInput",
180
+ "initSegmented",
181
+ "initStepper"
173
182
  ]
174
183
  },
175
184
  "upload": {
@@ -227,7 +236,12 @@
227
236
  "css": "media.css"
228
237
  },
229
238
  "rating": {
230
- "css": "media.css"
239
+ "css": "media.css",
240
+ "behavior": "controls",
241
+ "init": "initRating",
242
+ "exports": [
243
+ "initRating"
244
+ ]
231
245
  },
232
246
  "kbd": {
233
247
  "css": "content.css"
@@ -263,7 +277,12 @@
263
277
  "css": "scroll-area.css"
264
278
  },
265
279
  "table": {
266
- "css": "table.css"
280
+ "css": "table.css",
281
+ "behavior": "controls",
282
+ "init": "initTableSort",
283
+ "exports": [
284
+ "initTableSort"
285
+ ]
267
286
  },
268
287
  "datatable": {
269
288
  "css": "datatable.css",
@@ -306,7 +325,8 @@
306
325
  "renderChart",
307
326
  "normalizeChartSpec",
308
327
  "inferChartType",
309
- "chartFormatValue"
328
+ "chartFormatValue",
329
+ "registerChartTone"
310
330
  ]
311
331
  },
312
332
  "chart-line": {
@@ -411,10 +431,9 @@
411
431
  ]
412
432
  },
413
433
  "chart-calendar": {
414
- "css": "chart-calendar.css",
434
+ "css": "chart-heatmap.css",
415
435
  "extraCss": [
416
- "charts.css",
417
- "chart-heatmap.css"
436
+ "charts.css"
418
437
  ],
419
438
  "behavior": "charts",
420
439
  "exports": [
@@ -463,10 +482,20 @@
463
482
  "css": "breadcrumb.css"
464
483
  },
465
484
  "pagination": {
466
- "css": "pagination.css"
485
+ "css": "pagination.css",
486
+ "behavior": "controls",
487
+ "init": "initPagination",
488
+ "exports": [
489
+ "initPagination"
490
+ ]
467
491
  },
468
492
  "steps": {
469
- "css": "steps.css"
493
+ "css": "steps.css",
494
+ "behavior": "controls",
495
+ "init": "initSteps",
496
+ "exports": [
497
+ "initSteps"
498
+ ]
470
499
  },
471
500
  "back-top": {
472
501
  "css": "back-top.css",
@@ -504,7 +533,7 @@
504
533
  "init": "initAiComposer"
505
534
  },
506
535
  "ai-tool-call": {
507
- "css": "ai-tool-call.css",
536
+ "css": "ai-tool.css",
508
537
  "init": "initAiTool"
509
538
  },
510
539
  "ai-subagent": {
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * 仅在 <html class="style-retro">(或叠加 .dark)激活时生效,对其它风格无副作用:
8
8
  * - CRT 扫描线 + 暗角 + 颗粒噪点
9
- * - 屏幕闪烁 / 抖动 / 游走扫描光
9
+ * - 游走扫描光
10
10
  * - RGB 色散 / 霓虹发光(暗色)
11
11
  * - 像素边框 / 像素按钮 / 像素分隔线工具类
12
12
  * - 开机自检 / 打字机光标 / 页面闪白动画
@@ -63,20 +63,6 @@
63
63
  opacity: 0.55;
64
64
  }
65
65
 
66
- /* 屏幕闪烁(备用工具类,需要时挂在元素上) */
67
- @keyframes retro-flicker {
68
- 0%, 100% { opacity: 1; }
69
- 50% { opacity: 0.985; }
70
- }
71
-
72
- /* 屏幕轻微抖动(备用工具类) */
73
- @keyframes retro-jitter {
74
- 0%, 100% { transform: translate(0, 0); }
75
- 25% { transform: translate(0.5px, 0); }
76
- 50% { transform: translate(-0.5px, 0.5px); }
77
- 75% { transform: translate(0, -0.5px); }
78
- }
79
-
80
66
  /* CRT 颗粒噪点 */
81
67
  @keyframes retro-grain {
82
68
  0%, 100% { background-position: 0 0; }
@@ -263,6 +249,7 @@
263
249
  opacity: 0;
264
250
  }
265
251
 
266
- .style-retro .retro-page-flash.active {
252
+ /* 状态类遵循全库 .is-* 规范 */
253
+ .style-retro .retro-page-flash.is-active {
267
254
  animation: retro-flash 0.2s steps(3) forwards;
268
255
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * 仅在 <html class="style-retro">(或叠加 .dark)激活时生效,对其它风格无副作用:
8
8
  * - CRT 扫描线 + 暗角 + 颗粒噪点
9
- * - 屏幕闪烁 / 抖动 / 游走扫描光
9
+ * - 游走扫描光
10
10
  * - RGB 色散 / 霓虹发光(暗色)
11
11
  * - 像素边框 / 像素按钮 / 像素分隔线工具类
12
12
  * - 开机自检 / 打字机光标 / 页面闪白动画
@@ -63,20 +63,6 @@
63
63
  opacity: 0.55;
64
64
  }
65
65
 
66
- /* 屏幕闪烁(备用工具类,需要时挂在元素上) */
67
- @keyframes retro-flicker {
68
- 0%, 100% { opacity: 1; }
69
- 50% { opacity: 0.985; }
70
- }
71
-
72
- /* 屏幕轻微抖动(备用工具类) */
73
- @keyframes retro-jitter {
74
- 0%, 100% { transform: translate(0, 0); }
75
- 25% { transform: translate(0.5px, 0); }
76
- 50% { transform: translate(-0.5px, 0.5px); }
77
- 75% { transform: translate(0, -0.5px); }
78
- }
79
-
80
66
  /* CRT 颗粒噪点 */
81
67
  @keyframes retro-grain {
82
68
  0%, 100% { background-position: 0 0; }
@@ -263,6 +249,7 @@
263
249
  opacity: 0;
264
250
  }
265
251
 
266
- .style-retro .retro-page-flash.active {
252
+ /* 状态类遵循全库 .is-* 规范 */
253
+ .style-retro .retro-page-flash.is-active {
267
254
  animation: retro-flash 0.2s steps(3) forwards;
268
255
  }
@@ -84,7 +84,9 @@
84
84
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
85
85
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
86
86
 
87
- /* ── Typography 字体 ── */
87
+ /* ── Typography 字体 ──
88
+ --line-height-heading 不在此定义:typography.css 独家拥有(icen 品牌 1.2),
89
+ 各 .style-* profile 需要差异化时在自己的块里覆盖。 */
88
90
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
89
91
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
90
92
  --font-mono-paper: ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Courier New', monospace;
@@ -92,7 +94,6 @@
92
94
  --letter-spacing-body: 0;
93
95
  --letter-spacing-heading: 0;
94
96
  --line-height-body: 1.5;
95
- --line-height-heading: 1.2;
96
97
  }
97
98
 
98
99
  /* ══════════════════════════════════════════════════════════════
@@ -2,6 +2,7 @@
2
2
  * @icen.ai/ui — Typography Tokens(icen canonical)
3
3
  * 美学基调:等宽数字精密感 × 衬线书卷气(宋体标题)
4
4
  * 默认(:root)即 icen 品牌形态;.style-modern 显式回退 system-ui 栈(见 style-profiles.css)
5
+ * 工具类:.font-math(数字密集区,"Numeric Math" 数学字体 + tabular-nums)
5
6
  */
6
7
 
7
8
  /* ── 数学/等宽数字字体(数字密集区的精密感) ── */
@@ -24,6 +25,7 @@
24
25
  --font-heading: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', SimSun, serif;
25
26
  --font-cjk: var(--font-heading);
26
27
  --line-height-body: 1.7;
28
+ /* 独家定义(style-profiles.css 的 :root 不再重复;profile 差异化在各 .style-* 块覆盖) */
27
29
  --line-height-heading: 1.2;
28
30
  }
29
31
 
package/dist/tokens.css CHANGED
@@ -1339,7 +1339,9 @@
1339
1339
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
1340
1340
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
1341
1341
 
1342
- /* ── Typography 字体 ── */
1342
+ /* ── Typography 字体 ──
1343
+ --line-height-heading 不在此定义:typography.css 独家拥有(icen 品牌 1.2),
1344
+ 各 .style-* profile 需要差异化时在自己的块里覆盖。 */
1343
1345
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
1344
1346
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
1345
1347
  --font-mono-paper: ui-monospace, SFMono-Regular, 'JetBrains Mono', 'Courier New', monospace;
@@ -1347,7 +1349,6 @@
1347
1349
  --letter-spacing-body: 0;
1348
1350
  --letter-spacing-heading: 0;
1349
1351
  --line-height-body: 1.5;
1350
- --line-height-heading: 1.2;
1351
1352
  }
1352
1353
 
1353
1354
  /* ══════════════════════════════════════════════════════════════
@@ -1821,6 +1822,7 @@
1821
1822
  * @icen.ai/ui — Typography Tokens(icen canonical)
1822
1823
  * 美学基调:等宽数字精密感 × 衬线书卷气(宋体标题)
1823
1824
  * 默认(:root)即 icen 品牌形态;.style-modern 显式回退 system-ui 栈(见 style-profiles.css)
1825
+ * 工具类:.font-math(数字密集区,"Numeric Math" 数学字体 + tabular-nums)
1824
1826
  */
1825
1827
 
1826
1828
  /* ── 数学/等宽数字字体(数字密集区的精密感) ── */
@@ -1843,6 +1845,7 @@
1843
1845
  --font-heading: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', SimSun, serif;
1844
1846
  --font-cjk: var(--font-heading);
1845
1847
  --line-height-body: 1.7;
1848
+ /* 独家定义(style-profiles.css 的 :root 不再重复;profile 差异化在各 .style-* 块覆盖) */
1846
1849
  --line-height-heading: 1.2;
1847
1850
  }
1848
1851