@icen.ai/ui 0.8.1 → 0.10.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 (335) hide show
  1. package/AGENTS.md +176 -75
  2. package/README.md +66 -88
  3. package/dist/base.css +208 -179
  4. package/dist/behaviors/accordion.mjs +8 -8
  5. package/dist/behaviors/ai-branch.d.mts +19 -0
  6. package/dist/behaviors/ai-branch.mjs +1133 -0
  7. package/dist/behaviors/ai-chat.d.mts +12 -10
  8. package/dist/behaviors/ai-chat.mjs +1125 -155
  9. package/dist/behaviors/ai-composer.d.mts +44 -12
  10. package/dist/behaviors/ai-composer.mjs +2084 -523
  11. package/dist/behaviors/ai-core.d.mts +1 -1
  12. package/dist/behaviors/ai-core.mjs +1016 -107
  13. package/dist/behaviors/ai-diff.mjs +1019 -127
  14. package/dist/behaviors/ai-feedback.d.mts +26 -0
  15. package/dist/behaviors/ai-feedback.mjs +1212 -0
  16. package/dist/behaviors/ai-panel.d.mts +21 -7
  17. package/dist/behaviors/ai-panel.mjs +1308 -264
  18. package/dist/behaviors/ai-provider.mjs +1003 -101
  19. package/dist/behaviors/ai-threads.d.mts +38 -0
  20. package/dist/behaviors/ai-threads.mjs +1233 -0
  21. package/dist/behaviors/ai-tool.d.mts +2 -2
  22. package/dist/behaviors/ai-tool.mjs +2042 -396
  23. package/dist/behaviors/ai-tools.d.mts +89 -16
  24. package/dist/behaviors/ai-tools.mjs +4453 -372
  25. package/dist/behaviors/autocomplete.d.mts +53 -0
  26. package/dist/behaviors/autocomplete.mjs +1600 -0
  27. package/dist/behaviors/back-top.d.mts +1 -1
  28. package/dist/behaviors/back-top.mjs +951 -14
  29. package/dist/behaviors/carousel.d.mts +1 -1
  30. package/dist/behaviors/carousel.mjs +906 -11
  31. package/dist/behaviors/cascader.d.mts +48 -0
  32. package/dist/behaviors/cascader.mjs +1853 -0
  33. package/dist/behaviors/charts.d.mts +174 -8
  34. package/dist/behaviors/charts.mjs +2632 -192
  35. package/dist/behaviors/code-block.d.mts +36 -0
  36. package/dist/behaviors/code-block.mjs +1611 -0
  37. package/dist/behaviors/command-palette.d.mts +9 -6
  38. package/dist/behaviors/command-palette.mjs +161 -59
  39. package/dist/behaviors/context-menu.d.mts +9 -8
  40. package/dist/behaviors/context-menu.mjs +1112 -44
  41. package/dist/behaviors/controls.d.mts +13 -13
  42. package/dist/behaviors/controls.mjs +989 -130
  43. package/dist/behaviors/copy.d.mts +21 -2
  44. package/dist/behaviors/copy.mjs +1206 -42
  45. package/dist/behaviors/datatable.d.mts +53 -3
  46. package/dist/behaviors/datatable.mjs +1963 -207
  47. package/dist/behaviors/date-picker.d.mts +0 -1
  48. package/dist/behaviors/date-picker.mjs +1340 -293
  49. package/dist/behaviors/design.d.mts +54 -0
  50. package/dist/behaviors/design.mjs +109 -0
  51. package/dist/behaviors/dropdown.d.mts +5 -6
  52. package/dist/behaviors/dropdown.mjs +262 -110
  53. package/dist/behaviors/events.d.mts +313 -3
  54. package/dist/behaviors/events.mjs +47 -2
  55. package/dist/behaviors/feedback.d.mts +30 -0
  56. package/dist/behaviors/feedback.mjs +296 -0
  57. package/dist/behaviors/focus.d.mts +8 -0
  58. package/dist/behaviors/focus.mjs +24 -0
  59. package/dist/behaviors/form-validate.d.mts +102 -0
  60. package/dist/behaviors/form-validate.mjs +6091 -0
  61. package/dist/behaviors/i18n.d.mts +789 -0
  62. package/dist/behaviors/i18n.mjs +1711 -0
  63. package/dist/behaviors/icons.d.mts +93 -0
  64. package/dist/behaviors/icons.mjs +113 -0
  65. package/dist/behaviors/input.d.mts +9 -1
  66. package/dist/behaviors/input.mjs +1056 -60
  67. package/dist/behaviors/kb-access.d.mts +34 -0
  68. package/dist/behaviors/kb-access.mjs +2459 -0
  69. package/dist/behaviors/kb-acl.d.mts +50 -0
  70. package/dist/behaviors/kb-acl.mjs +1345 -0
  71. package/dist/behaviors/kb-answer.d.mts +38 -0
  72. package/dist/behaviors/kb-answer.mjs +3707 -0
  73. package/dist/behaviors/kb-audit.d.mts +23 -0
  74. package/dist/behaviors/kb-audit.mjs +1297 -0
  75. package/dist/behaviors/kb-canvas.d.mts +44 -0
  76. package/dist/behaviors/kb-canvas.mjs +1512 -0
  77. package/dist/behaviors/kb-chain.d.mts +15 -0
  78. package/dist/behaviors/kb-chain.mjs +1192 -0
  79. package/dist/behaviors/kb-checkpoint.d.mts +16 -0
  80. package/dist/behaviors/kb-checkpoint.mjs +1492 -0
  81. package/dist/behaviors/kb-chunks.d.mts +31 -0
  82. package/dist/behaviors/kb-chunks.mjs +1414 -0
  83. package/dist/behaviors/kb-citation.d.mts +38 -0
  84. package/dist/behaviors/kb-citation.mjs +1699 -0
  85. package/dist/behaviors/kb-clarify.d.mts +20 -0
  86. package/dist/behaviors/kb-clarify.mjs +1176 -0
  87. package/dist/behaviors/kb-conflict.d.mts +22 -0
  88. package/dist/behaviors/kb-conflict.mjs +1206 -0
  89. package/dist/behaviors/kb-connector.d.mts +17 -0
  90. package/dist/behaviors/kb-connector.mjs +1303 -0
  91. package/dist/behaviors/kb-core.d.mts +534 -0
  92. package/dist/behaviors/kb-core.mjs +1805 -0
  93. package/dist/behaviors/kb-eval.d.mts +22 -0
  94. package/dist/behaviors/kb-eval.mjs +2235 -0
  95. package/dist/behaviors/kb-explain.d.mts +11 -0
  96. package/dist/behaviors/kb-explain.mjs +1165 -0
  97. package/dist/behaviors/kb-filter.d.mts +31 -0
  98. package/dist/behaviors/kb-filter.mjs +2417 -0
  99. package/dist/behaviors/kb-gap.d.mts +27 -0
  100. package/dist/behaviors/kb-gap.mjs +1195 -0
  101. package/dist/behaviors/kb-hittest.d.mts +34 -0
  102. package/dist/behaviors/kb-hittest.mjs +1352 -0
  103. package/dist/behaviors/kb-metadata.d.mts +29 -0
  104. package/dist/behaviors/kb-metadata.mjs +1248 -0
  105. package/dist/behaviors/kb-passage.d.mts +41 -0
  106. package/dist/behaviors/kb-passage.mjs +1469 -0
  107. package/dist/behaviors/kb-pipeline.d.mts +18 -0
  108. package/dist/behaviors/kb-pipeline.mjs +1301 -0
  109. package/dist/behaviors/kb-qa.d.mts +26 -0
  110. package/dist/behaviors/kb-qa.mjs +1260 -0
  111. package/dist/behaviors/kb-rerank.d.mts +20 -0
  112. package/dist/behaviors/kb-rerank.mjs +1248 -0
  113. package/dist/behaviors/kb-retrieval.d.mts +49 -0
  114. package/dist/behaviors/kb-retrieval.mjs +2585 -0
  115. package/dist/behaviors/kb-review.d.mts +44 -0
  116. package/dist/behaviors/kb-review.mjs +2282 -0
  117. package/dist/behaviors/kb-sandbox.d.mts +33 -0
  118. package/dist/behaviors/kb-sandbox.mjs +1247 -0
  119. package/dist/behaviors/kb-segment.d.mts +32 -0
  120. package/dist/behaviors/kb-segment.mjs +1431 -0
  121. package/dist/behaviors/kb-select.d.mts +24 -0
  122. package/dist/behaviors/kb-select.mjs +1989 -0
  123. package/dist/behaviors/kb-sources.d.mts +27 -0
  124. package/dist/behaviors/kb-sources.mjs +1287 -0
  125. package/dist/behaviors/kb-sql.d.mts +43 -0
  126. package/dist/behaviors/kb-sql.mjs +1865 -0
  127. package/dist/behaviors/kb-trace.d.mts +16 -0
  128. package/dist/behaviors/kb-trace.mjs +1328 -0
  129. package/dist/behaviors/kb-visibility.d.mts +44 -0
  130. package/dist/behaviors/kb-visibility.mjs +1331 -0
  131. package/dist/behaviors/kb-who-can.d.mts +32 -0
  132. package/dist/behaviors/kb-who-can.mjs +2216 -0
  133. package/dist/behaviors/mentions.d.mts +93 -0
  134. package/dist/behaviors/mentions.mjs +2152 -0
  135. package/dist/behaviors/modal.d.mts +4 -3
  136. package/dist/behaviors/modal.mjs +1055 -33
  137. package/dist/behaviors/nav.d.mts +1 -1
  138. package/dist/behaviors/nav.mjs +6 -6
  139. package/dist/behaviors/notification.d.mts +16 -8
  140. package/dist/behaviors/notification.mjs +1615 -265
  141. package/dist/behaviors/panel.d.mts +4 -0
  142. package/dist/behaviors/panel.mjs +994 -0
  143. package/dist/behaviors/popover.d.mts +28 -5
  144. package/dist/behaviors/popover.mjs +225 -24
  145. package/dist/behaviors/select.d.mts +5 -2
  146. package/dist/behaviors/select.mjs +1410 -117
  147. package/dist/behaviors/sidebar.d.mts +1 -1
  148. package/dist/behaviors/sidebar.mjs +13 -13
  149. package/dist/behaviors/slider.d.mts +1 -1
  150. package/dist/behaviors/slider.mjs +9 -9
  151. package/dist/behaviors/split-pane.d.mts +1 -1
  152. package/dist/behaviors/split-pane.mjs +7 -7
  153. package/dist/behaviors/suggestions.d.mts +27 -0
  154. package/dist/behaviors/suggestions.mjs +1089 -0
  155. package/dist/behaviors/svg-parse.d.mts +14 -0
  156. package/dist/behaviors/svg-parse.mjs +37 -0
  157. package/dist/behaviors/tabs.d.mts +2 -2
  158. package/dist/behaviors/tabs.mjs +25 -25
  159. package/dist/behaviors/tag-input.d.mts +23 -5
  160. package/dist/behaviors/tag-input.mjs +1359 -104
  161. package/dist/behaviors/theme-switcher.d.mts +24 -0
  162. package/dist/behaviors/theme-switcher.mjs +1981 -0
  163. package/dist/behaviors/theme.d.mts +15 -8
  164. package/dist/behaviors/theme.mjs +390 -28
  165. package/dist/behaviors/toast.d.mts +24 -25
  166. package/dist/behaviors/toast.mjs +1266 -88
  167. package/dist/behaviors/tooltip.d.mts +4 -0
  168. package/dist/behaviors/tooltip.mjs +378 -0
  169. package/dist/behaviors/tree-select.d.mts +69 -0
  170. package/dist/behaviors/tree-select.mjs +1907 -0
  171. package/dist/behaviors/tree.d.mts +1 -1
  172. package/dist/behaviors/tree.mjs +15 -15
  173. package/dist/behaviors/upload.d.mts +3 -2
  174. package/dist/behaviors/upload.mjs +1076 -66
  175. package/dist/cli.mjs +5 -6
  176. package/dist/components/ai-branch.mjs +3 -0
  177. package/dist/components/ai-chat.css +846 -458
  178. package/dist/components/ai-diff.css +153 -132
  179. package/dist/components/ai-feedback.mjs +3 -0
  180. package/dist/components/ai-panel.css +495 -270
  181. package/dist/components/ai-threads.mjs +3 -0
  182. package/dist/components/ai-tool.css +393 -238
  183. package/dist/components/autocomplete.css +61 -0
  184. package/dist/components/autocomplete.mjs +3 -0
  185. package/dist/components/back-top.css +34 -31
  186. package/dist/components/badge.css +44 -41
  187. package/dist/components/breadcrumb.css +67 -46
  188. package/dist/components/btn.css +80 -74
  189. package/dist/components/card.css +117 -106
  190. package/dist/components/cascader.css +311 -0
  191. package/dist/components/cascader.mjs +3 -0
  192. package/dist/components/chart-area.css +8 -2
  193. package/dist/components/chart-bar.css +95 -33
  194. package/dist/components/chart-gauge.css +14 -11
  195. package/dist/components/chart-graph.css +60 -0
  196. package/dist/components/chart-graph.mjs +4 -0
  197. package/dist/components/chart-heatmap.css +96 -90
  198. package/dist/components/chart-line.css +8 -3
  199. package/dist/components/chart-map.mjs +3 -0
  200. package/dist/components/chart-pie.css +9 -6
  201. package/dist/components/chart-radar.css +8 -5
  202. package/dist/components/chart-scatter.css +9 -6
  203. package/dist/components/chart-scatter.mjs +1 -1
  204. package/dist/components/chart-sparkline.css +5 -2
  205. package/dist/components/chart-stack.css +14 -11
  206. package/dist/components/charts.css +190 -67
  207. package/dist/components/charts.mjs +1 -0
  208. package/dist/components/code-block.css +418 -0
  209. package/dist/components/code-block.mjs +4 -0
  210. package/dist/components/command-palette.css +138 -117
  211. package/dist/components/content.css +257 -251
  212. package/dist/components/copy.css +72 -44
  213. package/dist/components/datatable.css +423 -181
  214. package/dist/components/date-picker.css +135 -104
  215. package/dist/components/empty.css +68 -65
  216. package/dist/components/feedback.css +201 -183
  217. package/dist/components/form-validate.css +120 -0
  218. package/dist/components/form-validate.mjs +3 -0
  219. package/dist/components/form.css +150 -127
  220. package/dist/components/icon.css +102 -0
  221. package/dist/components/icon.mjs +3 -0
  222. package/dist/components/input.css +159 -104
  223. package/dist/components/kb-access.mjs +4 -0
  224. package/dist/components/kb-acl.mjs +4 -0
  225. package/dist/components/kb-agent.css +496 -0
  226. package/dist/components/kb-answer.mjs +4 -0
  227. package/dist/components/kb-audit.mjs +4 -0
  228. package/dist/components/kb-canvas.mjs +4 -0
  229. package/dist/components/kb-chain.mjs +4 -0
  230. package/dist/components/kb-checkpoint.mjs +4 -0
  231. package/dist/components/kb-chunks.mjs +4 -0
  232. package/dist/components/kb-citation.mjs +4 -0
  233. package/dist/components/kb-clarify.mjs +4 -0
  234. package/dist/components/kb-conflict.mjs +4 -0
  235. package/dist/components/kb-connector.mjs +4 -0
  236. package/dist/components/kb-data.css +653 -0
  237. package/dist/components/kb-eval.mjs +4 -0
  238. package/dist/components/kb-explain.mjs +4 -0
  239. package/dist/components/kb-filter.mjs +4 -0
  240. package/dist/components/kb-gap.mjs +4 -0
  241. package/dist/components/kb-ground.css +578 -0
  242. package/dist/components/kb-hittest.mjs +4 -0
  243. package/dist/components/kb-ingest.css +882 -0
  244. package/dist/components/kb-metadata.mjs +4 -0
  245. package/dist/components/kb-ops.css +554 -0
  246. package/dist/components/kb-passage.mjs +4 -0
  247. package/dist/components/kb-perm.css +433 -0
  248. package/dist/components/kb-pipeline.mjs +4 -0
  249. package/dist/components/kb-qa.mjs +4 -0
  250. package/dist/components/kb-rerank.mjs +4 -0
  251. package/dist/components/kb-retrieval.mjs +4 -0
  252. package/dist/components/kb-review.mjs +4 -0
  253. package/dist/components/kb-sandbox.mjs +4 -0
  254. package/dist/components/kb-search.css +897 -0
  255. package/dist/components/kb-segment.mjs +4 -0
  256. package/dist/components/kb-sources.mjs +4 -0
  257. package/dist/components/kb-sql.mjs +4 -0
  258. package/dist/components/kb-trace.mjs +4 -0
  259. package/dist/components/kb-visibility.mjs +4 -0
  260. package/dist/components/kb-who-can.mjs +4 -0
  261. package/dist/components/kb.css +263 -0
  262. package/dist/components/kb.mjs +9 -0
  263. package/dist/components/layout.css +85 -82
  264. package/dist/components/material-chinese.css +73 -0
  265. package/dist/components/material-soviet.css +76 -0
  266. package/dist/components/material.css +275 -0
  267. package/dist/components/media.css +220 -166
  268. package/dist/components/mentions.css +189 -0
  269. package/dist/components/mentions.mjs +3 -0
  270. package/dist/components/menu.css +113 -105
  271. package/dist/components/modal.css +107 -112
  272. package/dist/components/nav.css +118 -115
  273. package/dist/components/notification.css +238 -174
  274. package/dist/components/pagination.css +56 -53
  275. package/dist/components/panel.css +66 -63
  276. package/dist/components/panel.mjs +1 -0
  277. package/dist/components/pill.css +81 -71
  278. package/dist/components/popover.css +67 -53
  279. package/dist/components/scroll-area.css +113 -110
  280. package/dist/components/segmented.css +146 -143
  281. package/dist/components/select.css +206 -186
  282. package/dist/components/sidebar.css +137 -127
  283. package/dist/components/slider.css +117 -114
  284. package/dist/components/split-pane.css +112 -109
  285. package/dist/components/stat.css +112 -106
  286. package/dist/components/steps.css +109 -103
  287. package/dist/components/switch.css +138 -134
  288. package/dist/components/table.css +131 -107
  289. package/dist/components/tabs.css +114 -108
  290. package/dist/components/tag-input.css +48 -133
  291. package/dist/components/tag.css +81 -71
  292. package/dist/components/theme-switcher.css +105 -0
  293. package/dist/components/theme-switcher.mjs +3 -0
  294. package/dist/components/toast.css +100 -86
  295. package/dist/components/toolbar.css +45 -42
  296. package/dist/components/tooltip.css +102 -43
  297. package/dist/components/tooltip.mjs +1 -0
  298. package/dist/components/tree-select.css +416 -0
  299. package/dist/components/tree-select.mjs +3 -0
  300. package/dist/components/upload.css +135 -92
  301. package/dist/fonts/LICENSES/ark-pixel/OFL.txt +96 -0
  302. package/dist/fonts/LICENSES/cubic-11/OFL.txt +108 -0
  303. package/dist/fonts/LICENSES/galmuri/LICENSE.txt +93 -0
  304. package/dist/fonts/OFL.txt +96 -0
  305. package/dist/fonts/README.md +14 -0
  306. package/dist/fonts/fusion-pixel-12px-zh-hans.woff2 +0 -0
  307. package/dist/index.d.mts +64 -15
  308. package/dist/index.mjs +28049 -8595
  309. package/dist/react.d.mts +91 -0
  310. package/dist/react.mjs +8208 -0
  311. package/dist/registry.json +454 -15
  312. package/dist/tokens/chinese.css +44 -0
  313. package/dist/tokens/colors.css +365 -1222
  314. package/dist/tokens/design.css +109 -0
  315. package/dist/tokens/dtcg.json +11198 -0
  316. package/dist/tokens/figma.variables.json +7017 -0
  317. package/dist/tokens/icon-masks.css +78 -0
  318. package/dist/tokens/pixel.css +50 -0
  319. package/dist/tokens/soviet.css +44 -0
  320. package/dist/tokens/style-profiles.css +36 -547
  321. package/dist/tokens/themes.json +308 -0
  322. package/dist/tokens/tokens-studio.json +6728 -0
  323. package/dist/tokens/typography.css +21 -18
  324. package/dist/tokens.css +1555 -1801
  325. package/dist/ui.css +16147 -8597
  326. package/dist/vue.d.mts +344 -0
  327. package/dist/vue.mjs +7781 -0
  328. package/docs/spec/ai-input-experience.md +75 -0
  329. package/docs/spec/ai-native.md +238 -147
  330. package/docs/spec/design-philosophy.md +189 -0
  331. package/docs/spec/design-primitives.md +196 -0
  332. package/docs/spec/kb-family.md +475 -0
  333. package/package.json +42 -7
  334. package/dist/retro-effects.css +0 -255
  335. package/dist/tokens/retro-effects.css +0 -255
