From 2a882af936b11b763183ffcb74989face0407deb Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 13:05:42 +0800 Subject: [PATCH 01/34] chore: standardize repository setup --- .github/FUNDING.yml | 17 +- .../workflows/cloudflare-pages-preview.yml | 38 +++++ .github/workflows/codeql.yml | 22 +-- .github/workflows/react-component-ci.yml | 4 +- .github/workflows/react-doctor.yml | 27 +++ .github/workflows/surge-preview.yml | 35 ++++ README.md | 156 +++++++++--------- now.json | 11 -- package.json | 12 +- vercel.json | 6 + 10 files changed, 208 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/cloudflare-pages-preview.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/.github/FUNDING.yml b/.github/FUNDING.yml index 33b1999c..758659af 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/workflows/cloudflare-pages-preview.yml b/.github/workflows/cloudflare-pages-preview.yml new file mode 100644 index 00000000..c1738dfe --- /dev/null +++ b/.github/workflows/cloudflare-pages-preview.yml @@ -0,0 +1,38 @@ +name: Cloudflare Pages Preview + +on: + pull_request: + +permissions: + contents: read + deployments: write + +jobs: + preview: + runs-on: ubuntu-latest + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }} + PREVIEW: true + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - name: Skip Cloudflare Pages preview + if: ${{ env.CLOUDFLARE_API_TOKEN == '' || env.CLOUDFLARE_ACCOUNT_ID == '' || env.CLOUDFLARE_PAGES_PROJECT == '' }} + run: echo "Cloudflare Pages preview is not configured; skip deployment." + - name: Install dependencies + if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} + run: npm install + - name: Build site + if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} + run: npm run build + - name: Deploy preview + if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} + uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 + with: + apiToken: ${{ env.CLOUDFLARE_API_TOKEN }} + accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy dist --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT }} --branch=${{ github.head_ref }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1682c054..3dd511db 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,12 +1,12 @@ -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ "master" ] + branches: ['master'] pull_request: - branches: [ "master" ] + branches: ['master'] schedule: - - cron: "57 7 * * 2" + - cron: '57 7 * * 2' jobs: analyze: @@ -20,22 +20,24 @@ jobs: strategy: fail-fast: false matrix: - language: [ javascript ] + language: [javascript] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: - category: "/language:${{ matrix.language }}" + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 5735e2d2..f8482b63 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -2,5 +2,5 @@ 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 + 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..1b7fc7e2 --- /dev/null +++ b/.github/workflows/surge-preview.yml @@ -0,0 +1,35 @@ +name: Surge Preview + +on: + pull_request: + +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: 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/README.md b/README.md index 40920efb..b9d63499 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,124 @@ -# @rc-component/dialog +
+

@rc-component/dialog

+

💬 A composable dialog component for React.

-react dialog component. + + Ant Design + + +

Part of the Ant Design ecosystem.

[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] +
+ [npm-image]: https://img.shields.io/npm/v/@rc-component/dialog.svg?style=flat-square [npm-url]: https://npmjs.org/package/@rc-component/dialog -[travis-image]: https://img.shields.io/travis/react-component/dialog/master?style=flat-square -[travis-url]: https://travis-ci.com/react-component/dialog [github-actions-image]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml/badge.svg [github-actions-url]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml [codecov-image]: https://img.shields.io/codecov/c/github/react-component/dialog/master.svg?style=flat-square [codecov-url]: https://app.codecov.io/gh/react-component/dialog -[david-url]: https://david-dm.org/react-component/dialog -[david-image]: https://david-dm.org/react-component/dialog/status.svg?style=flat-square -[david-dev-url]: https://david-dm.org/react-component/dialog?type=dev -[david-dev-image]: https://david-dm.org/react-component/dialog/dev-status.svg?style=flat-square [download-image]: https://img.shields.io/npm/dm/@rc-component/dialog.svg?style=flat-square [download-url]: https://npmjs.org/package/@rc-component/dialog +[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/%40rc-component%2Fdialog?style=flat-square [bundlephobia-url]: https://bundlephobia.com/package/@rc-component/dialog -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/dialog -[dumi-url]: https://github.com/umijs/dumi [dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square +[dumi-url]: https://github.com/umijs/dumi +## Highlights -## Screenshot - - - -## Example - -http://localhost:8007/examples/ - -online example: https://dialog.react-component.vercel.app/ +- Supports controlled visibility, mask, keyboard close, and focus restoration. +- Allows custom title, footer, close icon, container, motion, and modal content rendering. +- Provides semantic `classNames` and `styles` hooks for the dialog structure. +- Ships compiled JavaScript, TypeScript definitions, and CSS assets. ## Install -[![@rc-component/dialog](https://nodei.co/npm/@rc-component/dialog.png)](https://npmjs.org/package/@rc-component/dialog) +```bash +npm install @rc-component/dialog +``` ## Usage -```js -var Dialog = require('@rc-component/dialog'); +```tsx | pure +import Dialog from '@rc-component/dialog'; +import '@rc-component/dialog/assets/index.css'; + +export default function App() { + return ( + {}}> +

Dialog content

