@haiyue/ui 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +523 -4
  3. package/dist/adapters/web/controls.js +48 -8
  4. package/dist/adapters/web/renderer.js +9 -11
  5. package/dist/adapters/web/styles.d.ts +2 -3
  6. package/dist/adapters/web/styles.js +26 -23
  7. package/dist/alert.d.ts +39 -0
  8. package/dist/alert.js +144 -0
  9. package/dist/anchor.d.ts +62 -0
  10. package/dist/anchor.js +293 -0
  11. package/dist/auto-complete.d.ts +83 -0
  12. package/dist/auto-complete.js +267 -0
  13. package/dist/avatar.d.ts +45 -0
  14. package/dist/avatar.js +135 -0
  15. package/dist/badge.js +5 -5
  16. package/dist/border-beam.js +3 -2
  17. package/dist/breadcrumb.js +5 -5
  18. package/dist/button-group.js +8 -8
  19. package/dist/button.js +10 -10
  20. package/dist/card.d.ts +29 -0
  21. package/dist/card.js +101 -0
  22. package/dist/carousel.js +6 -6
  23. package/dist/cascader.js +19 -13
  24. package/dist/checkbox.d.ts +12 -0
  25. package/dist/checkbox.js +22 -6
  26. package/dist/collapse.js +6 -6
  27. package/dist/context-menu.js +3 -4
  28. package/dist/core/actions.js +7 -8
  29. package/dist/core/data.d.ts +1 -1
  30. package/dist/core/data.js +44 -10
  31. package/dist/core/platform-view.js +8 -2
  32. package/dist/core/selection.js +4 -4
  33. package/dist/core/semantics.d.ts +26 -0
  34. package/dist/core/semantics.js +8 -0
  35. package/dist/core/text.js +3 -3
  36. package/dist/core/validation.d.ts +3 -1
  37. package/dist/core/validation.js +23 -5
  38. package/dist/date-picker.js +19 -13
  39. package/dist/descriptions.d.ts +44 -0
  40. package/dist/descriptions.js +169 -0
  41. package/dist/dialog.d.ts +4 -0
  42. package/dist/dialog.js +48 -27
  43. package/dist/divider.js +2 -2
  44. package/dist/draggable.js +5 -3
  45. package/dist/drawer.js +16 -24
  46. package/dist/dropdown.js +3 -4
  47. package/dist/empty.d.ts +20 -0
  48. package/dist/empty.js +58 -0
  49. package/dist/expandable.js +4 -4
  50. package/dist/form-item.d.ts +60 -0
  51. package/dist/form-item.js +212 -0
  52. package/dist/form.d.ts +41 -0
  53. package/dist/form.js +154 -0
  54. package/dist/history-controls.js +5 -5
  55. package/dist/image-preview.d.ts +22 -0
  56. package/dist/image-preview.js +38 -0
  57. package/dist/image.d.ts +52 -0
  58. package/dist/image.js +152 -0
  59. package/dist/index.d.ts +48 -0
  60. package/dist/index.js +72 -0
  61. package/dist/input.d.ts +11 -0
  62. package/dist/input.js +32 -18
  63. package/dist/internal/anchored-popup.d.ts +19 -0
  64. package/dist/internal/anchored-popup.js +89 -0
  65. package/dist/internal/focus.d.ts +2 -0
  66. package/dist/internal/focus.js +31 -0
  67. package/dist/internal/form-control.d.ts +22 -0
  68. package/dist/internal/form-control.js +52 -0
  69. package/dist/internal/image-viewer.d.ts +51 -0
  70. package/dist/internal/image-viewer.js +210 -0
  71. package/dist/internal/keyboard.d.ts +2 -0
  72. package/dist/internal/keyboard.js +12 -0
  73. package/dist/internal/numbers.d.ts +2 -0
  74. package/dist/internal/numbers.js +8 -0
  75. package/dist/internal/pagination.d.ts +35 -0
  76. package/dist/internal/pagination.js +169 -0
  77. package/dist/internal/popover-base.d.ts +87 -0
  78. package/dist/internal/popover-base.js +365 -0
  79. package/dist/internal/presentation.d.ts +2 -0
  80. package/dist/internal/presentation.js +28 -0
  81. package/dist/mentions.d.ts +115 -0
  82. package/dist/mentions.js +485 -0
  83. package/dist/menu-shared.d.ts +1 -1
  84. package/dist/menu-shared.js +3 -3
  85. package/dist/menu.d.ts +63 -0
  86. package/dist/menu.js +339 -0
  87. package/dist/modal.js +11 -40
  88. package/dist/notification.js +11 -10
  89. package/dist/pagination.d.ts +34 -0
  90. package/dist/pagination.js +73 -0
  91. package/dist/popconfirm.d.ts +6 -0
  92. package/dist/popconfirm.js +7 -0
  93. package/dist/popover.d.ts +6 -0
  94. package/dist/popover.js +7 -0
  95. package/dist/portable/page.js +25 -14
  96. package/dist/progress.d.ts +30 -0
  97. package/dist/progress.js +102 -0
  98. package/dist/qr-code.js +3 -3
  99. package/dist/radio.d.ts +10 -0
  100. package/dist/radio.js +18 -5
  101. package/dist/range.js +7 -7
  102. package/dist/rate.js +3 -3
  103. package/dist/resizable.js +8 -5
  104. package/dist/result.d.ts +22 -0
  105. package/dist/result.js +88 -0
  106. package/dist/ribbon.d.ts +19 -0
  107. package/dist/ribbon.js +106 -0
  108. package/dist/segmented.d.ts +39 -0
  109. package/dist/segmented.js +192 -0
  110. package/dist/select.d.ts +12 -0
  111. package/dist/select.js +31 -13
  112. package/dist/skeleton.js +10 -10
  113. package/dist/spin.d.ts +26 -0
  114. package/dist/spin.js +80 -0
  115. package/dist/steps.js +13 -13
  116. package/dist/switch.d.ts +44 -0
  117. package/dist/switch.js +104 -0
  118. package/dist/table.d.ts +3 -3
  119. package/dist/table.js +110 -128
  120. package/dist/tabs.js +7 -7
  121. package/dist/tag.js +8 -8
  122. package/dist/time-picker.js +16 -10
  123. package/dist/timeline.js +12 -12
  124. package/dist/toast.js +12 -11
  125. package/dist/tooltip.d.ts +6 -0
  126. package/dist/tooltip.js +107 -6
  127. package/dist/tour.js +26 -17
  128. package/dist/tree-model.d.ts +2 -0
  129. package/dist/tree-model.js +32 -11
  130. package/dist/tree-node.js +2 -2
  131. package/dist/tree-select.d.ts +94 -0
  132. package/dist/tree-select.js +398 -0
  133. package/dist/tree.d.ts +0 -2
  134. package/dist/tree.js +14 -29
  135. package/dist/upload.d.ts +108 -0
  136. package/dist/upload.js +358 -0
  137. package/dist/virtual-keyboard.d.ts +1 -0
  138. package/dist/virtual-keyboard.js +72 -41
  139. package/dist/virtual-list.d.ts +1 -0
  140. package/dist/virtual-list.js +25 -8
  141. package/dist/virtual-mouse.js +7 -6
  142. package/dist/watermark.js +2 -1
  143. package/package.json +82 -1
  144. package/themes/haiyue-dark.css +51 -0
  145. package/themes/haiyue-light.css +51 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.1 - 2026-11-24
