@greypan/web-ui 3.0.0 → 4.0.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 (220) hide show
  1. package/README.CN.md +297 -34
  2. package/README.md +304 -39
  3. package/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/decorate.js +1 -1
  4. package/dist/assets/glass.js +1 -1
  5. package/dist/assets/glass.js.map +1 -1
  6. package/dist/assets/menu-portal.js +1 -1
  7. package/dist/assets/menu-portal.js.map +1 -1
  8. package/dist/assets/overlay-motion.js +1 -1
  9. package/dist/assets/overlay-motion.js.map +1 -1
  10. package/dist/assets/toast-containers.js +1 -1
  11. package/dist/assets/toast-containers.js.map +1 -1
  12. package/dist/components/autocomplete/index.d.ts +4 -12
  13. package/dist/components/autocomplete/index.js +95 -102
  14. package/dist/components/autocomplete/index.js.map +1 -1
  15. package/dist/components/autocomplete/style.js +1 -1
  16. package/dist/components/autocomplete/style.js.map +1 -1
  17. package/dist/components/avatar/index.d.ts +0 -1
  18. package/dist/components/avatar/index.js +8 -13
  19. package/dist/components/avatar/index.js.map +1 -1
  20. package/dist/components/back-top/index.js +1 -1
  21. package/dist/components/back-top/style.js +1 -1
  22. package/dist/components/back-top/style.js.map +1 -1
  23. package/dist/components/badge/index.d.ts +1 -0
  24. package/dist/components/badge/index.js +12 -14
  25. package/dist/components/badge/index.js.map +1 -1
  26. package/dist/components/button/index.d.ts +2 -0
  27. package/dist/components/button/index.js +51 -38
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button/style.js +1 -1
  30. package/dist/components/button/style.js.map +1 -1
  31. package/dist/components/button-group/index.d.ts +1 -2
  32. package/dist/components/button-group/index.js +19 -23
  33. package/dist/components/button-group/index.js.map +1 -1
  34. package/dist/components/checkbox/index.d.ts +4 -7
  35. package/dist/components/checkbox/index.js +48 -37
  36. package/dist/components/checkbox/index.js.map +1 -1
  37. package/dist/components/checkbox/style.js +1 -1
  38. package/dist/components/checkbox/style.js.map +1 -1
  39. package/dist/components/checkbox-group/index.d.ts +4 -10
  40. package/dist/components/checkbox-group/index.js +74 -60
  41. package/dist/components/checkbox-group/index.js.map +1 -1
  42. package/dist/components/context-menu/index.js +7 -8
  43. package/dist/components/context-menu/index.js.map +1 -1
  44. package/dist/components/dialog/index.d.ts +1 -0
  45. package/dist/components/dialog/index.js +13 -9
  46. package/dist/components/dialog/index.js.map +1 -1
  47. package/dist/components/dialog/style.js +1 -1
  48. package/dist/components/dialog/style.js.map +1 -1
  49. package/dist/components/drawer/index.d.ts +15 -0
  50. package/dist/components/drawer/index.js +58 -34
  51. package/dist/components/drawer/index.js.map +1 -1
  52. package/dist/components/drawer/style.js +1 -1
  53. package/dist/components/drawer/style.js.map +1 -1
  54. package/dist/components/dropdown/index.js +1 -1
  55. package/dist/components/dropdown-divider/index.js +1 -1
  56. package/dist/components/dropdown-header/index.js +1 -1
  57. package/dist/components/dropdown-header/style.js +1 -1
  58. package/dist/components/dropdown-header/style.js.map +1 -1
  59. package/dist/components/dropdown-item/index.js +3 -2
  60. package/dist/components/dropdown-item/index.js.map +1 -1
  61. package/dist/components/empty/index.js +1 -1
  62. package/dist/components/empty/style.js +1 -1
  63. package/dist/components/empty/style.js.map +1 -1
  64. package/dist/components/icon/index.js +1 -1
  65. package/dist/components/index.d.ts +1 -1
  66. package/dist/components/index.js +9 -9
  67. package/dist/components/input/index.d.ts +2 -3
  68. package/dist/components/input/index.js +62 -52
  69. package/dist/components/input/index.js.map +1 -1
  70. package/dist/components/input/style.js +1 -1
  71. package/dist/components/input/style.js.map +1 -1
  72. package/dist/components/input-number/index.d.ts +2 -3
  73. package/dist/components/input-number/index.js +58 -38
  74. package/dist/components/input-number/index.js.map +1 -1
  75. package/dist/components/input-number/style.js +1 -1
  76. package/dist/components/input-number/style.js.map +1 -1
  77. package/dist/components/layout/index.d.ts +53 -3
  78. package/dist/components/layout/index.js +146 -39
  79. package/dist/components/layout/index.js.map +1 -1
  80. package/dist/components/layout/style.js +1 -1
  81. package/dist/components/layout/style.js.map +1 -1
  82. package/dist/components/option/index.js +1 -1
  83. package/dist/components/option/style.js +1 -1
  84. package/dist/components/option/style.js.map +1 -1
  85. package/dist/components/popover/index.js +7 -5
  86. package/dist/components/popover/index.js.map +1 -1
  87. package/dist/components/popover/style.js +1 -1
  88. package/dist/components/popover/style.js.map +1 -1
  89. package/dist/components/radio/index.d.ts +4 -7
  90. package/dist/components/radio/index.js +48 -37
  91. package/dist/components/radio/index.js.map +1 -1
  92. package/dist/components/radio/style.js +1 -1
  93. package/dist/components/radio/style.js.map +1 -1
  94. package/dist/components/radio-group/index.d.ts +4 -10
  95. package/dist/components/radio-group/index.js +70 -52
  96. package/dist/components/radio-group/index.js.map +1 -1
  97. package/dist/components/segmented/index.d.ts +6 -11
  98. package/dist/components/segmented/index.js +67 -55
  99. package/dist/components/segmented/index.js.map +1 -1
  100. package/dist/components/segmented/style.js +1 -1
  101. package/dist/components/segmented/style.js.map +1 -1
  102. package/dist/components/segmented-trigger/index.d.ts +1 -2
  103. package/dist/components/segmented-trigger/index.js +18 -19
  104. package/dist/components/segmented-trigger/index.js.map +1 -1
  105. package/dist/components/segmented-trigger/style.js +1 -1
  106. package/dist/components/segmented-trigger/style.js.map +1 -1
  107. package/dist/components/select/index.d.ts +13 -8
  108. package/dist/components/select/index.js +110 -75
  109. package/dist/components/select/index.js.map +1 -1
  110. package/dist/components/select/style.js +1 -1
  111. package/dist/components/select/style.js.map +1 -1
  112. package/dist/components/slider/index.d.ts +3 -5
  113. package/dist/components/slider/index.js +59 -42
  114. package/dist/components/slider/index.js.map +1 -1
  115. package/dist/components/slider/style.js +1 -1
  116. package/dist/components/slider/style.js.map +1 -1
  117. package/dist/components/spinner/index.d.ts +0 -2
  118. package/dist/components/spinner/index.js +14 -13
  119. package/dist/components/spinner/index.js.map +1 -1
  120. package/dist/components/spinner/style.js +1 -1
  121. package/dist/components/spinner/style.js.map +1 -1
  122. package/dist/components/svg-draw-lines/index.js +1 -1
  123. package/dist/components/switch/index.d.ts +5 -6
  124. package/dist/components/switch/index.js +51 -37
  125. package/dist/components/switch/index.js.map +1 -1
  126. package/dist/components/switch/style.js +1 -1
  127. package/dist/components/switch/style.js.map +1 -1
  128. package/dist/components/textarea/index.d.ts +5 -6
  129. package/dist/components/textarea/index.js +73 -63
  130. package/dist/components/textarea/index.js.map +1 -1
  131. package/dist/components/textarea/style.js +1 -1
  132. package/dist/components/textarea/style.js.map +1 -1
  133. package/dist/components/theme/index.js +1 -1
  134. package/dist/components/theme/style.js +1 -1
  135. package/dist/components/theme/style.js.map +1 -1
  136. package/dist/components/toast/style.js +1 -1
  137. package/dist/components/toast/style.js.map +1 -1
  138. package/dist/components/toast/toast.js +12 -12
  139. package/dist/components/toast/toast.js.map +1 -1
  140. package/dist/components/tooltip/index.js +1 -1
  141. package/dist/components/tooltip/style.js +1 -1
  142. package/dist/components/tooltip/style.js.map +1 -1
  143. package/dist/icons/generated/lucide-clapperboard.d.ts +6 -0
  144. package/dist/icons/generated/lucide-clapperboard.js +10 -0
  145. package/dist/icons/generated/lucide-clapperboard.js.map +1 -0
  146. package/dist/icons/generated/lucide-external-link.d.ts +6 -0
  147. package/dist/icons/generated/lucide-external-link.js +10 -0
  148. package/dist/icons/generated/lucide-external-link.js.map +1 -0
  149. package/dist/icons/generated/lucide-eye.d.ts +6 -0
  150. package/dist/icons/generated/lucide-eye.js +10 -0
  151. package/dist/icons/generated/lucide-eye.js.map +1 -0
  152. package/dist/icons/generated/lucide-file-text.d.ts +6 -0
  153. package/dist/icons/generated/lucide-file-text.js +10 -0
  154. package/dist/icons/generated/lucide-file-text.js.map +1 -0
  155. package/dist/icons/generated/lucide-film.d.ts +6 -0
  156. package/dist/icons/generated/lucide-film.js +10 -0
  157. package/dist/icons/generated/lucide-film.js.map +1 -0
  158. package/dist/icons/generated/lucide-folder-open.d.ts +6 -0
  159. package/dist/icons/generated/lucide-folder-open.js +10 -0
  160. package/dist/icons/generated/lucide-folder-open.js.map +1 -0
  161. package/dist/icons/generated/lucide-headphones.d.ts +6 -0
  162. package/dist/icons/generated/lucide-headphones.js +10 -0
  163. package/dist/icons/generated/lucide-headphones.js.map +1 -0
  164. package/dist/icons/generated/lucide-layout-grid.d.ts +6 -0
  165. package/dist/icons/generated/lucide-layout-grid.js +10 -0
  166. package/dist/icons/generated/lucide-layout-grid.js.map +1 -0
  167. package/dist/icons/generated/lucide-link.d.ts +6 -0
  168. package/dist/icons/generated/lucide-link.js +10 -0
  169. package/dist/icons/generated/lucide-link.js.map +1 -0
  170. package/dist/icons/generated/lucide-music.d.ts +6 -0
  171. package/dist/icons/generated/lucide-music.js +10 -0
  172. package/dist/icons/generated/lucide-music.js.map +1 -0
  173. package/dist/icons/generated/lucide-package.d.ts +6 -0
  174. package/dist/icons/generated/lucide-package.js +10 -0
  175. package/dist/icons/generated/lucide-package.js.map +1 -0
  176. package/dist/icons/generated/lucide-pen-line.d.ts +6 -0
  177. package/dist/icons/generated/lucide-pen-line.js +10 -0
  178. package/dist/icons/generated/lucide-pen-line.js.map +1 -0
  179. package/dist/icons/generated/lucide-pencil.d.ts +6 -0
  180. package/dist/icons/generated/lucide-pencil.js +10 -0
  181. package/dist/icons/generated/lucide-pencil.js.map +1 -0
  182. package/dist/icons/generated/lucide-play.d.ts +6 -0
  183. package/dist/icons/generated/lucide-play.js +10 -0
  184. package/dist/icons/generated/lucide-play.js.map +1 -0
  185. package/dist/icons/generated/lucide-refresh-cw.d.ts +6 -0
  186. package/dist/icons/generated/lucide-refresh-cw.js +10 -0
  187. package/dist/icons/generated/lucide-refresh-cw.js.map +1 -0
  188. package/dist/icons/generated/lucide-sliders-horizontal.d.ts +6 -0
  189. package/dist/icons/generated/lucide-sliders-horizontal.js +10 -0
  190. package/dist/icons/generated/lucide-sliders-horizontal.js.map +1 -0
  191. package/dist/icons/generated/lucide-tags.d.ts +6 -0
  192. package/dist/icons/generated/lucide-tags.js +10 -0
  193. package/dist/icons/generated/lucide-tags.js.map +1 -0
  194. package/dist/icons/generated/lucide-wrench.d.ts +6 -0
  195. package/dist/icons/generated/lucide-wrench.js +10 -0
  196. package/dist/icons/generated/lucide-wrench.js.map +1 -0
  197. package/dist/icons/index.d.ts +18 -0
  198. package/dist/icons/index.js +19 -1
  199. package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -3
  200. package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
  201. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -1
  202. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
  203. package/dist/shared/events/user-change.js.map +1 -1
  204. package/dist/shared/form-association/index.js +41 -0
  205. package/dist/shared/form-association/index.js.map +1 -0
  206. package/dist/shared/group-management/index.js +109 -0
  207. package/dist/shared/group-management/index.js.map +1 -0
  208. package/dist/shared/menu-portal/menu-tree.js +20 -7
  209. package/dist/shared/menu-portal/menu-tree.js.map +1 -1
  210. package/dist/shared/option-portal/index.js +65 -0
  211. package/dist/shared/option-portal/index.js.map +1 -0
  212. package/dist/shared/overlay/overlay.js +1 -1
  213. package/dist/shared/overlay/overlay.js.map +1 -1
  214. package/dist/shared/overlay/portal.js +9 -6
  215. package/dist/shared/overlay/portal.js.map +1 -1
  216. package/dist/shared/overlay/presence.js.map +1 -1
  217. package/dist/shared/visible-area/index.js +69 -0
  218. package/dist/shared/visible-area/index.js.map +1 -0
  219. package/dist/types/utils.d.ts +6 -1
  220. package/package.json +7 -5