+
+ ); +} +``` -ReactDOM.render( - -

first dialog

-
-), document.getElementById('t1')); +## Examples -// use dialog +```bash +npm install +npm start ``` +Then open `http://localhost:8000`. + +Online demo: https://dialog.react-component.vercel.app/ + ## API -### @rc-component/dialog - -| Name | Type | Default | Description | Version | -| --- | --- | --- | --- | --- | -| prefixCls | String | rc-dialog | The dialog dom node's prefixCls | | -| className | String | | additional className for dialog | | -| classNames | { header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string; } | | pass className to target area | | -| styles | { header?: CSSProperties; body?: CSSProperties; footer?: CSSProperties; mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties; } | | pass styles to target area | | -| style | Object | {} | Root style for dialog element.Such as width, height | | -| zIndex | Number | | | | -| visible | Boolean | false | current dialog's visible status | | -| animation | String | | part of dialog animation css class name | | -| maskAnimation | String | | part of dialog's mask animation css class name | | -| transitionName | String | | dialog animation css class name | | -| maskTransitionName | String | | mask animation css class name | | -| title | String\|React.Element | | Title of the dialog | | -| footer | React.Element | | footer of the dialog | | -| closable | Boolean \| ({ closeIcon?: React.ReactNode; disabled?: boolean, afterClose:function } & React.AriaAttributes) | true | whether show close button | | -| mask | Boolean | true | whether show mask | | -| maskClosable | Boolean | true | whether click mask to close | | -| keyboard | Boolean | true | whether support press esc to close | | -| mousePosition | {x:number,y:number} | | set pageX and pageY of current mouse(it will cause transform origin to be set). | | -| onClose | function() | | called when click close button or mask | | -| afterClose | function() | | called when close animation end | | -| getContainer | function(): HTMLElement | | to determine where Dialog will be mounted | | -| destroyOnHidden | Boolean | false | to unmount child compenents on onClose | | -| closeIcon | ReactNode | | specific the close icon. | | -| forceRender | Boolean | false | Create dialog dom node before dialog first show | | -| focusTriggerAfterClose | Boolean | true | focus trigger element when dialog closed | | -| scrollLock | Boolean | true | Control whether to lock body scroll when dialog opens | | -| modalRender | (node: ReactNode) => ReactNode | | Custom modal content render | 8.3.0 | +| Property | Description | Type | Default | +| --- | --- | --- | --- | +| afterClose | Callback after close animation ends | `() => void` | - | +| animation | Dialog animation name | string | - | +| className | Additional dialog class name | string | - | +| classNames | Semantic class names | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | +| closable | Whether to show close button, or close button props | boolean \| object | true | +| closeIcon | Custom close icon | `React.ReactNode` | - | +| destroyOnHidden | Unmount children after dialog closes | boolean | false | +| focusTriggerAfterClose | Focus trigger element after close | boolean | true | +| footer | Dialog footer | `React.ReactNode` | - | +| forceRender | Render dialog before it is first shown | boolean | false | +| getContainer | Container where dialog is mounted | `() => HTMLElement` | - | +| keyboard | Whether pressing Esc closes the dialog | boolean | true | +| mask | Whether to show mask | boolean | true | +| maskAnimation | Mask animation name | string | - | +| maskClosable | Whether clicking mask closes the dialog | boolean | true | +| maskTransitionName | Mask transition class name | string | - | +| modalRender | Custom modal content renderer | `(node: React.ReactNode) => React.ReactNode` | - | +| mousePosition | Mouse position used for transform origin | `{ x: number; y: number }` | - | +| prefixCls | Component class name prefix | string | `rc-dialog` | +| scrollLock | Whether to lock body scroll when open | boolean | true | +| style | Root dialog style | `React.CSSProperties` | - | +| styles | Semantic styles | `{ header?: CSSProperties; body?: CSSProperties; footer?: CSSProperties; mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties }` | - | +| title | Dialog title | `React.ReactNode` | - | +| transitionName | Dialog transition class name | string | - | +| visible | Whether the dialog is visible | boolean | false | +| zIndex | Dialog z-index | number | - | +| onClose | Callback when close button or mask is clicked | `(event: React.SyntheticEvent) => void` | - | ## Development -``` +```bash npm install npm start ``` -## Test Case - -``` +```bash npm test -npm run chrome-test +npm run tsc +npm run lint +npm run compile +npm run build ``` -## Coverage +## Release -``` -npm run coverage +```bash +npm run prepublishOnly ``` -open coverage/ dir +The release script compiles the package and runs `rc-np`. ## License -@rc-component/dialog is released under the MIT license. - - -## 🤝 Contributing - - - Contribution Leaderboard - +`@rc-component/dialog` is released under the MIT license. diff --git a/now.json b/now.json deleted file mode 100644 index b741932f..00000000 --- a/now.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": 2, - "name": "rc-dialog", - "builds": [ - { - "src": "package.json", - "use": "@now/static-build", - "config": { "distDir": "dist" } - } - ] -} diff --git a/package.json b/package.json index 50b90753..c6d01147 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "assets/*.css" ], "scripts": { + "build": "npm run docs:build", "compile": "father build && lessc assets/index.less assets/index.css && lessc assets/bootstrap.less assets/bootstrap.css", "coverage": "rc-test --coverage", "deploy": "npm run docs:build && npm run docs:deploy", @@ -35,17 +36,16 @@ "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "lint:tsc": "tsc -p tsconfig.json --noEmit", "now-build": "npm run docs:build", - "prepare": "husky install", + "prepare": "husky", "prepublishOnly": "npm run compile && rc-np", - "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", + "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "tsc": "bunx tsc --noEmit" + "tsc": "tsc --noEmit" }, "lint-staged": { "**/*.{js,jsx,tsx,ts,md,json}": [ - "prettier --write", - "git add" + "prettier --write --ignore-unknown" ] }, "dependencies": { @@ -87,4 +87,4 @@ "react": ">=18.0.0", "react-dom": ">=18.0.0" } -} \ No newline at end of file +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..e884e1b3 --- /dev/null +++ b/vercel.json @@ -0,0 +1,6 @@ +{ + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" +} From 3756998456cd6c9a5c1fdcef67f04439da8c9a40 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 13:29:56 +0800 Subject: [PATCH 02/34] chore: address review feedback --- .github/workflows/cloudflare-pages-preview.yml | 4 ++++ .github/workflows/surge-preview.yml | 4 ++++ README.md | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cloudflare-pages-preview.yml b/.github/workflows/cloudflare-pages-preview.yml index c1738dfe..bfbba49c 100644 --- a/.github/workflows/cloudflare-pages-preview.yml +++ b/.github/workflows/cloudflare-pages-preview.yml @@ -3,6 +3,10 @@ name: Cloudflare Pages Preview on: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + permissions: contents: read deployments: write diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 1b7fc7e2..df4510bb 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -3,6 +3,10 @@ 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 diff --git a/README.md b/README.md index b9d63499..ca6866dd 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Online demo: https://dialog.react-component.vercel.app/ | prefixCls | Component class name prefix | string | `rc-dialog` | | scrollLock | Whether to lock body scroll when open | boolean | true | | style | Root dialog style | `React.CSSProperties` | - | -| styles | Semantic styles | `{ header?: CSSProperties; body?: CSSProperties; footer?: CSSProperties; mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties }` | - | +| styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | | title | Dialog title | `React.ReactNode` | - | | transitionName | Dialog transition class name | string | - | | visible | Whether the dialog is visible | boolean | false | From 158034a3c9a53a3681c265ec9e1a6723c1b4dd94 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 15:03:45 +0800 Subject: [PATCH 03/34] chore: remove cloudflare preview and now-build --- .../workflows/cloudflare-pages-preview.yml | 42 ------------------- package.json | 1 - 2 files changed, 43 deletions(-) delete mode 100644 .github/workflows/cloudflare-pages-preview.yml diff --git a/.github/workflows/cloudflare-pages-preview.yml b/.github/workflows/cloudflare-pages-preview.yml deleted file mode 100644 index bfbba49c..00000000 --- a/.github/workflows/cloudflare-pages-preview.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Cloudflare Pages Preview - -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - deployments: write - -jobs: - preview: - runs-on: ubuntu-latest - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }} - PREVIEW: true - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - with: - persist-credentials: false - - name: Skip Cloudflare Pages preview - if: ${{ env.CLOUDFLARE_API_TOKEN == '' || env.CLOUDFLARE_ACCOUNT_ID == '' || env.CLOUDFLARE_PAGES_PROJECT == '' }} - run: echo "Cloudflare Pages preview is not configured; skip deployment." - - name: Install dependencies - if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} - run: npm install - - name: Build site - if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} - run: npm run build - - name: Deploy preview - if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }} - uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 - with: - apiToken: ${{ env.CLOUDFLARE_API_TOKEN }} - accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy dist --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT }} --branch=${{ github.head_ref }} - gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index c6d01147..7b0ba7c1 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "docs:deploy": "gh-pages -d dist", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "lint:tsc": "tsc -p tsconfig.json --noEmit", - "now-build": "npm run docs:build", "prepare": "husky", "prepublishOnly": "npm run compile && rc-np", "prettier": "prettier --write --ignore-unknown .", From ebafdbbcaf96a58e383290be983ced10759aac83 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:56:46 +0800 Subject: [PATCH 04/34] docs: standardize README release details --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca6866dd..1649bf11 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@