6
+
7
+ - 完成剩余审查项:统一缺省数值属性,修复 Drawer/Dialog/Tour/Tooltip 的焦点、无障碍与生命周期,以及选择器禁用和 Radio 组互斥行为。
8
+ - Table 每次操作仅筛选/排序一次;表头、Anchor 与 VirtualList 保留可复用节点,Tree 批量删除只重建一次索引并支持超宽分支移动。
9
+ - VirtualKeyboard 按字素移动和删除,安全处理不支持选区 API 的输入类型,并统一禁用/只读检查。
10
+ - 完善 portable RadioGroup 的键盘/RTL 导航、Checkbox/RadioGroup/Rate 的模态初始焦点及 Rate 错误描述;修复订阅自定义比较器、不可变协议快照、事务复制开销与 PlatformView 双重失败诊断。
11
+ - 行为说明:Dialog 每次有效关闭同步发送一次 `dialog-close`;Tour 保留高亮目标交互,明确为非模态引导;core/portable 在不可变快照上校验并拒绝访问器、不可枚举字段及稀疏/扩展数组。
12
+ - API 门禁增加可达声明签名比较,覆盖接口、参数、联合类型与事件 detail;更新当前 23 种语义和 11 类 Web 复用组件的文档与回归。
13
+ - 修复 Tree 自定义渲染器与 Draggable/Resizable 子控件的键盘事件被容器快捷键截获;Resizable 的键盘移动遵守 `movable=false`。
14
+ - 保留 Tree、Dropdown 和 ContextMenu 在挂载前的程序赋值,以及断开重连后的当前数据;声明式属性初始化和后续属性更新继续生效。
15
+ - Upload 在接受文件选择/拖放或移除后发送一次 composed `change`,使 FormItem 校验和 Form 的异步提交使用已提交的文件列表;上传进度不使字段校验失效。
16
+
17
+ ## 0.3.0 - 2026-11-24
18
+
19
+ - 发布检查兼容 npm 11/12 的打包结果格式。
20
+
21
+ - 完善月白/夜阑皮肤的语义颜色、间距、字体、行高、圆角和控件尺寸 token,组件样式统一继承规范参数;新增设计规范示例和陶土皮肤。
22
+
23
+ - Table 与 Pagination 复用内部分页控件,统一页码渲染、条数选择、键盘/RTL 导航和基础样式;表格分页通过 `table-change` 输出筛选后的总数,切换每页条数时回到首页。
24
+
25
+ - 新增 `HYRibbon` / `<hy-ribbon>` 缎带组件,支持文字与富文本插槽、自定义配色、随 RTL 方向适配的起始侧/末尾侧位置和主题 token;提供独立入口、根注册及可调节的 Card 示例。
26
+
27
+ - 新增低优先级组件 `HYEmpty`、`HYResult`、`HYAvatar`、`HYCard` 和 `HYDescriptions`,支持空状态与结果展示、头像图片/文字回退、卡片插槽与保留正文的加载态、响应式属性详情与跨列;提供独立入口、显式注册、主题化交互示例及浏览器回归。
28
+
29
+ - 优化 example 页皮肤按钮的大小和居中对齐,增加以陶土为初始配置的自定义皮肤及独立设置入口;面板支持颜色、字体、间距、圆角、控件尺寸的实时预览、本地保存和恢复初始值,并适配移动端。
30
+
31
+ - 修复 Image 通过 CSS 指定组件尺寸时内部显示区域未跟随高度,导致 fit 效果不正确的问题;示例改用明显不同比例的原图和容器,补充五种 fit 模式说明及实际像素差异回归。
32
+
33
+ - 新增中优先级组件 `HYAutoComplete`、`HYMenu`、`HYPagination`、`HYTreeSelect`、`HYImage` 和 `HYImagePreview`,提供独立子路径、显式注册、主题化示例与浏览器契约测试;覆盖自由文本补全、层级导航、独立分页、树形单/多选、图片加载/回退及多图模态预览。
34
+ - AutoComplete/TreeSelect 支持原生表单提交、校验、禁用 fieldset 和重置;表单 `setValues()` 支持树选择与原生 select 的多值。共享内部浮层与图片预览实现,保持组件入口隔离和零运行时依赖。
35
+
36
+ - 新增独立入口及根注册的 `HYSwitch`、`HYProgress`、`HYSpin`、`HYPopover`、`HYPopconfirm`、`HYForm`、`HYFormItem` 和 `HYUpload`:覆盖设置开关、直线/圆环进度、延迟加载遮罩、可交互浮层与异步确认、表单与异步校验、文件选择/拖放/上传进度/重试/取消。
37
+ - Input、Select、Checkbox、Radio、Mentions 与新增 Switch、Upload 支持原生表单关联、FormData、禁用 fieldset 和重置;保留既有交互事件及按需导入边界。新增主题化参数示例、键盘/焦点/异步生命周期回归,并更新公开 API 和包体积基线。
38
+
39
+ - 新增 `HYMentions` / `<hy-mentions>` 及独立 `@haiyue/ui/mentions` 入口:支持多行提及输入、单个或多个触发前缀、候选过滤与禁用项、光标定位弹层、键盘选择、中文输入法、异步搜索与加载态;补齐主题变量、交互示例和浏览器回归。
40
+
41
+ ## 0.2.3 - 2026-10-27
42
+
43
+ - 新增可按需导入的 `HYAnchor` / `<hy-anchor>`、`HYAlert` / `<hy-alert>` 与 `HYSegmented` / `<hy-segmented>`:分别提供滚动锚点导航与当前项跟踪、四种语义反馈及可取消关闭、可访问的分段单选与禁用项键盘导航;Anchor 在点击触发的平滑滚动期间会锁定目标高亮,避免途经区块造成闪烁;同步加入根导出、独立子路径、主题化示例和浏览器回归。
44
+
45
+ - Windows 下 API 隔离门禁改用目录 junction,避免普通 symlink 权限导致的间歇性 `EPERM`,不影响发布包内容或组件运行时。
46
+
5
47
  ## 0.2.2 - 2026-10-23
6
48
 
7
49
  - 新增 `HYModal` / `<hy-modal>` 及独立 `@haiyue/ui/modal` 入口:支持原生模态层、标题/正文/页脚插槽、确认与取消按钮、可阻止的操作事件、异步确认加载态、独立遮罩/Esc/关闭按钮控制、受控状态、焦点恢复、滚动锁与隐藏内容卸载。
