From 3e0af0e723d2828a8849403a959721f7e629cd3a Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 15:54:07 +0800 Subject: [PATCH 01/34] chore: standardize repository config --- .dumirc.ts | 6 + .github/FUNDING.yml | 17 +- .github/dependabot.yml | 36 ++-- .github/workflows/codeql.yml | 43 +++++ .github/workflows/react-component-ci.yml | 4 +- .github/workflows/react-doctor.yml | 27 +++ .github/workflows/surge-preview.yml | 39 ++++ .gitignore | 4 +- README.md | 233 ++++++++++------------- now.json | 11 -- package.json | 13 +- tsconfig.json | 6 +- vercel.json | 6 + 13 files changed, 255 insertions(+), 190 deletions(-) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/react-doctor.yml create mode 100644 .github/workflows/surge-preview.yml delete mode 100644 now.json create mode 100644 vercel.json diff --git a/.dumirc.ts b/.dumirc.ts index 229958b..4e72f33 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,12 +1,18 @@ // more config: https://d.umijs.org/config import { defineConfig } from 'dumi'; +const basePath = process.env.GH_PAGES ? '/progress/' : '/'; +const publicPath = process.env.GH_PAGES ? '/progress/' : '/'; + export default defineConfig({ favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], themeConfig: { name: '@rc-component/progress', logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, + outputPath: 'docs-dist', + base: basePath, + publicPath, exportStatic: {}, styles: [ ` diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 33b1999..758659a 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,15 +1,2 @@ -# These are supported funding model platforms - -github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: ant-design # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: # Replace with a single thanks.dev username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7c9e2a4..4d3949d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,20 +1,20 @@ 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 + - 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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..56785ea --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,43 @@ +name: 'CodeQL' + +on: + push: + branches: ['master'] + pull_request: + branches: ['master'] + schedule: + - cron: '13 8 * * 0' + +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/react-component-ci.yml b/.github/workflows/react-component-ci.yml index c2db94c..677f8ab 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -1,7 +1,9 @@ name: ✅ test on: [push, pull_request] +permissions: + contents: read jobs: test: - uses: react-component/rc-test/.github/workflows/test.yml@main + 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 0000000..f68281c --- /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 0000000..1b29a17 --- /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 005f482..52250a8 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ Thumbs.db node_modules .cache dist +docs-dist assets/**/*.css build lib @@ -38,5 +39,6 @@ pnpm-lock.yaml .dumi/tmp-test .dumi/tmp-production .env.local +.vercel -bun.lockb \ No newline at end of file +bun.lockb diff --git a/README.md b/README.md index 4b3a400..1523a94 100644 --- a/README.md +++ b/README.md @@ -1,163 +1,124 @@ -# @rc-component/progress - -Progress Bar. - -[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][coveralls-image]][coveralls-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url] - -[npm-image]: http://img.shields.io/npm/v/@rc-component/progress.svg?style=flat-square -[npm-url]: http://npmjs.org/package/@rc-component/progress -[github-actions-image]: https://github.com/react-component/progress/workflows/CI/badge.svg -[github-actions-url]: https://github.com/react-component/progress/actions -[circleci-image]: https://img.shields.io/circleci/react-component/progress/master?style=flat-square -[circleci-url]: https://circleci.com/gh/react-component/progress -[coveralls-image]: https://img.shields.io/coveralls/react-component/progress.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/react-component/progress?branch=master -[david-url]: https://david-dm.org/react-component/progress -[david-image]: https://david-dm.org/react-component/progress/status.svg?style=flat-square -[david-dev-url]: https://david-dm.org/react-component/progress?type=dev -[david-dev-image]: https://david-dm.org/react-component/progress/dev-status.svg?style=flat-square -[download-image]: https://img.shields.io/npm/dm/@rc-component/progress.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/progress -[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/progress -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/progress - -## Example - -https://progress.react-component.vercel.app/ - -## Screenshots - - - -## Browsers - -* support IE9+, Chrome, Firefox, Safari +
+

@rc-component/progress

+

📊 Lightweight React line and circle progress indicators with SVG rendering.

+ +

+ + Ant Design + +

+

+ Part of the Ant Design ecosystem +

+ +

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

