odui-build

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Build an Open Design UI component

构建 Open Design UI 组件

Read AGENTS.md, the component guide, the shared design system and the registry before editing.
  1. Start with the real use case. Define the states, keyboard behavior, accessible contract, responsive behavior and token roles before writing the recipe.
  2. Change the control source in
    packages/open-design-ui
    . Add the component source, registry item, interactive example, API notes and a real Studio consumer in the same change. Use the
    open-design-ui/*
    alias from the registry.
  3. Register a new control as
    adoption.mode: "opt-in"
    with a review condition. Keep it optional until one representative Studio use case is verified. Change to
    enforced
    only when the native rule and baseline are updated in the same change.
  4. Keep feature data, domain validation and persistence in the consumer. The component owns shared visual states and interaction mechanics.
  5. Run
    npm run design:check
    ,
    npm run components:build
    ,
    npm run typecheck:studio
    and focused consumer tests. Use
    odui-dev
    to inspect both themes, keyboard states and the narrow layout.
A component is ready for review only when its preview, registry entry, real consumer and verification evidence are present.
编辑前,请阅读 AGENTS.md、组件指南、共享设计系统 和 registry。
  1. 从真实使用场景出发。在编写 recipe 前,先定义状态、键盘行为、无障碍契约、响应式行为和 token 角色。
  2. 修改
    packages/open-design-ui
    中的控件源码。在同一次变更中添加组件源码、registry 条目、交互式示例、API 说明和真实的 Studio 使用方。使用 registry 中的
    open-design-ui/*
    alias。
  3. 将新控件注册为
    adoption.mode: "opt-in"
    ,并设置审查条件。在一个具有代表性的 Studio 使用场景得到验证之前,保持其为可选状态。仅当同一次变更中同时更新原生规则和基线时,才能将其改为
    enforced
    。
  4. 将功能数据、领域验证和持久化逻辑保留在使用方中。组件负责共享的视觉状态和交互机制。
  5. 运行
    npm run design:check
    、
    npm run components:build
    、
    npm run typecheck:studio
    和聚焦的使用方测试。使用
    odui-dev
    检查两种主题、键盘状态和窄屏布局。
只有在预览、registry 条目、真实使用方和验证证据均已就绪时,组件才能进入审查阶段。