package/README.md CHANGED
@@ -48,6 +48,27 @@ defineHaiyueUI();
48
48
  Because `defineHaiyueUI()` references the complete component set, prefer focused subpaths in bundle-sensitive
49
49
  product entry points.
50
50
 
51
+ ## Alert, Anchor, and Segmented
52
+
53
+ The three components have isolated, side-effect-free entry points and are also included in the opt-in root registration:
54
+
55
+ ```ts
56
+ import { defineAlertComponents } from '@haiyue/ui/alert';
57
+ import { defineAnchorComponents } from '@haiyue/ui/anchor';
58
+ import { defineSegmentedComponents } from '@haiyue/ui/segmented';
59
+
60
+ defineAlertComponents();
61
+ defineAnchorComponents();
62
+ defineSegmentedComponents();
63
+ ```
64
+
65
+ `<hy-alert>` supports `success`, `info`, `warning`, and `error`, optional built-in/custom icons, message and description
66
+ content, an `action` slot, banner presentation, and cancelable `alert-close` dismissal. `<hy-anchor>` accepts nested
67
+ `items`, tracks `active-href` against the viewport or an assigned `scrollContainer`, and exposes offsets, vertical or
68
+ horizontal layout, smooth scrolling, `scrollToAnchor()`, and composed click/change events. `<hy-segmented>` accepts
69
+ string or object options, uses an accessible radiogroup with roving focus, skips disabled choices during arrow-key
70
+ navigation, and supports three sizes, full-width layout, icons, group disable, `select()`, and `value-change`.
71
+
51
72
  ## Modal
52
73
 
53
74
  Import `defineModalComponents` from `@haiyue/ui/modal` and register once. `HYModal` is also exported by the root
