@icen.ai/ui 0.9.0 → 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 (281) hide show
  1. package/AGENTS.md +138 -80
  2. package/README.md +66 -91
  3. package/dist/base.css +208 -179
  4. package/dist/behaviors/accordion.mjs +8 -8
  5. package/dist/behaviors/ai-branch.d.mts +1 -1
  6. package/dist/behaviors/ai-branch.mjs +1010 -94
  7. package/dist/behaviors/ai-chat.d.mts +7 -7
  8. package/dist/behaviors/ai-chat.mjs +1071 -161
  9. package/dist/behaviors/ai-composer.d.mts +44 -12
  10. package/dist/behaviors/ai-composer.mjs +1997 -524
  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 +1 -1
  15. package/dist/behaviors/ai-feedback.mjs +1035 -126
  16. package/dist/behaviors/ai-panel.d.mts +8 -8
  17. package/dist/behaviors/ai-panel.mjs +1284 -266
  18. package/dist/behaviors/ai-provider.mjs +1003 -101
  19. package/dist/behaviors/ai-threads.d.mts +1 -1
  20. package/dist/behaviors/ai-threads.mjs +1068 -154
  21. package/dist/behaviors/ai-tool.d.mts +2 -2
  22. package/dist/behaviors/ai-tool.mjs +2037 -396
  23. package/dist/behaviors/ai-tools.d.mts +89 -16
  24. package/dist/behaviors/ai-tools.mjs +4448 -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 +72 -8
  34. package/dist/behaviors/charts.mjs +1901 -256
  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 +120 -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 +1 -1
  68. package/dist/behaviors/kb-access.mjs +2129 -239
  69. package/dist/behaviors/kb-acl.d.mts +6 -6
  70. package/dist/behaviors/kb-acl.mjs +1119 -179
  71. package/dist/behaviors/kb-answer.mjs +2070 -418
  72. package/dist/behaviors/kb-audit.d.mts +1 -1
  73. package/dist/behaviors/kb-audit.mjs +1076 -154
  74. package/dist/behaviors/kb-canvas.mjs +1100 -177
  75. package/dist/behaviors/kb-chain.mjs +1022 -100
  76. package/dist/behaviors/kb-checkpoint.d.mts +1 -1
  77. package/dist/behaviors/kb-checkpoint.mjs +1319 -169
  78. package/dist/behaviors/kb-chunks.mjs +1152 -213
  79. package/dist/behaviors/kb-citation.d.mts +1 -1
  80. package/dist/behaviors/kb-citation.mjs +1201 -179
  81. package/dist/behaviors/kb-clarify.mjs +1058 -130
  82. package/dist/behaviors/kb-conflict.mjs +1041 -119
  83. package/dist/behaviors/kb-connector.mjs +1104 -176
  84. package/dist/behaviors/kb-core.d.mts +6 -1
  85. package/dist/behaviors/kb-core.mjs +1077 -162
  86. package/dist/behaviors/kb-eval.mjs +1971 -144
  87. package/dist/behaviors/kb-explain.d.mts +1 -1
  88. package/dist/behaviors/kb-explain.mjs +1024 -102
  89. package/dist/behaviors/kb-filter.mjs +2008 -178
  90. package/dist/behaviors/kb-gap.d.mts +1 -1
  91. package/dist/behaviors/kb-gap.mjs +1043 -121
  92. package/dist/behaviors/kb-hittest.d.mts +1 -1
  93. package/dist/behaviors/kb-hittest.mjs +1093 -150
  94. package/dist/behaviors/kb-metadata.mjs +1052 -130
  95. package/dist/behaviors/kb-passage.d.mts +2 -2
  96. package/dist/behaviors/kb-passage.mjs +1101 -161
  97. package/dist/behaviors/kb-pipeline.d.mts +2 -2
  98. package/dist/behaviors/kb-pipeline.mjs +1082 -162
  99. package/dist/behaviors/kb-qa.mjs +1088 -160
  100. package/dist/behaviors/kb-rerank.mjs +1047 -114
  101. package/dist/behaviors/kb-retrieval.mjs +2063 -224
  102. package/dist/behaviors/kb-review.mjs +1990 -159
  103. package/dist/behaviors/kb-sandbox.d.mts +1 -1
  104. package/dist/behaviors/kb-sandbox.mjs +1026 -104
  105. package/dist/behaviors/kb-segment.mjs +1111 -179
  106. package/dist/behaviors/kb-select.d.mts +24 -0
  107. package/dist/behaviors/kb-select.mjs +1989 -0
  108. package/dist/behaviors/kb-sources.d.mts +1 -1
  109. package/dist/behaviors/kb-sources.mjs +1084 -170
  110. package/dist/behaviors/kb-sql.d.mts +1 -1
  111. package/dist/behaviors/kb-sql.mjs +1143 -226
  112. package/dist/behaviors/kb-trace.d.mts +1 -1
  113. package/dist/behaviors/kb-trace.mjs +1042 -128
  114. package/dist/behaviors/kb-visibility.mjs +1086 -158
  115. package/dist/behaviors/kb-who-can.mjs +1974 -137
  116. package/dist/behaviors/mentions.d.mts +93 -0
  117. package/dist/behaviors/mentions.mjs +2152 -0
  118. package/dist/behaviors/modal.d.mts +4 -3
  119. package/dist/behaviors/modal.mjs +1055 -33
  120. package/dist/behaviors/nav.d.mts +1 -1
  121. package/dist/behaviors/nav.mjs +6 -6
  122. package/dist/behaviors/notification.d.mts +16 -8
  123. package/dist/behaviors/notification.mjs +1615 -265
  124. package/dist/behaviors/panel.d.mts +4 -0
  125. package/dist/behaviors/panel.mjs +994 -0
  126. package/dist/behaviors/popover.d.mts +28 -5
  127. package/dist/behaviors/popover.mjs +225 -24
  128. package/dist/behaviors/select.d.mts +5 -2
  129. package/dist/behaviors/select.mjs +1410 -117
  130. package/dist/behaviors/sidebar.d.mts +1 -1
  131. package/dist/behaviors/sidebar.mjs +13 -13
  132. package/dist/behaviors/slider.d.mts +1 -1
  133. package/dist/behaviors/slider.mjs +9 -9
  134. package/dist/behaviors/split-pane.d.mts +1 -1
  135. package/dist/behaviors/split-pane.mjs +7 -7
  136. package/dist/behaviors/suggestions.d.mts +27 -0
  137. package/dist/behaviors/suggestions.mjs +1089 -0
  138. package/dist/behaviors/svg-parse.d.mts +14 -0
  139. package/dist/behaviors/svg-parse.mjs +37 -0
  140. package/dist/behaviors/tabs.d.mts +2 -2
  141. package/dist/behaviors/tabs.mjs +25 -25
  142. package/dist/behaviors/tag-input.d.mts +23 -5
  143. package/dist/behaviors/tag-input.mjs +1359 -104
  144. package/dist/behaviors/theme-switcher.d.mts +24 -0
  145. package/dist/behaviors/theme-switcher.mjs +1981 -0
  146. package/dist/behaviors/theme.d.mts +15 -8
  147. package/dist/behaviors/theme.mjs +390 -28
  148. package/dist/behaviors/toast.d.mts +24 -25
  149. package/dist/behaviors/toast.mjs +1266 -88
  150. package/dist/behaviors/tooltip.d.mts +4 -0
  151. package/dist/behaviors/tooltip.mjs +378 -0
  152. package/dist/behaviors/tree-select.d.mts +69 -0
  153. package/dist/behaviors/tree-select.mjs +1907 -0
  154. package/dist/behaviors/tree.d.mts +1 -1
  155. package/dist/behaviors/tree.mjs +15 -15
  156. package/dist/behaviors/upload.d.mts +3 -2
  157. package/dist/behaviors/upload.mjs +1076 -66
  158. package/dist/cli.mjs +5 -6
  159. package/dist/components/ai-chat.css +666 -573
  160. package/dist/components/ai-diff.css +153 -132
  161. package/dist/components/ai-panel.css +351 -343
  162. package/dist/components/ai-tool.css +393 -238
  163. package/dist/components/autocomplete.css +61 -0
  164. package/dist/components/autocomplete.mjs +3 -0
  165. package/dist/components/back-top.css +34 -31
  166. package/dist/components/badge.css +44 -41
  167. package/dist/components/breadcrumb.css +67 -46
  168. package/dist/components/btn.css +80 -74
  169. package/dist/components/card.css +117 -106
  170. package/dist/components/cascader.css +311 -0
  171. package/dist/components/cascader.mjs +3 -0
  172. package/dist/components/chart-area.css +8 -2
  173. package/dist/components/chart-bar.css +95 -33
  174. package/dist/components/chart-gauge.css +14 -11
  175. package/dist/components/chart-graph.css +20 -17
  176. package/dist/components/chart-heatmap.css +96 -90
  177. package/dist/components/chart-line.css +8 -3
  178. package/dist/components/chart-pie.css +9 -6
  179. package/dist/components/chart-radar.css +8 -5
  180. package/dist/components/chart-scatter.css +9 -6
  181. package/dist/components/chart-sparkline.css +5 -2
  182. package/dist/components/chart-stack.css +14 -11
  183. package/dist/components/charts.css +164 -73
  184. package/dist/components/code-block.css +418 -0
  185. package/dist/components/code-block.mjs +4 -0
  186. package/dist/components/command-palette.css +138 -117
  187. package/dist/components/content.css +257 -251
  188. package/dist/components/copy.css +72 -44
  189. package/dist/components/datatable.css +423 -181
  190. package/dist/components/date-picker.css +135 -104
  191. package/dist/components/empty.css +68 -65
  192. package/dist/components/feedback.css +201 -183
  193. package/dist/components/form-validate.css +120 -0
  194. package/dist/components/form-validate.mjs +3 -0
  195. package/dist/components/form.css +150 -127
  196. package/dist/components/icon.css +102 -0
  197. package/dist/components/icon.mjs +3 -0
  198. package/dist/components/input.css +159 -104
  199. package/dist/components/kb-agent.css +188 -173
  200. package/dist/components/kb-data.css +257 -253
  201. package/dist/components/kb-ground.css +197 -185
  202. package/dist/components/kb-ingest.css +334 -350
  203. package/dist/components/kb-ops.css +265 -259
  204. package/dist/components/kb-perm.css +260 -271
  205. package/dist/components/kb-search.css +317 -360
  206. package/dist/components/kb.css +120 -109
  207. package/dist/components/layout.css +85 -82
  208. package/dist/components/material-chinese.css +73 -0
  209. package/dist/components/material-soviet.css +76 -0
  210. package/dist/components/material.css +275 -0
  211. package/dist/components/media.css +220 -166
  212. package/dist/components/mentions.css +189 -0
  213. package/dist/components/mentions.mjs +3 -0
  214. package/dist/components/menu.css +113 -105
  215. package/dist/components/modal.css +107 -112
  216. package/dist/components/nav.css +118 -115
  217. package/dist/components/notification.css +238 -174
  218. package/dist/components/pagination.css +56 -53
  219. package/dist/components/panel.css +66 -63
  220. package/dist/components/panel.mjs +1 -0
  221. package/dist/components/pill.css +81 -71
  222. package/dist/components/popover.css +67 -53
  223. package/dist/components/scroll-area.css +113 -110
  224. package/dist/components/segmented.css +146 -143
  225. package/dist/components/select.css +206 -186
  226. package/dist/components/sidebar.css +137 -127
  227. package/dist/components/slider.css +117 -114
  228. package/dist/components/split-pane.css +112 -109
  229. package/dist/components/stat.css +112 -106
  230. package/dist/components/steps.css +109 -103
  231. package/dist/components/switch.css +138 -134
  232. package/dist/components/table.css +131 -107
  233. package/dist/components/tabs.css +114 -108
  234. package/dist/components/tag-input.css +48 -133
  235. package/dist/components/tag.css +81 -71
  236. package/dist/components/theme-switcher.css +105 -0
  237. package/dist/components/theme-switcher.mjs +3 -0
  238. package/dist/components/toast.css +100 -86
  239. package/dist/components/toolbar.css +45 -42
  240. package/dist/components/tooltip.css +102 -43
  241. package/dist/components/tooltip.mjs +1 -0
  242. package/dist/components/tree-select.css +416 -0
  243. package/dist/components/tree-select.mjs +3 -0
  244. package/dist/components/upload.css +135 -92
  245. package/dist/fonts/LICENSES/ark-pixel/OFL.txt +96 -0
  246. package/dist/fonts/LICENSES/cubic-11/OFL.txt +108 -0
  247. package/dist/fonts/LICENSES/galmuri/LICENSE.txt +93 -0
  248. package/dist/fonts/OFL.txt +96 -0
  249. package/dist/fonts/README.md +14 -0
  250. package/dist/fonts/fusion-pixel-12px-zh-hans.woff2 +0 -0
  251. package/dist/index.d.mts +28 -14
  252. package/dist/index.mjs +20705 -9601
  253. package/dist/react.d.mts +91 -0
  254. package/dist/react.mjs +8208 -0
  255. package/dist/registry.json +130 -13
  256. package/dist/tokens/chinese.css +44 -0
  257. package/dist/tokens/colors.css +365 -1222
  258. package/dist/tokens/design.css +109 -0
  259. package/dist/tokens/dtcg.json +11198 -0
  260. package/dist/tokens/figma.variables.json +7017 -0
  261. package/dist/tokens/icon-masks.css +78 -0
  262. package/dist/tokens/pixel.css +50 -0
  263. package/dist/tokens/soviet.css +44 -0
  264. package/dist/tokens/style-profiles.css +36 -547
  265. package/dist/tokens/themes.json +308 -0
  266. package/dist/tokens/tokens-studio.json +6728 -0
  267. package/dist/tokens/typography.css +21 -18
  268. package/dist/tokens.css +1555 -1801
  269. package/dist/ui.css +11975 -9831
  270. package/dist/vue.d.mts +344 -0
  271. package/dist/vue.mjs +7781 -0
  272. package/docs/spec/ai-input-experience.md +75 -0
  273. package/docs/spec/ai-native.md +238 -147
  274. package/docs/spec/design-philosophy.md +189 -0
  275. package/docs/spec/design-primitives.md +196 -0
  276. package/docs/spec/kb-family.md +147 -115
  277. package/package.json +43 -8
  278. package/dist/retro-effects.css +0 -255
  279. package/dist/tokens/retro-effects.css +0 -255
  280. package/docs/research/2026-10-03-ai-kb-components.md +0 -392
  281. package/docs/research/2026-10-03-kb-permissions.md +0 -992
