From c0fdbf082635a58ea2437bee9fc14e0767f88f4f Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 17:05:47 +0800 Subject: [PATCH 01/28] chore: standardize repository config --- .dumirc.ts | 9 +- .github/FUNDING.yml | 2 + .github/dependabot.yml | 27 +-- .github/workflows/codeql.yml | 43 ++++ .github/workflows/main.yml | 6 - .github/workflows/react-component-ci.yml | 12 ++ .github/workflows/react-doctor.yml | 27 +++ .github/workflows/surge-preview.yml | 39 ++++ .gitignore | 24 ++- README.md | 261 ++++++++--------------- docs/index.md | 2 +- package.json | 32 ++- tsconfig.json | 14 +- vercel.json | 6 + 14 files changed, 274 insertions(+), 230 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/react-component-ci.yml create mode 100644 .github/workflows/react-doctor.yml create mode 100644 .github/workflows/surge-preview.yml create mode 100644 vercel.json diff --git a/.dumirc.ts b/.dumirc.ts index ded1b399..cc07a0e4 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,10 +1,14 @@ import { defineConfig } from 'dumi'; import path from 'path'; +const basePath = process.env.GH_PAGES ? '/steps/' : '/'; +const publicPath = process.env.GH_PAGES ? '/steps/' : '/'; + export default defineConfig({ alias: { '@rc-component/steps$': path.resolve('src'), '@rc-component/steps/es': path.resolve('src'), + '@rc-component/steps/assets': path.resolve('assets'), }, mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], @@ -12,4 +16,7 @@ export default defineConfig({ name: 'Steps', logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, -}); \ No newline at end of file + outputPath: 'docs-dist', + base: basePath, + publicPath, +}); diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..758659af --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml index add01c3d..07575c02 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,23 +1,8 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "21:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: "@types/react-dom" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - dependency-name: "@types/react" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - 17.0.3 - - dependency-name: less - versions: - - 4.1.0 + - package-ecosystem: npm + directory: '/' + schedule: + interval: daily + time: '21:00' + open-pull-requests-limit: 10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..23f424a8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,43 @@ +name: 'CodeQL' + +on: + push: + branches: ['master'] + pull_request: + branches: ['master'] + schedule: + - cron: '17 10 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [javascript] + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + with: + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 5735e2d2..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: ✅ test -on: [push, pull_request] -jobs: - test: - uses: react-component/rc-test/.github/workflows/test.yml@main - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml new file mode 100644 index 00000000..1ed64209 --- /dev/null +++ b/.github/workflows/react-component-ci.yml @@ -0,0 +1,12 @@ +name: ✅ test +on: + push: + branches: [master] + pull_request: + branches: [master] +permissions: + contents: read +jobs: + test: + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + secrets: inherit diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml new file mode 100644 index 00000000..f68281c8 --- /dev/null +++ b/.github/workflows/react-doctor.yml @@ -0,0 +1,27 @@ +name: React Doctor + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + push: + branches: [master] + +permissions: + contents: read + pull-requests: write + issues: write + statuses: write + +concurrency: + group: react-doctor-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + react-doctor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + fetch-depth: 0 + persist-credentials: false + - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3 diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml new file mode 100644 index 00000000..1b29a17b --- /dev/null +++ b/.github/workflows/surge-preview.yml @@ -0,0 +1,39 @@ +name: Surge Preview + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: write + checks: write + statuses: write + +jobs: + preview: + runs-on: ubuntu-latest + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + PREVIEW: true + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec + if: ${{ env.SURGE_TOKEN != '' }} + with: + surge_token: ${{ env.SURGE_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + dist: docs-dist + failOnError: true + setCommitStatus: true + build: | + npm install + npm run build + - name: Skip Surge preview + if: ${{ env.SURGE_TOKEN == '' }} + run: echo "SURGE_TOKEN is not configured; skip Surge preview." diff --git a/.gitignore b/.gitignore index 75954683..bcd4e0c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -.iml +*.iml *.log +*.log.* .idea/ .ipr .iws @@ -25,18 +26,21 @@ assets/**/*.css build lib es -coverage +/coverage +yarn.lock package-lock.json pnpm-lock.yaml -yarn.lock .doc -.umi -.npmrc +docs-dist +.vercel +.storybook -# dumi -.dumi/tmp -.dumi/tmp-test -.dumi/tmp-production +# umi +.umi +.umi-production +.umi-test .env.local +.dumi/ -bun.lockb \ No newline at end of file +bun.lockb +bun.lock diff --git a/README.md b/README.md index db0a3b26..6d7de783 100644 --- a/README.md +++ b/README.md @@ -1,191 +1,114 @@ -# @rc-component/steps - ---- - -React steps component. - -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][codecov-image]][codecov-url] -[![npm download][download-image]][download-url] -[![bundle size][bundlephobia-image]][bundlephobia-url] - -[npm-image]: http://img.shields.io/npm/v/@rc-component/steps.svg?style=flat-square -[npm-url]: http://npmjs.org/package/@rc-component/steps -[travis-image]: https://img.shields.io/travis/react-component/steps.svg?style=flat-square -[travis-url]: https://travis-ci.org/react-component/steps -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/steps/master.svg?style=flat-square -[codecov-url]: https://codecov.io/gh/react-component/steps/branch/master -[download-image]: https://img.shields.io/npm/dm/@rc-component/steps.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/steps -[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/steps -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/steps - -## Usage +
+