+
+ +## Highlights + +- `Line` and `Circle` progress components rendered with SVG. +- Single value, segmented value, gradient color, and indeterminate loading states. +- Semantic `classNames` and `styles` slots for root, rail, and track customization. +- TypeScript definitions for the shared progress props. ## Install -[![@rc-component/progress](https://nodei.co/npm/@rc-component/progress.png)](https://npmjs.org/package/@rc-component/progress) +```bash +npm install @rc-component/progress +``` ## Usage -```js -import { Line, Circle } from '@rc-component/progress'; +```tsx | pure +import { Circle, Line } from '@rc-component/progress'; +import React from 'react'; export default () => ( <> - - + + ); ``` -## Compatibility +```tsx | pure +import { Circle } from '@rc-component/progress'; +import React from 'react'; -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Electron](http://godban.github.io/browsers-support-badges/)
Electron | -| --- | --- | --- | --- | --- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | +export default () => ( + +); +``` -## API +## Examples -### props - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
strokeWidthNumber1Width of the stroke. Unit is percentage of SVG canvas size.
strokeColorString#2db7f5Stroke color.
railWidthNumber1Width of the rail stroke. Unit is percentage of SVG canvas size. Rail is always centered relative to actual progress path. If railWidth is not defined, it is the same as strokeWidth.
railColorString#D9D9D9Color for lighter rail stroke underneath the actual progress path.
strokeLinecapString'round'The shape to be used at the end of the progress bar: can be `butt`, `square` or `round`.
prefixClsStringrc-progressprefix className for component
classNameStringcustomized className
styleObjectstyle object will be added to svg element
percentNumber | Number[]0the percent of the progress
gapDegreeNumber0the gap degree of half circle, 0 - 360
gapPositionStringtopthe gap position: can be `top`, `bottom`, `left`, or `right`.
loadingBooleanfalseIf it is true the indeterminate progress will be enabled.
- -## Installation +Run the examples locally: +```bash +npm install +npm start ``` -npm install --save @rc-component/progress -``` + +Online preview: https://progress.react-component.vercel.app/ + +## API + +`Line` and `Circle` share the same base props. + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `className` | string | - | Additional class name for the root node. | +| `classNames` | Partial> | - | Semantic class names for internal slots. | +| `gapDegree` | number | - | Gap degree for circle progress. | +| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'top'` | Gap position for circle progress. | +| `id` | string | - | Root element id. | +| `loading` | boolean | false | Render an indeterminate loading animation. | +| `onClick` | React.MouseEventHandler | - | Click handler for the root SVG. | +| `percent` | number \| number[] | 0 | Progress percent. Arrays render multiple tracks. | +| `prefixCls` | string | `'rc-progress'` | Prefix class name. | +| `railColor` | string | `'#D9D9D9'` | Rail color. | +| `railWidth` | number | `strokeWidth` | Rail stroke width. | +| `steps` | number \| { count: number; gap: number } | - | Render progress as discrete steps. | +| `strokeColor` | string \| Record \| Array> | `'#2db7f5'` | Track color, gradient object, or per-track colors. | +| `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | Stroke line cap. | +| `strokeWidth` | number | 1 | Track stroke width. | +| `style` | React.CSSProperties | - | Root style. | +| `styles` | Partial> | - | Semantic styles for internal slots. | +| `transition` | string | - | CSS transition for track updates. | ## Development -``` +```bash npm install npm start +npm test +npm run tsc +npm run compile +npm run build +``` + +## Release + +Package artifacts are built with Father: + +```bash +npm run compile ``` +Publishing is handled by `rc-np` through the `prepublishOnly` script. + ## License -@rc-component/progress is released under the MIT license. +`@rc-component/progress` is released under the MIT license. diff --git a/now.json b/now.json deleted file mode 100644 index 093e120..0000000 --- a/now.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": 2, - "name": "@rc-component/progress", - "builds": [ - { - "src": "package.json", - "use": "@now/static-build", - "config": { "distDir": "dist" } - } - ] -} diff --git a/package.json b/package.json index 9cd95de..fa1acfd 100644 --- a/package.json +++ b/package.json @@ -25,19 +25,19 @@ ], "scripts": { "start": "dumi dev", + "build": "npm run docs:build", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d dist", - "deploy": "npm run docs:build && npm run docs:deploy", + "docs:deploy": "gh-pages -d docs-dist", + "deploy": "npm run gh-pages", "compile": "father build", "prepare": "dumi setup", - "gh-pages": "npm run now-build && father doc deploy", + "gh-pages": "GH_PAGES=1 npm run docs:build && npm run docs:deploy", "prepublishOnly": "npm run compile && rc-np", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js", - "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", + "prettier": "prettier --write --ignore-unknown .", "test": "rc-test", "tsc": "tsc --noEmit", - "coverage": "father test --coverage", - "now-build": "npm run docs:build" + "coverage": "father test --coverage" }, "dependencies": { "@rc-component/util": "^1.11.1", @@ -58,6 +58,7 @@ "eslint-plugin-jest": "^27.6.0", "eslint-plugin-unicorn": "^50.0.1", "father": "^4.0.0", + "gh-pages": "^6.1.0", "glob": "^8.0.1", "prettier": "^3.1.1", "rc-test": "^7.0.15", diff --git a/tsconfig.json b/tsconfig.json index a2ff56f..90cc5ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,7 @@ "@@/*": [".dumi/tmp/*"], "@rc-component/progress": ["src/index.ts"] } - } -} \ No newline at end of file + }, + "include": [".dumirc.ts", "src", "docs", "tests"], + "exclude": ["node_modules", "lib", "es", "dist", "docs-dist", ".dumi"] +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..5f9139e --- /dev/null +++ b/vercel.json @@ -0,0 +1,6 @@ +{ + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "docs-dist" +} From 02bba574707744aff0280ae3bb4ea61ce09078af Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 15:59:13 +0800 Subject: [PATCH 02/34] chore: align preview output directory --- .dumirc.ts | 1 - .github/workflows/surge-preview.yml | 2 +- package.json | 2 +- vercel.json | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index 4e72f33..870f2d7 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -10,7 +10,6 @@ export default defineConfig({ name: '@rc-component/progress', logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, - outputPath: 'docs-dist', base: basePath, publicPath, exportStatic: {}, diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 1b29a17..df4510b 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -28,7 +28,7 @@ jobs: with: surge_token: ${{ env.SURGE_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} - dist: docs-dist + dist: dist failOnError: true setCommitStatus: true build: | diff --git a/package.json b/package.json index fa1acfd..6ea633a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "start": "dumi dev", "build": "npm run docs:build", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d docs-dist", + "docs:deploy": "gh-pages -d dist", "deploy": "npm run gh-pages", "compile": "father build", "prepare": "dumi setup", diff --git a/vercel.json b/vercel.json index 5f9139e..e884e1b 100644 --- a/vercel.json +++ b/vercel.json @@ -2,5 +2,5 @@ "framework": "umijs", "installCommand": "npm install", "buildCommand": "npm run build", - "outputDirectory": "docs-dist" + "outputDirectory": "dist" } From 2a1b15e00d8def52bd59814e0d74a26aa3b78557 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 16:07:50 +0800 Subject: [PATCH 03/34] docs: correct progress api defaults --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1523a94..30fc24e 100644 --- a/README.md +++ b/README.md @@ -82,14 +82,14 @@ Online preview: https://progress.react-component.vercel.app/ | `className` | string | - | Additional class name for the root node. | | `classNames` | Partial> | - | Semantic class names for internal slots. | | `gapDegree` | number | - | Gap degree for circle progress. | -| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'top'` | Gap position for circle progress. | +| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | Gap position for circle progress. | | `id` | string | - | Root element id. | | `loading` | boolean | false | Render an indeterminate loading animation. | | `onClick` | React.MouseEventHandler | - | Click handler for the root SVG. | | `percent` | number \| number[] | 0 | Progress percent. Arrays render multiple tracks. | | `prefixCls` | string | `'rc-progress'` | Prefix class name. | | `railColor` | string | `'#D9D9D9'` | Rail color. | -| `railWidth` | number | `strokeWidth` | Rail stroke width. | +| `railWidth` | number | 1 | Rail stroke width. | | `steps` | number \| { count: number; gap: number } | - | Render progress as discrete steps. | | `strokeColor` | string \| Record \| Array> | `'#2db7f5'` | Track color, gradient object, or per-track colors. | | `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | Stroke line cap. | From 0f2ae4b0aea2e7a7a2e7d09587551dfe6cd17399 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:27:30 +0800 Subject: [PATCH 04/34] chore: address AI review feedback --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ea633a..aac06b7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "deploy": "npm run gh-pages", "compile": "father build", "prepare": "dumi setup", - "gh-pages": "GH_PAGES=1 npm run docs:build && npm run docs:deploy", + "gh-pages": "cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy", "prepublishOnly": "npm run compile && rc-np", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js", "prettier": "prettier --write --ignore-unknown .", @@ -53,6 +53,7 @@ "@types/react": "^18.0.9", "@types/react-dom": "^18.0.3", "@umijs/fabric": "^3.0.0", + "cross-env": "^7.0.0", "dumi": "^2.0.0", "eslint": "^8.57.0", "eslint-plugin-jest": "^27.6.0", From 2e82d79441410170d57f6f40331fe6b12d418567 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:56:49 +0800 Subject: [PATCH 05/34] docs: standardize README release details --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30fc24e..e7c094e 100644 --- a/README.md +++ b/README.md @@ -111,14 +111,12 @@ npm run build ## Release -Package artifacts are built with Father: - ```bash -npm run compile +npm run prepublishOnly ``` -Publishing is handled by `rc-np` through the `prepublishOnly` script. +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. ## License -`@rc-component/progress` is released under the MIT license. +@rc-component/progress is released under the [MIT](./LICENSE.md) license. From 343e9c554b21af1962ce7b7a964ac9cbe9ccf897 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:13:58 +0800 Subject: [PATCH 06/34] 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 df4510b..9bd6c8a 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: dist - failOnError: true + failOnError: false setCommitStatus: true build: | npm install From c456c708674ad206bb52b33d09125e0cab51c463 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:17:45 +0800 Subject: [PATCH 07/34] docs: clarify Ant Design ecosystem note --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e7c094e..8202001 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,15 @@

