@starasia/toast 1.0.2 → 2.0.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.
package/dist/toast.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as t, jsxs as w } from "react/jsx-runtime";
2
- import p, { useState as b, useRef as x, useEffect as h } from "react";
1
+ import { jsx as s, jsxs as x } from "react/jsx-runtime";
2
+ import b, { useState as p, useRef as k, useEffect as v } from "react";
3
3
  import C from "react-dom";
4
4
  const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
5
5
 
@@ -11,71 +11,69 @@ const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display
11
11
  }
12
12
 
13
13
  :root {
14
- /* color solid default */
15
- --starasia-ui-solid-background-default: #111827;
16
- --starasia-ui-solid-color-default: #fff;
17
- --starasia-ui-solid-border-default: #e5e7eb;
14
+ /* solid default (dark bg) */
15
+ --sa-toast-solid-bg-default: var(--sa-text-bolder, #1e1f21);
16
+ --sa-toast-solid-text-default: var(--sa-text-primary-inverse, #ffffff);
17
+ --sa-toast-solid-border-default: var(--sa-border-subtle, #0b120e24);
18
18
 
19
- /* color outline default */
20
- --starasia-ui-outline-background-default: #f9fafb;
21
- --starasia-ui-outline-color-default: #111827;
22
- --starasia-ui-outline-border-default: #e5e7eb;
23
- --starasia-ui-outline-progress-default: #181a19;
19
+ /* outline default */
20
+ --sa-toast-outline-bg-default: var(--sa-background-primary, #ffffff);
21
+ --sa-toast-outline-text-default: var(--sa-text-primary, #292a2e);
22
+ --sa-toast-outline-border-default: var(--sa-border-subtle, #0b120e24);
23
+ --sa-toast-outline-progress-default: var(--sa-text-bolder, #1e1f21);
24
24
 
25
- /* color outline red */
26
- --starasia-ui-outline-background-danger: #fef2f2;
27
- --starasia-ui-outline-color-danger: #dc2626;
28
- --starasia-ui-outline-border-danger: #fecaca;
29
- --starasia-ui-outline-progress-danger: #181a19;
30
- --starasia-ui-outline-progress-danger: #c9184a;
25
+ /* outline danger */
26
+ --sa-toast-outline-bg-danger: var(--sa-background-error-subtlest, #fff0f3);
27
+ --sa-toast-outline-text-danger: var(--sa-background-error, #c9184a);
28
+ --sa-toast-outline-border-danger: var(--sa-color-error-100, #ffccd5);
29
+ --sa-toast-outline-progress-danger: var(--sa-background-error, #c9184a);
31
30
 
32
- /* color solid red */
33
- --starasia-ui-solid-background-danger: #c9184a;
34
- --starasia-ui-solid-color-danger: #fff0f3;
35
- --starasia-ui-solid-border-danger: #c9184a;
31
+ /* solid danger */
32
+ --sa-toast-solid-bg-danger: var(--sa-background-error, #c9184a);
33
+ --sa-toast-solid-text-danger: var(--sa-color-error-50, #fff0f3);
34
+ --sa-toast-solid-border-danger: var(--sa-background-error, #c9184a);
36
35
 
37
- /* color outline success */
38
- --starasia-ui-outline-background-success: #dcf6ea;
39
- --starasia-ui-outline-color-success: #28ac6e;
40
- --starasia-ui-outline-border-success: #97e6c1;
41
- --starasia-ui-outline-progress-success: #28ac6e;
36
+ /* outline success */
37
+ --sa-toast-outline-bg-success: var(--sa-background-success-subtlest, #ecfff6);
38
+ --sa-toast-outline-text-success: var(--sa-background-success, #28ac6e);
39
+ --sa-toast-outline-border-success: var(--sa-color-success-200, #97e6c1);
40
+ --sa-toast-outline-progress-success: var(--sa-background-success, #28ac6e);
42
41
 
43
- /* color solid success */
44
- --starasia-ui-solid-background-success: #28ac6e;
45
- --starasia-ui-solid-color-success: #dcf6ea;
46
- --starasia-ui-solid-border-success: #28ac6e;
42
+ /* solid success */
43
+ --sa-toast-solid-bg-success: var(--sa-background-success, #28ac6e);
44
+ --sa-toast-solid-text-success: var(--sa-color-success-50, #ecfff6);
45
+ --sa-toast-solid-border-success: var(--sa-background-success, #28ac6e);
47
46
 
48
- /* color outline info */
49
- --starasia-ui-outline-background-info: #e3f2fd;
50
- --starasia-ui-outline-color-info: #1976d2;
51
- --starasia-ui-outline-border-info: #64b5f6;
52
- --starasia-ui-outline-progress-info: #1976d2;
47
+ /* outline info */
48
+ --sa-toast-outline-bg-info: var(--sa-background-info-subtlest, #effaff);
49
+ --sa-toast-outline-text-info: var(--sa-background-info, #0090d4);
50
+ --sa-toast-outline-border-info: var(--sa-color-info-200, #b6eaff);
51
+ --sa-toast-outline-progress-info: var(--sa-background-info, #0090d4);
53
52
 
54
- /* color solid info */
55
- --starasia-ui-solid-background-info: #1976d2;
56
- --starasia-ui-solid-color-info: #e3f2fd;
57
- --starasia-ui-solid-border-info: #1976d2;
53
+ /* solid info */
54
+ --sa-toast-solid-bg-info: var(--sa-background-info, #0090d4);
55
+ --sa-toast-solid-text-info: var(--sa-color-info-50, #effaff);
56
+ --sa-toast-solid-border-info: var(--sa-background-info, #0090d4);
58
57
 
59
- /* color outline warning */
60
- --starasia-ui-outline-background-warning: #fdf3e4;
61
- --starasia-ui-outline-color-warning: #181a19;
62
- --starasia-ui-outline-border-warning: #f4c583;
63
- --starasia-ui-outline-progress-warning: #ed9f30;
58
+ /* outline warning */
59
+ --sa-toast-outline-bg-warning: var(--sa-background-warning-subtlest, #fef2e6);
60
+ --sa-toast-outline-text-warning: var(--sa-text-primary, #292a2e);
61
+ --sa-toast-outline-border-warning: var(--sa-color-warning-200, #f4c583);
62
+ --sa-toast-outline-progress-warning: var(--sa-color-warning-400, #ed9f30);
64
63
 
65
- /* color solid warning */
66
- --starasia-ui-solid-background-warning: #ed9f30;
67
- --starasia-ui-solid-color-warning: #fffeff;
68
- --starasia-ui-solid-border-warning: #ed9f30;
64
+ /* solid warning */
65
+ --sa-toast-solid-bg-warning: var(--sa-color-warning-400, #ed9f30);
66
+ --sa-toast-solid-text-warning: var(--sa-background-primary, #ffffff);
67
+ --sa-toast-solid-border-warning: var(--sa-color-warning-400, #ed9f30);
69
68
 
70
- /* height */
71
- --starasia-ui-h-0-5: 0.125rem; /* 2px */
69
+ --sa-toast-h-progress: 0.125rem;
72
70
  }
73
71
  /* styling for container */
74
72
  .starasia-toast-container {
75
73
  display: flex;
76
74
  flex-direction: column;
77
- gap: var(--starasia-ui-spacing-xs, 4px);
78
- padding: var(--starasia-ui-spacing-sm, 8px);
75
+ gap: var(--sa-spacing-xs, 4px);
76
+ padding: var(--sa-spacing-sm, 8px);
79
77
  position: fixed;
80
78
  max-height: 100vh;
81
79
  overflow: auto;
@@ -109,85 +107,85 @@ const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display
109
107
  }
110
108
  /* styling for */
111
109
  .starasia-toast-item-container {
112
- padding: var(--starasia-ui-spacing-lg, 16px);
110
+ padding: var(--sa-spacing-lg, 16px);
113
111
  width: max-content;
114
- border-radius: var(--starasia-ui-radii-md, 6px);
112
+ border-radius: var(--sa-radii-md, 6px);
115
113
  display: flex;
116
114
  align-items: center;
117
- gap: var(--starasia-ui-spacing-sm, 8px);
118
- border: var(--starasia-ui-border, 1px) solid transparent;
119
- font-size: var(--starasia-ui-fontSizes-md, 14px);
115
+ gap: var(--sa-spacing-sm, 8px);
116
+ border: var(--sa-border, 1px) solid transparent;
117
+ font-size: var(--sa-font-size-md, 14px);
120
118
  position: relative;
121
119
  overflow: hidden;
122
120
  width: 100%;
123
121
  }
124
122
  /* DEFAULT TOAST */
125
123
  .starasia-toast-item-container-solid-default {
126
- background-color: var(--starasia-ui-solid-background-default);
127
- color: var(--starasia-ui-solid-color-default);
128
- border-color: var(--starasia-ui-solid-border-default);
124
+ background-color: var(--sa-toast-solid-bg-default);
125
+ color: var(--sa-toast-solid-text-default);
126
+ border-color: var(--sa-toast-solid-border-default);
129
127
  }
130
128
 
131
129
  .starasia-toast-item-container-outline-default {
132
- background-color: var(--starasia-ui-outline-background-default);
133
- color: var(--starasia-ui-outline-color-default);
134
- border-color: var(--starasia-ui-outline-border-default);
130
+ background-color: var(--sa-toast-outline-bg-default);
131
+ color: var(--sa-toast-outline-text-default);
132
+ border-color: var(--sa-toast-outline-border-default);
135
133
  }
136
134
 
137
135
  /* DEFAULT DANGER */
138
136
  .starasia-toast-item-container-outline-danger {
139
- background-color: var(--starasia-ui-outline-background-danger);
140
- color: var(--starasia-ui-outline-color-danger);
141
- border-color: var(--starasia-ui-outline-border-danger);
137
+ background-color: var(--sa-toast-outline-bg-danger);
138
+ color: var(--sa-toast-outline-text-danger);
139
+ border-color: var(--sa-toast-outline-border-danger);
142
140
  }
143
141
 
144
142
  .starasia-toast-item-container-solid-danger {
145
- background-color: var(--starasia-ui-solid-background-danger);
146
- color: var(--starasia-ui-solid-color-danger);
147
- border-color: var(--starasia-ui-solid-border-danger);
143
+ background-color: var(--sa-toast-solid-bg-danger);
144
+ color: var(--sa-toast-solid-text-danger);
145
+ border-color: var(--sa-toast-solid-border-danger);
148
146
  }
149
147
 
150
148
  /* DEFAULT SUCCESS */
151
149
  .starasia-toast-item-container-outline-success {
152
- background-color: var(--starasia-ui-outline-background-success);
153
- color: var(--starasia-ui-outline-color-success);
154
- border-color: var(--starasia-ui-outline-border-success);
150
+ background-color: var(--sa-toast-outline-bg-success);
151
+ color: var(--sa-toast-outline-text-success);
152
+ border-color: var(--sa-toast-outline-border-success);
155
153
  }
156
154
 
157
155
  .starasia-toast-item-container-solid-success {
158
- background-color: var(--starasia-ui-solid-background-success);
159
- color: var(--starasia-ui-solid-color-success);
160
- border-color: var(--starasia-ui-solid-border-success);
156
+ background-color: var(--sa-toast-solid-bg-success);
157
+ color: var(--sa-toast-solid-text-success);
158
+ border-color: var(--sa-toast-solid-border-success);
161
159
  }
162
160
 
163
161
  /* DEFAULT INFO */
164
162
  .starasia-toast-item-container-outline-info {
165
- background-color: var(--starasia-ui-outline-background-info);
166
- color: var(--starasia-ui-outline-color-info);
167
- border-color: var(--starasia-ui-outline-border-info);
163
+ background-color: var(--sa-toast-outline-bg-info);
164
+ color: var(--sa-toast-outline-text-info);
165
+ border-color: var(--sa-toast-outline-border-info);
168
166
  }
169
167
 
170
168
  .starasia-toast-item-container-solid-info {
171
- background-color: var(--starasia-ui-solid-background-info);
172
- color: var(--starasia-ui-solid-color-info);
173
- border-color: var(--starasia-ui-solid-border-info);
169
+ background-color: var(--sa-toast-solid-bg-info);
170
+ color: var(--sa-toast-solid-text-info);
171
+ border-color: var(--sa-toast-solid-border-info);
174
172
  }
175
173
  /* DEFAULT WARNING */
176
174
  .starasia-toast-item-container-outline-warning {
177
- background-color: var(--starasia-ui-outline-background-warning);
178
- color: var(--starasia-ui-outline-color-warning);
179
- border-color: var(--starasia-ui-outline-border-warning);
175
+ background-color: var(--sa-toast-outline-bg-warning);
176
+ color: var(--sa-toast-outline-text-warning);
177
+ border-color: var(--sa-toast-outline-border-warning);
180
178
  }
181
179
 
182
180
  .starasia-toast-item-container-solid-warning {
183
- background-color: var(--starasia-ui-solid-background-warning);
184
- color: var(--starasia-ui-solid-color-warning);
185
- border-color: var(--starasia-ui-solid-border-warning);
181
+ background-color: var(--sa-toast-solid-bg-warning);
182
+ color: var(--sa-toast-solid-text-warning);
183
+ border-color: var(--sa-toast-solid-border-warning);
186
184
  }
187
185
 
188
186
  /* PROGRESS BAR */
189
187
  .starasia-toast-item-progress {
190
- height: var(--starasia-ui-h-0-5);
188
+ height: var(--sa-toast-h-progress);
191
189
  width: 100%;
192
190
  position: absolute;
193
191
  bottom: 0;
@@ -197,19 +195,19 @@ const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display
197
195
  }
198
196
 
199
197
  .starasia-toast-item-progress-outline-default {
200
- background-color: var(--starasia-ui-outline-progress-default);
198
+ background-color: var(--sa-toast-outline-progress-default);
201
199
  }
202
200
  .starasia-toast-item-progress-outline-info {
203
- background-color: var(--starasia-ui-outline-progress-info);
201
+ background-color: var(--sa-toast-outline-progress-info);
204
202
  }
205
203
  .starasia-toast-item-progress-outline-success {
206
- background-color: var(--starasia-ui-outline-progress-success);
204
+ background-color: var(--sa-toast-outline-progress-success);
207
205
  }
208
206
  .starasia-toast-item-progress-outline-danger {
209
- background-color: var(--starasia-ui-outline-progress-danger);
207
+ background-color: var(--sa-toast-outline-progress-danger);
210
208
  }
211
209
  .starasia-toast-item-progress-outline-warning {
212
- background-color: var(--starasia-ui-outline-progress-warning);
210
+ background-color: var(--sa-toast-outline-progress-warning);
213
211
  }
214
212
 
215
213
  /* animation */
@@ -304,120 +302,120 @@ const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display
304
302
  let E = 1;
305
303
  class T {
306
304
  constructor() {
307
- this.subscribe = (n) => (this.subscribers.push(n), () => {
308
- const r = this.subscribers.indexOf(n);
309
- this.subscribers.splice(r, 1);
310
- }), this.publish = (n) => {
311
- this.subscribers.forEach((r) => r(n));
312
- }, this.addToast = (n) => {
313
- this.publish(n), this.toasts = [...this.toasts, n];
314
- }, this.create = (n) => {
315
- const { message: r, type: i } = n, s = E++;
316
- return this.addToast({ title: r, type: i, id: s }), s;
317
- }, this.dismiss = (n) => (this.subscribers.forEach((r) => r({ id: n, dismiss: !0 })), n), this.danger = (n) => this.create({ message: n, type: "danger" }), this.warning = (n) => this.create({ message: n, type: "warning" }), this.success = (n) => this.create({ type: "success", message: n }), this.info = (n) => this.create({ type: "info", message: n }), this.default = (n) => this.create({ type: "default", message: n }), this.subscribers = [], this.toasts = [];
305
+ this.subscribe = (t) => (this.subscribers.push(t), () => {
306
+ const o = this.subscribers.indexOf(t);
307
+ this.subscribers.splice(o, 1);
308
+ }), this.publish = (t) => {
309
+ this.subscribers.forEach((o) => o(t));
310
+ }, this.addToast = (t) => {
311
+ this.publish(t), this.toasts = [...this.toasts, t];
312
+ }, this.create = (t) => {
313
+ const { message: o, type: e } = t, a = E++;
314
+ return this.addToast({ title: o, type: e, id: a }), a;
315
+ }, this.dismiss = (t) => (this.subscribers.forEach((o) => o({ id: t, dismiss: !0 })), t), this.danger = (t) => this.create({ message: t, type: "danger" }), this.warning = (t) => this.create({ message: t, type: "warning" }), this.success = (t) => this.create({ type: "success", message: t }), this.info = (t) => this.create({ type: "info", message: t }), this.default = (t) => this.create({ type: "default", message: t }), this.subscribers = [], this.toasts = [];
318
316
  }
319
317
  }
320
- const o = new T(), D = Object.assign({
321
- success: o.success,
322
- info: o.info,
323
- default: o.default,
324
- danger: o.danger,
325
- warning: o.warning
326
- }), v = "starasia-toast-styles", S = (a) => {
327
- if (!document.getElementById(v)) {
328
- const n = document.createElement("style");
329
- n.id = v, n.textContent = a, document.head.appendChild(n);
318
+ const r = new T(), D = Object.assign({
319
+ success: r.success,
320
+ info: r.info,
321
+ default: r.default,
322
+ danger: r.danger,
323
+ warning: r.warning
324
+ }), h = "starasia-toast-styles", S = (n) => {
325
+ if (!document.getElementById(h)) {
326
+ const t = document.createElement("style");
327
+ t.id = h, t.textContent = n, document.head.appendChild(t);
330
328
  }
331
329
  };
332
330
  S(L);
333
331
  const N = ({
334
- type: a = "outline",
335
- direction: n = "bottom-right"
332
+ type: n = "outline",
333
+ direction: t = "bottom-right"
336
334
  }) => {
337
- const [r, i] = p.useState([]);
338
- return p.useEffect(() => o.subscribe((s) => {
339
- if (s.dismiss) {
340
- i((e) => e.filter((u) => u.id !== s.id));
335
+ const [o, e] = b.useState([]);
336
+ return b.useEffect(() => r.subscribe((a) => {
337
+ if (a.dismiss) {
338
+ e((i) => i.filter((d) => d.id !== a.id));
341
339
  return;
342
340
  }
343
341
  setTimeout(() => {
344
342
  C.flushSync(() => {
345
- i((e) => [s, ...e]);
343
+ e((i) => [a, ...i]);
346
344
  });
347
345
  });
348
- }), []), /* @__PURE__ */ t(
346
+ }), []), /* @__PURE__ */ s(
349
347
  "div",
350
348
  {
351
- className: `starasia-toast-container starasia-toast-container-${n}`,
352
- children: r.map((s) => /* @__PURE__ */ t(
349
+ className: `starasia-toast-container starasia-toast-container-${t}`,
350
+ children: o.map((a) => /* @__PURE__ */ s(
353
351
  R,
354
352
  {
355
- data: s,
356
- type: a,
357
- direction: n
353
+ data: a,
354
+ type: n,
355
+ direction: t
358
356
  },
359
- s.id
357
+ a.id
360
358
  ))
361
359
  }
362
360
  );
363
- }, R = ({ data: a, type: n = "solid", direction: r }) => {
364
- const [i, s] = b(null), [e, u] = b(!1), l = x(null), f = () => {
365
- const c = setTimeout(() => {
361
+ }, R = ({ data: n, type: t = "solid", direction: o }) => {
362
+ const [e, a] = p(null), [i, d] = p(!1), c = k(null), f = () => {
363
+ const l = setTimeout(() => {
366
364
  g();
367
365
  }, 5e3);
368
- s(c);
369
- }, d = () => {
370
- i && (clearTimeout(i), s(null));
366
+ a(l);
367
+ }, u = () => {
368
+ e && (clearTimeout(e), a(null));
371
369
  }, g = () => {
372
- o.dismiss(a.id);
370
+ r.dismiss(n.id);
373
371
  };
374
- h(() => (e ? d() : f(), () => {
375
- d();
376
- }), [e]), h(() => {
377
- const c = l.current, m = () => {
372
+ v(() => (i ? u() : f(), () => {
373
+ u();
374
+ }), [i]), v(() => {
375
+ const l = c.current, m = () => {
378
376
  g();
379
377
  };
380
- return c && c.addEventListener("animationend", m), () => {
381
- c && c.removeEventListener("animationend", m);
378
+ return l && l.addEventListener("animationend", m), () => {
379
+ l && l.removeEventListener("animationend", m);
382
380
  };
383
381
  }, []);
384
382
  const y = () => {
385
- u(!0), d(), l.current && (l.current.style.animationPlayState = "paused");
386
- }, k = () => {
387
- u(!1), f(), l.current && (l.current.style.animationPlayState = "running");
383
+ d(!0), u(), c.current && (c.current.style.animationPlayState = "paused");
384
+ }, w = () => {
385
+ d(!1), f(), c.current && (c.current.style.animationPlayState = "running");
388
386
  };
389
- return /* @__PURE__ */ w(
387
+ return /* @__PURE__ */ x(
390
388
  "div",
391
389
  {
392
- className: `starasia-toast-item-container starasia-toast-item-container-${n}-${a.type} starasia-toast-item-container-animation-${r}`,
390
+ className: `starasia-toast-item-container starasia-toast-item-container-${t}-${n.type} starasia-toast-item-container-animation-${o}`,
393
391
  onMouseEnter: y,
394
- onMouseLeave: k,
392
+ onMouseLeave: w,
395
393
  children: [
396
- /* @__PURE__ */ t("div", { style: { display: "flex" }, children: a.type === "success" ? /* @__PURE__ */ t(M, { style: { color: "inherit" } }) : /* @__PURE__ */ t(I, { style: { color: "inherit" } }) }),
397
- /* @__PURE__ */ t("div", { style: { flex: 1 }, children: a.title }),
398
- /* @__PURE__ */ t(
394
+ /* @__PURE__ */ s("div", { style: { display: "flex" }, children: n.type === "success" ? /* @__PURE__ */ s(M, { style: { color: "inherit" } }) : /* @__PURE__ */ s(I, { style: { color: "inherit" } }) }),
395
+ /* @__PURE__ */ s("div", { style: { flex: 1 }, children: n.title }),
396
+ /* @__PURE__ */ s(
399
397
  "div",
400
398
  {
401
399
  style: { display: "flex", cursor: "pointer" },
402
- onClick: () => o.dismiss(a.id),
403
- children: /* @__PURE__ */ t(A, { style: { color: "inherit" } })
400
+ onClick: () => r.dismiss(n.id),
401
+ children: /* @__PURE__ */ s(A, { style: { color: "inherit" } })
404
402
  }
405
403
  ),
406
- n === "outline" ? /* @__PURE__ */ t(
404
+ t === "outline" ? /* @__PURE__ */ s(
407
405
  "div",
408
406
  {
409
- ref: l,
410
- className: `starasia-toast-item-progress starasia-toast-item-progress-outline-${a.type}`,
407
+ ref: c,
408
+ className: `starasia-toast-item-progress starasia-toast-item-progress-outline-${n.type}`,
411
409
  style: {
412
410
  animation: "progressBarr 5s linear forwards",
413
- animationPlayState: e ? "paused" : "running"
411
+ animationPlayState: i ? "paused" : "running"
414
412
  }
415
413
  }
416
414
  ) : null
417
415
  ]
418
416
  }
419
417
  );
420
- }, I = (a) => /* @__PURE__ */ t(
418
+ }, I = (n) => /* @__PURE__ */ s(
421
419
  "svg",
422
420
  {
423
421
  xmlns: "http://www.w3.org/2000/svg",
@@ -425,8 +423,8 @@ const N = ({
425
423
  height: "20",
426
424
  viewBox: "0 0 24 24",
427
425
  fill: "none",
428
- ...a,
429
- children: /* @__PURE__ */ t(
426
+ ...n,
427
+ children: /* @__PURE__ */ s(
430
428
  "path",
431
429
  {
432
430
  d: "M12 7.01001V7.00002M12 17L12 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
@@ -438,7 +436,7 @@ const N = ({
438
436
  }
439
437
  )
440
438
  }
441
- ), M = (a) => /* @__PURE__ */ t(
439
+ ), M = (n) => /* @__PURE__ */ s(
442
440
  "svg",
443
441
  {
444
442
  width: "20",
@@ -446,8 +444,8 @@ const N = ({
446
444
  viewBox: "0 0 20 20",
447
445
  fill: "none",
448
446
  xmlns: "http://www.w3.org/2000/svg",
449
- ...a,
450
- children: /* @__PURE__ */ t("g", { id: "Curved/Basic-actions-and-state", children: /* @__PURE__ */ t(
447
+ ...n,
448
+ children: /* @__PURE__ */ s("g", { id: "Curved/Basic-actions-and-state", children: /* @__PURE__ */ s(
451
449
  "path",
452
450
  {
453
451
  id: "shape",
@@ -459,7 +457,7 @@ const N = ({
459
457
  }
460
458
  ) })
461
459
  }
462
- ), A = (a) => /* @__PURE__ */ t(
460
+ ), A = (n) => /* @__PURE__ */ s(
463
461
  "svg",
464
462
  {
465
463
  xmlns: "http://www.w3.org/2000/svg",
@@ -467,8 +465,8 @@ const N = ({
467
465
  height: "20",
468
466
  viewBox: "0 0 24 24",
469
467
  fill: "none",
470
- ...a,
471
- children: /* @__PURE__ */ t(
468
+ ...n,
469
+ children: /* @__PURE__ */ s(
472
470
  "path",
473
471
  {
474
472
  d: "M19 5L5 19M5.00003 5L19 19",
package/dist/toast.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(o,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],a):(o=typeof globalThis<"u"?globalThis:o||self,a(o.Toast={},o.jsxRuntime,o.React,o.ReactDOM))})(this,function(o,a,e,v){"use strict";const y=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
1
+ (function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.Toast={},r.jsxRuntime,r.React,r.ReactDOM))})(this,function(r,n,i,h){"use strict";const y=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
2
2
 
3
3
  * {
4
4
  margin: 0;
@@ -8,71 +8,69 @@
8
8
  }
9
9
 
10
10
  :root {
11
- /* color solid default */
12
- --starasia-ui-solid-background-default: #111827;
13
- --starasia-ui-solid-color-default: #fff;
14
- --starasia-ui-solid-border-default: #e5e7eb;
11
+ /* solid default (dark bg) */
12
+ --sa-toast-solid-bg-default: var(--sa-text-bolder, #1e1f21);
13
+ --sa-toast-solid-text-default: var(--sa-text-primary-inverse, #ffffff);
14
+ --sa-toast-solid-border-default: var(--sa-border-subtle, #0b120e24);
15
15
 
16
- /* color outline default */
17
- --starasia-ui-outline-background-default: #f9fafb;
18
- --starasia-ui-outline-color-default: #111827;
19
- --starasia-ui-outline-border-default: #e5e7eb;
20
- --starasia-ui-outline-progress-default: #181a19;
16
+ /* outline default */
17
+ --sa-toast-outline-bg-default: var(--sa-background-primary, #ffffff);
18
+ --sa-toast-outline-text-default: var(--sa-text-primary, #292a2e);
19
+ --sa-toast-outline-border-default: var(--sa-border-subtle, #0b120e24);
20
+ --sa-toast-outline-progress-default: var(--sa-text-bolder, #1e1f21);
21
21
 
22
- /* color outline red */
23
- --starasia-ui-outline-background-danger: #fef2f2;
24
- --starasia-ui-outline-color-danger: #dc2626;
25
- --starasia-ui-outline-border-danger: #fecaca;
26
- --starasia-ui-outline-progress-danger: #181a19;
27
- --starasia-ui-outline-progress-danger: #c9184a;
22
+ /* outline danger */
23
+ --sa-toast-outline-bg-danger: var(--sa-background-error-subtlest, #fff0f3);
24
+ --sa-toast-outline-text-danger: var(--sa-background-error, #c9184a);
25
+ --sa-toast-outline-border-danger: var(--sa-color-error-100, #ffccd5);
26
+ --sa-toast-outline-progress-danger: var(--sa-background-error, #c9184a);
28
27
 
29
- /* color solid red */
30
- --starasia-ui-solid-background-danger: #c9184a;
31
- --starasia-ui-solid-color-danger: #fff0f3;
32
- --starasia-ui-solid-border-danger: #c9184a;
28
+ /* solid danger */
29
+ --sa-toast-solid-bg-danger: var(--sa-background-error, #c9184a);
30
+ --sa-toast-solid-text-danger: var(--sa-color-error-50, #fff0f3);
31
+ --sa-toast-solid-border-danger: var(--sa-background-error, #c9184a);
33
32
 
34
- /* color outline success */
35
- --starasia-ui-outline-background-success: #dcf6ea;
36
- --starasia-ui-outline-color-success: #28ac6e;
37
- --starasia-ui-outline-border-success: #97e6c1;
38
- --starasia-ui-outline-progress-success: #28ac6e;
33
+ /* outline success */
34
+ --sa-toast-outline-bg-success: var(--sa-background-success-subtlest, #ecfff6);
35
+ --sa-toast-outline-text-success: var(--sa-background-success, #28ac6e);
36
+ --sa-toast-outline-border-success: var(--sa-color-success-200, #97e6c1);
37
+ --sa-toast-outline-progress-success: var(--sa-background-success, #28ac6e);
39
38
 
40
- /* color solid success */
41
- --starasia-ui-solid-background-success: #28ac6e;
42
- --starasia-ui-solid-color-success: #dcf6ea;
43
- --starasia-ui-solid-border-success: #28ac6e;
39
+ /* solid success */
40
+ --sa-toast-solid-bg-success: var(--sa-background-success, #28ac6e);
41
+ --sa-toast-solid-text-success: var(--sa-color-success-50, #ecfff6);
42
+ --sa-toast-solid-border-success: var(--sa-background-success, #28ac6e);
44
43
 
45
- /* color outline info */
46
- --starasia-ui-outline-background-info: #e3f2fd;
47
- --starasia-ui-outline-color-info: #1976d2;
48
- --starasia-ui-outline-border-info: #64b5f6;
49
- --starasia-ui-outline-progress-info: #1976d2;
44
+ /* outline info */
45
+ --sa-toast-outline-bg-info: var(--sa-background-info-subtlest, #effaff);
46
+ --sa-toast-outline-text-info: var(--sa-background-info, #0090d4);
47
+ --sa-toast-outline-border-info: var(--sa-color-info-200, #b6eaff);
48
+ --sa-toast-outline-progress-info: var(--sa-background-info, #0090d4);
50
49
 
51
- /* color solid info */
52
- --starasia-ui-solid-background-info: #1976d2;
53
- --starasia-ui-solid-color-info: #e3f2fd;
54
- --starasia-ui-solid-border-info: #1976d2;
50
+ /* solid info */
51
+ --sa-toast-solid-bg-info: var(--sa-background-info, #0090d4);
52
+ --sa-toast-solid-text-info: var(--sa-color-info-50, #effaff);
53
+ --sa-toast-solid-border-info: var(--sa-background-info, #0090d4);
55
54
 
56
- /* color outline warning */
57
- --starasia-ui-outline-background-warning: #fdf3e4;
58
- --starasia-ui-outline-color-warning: #181a19;
59
- --starasia-ui-outline-border-warning: #f4c583;
60
- --starasia-ui-outline-progress-warning: #ed9f30;
55
+ /* outline warning */
56
+ --sa-toast-outline-bg-warning: var(--sa-background-warning-subtlest, #fef2e6);
57
+ --sa-toast-outline-text-warning: var(--sa-text-primary, #292a2e);
58
+ --sa-toast-outline-border-warning: var(--sa-color-warning-200, #f4c583);
59
+ --sa-toast-outline-progress-warning: var(--sa-color-warning-400, #ed9f30);
61
60
 
62
- /* color solid warning */
63
- --starasia-ui-solid-background-warning: #ed9f30;
64
- --starasia-ui-solid-color-warning: #fffeff;
65
- --starasia-ui-solid-border-warning: #ed9f30;
61
+ /* solid warning */
62
+ --sa-toast-solid-bg-warning: var(--sa-color-warning-400, #ed9f30);
63
+ --sa-toast-solid-text-warning: var(--sa-background-primary, #ffffff);
64
+ --sa-toast-solid-border-warning: var(--sa-color-warning-400, #ed9f30);
66
65
 
67
- /* height */
68
- --starasia-ui-h-0-5: 0.125rem; /* 2px */
66
+ --sa-toast-h-progress: 0.125rem;
69
67
  }
70
68
  /* styling for container */
71
69
  .starasia-toast-container {
72
70
  display: flex;
73
71
  flex-direction: column;
74
- gap: var(--starasia-ui-spacing-xs, 4px);
75
- padding: var(--starasia-ui-spacing-sm, 8px);
72
+ gap: var(--sa-spacing-xs, 4px);
73
+ padding: var(--sa-spacing-sm, 8px);
76
74
  position: fixed;
77
75
  max-height: 100vh;
78
76
  overflow: auto;
@@ -106,85 +104,85 @@
106
104
  }
107
105
  /* styling for */
108
106
  .starasia-toast-item-container {
109
- padding: var(--starasia-ui-spacing-lg, 16px);
107
+ padding: var(--sa-spacing-lg, 16px);
110
108
  width: max-content;
111
- border-radius: var(--starasia-ui-radii-md, 6px);
109
+ border-radius: var(--sa-radii-md, 6px);
112
110
  display: flex;
113
111
  align-items: center;
114
- gap: var(--starasia-ui-spacing-sm, 8px);
115
- border: var(--starasia-ui-border, 1px) solid transparent;
116
- font-size: var(--starasia-ui-fontSizes-md, 14px);
112
+ gap: var(--sa-spacing-sm, 8px);
113
+ border: var(--sa-border, 1px) solid transparent;
114
+ font-size: var(--sa-font-size-md, 14px);
117
115
  position: relative;
118
116
  overflow: hidden;
119
117
  width: 100%;
120
118
  }
121
119
  /* DEFAULT TOAST */
122
120
  .starasia-toast-item-container-solid-default {
123
- background-color: var(--starasia-ui-solid-background-default);
124
- color: var(--starasia-ui-solid-color-default);
125
- border-color: var(--starasia-ui-solid-border-default);
121
+ background-color: var(--sa-toast-solid-bg-default);
122
+ color: var(--sa-toast-solid-text-default);
123
+ border-color: var(--sa-toast-solid-border-default);
126
124
  }
127
125
 
128
126
  .starasia-toast-item-container-outline-default {
129
- background-color: var(--starasia-ui-outline-background-default);
130
- color: var(--starasia-ui-outline-color-default);
131
- border-color: var(--starasia-ui-outline-border-default);
127
+ background-color: var(--sa-toast-outline-bg-default);
128
+ color: var(--sa-toast-outline-text-default);
129
+ border-color: var(--sa-toast-outline-border-default);
132
130
  }
133
131
 
134
132
  /* DEFAULT DANGER */
135
133
  .starasia-toast-item-container-outline-danger {
136
- background-color: var(--starasia-ui-outline-background-danger);
137
- color: var(--starasia-ui-outline-color-danger);
138
- border-color: var(--starasia-ui-outline-border-danger);
134
+ background-color: var(--sa-toast-outline-bg-danger);
135
+ color: var(--sa-toast-outline-text-danger);
136
+ border-color: var(--sa-toast-outline-border-danger);
139
137
  }
140
138
 
141
139
  .starasia-toast-item-container-solid-danger {
142
- background-color: var(--starasia-ui-solid-background-danger);
143
- color: var(--starasia-ui-solid-color-danger);
144
- border-color: var(--starasia-ui-solid-border-danger);
140
+ background-color: var(--sa-toast-solid-bg-danger);
141
+ color: var(--sa-toast-solid-text-danger);
142
+ border-color: var(--sa-toast-solid-border-danger);
145
143
  }
146
144
 
147
145
  /* DEFAULT SUCCESS */
148
146
  .starasia-toast-item-container-outline-success {
149
- background-color: var(--starasia-ui-outline-background-success);
150
- color: var(--starasia-ui-outline-color-success);
151
- border-color: var(--starasia-ui-outline-border-success);
147
+ background-color: var(--sa-toast-outline-bg-success);
148
+ color: var(--sa-toast-outline-text-success);
149
+ border-color: var(--sa-toast-outline-border-success);
152
150
  }
153
151
 
154
152
  .starasia-toast-item-container-solid-success {
155
- background-color: var(--starasia-ui-solid-background-success);
156
- color: var(--starasia-ui-solid-color-success);
157
- border-color: var(--starasia-ui-solid-border-success);
153
+ background-color: var(--sa-toast-solid-bg-success);
154
+ color: var(--sa-toast-solid-text-success);
155
+ border-color: var(--sa-toast-solid-border-success);
158
156
  }
159
157
 
160
158
  /* DEFAULT INFO */
161
159
  .starasia-toast-item-container-outline-info {
162
- background-color: var(--starasia-ui-outline-background-info);
163
- color: var(--starasia-ui-outline-color-info);
164
- border-color: var(--starasia-ui-outline-border-info);
160
+ background-color: var(--sa-toast-outline-bg-info);
161
+ color: var(--sa-toast-outline-text-info);
162
+ border-color: var(--sa-toast-outline-border-info);
165
163
  }
166
164
 
167
165
  .starasia-toast-item-container-solid-info {
168
- background-color: var(--starasia-ui-solid-background-info);
169
- color: var(--starasia-ui-solid-color-info);
170
- border-color: var(--starasia-ui-solid-border-info);
166
+ background-color: var(--sa-toast-solid-bg-info);
167
+ color: var(--sa-toast-solid-text-info);
168
+ border-color: var(--sa-toast-solid-border-info);
171
169
  }
172
170
  /* DEFAULT WARNING */
173
171
  .starasia-toast-item-container-outline-warning {
174
- background-color: var(--starasia-ui-outline-background-warning);
175
- color: var(--starasia-ui-outline-color-warning);
176
- border-color: var(--starasia-ui-outline-border-warning);
172
+ background-color: var(--sa-toast-outline-bg-warning);
173
+ color: var(--sa-toast-outline-text-warning);
174
+ border-color: var(--sa-toast-outline-border-warning);
177
175
  }
178
176
 
179
177
  .starasia-toast-item-container-solid-warning {
180
- background-color: var(--starasia-ui-solid-background-warning);
181
- color: var(--starasia-ui-solid-color-warning);
182
- border-color: var(--starasia-ui-solid-border-warning);
178
+ background-color: var(--sa-toast-solid-bg-warning);
179
+ color: var(--sa-toast-solid-text-warning);
180
+ border-color: var(--sa-toast-solid-border-warning);
183
181
  }
184
182
 
185
183
  /* PROGRESS BAR */
186
184
  .starasia-toast-item-progress {
187
- height: var(--starasia-ui-h-0-5);
185
+ height: var(--sa-toast-h-progress);
188
186
  width: 100%;
189
187
  position: absolute;
190
188
  bottom: 0;
@@ -194,19 +192,19 @@
194
192
  }
195
193
 
196
194
  .starasia-toast-item-progress-outline-default {
197
- background-color: var(--starasia-ui-outline-progress-default);
195
+ background-color: var(--sa-toast-outline-progress-default);
198
196
  }
199
197
  .starasia-toast-item-progress-outline-info {
200
- background-color: var(--starasia-ui-outline-progress-info);
198
+ background-color: var(--sa-toast-outline-progress-info);
201
199
  }
202
200
  .starasia-toast-item-progress-outline-success {
203
- background-color: var(--starasia-ui-outline-progress-success);
201
+ background-color: var(--sa-toast-outline-progress-success);
204
202
  }
205
203
  .starasia-toast-item-progress-outline-danger {
206
- background-color: var(--starasia-ui-outline-progress-danger);
204
+ background-color: var(--sa-toast-outline-progress-danger);
207
205
  }
208
206
  .starasia-toast-item-progress-outline-warning {
209
- background-color: var(--starasia-ui-outline-progress-warning);
207
+ background-color: var(--sa-toast-outline-progress-warning);
210
208
  }
211
209
 
212
210
  /* animation */
@@ -297,4 +295,4 @@
297
295
  width: 0px;
298
296
  }
299
297
  }
300
- `;let k=1;class w{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{const{message:r,type:c}=n,s=k++;return this.addToast({title:r,type:c,id:s}),s},this.dismiss=n=>(this.subscribers.forEach(r=>r({id:n,dismiss:!0})),n),this.danger=n=>this.create({message:n,type:"danger"}),this.warning=n=>this.create({message:n,type:"warning"}),this.success=n=>this.create({type:"success",message:n}),this.info=n=>this.create({type:"info",message:n}),this.default=n=>this.create({type:"default",message:n}),this.subscribers=[],this.toasts=[]}}const i=new w,x=Object.assign({success:i.success,info:i.info,default:i.default,danger:i.danger,warning:i.warning}),m="starasia-toast-styles";(t=>{if(!document.getElementById(m)){const n=document.createElement("style");n.id=m,n.textContent=t,document.head.appendChild(n)}})(y);const C=({type:t="outline",direction:n="bottom-right"})=>{const[r,c]=e.useState([]);return e.useEffect(()=>i.subscribe(s=>{if(s.dismiss){c(l=>l.filter(f=>f.id!==s.id));return}setTimeout(()=>{v.flushSync(()=>{c(l=>[s,...l])})})}),[]),a.jsx("div",{className:`starasia-toast-container starasia-toast-container-${n}`,children:r.map(s=>a.jsx(T,{data:s,type:t,direction:n},s.id))})},T=({data:t,type:n="solid",direction:r})=>{const[c,s]=e.useState(null),[l,f]=e.useState(!1),u=e.useRef(null),p=()=>{const d=setTimeout(()=>{b()},5e3);s(d)},g=()=>{c&&(clearTimeout(c),s(null))},b=()=>{i.dismiss(t.id)};e.useEffect(()=>(l?g():p(),()=>{g()}),[l]),e.useEffect(()=>{const d=u.current,h=()=>{b()};return d&&d.addEventListener("animationend",h),()=>{d&&d.removeEventListener("animationend",h)}},[]);const M=()=>{f(!0),g(),u.current&&(u.current.style.animationPlayState="paused")},j=()=>{f(!1),p(),u.current&&(u.current.style.animationPlayState="running")};return a.jsxs("div",{className:`starasia-toast-item-container starasia-toast-item-container-${n}-${t.type} starasia-toast-item-container-animation-${r}`,onMouseEnter:M,onMouseLeave:j,children:[a.jsx("div",{style:{display:"flex"},children:t.type==="success"?a.jsx(E,{style:{color:"inherit"}}):a.jsx(L,{style:{color:"inherit"}})}),a.jsx("div",{style:{flex:1},children:t.title}),a.jsx("div",{style:{display:"flex",cursor:"pointer"},onClick:()=>i.dismiss(t.id),children:a.jsx(S,{style:{color:"inherit"}})}),n==="outline"?a.jsx("div",{ref:u,className:`starasia-toast-item-progress starasia-toast-item-progress-outline-${t.type}`,style:{animation:"progressBarr 5s linear forwards",animationPlayState:l?"paused":"running"}}):null]})},L=t=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...t,children:a.jsx("path",{d:"M12 7.01001V7.00002M12 17L12 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",cursor:"pointer"})}),E=t=>a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:a.jsx("g",{id:"Curved/Basic-actions-and-state",children:a.jsx("path",{id:"shape",d:"M14.1667 7.5L8.33332 13.3333L5.83328 10.8333M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),S=t=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...t,children:a.jsx("path",{d:"M19 5L5 19M5.00003 5L19 19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});o.ToastContainer=C,o.toast=x,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
298
+ `;let x=1;class w{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const o=this.subscribers.indexOf(t);this.subscribers.splice(o,1)}),this.publish=t=>{this.subscribers.forEach(o=>o(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{const{message:o,type:c}=t,a=x++;return this.addToast({title:o,type:c,id:a}),a},this.dismiss=t=>(this.subscribers.forEach(o=>o({id:t,dismiss:!0})),t),this.danger=t=>this.create({message:t,type:"danger"}),this.warning=t=>this.create({message:t,type:"warning"}),this.success=t=>this.create({type:"success",message:t}),this.info=t=>this.create({type:"info",message:t}),this.default=t=>this.create({type:"default",message:t}),this.subscribers=[],this.toasts=[]}}const e=new w,k=Object.assign({success:e.success,info:e.info,default:e.default,danger:e.danger,warning:e.warning}),b="starasia-toast-styles";(s=>{if(!document.getElementById(b)){const t=document.createElement("style");t.id=b,t.textContent=s,document.head.appendChild(t)}})(y);const C=({type:s="outline",direction:t="bottom-right"})=>{const[o,c]=i.useState([]);return i.useEffect(()=>e.subscribe(a=>{if(a.dismiss){c(l=>l.filter(f=>f.id!==a.id));return}setTimeout(()=>{h.flushSync(()=>{c(l=>[a,...l])})})}),[]),n.jsx("div",{className:`starasia-toast-container starasia-toast-container-${t}`,children:o.map(a=>n.jsx(T,{data:a,type:s,direction:t},a.id))})},T=({data:s,type:t="solid",direction:o})=>{const[c,a]=i.useState(null),[l,f]=i.useState(!1),d=i.useRef(null),m=()=>{const u=setTimeout(()=>{p()},5e3);a(u)},g=()=>{c&&(clearTimeout(c),a(null))},p=()=>{e.dismiss(s.id)};i.useEffect(()=>(l?g():m(),()=>{g()}),[l]),i.useEffect(()=>{const u=d.current,v=()=>{p()};return u&&u.addEventListener("animationend",v),()=>{u&&u.removeEventListener("animationend",v)}},[]);const M=()=>{f(!0),g(),d.current&&(d.current.style.animationPlayState="paused")},j=()=>{f(!1),m(),d.current&&(d.current.style.animationPlayState="running")};return n.jsxs("div",{className:`starasia-toast-item-container starasia-toast-item-container-${t}-${s.type} starasia-toast-item-container-animation-${o}`,onMouseEnter:M,onMouseLeave:j,children:[n.jsx("div",{style:{display:"flex"},children:s.type==="success"?n.jsx(E,{style:{color:"inherit"}}):n.jsx(L,{style:{color:"inherit"}})}),n.jsx("div",{style:{flex:1},children:s.title}),n.jsx("div",{style:{display:"flex",cursor:"pointer"},onClick:()=>e.dismiss(s.id),children:n.jsx(S,{style:{color:"inherit"}})}),t==="outline"?n.jsx("div",{ref:d,className:`starasia-toast-item-progress starasia-toast-item-progress-outline-${s.type}`,style:{animation:"progressBarr 5s linear forwards",animationPlayState:l?"paused":"running"}}):null]})},L=s=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...s,children:n.jsx("path",{d:"M12 7.01001V7.00002M12 17L12 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",cursor:"pointer"})}),E=s=>n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s,children:n.jsx("g",{id:"Curved/Basic-actions-and-state",children:n.jsx("path",{id:"shape",d:"M14.1667 7.5L8.33332 13.3333L5.83328 10.8333M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),S=s=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...s,children:n.jsx("path",{d:"M19 5L5 19M5.00003 5L19 19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});r.ToastContainer=C,r.toast=k,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starasia/toast",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "description": "toast component for starasia UI",
5
5
  "author": "Prawito Hudoro",
6
6
  "main": "dist/toast.umd.js",
@@ -12,6 +12,10 @@
12
12
  "dist/*.map",
13
13
  "dist/*.css"
14
14
  ],
15
+ "scripts": {
16
+ "dev": "vite --config vite.config.ts --port 3000",
17
+ "build": "vite build --config vite.config.ts"
18
+ },
15
19
  "keywords": [],
16
20
  "license": "ISC",
17
21
  "type": "module",
@@ -33,9 +37,5 @@
33
37
  "react-dom": "^18.2.0",
34
38
  "@types/react": "^18.2.55",
35
39
  "@types/react-dom": "^18.2.19"
36
- },
37
- "scripts": {
38
- "dev": "vite --config vite.config.ts --port 3000",
39
- "build": "vite build --config vite.config.ts"
40
40
  }
41
- }
41
+ }