@rc-component/steps

+

🚶 Structured React steps for progress, navigation, and multi-step workflows.

+

+ Ant Design +

+

Part of the Ant Design ecosystem.

+ +

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +## Highlights + +- Renders progress and navigation steps from a simple `items` array. +- Supports horizontal and vertical layouts, inline mode, custom icons, and status control. +- Provides semantic `classNames` and `styles` slots for stable theming. +- Keeps keyboard-accessible step changes when `onChange` is provided. + +## Install ```bash npm install @rc-component/steps ``` -
+## Usage -```jsx | pure - - - - - +```tsx pure +import Steps from '@rc-component/steps'; +import '@rc-component/steps/assets/index.css'; + +export default () => ( + +); ``` -## Example - -https://steps.vercel.app/ +Online preview: https://steps.react-component.vercel.app/ ## API - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
typestringdefaultdiretypetion of Steps, could be `default` `navigation` `inline`
directionstringhorizontaldirection of Steps, enum: `horizontal` or `vertical`
currentnumber0index of current step
initialnumber0index initial
sizestringsize of Steps, could be `small`
titlePlacementstringplacement of step title, could be `vertical`
statusstringwaitstatus of current Steps, could be `error` `process` `finish` `wait`
icons{ finish: ReactNode, error: ReactNode }specify the default finish icon and error icon
itemRender(item: StepProps, stepItem: React.ReactNode) => React.ReactNodecustom step item renderer
onChange(current: number) => voidTrigger when Step changed
- -### Steps.Step - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
titleReactNodetitle of step item
subTitleReactNodesubTitle of step item
descriptionReactNodedescription of step item
iconReactNodeset icon of step item
statusstringstatus of current Steps, could be `error` `process` `finish` `wait`
tailContentReactNodecontent above tail
disabledboolfalsedisabled step when onChange exist
render(stepItem: React.ReactNode) => React.ReactNodecustom step item renderer
+### Steps + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `className` | string | - | Additional class name. | +| `classNames` | `Partial>` | - | Semantic class names for internal slots. | +| `components` | `{ root?: ComponentType; item?: ComponentType }` | - | Override root and item elements. | +| `current` | number | 0 | Current step index. | +| `iconRender` | `(originNode, info) => ReactNode` | - | Custom step icon renderer. | +| `initial` | number | 0 | Initial step index offset. | +| `itemRender` | `(originNode, info) => ReactNode` | - | Custom step item renderer. | +| `itemWrapperRender` | `(originNode) => ReactNode` | - | Custom step item wrapper renderer. | +| `items` | StepItem[] | [] | Step data. | +| `onChange` | `(current: number) => void` | - | Triggered when a clickable step changes. | +| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout orientation. | +| `prefixCls` | string | `'rc-steps'` | Prefix class name. | +| `rootClassName` | string | - | Root class name. | +| `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | Current step status. | +| `style` | React.CSSProperties | - | Root style. | +| `styles` | `Partial>` | - | Semantic styles for internal slots. | +| `titlePlacement` | `'horizontal' \| 'vertical'` | `'horizontal'` | Title placement for horizontal steps. | + +### StepItem + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `className` | string | - | Item class name. | +| `classNames` | `Partial>` | - | Semantic class names for this item. | +| `content` | React.ReactNode | - | Step content. | +| `description` | React.ReactNode | - | Deprecated. Use `content` instead. | +| `disabled` | boolean | false | Disable step click behavior. | +| `icon` | React.ReactNode | - | Custom step icon. | +| `onClick` | React.MouseEventHandler | - | Item click handler. | +| `status` | Status | - | Item status. | +| `style` | React.CSSProperties | - | Item style. | +| `styles` | `Partial>` | - | Semantic styles for this item. | +| `subTitle` | React.ReactNode | - | Subtitle. | +| `title` | React.ReactNode | - | Title. | ## Development ```bash npm install npm start +npm test +npm run tsc +npm run compile +npm run build +``` + +## Release + +```bash +npm run prepublishOnly ``` +`prepublishOnly` builds the package with Father and publishes through `rc-np`. Run `npm run gh-pages` to deploy the dumi site. + ## License @rc-component/steps is released under the MIT license. diff --git a/docs/index.md b/docs/index.md index 8160c503..87842ca7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ --- hero: - title: "@rc-component/steps" + title: '@rc-component/steps' description: React Steps Component --- diff --git a/package.json b/package.json index 35efc283..5907ba91 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,19 @@ { "name": "@rc-component/steps", "version": "1.2.2", - "description": "steps ui component for react", + "description": "Step workflow component for React", "keywords": [ "react", "react-component", "react-steps" ], - "homepage": "https://github.com/react-component/steps", + "homepage": "https://react-component.github.io/steps", "bugs": { "url": "https://github.com/react-component/steps/issues" }, "repository": { "type": "git", - "url": " git+ssh://git@github.com/react-component/steps.git" + "url": "git@github.com:react-component/steps.git" }, "license": "MIT", "maintainers": [ @@ -27,28 +27,22 @@ "types": "./lib/index.d.ts", "files": [ "assets/*.css", - "es", - "lib" + "lib", + "es" ], "scripts": { + "build": "npm run compile && npm run docs:build", "compile": "father build && lessc assets/index.less assets/index.css", "coverage": "rc-test --coverage", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d .doc", - "gh-pages": "npm run docs:build && npm run docs:deploy", + "docs:deploy": "gh-pages -d docs-dist", + "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", - "prepare": "husky install && dumi setup", "prepublishOnly": "npm run compile && rc-np", - "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", - "postpublish": "npm run gh-pages", + "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "now-build": "npm run docs:build" - }, - "lint-staged": { - "**/*.{js,jsx,tsx,ts,md,json}": [ - "prettier --write" - ] + "tsc": "tsc --noEmit" }, "dependencies": { "@rc-component/util": "^1.11.1", @@ -78,7 +72,8 @@ "rc-test": "^7.0.9", "react": "^18.0.0", "react-dom": "^18.0.0", - "typescript": "^5.0.0" + "typescript": "^5.0.0", + "cross-env": "^7.0.0" }, "peerDependencies": { "react": ">=16.9.0", @@ -86,5 +81,6 @@ }, "engines": { "node": ">=8.x" - } + }, + "style": "./assets/index.css" } diff --git a/tsconfig.json b/tsconfig.json index 4f49d936..dd69c05a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,14 +3,20 @@ "target": "esnext", "moduleResolution": "node", "baseUrl": "./", + "lib": ["dom", "es2017"], "jsx": "preserve", "declaration": true, "skipLibCheck": true, "esModuleInterop": true, "paths": { "@/*": ["src/*"], - "@@/*": ["dumi/tmp/*"], - "@rc-component/steps": ["src/index.ts"] + "@@/*": [".dumi/tmp/*"], + "@rc-component/steps": ["src/index.ts"], + "@rc-component/steps/es": ["src"], + "@rc-component/steps/es/*": ["src/*"], + "@rc-component/steps/assets/*": ["assets/*"] } - } -} \ No newline at end of file + }, + "include": [".dumirc.ts", "src", "tests", "docs/examples"], + "exclude": ["docs-dist", "lib", "es"] +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..5f9139ef --- /dev/null +++ b/vercel.json @@ -0,0 +1,6 @@ +{ + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "docs-dist" +} From 111b8660b01b3d8df4066a60a83be773bbfaeb42 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 17:09:16 +0800 Subject: [PATCH 02/28] fix: keep default CodeQL setup --- .github/workflows/codeql.yml | 43 ------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 23f424a8..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: 'CodeQL' - -on: - push: - branches: ['master'] - pull_request: - branches: ['master'] - schedule: - - cron: '17 10 * * 1' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [javascript] - - steps: - - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - with: - persist-credentials: false - - - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - - name: Autobuild - uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - with: - category: '/language:${{ matrix.language }}' From e8e2e255a13ef060e9f59f4aa0c0923e82722b51 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:27:32 +0800 Subject: [PATCH 03/28] chore: address AI review feedback --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5907ba91..7ab1263a 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "coverage": "rc-test --coverage", "docs:build": "dumi build", "docs:deploy": "gh-pages -d docs-dist", - "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", + "gh-pages": "npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "prepublishOnly": "npm run compile && rc-np", "prettier": "prettier --write --ignore-unknown .", From aba3fd198c5687d8f09207ca659c321497226980 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:56:49 +0800 Subject: [PATCH 04/28] docs: standardize README release details --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d7de783..fe0ccd40 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ npm run build npm run prepublishOnly ``` -`prepublishOnly` builds the package with Father and publishes through `rc-np`. Run `npm run gh-pages` to deploy the dumi site. +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. ## License -@rc-component/steps is released under the MIT license. +@rc-component/steps is released under the [MIT](./LICENSE.md) license. From 4002d9e4876b67eda7bd32fbaad02c591835a4bd Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:13:59 +0800 Subject: [PATCH 05/28] ci: make surge preview non-blocking --- .github/workflows/surge-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 1b29a17b..ad8683da 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -29,7 +29,7 @@ jobs: surge_token: ${{ env.SURGE_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} dist: docs-dist - failOnError: true + failOnError: false setCommitStatus: true build: | npm install From 2f48e26b25866d77a507ea67410bef40c3b03ced Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:25:43 +0800 Subject: [PATCH 06/28] ci: keep surge preview as fallback --- .github/workflows/surge-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index ad8683da..70768bf2 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -30,7 +30,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} dist: docs-dist failOnError: false - setCommitStatus: true + setCommitStatus: false build: | npm install npm run build From ecef26d6d7d4957a14526d3269d6b72d5b9a20e5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:04:03 +0800 Subject: [PATCH 07/28] docs: refine README usage and ecosystem note --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fe0ccd40..a0e95060 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@

