meowtail 0.2.0-alpha.0 → 0.2.0-alpha.2

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 (163) hide show
  1. package/AGENT-COMPONENTS.md +65 -65
  2. package/ASSISTANT.md +35 -35
  3. package/JSON.md +11 -11
  4. package/README.md +413 -385
  5. package/THIRD_PARTY_NOTICES.md +8 -0
  6. package/dist/src/chat/assistant-composer.js +58 -98
  7. package/dist/src/chat/assistant-content.d.ts +1 -3
  8. package/dist/src/chat/assistant-content.js +36 -44
  9. package/dist/src/chat/assistant-markdown.js +4 -8
  10. package/dist/src/chat/assistant-question.js +13 -14
  11. package/dist/src/chat/assistant.js +27 -26
  12. package/dist/src/chat/attachments.d.ts +3 -2
  13. package/dist/src/chat/attachments.js +43 -34
  14. package/dist/src/chat/composer-panel.d.ts +16 -0
  15. package/dist/src/chat/composer-panel.js +11 -0
  16. package/dist/src/chat/composer.d.ts +7 -3
  17. package/dist/src/chat/composer.js +71 -22
  18. package/dist/src/chat/conversation.js +2 -2
  19. package/dist/src/chat/index.d.ts +1 -0
  20. package/dist/src/chat/index.js +1 -0
  21. package/dist/src/chat/message-list.js +1 -1
  22. package/dist/src/chat/message.js +3 -3
  23. package/dist/src/chat/question.js +1 -1
  24. package/dist/src/chat/sources.js +1 -1
  25. package/dist/src/chat/task.js +9 -15
  26. package/dist/src/chat/tool-call.js +7 -14
  27. package/dist/src/components/accordion.d.ts +24 -0
  28. package/dist/src/components/accordion.js +50 -0
  29. package/dist/src/components/action-rail.d.ts +19 -0
  30. package/dist/src/components/action-rail.js +13 -0
  31. package/dist/src/components/add-button.js +1 -1
  32. package/dist/src/components/alert.d.ts +2 -0
  33. package/dist/src/components/alert.js +2 -1
  34. package/dist/src/components/app-bar.d.ts +17 -0
  35. package/dist/src/components/app-bar.js +10 -0
  36. package/dist/src/components/avatar.d.ts +22 -0
  37. package/dist/src/components/avatar.js +44 -0
  38. package/dist/src/components/breadcrumb.js +1 -1
  39. package/dist/src/components/checkbox.d.ts +6 -2
  40. package/dist/src/components/checkbox.js +36 -8
  41. package/dist/src/components/choice-group.d.ts +1 -0
  42. package/dist/src/components/choice-group.js +12 -17
  43. package/dist/src/components/choice-select.d.ts +3 -1
  44. package/dist/src/components/choice-select.js +56 -54
  45. package/dist/src/components/code-block.d.ts +3 -3
  46. package/dist/src/components/code-block.js +31 -27
  47. package/dist/src/components/context-menu.d.ts +16 -0
  48. package/dist/src/components/context-menu.js +49 -0
  49. package/dist/src/components/credential-source.js +12 -12
  50. package/dist/src/components/diff-block.js +1 -1
  51. package/dist/src/components/disclosure.d.ts +2 -2
  52. package/dist/src/components/disclosure.js +1 -1
  53. package/dist/src/components/hover-card.js +2 -2
  54. package/dist/src/components/image-lightbox.js +3 -3
  55. package/dist/src/components/image-preview.js +1 -1
  56. package/dist/src/components/index.d.ts +12 -0
  57. package/dist/src/components/index.js +12 -0
  58. package/dist/src/components/json-block.js +2 -2
  59. package/dist/src/components/json-tree.js +3 -3
  60. package/dist/src/components/link.d.ts +13 -0
  61. package/dist/src/components/link.js +9 -0
  62. package/dist/src/components/list-group.d.ts +1 -1
  63. package/dist/src/components/menu-button.d.ts +13 -0
  64. package/dist/src/components/menu-button.js +10 -0
  65. package/dist/src/components/menu.d.ts +4 -0
  66. package/dist/src/components/menu.js +3 -3
  67. package/dist/src/components/meta-row.d.ts +34 -0
  68. package/dist/src/components/meta-row.js +61 -0
  69. package/dist/src/components/nav-item.js +2 -5
  70. package/dist/src/components/number-input.d.ts +29 -0
  71. package/dist/src/components/number-input.js +137 -0
  72. package/dist/src/components/output-block.js +8 -15
  73. package/dist/src/components/page-frame.d.ts +6 -2
  74. package/dist/src/components/page-frame.js +2 -2
  75. package/dist/src/components/path-picker.js +9 -14
  76. package/dist/src/components/pill.js +2 -5
  77. package/dist/src/components/popover.js +4 -4
  78. package/dist/src/components/process-group.d.ts +2 -2
  79. package/dist/src/components/progress.d.ts +15 -0
  80. package/dist/src/components/progress.js +12 -0
  81. package/dist/src/components/rail-item.d.ts +2 -2
  82. package/dist/src/components/rail-section.d.ts +1 -1
  83. package/dist/src/components/read-block.js +2 -2
  84. package/dist/src/components/resource-card.d.ts +1 -1
  85. package/dist/src/components/resource-link.d.ts +1 -1
  86. package/dist/src/components/risk-confirmation.js +2 -5
  87. package/dist/src/components/search-block.js +2 -3
  88. package/dist/src/components/segmented-control.js +3 -3
  89. package/dist/src/components/skeleton-boundary.js +4 -7
  90. package/dist/src/components/slider.d.ts +22 -0
  91. package/dist/src/components/slider.js +49 -0
  92. package/dist/src/components/table.d.ts +41 -0
  93. package/dist/src/components/table.js +146 -0
  94. package/dist/src/components/tabs.d.ts +1 -1
  95. package/dist/src/components/tabs.js +11 -20
  96. package/dist/src/components/terminal-block.js +6 -6
  97. package/dist/src/components/text-shimmer.js +2 -5
  98. package/dist/src/components/web-block.js +3 -3
  99. package/dist/src/components/work-card.d.ts +2 -2
  100. package/dist/src/components/work-card.js +1 -1
  101. package/dist/src/icons/README.md +13 -2
  102. package/dist/src/icons/icon-frame.d.ts +11 -0
  103. package/dist/src/icons/icon-frame.js +4 -0
  104. package/dist/src/icons/icon-source.d.ts +17 -0
  105. package/dist/src/icons/icon-source.js +6 -0
  106. package/dist/src/icons/icon.d.ts +44 -37
  107. package/dist/src/icons/icon.js +55 -128
  108. package/dist/src/icons/index.d.ts +1 -0
  109. package/dist/src/icons/index.js +1 -0
  110. package/dist/src/icons/lucide.d.ts +1 -0
  111. package/dist/src/icons/lucide.js +4 -0
  112. package/dist/src/registry/index.d.ts +99 -5
  113. package/dist/src/registry/index.js +28 -3
  114. package/dist/src/shared/execution-state.js +7 -7
  115. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
  116. package/dist/src/theme/chat/composer-panel.styles.js +47 -0
  117. package/dist/src/theme/chat/composer.styles.js +69 -60
  118. package/dist/src/theme/chat/task.styles.js +5 -6
  119. package/dist/src/theme/components/accordion.styles.d.ts +1 -0
  120. package/dist/src/theme/components/accordion.styles.js +63 -0
  121. package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
  122. package/dist/src/theme/components/action-rail.styles.js +47 -0
  123. package/dist/src/theme/components/alert.styles.js +42 -1
  124. package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
  125. package/dist/src/theme/components/app-bar.styles.js +48 -0
  126. package/dist/src/theme/components/avatar.styles.d.ts +1 -0
  127. package/dist/src/theme/components/avatar.styles.js +52 -0
  128. package/dist/src/theme/components/button.styles.js +9 -0
  129. package/dist/src/theme/components/card.styles.js +2 -0
  130. package/dist/src/theme/components/code-block.styles.js +7 -0
  131. package/dist/src/theme/components/context-menu.styles.d.ts +1 -0
  132. package/dist/src/theme/components/context-menu.styles.js +14 -0
  133. package/dist/src/theme/components/dialog.styles.js +7 -0
  134. package/dist/src/theme/components/link.styles.d.ts +1 -0
  135. package/dist/src/theme/components/link.styles.js +33 -0
  136. package/dist/src/theme/components/list-group.styles.js +1 -0
  137. package/dist/src/theme/components/menu.styles.js +9 -3
  138. package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
  139. package/dist/src/theme/components/meta-row.styles.js +66 -0
  140. package/dist/src/theme/components/number-input.styles.d.ts +1 -0
  141. package/dist/src/theme/components/number-input.styles.js +106 -0
  142. package/dist/src/theme/components/output-block.styles.js +9 -0
  143. package/dist/src/theme/components/page-frame.styles.js +7 -1
  144. package/dist/src/theme/components/page-header.styles.js +7 -0
  145. package/dist/src/theme/components/progress.styles.d.ts +1 -0
  146. package/dist/src/theme/components/progress.styles.js +71 -0
  147. package/dist/src/theme/components/resource-card.styles.js +7 -0
  148. package/dist/src/theme/components/slider.styles.d.ts +1 -0
  149. package/dist/src/theme/components/slider.styles.js +129 -0
  150. package/dist/src/theme/components/table.styles.d.ts +1 -0
  151. package/dist/src/theme/components/table.styles.js +156 -0
  152. package/dist/src/theme/components/tag.styles.js +3 -3
  153. package/dist/src/theme/components/toggle.styles.js +10 -0
  154. package/dist/src/theme/components/toolbar.styles.js +7 -0
  155. package/dist/src/theme/index.d.ts +15 -15
  156. package/dist/src/theme/index.js +24 -0
  157. package/dist/src/theme/palette.d.ts +1 -1
  158. package/dist/src/theme/palette.js +1 -1
  159. package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
  160. package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
  161. package/dist/src/theme/tokens.d.ts +7 -7
  162. package/dist/src/theme/tokens.js +14 -8
  163. package/package.json +9 -4
package/README.md CHANGED
@@ -1,19 +1,25 @@
1
1
  # Meowtail
2
2
 
3
- `meowtail` 提供跨应用组件、语义布局、标准主题和完整 Assistant 组合。网络、执行、权限与持久化由宿主适配,库不携带 Rossovia 的业务状态或后端。
3
+ `meowtail` provides cross-application components, semantic layout, the standard theme, and the complete Assistant composition. Networking, execution, permissions, and persistence are adapted by the host; the library carries no Rossovia business state or backend.
4
4
 
5
- ## 演示包
5
+ ## Presentation package
6
6
 
7
- 演示播放器、Reveal、媒体生命周期、演示内容布局和主题已迁入独立 [MeowSlides](../meowslides/README.md)。Meowtail 不反向依赖演示包,旧 `meowtail/presentation` 与根演示导出已移除;通用 UI 和布局仍由本包提供。
7
+ The presentation player, Reveal, media lifecycle, presentation content layouts, and themes have moved into the separate [MeowSlides](../meowslides/README.md). Meowtail does not depend on the presentation package in reverse, and the old `meowtail/presentation` and root presentation exports are removed; shared UI and layout are still provided by this package.
8
8
 
9
- 本包的 npm 名称是 `meowtail`;既有 `createMeowUI`、`installMeowUI`、`createMeowUICatalog` 等 API 和运行时样式身份保持不变。使用新的包导入路径,不能据包名推导新的函数名、`data-*` 标记或 CSS 变量。
9
+ This package's npm name is `meowtail`; existing APIs such as `createMeowUI`, `installMeowUI`, and `createMeowUICatalog`, along with runtime style identity, stay unchanged. Use the new package import path; do not derive new function names, `data-*` markers, or CSS variables from the package name.
10
10
 
11
- 完整组合的使用合同见 [Assistant](ASSISTANT.md),有限 JSON 入口见 [JSON catalog](JSON.md)。两者的实现与独立验收仍在进行;本页的 API 说明和早期产物验证不等于当前全部源码的同源验收通过。
11
+ See [Assistant](ASSISTANT.md) for the usage contract of the complete composition and [JSON catalog](JSON.md) for the finite JSON entry point. Implementation and independent acceptance of both are still in progress; the API descriptions and early artifact verification on this page do not equal a same-source acceptance pass for all current source code.
12
12
 
13
- ## 最小浏览器接入
13
+ ## Runtime compatibility
14
14
 
