Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
929799b
fix: 为兼容 cpp 版本做的暂时性的牺牲改动 (#3325)
xiaoyatong Aug 7, 2025
7ee836a
Merge branch 'feat_v3.x' into feat_v3.x_cpp
xiaoyatong Aug 15, 2025
94c5073
chore: 升级版本号
xiaoyatong Aug 20, 2025
5dfd20f
feat(popup): 增加上下滑动修改高度
xiaoyatong Aug 20, 2025
bd12ee6
feat: 合并popup功能
xiaoyatong Aug 21, 2025
e47d0d4
feat(popup): 添加自定义顶部
xiaoyatong Aug 21, 2025
e7a4b1f
fix(input): taro 下只读可以点击
xiaoyatong Aug 21, 2025
75057e6
feat(popup): 增加一些新属性,顺便解决了下input的只读无法点击、焦点等问题 (#3342)
xiaoyatong Aug 21, 2025
7da9642
chore: 升级版本号
xiaoyatong Aug 29, 2025
08e97b5
feat: 新样式变量值更新,修订dialog暗黑问题
xiaoyatong Sep 3, 2025
3da0ec6
chore: 修改版本号
xiaoyatong Sep 20, 2025
e90b2b2
feat(popup): 增加top属性,支持自定义节点,,且不popup高度
xiaoyatong Sep 20, 2025
3cbfe75
chore: 修改版本号
xiaoyatong Sep 20, 2025
88462db
feat: 合并3.x 分支
xiaoyatong Sep 29, 2025
8ce8c51
Feat v3 cpp td (#3364)
xiaoyatong Sep 29, 2025
68c851b
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
32b4cea
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
4e6df5d
feat: 修订button在安卓下的问题
xiaoyatong Oct 3, 2025
cf0553a
fix(noticebar): 获取rect异常时不处理
xiaoyatong Oct 4, 2025
1509b39
feat(noticebar): 增加自定义children时的样式,重构部分代码
xiaoyatong Oct 5, 2025
710afd9
feat(input): 去掉lineheight
xiaoyatong Oct 5, 2025
2be0323
feat(checkbox): 增加选中态自定义类名
xiaoyatong Oct 5, 2025
2379441
fix: dialog规范及toast ios和安卓适配问题修订
xiaoyatong Oct 9, 2025
e7f84cc
fix(dialog): 适配ios和安卓,动效暂时屏蔽
xiaoyatong Oct 10, 2025
7054cee
fix(noticebar): 增加ref id
xiaoyatong Oct 13, 2025
93c518f
feat(dialog): demo
xiaoyatong Oct 13, 2025
1b997a4
fix: 去掉不支持的样式
xiaoyatong Oct 13, 2025
23dba7a
fix: 回跨不兼容样式处理
xiaoyatong Oct 14, 2025
0354507
fix: 回跨不兼容样式处理,不能暴露~~
xiaoyatong Oct 14, 2025
dadca5b
fix: setTimeout 改调 Taro.nextTick 调用,保证rect能够获取成功 (#3369)
aniwei Oct 15, 2025
77ae33b
feat: 修订 toast 鸿蒙下折行问题,noticebar 获取宽度问题
xiaoyatong Oct 15, 2025
01a2bca
fix: ios/安卓不支持属性增加判断
xiaoyatong Oct 21, 2025
3d88959
feat: dialog 底部按钮增加角标展示
xiaoyatong Oct 24, 2025
075b551
fix: hack 动效 tabs 安卓
xiaoyatong Oct 24, 2025
884d3bc
Feat v3.x aria (#3387)
yangyanAurora Nov 14, 2025
b66439e
feat: 无障碍类型检测屏蔽
xiaoyatong Nov 14, 2025
e9f4a44
fix: 无需处理容器维度,系统会无法读取内部的文字
xiaoyatong Nov 17, 2025
83a322d
fix(dialog): 先不处理
xiaoyatong Dec 15, 2025
5be70c6
fix: 修正steps组件taro版标签& price多端结构统一 (#3404)
irisSong Dec 18, 2025
4de9c79
chore: 升级版本号
xiaoyatong Dec 25, 2025
a73366f
feat(popup): 支持自定义外层display属性 (#3414)
irisSong Jan 4, 2026
233d247
chore: 升级版本号
irisSong Jan 4, 2026
c2cea0d
chore: 升级版本号
irisSong Jan 8, 2026
b015f28
fix: 去掉没有使用的方法
xiaoyatong Jan 9, 2026
76a1ab1
Merge branch 'feat_v3.x_cpp' of https://github.com/jdf2e/nutui-react …
xiaoyatong Jan 9, 2026
81bbc29
Merge branch 'feat_v3.x' into feat_v3.x_cpp
xiaoyatong Jan 9, 2026
30a9d8d
fix: 修复checkbox和radio的规范,默认背景色为白色
xiaoyatong Jan 9, 2026
27587a8
fix: toast 在ios 和安卓上样式处理
xiaoyatong Jan 9, 2026
aa93ce5
chore: 升级版本号
xiaoyatong Jan 9, 2026
a8216d3
chore: 多语言文件更新
irisSong Jan 9, 2026
2dd7a86
fix: 修改input色值
xiaoyatong Jan 14, 2026
90f58e9
Merge branch 'feat_v3.x_cpp' of https://github.com/jdf2e/nutui-react …
xiaoyatong Jan 14, 2026
4e95e08
feat: 无障碍能力添加,toast 和 checkbox
xiaoyatong Jan 14, 2026
4e7bd66
feat(input): 新增属性支持 input 的 style 设置
xiaoyatong Jan 14, 2026
bad68b7
feat(input): 更新文档
xiaoyatong Jan 14, 2026
4a39d64
feat(radio): 无障碍处理
xiaoyatong Jan 14, 2026
f2d3dba
feat: 到家色值
xiaoyatong Jan 14, 2026
85b4d47
chore: 升级icon库版本
xiaoyatong Jan 21, 2026
dff9239
fix: 安卓下box-shadow 表现异常修复
xiaoyatong Jan 21, 2026
2c29d7b
fix: taro方法兼容鸿蒙\安卓\ios
xiaoyatong Jan 21, 2026
a290d24
chore: 升级版本号
xiaoyatong Jan 21, 2026
d232325
chore: 更新版本号
irisSong Jan 21, 2026
0a4eda4
fix: 恢复原有功能
xiaoyatong Feb 2, 2026
ad75225
fix(popup): 适配大屏样式重置
xiaoyatong Feb 5, 2026
ca395cf
fix(popup): title 不再设置line-height
xiaoyatong Feb 5, 2026
c55bce0
feat(popup): 增加taro下hooks的动效实现方法
xiaoyatong Feb 10, 2026
0548a8f
feat(popup): 增加taro下hooks的动效实现方法
xiaoyatong Feb 10, 2026
fd954f2
chore: 增加到家主题
xiaoyatong Feb 10, 2026
24836a5
feat(QuickEnter): 增加快捷入口组件
xiaoyatong Mar 5, 2026
c5ace79
fix(quickenter): 动效问题
xiaoyatong Mar 5, 2026
de563f2
fix: 文档\多语言
xiaoyatong Mar 24, 2026
12bd37e
feat(quickenter): 添加样式变量处理
xiaoyatong Mar 27, 2026
fed4f87
fix(dialog): 兼容多字大字等
xiaoyatong Mar 27, 2026
f1c22f9
fix: 回滚popup样式
xiaoyatong Apr 8, 2026
8dc258e
feat: 新增白皮书,ai助手
xiaoyatong Apr 21, 2026
d19986c
feat: 增加无障碍处理
xiaoyatong Apr 22, 2026
0539892
fix(navbar): 添加无障碍
xiaoyatong Apr 22, 2026
8ca0a87
fix(navbar): 添加无障碍,核心在demo中实现,在组件中基本都是占位,不过多处理无障碍部分
xiaoyatong Apr 22, 2026
b27b48e
fix(avatar): 无障碍支持, taro 端支持 alt
xiaoyatong Apr 22, 2026
31f4edb
feat(progress): 适配无障碍,全部透传到progress主节点
xiaoyatong Apr 22, 2026
4d6eb91
feat(tabs): 初步改动无障碍
xiaoyatong Apr 22, 2026
b3de1d8
refactor: 升级icon库版本
xiaoyatong Apr 22, 2026
01eeac2
fix(resultpage): 无障碍适配
xiaoyatong Apr 22, 2026
8a275ea
feat(searchbar): 无障碍
xiaoyatong Apr 22, 2026
452d4ac
feat(popup): 无障碍
xiaoyatong Apr 22, 2026
6cb6fe5
feat(quickenter): 无障碍适配
xiaoyatong Apr 22, 2026
603f50a
fix(quickenter): 修改顶部安全区域
xiaoyatong Apr 22, 2026
9b92463
feat(button): 无障碍适配,类型整合,demo添加
xiaoyatong Apr 23, 2026
7336c55
feat(dialog): 无障碍适配
xiaoyatong Apr 23, 2026
90c5b24
feat(image): 无障碍处理
xiaoyatong Apr 23, 2026
153eaa1
feat(image): 处理图片节点
xiaoyatong Apr 23, 2026
a2867e8
fix: 改引入路径
xiaoyatong Apr 23, 2026
d8aa79e
chore: 京东正黑字体升级到2.3 (#3435)
irisSong Apr 23, 2026
18cd5c5
fix(type): 修复类型导出
xiaoyatong Apr 24, 2026
f78c4c5
fix: 修复类型lint
xiaoyatong Apr 24, 2026
faa4144
Merge branch 'feat_v3.x_cpp' of https://github.com/jdf2e/nutui-react …
xiaoyatong Apr 24, 2026
0e9e8ae
feat: 针对小程序做的性能优化
xiaoyatong Apr 24, 2026
42039d3
docs: 补充文档
xiaoyatong Apr 24, 2026
8ff359c
fix: 版本号\lint处理
xiaoyatong Apr 24, 2026
1567a75
feat(calendarcard): 添加无障碍
xiaoyatong Apr 26, 2026
adeb15d
refactor: 发布版本
xiaoyatong Apr 26, 2026
e9b18e4
fix(Price): 组件传入异常信息直接原样返回 (#3440)
irisSong Apr 27, 2026
b944d0c
feat(price): 增加兜底逻辑
xiaoyatong Apr 27, 2026
e9d440e
chore: release v3.0.19-cpp.28
xiaoyatong Apr 27, 2026
721f05e
fix: calendar文本color继承问题&calendarCard顶部箭头icon替换为Image标签 (#3444)
xiyehutao Apr 29, 2026
7ad4196
feat: 解决calendar中weekend样式优先级问题
xiyehutao Apr 29, 2026
dc4f1e2
feat: 多尺寸适配
irisSong Apr 29, 2026
36d2328
feat(popup): 透传overlay 属性
xiaoyatong May 6, 2026
c4edd65
feat(popup): 增加属性,用于表达是否展示动效
xiaoyatong May 6, 2026
11be1b3
feat: 处理日历在多端表现异常问题,价格兼容更多格式。 (#3452)
xiaoyatong May 7, 2026
402c19c
feat: 增加老年版\大字版处理
irisSong May 7, 2026
1a35d9b
fix: 0px 不转换
irisSong May 8, 2026
1f36f70
style: 样式多尺寸适配
irisSong May 9, 2026
478e924
chore: 合并主分支
irisSong May 9, 2026
5565d44
style: 样式多尺寸适配
irisSong May 9, 2026
45c91f2
feat(swipe): 等比适配
irisSong May 11, 2026
8d8aa9a
chore: 增加等比适配skill
irisSong May 11, 2026
04a3afa
feat: taro和h5统一一套
irisSong May 11, 2026
39f3c9f
style: 更新等比适配组件样式
irisSong May 11, 2026
4d19218
feat: 构建时将组件 SCSS 转换
irisSong May 12, 2026
f3e2b10
chore: 还原部分改动
irisSong May 12, 2026
0dcd2b4
feat: 字体\行高\icon统一处理
irisSong May 12, 2026
e606a0b
feat: 组件图标尺寸治理
irisSong May 12, 2026
607d7c6
feat: 解决build验证
irisSong May 12, 2026
adac537
feat: 本地校验脚本
irisSong May 12, 2026
02c5b05
feat: 本地脚本验证
irisSong May 12, 2026
2d7eac1
style: 基础主题变更
irisSong May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .agents/A11Y-WORKFLOW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# NutUI-React AI 无障碍开发协同指南 (A11Y Workflow)

本指南旨在教开发者如何利用 `.agents/skills-a11y.md` 指令库,驱动 AI 助手自动完成组件的无障碍(A11y)适配。

## 1. 核心原理

AI 助手在加载 `.agents/skills-a11y.md` 后,会自动获得以下“常识”:

- **双端规范**:Web 端用 `aria-xxx` (kebab-case),Taro 端用 `ariaXxx` (CamelCase)。
- **状态绑定**:自动将 `checked/disabled/loading` 映射至 ARIA 属性。
- **视觉去噪**:自动为装饰性图标添加 `aria-hidden` / `ariaHidden`。

## 2. 如何下达指令 (Best Practices)

### 场景 A:新组件开发

**指令建议**:

> “请帮我开发一个新的 `Slider` 组件,并根据 `.agents/skills-a11y.md` 同步实现 Web 和 Taro 的无障碍支持。”

### 场景 B:现有组件重构

**指令建议**:

> “请对比 `.agents/skills-a11y.md` 中的校验清单,审计 `src/packages/xxx/xxx.tsx` 的无障碍实现,并给出重构代码。”

### 场景 C:批量 A11y 检查

**指令建议**:

> “检查当前组件是否在 Taro 环境下正确使用了驼峰式的 `ariaLabel` 而非 `aria-label`。”

## 3. 常见避坑指南

- **Taro 属性丢失**:如果发现 `ariaLabel` 没生效,检查是否在 `View` 标签上透传了 `...rest`。
- **重复 Label**:如果组件已经通过 `children` 渲染了文字,不必再在 `ariaLabel` 中重复,除非是为了给读屏器提供更清晰的上下文。
- **图标隐藏**:不要忘记给所有的辅助性 Icon 加上 `ariaHidden` / `aria-hidden="true"`,否则读屏器会尝试读取图标的 Unicode 字符。

## 4. 验证方式

- **Web 端**:使用 Chrome DevTools 的 `Accessibility` 面板查看 `Accessibility Tree`。
- **Taro 端**:在真机读屏模式(iOS VoiceOver / Android TalkBack)下测试。
139 changes: 139 additions & 0 deletions .agents/skills-a11y.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Agent Skill: NutUI-React Accessibility (A11y) Adaptation

本技能库指导 AI 助手如何根据 NutUI-React 的多端架构(Web & Taro)进行精准的无障碍适配。

## 1. 环境感知与属性规范 (Context & Convention)

AI 必须根据当前编辑的文件后缀切换属性命名风格:

| 平台 | 文件后缀 | 属性格式 | 示例 |
| --- | --- | --- | --- |
| **Web H5** | `*.tsx` | **Kebab-case** | `aria-label`, `aria-disabled` |
| **Taro** | `*.taro.tsx` | **CamelCase** | `ariaLabel`, `ariaDisabled` |

---

## 2. 核心适配规则 (Core Rules)

### 2.1 状态映射逻辑

自动将组件的逻辑状态映射到无障碍状态:

- **选中状态**:
- Web: `aria-checked={checked}`
- Taro: `ariaChecked={checked}`
- **禁用状态**:
- Web: `aria-disabled={disabled || loading}`
- Taro: `ariaDisabled={disabled || loading}`
- **忙碌/加载状态**:
- Web: `aria-busy={loading}`
- Taro: `ariaBusy={loading}`

### 2.2 角色显式声明 (Roles)

交互式容器或承载特定功能的组件必须声明 `role` (Web) 或 `ariaRole` (Taro):

- **Button**: `role="button"` / `ariaRole="button"`
- **Dialog/Popup**: `role="dialog"` / `ariaRole="dialog"` + `aria-modal="true"` / `ariaModal={true}`
- **TabItem**: `role="tab"` / `ariaRole="tab"`

### 2.3 视觉隐藏处理

- **装饰性元素**: Icon、装饰线等对视障用户无意义的元素必须隐藏。
- Web: `aria-hidden="true"`
- Taro: `ariaHidden` (Boolean 属性)

### 2.4 图标治理决策树 (Icon Strategy)

治理图标时,必须识别其在上下文中的角色:

1. **装饰性 (Icon + Text)**:
- **场景**:图标旁边有力所能及的文字说明。
- **规则**:彻底隐藏图标,避免信息重复。
- **实现**:`<Icon aria-hidden="true" />`。
2. **交互式 (Standalone Icon as Button)**:
- **场景**:图标是唯一的点击入口(如关闭按钮、搜索提交)。
- **规则**:**容器承载语义,内部图标隐藏**。
- **实现**:
```tsx
<span role="button" aria-label="搜索" tabIndex={0}>
<Search aria-hidden="true" />
</span>
```
3. **语义化 (Standalone Icon as Status)**:
- **场景**:图标独立表示某种状态(如“成功/失败”徽标)。
- **规则**:图标直接承载语义,**严禁使用 aria-hidden**。
- **实现**:`<Icon aria-label="已完成" />`。

---

## 3. 实现范式 (Implementation Patterns)

### 3.1 Web H5 示例 (`button.tsx`)

```tsx
<button
className={classes}
aria-disabled={disabled || loading}
aria-busy={loading}
aria-label={props['aria-label'] || props.ariaLabel}
>
<div className="nut-button-wrap" aria-hidden="true">
{icon}
<span>{children}</span>
</div>
</button>
```

### 3.2 Taro 示例 (`button.taro.tsx`)

```tsx
<View
className={classes}
ariaRole="button"
ariaDisabled={disabled || loading}
ariaBusy={loading}
ariaLabel={props.ariaLabel}
>
<View className="nut-button-wrap">
<View ariaHidden>{icon}</View>
<View>{children}</View>
</View>
</View>
```

---

## 4. 键盘与焦点管理 (Keyboard & Focus)

- **Tab 键支持**: 确保通过原生标签或 `tabIndex={0}` 使元素可聚焦。
- **Esc 交互**: 弹出层必须支持 Esc 键触发 `onClose`。
- **焦点捕获**: 复杂弹出层(Modal/Drawer)应引导用户使用 `FocusTrap` 逻辑或在文档中提示焦点管理。

## 5. 校验清单 (A11y Reviewer)

AI 在生成的代码中必须自检:

1. [ ] 所有的图片/图标是否有 `alt` 或 `aria-hidden`?
2. [ ] 无文字的按钮是否强制要求了 `aria-label`/`ariaLabel`?
3. [ ] 状态(Disabled/Busy)是否双向绑定到 ARIA?
4. [ ] 弹出层是否设置了 `role="dialog"` 和 `modal` 标记?

## 6. 自动化治理工具 (Automation Tools)

项目提供了一个统一的自动化修复脚本 `scripts/a11y-governance.mjs`,该脚本集成了属性映射、图标隐藏与语法修复功能。

### 脚本功能:

- **图标安全隐藏**: 自动为 Web/Taro 端的图标添加隐藏属性,具备组件识别过滤机制(自动避开 SearchBar 等)。
- **多端属性对齐**: 自动将 `.taro.tsx` 文件中的 `aria-*` 转换为驼峰式规范。
- **语法自动修复**: 修复 JSX 中的语法瑕疵,并保护箭头函数不受损。

### 使用建议:

- 在开展新批次治理前运行:
```bash
/usr/local/bin/node scripts/a11y-governance.mjs
```
- AI 在生成代码时,应参考该脚本的逻辑,确保装饰性图标默认隐藏,交互式图标通过容器承载语义。
- AI 在生成新组件代码时,应参考该脚本的逻辑,确保图标默认携带隐藏属性,除非该图标具有独立的交互功能。
27 changes: 27 additions & 0 deletions .agents/skills/performance_audit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# NutUI-React Performance Audit Skill

## Overview

This skill provides a unified workflow for auditing the performance, footprint, and codebase health of the NutUI-React component library.

## Commands

### `npm run performance:audit`

Executes all associated scripts and generates a Markdown report at `scripts/performance/audit-report.md`.

## Included Audits

1. **Bundle Size Audit**: Calculates individual component file sizes (pre/post-gzip).
2. **Tree-shaking Verification**: Validates the correct elimination of unused code during bundling.
3. **Render Performance Audit**: Checks for unnecessary re-renders in React components.

## When to Run

- **Before major releases**: To ensure no regression in bundle size.
- **Reviewing new components**: To verify they align with the library's performance standards.
- **Refactoring core logic**: To ensure Tree-shaking is not accidentally broken.

## Reporting

The results are output to the terminal in a formatted Markdown table for easy copy-pasting into PR reviews or documentation.
72 changes: 72 additions & 0 deletions .cursor/skills/nutui-build-local-verify/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: nutui-build-local-verify
description: NutUI 比例缩放本地验证——写回 src/packages 下同路径组件 SCSS(跳过 src/packages/**/demo.scss 与 demos);--mirror 写 scale-verify/;不写 build。
disable-model-invocation: true
---

# NutUI Build Local Verify

## 在做什么

**只做一步**:用 `scripts/px-to-scale-px-in-component-scss.cjs` 把组件 SCSS 里裸 `px` 转成 `scale-px` 等,并把结果写回磁盘。

**不扫描、不写入**:**`src/packages/<组件名>/demo.scss`**(各组件目录根下的单文件)、`**/demos/**`、路径中含 **`/demo/`**、测试与快照目录下的 `.scss`(与官方 `build.mjs` 里对 `**/demo.scss` 的 ignore 一致)。

- **默认(就地覆盖)**:对每个匹配的 `.scss`,**读、写都是同一路径**——相对 `src/packages` 的路径不变。例如 `src/packages/actionsheet/actionsheet.scss` 转换后仍写回该文件,不会改到别的目录或改名。
- **`--mirror`**:不写源码;结果写到 **`scale-verify/<与 src/packages 相同的相对路径>`**(例如 `scale-verify/actionsheet/actionsheet.scss`),便于 diff。

之后是否再跑 `pnpm run build`、是否用别的工具核对,由你自行决定;本 skill **不要求** build。

## 覆盖原 SCSS(推荐)

在 **nutui-react 仓库根目录** 执行。**务必先 commit / stash**,用完 `git restore src/packages` 或 `git checkout -- src/packages` 恢复。

若只需还原 **`src/packages/<组件>/demo.scss`**(当前脚本已跳过;若曾被旧版本误改):

```bash
find src/packages -name 'demo.scss' -exec git restore -- {} \;
```

**然后**在仓库根执行验证:

```bash
pnpm run verify-scale
```

等价:

```bash
node .cursor/skills/nutui-build-local-verify/scripts/verify-scale-generation.mjs
```

(`--in-place` / `-i` 与默认等价。)

## 报告

路径:**`scale-verify/report.json`**。覆盖模式下看 `overwriteSource === true`、`changedFileCount`、`changedFiles`。

## 其它命令

```bash
# 删除仓库根下 scale-verify/ 整目录(含 report;不还原已覆盖的 src/packages)
node .cursor/skills/nutui-build-local-verify/scripts/verify-scale-generation.mjs --clean
```

**可选**(只镜像、不覆盖源码):

```bash
pnpm run verify-scale:mirror
```

`--mirror` 与 `--in-place` 不能同时使用。

## 核对清单

- [ ] 覆盖前已 git 可回滚
- [ ] `changedFiles` 抽样无 `scale-px(0px)`、无重复嵌套 `scale-px`
- [ ] `font-size` / `font` 未被误改(转换器会跳过)

## 给用户的一句话结论

- 脚本跑完 + `changedFileCount` + 列 2~3 个 `changedFiles`
- **覆盖的是真实源码**时,验证完用 **git 恢复**
Loading
Loading