@rc-component/steps

+

Part of the Ant Design ecosystem.

🚶 Structured React steps for progress, navigation, and multi-step workflows.

-

- Ant Design -

-

Part of the Ant Design ecosystem.

npm version @@ -16,6 +13,7 @@

+ ## Highlights - Renders progress and navigation steps from a simple `items` array. From 20470638fa3137798dbbe57cb6525e5748eaed69 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:22:18 +0800 Subject: [PATCH 08/28] ci: isolate surge preview token --- .github/workflows/surge-preview.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 70768bf2..faf6b8bd 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -17,23 +17,26 @@ jobs: preview: runs-on: ubuntu-latest env: - SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} PREVIEW: true steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Build preview + if: ${{ secrets.SURGE_TOKEN != '' }} + run: | + npm install + npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec - if: ${{ env.SURGE_TOKEN != '' }} + if: ${{ secrets.SURGE_TOKEN != '' }} + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: surge_token: ${{ env.SURGE_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} dist: docs-dist failOnError: false setCommitStatus: false - build: | - npm install - npm run build - name: Skip Surge preview - if: ${{ env.SURGE_TOKEN == '' }} + if: ${{ secrets.SURGE_TOKEN == '' }} run: echo "SURGE_TOKEN is not configured; skip Surge preview." From 81606a5ccd53a107a2ef525496f1342709ae14d6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:20:13 +0800 Subject: [PATCH 09/28] docs: add Chinese README --- README.md | 2 + README.zh-CN.md | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 README.zh-CN.md diff --git a/README.md b/README.md index a0e95060..80a2348d 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@