Part of the Ant Design ecosystem.

+ + +
[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] @@ -117,8 +120,8 @@ npm run build npm run prepublishOnly ``` -The release script compiles the package and runs `rc-np`. +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. ## License -`@rc-component/dialog` is released under the MIT license. +@rc-component/dialog is released under the [MIT](./LICENSE.md) license. From 0843093a594102a359c6ea58f606197acec821c3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:13:56 +0800 Subject: [PATCH 05/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 df4510bb..9bd6c8a2 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 2bb80334a4583007bbb00c253b71b1f2148e6814 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:25:40 +0800 Subject: [PATCH 06/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 9bd6c8a2..b4a6a34d 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 bdf8444453ffb0f984574bf5ff42c163dfff5bfa Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:03:58 +0800 Subject: [PATCH 07/34] docs: refine README usage and ecosystem note --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1649bf11..eb324c2e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,10 @@

@rc-component/dialog

+

Part of the Ant Design ecosystem.

💬 A composable dialog component for React.

- - - Ant Design - - -

Part of the Ant Design ecosystem.

+
[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] From 3bbbb555c782c66f881e9cd5d5b5a049c3549101 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:22:13 +0800 Subject: [PATCH 08/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 b4a6a34d..b0f5a832 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 8c40a3478883fd0311705c190d01cbb758f0a22d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:19:14 +0800 Subject: [PATCH 09/34] docs: add Chinese README --- README.md | 2 + README.zh-CN.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 README.zh-CN.md diff --git a/README.md b/README.md index eb324c2e..b9717a7f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@

💬 A composable dialog component for React.

+

English | 简体中文

+
diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..7d744f15 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,125 @@ +
+

@rc-component/dialog

+

Ant Design 生态的一部分。

+

💬 可组合的 React 对话框组件。

+
+ +

English | 简体中文

+ + +
+ +[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] + +
+ +[npm-image]: https://img.shields.io/npm/v/@rc-component/dialog.svg?style=flat-square +[npm-url]: https://npmjs.org/package/@rc-component/dialog +[github-actions-image]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml/badge.svg +[github-actions-url]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml +[codecov-image]: https://img.shields.io/codecov/c/github/react-component/dialog/master.svg?style=flat-square +[codecov-url]: https://app.codecov.io/gh/react-component/dialog +[download-image]: https://img.shields.io/npm/dm/@rc-component/dialog.svg?style=flat-square +[download-url]: https://npmjs.org/package/@rc-component/dialog +[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/%40rc-component%2Fdialog?style=flat-square +[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/dialog +[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square +[dumi-url]: https://github.com/umijs/dumi + +## 特性 + +- 支持 controlled visibility, mask, keyboard close, and focus restoration. +- 支持自定义标题、页脚、关闭图标、容器、动画和弹窗内容渲染。 +- 提供 semantic `classNames` and `styles` hooks for the dialog structure. +- 提供编译后的 JavaScript、TypeScript 类型定义和 CSS 资源。 + +## 安装 + +```bash +npm install @rc-component/dialog +``` + +## 使用 + +```tsx | pure +import Dialog from '@rc-component/dialog'; +import '@rc-component/dialog/assets/index.css'; + +export default function App() { + return ( + {}}> +

Dialog content

+
+ ); +} +``` + +## 示例 + +```bash +npm install +npm start +``` + +然后打开 `http://localhost:8000`。 + +在线演示: https://dialog.react-component.vercel.app/ + +## API + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| afterClose | Callback after close animation ends | `() => void` | - | +| animation | Dialog animation name | string | - | +| className | Additional dialog class name | string | - | +| classNames | Semantic class names | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | +| closable | Whether to show close button, or close button props | boolean \| object | true | +| closeIcon | Custom close icon | `React.ReactNode` | - | +| destroyOnHidden | Unmount children after dialog closes | boolean | false | +| focusTriggerAfterClose | Focus trigger element after close | boolean | true | +| footer | Dialog footer | `React.ReactNode` | - | +| forceRender | Render dialog before it is first shown | boolean | false | +| getContainer | Container where dialog is mounted | `() => HTMLElement` | - | +| keyboard | Whether pressing Esc closes the dialog | boolean | true | +| mask | Whether to show mask | boolean | true | +| maskAnimation | Mask animation name | string | - | +| maskClosable | Whether clicking mask closes the dialog | boolean | true | +| maskTransitionName | Mask transition class name | string | - | +| modalRender | Custom modal content renderer | `(node: React.ReactNode) => React.ReactNode` | - | +| mousePosition | Mouse position used for transform origin | `{ x: number; y: number }` | - | +| prefixCls | Component class name prefix | string | `rc-dialog` | +| scrollLock | Whether to lock body scroll when open | boolean | true | +| style | Root dialog style | `React.CSSProperties` | - | +| styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | +| title | Dialog title | `React.ReactNode` | - | +| transitionName | Dialog transition class name | string | - | +| visible | Whether the dialog is visible | boolean | false | +| zIndex | Dialog z-index | number | - | +| onClose | Callback when close button or mask is clicked | `(event: React.SyntheticEvent) => void` | - | + +## 本地开发 + +```bash +npm install +npm start +``` + +```bash +npm test +npm run tsc +npm run lint +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/dialog is released under the [MIT](./LICENSE.md) license. From 5e45b84bc3b201ee148ea19419fbd63b2beb57f1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:34:32 +0800 Subject: [PATCH 10/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 b9717a7f..87fc91e6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