package/README.CN.md CHANGED
@@ -31,6 +31,29 @@ import '@greypan/web-ui'
31
31
 
32
32
  ## 框架集成
33
33
 
34
+ ### 跨框架 API 约定
35
+
36
+ `web-ui-*` 元素暴露三面 API,**DOM / JavaScript API 是事实来源**:Property 使用 camelCase,Attribute 使用
37
+ kebab-case,Event 使用 kebab-case。
38
+
39
+ | 表面 | 命名 | 示例 |
40
+ | --------- | ---------- | --------------------------------------------- |
41
+ | Property | camelCase | `open`、`sidebarCollapsed`、`noScrollLock` |
42
+ | Attribute | kebab-case | `open`、`sidebar-collapsed`、`no-scroll-lock` |
43
+ | Event | kebab-case | `open-change`、`sidebar-collapsed-change` |
44
+
45
+ - **布尔 Attribute** 遵循原生 HTML 存在语义:不存在 → `false`,存在 → `true`。框架绑定写入的
46
+ `disabled="false"` 是字符串 `"false"`,会被视为 true——**动态布尔必须绑定 Property**(camelCase),
47
+ 才能把 `false` 写成真实 property。
48
+ - **Vue**:动态绑定必须走 **Property**,使用 camelCase 属性名(`:sidebarCollapsed="x"`、`:open="x"`)。
49
+ kebab-case 绑定(`:sidebar-collapsed="x"`)会被写成字符串 attribute,无法表达 `false`,请使用 camelCase
50
+ property。`.prop` 修饰符只在 camelCase 属性名下有效(`:sidebarCollapsed.prop="x"`)。String/Number 值可
51
+ 保留 kebab-case attribute(`:max-height="120"`)。带值控件(`web-ui-input`、`web-ui-select`、
52
+ `web-ui-autocomplete` 等)支持 `v-model`,编译为元素的 `value` property + `input` 事件。
53
+ - **React**:React 19 对 custom element 的 props 直接写 DOM property,因此使用 camelCase props
54
+ (`open={open}`、`noScrollLock`、`value={value}`)。**不要把复杂数据(对象、数组)放进 attribute 字符串**,
55
+ 一律绑定为 property。kebab-case JSX prop 在 custom element 上会写成 attribute。
56
+
34
57
  ### React
