@pixotope/toasts 0.0.0-stage → 0.0.1
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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +85 -2
- package/dist/index.cjs +443 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +134 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +438 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +272 -0
- package/package.json +65 -3
package/dist/style.css
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
.NAvrhW_toaster {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
display: flex;
|
|
6
|
+
position: fixed;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.NAvrhW_toaster > * {
|
|
10
|
+
pointer-events: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.NAvrhW_toaster[data-position$="-right"] {
|
|
14
|
+
--px-toast-enter-transform: translateX(100%);
|
|
15
|
+
align-items: flex-end;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.NAvrhW_toaster[data-position$="-left"] {
|
|
19
|
+
--px-toast-enter-transform: translateX(-100%);
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.NAvrhW_toaster[data-position$="-center"] {
|
|
24
|
+
align-items: center;
|
|
25
|
+
transform: translateX(-50%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.NAvrhW_toaster[data-position="top-center"] {
|
|
29
|
+
--px-toast-enter-transform: translateY(-100%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.NAvrhW_toaster[data-position="bottom-center"] {
|
|
33
|
+
--px-toast-enter-transform: translateY(100%);
|
|
34
|
+
}
|
|
35
|
+
@keyframes _2Xv1UW_enter {
|
|
36
|
+
from {
|
|
37
|
+
transform: var(--px-toast-enter-transform, translateX(100%));
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
to {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
transform: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes _2Xv1UW_exit {
|
|
48
|
+
from {
|
|
49
|
+
opacity: 1;
|
|
50
|
+
transform: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
to {
|
|
54
|
+
transform: var(--px-toast-enter-transform, translateX(100%));
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes _2Xv1UW_timer {
|
|
60
|
+
from {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
to {
|
|
65
|
+
width: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
._2Xv1UW_toast {
|
|
70
|
+
--px-toast-accent: var(--support-03);
|
|
71
|
+
border: 0 solid var(--px-toast-accent);
|
|
72
|
+
background-color: var(--ui-02);
|
|
73
|
+
user-select: text;
|
|
74
|
+
border-left-width: 5px;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
width: 320px;
|
|
77
|
+
padding: 12px 24px 12px 20px;
|
|
78
|
+
animation: .3s ease-in-out _2Xv1UW_enter;
|
|
79
|
+
display: flex;
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
._2Xv1UW_toast[data-type="info"] {
|
|
84
|
+
--px-toast-accent: var(--support-04);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
._2Xv1UW_toast[data-type="error"] {
|
|
88
|
+
--px-toast-accent: var(--interactive-07);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
._2Xv1UW_toast[data-type="success"] {
|
|
92
|
+
--px-toast-accent: var(--support-12);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
._2Xv1UW_toast[data-type="insight"] {
|
|
96
|
+
--px-toast-accent: var(--support-13);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
._2Xv1UW_toast[data-type="clean"] {
|
|
100
|
+
--px-toast-accent: transparent;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
._2Xv1UW_toast[data-visible="false"] {
|
|
104
|
+
animation: .3s ease-in-out forwards _2Xv1UW_exit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
._2Xv1UW_timer {
|
|
108
|
+
background: var(--text-01);
|
|
109
|
+
opacity: .3;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 4px;
|
|
112
|
+
animation: linear forwards _2Xv1UW_timer;
|
|
113
|
+
position: absolute;
|
|
114
|
+
bottom: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
._2Xv1UW_toast:hover ._2Xv1UW_timer, [data-paused="true"] ._2Xv1UW_timer {
|
|
119
|
+
animation-play-state: paused;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
._2Xv1UW_icon {
|
|
123
|
+
fill: var(--px-toast-accent);
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
._2Xv1UW_buttons {
|
|
128
|
+
gap: 8px;
|
|
129
|
+
margin-right: 14px;
|
|
130
|
+
display: flex;
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: 12px;
|
|
133
|
+
right: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
._2Xv1UW_iconButton {
|
|
137
|
+
color: var(--text-01);
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
background: none;
|
|
140
|
+
border: none;
|
|
141
|
+
margin: 0;
|
|
142
|
+
padding: 0;
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
display: inline-flex;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
._2Xv1UW_iconButton svg {
|
|
148
|
+
fill: currentColor;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
._2Xv1UW_iconButton:focus-visible {
|
|
152
|
+
outline: 1px solid var(--interactive-01);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
._2Xv1UW_copyButton {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
transition: opacity .2s ease-in-out;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
._2Xv1UW_copyButton svg {
|
|
161
|
+
opacity: 0;
|
|
162
|
+
transition: opacity .2s ease-in-out;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
._2Xv1UW_toast:hover ._2Xv1UW_copyButton svg, ._2Xv1UW_copyButton:focus-visible svg {
|
|
166
|
+
opacity: 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
._2Xv1UW_copyButton[data-copied="true"] {
|
|
170
|
+
opacity: 0;
|
|
171
|
+
transition-duration: 1s;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
._2Xv1UW_content {
|
|
175
|
+
width: 100%;
|
|
176
|
+
color: var(--text-01);
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
justify-content: flex-start;
|
|
179
|
+
align-items: flex-start;
|
|
180
|
+
display: flex;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
._2Xv1UW_title {
|
|
184
|
+
color: var(--text-01);
|
|
185
|
+
letter-spacing: .16px;
|
|
186
|
+
text-align: left;
|
|
187
|
+
margin: 0 0 4px;
|
|
188
|
+
padding-bottom: 4px;
|
|
189
|
+
font-size: 16px;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
line-height: 22px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
._2Xv1UW_subtitle {
|
|
195
|
+
color: var(--text-03);
|
|
196
|
+
letter-spacing: .32px;
|
|
197
|
+
margin-top: -4px;
|
|
198
|
+
margin-bottom: 8px;
|
|
199
|
+
font-size: 12px;
|
|
200
|
+
font-weight: 400;
|
|
201
|
+
line-height: 16px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
._2Xv1UW_description {
|
|
205
|
+
color: var(--text-01);
|
|
206
|
+
letter-spacing: .16px;
|
|
207
|
+
text-align: left;
|
|
208
|
+
overflow-wrap: anywhere;
|
|
209
|
+
margin-bottom: 8px;
|
|
210
|
+
font-size: 14px;
|
|
211
|
+
font-weight: 400;
|
|
212
|
+
line-height: 20px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
._2Xv1UW_note {
|
|
216
|
+
background-color: var(--faded-light-green-2);
|
|
217
|
+
color: var(--text-01);
|
|
218
|
+
text-align: left;
|
|
219
|
+
border-radius: 2px;
|
|
220
|
+
align-self: stretch;
|
|
221
|
+
margin-bottom: 8px;
|
|
222
|
+
padding: 4px 8px;
|
|
223
|
+
font-family: IBM Plex Mono, monospace;
|
|
224
|
+
font-size: 14px;
|
|
225
|
+
font-weight: 400;
|
|
226
|
+
line-height: 20px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
._2Xv1UW_action {
|
|
230
|
+
border: 2px solid var(--interactive-01);
|
|
231
|
+
background: var(--interactive-01);
|
|
232
|
+
width: 100%;
|
|
233
|
+
color: var(--ui-01);
|
|
234
|
+
font: inherit;
|
|
235
|
+
text-align: center;
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
justify-content: center;
|
|
238
|
+
align-items: center;
|
|
239
|
+
margin-bottom: 8px;
|
|
240
|
+
padding: 10px 22px;
|
|
241
|
+
font-size: 14px;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
line-height: 16px;
|
|
244
|
+
transition: opacity .3s, background .3s;
|
|
245
|
+
display: inline-flex;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
._2Xv1UW_action:hover {
|
|
249
|
+
opacity: .9;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
._2Xv1UW_action:active {
|
|
253
|
+
opacity: .8;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
._2Xv1UW_action:focus {
|
|
257
|
+
outline: none;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
._2Xv1UW_action:focus-visible {
|
|
261
|
+
outline: 2px solid var(--interactive-03-hover);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
._2Xv1UW_time {
|
|
265
|
+
width: 100%;
|
|
266
|
+
color: var(--text-03);
|
|
267
|
+
justify-content: space-between;
|
|
268
|
+
font-size: 12px;
|
|
269
|
+
font-weight: 400;
|
|
270
|
+
line-height: 16px;
|
|
271
|
+
display: flex;
|
|
272
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixotope/toasts",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Pixotope toast notifications for React: a toast() API and a <Toaster> to render them",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Pixotope",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+ssh://git@bitbucket.org/futureuniverse/futureuniverse.bitbucket.io.git",
|
|
10
|
+
"directory": "packages/toasts"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"*.css"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
"CHANGELOG.md",
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"source": "./src/index.ts",
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/index.d.cts",
|
|
32
|
+
"default": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./style.css": "./dist/style.css",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18.0.0"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@pixotope/event-bus": "^0.6.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
46
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@pixotope/design-tokens": "0.0.1",
|
|
50
|
+
"@testing-library/dom": "^10.4.1",
|
|
51
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
52
|
+
"@testing-library/react": "^16.3.0",
|
|
53
|
+
"@types/node": "^24.10.1",
|
|
54
|
+
"@types/react": "^18.2.0",
|
|
55
|
+
"@types/react-dom": "^18.2.0",
|
|
56
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
57
|
+
"jsdom": "^24.0.0",
|
|
58
|
+
"react": "18.2.0",
|
|
59
|
+
"react-dom": "18.2.0",
|
|
60
|
+
"sass": "^1.94.2",
|
|
61
|
+
"vite-plus": "1.3.0"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "vp pack",
|
|
65
|
+
"test": "vp test run",
|
|
66
|
+
"type-check": "tsc --noEmit"
|
|
67
|
+
}
|
|
6
68
|
}
|