@rc-component/dialog

Part of the Ant Design ecosystem.

+ Ant Design

💬 A composable dialog component for React.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 7d744f15..4fe16ff4 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,7 @@

@rc-component/dialog

Ant Design 生态的一部分。

+ Ant Design

💬 可组合的 React 对话框组件。

From 633e7d7ad883e9ca284e5406eaa2ed2cb79ed76c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 23:02:47 +0800 Subject: [PATCH 11/34] docs: refine bilingual README branding --- README.md | 3 +-- README.zh-CN.md | 57 ++++++++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 87fc91e6..bb348d35 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@

@rc-component/dialog

-

Part of the Ant Design ecosystem.

- Ant Design +

Ant Design Part of the Ant Design ecosystem.

💬 A composable dialog component for React.

diff --git a/README.zh-CN.md b/README.zh-CN.md index 4fe16ff4..4c60859a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,7 +1,6 @@

@rc-component/dialog

-

Ant Design 生态的一部分。

- Ant Design +

Ant Design Ant Design 生态的一部分。

💬 可组合的 React 对话框组件。

@@ -29,9 +28,9 @@ ## 特性 -- 支持 controlled visibility, mask, keyboard close, and focus restoration. +- 支持受控可见性、遮罩、键盘关闭和焦点恢复。 - 支持自定义标题、页脚、关闭图标、容器、动画和弹窗内容渲染。 -- 提供 semantic `classNames` and `styles` hooks for the dialog structure. +- 为对话框结构提供语义 `classNames` 和 `styles` 挂钩。 - 提供编译后的 JavaScript、TypeScript 类型定义和 CSS 资源。 ## 安装 @@ -70,33 +69,33 @@ npm start | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | -| afterClose | Callback after close animation ends | `() => void` | - | -| animation | Dialog animation name | string | - | -| className | Additional dialog class name | string | - | -| classNames | Semantic class names | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | -| closable | Whether to show close button, or close button props | boolean \| object | true | -| closeIcon | Custom close icon | `React.ReactNode` | - | -| destroyOnHidden | Unmount children after dialog closes | boolean | false | -| focusTriggerAfterClose | Focus trigger element after close | boolean | true | +| afterClose | 关闭动画结束后回调 | `() => void` | - | +| 动画片 | 对话框动画名称 | string | - | +| className | 附加对话框className | string | - | +| classNames | 语义className | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | +| closable | 是否显示关闭按钮,或关闭按钮属性 | boolean \| object | true | +| closeIcon | 自定义关闭图标 | `React.ReactNode` | - | +| destroyOnHidden | 对话框关闭后卸载子项 | boolean | false | +| focusTriggerAfterClose | 关闭后聚焦触发元素 | boolean | true | | footer | Dialog footer | `React.ReactNode` | - | -| forceRender | Render dialog before it is first shown | boolean | false | -| getContainer | Container where dialog is mounted | `() => HTMLElement` | - | -| keyboard | Whether pressing Esc closes the dialog | boolean | true | -| mask | Whether to show mask | boolean | true | -| maskAnimation | Mask animation name | string | - | -| maskClosable | Whether clicking mask closes the dialog | boolean | true | -| maskTransitionName | Mask transition class name | string | - | -| modalRender | Custom modal content renderer | `(node: React.ReactNode) => React.ReactNode` | - | -| mousePosition | Mouse position used for transform origin | `{ x: number; y: number }` | - | -| prefixCls | Component class name prefix | string | `rc-dialog` | -| scrollLock | Whether to lock body scroll when open | boolean | true | -| style | Root dialog style | `React.CSSProperties` | - | +| forceRender | 在首次显示之前渲染对话框 | boolean | false | +| getContainer | 装载对话框的容器 | `() => HTMLElement` | - | +| keyboard | 按 Esc 是否关闭对话框 | boolean | true | +| mask | 是否显示面具 | boolean | true | +| maskAnimation | 蒙版动画名称 | string | - | +| maskClosable | 单击蒙版是否关闭对话框 | boolean | true | +| maskTransitionName | 掩码转换className称 | string | - | +| modalRender | 自定义模态内容渲染器 | `(node: React.ReactNode) => React.ReactNode` | - | +| mousePosition | 用于变换原点的鼠标位置 | `{ x: number; y: number }` | - | +| prefixCls | 组件className前缀 | string | `rc-dialog` | +| scrollLock | 打开时是否锁定body滚动 | boolean | true | +| 风格 | 根对话框样式 | `React.CSSProperties` | - | | styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | | title | Dialog title | `React.ReactNode` | - | -| transitionName | Dialog transition class name | string | - | -| visible | Whether the dialog is visible | boolean | false | +| transitionName | 对话框转换className | string | - | +| 可见的 | 对话框是否可见 | boolean | false | | zIndex | Dialog z-index | number | - | -| onClose | Callback when close button or mask is clicked | `(event: React.SyntheticEvent) => void` | - | +| onClose | 点击关闭按钮或遮罩时的回调 | `(event: React.SyntheticEvent) => void` | - | ## 本地开发 @@ -119,8 +118,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/dialog is released under the [MIT](./LICENSE.md) license. +@rc-component/dialog 基于 [MIT](./LICENSE.md) 许可证发布。 From 32db3819151875802d0ed8f1d637ca009b0b0575 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 01:28:38 +0800 Subject: [PATCH 12/34] chore: standardize rc tooling and docs --- .dumirc.ts | 8 ++++- .github/workflows/surge-preview.yml | 2 +- README.md | 4 +-- README.zh-CN.md | 4 +-- docs/examples/draggable.tsx | 6 +++- package.json | 46 ++++++++++++++--------------- tsconfig.json | 9 ++++-- vercel.json | 2 +- 8 files changed, 48 insertions(+), 33 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index e3235915..66e1a5ef 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -2,7 +2,13 @@ import os from 'node:os'; import { defineConfig } from 'dumi'; import path from 'path'; +const basePath = process.env.GH_PAGES ? '/dialog/' : '/'; +const publicPath = basePath; + export default defineConfig({ + outputPath: 'docs-dist', + base: basePath, + publicPath, alias: { 'rc-dialog$': path.resolve('src'), 'rc-dialog/es': path.resolve('src'), @@ -13,4 +19,4 @@ export default defineConfig({ logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, mako: ['Darwin', 'Linux'].includes(os.type()) ? {} : false, -});; +}); diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index b0f5a832..faf6b8bd 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 bb348d35..99050153 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ export default function App() { ## Examples +Run the local dumi site: + ```bash npm install npm start @@ -63,8 +65,6 @@ npm start Then open `http://localhost:8000`. -Online demo: https://dialog.react-component.vercel.app/ - ## API | Property | Description | Type | Default | diff --git a/README.zh-CN.md b/README.zh-CN.md index 4c60859a..436f22d8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -56,6 +56,8 @@ export default function App() { ## 示例 +运行本地 dumi 站点: + ```bash npm install npm start @@ -63,8 +65,6 @@ npm start 然后打开 `http://localhost:8000`。 -在线演示: https://dialog.react-component.vercel.app/ - ## API | 参数 | 说明 | 类型 | 默认值 | diff --git a/docs/examples/draggable.tsx b/docs/examples/draggable.tsx index d5a5d2d6..dbfa3889 100644 --- a/docs/examples/draggable.tsx +++ b/docs/examples/draggable.tsx @@ -4,6 +4,10 @@ import Draggable from 'react-draggable'; import Dialog from '@rc-component/dialog'; import '../../assets/index.less'; +const DemoDraggable = Draggable as React.ComponentType< + React.PropsWithChildren<{ disabled?: boolean }> +>; + const MyControl: React.FC = () => { const [visible, setVisible] = React.useState(false); const [disabled, setDisabled] = React.useState(true); @@ -46,7 +50,7 @@ const MyControl: React.FC = () => { modal
} - modalRender={(modal) => {modal}} + modalRender={(modal) => {modal}} >
Day before yesterday I saw a rabbit, and yesterday a deer, and today, you. diff --git a/package.json b/package.json index 7b0ba7c1..5ef837a8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "coverage": "rc-test --coverage", "deploy": "npm run docs:build && npm run docs:deploy", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d dist", + "docs:deploy": "gh-pages -d docs-dist", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "lint:tsc": "tsc -p tsconfig.json --noEmit", "prepare": "husky", @@ -55,32 +55,32 @@ }, "devDependencies": { "@rc-component/drawer": "^1.0.0", - "@rc-component/father-plugin": "^2.0.2", - "@rc-component/np": "^1.0.3", + "@rc-component/father-plugin": "^2.2.0", + "@rc-component/np": "^1.0.4", "@rc-component/select": "^1.0.0", - "@testing-library/jest-dom": "^6.1.6", - "@testing-library/react": "^16.3.0", - "@types/jest": "^30.0.0", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^15.0.7", + "@types/jest": "^29.5.14", "@types/keyv": "3.1.4", - "@types/node": "^24.0.8", - "@types/react": "^19.1.4", - "@types/react-dom": "^19.1.5", - "@umijs/fabric": "^4.0.0", + "@types/node": "^26.0.1", + "@types/react": "^18.3.31", + "@types/react-dom": "^18.3.7", + "@umijs/fabric": "^4.0.1", "bootstrap": "^5.3.7", - "dumi": "^2.1.3", - "eslint": "8.x", - "father": "^4.1.5", - "gh-pages": "^6.1.1", - "glob": "^11.0.0", - "husky": "^9.1.6", - "less": "^4.1.3", - "lint-staged": "^16.1.2", - "prettier": "^3.2.1", - "rc-test": "^7.0.14", - "react": "^18.0.0", - "react-dom": "^18.0.0", + "dumi": "^2.4.35", + "eslint": "^8.57.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", "react-draggable": "^4.4.3", - "typescript": "^5.4.3" + "typescript": "^5.9.3" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/tsconfig.json b/tsconfig.json index 38d5441e..1b59bf44 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,12 @@ "src/index.ts" ] }, - "types": ["node", "jest", "@testing-library/jest-dom"], + "types": [ + "node", + "jest", + "@testing-library/jest-dom" + ], + "ignoreDeprecations": "5.0" }, "include": [ ".dumirc.ts", @@ -27,4 +32,4 @@ "./docs/**/*.tsx", "./tests/**/*.tsx" ] -} \ No newline at end of file +} diff --git a/vercel.json b/vercel.json index e884e1b3..5f9139ef 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 815b3a5382e6ec4e160d191789f93dbce4008ec0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:01:04 +0800 Subject: [PATCH 13/34] chore: address standardization review comments --- .github/workflows/surge-preview.yml | 16 +++++++++++++--- package.json | 5 +++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index faf6b8bd..cb6c8c4a 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -22,13 +22,23 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Check Surge token + id: surge-token + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + run: | + if [ -n "$SURGE_TOKEN" ]; then + echo "enabled=true" >> "$GITHUB_OUTPUT" + else + echo "enabled=false" >> "$GITHUB_OUTPUT" + fi - name: Build preview - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: | npm install npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: @@ -38,5 +48,5 @@ jobs: failOnError: false setCommitStatus: false - name: Skip Surge preview - if: ${{ secrets.SURGE_TOKEN == '' }} + if: ${{ steps.surge-token.outputs.enabled != 'true' }} run: echo "SURGE_TOKEN is not configured; skip Surge preview." diff --git a/package.json b/package.json index 5ef837a8..d593a57c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build": "npm run docs:build", "compile": "father build && lessc assets/index.less assets/index.css && lessc assets/bootstrap.less assets/bootstrap.css", "coverage": "rc-test --coverage", - "deploy": "npm run docs:build && npm run docs:deploy", + "deploy": "npm run docs:build:gh-pages && npm run docs:deploy", "docs:build": "dumi build", "docs:deploy": "gh-pages -d docs-dist", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", @@ -40,7 +40,8 @@ "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "tsc": "tsc --noEmit" + "tsc": "tsc --noEmit", + "docs:build:gh-pages": "GH_PAGES=1 npm run docs:build" }, "lint-staged": { "**/*.{js,jsx,tsx,ts,md,json}": [ From 49029feb05cd62d284d7c81e7f4f66c6d14b400d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:10:32 +0800 Subject: [PATCH 14/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 1b59bf44..d8893fea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,7 @@ "ignoreDeprecations": "5.0" }, "include": [ + ".fatherrc.ts", ".dumirc.ts", "./src/**/*.ts", "./src/**/*.tsx", From b1a85413291717c782942575eb89214bebbabc6e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:23:39 +0800 Subject: [PATCH 15/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 3dd511db..f9f207f4 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 853dd0faafc6f1db256082d7dbb2709c7fc71536 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:27:35 +0800 Subject: [PATCH 16/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 f9f207f4..3dd511db 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 b7cc9f51757784f1f2f033801ac2a80da8bab133 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:14:23 +0800 Subject: [PATCH 17/34] chore: ignore dumi build output --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a43b2cd9..82f1bc92 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ pnpm-lock.yaml # dumi .dumi/tmp .dumi/tmp-production +docs-dist bun.lockb .vscode From ba2c48f7c88970a152d71a13a16d8c78605d4f3f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:27:00 +0800 Subject: [PATCH 18/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 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 99050153..d41bb608 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/dialog is released under the [MIT](./LICENSE.md) license. +@rc-component/dialog is released under the [MIT](./LICENSE) license. diff --git a/README.zh-CN.md b/README.zh-CN.md index 436f22d8..764c0ac2 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -122,4 +122,4 @@ npm run prepublishOnly ## 许可证 -@rc-component/dialog 基于 [MIT](./LICENSE.md) 许可证发布。 +@rc-component/dialog 基于 [MIT](./LICENSE) 许可证发布。 From 2e7096cae14371711fcb6158cdd939c25f954035 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:59:45 +0800 Subject: [PATCH 19/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 3dd511db..f4f38ee2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + uses: actions/checkout@v7 with: persist-credentials: false diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml index f68281c8..097eb883 100644 --- a/.github/workflows/react-doctor.yml +++ b/.github/workflows/react-doctor.yml @@ -20,7 +20,7 @@ jobs: react-doctor: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index cb6c8c4a..ebfecd53 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -19,7 +19,7 @@ jobs: env: PREVIEW: true steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: persist-credentials: false - name: Check Surge token From 7e5b87d65e5065f078de515541455ed3c986aab1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:30:08 +0800 Subject: [PATCH 20/34] chore: standardize package metadata --- package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d593a57c..11af00f0 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,13 @@ "dialog", "ui" ], - "homepage": "https://github.com/react-component/dialog", + "homepage": "https://react-component.github.io/dialog", "bugs": { - "url": "https://github.com/react-component/dialog/issues" + "url": "https://github.com/react-component/dialog/issues" }, "repository": { "type": "git", - "url": "git@github.com:react-component/dialog.git" + "url": "https://github.com/react-component/dialog.git" }, "license": "MIT", "author": "yiminghe@gmail.com", @@ -86,5 +86,8 @@ "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" + }, + "publishConfig": { + "access": "public" } } From babd55e23bec7474cf9c8cc605790d8cde32ba2f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:36:33 +0800 Subject: [PATCH 21/34] ci: standardize dependabot updates --- .github/dependabot.yml | 50 ++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 05db5d28..3b730ef9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,35 +1,19 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "21:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: rc-select - versions: - - 12.1.2 - - 12.1.3 - - 12.1.5 - - 12.1.6 - - 12.1.7 - - 12.1.9 - - dependency-name: "@types/react" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - 17.0.3 - - dependency-name: "@types/react-dom" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - dependency-name: rc-drawer - versions: - - 4.2.2 - - 4.3.0 - - dependency-name: less - versions: - - 4.1.0 + - package-ecosystem: npm + directory: '/' + schedule: + 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 1f81bd6a5809880f41663c5fe799350453961108 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 16:23:54 +0800 Subject: [PATCH 22/34] docs: fix Chinese README API names --- README.zh-CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 764c0ac2..88320601 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -70,7 +70,7 @@ npm start | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | afterClose | 关闭动画结束后回调 | `() => void` | - | -| 动画片 | 对话框动画名称 | string | - | +| animation | 对话框动画名称 | string | - | | className | 附加对话框className | string | - | | classNames | 语义className | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | | closable | 是否显示关闭按钮,或关闭按钮属性 | boolean \| object | true | @@ -89,11 +89,11 @@ npm start | mousePosition | 用于变换原点的鼠标位置 | `{ x: number; y: number }` | - | | prefixCls | 组件className前缀 | string | `rc-dialog` | | scrollLock | 打开时是否锁定body滚动 | boolean | true | -| 风格 | 根对话框样式 | `React.CSSProperties` | - | +| style | 根对话框样式 | `React.CSSProperties` | - | | styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | | title | Dialog title | `React.ReactNode` | - | | transitionName | 对话框转换className | string | - | -| 可见的 | 对话框是否可见 | boolean | false | +| visible | 对话框是否可见 | boolean | false | | zIndex | Dialog z-index | number | - | | onClose | 点击关闭按钮或遮罩时的回调 | `(event: React.SyntheticEvent) => void` | - | From 932a63d869b3848a9870b15ea908aa6b3dc25c0e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:14:32 +0800 Subject: [PATCH 23/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 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 d7f7fea3af92beb005a365179dd957a1ef00d396 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:35:33 +0800 Subject: [PATCH 24/34] docs: polish Chinese README wording --- README.zh-CN.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 88320601..19aa094b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -71,8 +71,8 @@ npm start | --- | --- | --- | --- | | afterClose | 关闭动画结束后回调 | `() => void` | - | | animation | 对话框动画名称 | string | - | -| className | 附加对话框className | string | - | -| classNames | 语义className | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | +| className | 附加对话框 className | string | - | +| classNames | 语义 className | `{ header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string }` | - | | closable | 是否显示关闭按钮,或关闭按钮属性 | boolean \| object | true | | closeIcon | 自定义关闭图标 | `React.ReactNode` | - | | destroyOnHidden | 对话框关闭后卸载子项 | boolean | false | @@ -84,15 +84,15 @@ npm start | mask | 是否显示面具 | boolean | true | | maskAnimation | 蒙版动画名称 | string | - | | maskClosable | 单击蒙版是否关闭对话框 | boolean | true | -| maskTransitionName | 掩码转换className称 | string | - | +| maskTransitionName | 掩码过渡 className | string | - | | modalRender | 自定义模态内容渲染器 | `(node: React.ReactNode) => React.ReactNode` | - | | mousePosition | 用于变换原点的鼠标位置 | `{ x: number; y: number }` | - | -| prefixCls | 组件className前缀 | string | `rc-dialog` | +| prefixCls | 组件 className 前缀 | string | `rc-dialog` | | scrollLock | 打开时是否锁定body滚动 | boolean | true | | style | 根对话框样式 | `React.CSSProperties` | - | | styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | | title | Dialog title | `React.ReactNode` | - | -| transitionName | 对话框转换className | string | - | +| transitionName | 对话框过渡 className | string | - | | visible | 对话框是否可见 | boolean | false | | zIndex | Dialog z-index | number | - | | onClose | 点击关闭按钮或遮罩时的回调 | `(event: React.SyntheticEvent) => void` | - | From 76c3a4aefec5a6dab127fb52773b36b09d7ad436 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:13:09 +0800 Subject: [PATCH 25/34] 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 19aa094b..0e4a615b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -47,7 +47,7 @@ import '@rc-component/dialog/assets/index.css'; export default function App() { return ( - {}}> + {}}>