+

+ + + Ant Design + + Part of the Ant Design ecosystem. + +

+ ## Highlights - `Line` and `Circle` progress components rendered with SVG. From e3545d28a748bda5619e6de06b2caaeeedd827a1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:25:42 +0800 Subject: [PATCH 08/34] 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 9bd6c8a..b4a6a34 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -30,7 +30,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} dist: dist failOnError: false - setCommitStatus: true + setCommitStatus: false build: | npm install npm run build From 15062169cd8d2d2442ae2d70920717a21ee42b16 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:04:02 +0800 Subject: [PATCH 09/34] docs: refine README usage and ecosystem note --- README.md | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/README.md b/README.md index 8202001..95e5584 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@

@rc-component/progress

+

Part of the Ant Design ecosystem.

📊 Lightweight React line and circle progress indicators with SVG rendering.

- -

- - Ant Design - -

Part of the Ant Design ecosystem

@@ -21,14 +16,6 @@

-

- - - Ant Design - - Part of the Ant Design ecosystem. - -

## Highlights @@ -47,8 +34,6 @@ npm install @rc-component/progress ```tsx | pure import { Circle, Line } from '@rc-component/progress'; -import React from 'react'; - export default () => ( <> @@ -59,8 +44,6 @@ export default () => ( ```tsx | pure import { Circle } from '@rc-component/progress'; -import React from 'react'; - export default () => ( Date: Sat, 27 Jun 2026 13:22:17 +0800 Subject: [PATCH 10/34] 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 b4a6a34..b0f5a83 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: 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 93a6549909b3741ca746f56c841a6f491f1a658f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:51:08 +0800 Subject: [PATCH 11/34] chore: address review comments --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 95e5584..3dbbb15 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@