+

English | 简体中文

+ ## Highlights diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..9e974ed4 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,114 @@ +
+

@rc-component/steps

+

Ant Design 生态的一部分。

+

👣 React 步骤条组件,支持状态、图标、进度和多种布局。

+ +

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +

English | 简体中文

+ + +## 特性 + +- Renders progress and navigation steps from a simple `items` array. +- 支持 horizontal and vertical layouts, inline mode, custom icons, and status control. +- 提供 semantic `classNames` and `styles` slots for stable theming. +- 保留 keyboard-accessible step changes when `onChange` is provided. + +## 安装 + +```bash +npm install @rc-component/steps +``` + +## 使用 + +```tsx pure +import Steps from '@rc-component/steps'; +import '@rc-component/steps/assets/index.css'; + +export default () => ( + +); +``` + +Online preview: https://steps.react-component.vercel.app/ + +## API + +### Steps + +| 名称 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `className` | string | - | Additional class name. | +| `classNames` | `Partial>` | - | Semantic class names for internal slots. | +| `components` | `{ root?: ComponentType; item?: ComponentType }` | - | Override root and item elements. | +| `current` | number | 0 | Current step index. | +| `iconRender` | `(originNode, info) => ReactNode` | - | Custom step icon renderer. | +| `initial` | number | 0 | Initial step index offset. | +| `itemRender` | `(originNode, info) => ReactNode` | - | Custom step item renderer. | +| `itemWrapperRender` | `(originNode) => ReactNode` | - | Custom step item wrapper renderer. | +| `items` | StepItem[] | [] | Step data. | +| `onChange` | `(current: number) => void` | - | Triggered when a clickable step changes. | +| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout orientation. | +| `prefixCls` | string | `'rc-steps'` | Prefix class name. | +| `rootClassName` | string | - | Root class name. | +| `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | Current step status. | +| `style` | React.CSSProperties | - | Root style. | +| `styles` | `Partial>` | - | Semantic styles for internal slots. | +| `titlePlacement` | `'horizontal' \| 'vertical'` | `'horizontal'` | Title placement for horizontal steps. | + +### StepItem + +| 名称 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `className` | string | - | Item class name. | +| `classNames` | `Partial>` | - | Semantic class names for this item. | +| `content` | React.ReactNode | - | Step content. | +| `description` | React.ReactNode | - | Deprecated. Use `content` instead. | +| `disabled` | boolean | false | Disable step click behavior. | +| `icon` | React.ReactNode | - | Custom step icon. | +| `onClick` | React.MouseEventHandler | - | Item click handler. | +| `status` | Status | - | Item status. | +| `style` | React.CSSProperties | - | Item style. | +| `styles` | `Partial>` | - | Semantic styles for this item. | +| `subTitle` | React.ReactNode | - | Subtitle. | +| `title` | React.ReactNode | - | Title. | + +## 本地开发 + +```bash +npm install +npm start +npm test +npm run tsc +npm run compile +npm run build +``` + +## 发布 + +```bash +npm run prepublishOnly +``` + +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + +## 许可证 + +@rc-component/steps is released under the [MIT](./LICENSE.md) license. From e612463f065531de43751c3103d6ff84c171efcb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:34:57 +0800 Subject: [PATCH 10/28] docs: add Ant Design logo to README --- README.md | 1 + README.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 80a2348d..40bcd083 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