Dialog content

); @@ -90,11 +90,11 @@ npm start | prefixCls | 组件 className 前缀 | string | `rc-dialog` | | scrollLock | 打开时是否锁定body滚动 | boolean | true | | style | 根对话框样式 | `React.CSSProperties` | - | -| styles | Semantic styles | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | -| title | Dialog title | `React.ReactNode` | - | +| styles | 语义化样式 | `{ header?: React.CSSProperties; body?: React.CSSProperties; footer?: React.CSSProperties; mask?: React.CSSProperties; content?: React.CSSProperties; wrapper?: React.CSSProperties }` | - | +| title | 对话框标题 | `React.ReactNode` | - | | transitionName | 对话框过渡 className | string | - | | visible | 对话框是否可见 | boolean | false | -| zIndex | Dialog z-index | number | - | +| zIndex | 对话框 z-index | number | - | | onClose | 点击关闭按钮或遮罩时的回调 | `(event: React.SyntheticEvent) => void` | - | ## 本地开发 From e84fa61c2351b70421204f9345bbcb5ff304c744 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:37:56 +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 d41bb608..bc530119 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ npm install npm start ``` +The dumi site runs at `http://localhost:8000` by default. + ```bash npm test npm run tsc diff --git a/README.zh-CN.md b/README.zh-CN.md index 0e4a615b..98b2de49 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -104,6 +104,8 @@ npm install npm start ``` +dumi 站点默认运行在 `http://localhost:8000`。 + ```bash npm test npm run tsc From b04d8347afe0f3f54ae4c9412d454849e09b706c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:45:30 +0800 Subject: [PATCH 27/34] docs: fix Chinese mask terminology --- 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 98b2de49..4cda2cf5 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -81,10 +81,10 @@ npm start | forceRender | 在首次显示之前渲染对话框 | boolean | false | | getContainer | 装载对话框的容器 | `() => HTMLElement` | - | | keyboard | 按 Esc 是否关闭对话框 | boolean | true | -| mask | 是否显示面具 | boolean | true | -| maskAnimation | 蒙版动画名称 | string | - | -| maskClosable | 单击蒙版是否关闭对话框 | boolean | true | -| maskTransitionName | 掩码过渡 className | string | - | +| mask | 是否显示遮罩 | boolean | true | +| maskAnimation | 遮罩动画名称 | string | - | +| maskClosable | 单击遮罩是否关闭对话框 | boolean | true | +| maskTransitionName | 遮罩过渡 className | string | - | | modalRender | 自定义模态内容渲染器 | `(node: React.ReactNode) => React.ReactNode` | - | | mousePosition | 用于变换原点的鼠标位置 | `{ x: number; y: number }` | - | | prefixCls | 组件 className 前缀 | string | `rc-dialog` | From 381e192b3f46575d9dc32d2bb6bf33dcc6fdc71e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:56:55 +0800 Subject: [PATCH 28/34] chore: standardize husky configuration --- .husky/pre-commit | 1 + package.json | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) 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 11af00f0..9294cea2 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,7 @@ "docs:build:gh-pages": "GH_PAGES=1 npm run docs:build" }, "lint-staged": { - "**/*.{js,jsx,tsx,ts,md,json}": [ - "prettier --write --ignore-unknown" - ] + "*": "prettier --write --ignore-unknown" }, "dependencies": { "@rc-component/motion": "^1.3.3", From da53dd6670f8c870a776f33da0ae317d93884be7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:05:44 +0800 Subject: [PATCH 29/34] docs: align readme badge layout --- README.md | 29 +++++++++-------------------- README.zh-CN.md | 29 +++++++++-------------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index bc530119..f42a9fee 100644 --- a/README.md +++ b/README.md @@ -2,29 +2,18 @@

