@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
@@ -1,3 +1,4 @@
1
+ @layer icen.components {
1
2
  /*
2
3
  * @icen.ai/ui — Component: tag(展示标签 / Chip)
3
4
  *
@@ -7,29 +8,29 @@
7
8
  * 常用于:分类、筛选条件、属性标记、邮件标签、文件 tag
8
9
  *
9
10
  * 完整契约:
10
- * <span class="tag [.tag--sm|.tag--lg] [.is-selected] [.is-disabled]
11
- * [.tag--accent|.tag--success|.tag--warning|.tag--error|.tag--info]">
12
- * <span class="tag-icon">…svg…</span> <!-- 可选左图标 -->
13
- * <span class="tag-label">标签文本</span>
14
- * <button class="tag-close" type="button" aria-label="移除">×</button> <!-- 可选 -->
11
+ * <span class="icen-tag [.icen-tag--sm|.icen-tag--lg] [.is-selected] [.is-disabled]
12
+ * [.icen-tag--accent|.icen-tag--success|.icen-tag--warning|.icen-tag--error|.icen-tag--info]">
13
+ * <span class="icen-tag-icon">…svg…</span> <!-- 可选左图标 -->
14
+ * <span class="icen-tag-label">标签文本</span>
15
+ * <button class="icen-tag-close" type="button" aria-label="移除">×</button> <!-- 可选 -->
15
16
  * </span>
16
17
  *
17
18
  * 选中态 .is-selected 由消费方驱动(用于筛选条件等);
18
- * .tag-close 点击后消费方决定是否从 DOM 移除本节点(本组件不自动删除)。
19
+ * .icen-tag-close 点击后消费方决定是否从 DOM 移除本节点(本组件不自动删除)。
19
20
  */
20
21
 
21
- .tag {
22
+ .icen-tag {
22
23
  display: inline-flex;
23
24
  align-items: center;
24
25
  gap: 4px;
25
- padding: 0 var(--density-space-sm);
26
+ padding: 0 var(--icen-density-space-sm);
26
27
  height: 24px;
27
- background: var(--token-fill-1);
28
- color: var(--token-text-muted);
29
- border: 1px solid var(--token-line-soft);
30
- border-radius: var(--radius-sm);
28
+ background: var(--icen-token-fill-1);
29
+ color: var(--icen-token-text-muted);
30
+ border: 1px solid var(--icen-token-line-soft);
31
+ border-radius: var(--icen-radius-sm);
31
32
  font: inherit;
32
- font-size: var(--density-font-size-sm);
33
+ font-size: var(--icen-density-font-size-sm);
33
34
  letter-spacing: 0.01em;
34
35
  white-space: nowrap;
35
36
  vertical-align: middle;
@@ -38,54 +39,54 @@
38
39
  border-color var(--icen-tx-fast),
39
40
  color var(--icen-tx-fast);
40
41
  }
41
- .tag:hover {
42
- background: var(--token-fill-2);
43
- color: var(--token-text);
42
+ .icen-tag:hover {
43
+ background: var(--icen-token-fill-2);
44
+ color: var(--icen-token-text);
44
45
  }
45
46
 
46
47
  /* 尺寸变体 */
47
- .tag--sm {
48
+ .icen-tag--sm {
48
49
  height: 20px;
49
50
  padding: 0 6px;
50
- font-size: var(--density-font-size-xs);
51
+ font-size: var(--icen-density-font-size-xs);
51
52
  gap: 3px;
52
53
  }
53
- .tag--lg {
54
+ .icen-tag--lg {
54
55
  height: 28px;
55
56
  padding: 0 10px;
56
- font-size: var(--density-font-size-md);
57
+ font-size: var(--icen-density-font-size-md);
57
58
  gap: 6px;
58
59
  }
59
60
 
60
61
  /* ── 图标 ── */
61
- .tag-icon {
62
+ .icen-tag-icon {
62
63
  display: inline-flex;
63
64
  align-items: center;
64
65
  justify-content: center;
65
66
  flex-shrink: 0;
66
- color: var(--token-text-faint);
67
+ color: var(--icen-token-text-faint);
67
68
  }
68
- .tag-icon svg { width: 12px; height: 12px; }
69
- .tag--sm .tag-icon svg { width: 10px; height: 10px; }
70
- .tag--lg .tag-icon svg { width: 14px; height: 14px; }
71
- .tag-label {
69
+ .icen-tag-icon svg { width: 12px; height: 12px; }
70
+ .icen-tag--sm .icen-tag-icon svg { width: 10px; height: 10px; }
71
+ .icen-tag--lg .icen-tag-icon svg { width: 14px; height: 14px; }
72
+ .icen-tag-label {
72
73
  overflow: hidden;
73
74
  text-overflow: ellipsis;
74
75
  max-width: 240px;
75
76
  }
76
77
 
77
78
  /* ── 关闭按钮(消费方点击后自行决定是否从 DOM 移除) ── */
78
- .tag-close {
79
+ .icen-tag-close {
79
80
  display: inline-flex;
80
81
  align-items: center;
81
82
  justify-content: center;
82
83
  width: 16px;
83
84
  height: 16px;
84
85
  padding: 0;
85
- margin-right: -4px;
86
- margin-left: 2px;
86
+ margin-inline-end: -4px;
87
+ margin-inline-start: 2px;
87
88
  border: 0;
88
- border-radius: var(--radius-xs);
89
+ border-radius: var(--icen-radius-xs);
89
90
  background: transparent;
90
91
  color: inherit;
91
92
  opacity: 0.6;
@@ -93,72 +94,81 @@
93
94
  -webkit-tap-highlight-color: transparent;
94
95
  transition: opacity var(--icen-tx-fast), background-color var(--icen-tx-fast);
95
96
  }
96
- .tag-close:hover {
97
+ .icen-tag-close:hover {
97
98
  opacity: 1;
98
- background: color-mix(in srgb, var(--token-text-faint) 22%, transparent);
99
+ background: color-mix(in srgb, var(--icen-token-text-faint) 22%, transparent);
99
100
  }
100
- .tag-close:focus-visible {
101
+ .icen-tag-close:focus-visible {
101
102
  outline: none;
102
103
  box-shadow: var(--icen-ring);
103
104
  }
104
- .tag-close svg { width: 10px; height: 10px; }
105
- .tag--sm .tag-close { width: 14px; height: 14px; margin-right: -2px; }
106
- .tag--lg .tag-close { width: 18px; height: 18px; margin-right: -6px; }
105
+ .icen-tag-close svg { width: 10px; height: 10px; }
106
+ .icen-tag--sm .icen-tag-close { width: 14px; height: 14px; margin-inline-end: -2px; }
107
+ .icen-tag--lg .icen-tag-close { width: 18px; height: 18px; margin-inline-end: -6px; }
107
108
 
108
109
  /* ── 选中态(用于筛选条件等)── */
109
- .tag.is-selected {
110
- background: var(--token-accent-subtle);
111
- color: var(--token-accent-deep, var(--token-accent));
112
- border-color: color-mix(in srgb, var(--token-accent) 40%, transparent);
110
+ .icen-tag.is-selected {
111
+ background: var(--icen-token-accent-subtle);
112
+ color: var(--icen-token-accent-deep, var(--icen-token-accent));
113
+ border-color: color-mix(in srgb, var(--icen-token-accent) 40%, transparent);
113
114
  }
114
- .tag.is-selected .tag-icon { color: var(--token-accent); }
115
+ .icen-tag.is-selected .icen-tag-icon { color: var(--icen-token-accent); }
115
116
 
116
117
  /* ── 语义色变体(与 pill 对齐,但底色更淡,作分类着色用)── */
117
- .tag--accent {
118
- background: color-mix(in srgb, var(--token-accent) 10%, transparent);
119
- color: var(--token-accent-deep, var(--token-accent));
120
- border-color: color-mix(in srgb, var(--token-accent) 30%, transparent);
121
- }
122
- .tag--success {
123
- background: color-mix(in srgb, var(--token-success) 10%, transparent);
124
- color: var(--token-success);
125
- border-color: color-mix(in srgb, var(--token-success) 30%, transparent);
126
- }
127
- .tag--warning {
128
- background: color-mix(in srgb, var(--token-warning) 10%, transparent);
129
- color: var(--token-warning);
130
- border-color: color-mix(in srgb, var(--token-warning) 30%, transparent);
131
- }
132
- .tag--error {
133
- background: color-mix(in srgb, var(--token-error) 10%, transparent);
134
- color: var(--token-error);
135
- border-color: color-mix(in srgb, var(--token-error) 30%, transparent);
136
- }
137
- .tag--info {
138
- background: color-mix(in srgb, var(--token-info) 10%, transparent);
139
- color: var(--token-info);
140
- border-color: color-mix(in srgb, var(--token-info) 30%, transparent);
118
+ .icen-tag--accent {
119
+ background: color-mix(in srgb, var(--icen-token-accent) 10%, transparent);
120
+ color: var(--icen-token-accent-deep, var(--icen-token-accent));
121
+ border-color: color-mix(in srgb, var(--icen-token-accent) 30%, transparent);
122
+ }
123
+ .icen-tag--success {
124
+ background: color-mix(in srgb, var(--icen-token-success) 10%, transparent);
125
+ color: var(--icen-token-success);
126
+ border-color: color-mix(in srgb, var(--icen-token-success) 30%, transparent);
127
+ }
128
+ .icen-tag--warning {
129
+ background: color-mix(in srgb, var(--icen-token-warning) 10%, transparent);
130
+ color: var(--icen-token-warning);
131
+ border-color: color-mix(in srgb, var(--icen-token-warning) 30%, transparent);
132
+ }
133
+ .icen-tag--error {
134
+ background: color-mix(in srgb, var(--icen-token-error) 10%, transparent);
135
+ color: var(--icen-token-error);
136
+ border-color: color-mix(in srgb, var(--icen-token-error) 30%, transparent);
137
+ }
138
+ .icen-tag--info {
139
+ background: color-mix(in srgb, var(--icen-token-info) 10%, transparent);
140
+ color: var(--icen-token-info);
141
+ border-color: color-mix(in srgb, var(--icen-token-info) 30%, transparent);
141
142
  }
142
143
 
143
144
  /* ── 禁用态 ── */
144
- .tag.is-disabled,
145
- .tag[aria-disabled='true'] {
145
+ .icen-tag.is-disabled,
146
+ .icen-tag[aria-disabled='true'] {
146
147
  opacity: var(--icen-disabled-opacity);
147
148
  cursor: not-allowed;
148
149
  pointer-events: none;
149
150
  }
150
151
 
151
152
  /* ── 可点击(用于可筛选 tag) ── */
152
- button.tag,
153
- .tag[role='button'] {
153
+ button.icen-tag,
154
+ .icen-tag[role='button'] {
154
155
  cursor: pointer;
155
156
  -webkit-tap-highlight-color: transparent;
156
157
  }
157
- .tag:where(button, [role='button']):focus-visible {
158
+ .icen-tag:where(button, [role='button']):focus-visible {
158
159
  outline: none;
159
160
  box-shadow: var(--icen-ring);
160
161
  }
161
162
 
162
163
  @media (prefers-reduced-motion: reduce) {
163
- .tag, .tag-close { transition: none; }
164
+ .icen-tag, .icen-tag-close { transition: none; }
165
+ }
166
+
167
+ /* Reveal only the secondary action; its fixed slot keeps the label still. */
168
+ @media (hover: hover) and (pointer: fine) {
169
+ .icen-tag-close { opacity: 0; transform: scale(.88); transition: opacity var(--icen-tx-fast), transform var(--icen-tx-fast), background-color var(--icen-tx-fast); }
170
+ .icen-tag:is(:hover,:focus-within) .icen-tag-close { opacity: 1; transform: none; }
171
+ }
172
+ @media (prefers-reduced-motion: reduce) { .icen-tag-close { transition: none; transform: none; } }
173
+
164
174
  }
@@ -0,0 +1,105 @@
1
+ @layer icen.components {
2
+ /* Appearance control: .icen-theme-switcher; --xs/--sm/default/--lg sizes.
3
+ * data-icen-display=icon|color|color-name|name|swatch|swatch-name.
4
+ * data-icen-layout=inline exposes the same choices as a settings panel.
5
+ * All rendering is owned by theme-switcher.ts; CSS has no behavior dependency. */
6
+ .icen-theme-switcher {
7
+ --switcher-height: var(--icen-density-input-height-md);
8
+ --switcher-font: var(--icen-density-font-size-md);
9
+ display: inline-flex;
10
+ max-inline-size: 100%;
11
+ vertical-align: middle;
12
+ font-family: var(--icen-font-body);
13
+ font-size: var(--switcher-font);
14
+ color: var(--icen-token-text);
15
+ }
16
+ .icen-theme-switcher--xs { --switcher-height: calc(var(--icen-density-input-height-sm) - 4px); --switcher-font: var(--icen-density-font-size-sm); }
17
+ .icen-theme-switcher--sm { --switcher-height: var(--icen-density-input-height-sm); --switcher-font: var(--icen-density-font-size-sm); }
18
+ .icen-theme-switcher--lg { --switcher-height: var(--icen-density-input-height-lg); }
19
+ .icen-theme-switcher-trigger,
20
+ .icen-theme-switcher-option {
21
+ display: inline-flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ gap: var(--icen-density-space-sm);
25
+ border: 1px solid var(--icen-token-line-soft);
26
+ border-radius: var(--icen-radius-md);
27
+ background: var(--icen-token-surface);
28
+ color: var(--icen-token-text);
29
+ font: inherit;
30
+ font-weight: 500;
31
+ cursor: pointer;
32
+ transition: background-color var(--icen-tx-fast), border-color var(--icen-tx-fast);
33
+ }
34
+ .icen-theme-switcher-trigger { min-block-size: var(--switcher-height); padding: 0 var(--icen-density-space-sm); white-space: nowrap; }
35
+ .icen-theme-switcher-trigger:hover,
36
+ .icen-theme-switcher-option:hover { background: var(--icen-token-surface-hover); border-color: var(--icen-token-line); }
37
+ .icen-theme-switcher-trigger:focus-visible,
38
+ .icen-theme-switcher-option:focus-visible { outline: 2px solid var(--icen-token-accent); outline-offset: 3px; }
39
+ .icen-theme-switcher-trigger[aria-expanded="true"] { border-color: var(--icen-token-accent); }
40
+ .icen-theme-switcher-sample { display: inline-flex; flex: 0 0 auto; inline-size: 40px; block-size: 20px; overflow: hidden; border: 1px solid var(--icen-token-line); border-radius: var(--icen-radius-sm); }
41
+ .icen-theme-switcher-sample i { display: block; flex: 1; }
42
+ .icen-theme-switcher-symbol { display: inline-flex; align-items: center; justify-content: center; inline-size: 20px; font-size: 20px; line-height: 1; }
43
+ .icen-theme-switcher[data-icen-display="icon"] .icen-theme-switcher-trigger,
44
+ .icen-theme-switcher[data-icen-display="color"] .icen-theme-switcher-trigger { inline-size: var(--switcher-height); padding: 0; }
45
+ .icen-theme-switcher[data-icen-display="icon"] .icen-theme-switcher-name,
46
+ .icen-theme-switcher[data-icen-display="color"] .icen-theme-switcher-name,
47
+ .icen-theme-switcher[data-icen-display="swatch"] .icen-theme-switcher-name { display: none; }
48
+ .icen-theme-switcher[data-icen-display="name"] .icen-theme-switcher-trigger > .icen-theme-switcher-sample,
49
+ .icen-theme-switcher[data-icen-display="name"] .icen-theme-switcher-trigger > .icen-theme-switcher-symbol { display: none; }
50
+ .icen-theme-switcher:is([data-icen-display="icon"],[data-icen-display="color"],[data-icen-display="color-name"]) .icen-theme-switcher-trigger .icen-theme-switcher-sample { inline-size: 18px; block-size: 18px; border-radius: var(--icen-radius-full); transform: rotate(-35deg); }
51
+ .icen-theme-switcher:is([data-icen-display="icon"],[data-icen-display="color"],[data-icen-display="color-name"]) .icen-theme-switcher-trigger .icen-theme-switcher-sample i:last-child { display: none; }
52
+ .icen-theme-switcher-panel {
53
+ position: fixed;
54
+ z-index: var(--icen-z-popover);
55
+ box-sizing: border-box;
56
+ padding: var(--icen-density-space-md);
57
+ overflow: auto;
58
+ border: 1px solid var(--icen-token-line-soft);
59
+ border-radius: var(--icen-radius-lg);
60
+ background: var(--icen-token-surface);
61
+ color: var(--icen-token-text);
62
+ box-shadow: var(--icen-token-shadow-overlay);
63
+ font: var(--icen-density-font-size-sm)/1.5 var(--icen-font-body);
64
+ }
65
+ .icen-theme-switcher-panel[hidden] { display: none; }
66
+ .icen-theme-switcher-section + .icen-theme-switcher-section { margin-block-start: var(--icen-density-space-md); padding-block-start: var(--icen-density-space-md); border-block-start: 1px solid var(--icen-token-line-soft); }
67
+ .icen-theme-switcher-heading { margin: 0 0 var(--icen-density-space-sm); font-size: var(--icen-density-font-size-sm); font-weight: 500; color: var(--icen-token-text-muted); }
68
+ .icen-theme-switcher-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--icen-density-space-sm); }
69
+ .icen-theme-switcher-option { position: relative; min-block-size: var(--icen-density-input-height-md); padding: var(--icen-density-space-sm); }
70
+ .icen-theme-switcher-options--theme .icen-theme-switcher-option { flex-direction: column; align-items: stretch; gap: var(--icen-density-space-sm); text-align: start; }
71
+ .icen-theme-switcher-options--theme .icen-theme-switcher-sample { inline-size: 100%; block-size: 28px; }
72
+ .icen-theme-switcher-option[aria-pressed="true"] { border-color: var(--icen-token-accent); background: var(--icen-token-accent-subtle); }
73
+ .icen-theme-switcher[data-icen-layout="inline"] { display: block; inline-size: 100%; container: icen-appearance / inline-size; }
74
+ .icen-theme-switcher[data-icen-layout="inline"] > .icen-theme-switcher-panel { position: static; inline-size: 100%; box-shadow: none; background: var(--icen-token-surface); }
75
+ /* Six built-ins form complete rows. Query the host, so sidebars and embedded
76
+ * settings do not inherit the viewport's column count. */
77
+ @container icen-appearance (min-width: 420px) {
78
+ .icen-theme-switcher-options--theme { grid-template-columns: repeat(3,minmax(0,1fr)); }
79
+ }
80
+ @container icen-appearance (min-width: 840px) {
81
+ .icen-theme-switcher-options--theme { grid-template-columns: repeat(6,minmax(0,1fr)); }
82
+ }
83
+ @media (pointer: coarse) {
84
+ .icen-theme-switcher-trigger { min-block-size: 44px; min-inline-size: 44px; }
85
+ .icen-theme-switcher-option { min-block-size: 44px; }
86
+ }
87
+ @media (forced-colors: active) {
88
+ .icen-theme-switcher-option[aria-pressed="true"] { outline: 2px solid Highlight; }
89
+ }
90
+
91
+ @media (prefers-reduced-motion: reduce) {
92
+ .icen-theme-switcher-chevron, .icen-theme-switcher-check, .icen-theme-switcher-trigger, .icen-theme-switcher-option { transition: none; }
93
+ }
94
+
95
+ /* Compact menu cards keep all three axes visible in ordinary desktop viewports. */
96
+ .icen-theme-switcher-panel[role="dialog"] .icen-theme-switcher-section + .icen-theme-switcher-section { margin-block-start: var(--icen-density-space-sm); padding-block-start: var(--icen-density-space-sm); }
97
+ .icen-theme-switcher-panel[role="dialog"] .icen-theme-switcher-options--theme .icen-theme-switcher-option { gap: var(--icen-density-space-xs); }
98
+ .icen-theme-switcher-panel[role="dialog"] .icen-theme-switcher-options--theme .icen-theme-switcher-sample { block-size: 24px; }
99
+
100
+ .icen-theme-switcher-panel[role="dialog"] .icen-theme-switcher-section:has(.icen-theme-switcher-options--mode) .icen-theme-switcher-heading { display: none; }
101
+
102
+ /* Compatibility with previously authored markup; new renderers omit these slots. */
103
+ .icen-theme-switcher-chevron, .icen-theme-switcher-check { display: none; }
104
+
105
+ }
@@ -0,0 +1,3 @@
1
+ // @icen.ai/ui — kit: theme-switcher(CSS + behavior 一行入口;构建产物,勿手改)
2
+ import './theme-switcher.css';
3
+ export * from '../behaviors/theme-switcher.mjs';
@@ -1,103 +1,104 @@
1
+ @layer icen.components {
1
2
  /*
2
3
  * @icen.ai/ui — Component: toast(轻提示,与 behaviors/toast 配套)
3
4
  *
4
- * 容器固定在右下角,左缘 3px 语义色条;滑入动画用 motion token。
5
+ * 容器固定在行内末端下角(LTR 右下 / RTL 镜像左下),起始缘 3px 语义色条;滑入动画用 motion token。
5
6
  *
6
7
  * 完整契约:
7
- * <div class="toast-container" role="status" aria-live="polite">
8
- * <div class="toast [toast--success|toast--error|toast--warning|toast--info]" role="status|alert">
9
- * <span class="toast-msg">文本</span>
10
- * <button class="toast-action">撤销</button> ← 可选 action
8
+ * <div class="icen-toast-container" role="status" aria-live="polite">
9
+ * <div class="icen-toast [icen-toast--success|icen-toast--error|icen-toast--warning|icen-toast--info]" role="status|icen-alert">
10
+ * <span class="icen-toast-msg">文本</span>
11
+ * <button class="icen-toast-action">撤销</button> ← 可选 action
11
12
  * </div>
12
13
  * </div>
13
14
  *
14
15
  * behavior 自动维护 role 与 aria-live。
15
16
  */
16
17
 
17
- .toast-container {
18
+ .icen-toast-container {
18
19
  position: fixed;
19
- right: var(--density-space-md);
20
- bottom: var(--density-space-md);
21
- z-index: var(--z-toast);
20
+ inset-inline-end: var(--icen-density-space-md);
21
+ bottom: var(--icen-density-space-md);
22
+ z-index: var(--icen-z-toast);
22
23
  display: flex;
23
24
  flex-direction: column;
24
- gap: var(--density-space-sm);
25
+ gap: var(--icen-density-space-sm);
25
26
  align-items: flex-end;
26
27
  pointer-events: none;
27
28
  }
28
29
 
29
- .toast {
30
+ .icen-toast {
30
31
  pointer-events: auto;
31
32
  position: relative;
32
33
  overflow: hidden;
33
34
  display: inline-flex;
34
35
  align-items: center;
35
- gap: var(--density-space-sm);
36
- background: var(--token-surface);
37
- color: var(--token-text);
38
- border: 1px solid var(--token-line-soft);
39
- border-left: 3px solid var(--token-line-strong);
40
- border-radius: var(--radius-sm);
41
- box-shadow: var(--token-shadow-overlay);
42
- padding: var(--density-space-sm) var(--density-space-md);
43
- font-size: var(--density-font-size-md);
36
+ gap: var(--icen-density-space-sm);
37
+ background: var(--icen-token-surface);
38
+ color: var(--icen-token-text);
39
+ border: 1px solid var(--icen-token-line-soft);
40
+ border-inline-start: 3px solid var(--icen-token-line-strong);
41
+ border-radius: var(--icen-radius-sm);
42
+ box-shadow: var(--icen-token-shadow-overlay);
43
+ padding: var(--icen-density-space-sm) var(--icen-density-space-md);
44
+ font-size: var(--icen-density-font-size-md);
44
45
  line-height: 1.4;
45
- max-width: 380px;
46
+ max-inline-size: 380px;
46
47
  animation: icen-toast-in var(--icen-tx-slow);
47
48
  }
48
49
 
49
- /* 语义色:左缘 3px 强调 */
50
- .toast--success { border-left-color: var(--token-success); }
51
- .toast--error { border-left-color: var(--token-error); }
52
- .toast--warning { border-left-color: var(--token-warning); }
53
- .toast--info { border-left-color: var(--token-info); }
50
+ /* 语义色:起始缘 3px 强调 */
51
+ .icen-toast--success { border-inline-start-color: var(--icen-token-success); }
52
+ .icen-toast--error { border-inline-start-color: var(--icen-token-error); }
53
+ .icen-toast--warning { border-inline-start-color: var(--icen-token-warning); }
54
+ .icen-toast--info { border-inline-start-color: var(--icen-token-info); }
54
55
 
55
- .toast-msg {
56
+ .icen-toast-msg {
56
57
  flex: 1;
57
58
  min-width: 0;
58
59
  word-break: break-word;
59
60
  }
60
61
 
61
- .toast-action {
62
+ .icen-toast-action {
62
63
  flex-shrink: 0;
63
64
  padding: 0;
64
65
  background: none;
65
66
  border: 0;
66
67
  cursor: pointer;
67
- color: var(--token-accent);
68
+ color: var(--icen-token-accent);
68
69
  font: inherit;
69
- font-size: var(--density-font-size-sm);
70
+ font-size: var(--icen-density-font-size-sm);
70
71
  font-weight: 500;
71
72
  text-decoration: underline;
72
73
  text-underline-offset: 3px;
73
74
  -webkit-tap-highlight-color: transparent;
74
75
  transition: color var(--icen-tx-fast);
75
76
  }
76
- .toast-action:hover { color: var(--token-accent-deep, var(--token-accent)); }
77
- .toast-action:focus-visible {
77
+ .icen-toast-action:hover { color: var(--icen-token-accent-deep, var(--icen-token-accent)); }
78
+ .icen-toast-action:focus-visible {
78
79
  outline: none;
79
- border-radius: var(--radius-xs);
80
+ border-radius: var(--icen-radius-xs);
80
81
  box-shadow: var(--icen-ring);
81
82
  }
82
83
 
83
84
  /* ── 增强 ── */
84
85
 
85
86
  /* 语义图标 */
86
- .toast-icon {
87
+ .icen-toast-icon {
87
88
  flex-shrink: 0;
88
89
  display: inline-flex;
89
90
  align-items: center;
90
91
  justify-content: center;
91
- color: var(--token-text-faint);
92
+ color: var(--icen-token-text-faint);
92
93
  }
93
- .toast-icon svg { width: 16px; height: 16px; }
94
- .toast--success .toast-icon { color: var(--token-success); }
95
- .toast--error .toast-icon { color: var(--token-error); }
96
- .toast--warning .toast-icon { color: var(--token-warning); }
97
- .toast--info .toast-icon { color: var(--token-info); }
94
+ .icen-toast-icon svg { width: 16px; height: 16px; }
95
+ .icen-toast--success .icen-toast-icon { color: var(--icen-token-success); }
96
+ .icen-toast--error .icen-toast-icon { color: var(--icen-token-error); }
97
+ .icen-toast--warning .icen-toast-icon { color: var(--icen-token-warning); }
98
+ .icen-toast--info .icen-toast-icon { color: var(--icen-token-info); }
98
99
 
99
100
  /* 关闭按钮 */
100
- .toast-close {
101
+ .icen-toast-close {
101
102
  flex-shrink: 0;
102
103
  display: inline-flex;
103
104
  align-items: center;
@@ -106,95 +107,94 @@
106
107
  height: 20px;
107
108
  padding: 0;
108
109
  border: 0;
109
- border-radius: var(--radius-xs);
110
+ border-radius: var(--icen-radius-xs);
110
111
  background: transparent;
111
- color: var(--token-text-faint);
112
+ color: var(--icen-token-text-faint);
112
113
  cursor: pointer;
113
114
  transition: color var(--icen-tx-fast), background-color var(--icen-tx-fast);
114
115
  }
115
- .toast-close:hover {
116
- color: var(--token-text);
117
- background: var(--token-fill-1);
116
+ .icen-toast-close:hover {
117
+ color: var(--icen-token-text);
118
+ background: var(--icen-token-fill-1);
118
119
  }
119
- .toast-close svg { width: 12px; height: 12px; }
120
+ .icen-toast-close svg { width: 12px; height: 12px; }
120
121
 
121
122
  /* 富内容(标题 + 正文) */
122
- .toast-content {
123
+ .icen-toast-content {
123
124
  flex: 1;
124
125
  min-width: 0;
125
126
  }
126
- .toast-title {
127
- font-size: var(--density-font-size-md);
127
+ .icen-toast-title {
128
+ font-size: var(--icen-density-font-size-md);
128
129
  font-weight: 500;
129
- color: var(--token-text);
130
+ color: var(--icen-token-text);
130
131
  line-height: 1.4;
131
132
  }
132
- .toast-body {
133
- font-size: var(--density-font-size-sm);
134
- color: var(--token-text-muted);
133
+ .icen-toast-body {
134
+ font-size: var(--icen-density-font-size-sm);
135
+ color: var(--icen-token-text-muted);
135
136
  margin-top: 2px;
136
137
  line-height: 1.5;
137
138
  }
138
139
 
139
140
  /* 超时进度条 */
140
- .toast-progress {
141
+ .icen-toast-progress {
141
142
  position: absolute;
142
143
  bottom: 0;
143
- left: 0;
144
- right: 0;
144
+ inset-inline: 0;
145
145
  height: 2px;
146
146
  background: transparent;
147
147
  overflow: hidden;
148
- border-radius: 0 0 var(--radius-sm) var(--radius-sm);
148
+ border-radius: 0 0 var(--icen-radius-sm) var(--icen-radius-sm);
149
149
  }
150
- .toast-progress-fill {
150
+ .icen-toast-progress-fill {
151
151
  height: 100%;
152
- background: var(--token-accent);
153
- transform-origin: left;
152
+ background: var(--icen-token-accent);
153
+ transform-origin: left; /* guard:allow-physical 倒计时压缩方向是动画语义(LTR 自左向右消减),RTL 下保持同一物理节奏 */
154
154
  animation: toast-countdown linear forwards;
155
155
  }
156
- .toast--success .toast-progress-fill { background: var(--token-success); }
157
- .toast--error .toast-progress-fill { background: var(--token-error); }
158
- .toast--warning .toast-progress-fill { background: var(--token-warning); }
159
- .toast--info .toast-progress-fill { background: var(--token-info); }
156
+ .icen-toast--success .icen-toast-progress-fill { background: var(--icen-token-success); }
157
+ .icen-toast--error .icen-toast-progress-fill { background: var(--icen-token-error); }
158
+ .icen-toast--warning .icen-toast-progress-fill { background: var(--icen-token-warning); }
159
+ .icen-toast--info .icen-toast-progress-fill { background: var(--icen-token-info); }
160
160
  @keyframes toast-countdown {
161
161
  from { transform: scaleX(1); }
162
162
  to { transform: scaleX(0); }
163
163
  }
164
164
 
165
- /* 容器定位变体 */
166
- .toast-container[data-position='top-left'] {
167
- right: auto;
165
+ /* 容器定位变体(位置名为物理角契约,RTL 语义不变) */
166
+ .icen-toast-container[data-icen-position='top-left'] {
167
+ right: auto; /* guard:allow-physical 物理角位置变体 top-left */
168
168
  bottom: auto;
169
- top: var(--density-space-md);
170
- left: var(--density-space-md);
169
+ top: var(--icen-density-space-md);
170
+ left: var(--icen-density-space-md); /* guard:allow-physical 物理角位置变体 top-left */
171
171
  align-items: flex-start;
172
172
  }
173
- .toast-container[data-position='top-right'] {
173
+ .icen-toast-container[data-icen-position='top-right'] {
174
174
  bottom: auto;
175
- top: var(--density-space-md);
175
+ top: var(--icen-density-space-md);
176
176
  }
177
- .toast-container[data-position='top-center'] {
178
- right: auto;
177
+ .icen-toast-container[data-icen-position='top-center'] {
178
+ right: auto; /* guard:allow-physical 物理角位置变体 top-center */
179
179
  bottom: auto;
180
- top: var(--density-space-md);
181
- left: 50%;
180
+ top: var(--icen-density-space-md);
181
+ left: 50%; /* guard:allow-physical 水平居中:left 50% + translateX(-50%) 任意方向下均为视口水平中心 */
182
182
  transform: translateX(-50%);
183
183
  align-items: center;
184
184
  }
185
- .toast-container[data-position='bottom-left'] {
186
- right: auto;
187
- left: var(--density-space-md);
185
+ .icen-toast-container[data-icen-position='bottom-left'] {
186
+ right: auto; /* guard:allow-physical 物理角位置变体 bottom-left */
187
+ left: var(--icen-density-space-md); /* guard:allow-physical 物理角位置变体 bottom-left */
188
188
  align-items: flex-start;
189
189
  }
190
- .toast-container[data-position='bottom-center'] {
191
- right: auto;
192
- left: 50%;
190
+ .icen-toast-container[data-icen-position='bottom-center'] {
191
+ right: auto; /* guard:allow-physical 物理角位置变体 bottom-center */
192
+ left: 50%; /* guard:allow-physical 水平居中:left 50% + translateX(-50%) 任意方向下均为视口水平中心 */
193
193
  transform: translateX(-50%);
194
194
  align-items: center;
195
195
  }
196
196
 
197
- .toast.is-leaving {
197
+ .icen-toast.is-leaving {
198
198
  opacity: 0;
199
199
  transform: translateY(8px);
200
200
  transition:
@@ -208,10 +208,24 @@
208
208
  }
209
209
 
210
210
  @media (max-width: 480px) {
211
- .toast-container { right: var(--density-space-sm); bottom: var(--density-space-sm); left: var(--density-space-sm); align-items: stretch; }
212
- .toast { max-width: none; }
211
+ .icen-toast-container { inset-inline: var(--icen-density-space-sm); bottom: var(--icen-density-space-sm); align-items: stretch; }
212
+ .icen-toast { max-inline-size: none; }
213
213
  }
214
214
 
215
215
  @media (prefers-reduced-motion: reduce) {
216
- .toast { animation: none; }
216
+ .icen-toast { animation: none; }
217
+ }
218
+
219
+ /* Quiet close shares the same fixed action slot as other interface controls. */
220
+ .icen-toast-close.icen-icon-action { inline-size: var(--icen-density-input-height-sm); block-size: var(--icen-density-input-height-sm); }
221
+ .icen-toast-close.icen-icon-action > svg { inline-size: 14px; block-size: 14px; }
222
+ .icen-toast-close:focus-visible { outline: 2px solid var(--icen-token-accent); outline-offset: 1px; }
223
+ @media (pointer: coarse) { .icen-toast-close.icen-icon-action { min-inline-size: 44px; min-block-size: 44px; } }
224
+
225
+ .icen-toast-content { min-inline-size: 0; }
226
+ .icen-toast { max-inline-size: min(380px, calc(100vw - 2 * var(--icen-density-space-md))); }
227
+ .icen-toast-action { min-block-size: var(--icen-density-input-height-sm); padding-inline: var(--icen-density-space-sm); border-radius: var(--icen-radius-sm); text-decoration: none; background: var(--icen-token-fill-1); }
228
+ .icen-toast-action:hover { background: var(--icen-token-fill-2); }
229
+ @media (pointer: coarse) { .icen-toast-action { min-inline-size: 44px; min-block-size: 44px; } }
230
+
217
231
  }