@rc-component/steps

Part of the Ant Design ecosystem.

+ Ant Design

🚶 Structured React steps for progress, navigation, and multi-step workflows.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 9e974ed4..81ebe66c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,7 @@

@rc-component/steps

Ant Design 生态的一部分。

+ Ant Design

👣 React 步骤条组件,支持状态、图标、进度和多种布局。

From 2b13601ea2a8a96cb12bfae16663c96b0c1d2232 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 23:03:52 +0800 Subject: [PATCH 11/28] docs: refine bilingual README branding --- README.md | 3 +-- README.zh-CN.md | 71 ++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 40bcd083..03490b4c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@

@rc-component/steps

-

Part of the Ant Design ecosystem.

- Ant Design +

Ant Design Part of the Ant Design ecosystem.

🚶 Structured React steps for progress, navigation, and multi-step workflows.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 81ebe66c..1cf1cb2e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,8 +1,7 @@

@rc-component/steps

-

Ant Design 生态的一部分。

- Ant Design -

👣 React 步骤条组件,支持状态、图标、进度和多种布局。

+

Ant Design Ant Design 生态的一部分。

+

🚶 React 步骤条组件,支持状态、图标、进度和多种布局。

npm version @@ -19,10 +18,10 @@ ## 特性 -- Renders progress and navigation steps from a simple `items` array. -- 支持 horizontal and vertical layouts, inline mode, custom icons, and status control. -- 提供 semantic `classNames` and `styles` slots for stable theming. -- 保留 keyboard-accessible step changes when `onChange` is provided. +- 从简单的 `items` 数组渲染进度和导航步骤。 +- 支持水平和垂直布局、内联模式、自定义图标和状态控制。 +- 提供语义 `classNames` 和 `styles` 插槽以实现稳定的主题。 +- 当提供 `onChange` 时,保留键盘可访问的步骤更改。 ## 安装 @@ -48,7 +47,7 @@ export default () => ( ); ``` -Online preview: https://steps.react-component.vercel.app/ +在线预览:https://steps.react-component.vercel.app/ ## API @@ -56,38 +55,38 @@ Online preview: https://steps.react-component.vercel.app/ | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `className` | string | - | Additional class name. | -| `classNames` | `Partial>` | - | Semantic class names for internal slots. | -| `components` | `{ root?: ComponentType; item?: ComponentType }` | - | Override root and item elements. | -| `current` | number | 0 | Current step index. | -| `iconRender` | `(originNode, info) => ReactNode` | - | Custom step icon renderer. | -| `initial` | number | 0 | Initial step index offset. | -| `itemRender` | `(originNode, info) => ReactNode` | - | Custom step item renderer. | -| `itemWrapperRender` | `(originNode) => ReactNode` | - | Custom step item wrapper renderer. | -| `items` | StepItem[] | [] | Step data. | -| `onChange` | `(current: number) => void` | - | Triggered when a clickable step changes. | +| `className` | string | - | 附加className。 | +| `classNames` | `Partial>` | - | 内部插槽的语义化 className。 | +| `components` | `{ root?: ComponentType; item?: ComponentType }` | - | 覆盖根元素和项目元素。 | +| `current` | number | 0 | 当前步骤索引。 | +| `iconRender` | `(originNode, info) => ReactNode` | - | 自定义步骤图标渲染器。 | +| `initial` | number | 0 | 初始步索引偏移。 | +| `itemRender` | `(originNode, info) => ReactNode` | - | 自定义步骤项渲染器。 | +| `itemWrapperRender` | `(originNode) => ReactNode` | - | 自定义步骤项包装渲染器。 | +| `items` | StepItem[] | [] | 步骤数据。 | +| `onChange` | `(current: number) => void` | - | 当可单击步骤发生更改时触发。 | | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout orientation. | -| `prefixCls` | string | `'rc-steps'` | Prefix class name. | -| `rootClassName` | string | - | Root class name. | -| `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | Current step status. | -| `style` | React.CSSProperties | - | Root style. | -| `styles` | `Partial>` | - | Semantic styles for internal slots. | -| `titlePlacement` | `'horizontal' \| 'vertical'` | `'horizontal'` | Title placement for horizontal steps. | +| `prefixCls` | string | `'rc-steps'` | 前缀className。 | +| `rootClassName` | string | - | 根className。 | +| `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | 当前步骤状态。 | +| `style` | React.CSSProperties | - | 根样式。 | +| `styles` | `Partial>` | - | 内部插槽的语义化样式。 | +| `titlePlacement` | `'horizontal' \| 'vertical'` | `'horizontal'` | 水平步骤的标题位置。 | ### StepItem | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `className` | string | - | Item class name. | -| `classNames` | `Partial>` | - | Semantic class names for this item. | -| `content` | React.ReactNode | - | Step content. | -| `description` | React.ReactNode | - | Deprecated. Use `content` instead. | -| `disabled` | boolean | false | Disable step click behavior. | -| `icon` | React.ReactNode | - | Custom step icon. | -| `onClick` | React.MouseEventHandler | - | Item click handler. | -| `status` | Status | - | Item status. | -| `style` | React.CSSProperties | - | Item style. | -| `styles` | `Partial>` | - | Semantic styles for this item. | +| `className` | string | - | 项目类别名称。 | +| `classNames` | `Partial>` | - | 该项目的语义className称。 | +| `content` | React.ReactNode | - | 步骤内容。 | +| `description` | React.ReactNode | - | 已弃用。请改用 `content`。 | +| `disabled` | boolean | false | 禁用步骤单击行为。 | +| `icon` | React.ReactNode | - | 自定义步骤图标。 | +| `onClick` | React.MouseEventHandler | - | 项目单击处理程序。 | +| `status` | Status | - | 条目状态。 | +| `style` | React.CSSProperties | - | 项目样式。 | +| `styles` | `Partial>` | - | 该项目的语义样式。 | | `subTitle` | React.ReactNode | - | Subtitle. | | `title` | React.ReactNode | - | Title. | @@ -108,8 +107,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/steps is released under the [MIT](./LICENSE.md) license. +@rc-component/steps 基于 [MIT](./LICENSE.md) 许可证发布。 From 5419342689bed4fd9254302a3f4dadd75e3470ac Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 01:28:43 +0800 Subject: [PATCH 12/28] chore: standardize rc tooling and docs --- .dumirc.ts | 2 +- README.md | 11 +++++++++++ README.zh-CN.md | 11 +++++++++++ package.json | 46 +++++++++++++++++++++++----------------------- tsconfig.json | 45 +++++++++++++++++++++++++++++++++++---------- 5 files changed, 81 insertions(+), 34 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index cc07a0e4..2bfd9e4c 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 ? '/steps/' : '/'; -const publicPath = process.env.GH_PAGES ? '/steps/' : '/'; +const publicPath = basePath; export default defineConfig({ alias: { diff --git a/README.md b/README.md index 03490b4c..d5894fed 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,17 @@ export default () => ( Online preview: https://steps.react-component.vercel.app/ +## Examples + +Run the local dumi site: + +```bash +npm install +npm start +``` + +Then open `http://localhost:8000`. + ## API ### Steps diff --git a/README.zh-CN.md b/README.zh-CN.md index 1cf1cb2e..35cc6aee 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -49,6 +49,17 @@ export default () => ( 在线预览:https://steps.react-component.vercel.app/ +## 示例 + +运行本地 dumi 站点: + +```bash +npm install +npm start +``` + +然后打开 `http://localhost:8000`。 + ## API ### Steps diff --git a/package.json b/package.json index 7ab1263a..79adc527 100644 --- a/package.json +++ b/package.json @@ -50,30 +50,30 @@ }, "devDependencies": { "@rc-component/father-plugin": "^2.2.0", - "@rc-component/np": "^1.0.0", - "@testing-library/jest-dom": "^6.4.5", - "@testing-library/react": "^15.0.6", - "@types/jest": "^29.4.0", - "@types/node": "^24.5.2", - "@types/react": "^18.0.28", - "@types/react-dom": "^18.0.11", + "@rc-component/np": "^1.0.4", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^15.0.7", + "@types/jest": "^29.5.14", + "@types/node": "^26.0.1", + "@types/react": "^18.3.31", + "@types/react-dom": "^18.3.7", "@umijs/fabric": "^4.0.1", - "dumi": "^2.0.0", - "eslint": "^8.55.0", - "eslint-plugin-jest": "^27.6.0", - "eslint-plugin-unicorn": "^50.0.1", - "father": "^4", - "gh-pages": "^6.1.0", - "glob": "^10.0.0", - "husky": "^8.0.1", - "less": "^4.1.3", - "lint-staged": "^15.2.0", - "prettier": "^3.1.0", - "rc-test": "^7.0.9", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "typescript": "^5.0.0", - "cross-env": "^7.0.0" + "dumi": "^2.4.35", + "eslint": "^8.57.1", + "eslint-plugin-jest": "^27.9.0", + "eslint-plugin-unicorn": "^56.0.1", + "father": "^4.6.23", + "gh-pages": "^6.3.0", + "glob": "^13.0.6", + "husky": "^9.1.7", + "less": "^4.6.7", + "lint-staged": "^16.4.0", + "prettier": "^3.9.0", + "rc-test": "^7.1.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "typescript": "^5.9.3", + "cross-env": "^10.1.0" }, "peerDependencies": { "react": ">=16.9.0", diff --git a/tsconfig.json b/tsconfig.json index dd69c05a..3d603aab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,20 +3,45 @@ "target": "esnext", "moduleResolution": "node", "baseUrl": "./", - "lib": ["dom", "es2017"], + "lib": [ + "dom", + "es2017" + ], "jsx": "preserve", "declaration": true, "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/steps": ["src/index.ts"], - "@rc-component/steps/es": ["src"], - "@rc-component/steps/es/*": ["src/*"], - "@rc-component/steps/assets/*": ["assets/*"] - } + "@/*": [ + "src/*" + ], + "@@/*": [ + ".dumi/tmp/*" + ], + "@rc-component/steps": [ + "src/index.ts" + ], + "@rc-component/steps/es": [ + "src" + ], + "@rc-component/steps/es/*": [ + "src/*" + ], + "@rc-component/steps/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 d45060944e076f7ea44a2fee142de91a7d5c151b Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:01:08 +0800 Subject: [PATCH 13/28] chore: address standardization review comments --- .github/workflows/surge-preview.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 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." From b03c064ec0b599e669e2dabd00a3081ac7a4174a Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:10:34 +0800 Subject: [PATCH 14/28] chore: include father config in type checks --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 3d603aab..59cde01f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,6 +34,7 @@ "ignoreDeprecations": "5.0" }, "include": [ + ".fatherrc.ts", ".dumirc.ts", "src", "tests", From 3c01b1c43e536b9875a09fe24c295ef44c21dfde Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:28:07 +0800 Subject: [PATCH 15/28] 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 d5894fed..c418626a 100644 --- a/README.md +++ b/README.md @@ -122,4 +122,4 @@ The release flow is handled by `@rc-component/np` through the `rc-np` command af ## License -@rc-component/steps is released under the [MIT](./LICENSE.md) license. +@rc-component/steps is released under the [MIT](./LICENSE) license. diff --git a/README.zh-CN.md b/README.zh-CN.md index 35cc6aee..838eb8ff 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -122,4 +122,4 @@ npm run prepublishOnly ## 许可证 -@rc-component/steps 基于 [MIT](./LICENSE.md) 许可证发布。 +@rc-component/steps 基于 [MIT](./LICENSE) 许可证发布。 From 8f76da0e356e86a62f44ed8df5687d740068a14d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:01:26 +0800 Subject: [PATCH 16/28] ci: use actions checkout v7 --- .github/workflows/react-doctor.yml | 2 +- .github/workflows/surge-preview.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 a10cfceb0cc69668071d0c8fdd3994fd7d19c69c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:32:13 +0800 Subject: [PATCH 17/28] chore: standardize package metadata --- package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 79adc527..2c2cf90a 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ ], "homepage": "https://react-component.github.io/steps", "bugs": { - "url": "https://github.com/react-component/steps/issues" + "url": "https://github.com/react-component/steps/issues" }, "repository": { "type": "git", - "url": "git@github.com:react-component/steps.git" + "url": "https://github.com/react-component/steps.git" }, "license": "MIT", "maintainers": [ @@ -82,5 +82,8 @@ "engines": { "node": ">=8.x" }, - "style": "./assets/index.css" + "style": "./assets/index.css", + "publishConfig": { + "access": "public" + } } From fd19a6a44d73ea4791bc96cba01e6d2f6f3e97e0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:38:24 +0800 Subject: [PATCH 18/28] 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 6d3cc7272885d62ef82e7f3217024dc80b45244f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 15:07:15 +0800 Subject: [PATCH 19/28] 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 1fa7ebcb792005eb11c4aed96c499f1f9515d843 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 16:52:50 +0800 Subject: [PATCH 20/28] docs: localize Chinese README descriptions --- README.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 838eb8ff..9a10e922 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -76,7 +76,7 @@ npm start | `itemWrapperRender` | `(originNode) => ReactNode` | - | 自定义步骤项包装渲染器。 | | `items` | StepItem[] | [] | 步骤数据。 | | `onChange` | `(current: number) => void` | - | 当可单击步骤发生更改时触发。 | -| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout orientation. | +| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | 布局方向。 | | `prefixCls` | string | `'rc-steps'` | 前缀className。 | | `rootClassName` | string | - | 根className。 | | `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | 当前步骤状态。 | From e7908683e3d966b65bce288ae4d61ddcf5925a30 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:16:16 +0800 Subject: [PATCH 21/28] 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 c78711009c65f29f3937602e645564c7a779e298 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:36:48 +0800 Subject: [PATCH 22/28] docs: polish Chinese README wording --- README.zh-CN.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 9a10e922..ba5dac67 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -66,7 +66,7 @@ npm start | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `className` | string | - | 附加className。 | +| `className` | string | - | 附加 className。 | | `classNames` | `Partial>` | - | 内部插槽的语义化 className。 | | `components` | `{ root?: ComponentType; item?: ComponentType }` | - | 覆盖根元素和项目元素。 | | `current` | number | 0 | 当前步骤索引。 | @@ -77,8 +77,8 @@ npm start | `items` | StepItem[] | [] | 步骤数据。 | | `onChange` | `(current: number) => void` | - | 当可单击步骤发生更改时触发。 | | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | 布局方向。 | -| `prefixCls` | string | `'rc-steps'` | 前缀className。 | -| `rootClassName` | string | - | 根className。 | +| `prefixCls` | string | `'rc-steps'` | className 前缀。 | +| `rootClassName` | string | - | 根 className。 | | `status` | `'error' \| 'process' \| 'finish' \| 'wait'` | `'process'` | 当前步骤状态。 | | `style` | React.CSSProperties | - | 根样式。 | | `styles` | `Partial>` | - | 内部插槽的语义化样式。 | @@ -89,7 +89,7 @@ npm start | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | `className` | string | - | 项目类别名称。 | -| `classNames` | `Partial>` | - | 该项目的语义className称。 | +| `classNames` | `Partial>` | - | 该条目的语义 className。 | | `content` | React.ReactNode | - | 步骤内容。 | | `description` | React.ReactNode | - | 已弃用。请改用 `content`。 | | `disabled` | boolean | false | 禁用步骤单击行为。 | From e62e61e86df65e538155ccc07e53c6dda77390b9 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:39:29 +0800 Subject: [PATCH 23/28] 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 c418626a..48313a6b 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,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 ba5dac67..b7d9fb9a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -112,6 +112,8 @@ npm run compile npm run build ``` +dumi 站点默认运行在 `http://localhost:8000`。 + ## 发布 ```bash From d7c73fdb402d6855be2d619b6ccfdfe487837c15 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:58:48 +0800 Subject: [PATCH 24/28] chore: standardize husky configuration --- .husky/pre-commit | 1 + package.json | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..2312dc58 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/package.json b/package.json index 2c2cf90a..61473d0f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "tsc": "tsc --noEmit" + "tsc": "tsc --noEmit", + "prepare": "husky" }, "dependencies": { "@rc-component/util": "^1.11.1", @@ -85,5 +86,8 @@ "style": "./assets/index.css", "publishConfig": { "access": "public" + }, + "lint-staged": { + "*": "prettier --write --ignore-unknown" } } From dc3252302f2c0af9885a2239912aaacea77c5f55 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:33:09 +0800 Subject: [PATCH 25/28] chore: standardize package type entry --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61473d0f..f2d25b2c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ ], "main": "./lib/index", "module": "./es/index", - "types": "./lib/index.d.ts", + "types": "./es/index.d.ts", "files": [ "assets/*.css", "lib", From dbbc4a707aa4c8dfbfdb90b6e9902385c73e29d1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:01:24 +0800 Subject: [PATCH 26/28] 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 48313a6b..4459ebfd 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@

🚶 Structured React steps for progress, navigation, and multi-step workflows.

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

diff --git a/README.zh-CN.md b/README.zh-CN.md index b7d9fb9a..870451ca 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -4,12 +4,12 @@

🚶 React 步骤条组件,支持状态、图标、进度和多种布局。

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

From 75a7f4cfd435ac7ce5be3c16eca4f2267a90f2fc Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:21:17 +0800 Subject: [PATCH 27/28] 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 c5c20614b77e4dc0ac7fba302c6921a1bb6642f2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:30:07 +0800 Subject: [PATCH 28/28] 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