35
58
 
36
59
  需要 `@types/react >= 19` 作为可选 peer 依赖。
@@ -127,10 +150,25 @@ import '@greypan/web-ui/types/vue'
127
150
  </template>
128
151
  ```
129
152
 
153
+ Boolean 属性必须用 **camelCase 属性名**绑定,而不是 kebab-case attribute。Vue 会把 attribute 绑定写成字符串,
154
+ 而布尔 attribute 遵循「存在即 true」的语义——所以 `:sidebar-collapsed="false"` 会写出字符串 `"false"`,被当作 true。
155
+ 改用 camelCase 属性名(`:sidebarCollapsed="false"`,或 `.prop` 修饰符)会让 Vue 直接写 DOM property:
156
+
157
+ ```vue
158
+ <web-ui-layout
159
+ header-glow
160
+ :sidebarCollapsed="sidebarCollapsed"
161
+ :sidebarOpen="sidebarOpen"
162
+ @sidebar-collapsed-change="sidebarCollapsed = $event.detail.collapsed"
163
+ @sidebar-open-change="sidebarOpen = $event.detail.open"
164
+ />
165
+ ```
166
+
130
167
  Vue 事件类型零 cast:带值组件上的 `@input`/`@change` 解析到组件 emit,`$event.target` 即为组件实例,
131
168
  `value`/`checked` 直接读取;kebab-case 事件(如 `open-change`)的 `$event.detail` 保持 `CustomEvent` 载荷类型。
132
- 命名 handler 用 `WebUiEvent<WebUiXxx, 'change'>` 标注。未声明为 emit 的原生事件(`@click`/`@focus` 等)
133
- 在任何 `web-ui-*` 元素上仍可绑定。
169
+ 命名 handler 用 `WebUiEvent<WebUiXxx, 'change'>` 标注;当变量或泛型表示事件名时,使用
170
+ `WebUiEventName<WebUiXxx>`,它只接受该组件 `$events` 的 string key。未声明为 emit 的原生事件
171
+ (`@click`/`@focus` 等)在任何 `web-ui-*` 元素上仍可绑定。
134
172
 
135
173
  ### 属性与事件边界
136
174
 
@@ -142,6 +180,10 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
142
180
  `click`、`input`、`change` 等浏览器 composed 原生事件仍是主要交互 API。`open-change` 等 kebab-case 自定义事件
143
181
  仅描述用户操作导致的组件状态变化;程序化赋值 property 不会触发它们。
144
182
 
183
+ ### 表单关联控件
184
+
185
+ 所有表单控件均参与原生 `FormData`、约束校验、`form.reset()` 和浏览器表单状态恢复。控件会在**首次连接且声明式属性完成初始化后**捕获一次重置默认值;之后的运行时 property 更新不会改写该默认值。祖先 `fieldset` 的禁用状态会禁用交互和校验,但不会改写控件公开的 `disabled` 属性。对于 checkbox/radio group,父 group 是提交、重置和状态恢复的唯一所有者;被管理的子项不会独立提交或恢复状态。
186
+
145
187
  ## 所有组件
146
188
 
147
189
  | 分类 | 组件 |
@@ -210,6 +252,12 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
210
252
 
211
253
  **插槽:** `prefix`, `default`, `suffix`
212
254
 
255
+ **CSS 自定义属性:**
256
+
257
+ | 属性 | 默认值 | 说明 |
258
+ | ------------------------- | -------------------------------- | ------------ |
259
+ | `--wui-input-clear-color` | `var(--wui-color-text-tertiary)` | 清除按钮颜色 |
260
+
213
261
  #### `<web-ui-textarea>`
214
262
 
215
263
  多行文本输入框,支持自动调整高度。
@@ -239,6 +287,13 @@ ARIA 属性同样必须显式支持:使用组件文档化的命名属性,而
239
287
 
240
288
  **插槽:** `prefix`, `suffix`
241
289
 
290
+ **CSS 自定义属性:**
291
+
292
+ | 属性 | 默认值 | 说明 |
293
+ | ---------------------------- | -------------------------------- | ------------ |
294
+ | `--wui-textarea-width` | `200px` | 文本域宽度 |
295
+ | `--wui-textarea-clear-color` | `var(--wui-color-text-tertiary)` | 清除按钮颜色 |
296
+
242
297
  #### `<web-ui-input-number>`
243
298
 
244
299
  数字输入框,支持步进按钮和键盘操作。
@@ -281,6 +336,13 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
281
336
 
282
337
  子 `<web-ui-option>` 通过 `option-register` / `option-unregister` 注册。支持 ArrowDown/ArrowUp/Enter/Escape 键盘导航。
283
338
 
339
+ **CSS 自定义属性:**
340
+
341
+ | 属性 | 默认值 | 说明 |
342
+ | ------------------------- | ------- | -------------- |
343
+ | `--wui-select-max-width` | `500px` | 下拉框最大宽度 |
344
+ | `--wui-overlay-min-width` | `200px` | 下拉框最小宽度 |
345
+
284
346
  #### `<web-ui-autocomplete>`
285
347
 
286
348
  可输入并过滤候选的单值选择器。
@@ -307,6 +369,13 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
307
369
 
308
370
  键入时按 label 过滤候选(`contains` 或 `prefix`,`none` 关闭过滤)。选择 option 时文本回填为该项 label,`selected-value` 暴露该项的 value;`change` 在选择提交时触发。支持 ArrowDown/ArrowUp/Enter/Escape 键盘导航。
309
371
 
372
+ **CSS 自定义属性:**
373
+
374
+ | 属性 | 默认值 | 说明 |
375
+ | ------------------------------ | ------- | -------------- |
376
+ | `--wui-autocomplete-max-width` | `500px` | 下拉框最大宽度 |
377
+ | `--wui-overlay-min-width` | `200px` | 下拉框最小宽度 |
378
+
310
379
  #### `<web-ui-slider>`
311
380
 
312
381
  范围滑块,支持刻度标记和垂直方向。
@@ -329,6 +398,18 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
329
398
 
330
399
  支持 ArrowLeft/Right/Up/Down、Home/End、PageUp/PageDown 键盘导航。使用 pointer capture 处理鼠标、触控笔和触摸交互。
331
400
 
401
+ **CSS 自定义属性:**
402
+
403
+ | 属性 | 默认值 | 说明 |
404
+ | ------------------------------ | ----------------------------------- | ------------ |
405
+ | `--wui-slider-width` | `200px` | 滑块宽度 |
406
+ | `--wui-slider-vertical-height` | `200px` | 垂直滑块高度 |
407
+ | `--wui-slider-height` | `var(--wui-slider-track-size, 6px)` | 轨道厚度 |
408
+ | `--wui-slider-track-size` | `6px` | 轨道尺寸 |
409
+ | `--wui-slider-thumb-width` | `24px` | 滑块短轴 |
410
+ | `--wui-slider-thumb-height` | `32px` | 滑块长轴 |
411
+ | `--wui-slider-marks-inset` | `0` | 刻度内缩 |
412
+
332
413
  #### `<web-ui-checkbox>`
333
414
 
334
415
  单个复选框。
@@ -441,16 +522,16 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
441
522
 
442
523
  样式化按钮,支持多种变体和加载状态。
443
524
 
444
- | 属性 | 类型 | 默认值 | 说明 |
445
- | ------------ | ------------------------------------------------------------ | ---------- | ----------------------------------- |
446
- | `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger' \| 'glass'` | `'glass'` | 按钮变体 |
447
- | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | 内部按钮类型;非法值回退为 `button` |
448
- | `disabled` | `boolean` | `false` | 禁用状态 |
449
- | `loading` | `boolean` | `false` | 加载旋转动画 |
450
- | `full` | `boolean` | `false` | 全宽 |
451
- | `icon` | `boolean` | `false` | 纯图标模式 |
452
- | `size` | `string` | `''` | 尺寸格式 `高度` 或 `高度x宽度` |
453
- | `aria-label` | `string` | — | 无障碍标签(委托给内部按钮) |
525
+ | 属性 | 类型 | 默认值 | 说明 |
526
+ | ------------ | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------- |
527
+ | `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger' \| 'glass'` | `'glass'` | 按钮变体 |
528
+ | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | 内部按钮类型;非法值回退为 `button` |
529
+ | `disabled` | `boolean` | `false` | 禁用状态 |
530
+ | `loading` | `boolean` | `false` | 加载旋转动画 |
531
+ | `full` | `boolean` | `false` | 全宽 |
532
+ | `icon` | `boolean` | `false` | 纯图标模式 |
533
+ | `size` | `string` | `''` | 按钮高度(px);icon 模式下同时设为 min-width,默认保持正方形 |
534
+ | `aria-label` | `string` | — | 无障碍标签(委托给内部按钮) |
454
535
 