@@ -0,0 +1,61 @@
1
+ @layer icen.components {
2
+ /*
3
+ * @icen.ai/ui — Component: autocomplete
4
+ * createAutocomplete owns .icen-autocomplete-panel with a named child listbox.
5
+ * .icen-autocomplete-option rows belong to that listbox; empty/loading/error and
6
+ * the keyboard-accessible retry button are siblings, not listbox options.
7
+ * Styling consumes shared tokens, materials and the suggestion status recipe.
8
+ */
9
+
10
+ .icen-autocomplete-panel {
11
+ position: fixed;
12
+ z-index: var(--icen-z-popover);
13
+ overflow-y: auto;
14
+ overscroll-behavior: contain;
15
+ padding: 4px;
16
+ background: var(--icen-token-card-strong);
17
+ border: 1px solid var(--icen-token-outline);
18
+ border-radius: var(--icen-radius-md);
19
+ box-shadow: var(--icen-token-shadow-overlay);
20
+ transform-origin: top center;
21
+ animation: icen-pop-in var(--icen-tx-fast);
22
+ }
23
+ .icen-autocomplete-panel[data-icen-side='top'] { transform-origin: bottom center; }
24
+
25
+ .icen-autocomplete-option {
26
+ display: flex;
27
+ align-items: center;
28
+ gap: var(--icen-density-space-xs);
29
+ padding: 6px var(--icen-density-space-sm);
30
+ font-size: var(--icen-density-font-size-sm);
31
+ color: var(--icen-token-text);
32
+ border-radius: var(--icen-radius-sm);
33
+ cursor: pointer;
34
+ min-block-size: var(--icen-density-input-height-sm);
35
+ overflow-wrap: anywhere;
36
+ transition:
37
+ background-color var(--icen-tx-fast),
38
+ color var(--icen-tx-fast);
39
+ }
40
+ .icen-autocomplete-option:hover { background: var(--icen-token-fill-1); }
41
+ .icen-autocomplete-option.is-active { background: var(--icen-token-fill-2); }
42
+
43
+ /* 命中片段高亮(behavior 以 <mark> 包裹 query 命中,大小写不敏感) */
44
+ .icen-autocomplete-option mark {
45
+ background: color-mix(in srgb, var(--icen-token-accent) 18%, transparent);
46
+ color: inherit;
47
+ border-radius: 2px; /* guard:allow-radius 微构件(bar/dot/track/指示器等图形级,不属容器圆角面) */
48
+ padding: 0 1px;
49
+ }
50
+
51
+ /* 空结果态(behavior 按结果数切 [hidden]) */
52
+ .icen-autocomplete-empty {
53
+ padding: var(--icen-density-space-sm);
54
+ font-size: var(--icen-density-font-size-sm);
55
+ color: var(--icen-token-text-muted);
56
+ text-align: center;
57
+ }
58
+ @media (pointer: coarse) { .icen-autocomplete-option { min-block-size: 44px; } }
59
+ @media (prefers-reduced-motion: reduce) { .icen-autocomplete-panel { animation: none; } .icen-autocomplete-option { transition: none; } }
60
+
61
+ }
@@ -0,0 +1,3 @@
1
+ // @icen.ai/ui — kit: autocomplete(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './autocomplete.css';
3
+ export * from '../behaviors/autocomplete.mjs';
@@ -1,33 +1,34 @@
1
+ @layer icen.components {
1
2
  /*
2
3
  * @icen.ai/ui — Component: back-top(回到顶部按钮,与 behaviors/back-top 配套)
3
4
  *
4
5
  * 契约(两种用法):
5
- * 1. 手写 + init:behavior 给 .back-top[data-back-top] 加 .is-shown 类
6
- * <button class="back-top" data-back-top type="button" aria-label="回到顶部">…svg…</button>
6
+ * 1. 手写 + init:behavior 给 .icen-back-top[data-icen-back-top] 加 .is-shown 类
7
+ * <button class="icen-back-top" data-icen-back-top type="button" aria-label="回到顶部">…svg…</button>
7
8
  *
8
- * 2. 全自动:initBackTop() 后任何 [data-back-top-auto] 会被自动 portal 到 body
9
+ * 2. 全自动:initBackTop() 后任何 [data-icen-back-top-auto] 会被自动 portal 到 body
9
10
  * 并接管滚到顶部逻辑,无需手写按钮
10
11
  * initBackTop({ autoCreate: true }) // 自动创建一个默认样式的按钮
11
12
  *
12
13
  * 默认滚动超过 320px 后出现;点击后 window.scrollTo({ top: 0, behavior: 'smooth' })。
13
14
  */
14
15
 
15
- .back-top {
16
+ .icen-back-top {
16
17
  position: fixed;
17
- right: var(--density-space-lg);
18
- bottom: var(--density-space-lg);
19
- z-index: var(--z-sticky);
18
+ inset-inline-end: var(--icen-density-space-lg);
19
+ bottom: var(--icen-density-space-lg);
20
+ z-index: var(--icen-z-sticky);
20
21
  display: inline-flex;
21
22
  align-items: center;
22
23
  justify-content: center;
23
24
  width: 40px;
24
25
  height: 40px;
25
26
  padding: 0;
26
- background: var(--token-card-strong);
27
- color: var(--token-text-muted);
28
- border: 1px solid var(--token-outline-soft);
29
- border-radius: var(--radius-full);
30
- box-shadow: var(--token-shadow-overlay);
27
+ background: var(--icen-token-card-strong);
28
+ color: var(--icen-token-text-muted);
29
+ border: 1px solid var(--icen-token-outline-soft);
30
+ border-radius: var(--icen-radius-full);
31
+ box-shadow: var(--icen-token-shadow-overlay);
31
32
  cursor: pointer;
32
33
  -webkit-tap-highlight-color: transparent;
33
34
  opacity: 0;
@@ -39,50 +40,52 @@
39
40
  color var(--icen-tx-fast),
40
41
  border-color var(--icen-tx-fast);
41
42
  }
42
- .back-top.is-shown {
43
+ .icen-back-top.is-shown {
43
44
  opacity: 1;
44
45
  transform: translateY(0) scale(1);
45
46
  pointer-events: auto;
46
47
  }
47
- .back-top:hover {
48
- color: var(--token-accent);
49
- border-color: var(--token-accent);
48
+ .icen-back-top:hover {
49
+ color: var(--icen-token-accent);
50
+ border-color: var(--icen-token-accent);
50
51
  }
51
- .back-top:focus-visible {
52
+ .icen-back-top:focus-visible {
52
53
  outline: none;
53
- box-shadow: var(--token-shadow-overlay), var(--icen-ring);
54
+ box-shadow: var(--icen-token-shadow-overlay), var(--icen-ring);
54
55
  }
55
- .back-top svg {
56
+ .icen-back-top svg {
56
57
  width: 18px;
57
58
  height: 18px;
58
59
  flex-shrink: 0;
59
60
  }
60
61
 
61
62
  /* 尺寸变体 */
62
- .back-top--sm {
63
+ .icen-back-top--sm {
63
64
  width: 32px;
64
65
  height: 32px;
65
66
  }
66
- .back-top--sm svg { width: 14px; height: 14px; }
67
- .back-top--lg {
67
+ .icen-back-top--sm svg { width: 14px; height: 14px; }
68
+ .icen-back-top--lg {
68
69
  width: 48px;
69
70
  height: 48px;
70
71
  }
71
- .back-top--lg svg { width: 22px; height: 22px; }
72
+ .icen-back-top--lg svg { width: 22px; height: 22px; }
72
73
 
73
74
  /* 方向变体:箭头方向(默认上) */
74
- .back-top[data-dir='left'] svg { transform: rotate(90deg); }
75
- .back-top[data-dir='right'] svg { transform: rotate(-90deg); }
76
- .back-top[data-dir='down'] svg { transform: rotate(180deg); }
75
+ .icen-back-top[data-icen-dir='left'] svg { transform: rotate(90deg); }
76
+ .icen-back-top[data-icen-dir='right'] svg { transform: rotate(-90deg); }
77
+ .icen-back-top[data-icen-dir='down'] svg { transform: rotate(180deg); }
77
78
 
78
79
  @media (max-width: 480px) {
79
- .back-top {
80
- right: var(--density-space-sm);
81
- bottom: var(--density-space-sm);
80
+ .icen-back-top {
81
+ inset-inline-end: var(--icen-density-space-sm);
82
+ bottom: var(--icen-density-space-sm);
82
83
  }
83
84
  }
84
85
 
85
86
  @media (prefers-reduced-motion: reduce) {
86
- .back-top { transition: opacity var(--icen-tx-fast); transform: none !important; }
87
- .back-top.is-shown { transform: none !important; }
87
+ .icen-back-top { transition: opacity var(--icen-tx-fast); transform: none !important; /* guard:allow-important 动效守卫:降级媒体查询需压制组件动画 */ }
88
+ .icen-back-top.is-shown { transform: none !important; /* guard:allow-important 动效守卫:降级媒体查询需压制组件动画 */ }
89
+ }
90
+
88
91
  }
@@ -1,3 +1,4 @@
1
+ @layer icen.components {
1
2
  /*
2
3
  * @icen.ai/ui — Component: badge(数字徽标 / 小红点)
3
4
  *
@@ -6,38 +7,38 @@
6
7
  * - badge = 角标式徽章,挂在外层元素的右上角,强调"数量/新动态"
7
8
  *
8
9
  * 完整契约(外层必须 position: relative 或 inline-flex):
9
- * <span class="badge-host">
10
- * <button class="btn">…</button>
11
- * <span class="badge">9</span> <!-- 数字徽标 -->
10
+ * <span class="icen-badge-host">
11
+ * <button class="icen-btn">…</button>
12
+ * <span class="icen-badge">9</span> <!-- 数字徽标 -->
12
13
  * </span>
13
14
  *
14
- * <span class="badge-host">
15
- * <button class="btn">…</button>
16
- * <span class="badge badge--dot"></span> <!-- 纯圆点(无数字) -->
15
+ * <span class="icen-badge-host">
16
+ * <button class="icen-btn">…</button>
17
+ * <span class="icen-badge icen-badge--dot"></span> <!-- 纯圆点(无数字) -->
17
18
  * </span>
18
19
  *
19
- * <span class="badge-host">
20
- * <span class="avatar">…</span>
21
- * <span class="badge badge--bottom badge--success badge--dot"></span> <!-- 头像右下角在线点 -->
20
+ * <span class="icen-badge-host">
21
+ * <span class="icen-avatar">…</span>
22
+ * <span class="icen-badge icen-badge--bottom icen-badge--success icen-badge--dot"></span> <!-- 头像右下角在线点 -->
22
23
  * </span>
23
24
  *
24
25
  * 变体:--dot 纯圆点 / --sm 小号 / --lg 大号 / --bottom 底部角
25
26
  * 语义色:--success(在线)/ --warning / --error / --info / --accent
26
27
  */
27
28
 
28
- .badge-host {
29
+ .icen-badge-host {
29
30
  position: relative;
30
31
  display: inline-flex;
31
32
  align-items: center;
32
33
  justify-content: center;
33
34
  }
34
35
 
35
- .badge {
36
+ .icen-badge {
36
37
  position: absolute;
37
38
  top: 0;
38
- right: 0;
39
+ right: 0; /* guard:allow-physical 角标契约是物理右上角(transform translate(50%) 同角心对齐),RTL 保持右上角 */
39
40
  transform: translate(50%, -50%);
40
- z-index: var(--z-raised);
41
+ z-index: var(--icen-z-raised);
41
42
  display: inline-flex;
42
43
  align-items: center;
43
44
  justify-content: center;
@@ -45,22 +46,22 @@
45
46
  height: 16px;
46
47
  padding: 0 4px;
47
48
  font: inherit;
48
- font-size: var(--density-font-size-2xs);
49
+ font-size: var(--icen-density-font-size-2xs);
49
50
  font-weight: 600;
50
51
  line-height: 1;
51
52
  font-variant-numeric: tabular-nums;
52
- color: var(--token-on-accent);
53
- background: var(--token-error);
54
- border: 2px solid var(--token-surface);
55
- border-radius: var(--radius-full);
56
- box-shadow: var(--token-shadow-inset);
53
+ color: var(--icen-token-on-accent);
54
+ background: var(--icen-token-error);
55
+ border: 2px solid var(--icen-token-surface);
56
+ border-radius: var(--icen-radius-full);
57
+ box-shadow: var(--icen-token-shadow-inset);
57
58
  pointer-events: none;
58
59
  white-space: nowrap;
59
60
  transform-origin: center;
60
61
  }
61
62
 
62
63
  /* 纯圆点(无数字) */
63
- .badge--dot {
64
+ .icen-badge--dot {
64
65
  width: 8px;
65
66
  height: 8px;
66
67
  min-width: 0;
@@ -69,59 +70,61 @@
69
70
  }
70
71
 
71
72
  /* 尺寸 */
72
- .badge--sm {
73
+ .icen-badge--sm {
73
74
  min-width: 14px;
74
75
  height: 14px;
75
- font-size: var(--density-font-size-2xs);
76
+ font-size: var(--icen-density-font-size-2xs);
76
77
  padding: 0 3px;
77
78
  }
78
- .badge--sm.badge--dot {
79
+ .icen-badge--sm.icen-badge--dot {
79
80
  width: 6px;
80
81
  height: 6px;
81
82
  }
82
- .badge--lg {
83
+ .icen-badge--lg {
83
84
  min-width: 20px;
84
85
  height: 20px;
85
- font-size: var(--density-font-size-xs);
86
+ font-size: var(--icen-density-font-size-xs);
86
87
  padding: 0 5px;
87
88
  }
88
- .badge--lg.badge--dot {
89
+ .icen-badge--lg.icen-badge--dot {
89
90
  width: 10px;
90
91
  height: 10px;
91
92
  }
92
93
 
93
94
  /* 底部角(头像在线指示等) */
94
- .badge--bottom {
95
+ .icen-badge--bottom {
95
96
  top: auto;
96
97
  bottom: 0;
97
98
  transform: translate(50%, 50%);
98
99
  }
99
100
 
100
101
  /* 语义色变体 */
101
- .badge--accent {
102
- background: var(--token-accent);
102
+ .icen-badge--accent {
103
+ background: var(--icen-token-accent-strong);
103
104
  }
104
- .badge--success {
105
- background: var(--token-success);
105
+ .icen-badge--success {
106
+ background: var(--icen-token-success);
106
107
  }
107
- .badge--warning {
108
- background: var(--token-warning);
108
+ .icen-badge--warning {
109
+ background: var(--icen-token-warning);
109
110
  }
110
- .badge--error {
111
- background: var(--token-error);
111
+ .icen-badge--error {
112
+ background: var(--icen-token-error);
112
113
  }
113
- .badge--info {
114
- background: var(--token-info);
114
+ .icen-badge--info {
115
+ background: var(--icen-token-info);
115
116
  }
116
117
 
117
118
  /* 挂在实底色按钮上时用更浅的边框 */
118
- .btn-primary .badge,
119
- .btn-danger .badge {
120
- border-color: var(--token-on-accent);
119
+ .icen-btn-primary .icen-badge,
120
+ .icen-btn-danger .icen-badge {
121
+ border-color: var(--icen-token-on-accent);
121
122
  }
122
123
 
123
124
  /* 数字超过 99 显示 99+(消费方决定是否使用,这里只保证宽度容纳) */
124
- .badge[data-overflow] {
125
+ .icen-badge[data-icen-overflow] {
125
126
  min-width: 20px;
126
127
  padding: 0 5px;
127
128
  }
129
+
130
+ }
@@ -1,50 +1,51 @@
1
+ @layer icen.components {
1
2
  /*
2
3
  * @icen.ai/ui — Component: breadcrumb(面包屑)
3
4
  *
4
5
  * 完整契约:
5
- * <nav class="breadcrumb" aria-label="面包屑">
6
+ * <icen-nav class="icen-breadcrumb" aria-label="面包屑">
6
7
  * <ol>
7
8
  * <li>
8
- * <a class="breadcrumb-link" href="…"><svg>…</svg> 首页</a>
9
- * <span class="breadcrumb-sep" aria-hidden="true"></span>
9
+ * <a class="icen-breadcrumb-link" href="…"><svg>…</svg> 首页</a>
10
+ * <span class="icen-breadcrumb-sep" aria-hidden="true"></span>
10
11
  * </li>
11
12
  * <li>
12
- * <span class="breadcrumb-ellipsis" aria-hidden="true">…</span>
13
- * <span class="breadcrumb-sep" aria-hidden="true"></span>
13
+ * <span class="icen-breadcrumb-ellipsis" aria-hidden="true">…</span>
14
+ * <span class="icen-breadcrumb-sep" aria-hidden="true"></span>
14
15
  * </li>
15
- * <li><span class="breadcrumb-current" aria-current="page">当前页</span></li>
16
+ * <li><span class="icen-breadcrumb-current" aria-current="page">当前页</span></li>
16
17
  * </ol>
17
- * </nav>
18
+ * </icen-nav>
18
19
  *
19
- * 分隔符是 .breadcrumb-sep::after(›);超长折叠用 .breadcrumb-ellipsis。
20
+ * 分隔符是 .icen-breadcrumb-sep::after(›);超长折叠用 .icen-breadcrumb-ellipsis。
20
21
  */
21
22
 
22
- .breadcrumb {
23
+ .icen-breadcrumb {
23
24
  display: flex;
24
25
  align-items: center;
25
- font-size: var(--density-font-size-md);
26
+ font-size: var(--icen-density-font-size-md);
26
27
  }
27
- .breadcrumb ol {
28
+ .icen-breadcrumb ol {
28
29
  display: flex;
29
30
  align-items: center;
30
31
  flex-wrap: wrap;
31
- gap: var(--density-space-xs);
32
+ gap: var(--icen-density-space-xs);
32
33
  list-style: none;
33
34
  margin: 0;
34
35
  padding: 0;
35
36
  }
36
- .breadcrumb li {
37
+ .icen-breadcrumb li {
37
38
  display: flex;
38
39
  align-items: center;
39
- gap: var(--density-space-xs);
40
+ gap: var(--icen-density-space-xs);
40
41
  min-width: 0;
41
42
  }
42
43
 
43
- .breadcrumb-link {
44
+ .icen-breadcrumb-link {
44
45
  display: inline-flex;
45
46
  align-items: center;
46
- gap: var(--density-space-xs);
47
- color: var(--token-text-muted);
47
+ gap: var(--icen-density-space-xs);
48
+ color: var(--icen-token-text-muted);
48
49
  text-decoration: none;
49
50
  max-width: 200px;
50
51
  overflow: hidden;
@@ -52,74 +53,94 @@
52
53
  white-space: nowrap;
53
54
  transition: color var(--icen-tx-fast);
54
55
  }
55
- .breadcrumb-link:hover {
56
- color: var(--token-accent);
56
+ .icen-breadcrumb-link:hover {
57
+ color: var(--icen-token-accent);
57
58
  text-decoration: none;
58
59
  }
59
- .breadcrumb-link:focus-visible {
60
+ .icen-breadcrumb-link:focus-visible {
60
61
  outline: none;
61
- border-radius: var(--radius-xs);
62
+ border-radius: var(--icen-radius-xs);
62
63
  box-shadow: var(--icen-ring);
63
64
  }
64
- .breadcrumb-link > svg {
65
+ .icen-breadcrumb-link > svg {
65
66
  width: 13px;
66
67
  height: 13px;
67
68
  flex-shrink: 0;
68
69
  }
69
70
 
70
- .breadcrumb-sep {
71
- color: var(--token-text-faint);
72
- font-size: var(--density-font-size-md);
71
+ .icen-breadcrumb-sep {
72
+ color: var(--icen-token-text-faint);
73
+ font-size: var(--icen-density-font-size-md);
73
74
  line-height: 1;
74
75
  user-select: none;
75
76
  }
76
- .breadcrumb-sep::after { content: '›'; }
77
+ .icen-breadcrumb-sep::after { content: '';
78
+ display: inline-block;
79
+ inline-size: 16px;
80
+ block-size: 16px;
81
+ flex: none;
82
+ vertical-align: middle;
83
+ background: currentColor;
84
+ mask: var(--icen-token-icon-chevron-right) center / contain no-repeat; }
77
85
 
78
- .breadcrumb-current {
86
+ .icen-breadcrumb-current {
79
87
  display: inline-flex;
80
88
  align-items: center;
81
- gap: var(--density-space-xs);
82
- color: var(--token-text);
89
+ gap: var(--icen-density-space-xs);
90
+ color: var(--icen-token-text);
83
91
  font-weight: 500;
84
92
  max-width: 240px;
85
93
  overflow: hidden;
86
94
  text-overflow: ellipsis;
87
95
  white-space: nowrap;
88
96
  }
89
- .breadcrumb-current > svg {
97
+ .icen-breadcrumb-current > svg {
90
98
  width: 13px;
91
99
  height: 13px;
92
100
  flex-shrink: 0;
93
101
  }
94
102
 
95
- .breadcrumb-ellipsis {
103
+ .icen-breadcrumb-ellipsis {
96
104
  padding: 0 2px;
97
- color: var(--token-text-faint);
105
+ color: var(--icen-token-text-faint);
98
106
  user-select: none;
99
107
  cursor: pointer;
100
- border-radius: var(--radius-xs);
108
+ border-radius: var(--icen-radius-xs);
101
109
  transition: color var(--icen-tx-fast), background-color var(--icen-tx-fast);
102
110
  }
103
- .breadcrumb-ellipsis:hover {
104
- color: var(--token-accent);
105
- background: var(--token-fill-1);
111
+ .icen-breadcrumb-ellipsis:hover {
112
+ color: var(--icen-token-accent);
113
+ background: var(--icen-token-fill-1);
106
114
  }
107
115
 
108
116
  /* ── 面包屑分隔符变体 ── */
109
- .breadcrumb--slash .breadcrumb-sep::after { content: '/'; }
110
- .breadcrumb--arrow .breadcrumb-sep::after { content: '→'; }
111
- .breadcrumb--dot .breadcrumb-sep::after { content: '·'; font-size: 1.2em; }
117
+ .icen-breadcrumb--slash .icen-breadcrumb-sep::after { content: '/'; }
118
+ .icen-breadcrumb--arrow .icen-breadcrumb-sep::after { content: '';
119
+ display: inline-block;
120
+ inline-size: 16px;
121
+ block-size: 16px;
122
+ flex: none;
123
+ vertical-align: middle;
124
+ background: currentColor;
125
+ mask: var(--icen-token-icon-arrow-right) center / contain no-repeat; }
126
+ .icen-breadcrumb--dot .icen-breadcrumb-sep::after { content: '·'; font-size: 1.2em; }
112
127
 
113
128
  /* ── 面包屑尺寸变体 ── */
114
- .breadcrumb--sm {
115
- font-size: var(--density-font-size-sm);
129
+ .icen-breadcrumb--sm {
130
+ font-size: var(--icen-density-font-size-sm);
116
131
  }
117
- .breadcrumb--sm .breadcrumb-link,
118
- .breadcrumb--sm .breadcrumb-current {
119
- max-width: 140px;
132
+ .icen-breadcrumb--sm .icen-breadcrumb-link,
133
+ .icen-breadcrumb--sm .icen-breadcrumb-current {
134
+ max-inline-size: 140px;
120
135
  }
121
136
 
122
137
  @media (max-width: 480px) {
123
- .breadcrumb-link { max-width: 100px; }
124
- .breadcrumb-current { max-width: 120px; }
138
+ .icen-breadcrumb-link { max-inline-size: 100px; }
139
+ .icen-breadcrumb-current { max-inline-size: 120px; }
140
+ }
141
+
142
+ /* ── RTL:分隔符方向镜像(› / → 指向行进方向,RTL 下行进朝左)── */
143
+ :is([dir='rtl']) .icen-breadcrumb-sep::after { transform: scaleX(-1); }
144
+ :is([dir='rtl']) .icen-breadcrumb--arrow .icen-breadcrumb-sep::after { transform: scaleX(-1); }
145
+
125
146
  }