@rc-component/dialog

Ant Design Part of the Ant Design ecosystem.

💬 A composable dialog component for React.

-
- -

English | 简体中文

- - -
- -[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] +

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

-[npm-image]: https://img.shields.io/npm/v/@rc-component/dialog.svg?style=flat-square -[npm-url]: https://npmjs.org/package/@rc-component/dialog -[github-actions-image]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml/badge.svg -[github-actions-url]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/dialog/master.svg?style=flat-square -[codecov-url]: https://app.codecov.io/gh/react-component/dialog -[download-image]: https://img.shields.io/npm/dm/@rc-component/dialog.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/dialog -[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/%40rc-component%2Fdialog?style=flat-square -[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/dialog -[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square -[dumi-url]: https://github.com/umijs/dumi +

English | 简体中文

## Highlights diff --git a/README.zh-CN.md b/README.zh-CN.md index 4cda2cf5..23689228 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,29 +2,18 @@

@rc-component/dialog

Ant Design Ant Design 生态的一部分。

💬 可组合的 React 对话框组件。

-
- -

English | 简体中文

- - -
- -[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] +

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

-[npm-image]: https://img.shields.io/npm/v/@rc-component/dialog.svg?style=flat-square -[npm-url]: https://npmjs.org/package/@rc-component/dialog -[github-actions-image]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml/badge.svg -[github-actions-url]: https://github.com/react-component/dialog/actions/workflows/react-component-ci.yml -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/dialog/master.svg?style=flat-square -[codecov-url]: https://app.codecov.io/gh/react-component/dialog -[download-image]: https://img.shields.io/npm/dm/@rc-component/dialog.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/dialog -[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/%40rc-component%2Fdialog?style=flat-square -[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/dialog -[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square -[dumi-url]: https://github.com/umijs/dumi +