455
536
  **事件:** 标准 `click`
456
537
 
@@ -460,6 +541,18 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
460
541
 
461
542
  禁用和加载状态阻止 `click` 事件。
462
543
 
544
+ **CSS 自定义属性:**
545
+
546
+ | 属性 | 默认值 | 说明 |
547
+ | ------------------------ | ------------- | ---------------------- |
548
+ | `--wui-button-width` | `max-content` | 按钮宽度 |
549
+ | `--wui-button-px` | `12px` | 水平内边距 |
550
+ | `--wui-button-gap` | `8px` | 前缀/默认/后缀插槽间距 |
551
+ | `--wui-button-color` | 随 variant | 按钮文字颜色 |
552
+ | `--wui-button-bg` | 随 variant | 按钮背景颜色 |
553
+ | `--wui-button-bg-hover` | 随 variant | 悬停背景颜色 |
554
+ | `--wui-button-bg-active` | 随 variant | 按下背景颜色 |
555
+
463
556
  #### `<web-ui-button-group>`
464
557
 
465
558
  按钮组,管理子按钮布局和方向。
@@ -470,7 +563,7 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
470
563
 
471
564
  **插槽:** `default`(投影 `<web-ui-button>` 元素)
472
565
 
473
- 向子按钮传递 `direction` 属性。
566
+ 以内部派生的视觉上下文控制按钮组方向,不改写子按钮属性。
474
567
 