@@ -278,6 +299,378 @@ button, or the application calls `search()`. Its detail contains `{ value, valid
278
299
  available. Style the `control`, `input`, `prefix`, `suffix`, and `search-button` parts or the
279
300
  `--hy-input-affix-*` and `--hy-input-search-*` tokens.
280
301
 
302
+ ## Mentions
303
+
304
+ ```ts
305
+ import { defineMentionsComponents } from '@haiyue/ui/mentions';
306
+ defineMentionsComponents();
307
+
308
+ const mentions = document.querySelector('hy-mentions');
309
+ mentions.options = [
310
+ { value: 'alice', label: 'Alice Chen' },
311
+ { value: 'bob', label: 'Bob Lin' },
312
+ { value: 'archived', label: 'Archived account', disabled: true },
313
+ ];
314
+ mentions.prefixes = ['@', '#'];
315
+ mentions.addEventListener('mention-select', event => console.log(event.detail));
316
+ ```
317
+
318
+ ```html
319
+ <hy-mentions placeholder="Type @ to mention someone" rows="3"
320
+ aria-label="Comment"></hy-mentions>
321
+ ```
322
+
323
+ `<hy-mentions>` uses a native multiline textarea. `value`, `placeholder`, `rows`, `disabled`, and
324
+ `readOnly` are properties; `readonly`, `required`, `maxlength`, and `name` are also forwarded attributes.
325
+ The default trigger is `@`; set `prefix` for a single trigger or `prefixes` for multiple triggers
326
+ (the `prefixes` attribute accepts a JSON string array). Triggers start at the beginning of the text,
327
+ after whitespace, or after `split`. The default `split` is one space; it is inserted after a selection.
328
+ Selecting a suggestion replaces the current token and preserves the surrounding text.
329
+
330
+ Suggestions match the option's value or label without case sensitivity. Set `filterOption` to a
331
+ `(text, option) => boolean` function to customize matching, or `false` for server-filtered results.
332
+ The bubbling, composed `search` event exposes `{ text, prefix }`; use it to fetch options and set
333
+ `loading` while waiting. Consumers own request cancellation and stale-response handling.
334
+ `notFoundContent` and `loadingText` customize the empty/loading messages. `placement` prefers `top`
335
+ or `bottom`, and the popup automatically fits the viewport. Arrow keys skip disabled options,
336
+ Enter selects, Shift+Enter inserts a newline, and Escape/Tab dismiss. IME composition keeps its
337
+ native editing behavior. `focus()` and `blur()` target the textarea.
338
+
339
+ `value-change` emits `{ value }` on user edits and selections, while `mention-select` emits
340
+ `{ value, option, prefix }` after a selection. Programmatic value updates do not emit change events.
341
+ The native composed `input` event is also available. Style the `textarea`, `panel`, `list`, `option`,
342
+ and `status` parts; colors inherit the semantic theme tokens. Popup dimensions use
343
+ `--hy-mentions-popup-min-width`, `--hy-mentions-popup-max-width`, `--hy-mentions-popup-max-height`,
344
+ and `--hy-mentions-z-index`. `open` is a read-only property reflecting popup visibility.
345
+
346
+ ## Switch, Progress, and Spin
347
+
348
+ ```ts
349
+ import { defineSwitchComponents } from '@haiyue/ui/switch';
350
+ import { defineProgressComponents } from '@haiyue/ui/progress';
351
+ import { defineSpinComponents } from '@haiyue/ui/spin';
352
+ defineSwitchComponents();
353
+ defineProgressComponents();
354
+ defineSpinComponents();
355
+ ```
356
+
357
+ ```html
358
+ <hy-switch name="autosave" label="Auto save" checked checked-text="On" unchecked-text="Off"></hy-switch>
359
+ <hy-progress percent="42" aria-label="Build progress"></hy-progress>
360
+ <hy-progress type="circle" percent="75" status="active"></hy-progress>
361
+ <hy-spin spinning="false" delay="200" tip="Loading preview"><div>Preview content</div></hy-spin>
362
+ ```
363
+
364
+ Switch has `checked`, `disabled`, `loading`, `size` (`small`/`default`), `value`, `name`, and `label`
365
+ properties. A default slot can supply its label. `checked-text`/`unchecked-text` customize the state text.
366
+ It uses a native checkbox with `role="switch"`; Space and Enter toggle it, while loading disables interaction.
367
+ User changes emit composed `checked-change` (`{ checked, value }`) and `change` events. Property updates
368
+ are silent. It participates in native forms, required validation, disabled fieldsets and reset.
369
+
370
+ Progress accepts `percent` (clamped to 0–100), `type` (`line`/`circle`), `status`
371
+ (`normal`/`active`/`success`/`exception`), `indeterminate`, `showInfo`, `strokeWidth`, and circle `size`.
372
+ The corresponding attributes are kebab-case. Indeterminate progress omits `aria-valuenow`.
373
+ Style `meter`, `trail`, `fill`, `circle` and `info` parts, or `--hy-progress-color`/`--hy-progress-trail-color`.
374
+
375
+ Spin is spinning by default; use `spinning="false"` or `.spinning = false` to stop it. `delay` in milliseconds
376
+ postpones the indicator (capped at 60 seconds), and `tip`/`size` (`small`/`default`/`large`) customize it.
377
+ With slotted content it displays an overlay and makes that content inert while loading, including during
378
+ the delay. Without content it is a standalone indicator. Owned timers are canceled on detach.
379
+ Both loading components respect reduced-motion preferences and inherit semantic theme colors.
380
+
381
+ ## Popover and Popconfirm
382
+
383
+ The independent `@haiyue/ui/popover` and `@haiyue/ui/popconfirm` entries expose
384
+ `definePopoverComponents()` and `definePopconfirmComponents()` respectively.
385
+
386
+ ```html
387
+ <hy-popover heading="Quick settings" placement="bottom-start">
388
+ <button slot="trigger">Settings</button>
389
+ <input aria-label="Preset name" />
390
+ </hy-popover>
391
+ <hy-popconfirm heading="Delete asset?" description="This removes the selected asset">
392
+ <button slot="trigger">Delete</button>
393
+ </hy-popconfirm>
394
+ ```
395
+
396
+ Both expose `open`, `disabled`, `heading`, `content`, `description`, `trigger`, `placement`, `show()` and
397
+ `hide()`. The `trigger` slot accepts a native button or a focusable custom control; the default slot supplies
398
+ interactive content, and the `heading` slot overrides the heading text. Triggers are `click` (default),
399
+ `hover`, `focus`, or `manual`. Hover delays use `show-delay`/`hide-delay` in milliseconds. Placement supports
400
+ top/bottom/left/right with optional `-start`/`-end`; popups flip and fit the viewport and use the native
401
+ popover top layer when available, escaping clipped ancestors. Escape, outside clicks and focus leaving
402
+ the surface close it; keyboard interaction inside remains available and closing restores owned focus.
403
+ `open-change` is composed and carries `{ open, reason }`. Disconnect releases listeners, timers and observers.
404
+
405
+ Popconfirm adds `okText`, `cancelText`, `confirmLoading`, `confirmDisabled`, `confirm()` and `cancel()`.
406
+ Its cancelable, composed `confirm`/`cancel` events carry `{ source: 'button' | 'api' }`. A prevented event
407
+ keeps the panel open; during `confirmLoading`, buttons, outside dismissal and Escape are blocked.
408
+
409
+ ```ts
410
+ popconfirm.addEventListener('confirm', async event => {
411
+ event.preventDefault();
412
+ popconfirm.confirmLoading = true;
413
+ try { await removeAsset(); popconfirm.hide(); }
414
+ finally { popconfirm.confirmLoading = false; }
415
+ });
416
+ ```
417
+
418
+ Style `trigger`, `panel`, `heading`, `description`, `content`, `footer`, `confirm`, and `cancel` parts.
419
+ `--hy-popover-width`, `--hy-popover-shadow` and `--hy-popover-z-index` customize the surface.
420
+
421
+ ## Form and Form Item
422
+
423
+ ```ts
424
+ import { defineFormComponents } from '@haiyue/ui/form';
425
+ import { defineFormItemComponents } from '@haiyue/ui/form-item';
426
+ import { defineInputComponents } from '@haiyue/ui/input';
427
+ defineFormComponents();
428
+ defineFormItemComponents();
429
+ defineInputComponents();
430
+ ```
431
+
432
+ ```html
433
+ <hy-form aria-label="Project settings">
434
+ <hy-form-item name="project" label="Project name" required help="At least 3 characters">
435
+ <hy-input></hy-input>
436
+ </hy-form-item>
437
+ <button type="submit">Save</button>
438
+ <button type="reset">Reset</button>
439
+ </hy-form>
440
+ ```
441
+
442
+ Form owns one real light-DOM `<form>` exposed as `formElement`. Children added to the host are moved into
443
+ that form, so native controls and form-associated custom controls share one owner. Do not nest forms.
444
+ `hy-input`, `hy-select`, `hy-checkbox`, `hy-radio`, `hy-mentions`, `hy-switch`, `hy-upload`,
445
+ `hy-auto-complete` and `hy-tree-select` participate
446
+ in native `FormData`, disabled fieldsets and reset, including inside an ordinary `<form>`. Other custom
447
+ components require an application-owned named native input if they need submission. Reset restores the
448
+ initial connected values silently. Existing input events and isolated component entry points are preserved.
449
+
450
+ `layout` is `vertical` (default), `horizontal`, or `inline`; `--hy-form-gap` and `--hy-form-label-width`
451
+ control spacing and horizontal labels. `values` and `formData` are fresh snapshots; repeated names become
452
+ arrays in `values`. `setValues(record)` updates supported native/value/checked fields silently.
453
+ Native and `hy-button` submit/reset actions work inside `hy-form`, as does Enter in single-line inputs.
454
+ `validate()` returns `Promise<boolean>`; `submit()` validates and emits the cancelable, composed
455
+ `form-submit` event with `{ values, formData }`. It resolves to the event's accepted status, and never
456
+ navigates or sends a network request. `form-invalid` carries `{ errors }`; `form-reset` signals reset.
457
+ Later edits, replacement submissions or disconnect prevent an old async validation from submitting.
458
+
459
+ Form Item owns one field. `name` supplies the field name when it has none; `label`, `required`, `help`,
460
+ and external `error` configure its presentation. Labels focus the field, and labels/error descriptions
461
+ are applied to the actual accessible control. `validateTrigger` (`validate-trigger`) is `blur` by default,
462
+ or `change`/`submit`. `rules` accepts `{ required, min, max, pattern, message, validator }`; min/max
463
+ measure string/array length or a numeric value. A validator receives `(value, signal)` and returns a
464
+ message or no message, synchronously or as a Promise. The signal cancels superseded validation.
465
+ `status` is read-only (`''`, `validating`, `success`, `error`); `clearValidation()` clears feedback.
466
+ `field-validate` emits `{ name, valid, error }`. Explicit native constraints remain in effect.
467
+
468
+ ```ts
469
+ item.rules = [{ min: 3, message: 'Use at least 3 characters' }, {
470
+ validator: async (value, signal) => {
471
+ const available = await checkName(value, { signal });
472
+ return available ? '' : 'Name already used';
473
+ },
474
+ }];
475
+ form.addEventListener('form-submit', event => {
476
+ event.preventDefault();
477
+ saveProject(event.detail.values);
478
+ });
479
+ ```
480
+
481
+ ## Upload
482
+
483
+ Import `defineUploadComponents` from `@haiyue/ui/upload`. File transport stays application-owned;
484
+ the component never chooses a server or sends a request by itself.
485
+
486
+ ```html
487
+ <hy-upload name="assets" drag multiple accept=".png,.jpg,.txt"
488
+ max-count="3" max-size="1048576" auto-upload="false">Drop files here</hy-upload>
489
+ ```
490
+
491
+ ```ts
492
+ upload.beforeUpload = async (file, files) => file.size <= 1024 * 1024;
493
+ upload.request = ({ file, signal, onProgress }) => uploadAsset(file, { signal, onProgress });
494
+ await upload.upload();
495
+ ```
496
+
497
+ `accept`, `multiple`, `disabled`, `drag`, `maxCount`, `maxSize` (bytes), `autoUpload`, and `showFileList`
498
+ configure selection; a zero limit means unlimited. The file input's type/size/count checks are applied
499
+ to both selection and drag/drop. `beforeUpload` can asynchronously veto a file; stale selection work is
500
+ discarded after disable, reset, replacement or disconnect. `autoUpload` defaults to true and only starts
501
+ work if an application `request` function exists. Input and drop content can be customized with `label`
502
+ and the default slot. `openFileDialog()` opens the picker; `focus()` targets its button.
503
+
504
+ `fileList` is a copied list of `{ uid, name, status, percent?, file?, size?, type?, response?, error? }`.
505
+ Statuses are `ready`, `uploading`, `done`, and `error`. `files` returns actual `File` instances.
506
+ `upload(uid?)` starts/retries files; `abort(uid?)` cancels and returns them to `ready`;
507
+ `removeFile(uid)` emits cancelable `file-remove` before removing and aborting a file.
508
+ `upload-change` carries `{ file, fileList, reason }`, including progress/success/error/abort, and
509
+ `file-reject` carries `{ file, reason, message }`. Request callbacks receive an AbortSignal and a
510
+ 0–100 progress callback; removed/replaced/disconnected requests cannot report stale success.
511
+ After accepting a selection/drop batch or completing an uncanceled removal, the host emits one
512
+ bubbling, composed `change` event after synchronizing its file list and native form value. Form Item
513
+ change validation and pending Form submissions therefore observe the accepted list. Native picker
514
+ input does not bubble to field listeners before acceptance; rejected selections, vetoed removals, request
515
+ progress/status updates, and programmatic `fileList` assignment do not emit this field-edit event.
516
+ Native form submission includes actual File objects under `name`; metadata-only preloaded entries
517
+ are displayed but do not fabricate files. `required` checks whether the list is empty.
518
+ Style `dropzone`, `trigger`, `list`, `file`, `file-name`, `file-status`, `progress`, `remove`, `retry`,
519
+ and `message` parts through the existing semantic theme tokens.
520
+
521
+ ## AutoComplete
522
+
523
+ Import `defineAutoCompleteComponents` from `@haiyue/ui/auto-complete`.
524
+
525
+ ```html
526
+ <hy-auto-complete name="asset" aria-label="Asset search" allow-clear search-delay="150"></hy-auto-complete>
527
+ ```
528
+
529
+ ```ts
530
+ autoComplete.options = [
531
+ { value: 'ocean', label: 'Ocean scene' },
532
+ { value: 'archived', label: 'Archived scene', disabled: true },
533
+ ];
534
+ autoComplete.addEventListener('search', event => fetchSuggestions(event.detail.value));
535
+ autoComplete.addEventListener('option-select', event => console.log(event.detail.option));
536
+ ```
537
+
538
+ Free text remains valid without selecting an option. `value`, `options`, `open`, `disabled`, `readOnly`,
539
+ `loading`, `allowClear`, `placeholder`, and `searchDelay` are properties. Options can also be supplied
540
+ as JSON in `options`. Default matching searches label/value without case sensitivity; `filterOption`
541
+ accepts a function or `false` for application-filtered results. Set `loading` while fetching and use
542
+ `not-found-content` to customize empty feedback. `search` emits `{ value }` after the configured delay;
543
+ superseded timers and IME intermediate searches are canceled. The application owns request cancellation
544
+ and stale network-response handling. Arrow keys skip disabled options, Enter selects, and Escape/Tab
545
+ dismiss. Native editing and composition keys are preserved.
546
+
547
+ `value-change` emits `{ value }` for user edits/selections; `option-select` emits `{ value, option }`;
548
+ `clear` and `open-change` are also composed events. Programmatic value assignments are silent.
549
+ Selection and clear preserve native input notifications. `name`, `required`, `minlength`, `maxlength`
550
+ and `pattern` support native forms and constraints; reset and disabled fieldsets work. `focus()`/`blur()`
551
+ target the real input. Parts are `control`, `input`, `clear`, `panel`, `list`, `option`, and `status`.
552
+
553
+ ## Menu
554
+
555
+ The isolated `@haiyue/ui/menu` entry exposes `HYMenu` and `defineMenuComponents()`.
556
+
557
+ ```ts
558
+ menu.items = [
559
+ { key: 'home', label: 'Home', icon: '⌂' },
560
+ { key: 'assets', label: 'Assets', children: [{ key: 'scenes', label: 'Scenes' }] },
561
+ { key: 'divider', type: 'divider' },
562
+ { key: 'settings', label: 'Settings', href: '/settings' },
563
+ ];
564
+ menu.selectedKeys = ['home'];
565
+ ```
566
+
567
+ Items have unique string keys and optional labels, text icons, hrefs, disabled state, children and
568
+ `type: 'group' | 'divider'`. Disabled parents disable their descendants. Cycles, duplicate keys and
569
+ invalid input are discarded. Link navigation permits http/https/mailto/tel and ordinary relative URLs.
570
+ `mode` is `inline` (default), `vertical`, or `horizontal`; `collapsed` provides a compact icon rail.
571
+ Inline children expand in place, while vertical/horizontal submenus use top-layer popups. `multiple`,
572
+ `selectedKeys` and `openKeys` control selection/expansion (array attributes use JSON). Programmatic updates
573
+ are silent; cancelable `menu-select` emits `{ key, item, selectedKeys }` before selection/navigation,
574
+ and `open-change` emits `{ openKeys }` for user expansion. Cancel a selection to prevent navigation.
575
+ Menus provide roving tab focus, arrow/Home/End navigation, Escape return to parent, and text typeahead.
576
+ Outside clicks close floating submenus. Parts are `menu`, `item`, `submenu`; width tokens include
577
+ `--hy-menu-width`, `--hy-menu-collapsed-width`, and `--hy-menu-popup-width`.
578
+
579
+ ## Pagination
580
+
581
+ Import `definePaginationComponents` from `@haiyue/ui/pagination` for lists or server-side pages.
582
+
583
+ ```html
584
+ <hy-pagination total="153" page="1" page-size="10" show-size-changer show-quick-jumper></hy-pagination>
585
+ ```
586
+
587
+ `page`, `pageSize`, `total`, `pageSizeOptions`, `disabled`, `simple`, `showSizeChanger` and
588
+ `showQuickJumper` have properties and corresponding kebab-case attributes. `pageCount` is read-only;
589
+ empty data still uses page 1. Invalid pages/sizes normalize, and huge totals render a bounded page window.
590
+ `page-size-options` accepts comma-separated numbers or a JSON numeric array. `show-total="false"`
591
+ hides the range, `hide-on-single-page` hides unnecessary navigation, and `size="small"` makes it compact.
592
+ User actions emit composed `page-change` with `{ page, pageSize, total, source }`, where source is
593
+ `page`, `size`, or `jump`. Programmatic changes are silent. Page-size changes retain the first visible
594
+ record within the new page. Native buttons/selects and the Enter-committed jumper work with keyboard;
595
+ Left/Right follow writing direction and Home/End reach the boundaries. No data fetching is implicit.
596
+ Parts are `nav`, `pages`, `page`, `previous`, `next`, `total`, `page-size`, and `jumper`.
597
+
598
+ ## TreeSelect
599
+
600
+ Import `defineTreeSelectComponents` from `@haiyue/ui/tree-select`. Its entry does not import/register Tree.
601
+
602
+ ```ts
603
+ treeSelect.options = [{ value: 'assets', label: 'Assets', selectable: false, children: [
604
+ { value: 'ocean', label: 'Ocean scene' },
605
+ { value: 'locked', label: 'Archived', disabled: true },
606
+ ] }];
607
+ treeSelect.multiple = true;
608
+ treeSelect.values = ['ocean'];
609
+ ```
610
+
611
+ Options have unique `value`, `label`, optional `disabled`, `selectable`, `expanded`, and `children`.
612
+ `value` is a string in single mode and a string array in multiple mode; `values` always exposes an array.
613
+ The multiple `value` attribute uses JSON. Multiple selection is independent: selecting a parent does not
614
+ implicitly select its descendants. Selected values survive async option replacement; unknown labels
615
+ temporarily show their values. `expandedKeys` / `expanded-keys` controls expansion.
616
+ `searchable` and `clearable` default to true (use `="false"` to disable); `loading`, `disabled`,
617
+ `readOnly`, `open`, and `placeholder` control interaction. Search preserves matching ancestors and
618
+ temporarily expands paths; it does not change stored expansion. `search` emits `{ text }`; consumers
619
+ own async requests and option updates. `not-found-content` customizes empty feedback.
620
+
621
+ The input keeps focus while aria-activedescendant identifies the active tree item. Arrows expand,
622
+ collapse and navigate, Enter selects, and Escape/Tab close. IME confirmation does not select a node.
623
+ `value-change` carries `{ value, values, options }` and is followed by a composed `change` event;
624
+ `expand-change` carries `{ expandedKeys }`. Programmatic assignments are silent. Named values participate
625
+ in FormData (repeated names for multiple values), required/custom validation, reset and disabled fieldsets.
626
+ `HYForm.setValues()` accepts arrays for multiple TreeSelect and native multiple select fields.
627
+ Parts include `control`, `input`, `tags`, `tag`, `clear`, `panel`, `tree`, `option`, `toggle`, and `status`.
628
+ AutoComplete/TreeSelect inherit semantic theme tokens and `--hy-popup-max-height`/`--hy-popup-z-index`.
629
+
630
+ ## Image and Image Preview
631
+
632
+ Use the independent `@haiyue/ui/image` and `@haiyue/ui/image-preview` entries to register
633
+ `defineImageComponents()` and `defineImagePreviewComponents()` respectively.
634
+
635
+ ```html
636
+ <hy-image src="ocean.png" alt="Ocean scene" width="280" height="180"
637
+ fit="cover" loading="lazy" fallback="placeholder.png"></hy-image>
638
+ ```
639
+
640
+ Image supports native `srcset`/`sizes` attributes, `src`, `alt`, `width`, `height`, `fit`, `loading`,
641
+ `fallback`, `preview` (default true), and `previewSrc` (`preview-src`) for a higher-resolution source.
642
+ Width/height accept numbers or CSS lengths. `status` is read-only: `empty`, `loading`, `loaded`, or `error`.
643
+ The frame also follows CSS width/height set on the host. With both dimensions constrained, `fit` uses
644
+ native `object-fit` semantics: `contain` shows the complete image with letterboxing, `cover` crops to fill,
645
+ `fill` stretches, `none` keeps the original size, and `scale-down` never enlarges. For oversized images,
646
+ `scale-down` matches `contain`; for smaller images it matches `none`. Constraining only the width retains
647
+ the image's natural aspect ratio.
648
+ `placeholder` and `fallback` slots customize loading/error content; `fallback` URL is tried once after
649
+ the original fails. Source changes detach old listeners so stale resources cannot replace new state.
650
+ `image-load` carries `{ src, naturalWidth, naturalHeight }`, and `image-error` carries `{ src, fallback }`.
651
+ `showPreview()`/`hidePreview()` control the single-image viewer, with `preview-open-change` notifications.
652
+ Parts include `frame`, `image`, `placeholder`, `error`, and `preview-trigger`; the radius/background use
653
+ `--hy-image-radius`/`--hy-image-bg` and semantic tokens.
654
+
655
+ ```ts
656
+ preview.images = [
657
+ { src: 'ocean.png', alt: 'Ocean', caption: 'Ocean scene' },
658
+ { src: 'moon.png', alt: 'Moon' },
659
+ ];
660
+ preview.show(0);
661
+ ```
662
+
663
+ Standalone Image Preview takes `images` (objects or URL strings; JSON attribute supported), `current`
664
+ (zero-based), `open`, `show(index?)`, and `hide()`. It uses a native modal dialog with keyboard focus
665
+ containment, Escape/backdrop dismissal and return focus. Toolbar controls provide previous/next,
666
+ zoom, rotation and reset; Left/Right switch images, wheel zooms, and dragging pans a zoomed image.
667
+ Navigation resets transforms. Loading and failures have visible feedback; empty lists close the viewer.
668
+ `open-change` carries `{ open, index }`; `preview-change` carries `{ index, item }`. Disconnect releases
669
+ modality and image listeners. Common preview parts are `preview`, `toolbar`, `stage`, `preview-image`,
670
+ `preview-status`, `caption`, `counter`, `previous`, `next`, `in`, `out`, `left`, `right`, `reset`, and `close`.
671
+ `--hy-image-preview-bg`, `--hy-image-preview-text-color` and `--hy-image-preview-mask-color`
672
+ customize its surface, overlay text and backdrop.
673
+
281
674
  ## Portable component semantics (M24 G03/G05)
282
675
 
283
676
  `@haiyue/ui/core` provides platform-independent component types, validation, selection/input/action
@@ -307,7 +700,7 @@ no writes; reordering preserves instances. Applications persist values on `commi
307
700
 