15
- 在包含 `<main id="app"></main>` 的浏览器入口中,先完成同一 runtime 的组件注册、完整 CSS 加载和主题根绑定,再渲染内容。
16
- 仅导入组件、仅安装 registry 或只用 `Theme` 都不能代替这三项;缺少任意一项,页面仍可能显示原生控件,却没有标准主题的尺寸与状态。
15
+ The current alpha requires `meowjsx@^0.1.1-alpha.1`: live component props use its public
16
+ `derived` signal primitive. Earlier JSX stable and alpha builds do not provide that export.
17
+ The existing MeowCSS peer range remains compatible.
18
+
19
+ ## Minimal browser integration
20
+
21
+ In a browser entry point containing `<main id="app"></main>`, first complete component registration on the same runtime, full CSS loading, and theme root binding, then render content.
22
+ Importing components only, installing the registry only, or using `Theme` only cannot replace these three steps; if any one is missing, the page may still show native controls without the standard theme's sizes and states.
17
23
 
18
24
  ```tsx
19
25
  import { createRuntime, h } from "meowjsx";
@@ -30,10 +36,10 @@ const removeStyles = mountStyles(root.ownerDocument, standardTheme.cssText);
30
36
  const removeTheme = applyTheme(root, standardTheme, standardOptions.select({ scheme: "light" }));
31
37
  const mounted = createWebRenderer(runtime).render(
32
38
  <Stack align="start">
33
- <strong>连接设置</strong>
39
+ <strong>Connection settings</strong>
34
40
  <Inline gap="compact">
35
- <Button>保存</Button>
36
- <Button variant="quiet">取消</Button>
41
+ <Button>Save</Button>
42
+ <Button variant="quiet">Cancel</Button>
37
43
  </Inline>
38
44
  </Stack>,
39
45
  root,
@@ -48,330 +54,352 @@ const dispose = () => {
48
54
  };
49
55
  ```
50
56
 
