📑 Flexible React tabs with overflow, editable items, custom tab bars, and accessible panels.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 2c653445..5b5e6dc8 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,6 +1,7 @@
@rc-component/tabs
Ant Design 生态的一部分。
+
🗂️ React 标签页组件,支持可编辑标签、溢出滚动和自定义渲染。
From c5c61c1bfd94ddab1c72365850dfb8621a4f0b2a Mon Sep 17 00:00:00 2001
From: afc163
Date: Sat, 27 Jun 2026 23:04:03 +0800
Subject: [PATCH 10/29] docs: refine bilingual README branding
---
README.md | 3 +-
README.zh-CN.md | 79 ++++++++++++++++++++++++-------------------------
2 files changed, 40 insertions(+), 42 deletions(-)
diff --git a/README.md b/README.md
index 0eaf54a1..0820a37e 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
@rc-component/tabs
-
Part of the Ant Design ecosystem.
-

+
Part of the Ant Design ecosystem.
📑 Flexible React tabs with overflow, editable items, custom tab bars, and accessible panels.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 5b5e6dc8..1d283341 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,8 +1,7 @@
@rc-component/tabs
-
Ant Design 生态的一部分。
-

-
🗂️ React 标签页组件,支持可编辑标签、溢出滚动和自定义渲染。
+
Ant Design 生态的一部分。
+
📑 React 标签页组件,支持可编辑标签、溢出滚动和自定义渲染。
@@ -19,10 +18,10 @@
## 特性
-- 支持 top, bottom, left, and right tab positions with RTL layouts.
-- Handles overflow with a dropdown operation menu.
-- 支持 editable tabs, extra tab bar content, indicators, and custom tab bars.
-- 提供 semantic `classNames` and `styles` slots for panel and navigation customization.
+- 支持 RTL 布局的顶部、底部、左侧和右侧选项卡位置。
+- 使用下拉操作菜单处理溢出。
+- 支持可编辑选项卡、额外选项卡栏内容、指示器和自定义选项卡栏。
+- 为面板和导航自定义提供语义 `classNames` 和 `styles` 插槽。
## 安装
@@ -44,7 +43,7 @@ const items = [
export default () => ;
```
-Online preview: https://tabs.react-component.vercel.app/
+在线预览:https://tabs.react-component.vercel.app/
## API
@@ -52,46 +51,46 @@ Online preview: https://tabs.react-component.vercel.app/
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| `activeKey` | string | - | Controlled active tab key. |
-| `animated` | boolean \| AnimatedConfig | `{ inkBar: true, tabPane: false }` | Animation config. |
-| `className` | string | - | Additional class name. |
-| `classNames` | `Partial>` | - | Semantic class names. |
-| `defaultActiveKey` | string | - | Initial active tab key. |
+| `activeKey` | string | - | 受控的活动 Tab 键。 |
+| `animated` | boolean \| AnimatedConfig | `{ inkBar: true, tabPane: false }` | 动画配置。 |
+| `className` | string | - | 附加className。 |
+| `classNames` | `Partial>` | - | 语义className。 |
+| `defaultActiveKey` | string | - | 初始活动 Tab 键。 |
| `destroyOnHidden` | boolean | false | Destroy inactive tab panels. |
| `direction` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction. |
-| `editable` | EditableConfig | - | Editable tab configuration. |
-| `getPopupContainer` | `(node: HTMLElement) => HTMLElement` | - | Popup container resolver. |
-| `id` | string | - | Root id. |
+| `editable` | EditableConfig | - | 可编辑标签页配置。 |
+| `getPopupContainer` | `(node: HTMLElement) => HTMLElement` | - | 弹层容器解析器。 |
+| `id` | string | - | 根 ID。 |
| `indicator` | `{ size?: GetIndicatorSize; align?: 'start' \| 'center' \| 'end' }` | - | Indicator size and alignment. |
-| `items` | Tab[] | [] | Tab items. |
-| `locale` | TabsLocale | - | Accessibility locale text. |
-| `more` | MoreProps | - | Overflow dropdown config. |
-| `onChange` | `(activeKey: string) => void` | - | Triggered when active tab changes. |
-| `onTabClick` | `(activeKey, event) => void` | - | Triggered when a tab is clicked. |
-| `onTabScroll` | `({ direction }) => void` | - | Triggered when tab navigation scrolls. |
-| `prefixCls` | string | `'rc-tabs'` | Prefix class name. |
-| `renderTabBar` | RenderTabBar | - | Custom tab bar renderer. |
-| `style` | React.CSSProperties | - | Root style. |
-| `styles` | `Partial>` | - | Semantic styles. |
-| `tabBarExtraContent` | React.ReactNode \| TabBarExtraMap | - | Extra content beside the tab bar. |
-| `tabBarGutter` | number | 0 | Gap between tabs. |
-| `tabBarStyle` | React.CSSProperties | - | Tab bar style. |
+| `items` | Tab[] | [] | 选项卡项目。 |
+| `locale` | TabsLocale | - | 无障碍本地化文本。 |
+| `more` | MoreProps | - | 溢出下拉菜单配置。 |
+| `onChange` | `(activeKey: string) => void` | - | 当活动选项卡更改时触发。 |
+| `onTabClick` | `(activeKey, event) => void` | - | 单击选项卡时触发。 |
+| `onTabScroll` | `({ direction }) => void` | - | 当选项卡导航滚动时触发。 |
+| `prefixCls` | string | `'rc-tabs'` | 前缀className。 |
+| `renderTabBar` | RenderTabBar | - | 自定义标签栏渲染函数。 |
+| `style` | React.CSSProperties | - | 根样式。 |
+| `styles` | `Partial>` | - | 语义化样式。 |
+| `tabBarExtraContent` | React.ReactNode \| TabBarExtraMap | - | 标签栏旁的额外内容。 |
+| `tabBarGutter` | number | 0 | 选项卡之间的间隙。 |
+| `tabBarStyle` | React.CSSProperties | - | 标签栏样式。 |
| `tabPosition` | `'left' \| 'right' \| 'top' \| 'bottom'` | `'top'` | Tab position. |
### Tab
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| `children` | React.ReactNode | - | Tab panel content. |
-| `className` | string | - | Panel class name. |
-| `closable` | boolean | - | Whether the tab can be closed in editable mode. |
-| `closeIcon` | React.ReactNode | - | Custom close icon. |
-| `destroyOnHidden` | boolean | false | Destroy inactive panel. |
-| `disabled` | boolean | false | Disable the tab. |
-| `forceRender` | boolean | false | Render panel before it becomes active. |
-| `key` | string | - | Required unique tab key. |
+| `children` | React.ReactNode | - | 选项卡面板内容。 |
+| `className` | string | - | 面板className称。 |
+| `closable` | boolean | - | 是否可以在可编辑模式下关闭选项卡。 |
+| `closeIcon` | React.ReactNode | - | 自定义关闭图标。 |
+| `destroyOnHidden` | boolean | false | 销毁非活动面板。 |
+| `disabled` | boolean | false | 禁用该选项卡。 |
+| `forceRender` | boolean | false | 在面板变为活动状态之前渲染面板。 |
+| `key` | string | - | 需要唯一的 Tab 键。 |
| `label` | React.ReactNode | - | Tab label. |
-| `style` | React.CSSProperties | - | Panel style. |
+| `style` | React.CSSProperties | - | 面板风格。 |
## 本地开发
@@ -110,8 +109,8 @@ npm run build
npm run prepublishOnly
```
-The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.
+包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。
## 许可证
-@rc-component/tabs is released under the [MIT](./LICENSE.md) license.
+@rc-component/tabs 基于 [MIT](./LICENSE.md) 许可证发布。
From 8f2283d0afe48fdb96c9bb4f763019643c651b30 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 01:28:44 +0800
Subject: [PATCH 11/29] chore: standardize rc tooling and docs
---
.dumirc.ts | 2 +-
README.md | 11 +++++++++
README.zh-CN.md | 11 +++++++++
package.json | 42 ++++++++++++++++-----------------
tests/accessibility.test.tsx | 19 ++++++++++-----
tsconfig.json | 45 ++++++++++++++++++++++++++++--------
6 files changed, 92 insertions(+), 38 deletions(-)
diff --git a/.dumirc.ts b/.dumirc.ts
index 40f97753..65a8e909 100644
--- a/.dumirc.ts
+++ b/.dumirc.ts
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
import path from 'path';
const basePath = process.env.GH_PAGES ? '/tabs/' : '/';
-const publicPath = process.env.GH_PAGES ? '/tabs/' : '/';
+const publicPath = basePath;
export default defineConfig({
alias: {
diff --git a/README.md b/README.md
index 0820a37e..2808a3ab 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,17 @@ export default () => ;
Online preview: https://tabs.react-component.vercel.app/
+## Examples
+
+Run the local dumi site:
+
+```bash
+npm install
+npm start
+```
+
+Then open `http://localhost:8000`.
+
## API
### Tabs
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 1d283341..1493e01c 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -45,6 +45,17 @@ export default () => ;
在线预览:https://tabs.react-component.vercel.app/
+## 示例
+
+运行本地 dumi 站点:
+
+```bash
+npm install
+npm start
+```
+
+然后打开 `http://localhost:8000`。
+
## API
### Tabs
diff --git a/package.json b/package.json
index cd8187b5..547d3a9a 100644
--- a/package.json
+++ b/package.json
@@ -49,34 +49,34 @@
},
"devDependencies": {
"@rc-component/father-plugin": "^2.2.0",
- "@rc-component/np": "^1.0.3",
- "@testing-library/jest-dom": "^6.1.4",
- "@testing-library/react": "^16.0.1",
- "@testing-library/user-event": "^14.5.2",
+ "@rc-component/np": "^1.0.4",
+ "@testing-library/jest-dom": "^6.9.1",
+ "@testing-library/react": "^15.0.7",
+ "@testing-library/user-event": "14.5.2",
"@types/enzyme": "^3.10.5",
- "@types/jest": "^30.0.0",
- "@types/node": "^24.5.2",
- "@types/react": "^18.2.42",
+ "@types/jest": "^29.5.14",
+ "@types/node": "^26.0.1",
+ "@types/react": "^18.3.31",
"@types/react-dom": "^18.3.7",
- "@typescript-eslint/eslint-plugin": "^5.59.7",
- "@typescript-eslint/parser": "^5.59.7",
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
+ "@typescript-eslint/parser": "^5.62.0",
"@umijs/fabric": "^4.0.1",
- "dumi": "^2.0.0",
- "eslint": "^8.54.0",
- "father": "^4.0.0",
- "gh-pages": "^6.1.0",
+ "dumi": "^2.4.35",
+ "eslint": "^8.57.1",
+ "father": "^4.6.23",
+ "gh-pages": "^6.3.0",
"husky": "^9.1.7",
- "less": "^4.1.3",
- "lint-staged": "^16.2.3",
- "prettier": "^3.5.3",
- "rc-test": "^7.0.14",
- "react": "^18.0.0",
+ "less": "^4.6.7",
+ "lint-staged": "^16.4.0",
+ "prettier": "^3.9.0",
+ "rc-test": "^7.1.3",
+ "react": "^18.3.1",
"react-dnd": "^10.0.0",
"react-dnd-html5-backend": "^10.0.0",
- "react-dom": "^18.0.0",
+ "react-dom": "^18.3.1",
"react-sticky": "^6.0.3",
- "typescript": "^5.3.2",
- "cross-env": "^7.0.0"
+ "typescript": "^5.9.3",
+ "cross-env": "^10.1.0"
},
"peerDependencies": {
"react": ">=16.9.0",
diff --git a/tests/accessibility.test.tsx b/tests/accessibility.test.tsx
index fbee0fa6..c31e4679 100644
--- a/tests/accessibility.test.tsx
+++ b/tests/accessibility.test.tsx
@@ -139,22 +139,29 @@ describe('Tabs.Accessibility', () => {
it('should distinguish between keyboard and mouse navigation', async () => {
const user = userEvent.setup();
- const { getByRole } = render(createTabs());
+ const { getByRole, unmount } = render(createTabs());
const secondTab = getByRole('tab', { name: /Tab2/i });
- const fourthTab = getByRole('tab', { name: /Tab4/i });
// mouse click should not add focus style
- await user.click(secondTab);
+ fireEvent.mouseDown(secondTab);
+ fireEvent.click(secondTab);
expect(secondTab.parentElement).not.toHaveClass('rc-tabs-tab-focus');
- // clear focus
- await user.click(document.body);
+ unmount();
+
+ const { getByRole: getByRoleWithKeyboard } = render(createTabs());
+ const firstTab = getByRoleWithKeyboard('tab', { name: /Tab1/i });
+ const secondKeyboardTab = getByRoleWithKeyboard('tab', { name: /Tab2/i });
+ const fourthTab = getByRoleWithKeyboard('tab', { name: /Tab4/i });
// keyboard navigation should add focus style
await user.tab();
// default focus active tab
- expect(secondTab.parentElement).toHaveClass('rc-tabs-tab-focus');
+ expect(firstTab.parentElement).toHaveClass('rc-tabs-tab-focus');
+
+ await user.keyboard('{ArrowRight}');
+ expect(secondKeyboardTab.parentElement).toHaveClass('rc-tabs-tab-focus');
await user.keyboard('{ArrowRight}');
// skip disabled tab
diff --git a/tsconfig.json b/tsconfig.json
index cb5d1b5d..d72095a0 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -3,20 +3,45 @@
"target": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
- "lib": ["dom", "es2017"],
+ "lib": [
+ "dom",
+ "es2017"
+ ],
"jsx": "react",
"declaration": true,
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
- "@/*": ["src/*"],
- "@@/*": [".dumi/tmp/*"],
- "@rc-component/tabs": ["src/index.ts"],
- "@rc-component/tabs/es": ["src"],
- "@rc-component/tabs/es/*": ["src/*"],
- "@rc-component/tabs/assets/*": ["assets/*"]
- }
+ "@/*": [
+ "src/*"
+ ],
+ "@@/*": [
+ ".dumi/tmp/*"
+ ],
+ "@rc-component/tabs": [
+ "src/index.ts"
+ ],
+ "@rc-component/tabs/es": [
+ "src"
+ ],
+ "@rc-component/tabs/es/*": [
+ "src/*"
+ ],
+ "@rc-component/tabs/assets/*": [
+ "assets/*"
+ ]
+ },
+ "ignoreDeprecations": "5.0"
},
- "include": [".dumirc.ts", "src", "tests", "docs/examples"],
- "exclude": ["docs-dist", "lib", "es"]
+ "include": [
+ ".dumirc.ts",
+ "src",
+ "tests",
+ "docs/examples"
+ ],
+ "exclude": [
+ "docs-dist",
+ "lib",
+ "es"
+ ]
}
From f18c5f5ef6604d30ee4e31dd0df6d6d44b213c7c Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 02:01:08 +0800
Subject: [PATCH 12/29] chore: address standardization review comments
---
.github/workflows/surge-preview.yml | 16 +++++++++++++---
README.zh-CN.md | 20 ++++++++++----------
tsconfig.json | 1 +
3 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index faf6b8bd..cb6c8c4a 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -22,13 +22,23 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
+ - name: Check Surge token
+ id: surge-token
+ env:
+ SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
+ run: |
+ if [ -n "$SURGE_TOKEN" ]; then
+ echo "enabled=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "enabled=false" >> "$GITHUB_OUTPUT"
+ fi
- name: Build preview
- if: ${{ secrets.SURGE_TOKEN != '' }}
+ if: ${{ steps.surge-token.outputs.enabled == 'true' }}
run: |
npm install
npm run build
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
- if: ${{ secrets.SURGE_TOKEN != '' }}
+ if: ${{ steps.surge-token.outputs.enabled == 'true' }}
env:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
with:
@@ -38,5 +48,5 @@ jobs:
failOnError: false
setCommitStatus: false
- name: Skip Surge preview
- if: ${{ secrets.SURGE_TOKEN == '' }}
+ if: ${{ steps.surge-token.outputs.enabled != 'true' }}
run: echo "SURGE_TOKEN is not configured; skip Surge preview."
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 1493e01c..3fb12bc3 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -64,44 +64,44 @@ npm start
| --- | --- | --- | --- |
| `activeKey` | string | - | 受控的活动 Tab 键。 |
| `animated` | boolean \| AnimatedConfig | `{ inkBar: true, tabPane: false }` | 动画配置。 |
-| `className` | string | - | 附加className。 |
-| `classNames` | `Partial>` | - | 语义className。 |
+| `className` | string | - | 附加 className。 |
+| `classNames` | `Partial>` | - | 语义化类名。 |
| `defaultActiveKey` | string | - | 初始活动 Tab 键。 |
-| `destroyOnHidden` | boolean | false | Destroy inactive tab panels. |
-| `direction` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction. |
+| `destroyOnHidden` | boolean | false | 销毁非活动标签页面板。 |
+| `direction` | `'ltr' \| 'rtl'` | `'ltr'` | 布局方向。 |
| `editable` | EditableConfig | - | 可编辑标签页配置。 |
| `getPopupContainer` | `(node: HTMLElement) => HTMLElement` | - | 弹层容器解析器。 |
| `id` | string | - | 根 ID。 |
-| `indicator` | `{ size?: GetIndicatorSize; align?: 'start' \| 'center' \| 'end' }` | - | Indicator size and alignment. |
+| `indicator` | `{ size?: GetIndicatorSize; align?: 'start' \| 'center' \| 'end' }` | - | 指示器尺寸和对齐方式。 |
| `items` | Tab[] | [] | 选项卡项目。 |
| `locale` | TabsLocale | - | 无障碍本地化文本。 |
| `more` | MoreProps | - | 溢出下拉菜单配置。 |
| `onChange` | `(activeKey: string) => void` | - | 当活动选项卡更改时触发。 |
| `onTabClick` | `(activeKey, event) => void` | - | 单击选项卡时触发。 |
| `onTabScroll` | `({ direction }) => void` | - | 当选项卡导航滚动时触发。 |
-| `prefixCls` | string | `'rc-tabs'` | 前缀className。 |
+| `prefixCls` | string | `'rc-tabs'` | 前缀 className。 |
| `renderTabBar` | RenderTabBar | - | 自定义标签栏渲染函数。 |
| `style` | React.CSSProperties | - | 根样式。 |
| `styles` | `Partial>` | - | 语义化样式。 |
| `tabBarExtraContent` | React.ReactNode \| TabBarExtraMap | - | 标签栏旁的额外内容。 |
| `tabBarGutter` | number | 0 | 选项卡之间的间隙。 |
| `tabBarStyle` | React.CSSProperties | - | 标签栏样式。 |
-| `tabPosition` | `'left' \| 'right' \| 'top' \| 'bottom'` | `'top'` | Tab position. |
+| `tabPosition` | `'left' \| 'right' \| 'top' \| 'bottom'` | `'top'` | 标签页位置。 |
### Tab
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| `children` | React.ReactNode | - | 选项卡面板内容。 |
-| `className` | string | - | 面板className称。 |
+| `className` | string | - | 面板 className。 |
| `closable` | boolean | - | 是否可以在可编辑模式下关闭选项卡。 |
| `closeIcon` | React.ReactNode | - | 自定义关闭图标。 |
| `destroyOnHidden` | boolean | false | 销毁非活动面板。 |
| `disabled` | boolean | false | 禁用该选项卡。 |
| `forceRender` | boolean | false | 在面板变为活动状态之前渲染面板。 |
| `key` | string | - | 需要唯一的 Tab 键。 |
-| `label` | React.ReactNode | - | Tab label. |
-| `style` | React.CSSProperties | - | 面板风格。 |
+| `label` | React.ReactNode | - | Tab 标签内容。 |
+| `style` | React.CSSProperties | - | 面板样式。 |
## 本地开发
diff --git a/tsconfig.json b/tsconfig.json
index d72095a0..0dfc8d55 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -35,6 +35,7 @@
},
"include": [
".dumirc.ts",
+ ".fatherrc.ts",
"src",
"tests",
"docs/examples"
From cd5c1a92045b77bcd18e76053e32d04baaeeff22 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 02:30:42 +0800
Subject: [PATCH 13/29] test: cover mouse focus reset
---
tests/accessibility.test.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/accessibility.test.tsx b/tests/accessibility.test.tsx
index c31e4679..385d889c 100644
--- a/tests/accessibility.test.tsx
+++ b/tests/accessibility.test.tsx
@@ -146,6 +146,7 @@ describe('Tabs.Accessibility', () => {
// mouse click should not add focus style
fireEvent.mouseDown(secondTab);
fireEvent.click(secondTab);
+ fireEvent.mouseUp(secondTab);
expect(secondTab.parentElement).not.toHaveClass('rc-tabs-tab-focus');
unmount();
From 1953df80755d80a1d5f6eface9f29815c93c9d7a Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 12:24:43 +0800
Subject: [PATCH 14/29] ci: update GitHub Actions versions
---
.github/workflows/codeql.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 23f424a8..6999184b 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -29,15 +29,15 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
- uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
- uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444
with:
category: '/language:${{ matrix.language }}'
From f73faab53b3fa64ffbbf44b6abc3e8f5ddf1780f Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 12:30:18 +0800
Subject: [PATCH 15/29] ci: use resolvable CodeQL action ref
---
.github/workflows/codeql.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 6999184b..23f424a8 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -29,15 +29,15 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
- uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
- uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
with:
category: '/language:${{ matrix.language }}'
From fe1a801a3b1a725597ec7a6bea2797938496056f Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 13:28:15 +0800
Subject: [PATCH 16/29] docs: add license file
---
LICENSE | 21 +++++++++++++++++++++
README.md | 2 +-
README.zh-CN.md | 2 +-
3 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 LICENSE
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..bd0a1f72
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019-present react-component
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 2808a3ab..2db9c2ff 100644
--- a/README.md
+++ b/README.md
@@ -124,4 +124,4 @@ The release flow is handled by `@rc-component/np` through the `rc-np` command af
## License
-@rc-component/tabs is released under the [MIT](./LICENSE.md) license.
+@rc-component/tabs is released under the [MIT](./LICENSE) license.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 3fb12bc3..6fa168dd 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -124,4 +124,4 @@ npm run prepublishOnly
## 许可证
-@rc-component/tabs 基于 [MIT](./LICENSE.md) 许可证发布。
+@rc-component/tabs 基于 [MIT](./LICENSE) 许可证发布。
From 71542518ed70c108636a0a711e4c8c152aaa5a93 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:01:42 +0800
Subject: [PATCH 17/29] ci: use actions checkout v7
---
.github/workflows/codeql.yml | 2 +-
.github/workflows/react-doctor.yml | 2 +-
.github/workflows/surge-preview.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 23f424a8..82242dfd 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ uses: actions/checkout@v7
with:
persist-credentials: false
diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml
index f68281c8..097eb883 100644
--- a/.github/workflows/react-doctor.yml
+++ b/.github/workflows/react-doctor.yml
@@ -20,7 +20,7 @@ jobs:
react-doctor:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ - uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index cb6c8c4a..ebfecd53 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -19,7 +19,7 @@ jobs:
env:
PREVIEW: true
steps:
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ - uses: actions/checkout@v7
with:
persist-credentials: false
- name: Check Surge token
From 881ee0b9fbf212d6109a91a195496938fb67ef6d Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:32:22 +0800
Subject: [PATCH 18/29] chore: standardize package metadata
---
package.json | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index 547d3a9a..03b3819d 100644
--- a/package.json
+++ b/package.json
@@ -9,11 +9,11 @@
],
"homepage": "https://react-component.github.io/tabs",
"bugs": {
- "url": "https://github.com/react-component/tabs/issues"
+ "url": "https://github.com/react-component/tabs/issues"
},
"repository": {
"type": "git",
- "url": "git@github.com:react-component/tabs.git"
+ "url": "https://github.com/react-component/tabs.git"
},
"license": "MIT",
"author": "yiminghe@gmail.com",
@@ -86,5 +86,8 @@
"node": ">=8.x"
},
"types": "./lib/index.d.ts",
- "style": "./assets/index.css"
+ "style": "./assets/index.css",
+ "publishConfig": {
+ "access": "public"
+ }
}
From a9c785bbeb1fba7fd68cf0f0784058d587ccaaac Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:38:34 +0800
Subject: [PATCH 19/29] ci: standardize dependabot updates
---
.github/dependabot.yml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 07575c02..3b730ef9 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -3,6 +3,17 @@ updates:
- package-ecosystem: npm
directory: '/'
schedule:
- interval: daily
+ interval: weekly
+ day: monday
time: '21:00'
+ timezone: Asia/Shanghai
+ open-pull-requests-limit: 10
+
+ - package-ecosystem: github-actions
+ directory: '/'
+ schedule:
+ interval: weekly
+ day: monday
+ time: '21:00'
+ timezone: Asia/Shanghai
open-pull-requests-limit: 10
From 6110def4bf10d42f1f7289f4de2dcd378b1193e2 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 15:07:27 +0800
Subject: [PATCH 20/29] chore: ignore generated docs artifacts
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index bcd4e0c9..dc304eff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,3 +44,6 @@ docs-dist
bun.lockb
bun.lock
+coverage
+.dumi/tmp
+.dumi/tmp-production
From 2cb19e978e169aeea72d3def0f3b976f08d22c7b Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 17:16:37 +0800
Subject: [PATCH 21/29] chore: refine preview workflow ignores
---
.github/workflows/surge-preview.yml | 3 +++
.prettierignore | 14 ++++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 .prettierignore
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index ebfecd53..eaff160a 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -16,6 +16,9 @@ permissions:
jobs:
preview:
runs-on: ubuntu-latest
+ concurrency:
+ group: surge-preview-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
env:
PREVIEW: true
steps:
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..c466d872
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,14 @@
+node_modules
+coverage
+docs-dist
+dist
+es
+lib
+.dumi/tmp
+.dumi/tmp-production
+.vercel
+package-lock.json
+pnpm-lock.yaml
+yarn.lock
+bun.lockb
+*.log
From 155b4b467e1cfbc20b082b987b02d500e158c04b Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 19:39:38 +0800
Subject: [PATCH 22/29] docs: document dumi dev server port
---
README.md | 2 ++
README.zh-CN.md | 2 ++
2 files changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 2db9c2ff..4888e335 100644
--- a/README.md
+++ b/README.md
@@ -114,6 +114,8 @@ npm run compile
npm run build
```
+The dumi site runs at `http://localhost:8000` by default.
+
## Release
```bash
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 6fa168dd..f6307bbf 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -114,6 +114,8 @@ npm run compile
npm run build
```
+dumi 站点默认运行在 `http://localhost:8000`。
+
## 发布
```bash
From dc59453fb07cb6d8c8ddcd291f037ef4b2b6fc09 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 19:59:07 +0800
Subject: [PATCH 23/29] chore: standardize husky configuration
---
.husky/pre-commit | 2 +-
package.json | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.husky/pre-commit b/.husky/pre-commit
index d0a77842..2312dc58 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-npx lint-staged
\ No newline at end of file
+npx lint-staged
diff --git a/package.json b/package.json
index 03b3819d..295107f3 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,8 @@
"prettier": "prettier --write --ignore-unknown .",
"start": "dumi dev",
"test": "rc-test",
- "tsc": "tsc --noEmit"
+ "tsc": "tsc --noEmit",
+ "prepare": "husky"
},
"dependencies": {
"@rc-component/dropdown": "~1.0.0",
@@ -89,5 +90,8 @@
"style": "./assets/index.css",
"publishConfig": {
"access": "public"
+ },
+ "lint-staged": {
+ "*": "prettier --write --ignore-unknown"
}
}
From 04a04cc27e9418c587e63fae1477ac4be565362d Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 20:33:23 +0800
Subject: [PATCH 24/29] chore: standardize package type entry
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 295107f3..3c8ecf3e 100644
--- a/package.json
+++ b/package.json
@@ -86,7 +86,7 @@
"engines": {
"node": ">=8.x"
},
- "types": "./lib/index.d.ts",
+ "types": "./es/index.d.ts",
"style": "./assets/index.css",
"publishConfig": {
"access": "public"
From cf4d30f2b80b63073f40ceefcb8fa2be9b5c23e0 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:01:39 +0800
Subject: [PATCH 25/29] docs: normalize readme badges
---
README.md | 12 ++++++------
README.zh-CN.md | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 4888e335..8b89fc66 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,12 @@
📑 Flexible React tabs with overflow, editable items, custom tab bars, and accessible panels.
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/README.zh-CN.md b/README.zh-CN.md
index f6307bbf..c6d5c424 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -4,12 +4,12 @@
📑 React 标签页组件,支持可编辑标签、溢出滚动和自定义渲染。
-
-
-
-
-
-
+
+
+
+
+
+
From 758493ad87a37b9bfec3db38037aeee2c0c64974 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:21:26 +0800
Subject: [PATCH 26/29] ci: limit reusable workflow secrets
---
.github/workflows/react-component-ci.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index 1ed64209..cf754afa 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -9,4 +9,6 @@ permissions:
jobs:
test:
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
- secrets: inherit
+ secrets:
+
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
From 57fc51b30581b5875a6336770b5c41ef6efc1c1d Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:30:13 +0800
Subject: [PATCH 27/29] ci: restore reusable workflow compatibility
---
.github/workflows/react-component-ci.yml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index cf754afa..1ed64209 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -9,6 +9,4 @@ permissions:
jobs:
test:
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
- secrets:
-
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ secrets: inherit
From 588a43edf31821e6ca8be6d5734bdbd3e9bd373f Mon Sep 17 00:00:00 2001
From: afc163
Date: Mon, 29 Jun 2026 01:21:01 +0800
Subject: [PATCH 28/29] ci: narrow surge preview permissions
---
.github/workflows/surge-preview.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index eaff160a..4c2f17ed 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -11,7 +11,6 @@ permissions:
contents: read
pull-requests: write
checks: write
- statuses: write
jobs:
preview:
From d70016ae7ee6f75f276ce0172c5002497a58154d Mon Sep 17 00:00:00 2001
From: afc163
Date: Mon, 29 Jun 2026 14:26:59 +0800
Subject: [PATCH 29/29] chore: limit reusable workflow secrets
---
.github/workflows/react-component-ci.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index 1ed64209..f0323dae 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -9,4 +9,5 @@ permissions:
jobs:
test:
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
- secrets: inherit
+ secrets:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
\ No newline at end of file