308
701
  The Web backend is available from `@haiyue/ui/adapters/web`: explicitly call
309
702
  `definePortableWebComponents()`, construct `new HYWebRenderer(connectedElement, options)`, then pass it
310
- to `HYPage`. It reuses seven existing Web Components and maps the other semantic kinds to browser
703
+ to `HYPage`. It reuses eleven existing Web Components and maps the other semantic kinds to browser
311
704
  elements. It introduces no runtime package dependencies or automatic registration. See the
312
705
  [Web adapter guide](docs/web-adapter.md) and [interactive example](examples/portable-ui/index.html).
313
706
  Run `npm run test:web-adapter` for Chromium/WebKit regression coverage.
@@ -459,6 +852,34 @@ semantic status. Numeric counts are capped by `overflowCount` (99 by default); u
459
852
  preferences. Structural styling hooks include `wrapper`, `badge`, `badge-content`, `status`, `status-dot`, and
460
853
  `status-text` shadow parts.
461
854
 
855
+ ## Ribbon
856
+
857
+ `@haiyue/ui/ribbon` exports `HYRibbon`, `HYRibbonPlacement` and `defineRibbonComponents()`.
858
+ Register it explicitly, or use the root `defineHaiyueUI()` registration.
859
+
860
+ ```html
861
+ <hy-ribbon text="Featured" placement="end">
862
+ <article>Your content</article>
863
+ </hy-ribbon>
864
+
865
+ <hy-ribbon placement="start" color="var(--hy-success-color)">
866
+ <strong slot="text">★ Recommended</strong>
867
+ <article>Your content</article>
868
+ </hy-ribbon>
869
+ ```
870
+
871
+ `text` supplies the label, and the named `text` slot takes precedence when provided. An empty label hides
872
+ the ribbon while retaining its content. `placement` defaults to `end` and accepts `start`, using the inherited
873
+ text direction. `color` accepts a CSS color, including custom-property references. Clearing it restores the
874
+ theme background. Content in the default slot retains its DOM, input state and keyboard interaction.
875
+
876
+ Style `::part(wrapper)`, `::part(content)`, `::part(ribbon)`, `::part(text)` and `::part(fold)`.
877
+ Inherited `--hy-ribbon-bg-color`, `--hy-ribbon-text-color`, `--hy-ribbon-font-size`, `--hy-ribbon-radius`,
878
+ `--hy-ribbon-height`, `--hy-ribbon-padding`, `--hy-ribbon-offset` and `--hy-ribbon-fold-size` override the
879
+ shared color, typography, spacing and sizing tokens. A valid `color` attribute takes precedence over
880
+ `--hy-ribbon-bg-color`. The fold darkens the ribbon color. Allow room for the label near the top of the content
881
+ and for the fold beyond its edge when composing surrounding layouts.
882
+
462
883
  ## Collapse