@rc-component/progress

Part of the Ant Design ecosystem.

📊 Lightweight React line and circle progress indicators with SVG rendering.

-

- Part of the Ant Design ecosystem -

npm version From e074d1a0d2a78016615e2c44daff90d1150738fb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:19:54 +0800 Subject: [PATCH 12/34] docs: add Chinese README --- README.md | 2 + README.zh-CN.md | 113 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 README.zh-CN.md diff --git a/README.md b/README.md index 3dbbb15..ed04dc2 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 0000000..4614640 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,113 @@ +
+

@rc-component/progress

+

Ant Design 生态的一部分。

+

📊 React 进度条组件,支持线型、圆形和自定义进度展示。

+ +

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

+
+ +

English | 简体中文

+ + +## 特性 + +- `Line` and `Circle` progress components rendered with SVG. +- Single value, segmented value, gradient color, and indeterminate loading states. +- Semantic `classNames` and `styles` slots for root, rail, and track customization. +- TypeScript definitions for the shared progress props. + +## 安装 + +```bash +npm install @rc-component/progress +``` + +## 使用 + +```tsx | pure +import { Circle, Line } from '@rc-component/progress'; +export default () => ( + <> + + + +); +``` + +```tsx | pure +import { Circle } from '@rc-component/progress'; +export default () => ( + +); +``` + +## 示例 + +本地运行示例: + +```bash +npm install +npm start +``` + +Online preview: https://progress.react-component.vercel.app/ + +## API + +`Line` and `Circle` share the same base props. + +| 名称 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `className` | string | - | Additional class name for the root node. | +| `classNames` | Partial> | - | Semantic class names for internal slots. | +| `gapDegree` | number | - | Gap degree for circle progress. | +| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | Gap position for circle progress. | +| `id` | string | - | Root element id. | +| `loading` | boolean | false | Render an indeterminate loading animation. | +| `onClick` | React.MouseEventHandler | - | Click handler for the root SVG. | +| `percent` | number \| number[] | 0 | Progress percent. Arrays render multiple tracks. | +| `prefixCls` | string | `'rc-progress'` | Prefix class name. | +| `railColor` | string | `'#D9D9D9'` | Rail color. | +| `railWidth` | number | 1 | Rail stroke width. | +| `steps` | number \| { count: number; gap: number } | - | Render progress as discrete steps. | +| `strokeColor` | string \| Record \| Array> | `'#2db7f5'` | Track color, gradient object, or per-track colors. | +| `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | Stroke line cap. | +| `strokeWidth` | number | 1 | Track stroke width. | +| `style` | React.CSSProperties | - | Root style. | +| `styles` | Partial> | - | Semantic styles for internal slots. | +| `transition` | string | - | CSS transition for track updates. | + +## 本地开发 + +```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/progress is released under the [MIT](./LICENSE.md) license. From 5aa70f6424474521414efa8841d86556ea70bfbb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:34:41 +0800 Subject: [PATCH 13/34] 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 ed04dc2..b9aea96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

@rc-component/progress

Part of the Ant Design ecosystem.

+ Ant Design

📊 Lightweight React line and circle progress indicators with SVG rendering.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 4614640..775b799 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,7 @@

@rc-component/progress