51
- 主题根提供可继承的正文 font、字号、行高与文字颜色;局部主题配置继承外层排版,组件仍拥有自己的控件与标题尺度。
52
- 这不包含全局 `html/body` margin 重置、页面背景、页面留白,也不自动重置任意 `h1/h2/p`。
53
- 页面空间用 `PageFrame` / `Container`,相关内容用 `Stack`,一组操作用 `Inline`;完整 Assistant 可直接用 `AssistantView`,不必从裸 Card 重搭一页。
54
- `CardHeader/Title/Content/Footer` 表达卡片内关系,原生内容则按文档语义排版;不要把每层内容都包成独立表面。
55
- 可比较 Meowbook 的 `buttons`、`card-composition`、`workspace-composition`;它们分别展示操作关系、卡片结构与滚动工作区,压力态不等于产品必须同时展示所有状态。
56
- 静态 CSS 交付与局部配置见[组件安装与样式交付](#组件安装与样式交付);`examples/browser` 的 Increment 仅是包接合 smoke,不是页面设计模板。
57
+ The theme root provides an inheritable body font, font size, line height, and text color; local theme configuration inherits the outer typography, while components still own their own control and heading scales.
58
+ This does not include a global `html/body` margin reset, page background, or page whitespace, and does not automatically reset arbitrary `h1/h2/p`.
59
+ Use `PageFrame` / `Container` for page space, `Stack` for related content, and `Inline` for a group of actions; the complete Assistant can use `AssistantView` directly, without rebuilding a page from bare Cards.
60
+ `CardHeader/Title/Content/Footer` express relationships inside a card, while native content follows document semantics; do not wrap every layer of content in its own surface.
61
+ Compare Meowbook's `buttons`, `card-composition`, and `workspace-composition`; they show action relationships, card structure, and a scrolling workspace respectively. A stress state does not mean the product must display all states at once.
62
+ See [Component installation and style delivery](#component-installation-and-style-delivery) for static CSS delivery and local configuration; the Increment in `examples/browser` is only a package-integration smoke test, not a page design template.
57
63
 
58
- ## 目录
64
+ ## Directory structure
59
65
 
60
66
  ```text
61
67
  src/
62
- components/ # Button、Card、Input、Dialog 等基础组件;一个组件一个文件
63
- chat/ # ChatFrame、ChatMessage、ChatComposer 等对话组件
64
- icons/ # 品牌标记和小图标;一个图标一个文件
65
- registry/ # contract 聚合、meowjsx 类型声明和安装入口
66
- shared/ # 组件内部共享的小工具
67
- theme/ # 标准主题的 token 定义和按 part 组织的 TS 样式
68
+ components/ # Base components such as Button, Card, Input, and Dialog; one component per file
69
+ chat/ # Conversation components such as ChatFrame, ChatMessage, and ChatComposer
70
+ icons/ # Brand marks and small icons; one icon per file
71
+ registry/ # Contract aggregation, meowjsx type declarations, and the installation entry point
72
+ shared/ # Small utilities shared inside components
73
+ theme/ # Standard theme token definitions and TS styles organized by part
68
74
  tests/
69
- unit/ # Bun,按 components/chat/icons/shared/theme 分组
70
- types/ # 公共类型合同,使用 *.types.ts / *.types.tsx,由 tsc 验证
71
- browser/ # Playwright,按 components/chat/theme/catalog 分组
75
+ unit/ # Bun, grouped by components/chat/icons/shared/theme
76
+ types/ # Public type contracts using *.types.ts / *.types.tsx, verified by tsc
77
+ browser/ # Playwright, grouped by components/chat/theme/catalog
72
78
  ```
73
79
 
74
- 产品事实、导航适配和应用专属样式留在宿主;通用活动面板、完整 Assistant 组合、共同页面壳和区域布局由本包提供,不要求消费者重新搭整页。
75
- 通用组件通过
76
- className 保留宿主应用的视觉扩展点,标准主题由同一 package 的 `meowtail/theme`
77
- 根据 registry 的 component/part 身份提供默认样式。MeowUI 的 registry 是运行时 contract
78
- 和安装入口,不是 shadcn 式的源码分发目录。
79
-
80
- ## 当前组件
81
-
82
- `PageFrame` 接收 header、toolbar 和 children,分配页头与 body 的可用高度,并提供共同页面外缘。
83
- 业务和 iframe 放入 body,不再各自按 viewport 减去页头高度。
84
- 默认 `variant="page"` 提供有限宽度与页面外缘;`variant="workspace"` 用于全宽工具栏和
85
- 连续阅读/输入工作区,外壳不重复添加页面 inset,内容组件继续拥有阅读宽度和安全底缘。
86
- 两种外壳都约束 body 高度;页头自然取高,动作可换行,就地展开内容可覆盖主体。
87
- `scrollOwner="content"` 是默认值,body 将滚动交给既有内部容器;`scrollOwner="layout"`
88
- 让 body 自己承接自然文流与滚动。标题、关闭与其他 header 动作不放进 body 滚动区。
89
- 仅 `content` 模式向直属内容根分配伸缩空间;`layout` 模式保留控件自身的默认尺寸。
90
- `RegionLayoutDescription` 用命名矩阵声明页面区域,浏览器宿主调用
91
- `mountRegionLayout(host, layout, options)`,获得 `regions` 内容根、`showGroup`、`back` 和 `dispose`。
92
- 作者把内容放入这些根;矩形区域、有限尺寸、局部排列与滚动归属共享同一校验和 renderer。
93
- `content` 行按自然内容领取空间,`fill` 行领取余量;空间不足时 content 区域按其滚动 owner
94
- 保持动作可达。组件应限制自身长内容,不能依靠外壳默认裁切来保住阅读空间。
95
- 多列在窄窗投影为一列;区域的 `compactRow="content" | "fill"` 可指定该投影中的自然高或
96
- 剩余高度,省略时沿原矩阵行推导。它不改变分组、桌面几何、内容挂载或滚动 owner。
97
- 跨模块合同和内置/扩展的共同使用见
98
- 统一 Extension 的区域布局(原产品仓库历史参考)。
99
- 原产品的接线和 UI 验收属于历史证据,不能代替本库迁移后的独立验证。
100
-
101
- `CodeBlock` 接收原始 `code` 和可选 `language`,已知语法按需加载 Shiki 高亮,提供独立复制与自动换行开关。
102
- 换行只改变显示,复制保留原始空白;浏览器剪贴板失败时显示反馈。`onCopy` 可由宿主绑定其他
103
- 剪贴板实现,组件不执行代码。无语言时显示“代码”,`defaultWrap` 设置初始换行状态。
104
- 未知语言或高亮加载失败时保留纯文本显示。
105
-
106
- `Checkbox`、`Switch` 和 `SegmentedControl` 提供原生表单选择;`Tabs` 负责保留挂载的面板切换。
107
- `Menu`、`HoverCard`、`Toast`、`RiskConfirmation` 提供菜单、预览和反馈,业务操作与显示寿命由宿主负责。
108
- Menu 的 Tab / Shift+Tab 关闭整个菜单链并沿原生顺序离开,不执行菜单项;Escape 逐层关闭并返回该层入口。
109
- `TerminalBlock`、`ReadBlock`、`DiffBlock`、`SearchBlock`、`WebBlock` 与 `JsonBlock/JsonTree`
110
- 展示宿主提供的输出;组件不执行工具或读取文件。`ReadBlock` 可传 `lang`,首次进入视口时加载高亮,未知语言保留纯文本。
111
- `ImagePreview` 统一图片加载、失败与预览框,`ImageLightbox` 提供单图查看,
112
- `ShortcutKeys`、`PathLabel`、`StateDot` 和 `TextShimmer` 提供辅助呈现。
113
-
114
- `Pill` 用于紧凑胶囊标签或操作,选中状态由宿主提供;静态标签沿用 `Badge`,支持 outline、solid 和 quiet 呈现。
115
-
116
- 界面改版(系统设计稿(原产品仓库历史参考))新增的通用组件:
117
- `StatusDot` 以 processing(accent 脉冲)、success、returned(空心绿,执行返回不等于目标完成)、
118
- warning、danger、unknown(空心灰,不假装知道)、idle 表达状态,点本身不带文字。
119
- `Status` 接收 `state` 与必填 `label`,把装饰点与可见状态文字作为一个内容单元,标准主题统一点为 7px,
120
- 不提供 `size` 或 `halo`。`label` 保留 `Child` 的组合能力并排除直接空值与布尔值;调用方须保证
121
- 字符串、数组及动态内容实际非空且可见,并使用适合行内呈现的内容。`ListRow.status` 与
122
- `ResourceCard.status` 仍接收 `Child`,可传入 `Status`;`WorkCard`、`Timeline` 等组件继续拥有内部标记,
123
- 不机械替换命令式改写、信号独立点或无逐点文字的装饰点阵。状态文字的非空语义仍由调用方审查。
124
- `Tag` 是挨着内容的静态事实
125
- (中性、强调、橙色计数、等宽路径),可选择与筛选仍用 `Pill`;`ProcessGroup` 与 `ProcessStep` 是折叠的步骤记录;
126
- `WorkCard` 是对话里指向一件工作的单个控件;`IconRail`、`RailItem` 与 `RailSection` 是 56px 图标栏,悬停或键盘
127
- 聚焦时展开为覆盖在内容上的 256px 抽屉,分组收起时折成一个图标并显示子项的当前位置与橙点。
128
- `Button` 的 `outline` 是次要层级,另有 `accent`(关于当前活动的软底)与 `stop`(打断运行中的工作)。
129
- 第二阶段补齐的详情与页面结构:`DetailSection`(带发丝线的分块,标题是小标签而非页面标题)、`Timeline` 与
130
- `TimelineItem`(一条线串起的事件,标记点沿用 `StatusDot` 语义)、`ResourceLink`(指向一个可打开对象的整行引用,
131
- 有 href 时是链接,否则是按钮);`PageHeader`(页名、一句用途与页面级操作)、`ListGroup` 与 `ListRow`(并列条目共用一圈
132
- 轮廓,可在行下展开编辑区,单独使用并设 `tone="accent"` 是摘要行)、`ResourceCard`(概览页里的一项能力,停用态用虚线
133
- 低对比);`Drawer` 是窄屏从起始边滑入的原生模态面板,遮罩点击与 Escape 都交给宿主更新 `open`。`SegmentedControl` 的
134
- 轨道与选中态按设计稿收紧。窄屏的 `ChatComposer` 堆叠布局把「添加、输入、发送」放在一行,模型选择留在下方。
135
- 色板与层级只在 `theme/palette.ts`:`accentTokens`、`statusTokens`、`radiusTokens`(8/10/14/22)、`lineTokens`
136
- (0.5px 发丝线)、`layerTokens`;accent 只表达「正在发生」与「当前所在」,primary 仍为黑白。
137
-
138
- `ChatToolCall` 用 `label` 表示动作,`summary` 表示折叠时仍可见的简短目标;输入/输出是可响应更新的惰性文本,
139
- 超长结果沿共享 `OutputBlock` 折叠并完整复制。queued/running/waiting/success/error/cancelled/unknown
140
- 分别表示宿主事实,complete 保留兼容。onRetry/onCancel 只通知宿主,组件不执行工具或自动更新业务状态。
141
- `ChatTask` 提供标题、状态、公开执行摘要、独立的 executionText/replyText、可选原生进度与 children/footer;
142
- 执行成功但公开答复未收到仍可准确呈现。默认 unknown;未知进度省略,不伪造百分比。
143
- `ChatProcess` 用原生 details 聚合记录,任务与工具继续复用 Stack/Inline/Grid、来源、附件、产物和代码组件。
144
- 完整生命周期的已有/补齐/宿主边界与连贯组合规则见 [Agent 组件说明](AGENT-COMPONENTS.md),
145
- 真实默认组合见 Meowbook 的 agent-workflow、agent-workflow-narrow 与 agent-workflow-assistant。
146
- 已有 AssistantView JSON catalog 同步增加有限 tool/task parts 与 onToolAction,复用同一组件;
147
- 不新增独立 ChatTask/ChatToolCall JSON entry、递归任务树或任意对象解释,支持集见 [JSON 合同](JSON.md)。
148
-
149
- `ChatMessageList` 的行距由列声明、由行读取:列在每个非首行上给出 `--chat-row-pitch`,行按它设置
150
- 上边距,首行的上边距来自列表自身的内距。宿主逐条挂载消息时可以在列与行之间插入无布局容器
151
- (`display: contents`),行距与直接子项一致。工具调用、过程分组与来源共用同一组行度量
152
- (leading 盒、间隙与行盒),并随 `--chat-font-body` 相对 14px 的增量一起缩放:改变对话字号时
153
- 字形盒、字形、行盒与展开体缩进一起移动。行所拥有的内容(展开体、分组内的行)挂在行标签的
154
- 轴线上,与标签本身区分层级;与行并列的条目留在同一轴线上。
155
-
156
- 连续回复传入同一头像与 `continuation`,主题保留头像列并隐藏重复头像,正文轴线不依赖相邻 DOM 结构;未传头像的组继续使用无头像布局。
157
-
158
- 默认尺度与组件开发顺序见 [组件开发约定](AGENTS.md)。新组件先在 Meowbook 与现有控件同屏校准,
159
- 再接入应用;主题的字号、控件高度和三层间距是一套关系,不分别为每个组件选择一组新尺寸。
160
- 默认按钮高 36px,紧凑按钮高 28px,输入控件高 32px。信息块内部紧凑;页面边缘、独立区块与阅读区域应有充分留白。
161
- 局部间距 token 不是页面留白的上限,不将所有层级统一压紧。
162
-
163
- 界面正文使用 `uiTokens.fontBody`,辅助说明使用 `uiTokens.fontCaption`,长文与对话正文使用
164
- `uiTokens.fontReading`,局部标题使用 `uiTokens.fontTitle`,完整页面标题使用
165
- `uiTokens.fontPageTitle`,不把页面标题尺度用于字段标签。普通控件的水平内距由
166
- `uiTokens.controlPaddingInline` 决定;group、section、panel 分别表达组内、区域之间和容器边缘的留白。
167
- 阅读段落的相对缩进、媒体尺寸、图谱坐标与触摸目标仍按真实用途设置,不套用控件尺度。
168
-
169
- `PageFrame` 的页面边缘使用 `pageInsetBlock` / `pageInsetInline`,窄窗使用对应的
170
- `pageInsetCompactBlock` / `pageInsetCompactInline`;页面留白不压成局部 panel 内距。
171
- `ResourceCard` 使用统一的局部标题、正文、辅助文字与 card 圆角;紧凑概览对象的内距和
172
- 纵向节奏只在组件主题 token 中定义,不增加任意像素或 density 参数。需要核对的 identity
173
- 使用辅助文字色与等宽字体,停用状态不抹去名称与操作原因。
174
- Meowbook 的 `page-structure-long-content` 补充长名称、准确标识、邻接状态与禁用动作的组合;
175
- `EmptyState` 透传调用方的原生属性,状态紧急度与加载事实仍由宿主提供。
176
-
177
- 从仓库根运行 `bun test packages/meowtail/tests/unit` 执行 `tests/unit` 的 Bun 测试;类型检查与 `tests/browser` 的组件行为回归分别执行。文件归属与命名遵循测试文件组织规范(原产品仓库历史参考)。
178
- 浏览器测试只启动本包的 Meowbook 场景,不需要 Dashboard。组件交互、布局、对话组件和主题
179
- 回归统一位于 `tests/browser`;其中 catalog 验证本包展示配置作为 Meowbook 消费者的实际接合。
180
- Meowbook 自身的工具与独立夹具测试仍由 `test:meowbook` 负责。
181
- 完整 UI 回归还需运行 Meowbook 测试及本包 `playwright.config.ts` 的浏览器场景。
182
-
183
- `ChoiceGroup` 直接展示少量单选项,复用原生 radio 的键盘、表单和必填校验。
184
- 支持选项说明、禁用、受控值及表单重置;不负责提交。
185
- `ChatQuestion` 提供问题、补充说明、回答内容、反馈和操作的布局;回答方式、异步提交和取消的业务含义
186
- 由宿主负责。标准主题遵循紧凑工作尺度,相关操作集中排列,不默认拉到容器两端。
187
-
188
- ### 布局与内容组合
189
-
190
- `Stack` 纵向排列,`Inline` 横向排列且默认允许换行。共同提供 `gap`(none/compact/normal/relaxed)、
191
- `align` 和 `justify`;`Inline wrap={false}` 可明确保持单行。组件保留方向与排列结构,theme 决定语义间距。
192
- `Grid` 默认按容器宽度自动排列,`minColumnWidth` 为 compact/normal/wide;也可指定 `columns={1|2|3|4}`。
193
- 固定列数不会偷偷变成响应式列数。`Container width` 为 narrow/content/wide/page/full,主题控制内容最大宽度。
194
- Stack 默认 stretch 便于表单与内容区域填满宽度;混合标签和按钮时用 `align="start"` 保留自然尺寸,
195
- 或把行动放入 Inline。字段、动作与长文字按内容关系明确选择 stretch、start 或 baseline 对齐。
196
-
197
- 局部布局可以自由嵌套这些 JSX 组件:先选择横向、纵向或并列关系,再在需要分配余量时使用
198
- `LayoutItem`,内容和原生语义仍由真实组件承载。页壳与命名区域矩阵分配页面空间,
199
- 不限制区域内部的组件组合;没有新增可序列化的递归布局模板或另一套布局引擎。
200
-
201
- 沿用这套布局原语,不在应用中重复实现方向、对齐和间距。Stack/Inline/Grid 的 `rowGap`、
202
- `columnGap` 默认 auto(沿用 gap),可单独使用同一套语义间距。布局可用 `as="header"` 或
203
- `as="footer"` 保留区域语义;组件不会代替宿主选择业务断点、文字截断或换行策略。
204
-
205
- `Toolbar` 默认横向并允许换行;`orientation="vertical"` 沿纵向排列。它为自身按钮、原生输入型按钮和有 href 的链接动作集合提供一个 Tab 停靠,方向键、Home / End 在当前集合内移动,横向尊重 RTL。原生 Input、Textarea、Select 和自管键盘的组合控件保留独立 Tab 与编辑键;嵌套 Toolbar 不重复消费。隐藏、disabled、inert 或作者显式 `tabIndex=-1` 的入口不入动作集合,动态成员变化不主动夺焦点。Enter / Space 仍沿控件原生激活,不自动将复杂输入折进 overflow 菜单;卸载恢复本组件管理过的 tabindex,保调用方后续有效属性。
206
-
207
- `LayoutItem` 控制直接子项的空间分配:`grow` 默认 false,`shrink` 默认 true,
208
- `basis` 默认 auto,`alignSelf` 默认 auto。它与 Stack/Inline/Grid 的根保留 min-width:0、min-height:0,
209
- 让嵌套子项能够接受父容器分配的有限空间;长标识符
210
- 是否断行、正文是否截断由内容决定。只在需要控制子项空间时使用,不要求每个元素包一层。
211
-
212
- 纵向工作区先由宿主或 PageFrame 提供有限高度,再用 `LayoutItem grow` 分配正文余量。
213
- 实际滚动内容明确使用 `overflow: auto`;布局组件不会默认裁切内容,也不会自动选择滚动 owner。
214
- 中间继续用 Stack 等布局组件时沿用可收缩的根;插入原生 div 等宿主包装时,仍须自行处理其
215
- 高度和最小尺寸。无高度限制的 Stack 保持自然文流,`shrink={false}` 的动作仍保留自然尺寸。
80
+ Product facts, navigation adaptation, and application-specific styles stay in the host; this package provides shared activity panels, the complete Assistant composition, shared page shells, and region layouts, so consumers do not need to rebuild whole pages.
81
+ Shared components keep visual extension points for host applications through
82
+ className, and the standard theme provides default styles from `meowtail/theme`
83
+ in the same package based on the registry's component/part identity. The MeowUI registry is a runtime contract
84
+ and installation entry point, not a shadcn-style source distribution directory.
85
+
86
+ ## Current components
87
+
88
+ `PageFrame` accepts header, toolbar, notice, footer, and children, allocates available height between the page header and body, and provides the shared page outer edge.
89
+ The optional `notice` sits between the header and the scrolling body; the optional `footer` stays after the body, so a composer or action bar does not need to float over content.
90
+ Business content and iframes go into the body and no longer each subtract the header height from the viewport.
91
+ The default `variant="page"` provides a bounded width and the page outer edge; `variant="workspace"` is for full-width toolbars and continuous reading/input workspaces, where the shell does not add another page inset and content components keep owning reading width and a safe bottom edge.
92
+ Both shells constrain the body height; the header takes its natural height, actions can wrap, and content expanded in place can overlay the main region.
93
+ `AppBar` is the compact application chrome used in `PageFrame`'s header slot: one title, one optional status line (usually `ChatStatus`), and the actions for the whole screen. It is distinct from `PageHeader` (page title block) and the keyboard `Toolbar`; use it for continuous small-screen workspaces, not as a second page header on desktop pages.
94
+
95
+ `scrollOwner="content"` is the default, where the body hands scrolling to an existing inner container; `scrollOwner="layout"` has the body itself carry natural flow and scrolling. Titles, close buttons, and other header actions do not go inside the body scroll region.
96
+ Only `content` mode allocates stretch space to direct content roots; `layout` mode keeps controls' own default sizes.
97
+ `RegionLayoutDescription` declares page regions with a named matrix; the browser host calls
98
+ `mountRegionLayout(host, layout, options)` and gets `regions` content roots, `showGroup`, `back`, and `dispose`.
99
+ Authors put content into these roots; rectangular regions, finite sizes, local arrangement, and scroll ownership share the same validation and renderer.
100
+ `content` rows claim space by natural content, and `fill` rows claim the remainder; when space is short, content regions keep actions reachable according to their scroll owner. Components should limit their own long content rather than relying on the shell's default clipping to preserve reading space.
101
+ Multiple columns project to one column in narrow windows; a region's `compactRow="content" | "fill"` can specify natural height or remaining height in that projection, and when omitted it is derived from the original matrix row. It does not change grouping, desktop geometry, content mounting, or scroll owner.
102
+ See unified Extension region layout (historical reference in the original product repository) for
103
+ cross-module contracts and shared use between built-ins and extensions.
104
+ The original product's wiring and UI acceptance are historical evidence and cannot replace independent verification after this library's migration.
105
+
106
+ `CodeBlock` accepts raw `code` and an optional `language`, loads Shiki highlighting on demand for known syntaxes, and provides independent copy and soft-wrap toggles.
107
+ Wrapping changes only the display; copying preserves the original whitespace. When the browser clipboard fails, it shows feedback. The host can bind `onCopy` to another
108
+ clipboard implementation, and the component does not execute code. With no language it shows "Code", and `defaultWrap` sets the initial wrap state.
109
+ Unknown languages or failed highlight loads keep a plain-text display.
110
+
111
+ `Checkbox`, `Switch`, and `SegmentedControl` provide native form selection; `Tabs` handles switching panels that stay mounted.
112
+ A `Checkbox` can be `indeterminate` for a parent of mixed children; assistive technology reads `aria-checked="mixed"`.
113
+ `Slider` is a native range with a visible figure for the same value; `NumberInput` steps and clamps a number and formats the committed figure.
114
+ `Progress` is a labeled native progress bar, determinate or indeterminate; `Spinner` remains the wait with no known amount. `ChatTask` reuses `Progress` for explicit host progress.
115
+ `Avatar` shows a picture or initials; `ChatMessage` still takes any avatar child in its identity column, because that slot already hosts icons and other artwork.
116
+ `Link` is a themed inline text link. It is not `ResourceLink`, which remains the whole-row reference to an openable object.
117
+ `Table` shows host rows in columns that the user can sort, resize, and multi-select; row order and records stay with the caller.
118
+ `Accordion` groups `Disclosure` sections in single- or multiple-open mode.
119
+ `Menu`, `MenuButton`, `ContextMenu`, `HoverCard`, `Toast`, and `RiskConfirmation` provide menus, previews, and feedback, while business actions and display lifetimes are the host's responsibility.
120
+ `MenuButton` is a button that opens the existing `Menu`; `ContextMenu` opens that same `Menu` from a right-click or Shift+F10, including nested items.
121
+ Menu's Tab / Shift+Tab closes the whole menu chain and leaves along the native order without activating menu items; Escape closes one layer at a time and returns to that layer's entry point.
122
+ `TerminalBlock`, `ReadBlock`, `DiffBlock`, `SearchBlock`, `WebBlock`, and `JsonBlock/JsonTree`
123
+ display host-provided output; components do not execute tools or read files. `ReadBlock` accepts `lang`, loads highlighting when it first enters the viewport, and keeps unknown languages as plain text.
124
+ `ImagePreview` unifies image loading, failure, and the preview frame; `ImageLightbox` provides single-image viewing;
125
+ `ShortcutKeys`, `PathLabel`, `StateDot`, and `TextShimmer` provide supporting presentation.
126
+
127
+ `Pill` is for compact capsule labels or actions, with selected state provided by the host; static labels use `Badge`, which supports outline, solid, and quiet presentation.
128
+
129
+ Shared components added by the UI revision (system design draft (historical reference in the original product repository)):
130
+ `StatusDot` expresses state as processing (accent pulse), success, returned (hollow green; an execution return does not mean the goal is complete),
131
+ warning, danger, unknown (hollow gray; do not pretend to know), and idle; the dot itself carries no text.
132
+ `Status` accepts `state` and a required `label`, treating the decorative dot and visible state text as one content unit; the standard theme fixes the dot at 7px
133
+ and exposes no `size` or `halo`. `label` keeps `Child` composition and excludes direct empty values and booleans; callers must ensure
134
+ strings, arrays, and dynamic content are actually non-empty and visible, and use content suitable for inline presentation. `ListRow.status` and
135
+ `ResourceCard.status` still accept `Child` and can take `Status`; `WorkCard`, `Timeline`, and similar components keep their internal markers
136
+ and are not mechanically replaced with imperative rewrites, per-signal dots, or decorative dot matrices without per-dot text. The caller still reviews the non-empty semantics of status text.
137
+ `Tag` is a static fact next to content
138
+ (neutral, emphasized, orange count, monospace path), while selection and filtering still use `Pill`; `ProcessGroup` and `ProcessStep` are collapsible step records;
139
+ `WorkCard` is a single control in a conversation that points to one piece of work; `IconRail`, `RailItem`, and `RailSection` form a 56px icon rail that expands on hover or keyboard
140
+ focus into a 256px drawer over the content, and a collapsed group folds into one icon that shows the current position of its items with an orange dot.
141
+ `Button`'s `outline` is the secondary level, plus `accent` (a soft background related to current activity) and `stop` (to interrupt running work).
142
+ Details and page structures added in the second stage: `DetailSection` (a block with a hairline; its title is a small label rather than a page title), `Timeline` and
143
+ `TimelineItem` (events threaded on one line, with markers following `StatusDot` semantics), `ResourceLink` (a whole-row reference to an openable object:
144
+ a link when href is present, otherwise a button); `PageHeader` (page name, one-sentence purpose, and page-level actions), `ListGroup` and `ListRow` (sibling entries share one
145
+ outline, an editing area can expand below a row, and a standalone row with `tone="accent"` is a summary row), `ResourceCard` (a capability on an overview page, with a dashed
146
+ low-contrast disabled state); `Drawer` is a narrow-screen native modal panel that slides in from the start edge, with backdrop clicks and Escape handed to the host to update `open`. `SegmentedControl`
147
+ tightens its track and selected state to match the design draft. The narrow-screen `ChatComposer` stacked layout puts "add, input, send" on one row and keeps model selection below.
148
+ The palette and layers live only in `theme/palette.ts`: `accentTokens`, `statusTokens`, `radiusTokens` (8/10/14/22), `lineTokens`
149
+ (0.5px hairlines), and `layerTokens`; accent expresses only "happening now" and "where you are", while primary stays black and white.
150
+
151
+ `ChatToolCall` uses `label` for the action and `summary` for the short target still visible when collapsed; input/output are reactive lazy text,
152
+ and overlong results collapse through the shared `OutputBlock` and copy in full. queued/running/waiting/success/error/cancelled/unknown
153
+ each represent host facts, and complete stays for compatibility. onRetry/onCancel only notify the host; the component does not execute tools or update business state automatically.
154
+ `ChatTask` provides a title, state, public execution summary, separate executionText/replyText, optional native progress, and children/footer;
155
+ execution success without a received public reply is still presented accurately. It defaults to unknown; unknown progress is omitted rather than faking percentages.
156
+ `ChatProcess` aggregates records with native details, and tasks and tools continue to reuse Stack/Inline/Grid, sources, attachments, artifacts, and code components.
157
+ For existing/added/host boundaries across the full lifecycle and the coherent composition rules, see [Agent components](AGENT-COMPONENTS.md);
158
+ for real default compositions, see agent-workflow, agent-workflow-narrow, and agent-workflow-assistant in Meowbook.
159
+ The existing AssistantView JSON catalog also gains finite tool/task parts and onToolAction while reusing the same components;
160
+ it adds no separate ChatTask/ChatToolCall JSON entry, recursive task tree, or arbitrary object interpretation. See the [JSON contract](JSON.md) for the supported set.
161
+
162
+ `ChatMessageList` row spacing is declared by the column and read by the rows: the column sets `--chat-row-pitch` on every non-first row, and rows use it for their
163
+ top margin, with the first row's top margin coming from the list's own inset. When the host mounts messages one by one, it can insert a layout-free container
164
+ (`display: contents`) between the column and the rows, and row spacing matches that of direct children. Tool calls, process groups, and sources share one set of row metrics
165
+ (leading box, gaps, and row box) and scale with the `--chat-font-body` delta relative to 14px: changing the conversation font size
166
+ moves the glyph box, glyphs, row box, and expanded-body indentation together. Content owned by a row (expanded body, rows inside a group) hangs on the row label's
167
+ axis and is hierarchically distinct from the label itself; entries beside the row stay on the same axis.
168
+
169
+ Consecutive replies pass the same avatar with `continuation`, and the theme keeps the avatar column while hiding repeated avatars; the body axis does not depend on adjacent DOM structure. Groups without an avatar keep the avatar-free layout.
170
+
171
+ See [Component development conventions](AGENTS.md) for the default scale and component development order. Calibrate new components on the same screen as existing controls in Meowbook
172
+ first, then integrate them into applications; the theme's font sizes, control heights, and three-level spacing form one set of relationships, and each component does not get its own new sizes.
173
+ Default buttons are 36px high, compact buttons 28px, and input controls 32px. Information blocks are tight inside; page edges, standalone blocks, and reading areas should have generous whitespace.
174
+ Local spacing tokens are not the ceiling for page whitespace, and not every level is uniformly compressed.
175
+
176
+ Use `uiTokens.fontBody` for interface body text, `uiTokens.fontCaption` for supporting descriptions, `uiTokens.fontReading` for long-form and conversation body text,
177
+ `uiTokens.fontTitle` for local titles, and `uiTokens.fontPageTitle` for complete page titles; do not use the page-title scale for field labels. The horizontal padding of ordinary controls comes from
178
+ `uiTokens.controlPaddingInline`; group, section, and panel express whitespace within a group, between areas, and at container edges respectively.
179
+ Relative indentation in reading paragraphs, media sizes, graph coordinates, and touch targets still follow real usage and do not adopt control scales.
180
+
181
+ `PageFrame`'s page edge uses `pageInsetBlock` / `pageInsetInline`, and narrow windows use the corresponding
182
+ `pageInsetCompactBlock` / `pageInsetCompactInline`; page whitespace is not compressed into local panel padding.
183
+ `ResourceCard` uses unified local titles, body text, supporting text, and card radius; padding and vertical rhythm for compact overview objects are defined only in component theme tokens,
184
+ without arbitrary pixel or density parameters. Identities that need checking use the supporting text color and a monospace font, and the disabled state does not erase
185
+ the name or the reason the action is unavailable.
186
+ Meowbook's `page-structure-long-content` adds compositions with long names, precise identifiers, adjacent states, and disabled actions;
187
+ `EmptyState` passes through the caller's native attributes, and state urgency and loading facts still come from the host.
188
+
189
+ Run `bun test packages/meowtail/tests/unit` from the repository root to run the Bun tests in `tests/unit`; typechecking and the component behavior regressions in `tests/browser` run separately. File ownership and naming follow the test file organization specification (historical reference in the original product repository).
190
+ Browser tests start only this package's Meowbook scenes and do not need the Dashboard. Component interaction, layout, conversation components, and theme
191
+ regressions all live in `tests/browser`; the catalog there verifies the actual integration of this package's showcase configuration as a Meowbook consumer.
192
+ Meowbook's own tool and standalone fixture tests are still handled by `test:meowbook`.
193
+ A complete UI regression also requires running the Meowbook tests and the browser scenes in this package's `playwright.config.ts`.
194
+
195
+ `ChoiceGroup` directly displays a small number of single-choice options and reuses native radio keyboard, form, and required validation.
196
+ It supports option descriptions, disabled options, controlled values, and form reset; it does not handle submission.
197
+ `ChatQuestion` lays out the question, supporting description, answer content, feedback, and actions; the meaning of answer modes, asynchronous submission, and cancellation
198
+ is the host's responsibility. The standard theme follows the compact work scale and keeps related actions grouped rather than stretching them to the container edges by default.
199
+
200
+ ### Layout and content composition
201
+
202
+ `Stack` arranges vertically; `Inline` arranges horizontally and allows wrapping by default. Both provide `gap` (none/compact/normal/relaxed),
203
+ `align`, and `justify`; `Inline wrap={false}` explicitly keeps a single line. Components keep direction and arrangement structure, and the theme decides semantic spacing.
204
+ `Grid` arranges automatically by container width by default, with `minColumnWidth` set to compact/normal/wide; `columns={1|2|3|4}` can also be specified.
205
+ A fixed column count does not silently become a responsive count. `Container width` is narrow/content/wide/page/full, and the theme controls the maximum content width.
206
+ Stack stretches by default so forms and content regions fill the width; when mixing labels and buttons, use `align="start"` to keep natural sizes,
207
+ or put the actions in an Inline. Fields, actions, and long text clearly choose stretch, start, or baseline alignment according to their content relationship.
208
+
209
+ Local layout can freely nest these JSX components: first choose the horizontal, vertical, or parallel relationship, then use `LayoutItem` when space needs allocating,
210
+ while content and native semantics are still carried by real components. The page shell and named region matrix allocate page space and do not limit component composition inside a region;
211
+ no new serializable recursive layout template or second layout engine was added.
212
+
213
+ Use this set of layout primitives and do not reimplement direction, alignment, and spacing in applications. Stack/Inline/Grid `rowGap` and
214
+ `columnGap` default to auto (following gap) and can use the same semantic spacing independently. Layouts can use `as="header"` or
215
+ `as="footer"` to keep region semantics; components do not choose business breakpoints, text truncation, or wrapping strategies for the host.
216
+
217
+ `ActionRail` is one action row with named `leading`, `trailing`, and `submit` slots. The rail owns start/end anchoring and the rule that the submit action stays visible while flexible leading and trailing actions wrap; callers pass actions rather than layout classes. `MetaRow` is one page-level fact row: `items` carry an optional icon and a short label, separators are generated between facts, `progress` appends one optional progress fact (finite values clamp to 0–100; non-finite values are omitted), and `align`/`progressTone` select the two finite presentations. Neither component owns business state or actions.
218
+
219
+ `Toolbar` is horizontal by default and allows wrapping; `orientation="vertical"` arranges it vertically. It provides one Tab stop for its own buttons and for the action set of native input-like buttons and links with href; arrow keys, Home / End move within the current set, and horizontal orientation respects RTL. Native Input, Textarea, Select, and composite controls that manage their own keyboard keep independent Tab stops and editing keys; nested Toolbars do not consume them twice. Entries that are hidden, disabled, inert, or explicitly set to `tabIndex=-1` by the author are excluded from the action set, and dynamic membership changes do not steal focus. Enter / Space still activate along native control behavior, and complex inputs are not automatically folded into an overflow menu; unmounting restores the tabindex values this component managed and preserves the caller's subsequent valid attributes.
220
+
221
+ `LayoutItem` controls space allocation for direct children: `grow` defaults to false, `shrink` to true,
222
+ `basis` to auto, and `alignSelf` to auto. Its root with Stack/Inline/Grid keeps min-width:0 and min-height:0
223
+ so nested children can accept the finite space the parent allocates; whether long identifiers
224
+ break or body text truncates is decided by the content. Use it only when child space needs controlling, not as a wrapper around every element.
225
+
226
+ For a vertical workspace, first have the host or PageFrame provide a finite height, then allocate the body remainder with `LayoutItem grow`.
227
+ Content that actually scrolls explicitly uses `overflow: auto`; layout components do not clip content by default and do not choose a scroll owner automatically.
228
+ When continuing with layout components such as Stack in between, keep using shrinkable roots; when inserting host wrappers such as native divs, the wrapper still has to handle its own
229
+ height and minimum size. A Stack without a height constraint keeps natural flow, and actions with `shrink={false}` keep their natural size.
216
230
 
217
231
  ```tsx
218
- // 标签与值属于一组,混合字号沿文字基线对齐。
232
+ // Label and value belong to one group; mixed font sizes align along the text baseline.
219
233
  <Inline gap="compact" align="baseline">
220
- <small>默认连接</small>
234
+ <small>Default connection</small>
221
235
  <strong>Codex</strong>
222
236
  <small>gpt-6-luna</small>
223
237
  </Inline>
224
238
 
225
- // 正文使用剩余宽度,动作保留自然尺寸。
239
+ // The body uses the remaining width; the action keeps its natural size.
226
240
  <Inline wrap={false}>
227
241
  <LayoutItem grow><Stack gap="compact">{title}{description}</Stack></LayoutItem>
228
- <LayoutItem shrink={false}><Button>编辑连接</Button></LayoutItem>
242
+ <LayoutItem shrink={false}><Button>Edit connection</Button></LayoutItem>
229
243
  </Inline>
230
244
 
231
- // 操作靠近排列,换行后留出更清楚的行距。
245
+ // Actions sit close together, with clearer line spacing when they wrap.
232
246
  <Inline as="footer" gap="compact" rowGap="normal">{actions}</Inline>
233
247
  ```
234
248
 
235
- Meowbook 的“布局组合 · 文本基线与固定动作”同时覆盖这些组合与长模型标识符。
249
+ Meowbook's "Layout composition · Text baseline and fixed actions" covers these compositions and long model identifiers together.
236
250
 
237
- `DescriptionList` / `DescriptionItem term={...}` 用原生 `dl` / `dt` / `dd` 组织相关的标签与值。
238
- 同组标签自然取宽并有上限,值共享列起点;局部容器宽度不足时,每项按标签、值上下排列,
239
- 不按整个窗口宽度判断。默认保留语义字号与可换行长文本,不提供表面、内距或独立滚动。
240
- 需要父容器分配可用宽度,不承诺按内容收紧宽度的布局;当前 Web 主题使用 CSS subgrid 与容器查询。
241
- 标签和任意值都可传 `Child`,值内继续组合已有布局与控件,不提供元数据 schema 或额外动作插槽。
242
- 代码字体、截断和固定尺寸子内容由消费者决定;普通文字与长标识默认可断行。
243
- 公开 parts 为 `description-list/root`、`description-item/root/term/value`,原生属性透传到各组件 root。
251
+ `DescriptionList` / `DescriptionItem term={...}` organize related labels and values with native `dl` / `dt` / `dd`.
252
+ Labels in the same group take their natural width up to a cap, and values share a column start; when the local container is too narrow, each item stacks label above value
253
+ based on the local width, not the whole window. By default it keeps semantic font sizes and wrappable long text, and provides no surface, padding, or independent scrolling.
254
+ It needs the parent container to allocate available width and does not promise a layout that tightens width to content; the current Web theme uses CSS subgrid and container queries.
255
+ Labels and arbitrary values accept `Child`; values continue to compose existing layouts and controls, and no metadata schema or extra action slot is provided.
256
+ Code fonts, truncation, and fixed-size child content are decided by the consumer; ordinary text and long identifiers can wrap by default.
257
+ The public parts are `description-list/root` and `description-item/root/term/value`, and native attributes pass through to each component root.
244
258
 
245
259
  ```tsx
246
260
  <DescriptionList>
247
- <DescriptionItem term="工作目录">
261
+ <DescriptionItem term="Working directory">
248
262
  <Inline wrap={false} gap="compact" align="start">
249
263
  <LayoutItem grow>
250
264
  <code>{workspacePath}</code>
251
265
  </LayoutItem>
252
266
  <LayoutItem shrink={false}>
253
- <Button size="small">复制目录</Button>
267
+ <Button size="small">Copy directory</Button>
254
268
  </LayoutItem>
255
269
  </Inline>
256
270
  </DescriptionItem>
257
- <DescriptionItem term="访问方式">只读</DescriptionItem>
271
+ <DescriptionItem term="Access mode">Read-only</DescriptionItem>
258
272
  </DescriptionList>
259
273
  ```
260
274
 
261
- Meowbook 的 `description-list-composition` 在同一视口展示宽、窄局部容器、长标签与标识、
262
- 值内动作和输入,用于核对共享列、自然重排、原生语义与草稿连续性;它不代表业务页面已验收。
263
-
264
- `Card` 支持 CardHeader、CardTitle、CardDescription、CardAction、CardContent、CardFooter。
265
- 默认 `variant="auto"` 通过渲染树 Context 取得深度:标准主题将顶层呈现为独立表面、后代融入父级;显式 variant 优先。
266
- 深度跟随逻辑组件树,浮层不会因为视觉上离开父卡片而自动变成新根;需要独立表面的弹层内容显式使用 surface。
267
- Title 可以指定 h2–h6,标题等级仍由文档结构决定,不根据卡片嵌套自动猜测。
268
- 内部普通分组使用共享表面,独立事项可以明确使用 `variant="surface"`;`variant="embedded"` 明确融入父表面。
269
- 嵌套关系不等于必须重复外框和阴影。复杂内容仍使用 Stack/Inline/Grid 排版,不把 Card 变成万能布局组件。
270
-
271
- `FieldGroup` 使用原生 fieldset/legend 组织字段,支持整组 disabled;Field 继续负责单个字段关联。
272
- `AspectRatio ratio={16/9}` 控制布局比例,媒体的 object-fit 与裁切由调用方选择。
273
- `Separator` 保留横向/纵向分隔语义。
274
-
275
- `Tabs` 使用必需的 id、label 与 items(value/label/content/disabled)创建关联的 tab/tabpanel;
276
- 支持方向键、Home/End、受控 value Signal 与 defaultValue。切换时面板保持挂载,草稿不丢失。
277
- `Breadcrumb items` 为 label/href 数组,最后一项标记当前位置。
278
- `Tooltip` 使用 `trigger(bindings)` 为有名称的可聚焦控件补充文字说明,鼠标延迟出现、键盘聚焦立即出现,
279
- Escape 关闭;不要把必要信息或可交互内容只放进 Tooltip,后者使用 Popover。
280
- `Alert tone` 表达视觉状态,`role` 明确选择 status/alert,紧急度不由颜色推断。
281
- `Skeleton` 是 aria-hidden 的占位;调用方提供内容区域的 aria-busy 和加载文案。
282
- `SkeletonBoundary active={loading} label="正在更新资料"` 对已挂载的内容应用骨架呈现,
283
- `active` 接收 boolean 或 Signal;切换不会卸载 children,保留输入草稿与组件状态。
284
- 加载时区域标记 aria-busy、内容 inert,屏幕阅读器从区域外的 status 获取调用方提供的加载文案。
285
- 开始加载时释放内容内的焦点;完成后不自动抢回焦点。调用方应把取消、重试等可用操作放在边界外。
286
- 底层使用 MeowJSX Web 的共享骨架控制器,对文字、图片、图标及输入统一去细节;这只是加载呈现,
287
- 不负责发起请求、计时或判断完成。首次加载尚无内容几何时,仍由调用方使用 `Skeleton` 提供占位结构。
288
- 宿主显式给 Web renderer 接入 `observation` hub 时,边界从渲染树 Context 取得来源并订阅自己的
289
- 组件子树;嵌套边界按 contract 与节点归属定位,不依赖函数名。普通未观察的 renderer 仍用局部 DOM
290
- 方式呈现,不强制开启组件索引。两种方式都保留外部 DOM 与主题变化的补充监听。
291
- `Spinner label` 提供可读加载状态,不宣称真实进度。
292
-
293
- 原生选择控件 `Select` 复用浏览器的选项、键盘与表单语义,提供 `root` part;视觉由 theme 决定。它同时用于 Meowbook 工具外观与场景主题选择。控件保留原生 `size`(行数)语义,不把它复用成视觉尺寸。
294
-
295
- `Popover` 是非模态的通用弹层,不默认设置菜单角色或锁住焦点。必需 `id` 和
296
- `trigger(bindings)`;触发按钮展开 bindings,内容放 children。支持 `open` Signal / `defaultOpen`、
297
- `onOpenChange`、`align`、`matchTriggerWidth`、`role` 和 `labelledBy`。`triggerId` 可与外部 Field 关联。
298
- 使用浏览器 Popover API 的顶层承载,依赖支持该 API 的浏览器;定位采用 `@floating-ui/dom`
299
- 的 offset/flip/shift/size 与打开期间的 autoUpdate,关闭或卸载时清理。外部点击关闭最上层,
300
- Escape 返回当前层入口;焦点移到外部时不抢回焦点。内容按普通 Tab 顺序访问,菜单键盘规则由消费者提供。
301
- 局部 DOM 控件先处理 Escape;子 `preventDefault()` 表示消费,未消费时只由原 topmost 调用一次既有 `onKeyDown` 并尝试关闭,回调后重核原层,不能同一键再关 parent。单独 `stopPropagation()` 阻断自定义派发,不承诺阻止原生 Dialog 默认取消。正常回焦仍要求成功关闭且 trigger 可用,controlled 拒绝关闭、外部主动转焦和卸载不被强行覆盖;不吞调用方异常。
302
- 定位与限高完成后,仅最上层弹层把内部当前聚焦项滚入可见区域,不移动焦点或滚动外层。
303
- parts 为 `root/panel`,表面、间距与动效归 theme。
304
-
305
- `ChoiceSelect` 在 Popover 上实现自定义单选,原生 `Select` 继续用于系统选择器与多选。
306
- `options` 为 `{ value, label, disabled?, group? }[]`,支持 `defaultValue` 或受控 `value` Signal,
307
- 用 `onValueChange` 接收选择。方向键、Home/End、字符定位、Enter/Space、Escape 和 Tab 可用。
308
- `id` 用于 Field 关联;`name/required/disabled/form` 接到原生表单控件,必填失败阻止提交并聚焦
309
- 触发按钮。错误消息使用浏览器的原生校验文案。重置恢复非受控默认值,受控值仍归调用方。
310
- 主题视觉隐藏原生表单载体;不以 hidden input 冒充 required 校验。不提供自定义多选或异步搜索。
311
- parts 为 `root/trigger/value/indicator/list/group/option/native/validation`。
312
-
313
- - 基础:Button、AddButton、IconButton、Card、Badge、Input、Textarea、Select、Field、
314
- SearchInput、Disclosure、Separator、NavItem、EmptyState。
315
- - 对话框:Dialog、DialogPanel、DialogHeader、DialogActions。
316
- - Chat:ChatFrame、ChatHeader、ChatStatus、ChatConversation、ChatMessageList、ChatMessage、ChatBubble、
317
- ChatMessageActions、ChatComposer、ChatToolCall、ChatAttachments、ChatProcess、ChatSources。
318
- - 图标:统一 Lucide 子集 `Icon` 与 `iconNames`,以及 MeowlandMark、DoodleCat、NotesIcon、TasksIcon、SearchIcon、PlusIcon、
319
- GithubIcon、ExternalArrowIcon。
320
-
321
- 新增组件前先确认它能在两个以上的应用或场景中复用;应用只使用一次的页面组件不要
322
- 为了“提取”而迁入这里。
323
-
324
- `Field` 在只有一个控制子节点且能从 `htmlFor`、`descriptionId` 或 `errorId` 解析关联
325
- 时,会把描述和错误节点的 id 连接到控制节点的 `aria-describedby`,并在有错误时设置
326
- `aria-invalid`。多个控制节点或自定义组合仍由调用方显式传递关联属性。
327
-
328
- `Dialog` 只负责原生 `<dialog>` 的结构、标签关联和 panel/header/actions 分区;打开、关闭、
329
- Escape、焦点返回和提交结果仍由应用控制。它没有仿 Radix 的 context、portal 或 focus trap,
330
- 不要把这些行为默认为组件已经提供。
331
- `DialogPanel header={...}` 与 `Drawer header={...}` 显式组合共享 `PageFrame`,标题和关闭
332
- 同处固定 header,body 是唯一的主滚动区。`DialogPanel as="form"` 保留原生表单归属与提交,
333
- 短内容自然取高,长内容继承宿主 dialog 的最大高度;不扫描 children 猜标题,也不重复计算页头高度。
334
- 消费者将 `DialogHeader` 放进 header 属性,正文与原有末尾动作放进 children;原生窗口、
335
- 取消、草稿及打开方式仍归宿主。正文滚动引用沿公开 `page-frame/body` part 获取。
336
- DialogPanel 在直属 header 与 body 内分配标准留白,保证正文首末控件的焦点轮廓位于其滚动视口内;任意 Child header 使用同一 `spaceSection` 分隔,无 header 时 body 四边取 panel 留白。既有 DialogHeader 组合保持原内容几何,不承诺任意自定义 header 总高不变;没有新增 gap 属性。固定标题、退出与唯一 body 滚动仍分开,任何极小高度都足够阅读不是承诺。原生 Dialog 的打开、取消与 caller 焦点前提不变,主题留白修复不表示所有指针/系统焦点路径均已验证。
337
-
338
- `EmptyState size="compact"` 用于局部空列表或未选内容区域,沿用标题、说明和动作,去掉装饰插图。
339
- 默认 `size="default"` 保留整页空态;加载与失败仍使用各自已有反馈,不改成空态。
340
-
341
- `ChatAttachments` 接收 `items: readonly ChatAttachmentItem[]`,每项包含
342
- `id`、`name`、`url`、`mediaType` 和可选的 `sizeBytes`;`label` 默认是“消息附件”。
343
- 调用方提供 URL,组件不获取数据。图片默认以可访问的新窗口链接和懒加载预览展示,提供 `onPreview` 时改为预览按钮;
344
- 文件链接使用原文件名下载,提供有效大小时显示 B / KB / MB。
345
- 主题通过 `partSelector(chatAttachmentsContract, part)` 使用 `chat-attachments` 的
346
- `root/entry/image/preview/file/icon/details/name/size/previewButton/remove` parts。
347
- 每项可提供 `onRemove`,只有草稿需要移除操作时才传入;上传、删除文件和 URL 生命周期仍归宿主。
348
-
349
- `ChatFrame` 只为直属 `ChatComposer` 提供阅读边距;若 footer、Card 或其他包装容器负责该区域的空间,
350
- 其内部 Composer 使用容器内的自然宽度,不再受到祖先 Frame 的额外收窄与外边距影响。
351
-
352
- `ChatComposer` 的 `hintId` 会把提示节点和输入框通过 `aria-describedby` 关联;`onInput`
353
- 绑定在 textarea 上,`onSubmit` 绑定在外层 form 上。`value` 支持 Signal,`submitDisabled`
354
- 仅禁止提交,适合等待结果时继续编辑;`disabled` 同时禁止编辑与提交。请求状态、已提交快照和
355
- 最新草稿由调用方管理。`attachments` 放待发送材料,`inputLabel` 提供输入名称。
356
- 标准主题把附件、输入、辅助操作和提交组织在同一书写面中。
357
- `layout="inline"` 让短草稿与操作同排,长草稿保持增高;聚焦时显示提示,默认 `stacked` 保留独立工具行。
358
- `layout="hero"` 使用桌面母版空白对话的输入高度。`trailing` 在发送按钮左侧组合 provider、模型等选择入口;
359
- 可传入受控 `ChoiceSelect`,用 `placement="top"`、`align="end"`、`matchTriggerWidth={false}`
360
- 向上展开分组选项。选项来源、当前值与运行配置的实际切换仍由宿主负责。
361
-
362
- `ChatMessage` 管身份、排列与状态,默认在内容中包装 `ChatBubble`,保留原调用方式。
363
- 需要将附件、过程和文字分别展示时,设置 `surface="none"`,自行组合 `ChatBubble` 与其他组件。
364
- Bubble 的 `auto` 通过 Context 读取消息角色,主题决定底色;也可显式选择 `plain` / `filled`。
365
- `header` / `footer` 是补充材料和送达反馈的插槽,业务状态仍由宿主提供。
366
-
367
- `ChatConversation` 是可选的滚动容器,宿主必须提供受约束的高度。
368
- 它在靠近底部时跟随追加内容,上翻时保留位置,并提供返回最新的按钮。
369
- 返回动作在消息视口之后参与正常布局,显示时领取自身高度,隐藏后把空间归还消息;不会浮在历史正文之上。
370
- 它不实现历史前插、逐消息锚点或持久化阅读恢复。不要与应用已有滚动控制器叠加;
371
- Dashboard 继续使用自身控制器。`ChatMessageList` 仍只提供消息记录语义。
372
-
373
- 已有滚动 owner 的宿主可以单用 `ChatConversationLatest`。它是正常流按钮,不安装控制器、不设置定位容器,也不会独自给任意宿主视口分配高度。
374
- 例如下面的 `transcript`、`latestHidden` 与三个回调都来自宿主现有控制器:
275
+ Meowbook's `description-list-composition` shows wide and narrow local containers, long labels and identifiers,
276
+ actions and inputs inside values in one viewport, for checking shared columns, natural reflow, native semantics, and draft continuity; it does not mean a business page has been accepted.
277
+
278
+ `Card` supports CardHeader, CardTitle, CardDescription, CardAction, CardContent, and CardFooter.
279
+ The default `variant="auto"` takes depth from the render tree Context: the standard theme presents the top level as an independent surface and blends descendants into the parent; an explicit variant takes precedence.
280
+ Depth follows the logical component tree, so an overlay does not automatically become a new root just because it visually leaves the parent card; overlay content that needs an independent surface uses surface explicitly.
281
+ Title can specify h2–h6; heading levels are still decided by document structure and are not guessed automatically from card nesting.
282
+ Ordinary internal groups use the shared surface, standalone items can explicitly use `variant="surface"`, and `variant="embedded"` explicitly blends into the parent surface.
283
+ Nesting does not mean borders and shadows must be repeated. Complex content still uses Stack/Inline/Grid layout; do not turn Card into a universal layout component.
284
+
285
+ `FieldGroup` organizes fields with native fieldset/legend and supports disabling the whole group; Field continues to handle association for a single field.
286
+ `AspectRatio ratio={16/9}` controls layout ratio; the caller chooses media object-fit and clipping.
287
+ `Separator` keeps horizontal/vertical separator semantics.
288
+
289
+ `Tabs` uses the required id, label, and items (value/label/content/disabled) to create associated tabs/tabpanels;
290
+ it supports arrow keys, Home/End, a controlled value Signal, and defaultValue. Panels stay mounted when switching, so drafts are not lost.
291
+ `Breadcrumb items` is an array of label/href, and the last item marks the current location.
292
+ `Tooltip` uses `trigger(bindings)` to add text descriptions to named focusable controls; it appears after a mouse delay, appears immediately on keyboard focus,
293
+ and closes on Escape; do not put necessary information or interactive content only in a Tooltip—use Popover for the latter.
294
+ `Alert tone` expresses visual state, and `role` explicitly chooses status/alert; urgency is not inferred from color.
295
+ `Alert layout="bar"` is the compact page-notice form: one line with a status dot, body text and a trailing action; the default `layout="block"` keeps title/body/actions for outcomes that need reading. Use `bar` in `PageFrame`'s notice slot; it is a semantic notice shape, not a device variant.
296
+
297
+ `Skeleton` is an aria-hidden placeholder; the caller provides the content region's aria-busy and loading copy.
298
+ `SkeletonBoundary active={loading} label="Updating details"` applies skeleton presentation to already mounted content;
299
+ `active` accepts a boolean or Signal, and toggling does not unmount children, preserving input drafts and component state.
300
+ While loading, the region is marked aria-busy and its content is inert, and screen readers get the caller-provided loading copy from a status outside the region.
301
+ Focus inside the content is released when loading starts and is not automatically reclaimed when it finishes. Callers should put available actions such as cancel and retry outside the boundary.
302
+ Underneath it uses MeowJSX Web's shared skeleton controller, which uniformly removes detail from text, images, icons, and inputs; this is loading presentation only and does not
303
+ start requests, time anything, or decide completion. When there is no content geometry on first load, the caller still uses `Skeleton` to provide placeholder structure.
304
+ When the host explicitly wires an `observation` hub into the Web renderer, the boundary gets its source from the render tree Context and subscribes to its own
305
+ component subtree; nested boundaries are located by contract and node ownership, not by function name. An ordinary unobserved renderer still uses the local DOM
306
+ approach and does not force the component index on. Both approaches keep supplementary listeners for external DOM and theme changes.
307
+ `Spinner label` provides a readable loading state and does not claim real progress.
308
+
309
+ The native select control `Select` reuses browser option, keyboard, and form semantics and provides a `root` part; the theme decides visuals. It is used both for the Meowbook tool appearance and for scene theme selection. The control keeps native `size` (row count) semantics and does not reuse it as a visual size.
310
+
311
+ `Popover` is a non-modal general overlay; it does not set a menu role or trap focus by default. It requires `id` and
312
+ `trigger(bindings)`; the trigger button exposes the bindings, and content goes in children. It supports `open` Signal / `defaultOpen`,
313
+ `onOpenChange`, `align`, `matchTriggerWidth`, `role`, and `labelledBy`. `triggerId` can associate with an external Field.
314
+ It uses the browser Popover API's top-layer hosting and depends on browsers that support that API; positioning uses `@floating-ui/dom`'s
315
+ offset/flip/shift/size and autoUpdate while open, cleaned up on close or unmount. An outside click closes the topmost layer,
316
+ and Escape returns to the current layer's entry point; focus moved outside is not reclaimed. Content is reached in ordinary Tab order, and menu keyboard rules are provided by the consumer.
317
+ Local DOM controls handle Escape first; a child's `preventDefault()` means consumed, and when unconsumed only the original topmost calls the existing `onKeyDown` once and tries to close, re-checking the original layer after the callback so the same key cannot close the parent. `stopPropagation()` alone blocks custom dispatch and does not promise to prevent native Dialog default cancellation. Normal focus return still requires a successful close and an available trigger; a controlled refusal to close, an external deliberate focus move, and unmount are not forcibly overridden, and caller exceptions are not swallowed.
318
+ After positioning and height limiting, only the topmost overlay scrolls its currently focused internal item into view, without moving focus or scrolling outer layers.
319
+ The parts are `root/panel`; surface, spacing, and motion belong to the theme.
320
+
321
+ `ChoiceSelect` implements custom single selection on Popover; native `Select` continues to serve system pickers and multiple selection.
322
+ `options` is `{ value, label, disabled?, group? }[]`; it supports `defaultValue` or a controlled `value` Signal,
323
+ and `onValueChange` receives selections. Arrow keys, Home/End, character search, Enter/Space, Escape, and Tab work.
324
+ `id` is used for Field association; `name/required/disabled/form` connect to a native form control, and a required failure blocks submission and focuses the
325
+ trigger. Error messages use the browser's native validation copy. Reset restores the uncontrolled default value, and a controlled value still belongs to the caller.
326
+ The theme visually hides the native form carrier; a hidden input is not used to fake required validation. It provides no custom multiple selection or asynchronous search.
327
+ The parts are `root/trigger/value/indicator/list/group/option/native/validation`.
328
+
329
+ - Basics: Button, AddButton, IconButton, MenuButton, Card, Badge, Avatar, Input, NumberInput,
330
+ Textarea, Select, Field, SearchInput, Slider, Progress, Link, Disclosure, Accordion, Table,
331
+ Separator, NavItem, EmptyState.
332
+ - Dialogs: Dialog, DialogPanel, DialogHeader, DialogActions.
333
+ - Chat: ChatFrame, ChatHeader, ChatStatus, ChatConversation, ChatMessageList, ChatMessage, ChatBubble,
334
+ ChatMessageActions, ChatComposer, ChatToolCall, ChatAttachments, ChatProcess, ChatSources.
335
+ - Icons: the finite semantic set `Icon` and `iconNames` sourced from the pinned Lucide dependency, caller-supplied `IconSource` and `IconNode`, and the `meowtail/icons/lucide` pass-through for application icons, plus MeowlandMark, DoodleCat, NotesIcon, TasksIcon, SearchIcon, PlusIcon, GithubIcon, ExternalArrowIcon.
336
+
337
+ Icons outside the semantic set go through `IconSource` with structural `IconNode` data from a trusted source. The pinned pass-through at `meowtail/icons/lucide` re-exports the installed Lucide version, so an application can use any Lucide icon without adding its own icon dependency; JSON surfaces keep only the finite `iconNames` set:
338
+
339
+ ```tsx
340
+ import { IconSource } from "meowtail/icons";
341
+ import { Bell } from "meowtail/icons/lucide";
342
+
343
+ <IconSource source={Bell} size={16} label="Notifications" />;
344
+ ```
345
+
346
+ Before adding a component, confirm it can be reused in more than two applications or scenes; page components used once by an application should not be moved
347
+ here just to "extract" them.
348
+
349
+ When `Field` has a single control child and can resolve association from `htmlFor`, `descriptionId`, or `errorId`, it
350
+ connects the description and error node ids to the control's `aria-describedby` and sets
351
+ `aria-invalid` when there is an error. Multiple control children or custom compositions still require the caller to pass association attributes explicitly.
352
+
353
+ `Dialog` handles only the native `<dialog>` structure, label association, and panel/header/actions partitioning; opening, closing,
354
+ Escape, focus return, and submission results are still controlled by the application. It has no Radix-like context, portal, or focus trap;
355
+ do not assume the component already provides those behaviors.
356
+ `DialogPanel header={...}` and `Drawer header={...}` explicitly compose the shared `PageFrame`, with the title and close
357
+ sharing a fixed header and the body as the only main scroll region. `DialogPanel as="form"` keeps native form ownership and submission;
358
+ short content takes its natural height, and long content inherits the host dialog's maximum height. It does not scan children to guess a title or compute the header height twice.
359
+ Consumers put `DialogHeader` into the header prop and put the body and existing trailing actions into children; the native window,
360
+ cancellation, drafts, and opening method still belong to the host. The body scroll reference is obtained through the public `page-frame/body` part.
361
+ DialogPanel distributes standard whitespace inside its direct header and body, ensuring that focus outlines of the first and last body controls stay within its scroll viewport; an arbitrary Child header separates with the same `spaceSection`, and without a header the body takes panel whitespace on all four sides. The existing DialogHeader composition keeps its original content geometry, and a stable total height is not promised for arbitrary custom headers; no new gap prop was added. The fixed title, exit, and single body scroll remain separate, and it is not promised that any extremely small height is enough to read. Native Dialog opening, cancellation, and caller focus premises are unchanged; the theme whitespace fix does not mean all pointer/system focus paths have been verified.
362
+
363
+ `EmptyState size="compact"` is for a local empty list or an unselected content region, keeping the title, description, and actions while removing decorative artwork.
364
+ The default `size="default"` keeps the full-page empty state; loading and failure still use their existing feedback and do not become empty states.
365
+
366
+ `ChatAttachments` accepts `items: readonly ChatAttachmentItem[]`, where each item has
367
+ `id`, `name`, `url`, `mediaType`, and an optional `sizeBytes`; `label` defaults to "Message attachments".
368
+ The caller provides URLs, and the component does not fetch data. Images are shown by default as accessible new-window links with lazy-loaded previews and become preview buttons when `onPreview` is provided;
369
+ file links download with the original file name and show B / KB / MB when a valid size is available.
370
+ The theme uses the `root/entry/image/preview/file/icon/details/name/size/previewButton/remove` parts of `chat-attachments`
371
+ through `partSelector(chatAttachmentsContract, part)`.
372
+ Each item can provide `onRemove`, passed only when a draft needs a remove action; upload, file deletion, and URL lifecycles still belong to the host.
373
+
374
+ `ComposerPanel` composes one `ChatComposer` and an optional page-level meta row, usually a `MetaRow`. It refines the same internal writing surface rather than wrapping the whole form in a second surface. Draft, actions, submission and the external supporting hint stay in `ChatComposer`. Narrow composition stays with `ChatComposer`'s own layout and the page/footer edge; the panel has no device variant.
375
+
376
+ `ChatFrame` provides reading margins only for a direct `ChatComposer`; if a footer, Card, or other wrapper container owns that region's space,
377
+ the Composer inside uses its natural width within that container and is no longer narrowed or margined by an ancestor Frame.
378
+
379
+ `ChatComposer`'s `hintId` associates the hint node with the input through `aria-describedby`;
380
+ `onInput` is bound on the textarea and `onSubmit` on the outer form. `value` supports Signals, and
381
+ `submitDisabled` only prevents submission, which suits continued editing while waiting for a result; `disabled` prevents both editing and submission.
382
+ Request state, submitted snapshots, and the latest draft are managed by the caller. `attachments` holds materials to send, and `inputLabel` provides the input name.
383
+ The form groups a writing `surface` and its supporting `hint`. Attachments, input and actions stay inside the surface; the hint follows outside its rounded edge and focus outline, associated with the textarea by `hintId`. Page-level metadata follows the whole composer.
384
+ `surface="none"` removes only the internal writing surface's chrome and padding for explicit bare embedding; it does not move the hint back inside a surface.
385
+ `layout="inline"` puts short drafts and actions on the same row, and long drafts keep growing; its external hint appears on focus. The default `stacked` keeps the tool row at the bottom of the writing surface. On narrow screens, attach/input/send share the writing row and model selection sits below it; the supporting hint remains outside the surface and wraps. The `hero` hint retains its visually hidden presentation.
386
+ `layout="hero"` uses the input height of the desktop master blank conversation. `trailing` composes selection entry points such as provider and model to the left of the send button;
387
+ a controlled `ChoiceSelect` can be passed, expanding grouped options upward with `placement="top"`, `align="end"`, and `matchTriggerWidth={false}`.
388
+ Option sources, current values, and the actual switching of runtime configuration are still the host's responsibility.
389
+
390
+ `ChatMessage` handles identity, arrangement, and state, wrapping `ChatBubble` around content by default and keeping the original call style.
391
+ To show attachments, processes, and text separately, set `surface="none"` and compose `ChatBubble` with other components yourself.
392
+ Bubble's `auto` reads the message role through Context and the theme decides the background; `plain` / `filled` can also be chosen explicitly.
393
+ `header` / `footer` are slots for supplementary material and delivery feedback, and business state still comes from the host.
394
+
395
+ `ChatConversation` is an optional scroll container, and the host must provide a constrained height.
396
+ It follows appended content when near the bottom, keeps position when scrolled up, and provides a return-to-latest button.
397
+ The return action participates in normal layout after the message viewport, claiming its own height when shown and returning the space to messages when hidden; it never floats above historical body text.
398
+ It does not implement history prepending, per-message anchors, or persisted reading restoration. Do not stack it on top of an existing application scroll controller;
399
+ the Dashboard keeps using its own controller. `ChatMessageList` still provides only message-record semantics.
400
+
401
+ A host that already has a scroll owner can use `ChatConversationLatest` alone. It is a normal-flow button that installs no controller, sets no positioning container, and does not allocate height to an arbitrary host viewport on its own.
402
+ For example, the following `transcript`, `latestHidden`, and three callbacks all come from the host's existing controller:
375
403
 
376
404
  ```tsx
377
405
  import { h } from "meowjsx";
@@ -383,7 +411,7 @@ import { ChatMessageList, ChatConversationLatest } from "meowtail/chat";
383
411
  grow
384
412
  basis={0}
385
413
  role="region"
386
- aria-label="消息阅读区"
414
+ aria-label="Message reading area"
387
415
  tabIndex={0}
388
416
  style={{ overflowY: "auto", overflowAnchor: "none" }}
389
417
  ref={connectTranscriptViewport}
@@ -395,39 +423,40 @@ import { ChatMessageList, ChatConversationLatest } from "meowtail/chat";
395
423
  </Stack>;
396
424
  ```
397
425
 
398
- 父容器必须提供有限高度;上例的 LayoutItem 是唯一滚动视口,按钮是它的兄弟项。
399
- 宿主负责读取位置、显隐、追加跟随与保位;`returnToLatest` 应滚到末端,并以 `preventScroll` 将焦点交回该视口再隐藏动作。
400
- 不要把片段改成绝对定位后期待它自动避让正文,也不要靠消息末端 padding 或设备偏移量保护历史中段。
426
+ The parent container must provide a finite height; the LayoutItem in the example is the only scroll viewport, and the button is its sibling.
427
+ The host handles reading position, show/hide, append following, and holding position; `returnToLatest` should scroll to the end, hand focus back to that viewport with `preventScroll`, and then hide the action.
428
+ Do not turn the snippet into absolute positioning and expect it to avoid the body automatically, and do not protect the middle of history with message-end padding or device offsets.
401
429
 
402
- `SearchInput` 提供搜索图标与原生 search input 的共同外壳,`label` 是必需的可访问名称。
403
- `className` 作用于外壳,`inputClassName` 作用于输入;`id/name/value/disabled/readOnly/aria-*`
404
- 及事件都传给 input,保留 Field 的说明和错误关联。筛选、提交与结果状态仍由消费者负责。
405
- parts 为 `root/icon/control`,默认表面、焦点和错误边界由 theme 决定。
430
+ `SearchInput` provides a shared shell with a search icon and a native search input; `label` is the required accessible name.
431
+ `className` applies to the shell and `inputClassName` to the input; `id/name/value/disabled/readOnly/aria-*`
432
+ and events all pass to the input, keeping Field descriptions and error associations. Filtering, submission, and result state remain the consumer's responsibility.
433
+ The parts are `root/icon/control`, and the theme decides the default surface, focus, and error boundary.
406
434
 
407
- `PathPicker` 组合受控路径输入与可选的浏览按钮。调用方提供 `value/onValueChange`、
408
- 可访问名称 `label`,以及返回路径或 `null`(取消)的异步 `onChoose`;`kind="file" | "directory"`
409
- 只确定按钮文字,实际选择能力由宿主注入。不提供 `onChoose` 时仍可手动输入。
410
- 组件负责等待、失败反馈与卸载后忽略结果;在途时暂时锁定输入,父值或禁用/只读状态变化后不写回旧选择。
411
- 选择只填写路径,不读取文件、上传文件或授予访问权限。说明、校验与保存仍归调用方。
435
+ `PathPicker` composes a controlled path input with an optional browse button. The caller provides `value/onValueChange`,
436
+ the accessible name `label`, and an async `onChoose` that returns a path or `null` (canceled); `kind="file" | "directory"`
437
+ only determines the button text, and the host injects the actual selection capability. Without `onChoose`, manual entry still works.
438
+ The component handles waiting, failure feedback, and ignoring results after unmount; it temporarily locks the input while in flight and does not write back an old selection after the parent value or disabled/read-only state changes.
439
+ Choosing only fills in the path; it does not read files, upload files, or grant access. Descriptions, validation, and saving remain the caller's responsibility.
412
440
 
413
- `Disclosure` 使用原生 details/summary,接收 `summary: Child` 与内容 children,支持
414
- `open/name/onToggle` 等原生属性。`summaryClassName`、`contentClassName` 用于宿主布局;
415
- parts 为 `root/summary/icon/content`。它不维护另一份展开状态,也不是多项 Accordion。
441
+ `Disclosure` uses native details/summary, accepts `summary: Child` and content children, and supports
442
+ `open/name/onToggle` and other native attributes. `summaryClassName` and `contentClassName` are for host layout;
443
+ the parts are `root/summary/icon/content`. `Accordion` groups several Disclosures, with `type="single"` or
444
+ `type="multiple"`, and still does not own business content.
416
445
 
417
- ## 标准主题(meowtail/theme)
446
+ ## Standard theme (meowtail/theme)
418
447
 
419
- 标准主题导出 `standardTheme`、`standardOptions` 和类型化的 `uiTokens`。只读 `standardThemeTokens`、`standardThemeStyles` 是主题组装原件,供 MeowSlides 等扩展主题复用同一 token/fragment 对象;它们不安装组件或操作 DOM。token 与样式
420
- 都由 TypeScript 定义;组件通过稳定的 part 标记与样式选项匹配 CSS,不再由主题插件
421
- 生成视觉类名。完整设计见 TypeScript token 与参数化配置(原产品仓库历史参考)。
448
+ The standard theme exports `standardTheme`, `standardOptions`, and typed `uiTokens`. The read-only `standardThemeTokens` and `standardThemeStyles` are theme assembly primitives that let extended themes such as MeowSlides reuse the same token/fragment objects; they do not install components or touch the DOM. Tokens and styles
449
+ are both defined in TypeScript; components match CSS through stable part markers and style options, and theme plugins no longer generate
450
+ visual class names. See TypeScript tokens and parameterized configuration (historical reference in the original product repository) for the complete design.
422
451
 
423
- 样式文件统一采用 `<职责>.styles.ts`,标准主题按组件与对话职责分组,应用样式随应用模块维护。
424
- 命名、组件族边界与层叠整理见样式文件组织(原产品仓库历史参考)。
425
- 现有样式已按此规范迁移,历史对话覆写已并回消息与输入框负责文件。
452
+ Style files use `<responsibility>.styles.ts`; the standard theme groups them by component and conversation responsibility, and application styles are maintained with application modules.
453
+ See the style file organization (historical reference in the original product repository) for naming, component family boundaries, and cascade organization.
454
+ Existing styles have been migrated to this specification, and historical conversation overrides have been merged back into the files owned by messages and the composer.
426
455
 
427
- ### 组件安装与样式交付
456
+ ### Component installation and style delivery
428
457
 
429
- 组件安装和样式加载是两个明确的步骤。`createMeowUI()` 注册组件及样式属性适配器;
430
- `standardTheme.cssText` 提供包含变量声明和组件规则的完整 CSS。动态宿主可以这样组装:
458
+ Component installation and style loading are two explicit steps. `createMeowUI()` registers components and style prop adapters;
459
+ `standardTheme.cssText` provides the complete CSS with variable declarations and component rules. A dynamic host can assemble it like this:
431
460
 
432
461
  ```tsx
433
462
  import { createRuntime, h } from "meowjsx";
@@ -444,53 +473,52 @@ const removeTheme = applyTheme(
444
473
  standardTheme,
445
474
  standardOptions.select({ scheme: "light" }),
446
475
  );
447
- const mounted = web.render(<Button variant="quiet">取消</Button>, container);
476
+ const mounted = web.render(<Button variant="quiet">Cancel</Button>, container);
448
477
 
449
- // 宿主销毁时:
478
+ // When the host is destroyed:
450
479
  mounted.unmount();
451
480
  removeTheme();
452
481
  removeStyles();
453
482
  ```
454
483
 
455
- 使用 defaultRuntime 时调用 `installMeowUI(defaultRuntime)`,并让初次渲染和动态控件
456
- 使用同一个 runtime。无需另外安装标准主题插件。样式属性的合法值、默认值和承载 part
457
- 由组件 contract 的 `defineStyleProps` 声明;适配器负责消费属性,避免将 variant 等
458
- 样式选项当作普通 DOM 属性透传。`ThemedProps` 提供联合类型及 Signal 输入;组件沿用
459
- 开放的原生 Props,因此不承诺拒绝所有未知属性。
484
+ When using defaultRuntime, call `installMeowUI(defaultRuntime)` and use the same runtime for the initial render and dynamic controls.
485
+ No separate standard theme plugin needs to be installed. Valid values, defaults, and carrying parts for style props
486
+ are declared by the component contract's `defineStyleProps`; the adapter consumes the props so style options such as variant are not passed through as ordinary DOM attributes.
487
+ `ThemedProps` provides union types and Signal inputs; components keep open native Props and therefore do not promise to reject all unknown attributes.
460
488
 
461
- 静态宿主在构建时组合 `standardTheme.cssText` 与应用 CSS,写出 `.css` 文件并由 HTML
462
- 加载,同时通过 `themeAttributes(standardTheme, config)` 输出根属性。样式在客户端
463
- JavaScript 执行前即可加载。Dashboard 和 Meowbook 使用这条交付路径;
464
- 动态预览使用 `mountStyles(document, cssText)`,由宿主持有返回的清理函数。
465
- 源码不维护 `.css` 文件,生成的 CSS 仍是浏览器资源。模块导入本身不访问 DOM,
466
- `mountStyles` 不负责跨调用去重,宿主应在文档或应用生命周期内组装一次。
489
+ A static host composes `standardTheme.cssText` with application CSS at build time, writes a `.css` file loaded by HTML,
490
+ and outputs root attributes through `themeAttributes(standardTheme, config)`. Styles can load before client-side
491
+ JavaScript runs. The Dashboard and Meowbook use this delivery path;
492
+ dynamic previews use `mountStyles(document, cssText)`, with the host holding the returned cleanup function.
493
+ Source code maintains no `.css` files, and generated CSS is still a browser asset. Module imports themselves do not access the DOM;
494
+ `mountStyles` does not deduplicate across calls, so the host should assemble once within the document or application lifecycle.
467
495
 
468
- ### 根配置与局部覆盖
496
+ ### Root configuration and local overrides
469
497
 
470
- `standardOptions` 内置 scheme,当前标准主题默认 `auto`,支持 light/dark/auto。
471
- 标准视觉以 DeepSeek Harness 为基准:系统字体、正文 14px、辅助 12px、标题 16px;按钮
472
- small/default/large 使用 28/36/44px,输入框默认 32px。控件、菜单和大面板分别使用对应的
473
- 圆角与材质,应用从同一语言组合页面。参考来源与许可证见 [第三方说明](THIRD_PARTY_NOTICES.md),
474
- 实施范围及尚未完成的验证见 迁移记录(原产品仓库历史参考)。
498
+ `standardOptions` has a built-in scheme; the current standard theme defaults to `auto` and supports light/dark/auto.
499
+ The standard visuals use DeepSeek Harness as their baseline: system fonts, 14px body, 12px supporting text, and 16px titles; buttons
500
+ use 28/36/44px for small/default/large, and inputs default to 32px. Controls, menus, and large panels use their corresponding
501
+ radii and materials, and applications compose pages from the same language. See [third-party notices](THIRD_PARTY_NOTICES.md) for reference sources and licenses,
502
+ and the migration record (historical reference in the original product repository) for the implementation scope and verification not yet finished.
475
503
 
476
504
  ```tsx
477
505
  import { Theme } from "meowcss/web";
478
506
 
479
507
  <Theme theme={standardTheme} config={standardOptions.select({ scheme: "dark" })}>
480
- <Button>保存</Button>
508
+ <Button>Save</Button>
481
509
  <Theme config={standardOptions.select({ scheme: "light" })}>
482
510
  <Preview />
483
511
  </Theme>
484
512
  </Theme>;
485
513
  ```
486
514
 
487
- `Theme` 只绑定配置,不加载 CSS。局部 config 省略的维度继承父级;移除局部选择恢复
488
- 继承,组件实例和草稿不需要重建。已有 DOM 根使用 `applyTheme`,静态 HTML 使用
489
- `themeAttributes`,三者共享属性语义。不要为每套主题创建新的 Theme 组件。
515
+ `Theme` binds configuration only and does not load CSS. Dimensions omitted from a local config inherit from the parent; removing a local selection restores
516
+ inheritance, and component instances and drafts do not need rebuilding. Existing DOM roots use `applyTheme`, static HTML uses
517
+ `themeAttributes`, and the three share attribute semantics. Do not create a new Theme component for each theme.
490
518
 
491
- ### 样式与组件选项
519
+ ### Styles and component options
492
520
 
493
- 普通 CSS 保持模板形式;token 与 part 在 TypeScript 中引用,避免手写生成后的名称:
521
+ Ordinary CSS keeps the template form; tokens and parts are referenced in TypeScript to avoid hand-writing generated names:
494
522
 
495
523
  ```ts
496
524
  import { buttonContract, buttonOptions } from "meowtail";
@@ -507,26 +535,26 @@ const applicationStyles = css`
507
535
  `;
508
536
  ```
509
537
 
510
- 宿主显式按标准主题、应用基础、应用覆写的顺序组合 CSS。hover、focus、媒体查询与动画
511
- 继续由 CSS 执行;原生状态用原生属性匹配,组件样式选项使用 `when`。`className` 和
512
- `style` 保留为应用扩展入口,业务布局不进入标准主题。
538
+ The host explicitly composes CSS in the order of standard theme, application base, and application overrides. hover, focus, media queries, and animation
539
+ continue to be handled by CSS; native states match on native attributes, and component style options use `when`. `className` and
540
+ `style` remain application extension entry points, and business layout does not enter the standard theme.
513
541
 
514
- 自定义 token 使用 `defineTokens`,通过 `defineTheme` 一次组合选项、完整默认值、token
515
- 集合和 CSS 片段。组件绑定从片段中的 typed part 引用取得;不要提前将片段转成字符串而
516
- 丢失这些信息。无默认值的测量变量使用 `tokenRef`,通过 `.name` 交给 `setProperty`。
517
- 纯生成与 typed adapter 的写法和作用域边界见 [MeowCSS](../meowcss/README.md)。
542
+ Custom tokens use `defineTokens`, and `defineTheme` composes options, complete defaults, token
543
+ sets, and CSS fragments in one call. Component bindings come from typed part references in the fragment; do not convert the fragment to a string early and
544
+ lose that information. Measurement variables without defaults use `tokenRef`, whose `.name` is passed to `setProperty`.
545
+ See [MeowCSS](../meowcss/README.md) for pure generation and typed adapter usage and scope boundaries.
518
546
 
519
- 构建并安装本地包后,从仓库根运行 `bunx --no-install meowbook serve --config packages/meowtail/meowbook.config.ts`
520
- 打开组件场景,核对明暗、桌面与窄屏、输入草稿和状态切换。尺寸是 Web 适配,
521
- 当前视觉基准见上述 DeepSeek 迁移记录;设计判断与打磨方法见
522
- meow-design(原产品仓库历史参考),其历史探索配方不作为标准主题规范。
547
+ After building and installing the local package, run `bunx --no-install meowbook serve --config packages/meowtail/meowbook.config.ts` from the repository root to
548
+ open component scenes and check light/dark, desktop and narrow screens, input drafts, and state switching. Sizes are Web adaptations;
549
+ see the DeepSeek migration record above for the current visual baseline. See meow-design (historical reference in the original product repository)
550
+ for design judgment and polishing methods; its historical exploration recipes are not the standard theme specification.
523
551
 
524
- ### 生命周期扩展
552
+ ### Lifecycle extensions
525
553
 
526
- 静态视觉使用 CSS。只有需要真实 DOM、实例状态、监听或清理时才使用 shadow:
554
+ Static visuals use CSS. Use a shadow only when real DOM, instance state, listeners, or cleanup are needed:
527
555
 
528
556
  ```ts
529
- // Web shadow:context.element 是真实 Element。
557
+ // Web shadow: context.element is a real Element.
530
558
  import { defineShadow } from "meowjsx/web";
531
559
 
532
560
  runtime.use({
@@ -553,24 +581,24 @@ runtime.use({
553
581
  });
554
582
  ```
555
583
 
556
- 集中注册,不生成包装组件。shadow 与组件共享 signal/effect/onCleanup 生命周期 API。
557
- 插件卸载阻止后续应用;现有元素的实例清理由其 mount 的 unmount 负责。不要用
558
- renderToHtml + innerHTML 代替需要生命周期的浏览器挂载。
559
-
560
- ### 文件与验证
561
-
562
- - `meowcss`:通用 token/选项/CSS 生成;`meowcss/meowjsx` 负责 typed parts 与自动 carrier;`meowcss/web` 负责 DOM 主题生命周期,详见 [MeowCSS](../meowcss/README.md)。
563
- - `src/theme/tokens.ts`、`palette.ts`:共享参数与语义色板。
564
- - `src/theme/base.styles.ts` 与 `components/chat/icons/shared` 下的 `*.styles.ts`:按职责编写的 CSS 模板;
565
- 专属高亮 token 在 `shared/code-highlight.tokens.ts`。
566
- - `src/theme/index.ts`:标准主题的显式组装与公共导出。
567
- - `bun test packages/meowtail/tests/unit`:组件与标准主题合同;通用 token/选项合同在 MeowCSS 测试中验证。
568
- - `tsc --noEmit --project packages/meowtail/tsconfig.json`:检查实现、展示场景、浏览器测试和
569
- `tests/types/` 的公共类型合同;类型用例不由 Bun 执行。
570
- - `tests/browser/theme/parameterized-theme.spec.ts`:参数化主题、局部覆盖及真实组件组合回归,针对
571
- `tests/fixtures/theme-prototype-demo.tsx` 与 `tests/fixtures/real-controls-demo.tsx` 的独立测试场景,
572
- 由本包 Playwright 专用测试配置加载,不进入组件 gallery。
573
- - Rossovia 的 Dashboard 组合验证仍由产品仓库维护,不是本库的可运行命令;库内不保留依赖产品 checkout 的测试。
574
-
575
- 浏览器验收覆盖对应场景,不能用类型或构建通过替代。组件注册必须作用于实际渲染的
576
- runtime;需要生命周期的内容使用 render 挂载,而非 HTML 字符串插入。
584
+ Register centrally; do not generate wrapper components. A shadow shares the signal/effect/onCleanup lifecycle API with components.
585
+ Plugin uninstall blocks later application; instance cleanup for existing elements is handled by the unmount of their mount. Do not use
586
+ renderToHtml + innerHTML instead of browser mounting that needs a lifecycle.
587
+
588
+ ### Files and verification
589
+
590
+ - `meowcss`: shared token/option/CSS generation; `meowcss/meowjsx` handles typed parts and automatic carriers; `meowcss/web` handles the DOM theme lifecycle. See [MeowCSS](../meowcss/README.md).
591
+ - `src/theme/tokens.ts`, `palette.ts`: shared parameters and semantic palettes.
592
+ - `src/theme/base.styles.ts` and the `*.styles.ts` files under `components/chat/icons/shared`: CSS templates written by responsibility;
593
+ highlight-specific tokens live in `shared/code-highlight.tokens.ts`.
594
+ - `src/theme/index.ts`: explicit assembly and public exports of the standard theme.
595
+ - `bun test packages/meowtail/tests/unit`: component and standard theme contracts; shared token/option contracts are verified in MeowCSS tests.
596
+ - `tsc --noEmit --project packages/meowtail/tsconfig.json`: typechecks the implementation, showcase scenes, browser tests, and
597
+ public type contracts in `tests/types/`; type cases are not run by Bun.
598
+ - `tests/browser/theme/parameterized-theme.spec.ts`: parameterized theme, local override, and real component composition regressions, targeting
599
+ the standalone test scenes in `tests/fixtures/theme-prototype-demo.tsx` and `tests/fixtures/real-controls-demo.tsx`,
600
+ loaded by this package's dedicated Playwright test config and not part of the component gallery.
601
+ - Dashboard composition verification for Rossovia is still maintained by the product repository and is not a runnable command in this library; the library keeps no tests that depend on a product checkout.
602
+
603
+ Browser acceptance covers the corresponding scenes and cannot be replaced by passing types or build. Component registration must apply to the runtime that actually renders;
604
+ content that needs a lifecycle is mounted with render rather than inserted as an HTML string.