Skip to content

Commit 5360802

Browse files
committed
chore: merge master
2 parents 55bc778 + 129f11f commit 5360802

File tree

14 files changed

+63
-58
lines changed

14 files changed

+63
-58
lines changed

.dumirc.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default defineConfig({
1616
name: 'Collapse',
1717
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
1818
},
19-
outputPath: '.doc',
2019
base: basePath,
2120
publicPath,
2221
});

.github/workflows/site-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: peaceiris/actions-gh-pages@v3
3434
with:
3535
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./.doc
36+
publish_dir: ./dist
3737
force_orphan: true
3838
user_name: 'github-actions[bot]'
3939
user_email: 'github-actions[bot]@users.noreply.github.com'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ coverage
2828
es
2929
yarn.lock
3030
package-lock.json
31+
pnpm-lock.yaml
3132
.storybook
3233
.doc
3334

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ReactDOM.render(App, container);
7878
<td>default active key</td>
7979
</tr>
8080
<tr>
81-
<td>destroyInactivePanel</td>
81+
<td>destroyOnHidden</td>
8282
<td>Boolean</td>
8383
<th>false</th>
8484
<td>If destroy the panel which not active, default false. </td>

docs/examples/_util/motionUtil.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { CSSMotionProps, MotionEndEventHandler, MotionEventHandler } from 'rc-motion';
1+
import type {
2+
CSSMotionProps,
3+
MotionEndEventHandler,
4+
MotionEventHandler,
5+
} from '@rc-component/motion';
26

37
const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });
48
const getRealHeight: MotionEventHandler = (node) => ({ height: node.scrollHeight, opacity: 1 });

now.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rc-component/collapse",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "rc-collapse ui component for react",
55
"keywords": [
66
"react",
@@ -31,11 +31,11 @@
3131
"compile": "father build && lessc assets/index.less assets/index.css",
3232
"coverage": "rc-test --coverage",
3333
"docs:build": "dumi build",
34-
"docs:deploy": "npm run docs:build && gh-pages -d .doc",
34+
"docs:deploy": "npm run docs:build && gh-pages -d dist",
3535
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
3636
"prepare": "husky",
3737
"now-build": "npm run docs:build",
38-
"prepublishOnly": "npm run compile && np --yolo --no-publish",
38+
"prepublishOnly": "npm run compile && rc-np",
3939
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
4040
"postpublish": "npm run docs:deploy",
4141
"start": "dumi dev",
@@ -46,39 +46,40 @@
4646
},
4747
"dependencies": {
4848
"@babel/runtime": "^7.10.1",
49+
"@rc-component/motion": "^1.1.4",
4950
"@rc-component/util": "^1.0.1",
50-
"classnames": "2.x",
51-
"rc-motion": "^2.3.4"
51+
"classnames": "2.x"
5252
},
5353
"devDependencies": {
5454
"@rc-component/father-plugin": "^2.0.1",
55+
"@rc-component/np": "^1.0.4",
5556
"@testing-library/jest-dom": "^6.1.4",
56-
"@testing-library/react": "^14.1.2",
57+
"@testing-library/react": "^16.3.0",
5758
"@testing-library/user-event": "^14.5.2",
5859
"@types/classnames": "^2.2.9",
5960
"@types/jest": "^29.4.0",
60-
"@types/react": "^18.0.0",
61-
"@types/react-dom": "^18.0.0",
61+
"@types/node": "^22.15.18",
62+
"@types/react": "^19.1.4",
63+
"@types/react-dom": "^19.1.5",
6264
"@umijs/fabric": "^4.0.0",
6365
"dumi": "^2.1.1",
6466
"eslint": "^8.55.0",
65-
"eslint-plugin-jest": "^27.6.0",
67+
"eslint-plugin-jest": "^28.11.0",
6668
"eslint-plugin-unicorn": "^49.0.0",
6769
"father": "^4.1.3",
6870
"gh-pages": "^6.2.0",
6971
"husky": "^9.0.0",
7072
"jest": "^29.1.2",
7173
"less": "^4.2.0",
72-
"lint-staged": "^15.0.2",
73-
"np": "^9.1.0",
74+
"lint-staged": "^16.0.0",
7475
"prettier": "^3.0.3",
7576
"rc-test": "^7.0.14",
76-
"react": "^18.2.0",
77-
"react-dom": "^18.2.0",
77+
"react": "^19.1.0",
78+
"react-dom": "^19.1.0",
7879
"typescript": "^5.0.0"
7980
},
8081
"peerDependencies": {
81-
"react": ">=16.9.0",
82-
"react-dom": ">=16.9.0"
82+
"react": ">=18.0.0",
83+
"react-dom": ">=18.0.0"
8384
}
8485
}

src/Collapse.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function getActiveKeysArray(activeKey: React.Key | React.Key[]) {
2121
const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) => {
2222
const {
2323
prefixCls = 'rc-collapse',
24-
destroyInactivePanel = false,
24+
destroyOnHidden = false,
2525
style,
2626
accordion,
2727
className,
@@ -76,7 +76,7 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
7676
openMotion,
7777
expandIcon,
7878
collapsible,
79-
destroyInactivePanel,
79+
destroyOnHidden,
8080
onItemClick,
8181
activeKey,
8282
classNames: customizeClassNames,

src/Panel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import classNames from 'classnames';
2-
import CSSMotion from 'rc-motion';
2+
import CSSMotion from '@rc-component/motion';
33
import KeyCode from '@rc-component/util/lib/KeyCode';
44
import type { PropsWithChildren } from 'react';
55
import React from 'react';
@@ -24,7 +24,7 @@ const CollapsePanel = React.forwardRef<HTMLDivElement, CollapsePanelProps>((prop
2424
header,
2525
expandIcon,
2626
openMotion,
27-
destroyInactivePanel,
27+
destroyOnHidden,
2828
children,
2929
headingLevel,
3030
id,
@@ -117,7 +117,7 @@ const CollapsePanel = React.forwardRef<HTMLDivElement, CollapsePanelProps>((prop
117117
leavedClassName={`${prefixCls}-panel-hidden`}
118118
{...openMotion}
119119
forceRender={forceRender}
120-
removeOnLeave={destroyInactivePanel}
120+
removeOnLeave={destroyOnHidden}
121121
>
122122
{({ className: motionClassName, style: motionStyle }, motionRef) => {
123123
return (
@@ -132,7 +132,7 @@ const CollapsePanel = React.forwardRef<HTMLDivElement, CollapsePanelProps>((prop
132132
styles={styles}
133133
isActive={isActive}
134134
forceRender={forceRender}
135-
role={accordion ? 'tabpanel' : void 0}
135+
role={accordion ? 'tabpanel' : undefined}
136136
>
137137
{children}
138138
</PanelContent>

src/PanelContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { CollapsePanelProps } from './interface';
44

55
const PanelContent = React.forwardRef<
66
HTMLDivElement,
7-
CollapsePanelProps & { children: React.ReactNode }
7+
React.PropsWithChildren<Readonly<CollapsePanelProps>>
88
>((props, ref) => {
99
const {
1010
prefixCls,

0 commit comments

Comments
 (0)