475
568
  ---
476
569
 
@@ -485,6 +578,7 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
485
578
  | `open` | `boolean` | `false` | 对话框可见性 |
486
579
  | `no-scroll-lock` | `boolean` | `false` | 打开时不锁定页面滚动 |
487
580
  | `no-backdrop-close` | `boolean` | `false` | 禁止点击遮罩关闭 |
581
+ | `no-escape-close` | `boolean` | `false` | 禁止按 Escape 关闭 |
488
582
 
489
583
  **事件:** `open-change` (`CustomEvent<{ open: boolean }>`)
490
584
 
@@ -492,28 +586,49 @@ ArrowUp/ArrowDown 键增减数值。空输入或 `-` 在提交时被忽略,值
492
586
 
493
587
  **方法:** `showModal()`, `close()`
494
588
 
495
- 使用原生 `<dialog>`,`@cancel` 阻止默认关闭行为(Escape 调用 `close()`)。点击遮罩关闭。
589
+ 使用原生 `<dialog>`,`@cancel` 阻止默认关闭行为。除非存在 `no-escape-close`,否则 Escape 调用 `close()`;除非存在 `no-backdrop-close`,否则点击遮罩关闭。
590
+
591
+ **CSS 自定义属性:**
592
+
593
+ | 属性 | 默认值 | 说明 |
594
+ | ------------------------- | --------------------------- | -------------- |
595
+ | `--wui-dialog-max-width` | `360px` | 对话框最大宽度 |
596
+ | `--wui-dialog-overlay-bg` | `var(--wui-color-backdrop)` | 遮罩背景色 |
496
597
 
497
598
  #### `<web-ui-drawer>`
498
599
 
499
600
  侧边抽屉,使用原生 `<dialog>` 并自带关闭动画。
500
601
 
501
- | 属性 | 类型 | 默认值 | 说明 |
502
- | ------------------- | ---------------------------------------- | --------- | -------------------------------- |
503
- | `open` | `boolean` | `false` | 抽屉可见性 |
504
- | `placement` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 滑入方向 |
505
- | `heading` | `string` | `''` | 标题文字(无 header 插槽时显示) |
506
- | `closable` | `boolean` | `false` | 显示关闭按钮 |
507
- | `no-scroll-lock` | `boolean` | `false` | 打开时不锁定页面滚动 |
508
- | `no-backdrop-close` | `boolean` | `false` | 禁止点击遮罩关闭 |
602
+ | 属性 | 类型 | 默认值 | 说明 |
603
+ | ------------------- | ---------------------------------------- | --------- | ---------------------------------------------------- |
604
+ | `open` | `boolean` | `false` | 抽屉可见性 |
605
+ | `placement` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 滑入方向 |
606
+ | `heading` | `string` | `''` | 标题文字(无 header 插槽时显示) |
607
+ | `closable` | `boolean` | `false` | 显示关闭按钮 |
608
+ | `no-scroll-lock` | `boolean` | `false` | 打开时不锁定页面滚动 |
609
+ | `no-backdrop-close` | `boolean` | `false` | 禁止点击遮罩关闭 |
610
+ | `request-only` | `boolean` | `false` | 用户关闭仅请求 `open=false`,由 Consumer 回写 `open` |
611
+ | `headless` | `boolean` | `false` | 仅保留 overlay 行为,默认插槽不渲染内置抽屉 UI |
612
+ | `dialog-label` | `string` | `''` | 内部原生 dialog 的可访问名称;headless 模式必须提供 |
509
613
 
510
- **事件:** `open-change` (`CustomEvent<{ open: boolean }>`)
614
+ **事件:** `open-change` (`CustomEvent<{ open: boolean }>`)。启用 `request-only` 后,Escape、遮罩和内置关闭按钮仅请求 `open=false`;Consumer 写入 `open=false` 前抽屉保持打开。若原生 dialog 在请求被拒绝期间关闭,组件会恢复其打开的 top layer 状态并发出同一关闭请求。
511
615
 
512
- **插槽:** `header`, `default`, `footer`
616
+ **插槽:** `header`, `default`, `footer`;启用 `headless` 时仅渲染 `default` 插槽。
513
617
 
514
618
  **方法:** `show()`, `close()`
515
619
 
516
- 关闭时保留原生 dialog 的 top layer,待 `--wui-duration-drawer` 过渡完成(默认 280ms)后调用 `dialog.close()`。Escape 始终走此关闭路径;`no-backdrop-close` 仅控制遮罩点击。
620
+ `headless` 保留原生 dialog、遮罩、placement 动画、Escape/遮罩关闭行为和滚动锁定,但不渲染内置 glass 主体、header、关闭按钮或 footer;Consumer 负责完整定义默认插槽内容的样式,并且必须提供 `dialog-label`,确保原生 dialog 具有可访问名称。
621
+
622
+ 关闭时保留原生 dialog 的 top layer,待退出过渡完成后调用 `dialog.close()`。Escape 始终走此关闭路径;`no-backdrop-close` 仅控制遮罩点击。
623
+
624
+ **CSS 自定义属性:**
625
+
626
+ | 属性 | 默认值 | 说明 |
627
+ | ------------------------- | ---------------------------------- | ----------------- |
628
+ | `--wui-drawer-width` | `320px` | 抽屉宽度 |
629
+ | `--wui-drawer-height` | `300px` | 抽屉高度(上/下) |
630
+ | `--wui-drawer-bg` | `var(--wui-color-surface-overlay)` | 抽屉背景色 |
631
+ | `--wui-drawer-overlay-bg` | `rgb(0 0 0 / 0.12)` | 遮罩背景色 |
517
632
 