463
884
 
464
885
  Import `@haiyue/ui/collapse` and assign typed `items` containing `key`, `title`, optional `content`, `extra`,
@@ -777,7 +1198,38 @@ Apply a theme to the document or to a component subtree. Tokens inherit through
777
1198
  - `light` / Haiyue Moonlight: moon white, pale ice blue, cyan and a soft violet highlight.
778
1199
  - `dark` / Haiyue Nightfall: deep navy, blue violet, cool white and a restrained gold highlight.
779
1200
 
780
- All theme tokens use the `--hy-` prefix and may be overridden by consuming products.
1201
+ The two skins share the same design scales. Define overrides on the element that carries `data-hy-theme`
1202
+ or on a descendant wrapper. For overrides on the same element, load product rules after the theme stylesheet
1203
+ and match the theme selector's specificity.
1204
+
1205
+ | Category | Shared tokens | Examples |
1206
+ | --- | --- | --- |
1207
+ | Semantic colors | Surface, text, border, accent, focus and status | `--hy-surface-color`, `--hy-text-color`, `--hy-accent-color`, `--hy-success-color` |
1208
+ | Spacing | `--hy-space-*` on a 2px scale | `--hy-space-2` = 4px, `--hy-space-4` = 8px, `--hy-space-8` = 16px |
1209
+ | Typography | Font families, `--hy-font-size-*`, `--hy-line-height-*`, `--hy-font-weight-*` | `--hy-font-size-sm` = 12px, `--hy-font-size-md` = 14px, `--hy-line-height-relaxed` = 1.5 |
1210
+ | Corner radius | `--hy-radius-xs` through `--hy-radius-xl` and `--hy-radius-full` | `--hy-radius-sm` = 4px, `--hy-radius-md` = 6px, `--hy-radius-lg` = 8px |
1211
+ | Control height | `--hy-control-height-xs`, `-sm`, `-md`, `-lg` | 24px, 28px, 34px, 44px |
1212
+
1213
+ ```html
1214
+ <section data-hy-theme="light" class="product-skin">
1215
+ <hy-input aria-label="Project name"></hy-input>
1216
+ <hy-button>Save</hy-button>
1217
+ </section>
1218
+ ```
1219
+
1220
+ ```css
1221
+ [data-hy-theme="light"].product-skin {
1222
+ --hy-accent-color: #a44932;
1223
+ --hy-space-4: 12px;
1224
+ --hy-space-5: 15px;
1225
+ --hy-font-size-sm: 15px;
1226
+ --hy-radius-sm: 10px;
1227
+ --hy-control-height-sm: 38px;
1228
+ }
1229
+ ```
1230
+
1231
+ Components resolve their specific tokens first where available. For example, `--hy-input-radius` overrides
1232
+ `--hy-radius-sm` for Input. Each component provides usable fallback values when no theme is applied.
781
1233
 