Ant Design 生态的一部分。

+ Ant Design

📊 React 进度条组件,支持线型、圆形和自定义进度展示。

From 414ca4063d7f72d8c174b83903ff3ba32314d9f8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 23:03:32 +0800 Subject: [PATCH 14/34] docs: refine bilingual README branding --- README.md | 3 +-- README.zh-CN.md | 51 ++++++++++++++++++++++++------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index b9aea96..caca3aa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@

@rc-component/progress

-

Part of the Ant Design ecosystem.

- Ant Design +

Ant Design Part of the Ant Design ecosystem.

📊 Lightweight React line and circle progress indicators with SVG rendering.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 775b799..248aef8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,7 +1,6 @@

@rc-component/progress

-

Ant Design 生态的一部分。

- Ant Design +

Ant Design Ant Design 生态的一部分。

📊 React 进度条组件,支持线型、圆形和自定义进度展示。

@@ -19,10 +18,10 @@ ## 特性 -- `Line` and `Circle` progress components rendered with SVG. -- Single value, segmented value, gradient color, and indeterminate loading states. -- Semantic `classNames` and `styles` slots for root, rail, and track customization. -- TypeScript definitions for the shared progress props. +- `Line` 和 `Circle` 使用 SVG 渲染的进度组件。 +- 单值、分段值、渐变颜色和不确定的加载状态。 +- 用于根、导轨和轨道定制的语义 `classNames` 和 `styles` 插槽。 +- 为共享进度属性提供 TypeScript 类型定义。 ## 安装 @@ -63,32 +62,32 @@ npm install npm start ``` -Online preview: https://progress.react-component.vercel.app/ +在线预览:https://progress.react-component.vercel.app/ ## API -`Line` and `Circle` share the same base props. +`Line` 和 `Circle` 共享相同的基础属性。 | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `className` | string | - | Additional class name for the root node. | -| `classNames` | Partial> | - | Semantic class names for internal slots. | -| `gapDegree` | number | - | Gap degree for circle progress. | -| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | Gap position for circle progress. | -| `id` | string | - | Root element id. | -| `loading` | boolean | false | Render an indeterminate loading animation. | -| `onClick` | React.MouseEventHandler | - | Click handler for the root SVG. | -| `percent` | number \| number[] | 0 | Progress percent. Arrays render multiple tracks. | -| `prefixCls` | string | `'rc-progress'` | Prefix class name. | +| `className` | string | - | 根节点的附加className称。 | +| `classNames` | 部分<记录<'根'\| '铁路' | '轨道',字符串>> | - | 内部插槽的语义化 className。 | +| `gapDegree` | number | - | 循环进度的差距度。 | +| `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | 循环进度的间隙位置。 | +| `id` | string | - | 根元素 ID。 | +| `loading` | boolean | false | 渲染不确定的加载动画。 | +| `onClick` | React.MouseEventHandler | - | 单击根 SVG 的处理程序。 | +| `percent` | number \| number[] | 0 | 进度百分比。数组会渲染多条轨道。 | +| `prefixCls` | string | `'rc-progress'` | 前缀className。 | | `railColor` | string | `'#D9D9D9'` | Rail color. | -| `railWidth` | number | 1 | Rail stroke width. | -| `steps` | number \| { count: number; gap: number } | - | Render progress as discrete steps. | -| `strokeColor` | string \| Record \| Array> | `'#2db7f5'` | Track color, gradient object, or per-track colors. | +| `railWidth` | number | 1 | 导轨行程宽度。 | +| `steps` | 数字\| { 计数:数量;间隙:数量 } | - | 以离散步骤渲染进度。 | +| `strokeColor` | 字符串\|记录<字符串,字符串\|布尔值> \|数组<字符串\|记录<字符串,字符串\|布尔值>> | `'#2db7f5'` | 轨道颜色、渐变对象或每条轨道的颜色。 | | `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | Stroke line cap. | -| `strokeWidth` | number | 1 | Track stroke width. | -| `style` | React.CSSProperties | - | Root style. | -| `styles` | Partial> | - | Semantic styles for internal slots. | -| `transition` | string | - | CSS transition for track updates. | +| `strokeWidth` | number | 1 | 轨道描边宽度。 | +| `style` | React.CSSProperties | - | 根样式。 | +| `styles` | 部分<记录<'根'\| '铁路' | 'track',React.CSSProperties>> | - | 内部插槽的语义化样式。 | +| `transition` | string | - | 用于跟踪更新的 CSS 过渡。 | ## 本地开发 @@ -107,8 +106,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/progress is released under the [MIT](./LICENSE.md) license. +@rc-component/progress 基于 [MIT](./LICENSE.md) 许可证发布。 From 87f1c6f29c30e693f065eecd4332fdf4bd7fba38 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 01:28:42 +0800 Subject: [PATCH 15/34] chore: standardize rc tooling and docs --- .dumirc.ts | 3 ++- .github/workflows/surge-preview.yml | 2 +- README.md | 4 +-- README.zh-CN.md | 4 +-- package.json | 40 ++++++++++++++--------------- tsconfig.json | 31 +++++++++++++++++----- vercel.json | 2 +- 7 files changed, 53 insertions(+), 33 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index 870f2d7..bb214c5 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -2,9 +2,10 @@ import { defineConfig } from 'dumi'; const basePath = process.env.GH_PAGES ? '/progress/' : '/'; -const publicPath = process.env.GH_PAGES ? '/progress/' : '/'; +const publicPath = basePath; export default defineConfig({ + outputPath: 'docs-dist', favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], themeConfig: { name: '@rc-component/progress', diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index b0f5a83..faf6b8b 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -34,7 +34,7 @@ jobs: with: surge_token: ${{ env.SURGE_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} - dist: dist + dist: docs-dist failOnError: false setCommitStatus: false - name: Skip Surge preview diff --git a/README.md b/README.md index caca3aa..17ff5b7 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,14 @@ export default () => ( ## Examples -Run the examples locally: +Run the local dumi site: ```bash npm install npm start ``` -Online preview: https://progress.react-component.vercel.app/ +Then open `http://localhost:8000`. ## API diff --git a/README.zh-CN.md b/README.zh-CN.md index 248aef8..cdc2cb3 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -55,14 +55,14 @@ export default () => ( ## 示例 -本地运行示例: +运行本地 dumi 站点: ```bash npm install npm start ``` -在线预览:https://progress.react-component.vercel.app/ +然后打开 `http://localhost:8000`。 ## API diff --git a/package.json b/package.json index aac06b7..95ee013 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "start": "dumi dev", "build": "npm run docs:build", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d dist", + "docs:deploy": "gh-pages -d docs-dist", "deploy": "npm run gh-pages", "compile": "father build", "prepare": "dumi setup", @@ -46,26 +46,26 @@ "devDependencies": { "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", - "@testing-library/react": "^13.0.0", - "@types/jest": "^29.4.0", + "@testing-library/react": "^15.0.7", + "@types/jest": "^29.5.14", "@types/keyv": "3.1.4", - "@types/node": "^24.5.2", - "@types/react": "^18.0.9", - "@types/react-dom": "^18.0.3", - "@umijs/fabric": "^3.0.0", - "cross-env": "^7.0.0", - "dumi": "^2.0.0", - "eslint": "^8.57.0", - "eslint-plugin-jest": "^27.6.0", - "eslint-plugin-unicorn": "^50.0.1", - "father": "^4.0.0", - "gh-pages": "^6.1.0", - "glob": "^8.0.1", - "prettier": "^3.1.1", - "rc-test": "^7.0.15", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "typescript": "^5.0.0" + "@types/node": "^26.0.1", + "@types/react": "^18.3.31", + "@types/react-dom": "^18.3.7", + "@umijs/fabric": "^4.0.1", + "cross-env": "^10.1.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", + "prettier": "^3.9.0", + "rc-test": "^7.1.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "typescript": "^5.9.3" }, "peerDependencies": { "react": ">=16.9.0", diff --git a/tsconfig.json b/tsconfig.json index 90cc5ae..dc3b4fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,11 +8,30 @@ "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/progress": ["src/index.ts"] - } + "@/*": [ + "src/*" + ], + "@@/*": [ + ".dumi/tmp/*" + ], + "@rc-component/progress": [ + "src/index.ts" + ] + }, + "ignoreDeprecations": "5.0" }, - "include": [".dumirc.ts", "src", "docs", "tests"], - "exclude": ["node_modules", "lib", "es", "dist", "docs-dist", ".dumi"] + "include": [ + ".dumirc.ts", + "src", + "docs", + "tests" + ], + "exclude": [ + "node_modules", + "lib", + "es", + "dist", + "docs-dist", + ".dumi" + ] } diff --git a/vercel.json b/vercel.json index e884e1b..5f9139e 100644 --- a/vercel.json +++ b/vercel.json @@ -2,5 +2,5 @@ "framework": "umijs", "installCommand": "npm install", "buildCommand": "npm run build", - "outputDirectory": "dist" + "outputDirectory": "docs-dist" } From 8eaedd27bbd8fb8255b3b6bf989301845523798d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:01:07 +0800 Subject: [PATCH 16/34] chore: address standardization review comments --- .github/workflows/surge-preview.yml | 16 +++++++++++++--- README.zh-CN.md | 16 ++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index faf6b8b..cb6c8c4 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 cdc2cb3..35477c9 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -70,23 +70,23 @@ npm start | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `className` | string | - | 根节点的附加className称。 | -| `classNames` | 部分<记录<'根'\| '铁路' | '轨道',字符串>> | - | 内部插槽的语义化 className。 | +| `className` | string | - | 根节点的附加 className。 | +| `classNames` | `Partial>` | - | 内部插槽的语义化 className。 | | `gapDegree` | number | - | 循环进度的差距度。 | | `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | 循环进度的间隙位置。 | | `id` | string | - | 根元素 ID。 | | `loading` | boolean | false | 渲染不确定的加载动画。 | | `onClick` | React.MouseEventHandler | - | 单击根 SVG 的处理程序。 | | `percent` | number \| number[] | 0 | 进度百分比。数组会渲染多条轨道。 | -| `prefixCls` | string | `'rc-progress'` | 前缀className。 | -| `railColor` | string | `'#D9D9D9'` | Rail color. | +| `prefixCls` | string | `'rc-progress'` | 前缀 className。 | +| `railColor` | string | `'#D9D9D9'` | 导轨颜色。 | | `railWidth` | number | 1 | 导轨行程宽度。 | -| `steps` | 数字\| { 计数:数量;间隙:数量 } | - | 以离散步骤渲染进度。 | -| `strokeColor` | 字符串\|记录<字符串,字符串\|布尔值> \|数组<字符串\|记录<字符串,字符串\|布尔值>> | `'#2db7f5'` | 轨道颜色、渐变对象或每条轨道的颜色。 | -| `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | Stroke line cap. | +| `steps` | number \| { count: number; gap: number } | - | 以离散步骤渲染进度。 | +| `strokeColor` | string \| Record \| Array> | `'#2db7f5'` | 轨道颜色、渐变对象或每条轨道的颜色。 | +| `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | 描边端点样式。 | | `strokeWidth` | number | 1 | 轨道描边宽度。 | | `style` | React.CSSProperties | - | 根样式。 | -| `styles` | 部分<记录<'根'\| '铁路' | 'track',React.CSSProperties>> | - | 内部插槽的语义化样式。 | +| `styles` | `Partial>` | - | 内部插槽的语义化样式。 | | `transition` | string | - | 用于跟踪更新的 CSS 过渡。 | ## 本地开发 From 4f07145b8fd59e14b13790e9de25d15de6104f01 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:10:34 +0800 Subject: [PATCH 17/34] chore: include father config in type checks --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index dc3b4fa..0a8f3a8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "ignoreDeprecations": "5.0" }, "include": [ + ".fatherrc.ts", ".dumirc.ts", "src", "docs", From f78c7970d5631e0d01bba1d185144207b6afd3b7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:24:20 +0800 Subject: [PATCH 18/34] 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 56785ea..adb46ee 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 6a9f75a9dd6289ef156c4cf362d84bddc55f57d1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:29:55 +0800 Subject: [PATCH 19/34] 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 adb46ee..56785ea 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 4ae7cff8e240904defbe059fa683613ddd6eed82 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:27:46 +0800 Subject: [PATCH 20/34] 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 0000000..bd0a1f7 --- /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 17ff5b7..5a48f10 100644 --- a/README.md +++ b/README.md @@ -110,4 +110,4 @@ The release flow is handled by `@rc-component/np` through the `rc-np` command af ## License -@rc-component/progress is released under the [MIT](./LICENSE.md) license. +@rc-component/progress is released under the [MIT](./LICENSE) license. diff --git a/README.zh-CN.md b/README.zh-CN.md index 35477c9..f850816 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -110,4 +110,4 @@ npm run prepublishOnly ## 许可证 -@rc-component/progress 基于 [MIT](./LICENSE.md) 许可证发布。 +@rc-component/progress 基于 [MIT](./LICENSE) 许可证发布。 From 6a71b5892445cfe28db0dfb426c93dfb6b84d27f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:00:52 +0800 Subject: [PATCH 21/34] 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 56785ea..1c7e7bf 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 f68281c..097eb88 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 cb6c8c4..ebfecd5 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 89b565df0e5051c7129ec7e33ff2bff622cbf7ac Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:31:44 +0800 Subject: [PATCH 22/34] chore: standardize package metadata --- package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 95ee013..59d99a7 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,13 @@ "react-progress", "progress" ], - "homepage": "http://github.com/react-component/progress", + "homepage": "https://react-component.github.io/progress", "repository": { "type": "git", - "url": "git@github.com:react-component/progress.git" + "url": "https://github.com/react-component/progress.git" }, "bugs": { - "url": "http://github.com/react-component/progress/issues" + "url": "https://github.com/react-component/progress/issues" }, "license": "MIT", "main": "./lib/index", @@ -70,5 +70,8 @@ "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" + }, + "publishConfig": { + "access": "public" } } From 5a8048b0358122c43fb22da2d508e6b8e673420d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:37:59 +0800 Subject: [PATCH 23/34] ci: standardize dependabot updates --- .github/dependabot.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4d3949d..3b730ef 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,18 +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 - 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 From aa1a4d8315c37995b4832988997377cccc489e72 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 16:27:28 +0800 Subject: [PATCH 24/34] docs: fix Chinese README API names --- README.zh-CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index f850816..9fa55f2 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -71,7 +71,7 @@ npm start | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | `className` | string | - | 根节点的附加 className。 | -| `classNames` | `Partial>` | - | 内部插槽的语义化 className。 | +| `classNames` | Partial> | - | 内部插槽的语义化 className。 | | `gapDegree` | number | - | 循环进度的差距度。 | | `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | 循环进度的间隙位置。 | | `id` | string | - | 根元素 ID。 | @@ -86,7 +86,7 @@ npm start | `strokeLinecap` | `'round'` \| `'butt'` \| `'square'` | `'round'` | 描边端点样式。 | | `strokeWidth` | number | 1 | 轨道描边宽度。 | | `style` | React.CSSProperties | - | 根样式。 | -| `styles` | `Partial>` | - | 内部插槽的语义化样式。 | +| `styles` | Partial> | - | 内部插槽的语义化样式。 | | `transition` | string | - | 用于跟踪更新的 CSS 过渡。 | ## 本地开发 From fc23f58a948ddb2ead4c9629de8d549d9c2884ed Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:15:35 +0800 Subject: [PATCH 25/34] 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 ebfecd5..eaff160 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 0000000..c466d87 --- /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 5db958bf3e300888fbbfb2187e4ed8a8b85f303d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:38:57 +0800 Subject: [PATCH 26/34] 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 5a48f10..6f80d6c 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,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 9fa55f2..2e6d71e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -100,6 +100,8 @@ npm run compile npm run build ``` +dumi 站点默认运行在 `http://localhost:8000`。 + ## 发布 ```bash From d574c191db947fc1eccf3dfd6f895c3c0ddcb777 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:58:14 +0800 Subject: [PATCH 27/34] chore: standardize husky configuration --- .husky/pre-commit | 1 + package.json | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..2312dc5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/package.json b/package.json index 59d99a7..e0a7036 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "docs:deploy": "gh-pages -d docs-dist", "deploy": "npm run gh-pages", "compile": "father build", - "prepare": "dumi setup", + "prepare": "husky && dumi setup", "gh-pages": "cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy", "prepublishOnly": "npm run compile && rc-np", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js", @@ -65,7 +65,9 @@ "rc-test": "^7.1.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "husky": "^9.1.7", + "lint-staged": "^16.4.0" }, "peerDependencies": { "react": ">=16.9.0", @@ -73,5 +75,8 @@ }, "publishConfig": { "access": "public" + }, + "lint-staged": { + "*": "prettier --write --ignore-unknown" } } From 089320424186093017191fc19e123f8d105b4f02 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:32:45 +0800 Subject: [PATCH 28/34] chore: standardize package type entry --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e0a7036..7fb8689 100644 --- a/package.json +++ b/package.json @@ -78,5 +78,6 @@ }, "lint-staged": { "*": "prettier --write --ignore-unknown" - } + }, + "types": "./es/index.d.ts" } From 86b8783c153c647904a37f119a9ab6fbcccffd46 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:00:57 +0800 Subject: [PATCH 29/34] 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 6f80d6c..b846f83 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@