518
633
  ---
519
634
 
@@ -563,6 +678,13 @@ Hover 模式使用 `pointerenter`/`pointerleave` 加延迟控制。Click 模式
563
678
 
564
679
  `open` 是受控可见性属性。指针/焦点触发会更新它,直接设置也会同步本地或 Portal 面板。第一个 Tooltip 显示后,相邻 Tooltip 会立即切换;其余 pointer/focus 触发使用延迟计时器。
565
680
 
681
+ **CSS 自定义属性:**
682
+
683
+ | 属性 | 默认值 | 说明 |
684
+ | ------------------------- | ------- | ------------ |
685
+ | `--wui-tooltip-max-width` | `240px` | 提示最大宽度 |
686
+ | `--wui-tooltip-font-size` | `13px` | 提示字号 |
687
+
566
688
  #### `<web-ui-context-menu>`
567
689
 
568
690
  右键上下文菜单。
@@ -675,6 +797,17 @@ Hover 模式使用 `pointerenter`/`pointerleave` 加延迟控制。Click 模式
675
797
 
676
798
  **插槽:** `default`(标题,覆盖 `title` 属性)、`icon`、`description`、`action`
677
799
 
800
+ **CSS 自定义属性:**
801
+
802
+ | 属性 | 默认值 | 说明 |
803
+ | ----------------------------------- | ----------- | ------------------ |
804
+ | `--wui-empty-min-height` | `240px` | 最小高度(medium) |
805
+ | `--wui-empty-padding` | `32px 24px` | 内边距(medium) |
806
+ | `--wui-empty-icon-size` | `56px` | 图标容器尺寸 |
807
+ | `--wui-empty-content-width` | `480px` | 标题/描述最大宽度 |
808
+ | `--wui-empty-title-font-size` | `16px` | 标题字号(medium) |
809
+ | `--wui-empty-description-font-size` | `14px` | 描述字号(medium) |
810
+
678
811
  #### `<web-ui-icon>`
679
812
 
680
813
  图标渲染组件。接受 Iconify 数据对象。
@@ -693,6 +826,12 @@ import { lucideLoaderCircle } from '@greypan/web-ui/icons'
693
826
  html`<web-ui-icon .icon=${lucideLoaderCircle} spin />`
