Skip to content

Commit dd83e2c

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/testing-library/jest-dom-6.4.8
2 parents 11461f6 + 307d8a7 commit dd83e2c

File tree

16 files changed

+285
-196
lines changed

16 files changed

+285
-196
lines changed

.dumirc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import path from 'path';
33

44
export default defineConfig({
55
alias: {
6-
'rc-notification$': path.resolve('src'),
7-
'rc-notification/es': path.resolve('src'),
6+
'@rc-component/notification$': path.resolve('src'),
7+
'@rc-component/notification/es': path.resolve('src'),
88
},
99
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
1010
themeConfig: {

.github/workflows/main.yml

Lines changed: 5 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,6 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
8-
1+
name: ✅ test
2+
on: [push, pull_request]
93
jobs:
10-
setup:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: checkout
14-
uses: actions/checkout@master
15-
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: '12'
19-
20-
- name: cache package-lock.json
21-
uses: actions/cache@v2
22-
with:
23-
path: package-temp-dir
24-
key: lock-${{ github.sha }}
25-
26-
- name: create package-lock.json
27-
run: npm i --package-lock-only
28-
29-
- name: hack for singe file
30-
run: |
31-
if [ ! -d "package-temp-dir" ]; then
32-
mkdir package-temp-dir
33-
fi
34-
cp package-lock.json package-temp-dir
35-
- name: cache node_modules
36-
id: node_modules_cache_id
37-
uses: actions/cache@v2
38-
with:
39-
path: node_modules
40-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
41-
42-
- name: install
43-
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
44-
run: npm ci
45-
46-
lint:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- name: checkout
50-
uses: actions/checkout@master
51-
52-
- name: restore cache from package-lock.json
53-
uses: actions/cache@v2
54-
with:
55-
path: package-temp-dir
56-
key: lock-${{ github.sha }}
57-
58-
- name: restore cache from node_modules
59-
uses: actions/cache@v2
60-
with:
61-
path: node_modules
62-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
63-
64-
- name: lint
65-
run: npm run lint
66-
67-
needs: setup
68-
69-
compile:
70-
runs-on: ubuntu-latest
71-
steps:
72-
- name: checkout
73-
uses: actions/checkout@master
74-
75-
- name: restore cache from package-lock.json
76-
uses: actions/cache@v2
77-
with:
78-
path: package-temp-dir
79-
key: lock-${{ github.sha }}
80-
81-
- name: restore cache from node_modules
82-
uses: actions/cache@v2
83-
with:
84-
path: node_modules
85-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
86-
87-
- name: compile
88-
run: npm run compile
89-
90-
needs: setup
91-
92-
coverage:
93-
runs-on: ubuntu-latest
94-
steps:
95-
- name: checkout
96-
uses: actions/checkout@master
97-
98-
- name: restore cache from package-lock.json
99-
uses: actions/cache@v2
100-
with:
101-
path: package-temp-dir
102-
key: lock-${{ github.sha }}
103-
104-
- name: restore cache from node_modules
105-
uses: actions/cache@v2
106-
with:
107-
path: node_modules
108-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
109-
110-
- name: coverage
111-
run: npm run coverage && bash <(curl -s https://codecov.io/bash)
112-
113-
needs: setup
4+
test:
5+
uses: react-component/rc-test/.github/workflows/test.yml@main
6+
secrets: inherit

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ es
3030
coverage
3131
yarn.lock
3232
package-lock.json
33+
pnpm-lock.yaml
3334

3435
# umi
3536
.umi
3637
.umi-production
3738
.umi-test
38-
.env.local
39+
.env.local
3940

4041
# dumi
4142
.dumi/tmp
42-
.dumi/tmp-production
43+
.dumi/tmp-production
44+
45+
bun.lockb

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
1-
# rc-notification
1+
# @rc-component/notification
22

33
React Notification UI Component
44

55
[![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]
66

7-
[npm-image]: http://img.shields.io/npm/v/rc-notification.svg?style=flat-square
8-
[npm-url]: http://npmjs.org/package/rc-notification
7+
[npm-image]: http://img.shields.io/npm/v/@rc-component/notification.svg?style=flat-square
8+
[npm-url]: http://npmjs.org/package/@rc-component/notification
99
[github-actions-image]: https://github.com/react-component/notification/workflows/CI/badge.svg
1010
[github-actions-url]: https://github.com/react-component/notification/actions
1111
[coveralls-image]: https://img.shields.io/coveralls/react-component/notification.svg?style=flat-square
1212
[coveralls-url]: https://coveralls.io/r/react-component/notification?branch=master
13-
[download-image]: https://img.shields.io/npm/dm/rc-notification.svg?style=flat-square
14-
[download-url]: https://npmjs.org/package/rc-notification
15-
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-notification
16-
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-notification
13+
[download-image]: https://img.shields.io/npm/dm/@rc-component/notification.svg?style=flat-square
14+
[download-url]: https://npmjs.org/package/@rc-component/notification
15+
[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/notification
16+
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/notification
1717

1818
## Install
1919

20-
[![rc-notification](https://nodei.co/npm/rc-notification.png)](https://npmjs.org/package/rc-notification)
20+
[![@rc-component/notification](https://nodei.co/npm/@rc-component/notification.png)](https://npmjs.org/package/@rc-component/notification)
2121

2222
## Usage
2323

2424
```js
25-
import Notification from 'rc-notification';
25+
import Notification from '@rc-component/notification';
2626

27-
Notification.newInstance({}, notification => {
27+
Notification.newInstance({}, (notification) => {
2828
notification.notice({
29-
content: 'content'
29+
content: 'content',
3030
});
3131
});
3232
```
3333

3434
## Compatibility
3535

36-
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
37-
| --- | --- | --- | --- | --- |
38-
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
36+
| Browser | Supported Version |
37+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
38+
| [![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png)<br>Firefox](http://godban.github.io/browsers-support-badges/) | last 2 versions |
39+
| [![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png)<br>Chrome](http://godban.github.io/browsers-support-badges/) | last 2 versions |
40+
| [![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png)<br>Safari](http://godban.github.io/browsers-support-badges/) | last 2 versions |
41+
| [![Electron](https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png)<br>Electron](http://godban.github.io/browsers-support-badges/) | last 2 versions |
3942

4043
## Example
4144

@@ -114,7 +117,7 @@ props details:
114117
</tr>
115118
<tr>
116119
<td>closable</td>
117-
<td>Boolean</td>
120+
<td>Boolean | { closeIcon: ReactNode, onClose: VoidFunction }</td>
118121
<td></td>
119122
<td>whether show close button</td>
120123
</tr>
@@ -188,4 +191,4 @@ open coverage/ dir
188191

189192
## License
190193

191-
rc-notification is released under the MIT license.
194+
@rc-component/notification is released under the MIT license.

assets/index.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
cursor: pointer;
8080
opacity: 0.2;
8181
filter: alpha(opacity=20);
82+
border: 0;
83+
background-color: #fff;
8284

8385
&-x:after {
8486
content: '×';
@@ -237,7 +239,7 @@
237239
pointer-events: auto;
238240
}
239241

240-
&::after {
242+
&::before {
241243
content: "";
242244
position: absolute;
243245
left: 0;

bunfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[install]
2+
peer = false

docs/examples/motion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CSSMotionProps } from 'rc-motion';
1+
import type { CSSMotionProps } from '@rc-component/motion';
22

33
const motion: CSSMotionProps = {
44
motionName: 'rc-notification-fade',

docs/examples/stack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const getConfig = () => ({
1515
});
1616

1717
const Demo = () => {
18-
const [{ open }, holder] = useNotification({ motion, stack: true });
18+
const [{ open }, holder] = useNotification({ motion, stack: true, closable: true });
1919

2020
return (
2121
<Context.Provider value={{ name: 'bamboo' }}>

package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rc-notification",
3-
"version": "5.6.0",
2+
"name": "@rc-component/notification",
3+
"version": "1.1.0",
44
"description": "notification ui component for react",
55
"engines": {
66
"node": ">=8.x"
@@ -39,25 +39,29 @@
3939
"build": "dumi build",
4040
"docs:deploy": "gh-pages -d .doc",
4141
"compile": "father build && lessc assets/index.less assets/index.css",
42-
"prepublishOnly": "npm run compile && np --yolo --no-publish",
42+
"prepublishOnly": "npm run compile && rc-np",
4343
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
44-
"test": "vitest",
44+
"test": "vitest --watch=false",
45+
"test:watch": "vitest",
4546
"coverage": "vitest run --coverage",
4647
"now-build": "npm run build",
4748
"prepare": "husky install"
4849
},
49-
"peerDependencies": {
50-
"react": ">=16.9.0",
51-
"react-dom": ">=16.9.0"
50+
"dependencies": {
51+
"@rc-component/motion": "^1.1.4",
52+
"@rc-component/util": "^1.2.1",
53+
"clsx": "^2.1.1"
5254
},
5355
"devDependencies": {
5456
"@rc-component/father-plugin": "^1.0.2",
5557
"@testing-library/jest-dom": "^6.4.8",
5658
"@testing-library/react": "^15.0.7",
57-
"@types/classnames": "^2.2.10",
59+
"@types/node": "^24.5.2",
5860
"@types/react": "^18.0.0",
5961
"@types/react-dom": "^18.0.0",
6062
"@types/testing-library__jest-dom": "^6.0.0",
63+
"@typescript-eslint/eslint-plugin": "^5.59.7",
64+
"@typescript-eslint/parser": "^5.59.7",
6165
"@umijs/fabric": "^2.0.0",
6266
"@vitest/coverage-v8": "^0.34.2",
6367
"cross-env": "^7.0.0",
@@ -66,23 +70,18 @@
6670
"father": "^4.0.0",
6771
"gh-pages": "^3.1.0",
6872
"husky": "^8.0.3",
69-
"jsdom": "^22.1.0",
70-
"less": "^4.2.0",
7173
"jsdom": "^24.0.0",
7274
"less": "^4.2.0",
7375
"lint-staged": "^14.0.1",
74-
"np": "^10.0.5",
7576
"prettier": "^3.0.2",
7677
"react": "^18.0.0",
7778
"react-dom": "^18.0.0",
7879
"typescript": "^5.4.5",
7980
"vitest": "^0.34.2"
8081
},
81-
"dependencies": {
82-
"@babel/runtime": "^7.10.1",
83-
"classnames": "2.x",
84-
"rc-motion": "^2.9.0",
85-
"rc-util": "^5.20.1"
82+
"peerDependencies": {
83+
"react": ">=16.9.0",
84+
"react-dom": ">=16.9.0"
8685
},
8786
"lint-staged": {
8887
"**/*.{js,jsx,tsx,ts,md,json}": [

0 commit comments

Comments
 (0)