782
1234
  ## Component examples
783
1235
 
@@ -790,12 +1242,69 @@ npm run examples
790
1242
  ```
791
1243
 
792
1244
  Then open <http://localhost:4173/>. The gallery provides a left-side component index and live examples for
793
- every exported component, including editable parameters and event output. The gallery shell itself dogfoods
1245
+ every exported component, including editable parameters and event output. Open **设计规范** to compare
1246
+ Moonlight, Nightfall, and a custom skin on the same controls and inspect the CSS and current token values.
1247
+ The compact skin picker also offers **自定义**, starting from Terracotta. Its gear button opens a live
1248
+ preview panel for colors (including alpha values), fonts, spacing, radii, and control heights. Changes and
1249
+ the selected skin are saved locally; **恢复陶土** resets the custom values, and **应用皮肤** applies them to the
1250
+ gallery. The same picker remains available above the introduction on mobile screens.
1251
+ The gallery shell itself dogfoods
794
1252
  Haiyue UI: theme actions, component search, command results, status, and example action controls use the
795
1253
  published Web Components rather than parallel page-only widgets. The navigation/content shell and eligible
796
1254
  preview/control cards use `hy-split` for keyboard- and pointer-adjustable sizing. Usage blocks are rendered as
797
1255
  read-only CodeMirror editors with HTML, JavaScript, and CSS syntax highlighting.
798
1256
 
1257
+ ## Empty, Result, Avatar, Card and Descriptions
1258
+
1259
+ These five presentation components have focused, side-effect-free entries (`@haiyue/ui/empty`,
1260
+ `/result`, `/avatar`, `/card`, `/descriptions`) and are included in `defineHaiyueUI()`.
1261
+ Each entry exposes its `HY…` class and `define…Components()` registration function. Styling inherits
1262
+ the semantic color, font, spacing and radius tokens; no runtime dependency is added.
1263
+
1264
+ | Component | Properties / attributes | Content slots |
1265
+ | --- | --- | --- |
1266
+ | `HYEmpty` / `hy-empty` | `description` (default `No data`), `image` (`default`, `simple`, `none`), `size` (`small`, `default`) | `image`, `description`, default actions |
1267
+ | `HYResult` / `hy-result` | `status` (`success`, `info`, `warning`, `error`, `403`, `404`, `500`), `heading`, `description` | `icon`, `heading`, `description`, default details, `extra` actions |
1268
+ | `HYAvatar` / `hy-avatar` | `src`, native `srcset`/`sizes` attributes, `alt`, `text`, `size` (`small`, `default`, `large`, or 16–256 pixels), `shape` (`circle`, `square`), `fit` (`cover`, `contain`, `fill`), read-only `status` | default image fallback |
1269
+ | `HYCard` / `hy-card` | `heading`, `bordered` (default true; `bordered="false"` removes it), `hoverable`, `loading`, `size` (`small`, `default`) | `heading`, `extra`, `cover`, default body, `footer` |
1270
+ | `HYDescriptions` / `hy-descriptions` | `items`, `heading`, `column` (1–6, default 3), `layout` (`horizontal`, `vertical`), `bordered`, `size`, `responsive` (default true), `emptyText` (`empty-text`) | `heading`, `extra`, `label-{key}`, `value-{key}` |
1271
+
1272
+ ```js
1273
+ import { defineDescriptionsComponents } from '@haiyue/ui/descriptions';
1274
+ defineDescriptionsComponents();
1275
+ const details = document.querySelector('hy-descriptions');
1276
+ details.items = [
1277
+ { key: 'name', label: 'Project', value: 'Ocean' },
1278
+ { key: 'files', label: 'Files', value: 0 },
1279
+ { key: 'notes', label: 'Notes', value: 'More room for this value', span: 'filled' },
1280
+ ];
1281
+ ```
1282
+
1283
+ `HYDescriptionItem` uses optional unique string `key` (defaults to the item index), `label`, primitive
1284
+ `value` and optional `span` (1–6 or `filled` to consume the remaining row). Items are copied; duplicate
1285
+ keys reject a property update, while invalid JSON in the `items` attribute produces an empty list.
1286
+ Values render as text; use the named value/label slots for links, tags or inputs. `0` and `false` remain
1287
+ visible; null, missing and empty string values use `emptyText` (default `—`). Responsive layout follows
1288
+ the component's container: one column below 480px, up to two below 720px, otherwise `column`.
1289
+ Set `responsive="false"` to retain the configured columns. Resize observers disconnect on removal.
1290
+
1291
+ Avatar shows its default slot, `text`, or a person icon while loading and after failure. `status` is
1292
+ `empty`, `loading`, `loaded` or `error`. `avatar-load` carries `{ src, naturalWidth, naturalHeight }` and
1293
+ `avatar-error` carries `{ src }`; both bubble across shadow roots. Superseded requests and disconnected
1294
+ instances ignore stale image events. Supply `alt` or `aria-label` for the user name; explicit `alt=""`
1295
+ makes the avatar decorative. `--hy-avatar-size`, `--hy-avatar-font-size`, `--hy-avatar-radius`,
1296
+ `--hy-avatar-bg-color` and `--hy-avatar-text-color` provide local overrides.
1297
+
1298
+ Card loading hides and makes its body inert without destroying inputs, and hides the footer until
1299
+ loading ends. `hoverable` adds a visual hover treatment; use actual slotted links/buttons for actions.
1300
+ Empty and Result preserve slotted controls, and Result exposes a labelled region without unsolicited
1301
+ live announcements. All fallback strings render as text. Useful surface parts are `empty`, `image`,
1302
+ `description`, `actions`; `result`, `icon`, `heading`, `content`, `extra`; `avatar`, `image`, `fallback`,
1303
+ `text`; `card`, `header`, `heading`, `cover`, `body`, `loading`, `footer`; and `list`, `item`, `label`,
1304
+ `value` respectively. Component CSS hooks also include `--hy-empty-padding`, `--hy-empty-image-size`,
1305
+ `--hy-result-padding`, `--hy-result-icon-size`, `--hy-card-radius`, `--hy-card-bg-color`,
1306
+ `--hy-card-body-padding`, `--hy-descriptions-label-width`, `--hy-descriptions-cell-padding` and gap tokens.
1307
+
799
1308
  ## Expandable container
800
1309
 
801
1310
  Explicit export: `@haiyue/ui/expandable` → `HYExpandable`, `defineExpandableComponents`,
@@ -835,7 +1344,7 @@ npm run release:check
835
1344
  ```
