react-strawberry-toast 2.1.0-alpha.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +77 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # React-Strawberry-Toast
2
+
3
+ A simple and customizable React toast library
4
+
5
+ ## Documentation
6
+
7
+ For more detailed information, please refer to the official [Documentation](https://dkpark10.github.io/react-strawberry-toast/)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm i --save react-strawberry-toast
13
+ ```
14
+
15
+ ```bash
16
+ yarn add react-strawberry-toast
17
+ ```
18
+
19
+ ```bash
20
+ pnpm i --save react-strawberry-toast
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```jsx
26
+ import { ToastContainer, toast } from 'react-strawberry-toast';
27
+ import 'react-strawberry-toast/dist/style.css';
28
+
29
+ function App() {
30
+ const click = () => {
31
+ toast('hello strawberry toast');
32
+ };
33
+
34
+ return (
35
+ <>
36
+ <ToastContainer />
37
+ <button type='button' onClick={click}>click</button>
38
+ </>
39
+ );
40
+ }
41
+ ```
42
+
43
+ ## API
44
+
45
+ ### &lt;ToastContainer /&gt;
46
+
47
+ | Option | Description | Type | Default |
48
+ |:-----------|:-----------|:-----------|:-----------|
49
+ | position | Global toast's Position | top-left, top-center, top-right, bottom-left, bottom-center, bottom-right | top-center |
50
+ | containerId | ToastContainer's unique id | String | |
51
+ | reverse | Direction when toast appear | Boolean | false |
52
+ | className | Class of ToastContainer | String | |
53
+ | style | Style of ToastContainer | Object | |
54
+ | gap | Gap Between toasts | Number | 9 |
55
+ | pauseOnActivate | Pause Toast timer when blur events occurs | Boolean | true |
56
+
57
+
58
+ ### toast
59
+
60
+ | Option | Description | Type | Default |
61
+ |:-----------|:-----------|:-----------|:-----------|
62
+ | toastId | Toast's unique Id | String | |
63
+ | position | Position per toast | top-left, top-center, top-right, bottom-left, bottom-center, bottom-right | top-center |
64
+ | containerId | ID shown in the Toast Container Unique ID | String | |
65
+ | pauseOnHover | Option that sets the timer to stop or not when a hover event occurs | Boolean | true |
66
+ | icon | The icon to be displayed in the toast | ReactNode | |
67
+ | timeOut | Time for toast to disappear | Number | 3000 |
68
+ | removeTimeOut | Time for toast to remove In Toast List | Number | 200 |
69
+ | className | Class of toast | String | |
70
+ | style | Style of toast | Object | |
71
+ | target | Target element where toast will be located | Object | |
72
+ | closeButton | Option to show or hide the close button | Boolean | false |
73
+
74
+
75
+ ## License
76
+
77
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-strawberry-toast",
3
3
  "description": "A simple and customizable React toast library",
4
- "version": "2.1.0-alpha.1",
4
+ "version": "2.1.0",
5
5
  "author": "dkpark10",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -56,7 +56,8 @@
56
56
  "test": "vitest",
57
57
  "test:e2e": "npx playwright test",
58
58
  "test:e2e:ui": "npx playwright test --ui",
59
- "deploy": "pnpm run test --run && pnpm run test:e2e && pnpm run build && npm publish --access=public"
59
+ "prepare": "cp ../../README.md ./README.md",
60
+ "deploy": "pnpm run prepare && pnpm run test --run && pnpm run test:e2e && pnpm run build && npm publish --access=public"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@playwright/test": "^1.50.1",