@@ -0,0 +1,653 @@
1
+ @layer icen.components {
2
+ /*
3
+ * @icen.ai/ui — kb-data.css(问数域:kb-sql / kb-answer / kb-clarify / kb-explain)
4
+ * 共享原语在 kb.css(.icen-kb-row/.icen-kb-num/.icen-kb-chip/.icen-kb-badge/.icen-kb-fold-head/.icen-kb-notice…),
5
+ * 本文件只做本域专属结构。DOM 契约见 docs/spec/kb-family.md §5.15–5.18 与各 behavior 头注释。
6
+ *
7
+ * 域内色彩纪律(spec §2 数字域):
8
+ * - 数字本身永远中性色(.icen-kb-num / 结果表右对齐列),success 只表达「可信资产」(认证徽章);
9
+ * - SQL 着色是语法层级信号不是装饰:全部 color-mix 半透明降饱和(kw=accent /
10
+ * str=success / num=warning / fn=info / cmt=faint);
11
+ * - 修正卡 = warning 边框(告警语义);权限提示不可关闭(诚实呈现,无 dismiss 样式钩子)。
12
+ * 只消费 --icen-token-* / --icen-radius-* / --icen-density-* / --icen-font-mono;明暗自适应走 token 与 [data-icen-theme="dark"] 档。
13
+ */
14
+
15
+ /* ═══════════════════ kb-sql · 生成 SQL 卡片 ═══════════════════ */
16
+
17
+ .icen-kb-sql {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 8px;
21
+ min-width: 0;
22
+ padding: 10px 12px;
23
+ border: 1px solid var(--icen-token-line-soft);
24
+ border-radius: var(--icen-radius-md);
25
+ background: var(--icen-token-surface);
26
+ }
27
+
28
+ .icen-kb-sql-head {
29
+ display: flex;
30
+ align-items: center;
31
+ gap: 8px;
32
+ flex-wrap: wrap;
33
+ min-height: 24px;
34
+ }
35
+
36
+ .icen-kb-sql-title {
37
+ font-size: 13px;
38
+ font-weight: 600;
39
+ color: var(--icen-token-text);
40
+ white-space: nowrap;
41
+ }
42
+
43
+ .icen-kb-sql-tables {
44
+ display: inline-flex;
45
+ align-items: center;
46
+ gap: 4px;
47
+ flex-wrap: wrap;
48
+ min-width: 0;
49
+ }
50
+
51
+ .icen-kb-sql-actions {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ gap: 6px;
55
+ margin-inline-start: auto;
56
+ flex: 0 0 auto;
57
+ }
58
+
59
+ /* ghost 图标钮(复制/编辑/应用/确认共用底座) */
60
+ .icen-kb-sql-btn {
61
+ display: inline-flex;
62
+ align-items: center;
63
+ gap: 4px;
64
+ min-height: 22px;
65
+ padding: 2px 8px;
66
+ font: inherit;
67
+ font-size: 11.5px;
68
+ color: var(--icen-token-text-muted);
69
+ background: transparent;
70
+ border: 1px solid var(--icen-token-line-soft);
71
+ border-radius: var(--icen-radius-sm);
72
+ cursor: pointer;
73
+ white-space: nowrap;
74
+ }
75
+ .icen-kb-sql-btn:hover:not(:disabled) {
76
+ color: var(--icen-token-text);
77
+ border-color: var(--icen-token-line);
78
+ background: var(--icen-token-bg-soft);
79
+ }
80
+ .icen-kb-sql-btn:focus-visible {
81
+ outline: 2px solid var(--icen-token-accent);
82
+ outline-offset: 1px;
83
+ }
84
+ .icen-kb-sql-btn:disabled {
85
+ opacity: 0.55;
86
+ cursor: default;
87
+ }
88
+ .icen-kb-sql-btn-icon,
89
+ .icen-kb-sql-btn-icon svg {
90
+ width: 12px;
91
+ height: 12px;
92
+ flex: 0 0 auto;
93
+ }
94
+ .icen-kb-sql-btn--run {
95
+ color: var(--icen-token-accent);
96
+ border-color: color-mix(in srgb, var(--icen-token-accent) 45%, transparent);
97
+ }
98
+ .icen-kb-sql-btn--run:hover:not(:disabled) {
99
+ color: var(--icen-token-accent);
100
+ border-color: var(--icen-token-accent);
101
+ background: var(--icen-token-accent-subtle);
102
+ }
103
+ /* 修正卡内的主行动(一屏一个 accent 级操作:此处告警色承载) */
104
+ .icen-kb-sql-btn--apply {
105
+ color: var(--icen-token-warning);
106
+ border-color: color-mix(in srgb, var(--icen-token-warning) 45%, transparent);
107
+ background: var(--icen-token-warning-muted);
108
+ }
109
+ .icen-kb-sql-btn--apply:hover:not(:disabled) {
110
+ color: var(--icen-token-warning);
111
+ border-color: var(--icen-token-warning);
112
+ }
113
+
114
+ /* SQL 码块:浅色 bg-soft / 深色更深一档([data-icen-theme="dark"] 类,与 tokens 同机制) */
115
+ .icen-kb-sql-code {
116
+ margin: 0;
117
+ padding: 10px 12px;
118
+ background: var(--icen-token-bg-soft);
119
+ border: 1px solid var(--icen-token-line-soft);
120
+ border-radius: var(--icen-radius-sm);
121
+ font-family: var(--icen-font-mono);
122
+ font-size: 12px;
123
+ line-height: 1.65;
124
+ color: var(--icen-token-text);
125
+ white-space: pre;
126
+ overflow: auto;
127
+ max-height: 320px;
128
+ tab-size: 2;
129
+ }
130
+ [data-icen-theme="dark"] .icen-kb-sql-code {
131
+ background: color-mix(in srgb, var(--icen-token-bg) 85%, black);
132
+ border-color: color-mix(in srgb, var(--icen-token-line-soft) 70%, transparent);
133
+ }
134
+
135
+ /* 语法 token:color-mix 半透明降饱和(语法层级,非装饰) */
136
+ .icen-kb-sql-tok--kw { color: var(--icen-token-accent-text); }
137
+ .icen-kb-sql-tok--str { color: color-mix(in srgb, var(--icen-token-success) 82%, transparent); }
138
+ .icen-kb-sql-tok--num { color: color-mix(in srgb, var(--icen-token-warning) 50%, var(--icen-token-text)); }
139
+ .icen-kb-sql-tok--fn { color: var(--icen-token-info); }
140
+ .icen-kb-sql-tok--cmt { color: var(--icen-token-text-muted); font-style: italic; }
141
+
142
+ /* 修正卡(warning 边框:「修复已就绪」心智) */
143
+ .icen-kb-sql-fix {
144
+ display: flex;
145
+ flex-direction: column;
146
+ gap: 8px;
147
+ padding: 8px 10px;
148
+ border: 1px solid color-mix(in srgb, var(--icen-token-warning) 45%, transparent);
149
+ border-radius: var(--icen-radius-sm);
150
+ background: color-mix(in srgb, var(--icen-token-warning) 5%, transparent);
151
+ }
152
+ .icen-kb-sql-fix-head {
153
+ display: flex;
154
+ align-items: center;
155
+ gap: 8px;
156
+ flex-wrap: wrap;
157
+ }
158
+ .icen-kb-sql-fix-title {
159
+ display: inline-flex;
160
+ align-items: center;
161
+ gap: 6px;
162
+ font-size: 12px;
163
+ color: var(--icen-token-warning);
164
+ }
165
+ .icen-kb-sql-fix-title svg {
166
+ width: 13px;
167
+ height: 13px;
168
+ flex: 0 0 auto;
169
+ }
170
+ .icen-kb-sql-fix-title + .icen-kb-sql-btn,
171
+ .icen-kb-sql-fix-head .icen-kb-sql-btn {
172
+ margin-inline-start: auto;
173
+ }
174
+ .icen-kb-sql-fix-diff {
175
+ min-inline-size: 0;
176
+ border-radius: var(--icen-radius-sm);
177
+ overflow: hidden;
178
+ }
179
+ .icen-kb-sql-fix-diff .icen-ai-diff-file {
180
+ border: 1px solid var(--icen-token-line-soft);
181
+ }
182
+
183
+ /* 编辑态:pre ↔ textarea 同尺寸心智(mono) */
184
+ .icen-kb-sql-editor {
185
+ display: flex;
186
+ flex-direction: column;
187
+ gap: 8px;
188
+ }
189
+ .icen-kb-sql-editor[hidden] {
190
+ display: none;
191
+ }
192
+ .icen-kb-sql-textarea {
193
+ width: 100%;
194
+ min-height: 132px;
195
+ padding: 10px 12px;
196
+ font-family: var(--icen-font-mono);
197
+ font-size: 12px;
198
+ line-height: 1.65;
199
+ color: var(--icen-token-text);
200
+ background: var(--icen-token-bg-soft);
201
+ border: 1px solid var(--icen-token-line);
202
+ border-radius: var(--icen-radius-sm);
203
+ resize: vertical;
204
+ tab-size: 2;
205
+ }
206
+ .icen-kb-sql-textarea:focus-visible {
207
+ outline: 2px solid var(--icen-token-accent);
208
+ outline-offset: -1px;
209
+ }
210
+ .icen-kb-sql-editor-actions {
211
+ display: flex;
212
+ justify-content: flex-end;
213
+ gap: 8px;
214
+ }
215
+ .icen-kb-sql.is-editing .icen-kb-sql-fix {
216
+ display: none; /* 编辑当前 SQL 时隐藏旧版修复对比,避免双修离心 */
217
+ }
218
+
219
+ /* ═══════════════════ kb-clarify · 澄清反问卡 ═══════════════════ */
220
+
221
+ .icen-kb-clarify {
222
+ display: flex;
223
+ flex-direction: column;
224
+ gap: 8px;
225
+ padding: 10px 12px;
226
+ border: 1px dashed var(--icen-token-line-dashed);
227
+ border-radius: var(--icen-radius-sm);
228
+ background: var(--icen-token-bg-soft);
229
+ }
230
+ .icen-kb-clarify.is-answered {
231
+ border-style: solid;
232
+ border-color: color-mix(in srgb, var(--icen-token-accent) 30%, transparent);
233
+ }
234
+ .icen-kb-clarify-q {
235
+ display: flex;
236
+ align-items: flex-start;
237
+ gap: 6px;
238
+ font-size: 13px;
239
+ color: var(--icen-token-text);
240
+ line-height: 1.6;
241
+ }
242
+ .icen-kb-clarify-qicon,
243
+ .icen-kb-clarify-qicon svg {
244
+ width: 14px;
245
+ height: 14px;
246
+ flex: 0 0 auto;
247
+ margin-top: 2px;
248
+ color: var(--icen-token-accent);
249
+ }
250
+ .icen-kb-clarify-qtext {
251
+ min-width: 0;
252
+ }
253
+ .icen-kb-clarify-opts {
254
+ display: flex;
255
+ flex-wrap: wrap;
256
+ gap: 6px;
257
+ }
258
+ .icen-kb-clarify-opt {
259
+ font: inherit;
260
+ font-size: 12px;
261
+ min-height: 24px;
262
+ padding: 3px 12px;
263
+ color: var(--icen-token-text-muted);
264
+ background: var(--icen-token-surface);
265
+ border: 1px solid var(--icen-token-line-soft);
266
+ border-radius: var(--icen-radius-full);
267
+ cursor: pointer;
268
+ transition: color 0.16s ease-out, border-color 0.16s ease-out, background 0.16s ease-out;
269
+ }
270
+ .icen-kb-clarify-opt:hover:not(:disabled) {
271
+ color: var(--icen-token-text);
272
+ border-color: color-mix(in srgb, var(--icen-token-accent) 45%, transparent);
273
+ }
274
+ .icen-kb-clarify-opt:focus-visible {
275
+ outline: 2px solid var(--icen-token-accent);
276
+ outline-offset: 1px;
277
+ }
278
+ .icen-kb-clarify-opt.is-picked {
279
+ color: var(--icen-token-accent);
280
+ border-color: color-mix(in srgb, var(--icen-token-accent) 55%, transparent);
281
+ background: var(--icen-token-accent-subtle);
282
+ }
283
+ .icen-kb-clarify-opt:disabled {
284
+ opacity: 0.55;
285
+ cursor: default;
286
+ }
287
+ .icen-kb-clarify-resolved {
288
+ font-size: 12px;
289
+ color: var(--icen-token-text-muted);
290
+ }
291
+ .icen-kb-clarify-picked {
292
+ font-weight: 600;
293
+ color: var(--icen-token-text);
294
+ }
295
+ .icen-kb-clarify-reason {
296
+ font-size: 11.5px;
297
+ color: var(--icen-token-text-faint);
298
+ }
299
+
300
+ /* ═══════════════════ kb-explain · 口径解释折叠 ═══════════════════ */
301
+
302
+ .icen-kb-explain {
303
+ min-width: 0;
304
+ border: 1px solid var(--icen-token-line-soft);
305
+ border-radius: var(--icen-radius-sm);
306
+ background: var(--icen-token-bg-soft);
307
+ overflow: hidden;
308
+ }
309
+ .icen-kb-explain-head {
310
+ border-radius: 0;
311
+ }
312
+ .icen-kb-explain-head:hover {
313
+ border-radius: var(--icen-radius-sm);
314
+ }
315
+ .icen-kb-explain-title {
316
+ white-space: nowrap;
317
+ overflow: hidden;
318
+ text-overflow: ellipsis;
319
+ }
320
+ .icen-kb-explain-body {
321
+ display: flex;
322
+ flex-direction: column;
323
+ gap: 8px;
324
+ padding-block: 4px 10px;
325
+ padding-inline: 10px 28px;
326
+ }
327
+ .icen-kb-explain-group {
328
+ display: flex;
329
+ align-items: baseline;
330
+ gap: 6px;
331
+ flex-wrap: wrap;
332
+ }
333
+ .icen-kb-explain-group-label {
334
+ flex: 0 0 auto;
335
+ min-inline-size: 2.5em;
336
+ font-size: 11px;
337
+ color: var(--icen-token-text-faint);
338
+ }
339
+ .icen-kb-explain-metrics {
340
+ display: flex;
341
+ flex-direction: column;
342
+ gap: 4px;
343
+ padding-top: 8px;
344
+ border-top: 1px dashed var(--icen-token-line-dashed);
345
+ }
346
+ .icen-kb-explain-metric {
347
+ display: flex;
348
+ align-items: center;
349
+ gap: 10px;
350
+ flex-wrap: wrap;
351
+ font-size: 12.5px;
352
+ }
353
+ .icen-kb-explain-metric-name {
354
+ color: var(--icen-token-text);
355
+ font-weight: 500;
356
+ }
357
+ .icen-kb-explain-metric-ref {
358
+ font-size: 11.5px;
359
+ color: var(--icen-token-accent);
360
+ text-decoration: none;
361
+ border-bottom: 1px solid color-mix(in srgb, var(--icen-token-accent) 35%, transparent);
362
+ }
363
+ .icen-kb-explain-metric-ref:hover {
364
+ border-bottom-color: var(--icen-token-accent);
365
+ }
366
+ .icen-kb-explain-count {
367
+ flex: 0 0 auto;
368
+ }
369
+
370
+ /* ═══════════════════ kb-answer · 答案组合容器 ═══════════════════ */
371
+
372
+ .icen-kb-answer {
373
+ display: flex;
374
+ flex-direction: column;
375
+ gap: 12px;
376
+ min-width: 0;
377
+ font-size: 13px;
378
+ }
379
+
380
+ /* 徽章区 */
381
+ .icen-kb-answer-badges {
382
+ display: flex;
383
+ align-items: center;
384
+ gap: 8px;
385
+ flex-wrap: wrap;
386
+ }
387
+ .icen-kb-verified {
388
+ display: inline-flex;
389
+ align-items: center;
390
+ gap: 8px;
391
+ flex-wrap: wrap;
392
+ padding: 0;
393
+ font: inherit;
394
+ background: none;
395
+ border: none;
396
+ cursor: pointer;
397
+ text-align: start;
398
+ }
399
+ .icen-kb-verified:focus-visible {
400
+ outline: 2px solid var(--icen-token-accent);
401
+ outline-offset: 3px;
402
+ border-radius: var(--icen-radius-sm);
403
+ }
404
+ .icen-kb-verified-via {
405
+ font-size: 11.5px;
406
+ color: var(--icen-token-text-muted);
407
+ }
408
+ .icen-kb-verified-note {
409
+ font-size: 11.5px;
410
+ color: var(--icen-token-text-faint);
411
+ }
412
+ .icen-kb-verified-hint {
413
+ font-size: 11px;
414
+ color: var(--icen-token-text-faint);
415
+ border-inline-start: 2px solid var(--icen-token-line-soft);
416
+ padding-inline-start: 8px;
417
+ }
418
+ .icen-kb-verified:hover .icen-kb-verified-via {
419
+ color: var(--icen-token-text);
420
+ }
421
+
422
+ /* 权限提示(行级过滤 + 脱敏列;不可关闭) */
423
+ .icen-kb-perm {
424
+ display: flex;
425
+ align-items: center;
426
+ gap: 8px;
427
+ flex-wrap: wrap;
428
+ width: 100%;
429
+ padding: 4px 8px;
430
+ border-radius: var(--icen-radius-sm);
431
+ background: var(--icen-token-bg-soft);
432
+ font-size: 11.5px;
433
+ color: var(--icen-token-text-muted);
434
+ }
435
+ .icen-kb-perm-icon,
436
+ .icen-kb-perm-icon svg {
437
+ width: 12px;
438
+ height: 12px;
439
+ flex: 0 0 auto;
440
+ color: var(--icen-token-text-faint);
441
+ }
442
+ .icen-kb-perm-mask {
443
+ display: inline-flex;
444
+ align-items: center;
445
+ gap: 4px;
446
+ flex-wrap: wrap;
447
+ }
448
+ .icen-kb-perm-mask-label {
449
+ color: var(--icen-token-text-faint);
450
+ }
451
+ .icen-kb-perm-mask .icen-kb-chip {
452
+ border-color: color-mix(in srgb, var(--icen-token-warning) 35%, transparent);
453
+ }
454
+
455
+ /* 正文与简化引用角标(与 kb-ground 域 .icen-kb-citation 类名一致;默认弱化,hover 点亮) */
456
+ .icen-kb-answer-body {
457
+ font-size: 13px;
458
+ line-height: 1.75;
459
+ color: var(--icen-token-text);
460
+ white-space: pre-wrap;
461
+ overflow-wrap: anywhere;
462
+ }
463
+ .icen-kb-answer-body .icen-kb-citation {
464
+ font-size: 10.5px;
465
+ line-height: 1;
466
+ margin: 0 1px;
467
+ padding: 1px 5px;
468
+ color: var(--icen-token-text-faint);
469
+ background: var(--icen-token-bg-soft);
470
+ border: 1px solid var(--icen-token-line-soft);
471
+ border-radius: var(--icen-radius-full);
472
+ cursor: default;
473
+ transition: color 0.16s ease-out, border-color 0.16s ease-out;
474
+ }
475
+ .icen-kb-answer-body .icen-kb-citation:hover {
476
+ color: var(--icen-token-accent);
477
+ border-color: color-mix(in srgb, var(--icen-token-accent) 45%, transparent);
478
+ }
479
+
480
+ /* 槽位 */
481
+ .icen-kb-answer-clarify,
482
+ .icen-kb-answer-explain {
483
+ min-width: 0;
484
+ }
485
+
486
+ /* 结果表:滚动容器 + sticky 表头 + 数字列右对齐(数字永远中性色) */
487
+ .icen-kb-answer-results {
488
+ display: flex;
489
+ flex-direction: column;
490
+ gap: 6px;
491
+ min-width: 0;
492
+ }
493
+ .icen-kb-result-meta {
494
+ display: flex;
495
+ align-items: center;
496
+ gap: 10px;
497
+ flex-wrap: wrap;
498
+ }
499
+ .icen-kb-result-export {
500
+ display: inline-flex;
501
+ gap: 6px;
502
+ margin-inline-start: auto;
503
+ }
504
+ .icen-kb-result-export-btn {
505
+ font: inherit;
506
+ font-size: 11.5px;
507
+ min-height: 22px;
508
+ padding: 2px 8px;
509
+ color: var(--icen-token-text-muted);
510
+ background: transparent;
511
+ border: 1px solid var(--icen-token-line-soft);
512
+ border-radius: var(--icen-radius-sm);
513
+ cursor: pointer;
514
+ }
515
+ .icen-kb-result-export-btn:hover:not(:disabled) {
516
+ color: var(--icen-token-text);
517
+ border-color: var(--icen-token-line);
518
+ background: var(--icen-token-bg-soft);
519
+ }
520
+ .icen-kb-result-export-btn:focus-visible {
521
+ outline: 2px solid var(--icen-token-accent);
522
+ outline-offset: 1px;
523
+ }
524
+ .icen-kb-result-export-btn:disabled {
525
+ opacity: 0.55;
526
+ cursor: default;
527
+ }
528
+ .icen-kb-result-scroll {
529
+ overflow: auto;
530
+ max-height: 360px;
531
+ border: 1px solid var(--icen-token-line-soft);
532
+ border-radius: var(--icen-radius-sm);
533
+ background: var(--icen-token-surface);
534
+ }
535
+ .icen-kb-result-table {
536
+ width: 100%;
537
+ border-collapse: separate;
538
+ border-spacing: 0;
539
+ font-size: 12.5px;
540
+ }
541
+ .icen-kb-result-table th {
542
+ position: sticky;
543
+ top: 0;
544
+ z-index: 1;
545
+ padding: 6px 10px;
546
+ background: var(--icen-token-bg-soft);
547
+ border-bottom: 1px solid var(--icen-token-line-soft);
548
+ font-size: 11.5px;
549
+ font-weight: 600;
550
+ color: var(--icen-token-text-muted);
551
+ text-align: start;
552
+ white-space: nowrap;
553
+ }
554
+ .icen-kb-result-table td {
555
+ padding: 5px 10px;
556
+ border-bottom: 1px solid color-mix(in srgb, var(--icen-token-line-soft) 50%, transparent);
557
+ color: var(--icen-token-text);
558
+ white-space: nowrap;
559
+ }
560
+ .icen-kb-result-table tbody tr:last-child td {
561
+ border-bottom: none;
562
+ }
563
+ .icen-kb-result-table tbody tr:hover td {
564
+ background: var(--icen-token-bg-soft);
565
+ }
566
+ /* 数字列:等宽 + tabular-nums + 右对齐(数字是 LTR 文种,物理右对齐惯例,RTL 不镜像) */
567
+ .icen-kb-result-table th.icen-kb-num,
568
+ .icen-kb-result-table td.icen-kb-num {
569
+ font-family: var(--icen-font-mono);
570
+ font-variant-numeric: tabular-nums;
571
+ text-align: right; /* guard:allow-physical 数字列物理右对齐惯例,RTL 不镜像 */
572
+ }
573
+ .icen-kb-result-null {
574
+ color: var(--icen-token-text-faint);
575
+ }
576
+ .icen-kb-result-truncated {
577
+ padding: 2px 8px;
578
+ }
579
+
580
+ /* 图表区(renderChart 复用;类型切换 chips) */
581
+ .icen-kb-answer-chart {
582
+ display: flex;
583
+ flex-direction: column;
584
+ gap: 8px;
585
+ min-width: 0;
586
+ }
587
+ .icen-kb-chart-switch {
588
+ display: flex;
589
+ align-items: center;
590
+ gap: 6px;
591
+ }
592
+ .icen-kb-chart-chip {
593
+ font: inherit;
594
+ font-size: 11.5px;
595
+ min-height: 22px;
596
+ padding: 2px 10px;
597
+ color: var(--icen-token-text-muted);
598
+ background: transparent;
599
+ border: 1px solid var(--icen-token-line-soft);
600
+ border-radius: var(--icen-radius-full);
601
+ cursor: pointer;
602
+ transition: color 0.16s ease-out, border-color 0.16s ease-out, background 0.16s ease-out;
603
+ }
604
+ .icen-kb-chart-chip:hover {
605
+ color: var(--icen-token-text);
606
+ border-color: var(--icen-token-line);
607
+ }
608
+ .icen-kb-chart-chip:focus-visible {
609
+ outline: 2px solid var(--icen-token-accent);
610
+ outline-offset: 1px;
611
+ }
612
+ .icen-kb-chart-chip.is-active {
613
+ color: var(--icen-token-accent-text);
614
+ border-color: color-mix(in srgb, var(--icen-token-accent) 55%, transparent);
615
+ background: var(--icen-token-accent-subtle);
616
+ }
617
+ .icen-kb-chart-mount {
618
+ min-height: 0;
619
+ }
620
+
621
+ /* 追问建议 */
622
+ .icen-kb-answer-followups {
623
+ display: flex;
624
+ align-items: center;
625
+ gap: 6px;
626
+ flex-wrap: wrap;
627
+ }
628
+ .icen-kb-followups-label {
629
+ font-size: 11.5px;
630
+ color: var(--icen-token-text-faint);
631
+ }
632
+ .icen-kb-followup {
633
+ cursor: pointer;
634
+ transition: border-color 0.16s ease-out, color 0.16s ease-out;
635
+ }
636
+ .icen-kb-followup:hover {
637
+ color: var(--icen-token-text);
638
+ border-color: color-mix(in srgb, var(--icen-token-accent) 45%, transparent);
639
+ }
640
+ .icen-kb-followup:focus-visible {
641
+ outline: 2px solid var(--icen-token-accent);
642
+ outline-offset: 1px;
643
+ }
644
+
645
+ /* ═══════════════════ 密度档 ═══════════════════ */
646
+
647
+ [data-icen-density='compact'] .icen-kb-sql { padding: 8px 10px; gap: 6px; }
648
+ [data-icen-density='compact'] .icen-kb-result-table th { padding: 4px 8px; }
649
+ [data-icen-density='compact'] .icen-kb-result-table td { padding: 3px 8px; }
650
+ [data-icen-density='compact'] .icen-kb-answer { gap: 8px; }
651
+ [data-icen-density='compact'] .icen-kb-clarify { padding: 8px 10px; }
652
+
653
+ }
@@ -0,0 +1,4 @@
1
+ // @icen.ai/ui — kit: kb-eval(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './kb-ops.css';
3
+ import './kb.css';
4
+ export * from '../behaviors/kb-eval.mjs';
@@ -0,0 +1,4 @@
1
+ // @icen.ai/ui — kit: kb-explain(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './kb-data.css';
3
+ import './kb.css';
4
+ export * from '../behaviors/kb-explain.mjs';
@@ -0,0 +1,4 @@
1
+ // @icen.ai/ui — kit: kb-filter(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './kb-search.css';
3
+ import './kb.css';
4
+ export * from '../behaviors/kb-filter.mjs';
@@ -0,0 +1,4 @@
1
+ // @icen.ai/ui — kit: kb-gap(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './kb-ops.css';
3
+ import './kb.css';
4
+ export * from '../behaviors/kb-gap.mjs';