694
827
  ```
695
828
 
829
+ **CSS 自定义属性:**
830
+
831
+ | 属性 | 默认值 | 说明 |
832
+ | ------------------ | --------- | -------- |
833
+ | `--wui-icon-color` | `inherit` | 图标颜色 |
834
+
696
835
  #### `<web-ui-spinner>`
697
836
 
698
837
  加载旋转器。
@@ -725,14 +864,37 @@ WebUiSpinner.hide() // 隐藏
725
864
 
726
865
  #### `<web-ui-layout>`
727
866
 
728
- 页面布局网格。
867
+ 响应式页面布局:支持可选全宽 Banner、桌面端可折叠侧边栏,以及移动端 headless drawer。页面本身滚动;Banner 滚出后,桌面端 sidebar 和 header 固定在视口内。
868
+
869
+ | 属性 | 类型 | 默认值 | 说明 |
870
+ | ------------------- | --------- | --------- | ------------------------------------ |
871
+ | `sidebar-collapsed` | `boolean` | `false` | 桌面端侧边栏受控折叠状态 |
872
+ | `sidebar-open` | `boolean` | `false` | 移动端侧边栏 Drawer 受控打开状态 |
873
+ | `header-glow` | `boolean` | `false` | 在 header 插槽内容背后显示装饰性晕染 |
874
+ | `sidebar-width` | `string` | `'240px'` | 桌面端和移动端展开时的侧边栏宽度 |
875
+ | `collapsed-width` | `string` | `'72px'` | 桌面端折叠时的侧边栏宽度 |
876
+
877
+ **事件:** `sidebar-collapsed-change`(`CustomEvent<{ collapsed: boolean }>`)用于请求更新桌面端折叠状态;`sidebar-open-change`(`CustomEvent<{ open: boolean }>`)用于请求更新移动端 Drawer 打开状态。Consumer 必须将请求值回写到对应的受控属性。
878
+
879
+ | 插槽 | 说明 |
880
+ | --------- | ------------------------------------------------------------ |
881
+ | `banner` | 位于布局主体上方的可选全宽 Banner |
882
+ | `header` | 内容区的 sticky header |
883
+ | `sidebar` | 侧边栏卡片内容;内部固定区域与滚动容器均由 Consumer 自行定义 |
884
+ | `default` | 主内容区 |
885
+ | `tabbar` | 底部 tabbar |
886
+
887
+ `web-ui-layout` 只约束侧边栏卡片的可用空间并管理桌面端 Toggle,不创建侧边栏 scrollport。若仅让侧边栏的一部分滚动,请将 `sidebar` 插槽根节点设为 `height: 100%; min-height: 0` 的 flex column,再将 `overflow-y: auto` 设置到目标子元素。这样 Consumer 可自行固定头部和底部,无需额外的公共 slot。
729
888
 
730
- | 插槽 | 说明 |
731
- | --------- | ---------- |
732
- | `header` | 顶部横幅 |
733
- | `default` | 主内容区 |
734
- | `sidebar` | 侧边栏 |
735
- | `tabbar` | 底部标签栏 |
889
+ 在 `640px` 及以下,侧边栏会切换为 headless 模式的 `web-ui-drawer`。Consumer 内容仍渲染在相同的圆角侧边栏卡片中,移动端 Toggle 位于 header 行内。
890
+
891
+ `header-glow` 会在 header 插槽内容和移动端 Toggle 的背后添加 `pointer-events: none` 的装饰性晕染。它属于 Header 背景而非前景层,因此插槽内容始终位于其上方;可通过 `--wui-layout-header-glow-color` 覆盖颜色,默认值为 `--wui-color-page`。晕染浓度和范围由内部变量 `--wui-layout-header-glow-height`(默认 `150%`)控制;增大可加强覆盖,减小则更柔和。布局层级顺序为 Header(`10`)< Auxiliary(`20`)< Banner(`30`)< Tabbar(`40`)< Sidebar(`50`)。
892
+
893
+ **CSS 自定义属性:**
894
+
895
+ | 属性 | 默认值 | 说明 |
896
+ | ----------------------------- | ------ | ------------------------------------ |
897
+ | `--wui-layout-sidebar-radius` | `28px` | 侧边栏卡片圆角(桌面端和移动端共用) |
736
898
 
737
899
  #### `<web-ui-back-top>`
738
900
 
@@ -749,10 +911,21 @@ WebUiSpinner.hide() // 隐藏
749
911
 
750
912
  **方法:** `toTop()`
751
913
 
752
- **定位:** `scrollTarget` 为 `window` 时按钮固定在视口角落;为 `HTMLElement` 时需将元素放置在容器内部,按钮通过 `position: sticky` 悬浮于容器底部角落。偏移量沿用 `--web-ui-back-top-top/right/bottom/left` CSS 变量。
914
+ **定位:** `scrollTarget` 为 `window` 时按钮固定在视口角落;为 `HTMLElement` 时需将元素放置在容器内部,按钮通过 `position: sticky` 悬浮于容器底部角落。偏移量沿用 `--wui-back-top-top/right/bottom/left` CSS 变量。
753
915
 
754
916
  角色:`button`,键盘 Enter 触发回到顶部。
755
917
 
918
+ **CSS 自定义属性:**
919
+
920
+ | 属性 | 默认值 | 说明 |
921
+ | ------------------------- | -------------------------------- | -------- |
922
+ | `--wui-back-top-position` | `fixed` | CSS 定位 |
923
+ | `--wui-back-top-z-index` | `var(--wui-layer-auxiliary, 20)` | 层级 |
924
+ | `--wui-back-top-top` | `auto` | 上偏移 |
925
+ | `--wui-back-top-right` | `20px` | 右偏移 |
926
+ | `--wui-back-top-bottom` | `20px` | 下偏移 |
927
+ | `--wui-back-top-left` | `auto` | 左偏移 |
928
+
756
929
  #### `<web-ui-svg-draw-lines>`
757
930
 
758
931
  SVG 线条绘制动画,基于 `stroke-dashoffset`。直接在原元素上动画 —— 不克隆、不操作 DOM。
@@ -781,7 +954,76 @@ SVG 线条绘制动画,基于 `stroke-dashoffset`。直接在原元素上动
781
954
 
782
955
  **方法:** `getOverlayRoot()` — 返回 Portal 浮层容器
783
956
 
784
- 定义 `--wui-color-*`、`--wui-shadow-*`、`--wui-layer-*` 与 motion token。motion token 是稳定的主题契约,可在主题范围覆盖:`--wui-duration-press`、`--wui-duration-feedback`、`--wui-duration-trigger`、`--wui-duration-focus`、`--wui-duration-menu-enter`、`--wui-duration-menu-exit`、`--wui-duration-overlay-enter`、`--wui-duration-overlay-exit`、`--wui-duration-drawer-enter`、`--wui-duration-drawer-exit`、`--wui-ease-enter`、`--wui-ease-slide`、`--wui-scale-enter`。`motion="system"` 跟随 `prefers-reduced-motion`;使用 `motion="reduced"` 降低当前作用域动效,或在嵌套主题中使用 `motion="full"` 恢复默认 token。System 配色模式跟随 `prefers-color-scheme`。
957
+ 在其子树中定义基础、颜色、层级、阴影和动效 token。`motion="system"` 跟随 `prefers-reduced-motion`;使用 `motion="reduced"` 降低当前作用域动效,或在嵌套主题中使用 `motion="full"` 恢复默认 token。System 配色模式跟随 `prefers-color-scheme`。
958
+
959
+ **基础 token:**
960
+
961
+ | 属性 | 默认值 | 说明 |
962
+ | ------------------------- | ------- | ------------------------ |
963
+ | `--wui-font-size` | `14px` | 控件基础字号 |
964
+ | `--wui-input-width` | `200px` | 紧凑表单控件默认宽度 |
965
+ | `--wui-control-size` | `40px` | 控件默认高度和方形最小宽 |
966
+ | `--wui-overlay-min-width` | `200px` | 锚定浮层最小宽度 |
967
+ | `--wui-focus-ring-width` | `3px` | Focus 指示器宽度 |
968
+
969
+ **层级 token:**
970
+
971
+ | 属性 | 默认值 | 说明 |
972
+ | ---------------------------- | ------ | -------------- |
973
+ | `--wui-layer-base` | `0` | 基础内容 |
974
+ | `--wui-layer-inline-overlay` | `1` | 组件内部浮层 |
975
+ | `--wui-layer-header` | `10` | 页面 Header |
976
+ | `--wui-layer-auxiliary` | `20` | 悬浮工具控件 |
977
+ | `--wui-layer-banner` | `30` | Banner |
978
+ | `--wui-layer-tabbar` | `40` | Tab Bar |
979
+ | `--wui-layer-sidebar` | `50` | 侧边栏 |
980
+ | `--wui-layer-menu` | `100` | 菜单/浮动面板 |
981
+ | `--wui-layer-menu-nested` | `110` | 嵌套菜单 |
982
+ | `--wui-layer-toast` | `200` | Toast |
983
+ | `--wui-layer-loading` | `300` | 阻塞式 Loading |
984
+
985
+ **动效 token:** duration 默认值为 `--wui-duration-press: 80ms`、`--wui-duration-feedback: 100ms`、`--wui-duration-trigger: 160ms`、`--wui-duration-focus: 200ms`、`--wui-duration-menu-enter: 140ms`、`--wui-duration-menu-exit: 100ms`、`--wui-duration-overlay-enter: 180ms`、`--wui-duration-overlay-exit: 140ms`、`--wui-duration-drawer-enter: 280ms`、`--wui-duration-drawer-exit: 240ms`、`--wui-duration-layout: 200ms`。Easing token 是 `--wui-ease-enter` 和 `--wui-ease-slide`;进入缩放是 `--wui-scale-enter: 0.97`。
986
+
987
+ **颜色 token:**
988
+
989
+ | 属性 | 浅色默认值 | 深色默认值 | 说明 |
990
+ | ---------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------------- |
991
+ | `--wui-color-page` | `#fff` | `#18181a` | 页面背景 |
992
+ | `--wui-color-surface` | `#fff` | `#2c2c2e` | 普通 表面 |
993
+ | `--wui-color-surface-raised` | `#f2f2f7` | `#2c2c2e` | 抬升表面 |
994
+ | `--wui-color-surface-control` | `#dfdfdf` | `#3a3a3c` | 中性可交互控件表面 |
995
+ | `--wui-color-surface-track` | `#e5e5ea` | `#444446` | Slider/Switch 轨道表面 |
996
+ | `--wui-color-surface-glass` | `rgb(250 250 250 / 0.34)` | `rgb(44 44 46 / 0.42)` | 液态玻璃表面 |
997
+ | `--wui-color-surface-glass-hover` | `color-mix(... text 6%, surface-glass)` | `color-mix(... text 6%, surface-glass)` | Glass 完整悬停背景 |
998
+ | `--wui-color-surface-glass-active` | `color-mix(... text 15%, surface-glass)` | `color-mix(... text 15%, surface-glass)` | Glass 完整按下背景 |
999
+ | `--wui-color-surface-overlay` | `rgb(246 246 246 / 0.82)` | `rgb(44 44 46 / 0.82)` | 半透明浮层表面 |
1000
+ | `--wui-color-text` | `#1b1b1b` | `#f5f5f7` | 主要文本 |
1001
+ | `--wui-color-text-secondary` | `#6a6a6a` | `#a1a1a6` | 次要文本 |
1002
+ | `--wui-color-text-tertiary` | `color-mix(in srgb, var(--wui-color-text) 35%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 42%, transparent)` | 三级文本和弱意图图标 |
1003
+ | `--wui-color-text-disabled` | `color-mix(in srgb, var(--wui-color-text) 32%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 38%, transparent)` | 禁用态前景文本 |
1004
+ | `--wui-color-state-layer-hover` | `color-mix(in srgb, var(--wui-color-text) 6%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 6%, transparent)` | 透明悬停层 |
1005
+ | `--wui-color-state-layer-active` | `color-mix(in srgb, var(--wui-color-text) 15%, transparent)` | `color-mix(in srgb, var(--wui-color-text) 15%, transparent)` | 透明按下层 |
1006
+ | `--wui-color-border` | `rgb(0 0 0 / 0.1)` | `rgb(255 255 255 / 0.14)` | 常规边框和分隔线 |
1007
+ | `--wui-color-glass-border` | `rgb(51 51 51 / 0.12)` | `rgb(255 255 255 / 0.16)` | Glass 边框色调 |
1008
+ | `--wui-color-glass-highlight` | `rgb(255 255 255 / 0.9)` | `rgb(255 255 255 / 0.22)` | Glass 高光边缘 |
1009
+ | `--wui-color-accent` | `#08f` | `#0a84ff` | Accent 和输入焦点边框 |
1010
+ | `--wui-color-on-accent` | `#fff` | `#fff` | Accent 上的前景色 |
1011
+ | `--wui-color-success` | `#16a34a` | `#30d158` | 成功 |
1012
+ | `--wui-color-warning` | `#d97706` | `#ff9f0a` | 警告 |
1013
+ | `--wui-color-danger` | `#dc2626` | `#ff453a` | 危险 |
1014
+ | `--wui-color-info` | `#2563eb` | `#64d2ff` | 信息 |
1015
+ | `--wui-color-backdrop` | `rgb(0 0 0 / 0.12)` | `rgb(0 0 0 / 0.48)` | Modal 遮罩 |
1016
+ | `--wui-color-focus-ring` | `rgb(0 136 255 / 0.4)` | `rgb(10 132 255 / 0.62)` | Focus 指示器颜色 |
1017
+
1018
+ **阴影 token:**
1019
+
1020
+ | 属性 | 浅色默认值 | 深色默认值 | 说明 |
1021
+ | ---------------------- | -------------------------------- | ------------------------------- | ----------------- |
1022
+ | `--wui-shadow-overlay` | `2px 16px 40px rgb(0 0 0 / 0.4)` | `0 18px 48px rgb(0 0 0 / 0.54)` | Modal/Drawer 阴影 |
1023
+ | `--wui-shadow-panel` | `0 3px 9px rgb(0 0 0 / 0.27)` | `0 4px 16px rgb(0 0 0 / 0.35)` | 小型浮动面板阴影 |
1024
+ | `--wui-shadow-glass` | 四层扩散阴影 | `0 12px 32px rgb(0 0 0 / 0.38)` | 液态玻璃基础阴影 |
1025
+
1026
+ **内部 token:** 以 `--wui-internal-*` 为前缀的变量是 Shadow DOM 内部接线变量,不属于公共 token API,消费方不应覆盖。
785
1027
 