836
1345
 
837
1346
  Candidates: `.artifacts/packages/`. Review API changes before `npm run api:update`.
838
- See [release review](review/release-0.2.2.md).
1347
+ See [release review](review/release-0.3.1.md).
839
1348
 
840
1349
  ### 共享组件目录(开发中)
841
1350
 
@@ -872,3 +1381,13 @@ or validation errors preserves the existing input, selection and composition.
872
1381
  `hyResponsiveWorkspace`, `HYResponsiveGridOptions` and
873
1382
  `HYResponsiveWorkspaceOptions`. These return logical-pixel layout data without
874
1383
  reading window or platform globals, so hosts can use actual split-window sizes.
1384
+
1385
+ ### 审查后的交互契约
1386
+
1387
+ 数值属性缺省或为空时使用文档默认值;显式 `0` 继续按各控件范围处理。Table 每次同步操作共享一次筛选/排序结果,公开数据 getter 仍读取最新记录和筛选闭包;更新列结构会重建表头,排序/筛选保留表头控件。VirtualList 滚动复用重叠行,`refresh()` 或替换数据/渲染器会重建内容;焦点行移出窗口时焦点回到列表视口。
1388
+
1389
+ Drawer 的模态 Tab 环绕包含插槽中的 Shadow DOM 控件。Dialog 断开时释放原生 modal 状态,重新连接后按 `open` 恢复;每次有效关闭同步发送一次 `dialog-close`,重新打开不会被旧原生 close 事件撤销。Tour 是允许高亮目标交互的非模态引导,不声明 `aria-modal`;打开时清空步骤会以 `programmatic` 关闭并清理监听。Tooltip 在真实触发目标所在树中提供可访问描述,保留应用自己的 `aria-describedby`,禁用或移除时清理关系。
1390
+
1391
+ VirtualKeyboard 对 textarea 及支持选区 API 的 text/search/url/tel/password input 编辑;其他 input 类型安全忽略编辑。移动和删除按完整字素处理,包括 emoji、组合字符与 ZWJ 序列;禁用或只读目标不会被修改。portable RadioGroup 仅保留一个 Tab 停靠点,方向键跳过禁用项并按 RTL 导航;所有选择仍经过受控状态回填。
1392
+
1393
+ core/portable 仅接受普通数据对象与无空洞数组;拒绝访问器、不可枚举属性、符号键和额外数组属性,在不可变快照上验证,调用方后续修改不影响已接受的数据。新增辅助模块保持私有,不新增公开入口;API 基线现同时记录导出名与可达声明签名。