d9-toast 1.0.14 → 1.0.16
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.
- package/README.md +5 -4
- package/dist/Toast.js +7 -4
- package/dist/toast.css +23 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,10 +80,8 @@ export default App;
|
|
|
80
80
|
|
|
81
81
|
| Prop | Type | Default | Description |
|
|
82
82
|
| ------------------ | ------- | ----------- | ------------------------------------------------------------------------------- |
|
|
83
|
-
| `position` | string | `top-right` | Position of all toasts (`top-left`, `top-right`, `bottom-left`, `bottom-right`) |
|
|
84
|
-
|
|
85
|
-
| `pauseOnHover` | boolean | `true` | Pause toast timer on hover |
|
|
86
|
-
| `pauseOnFocusLoss` | boolean | `true` | Pause toast timer when window loses focus |
|
|
83
|
+
| `position` | string | `top-right` | Position of all toasts (`top-left`, `top-right`, `bottom-left`, `bottom-right`, `center`, `center-top`, `center-bottom` ) |
|
|
84
|
+
|
|
87
85
|
|
|
88
86
|
### 4. Toast Options
|
|
89
87
|
|
|
@@ -92,6 +90,9 @@ export default App;
|
|
|
92
90
|
| `message` | string | - | The message to display |
|
|
93
91
|
| `type` | string | `info` | Type of toast (`success`, `error`, `info`, `warning`, `loading`, `submit`) |
|
|
94
92
|
| `duration` | number | 5000 | Auto-close duration in ms (0 for infinite) |
|
|
93
|
+
| `theme` | string | `light` | Default theme for all toasts (`light` or `dark`) |
|
|
94
|
+
| `pauseOnHover` | boolean | `true` | Pause toast timer on hover |
|
|
95
|
+
| `pauseOnFocusLoss` | boolean | `true` | Pause toast timer when window loses focus |
|
|
95
96
|
| `actions` | array | [] | Array of action objects `{ text: string, callback: function }` |
|
|
96
97
|
| `closable` | boolean | true | Show close button |
|
|
97
98
|
| `progress` | boolean | true | Show progress bar |
|
package/dist/Toast.js
CHANGED
|
@@ -148,10 +148,13 @@ var Toast = function Toast(_ref) {
|
|
|
148
148
|
}, idx);
|
|
149
149
|
})
|
|
150
150
|
}), progress && duration !== 0 && /*#__PURE__*/_jsx("div", {
|
|
151
|
-
className: "
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
className: "progress-container ".concat(type),
|
|
152
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
153
|
+
className: "toast-progress ".concat(type),
|
|
154
|
+
style: {
|
|
155
|
+
width: "".concat(progressWidth, "%")
|
|
156
|
+
}
|
|
157
|
+
})
|
|
155
158
|
})]
|
|
156
159
|
})
|
|
157
160
|
});
|
package/dist/toast.css
CHANGED
|
@@ -118,22 +118,37 @@
|
|
|
118
118
|
border: 1px solid;
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
.toast-progress {
|
|
121
|
+
.progress-container {
|
|
123
122
|
position: absolute;
|
|
124
123
|
bottom: 0;
|
|
125
124
|
left: 0;
|
|
125
|
+
width: 100%;
|
|
126
126
|
height: 0.25rem;
|
|
127
|
-
transition: width 0.1s linear;
|
|
128
127
|
border-radius: 0 0 0.25rem 0.25rem;
|
|
128
|
+
background-color: rgba(220, 220, 220, 0.715);
|
|
129
129
|
overflow: hidden;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
|
|
132
|
+
.progress-container.success {
|
|
133
|
+
background-color: oklch(62.7% 0.194 149.214 / 0.25);
|
|
134
|
+
}
|
|
135
|
+
.progress-container.error {
|
|
136
|
+
background-color: oklch(57.7% 0.245 27.325 / 0.25);
|
|
137
|
+
}
|
|
138
|
+
.progress-container.info {
|
|
139
|
+
background-color: oklch(54.6% 0.245 262.881 / 0.25);
|
|
140
|
+
}
|
|
141
|
+
.progress-container.warning {
|
|
142
|
+
background-color: oklch(68.1% 0.162 75.834 / 0.25);
|
|
143
|
+
}
|
|
144
|
+
.progress-container.loading,
|
|
145
|
+
.progress-container.submit {
|
|
146
|
+
background-color: oklch(48.847% 0.03665 257.306 / 0.25);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.toast-progress {
|
|
134
150
|
height: 0.25rem;
|
|
135
|
-
|
|
136
|
-
opacity: 0.5;
|
|
151
|
+
transition: width 0.1s linear;
|
|
137
152
|
}
|
|
138
153
|
|
|
139
154
|
.toast-progress.success {
|