786
1028
  ---
787
1029
 
@@ -835,6 +1077,13 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
835
1077
 
836
1078
  悬停暂停自动关闭计时器(使用 `pointerenter`/`pointerleave`)。同一微任务中批量挂载 Toast。
837
1079
 
1080
+ **CSS 自定义属性:**
1081
+
1082
+ | 属性 | 默认值 | 说明 |
1083
+ | ------------------------------- | ------ | -------------------------- |
1084
+ | `--wui-toast-viewport-gap` | `16px` | Toast 到视口边缘的可见距离 |
1085
+ | `--wui-toast-container-padding` | `40px` | 容器预留的扩散阴影绘制空间 |
1086
+
838
1087
  ---
839
1088
 
840
1089
  ### 子项
@@ -854,6 +1103,12 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
854
1103
 
855
1104
  非表单关联组件(父级 select 统一提交)。
856
1105
 
1106
+ **CSS 自定义属性:**
1107
+
1108
+ | 属性 | 默认值 | 说明 |
1109
+ | ---------------------------- | ------- | ------------------------- |
1110
+ | `--wui-option-check-display` | `block` | 选中勾选图标的 display 值 |
1111
+
857
1112
  #### `<web-ui-segmented-trigger>`
858
1113
 
859
1114
  `<web-ui-segmented>` 的分段按钮。
@@ -867,3 +1122,11 @@ toast.updateMessage(id, { message: '上传已完成 60%', heading: '正在上传
867
1122
  **事件:** `change`
868
1123
 
869
1124
  非表单关联组件(父级 segmented 统一提交)。
1125
+
1126
+ **CSS 自定义属性:**
1127
+
1128
+ | 属性 | 默认值 | 说明 |
1129
+ | ----------------------------------- | -------------------------------- | ---------------- |
1130
+ | `--wui-segmented-trigger-px` | `12px` | 水平内边距 |
1131
+ | `--wui-segmented-trigger-bg-hover` | `--wui-color-state-layer-hover` | Trigger 悬停背景 |
1132
+ | `--wui-segmented-trigger-bg-active` | `--wui-color-state-layer-active` | Trigger 按下背景 |