English | 简体中文

## 特性 From 4de47b3513dcd685f4b07ae8d4f62fe7c26c801c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:31:35 +0800 Subject: [PATCH 30/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 9294cea2..c448b48f 100644 --- a/package.json +++ b/package.json @@ -87,5 +87,6 @@ }, "publishConfig": { "access": "public" - } + }, + "types": "./es/index.d.ts" } From 53a190e1627f82e2e59238b06c7e16936ed6b66c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:19:17 +0800 Subject: [PATCH 31/34] ci: limit reusable workflow secrets --- .github/workflows/react-component-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index f8482b63..36dacae4 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -1,6 +1,9 @@ name: ✅ test on: [push, pull_request] +permissions: + contents: read jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 9ab726b8ad10fad2de5c7463bc2057e1d6269c4d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:32:00 +0800 Subject: [PATCH 32/34] ci: restore reusable workflow compatibility --- .github/workflows/react-component-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 36dacae4..9503b960 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -5,5 +5,4 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + secrets: inherit From 6e67efb49ccebc64d8299b76f58d1b21e1651332 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 00:34:13 +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 eaff160a..4c2f17ed 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -11,7 +11,6 @@ permissions: contents: read pull-requests: write checks: write - statuses: write jobs: preview: From 4b801438e453f4f4f9353c01f1450624f0e5666c Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 14:24:33 +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 9503b960..36dacae4 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -5,4 +5,5 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}