📊 Lightweight React line and circle progress indicators with SVG rendering.

- 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 2e6d71e..f8fbfef 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 6d2bba92e661b8ffc6479ea800710616c05f4b36 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:20:38 +0800 Subject: [PATCH 30/34] 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 677f8ab..c20cb88 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -6,4 +6,6 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 8bd90238e472d678548c4b2dbebae87930911b19 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:29:41 +0800 Subject: [PATCH 31/34] 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 c20cb88..677f8ab 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -6,6 +6,4 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: - - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + secrets: inherit From d145a98ec5576dde7448d404471b465357c2245b Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:52:44 +0800 Subject: [PATCH 32/34] docs: polish zh-CN readme wording --- README.zh-CN.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index f8fbfef..e7ee689 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -15,7 +15,6 @@

English | 简体中文

- ## 特性 - `Line` 和 `Circle` 使用 SVG 渲染的进度组件。 @@ -72,7 +71,7 @@ npm start | --- | --- | --- | --- | | `className` | string | - | 根节点的附加 className。 | | `classNames` | Partial> | - | 内部插槽的语义化 className。 | -| `gapDegree` | number | - | 循环进度的差距度。 | +| `gapDegree` | number | - | 环形进度缺口角度。 | | `gapPosition` | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | `'bottom'` | 循环进度的间隙位置。 | | `id` | string | - | 根元素 ID。 | | `loading` | boolean | false | 渲染不确定的加载动画。 | From 39c748cdced14915ffb18be76ae4ac0a7f56f302 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 01:00:10 +0800 Subject: [PATCH 33/34] 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 eaff160..4c2f17e 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 0431c52c4128c8ac6593322f2145028753c1db8b Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 14:26:01 +0800 Subject: [PATCH 34/34] 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 677f8ab..e2b301b 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -6,4 +6,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