sander-ui 0.1.5 → 0.1.7

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 (80) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +53 -51
  3. package/dist/index10.js +2 -2
  4. package/dist/index11.js +1 -1
  5. package/dist/index12.js +4 -4
  6. package/dist/index13.js +98 -100
  7. package/dist/index14.js +41 -21
  8. package/dist/index15.js +22 -19
  9. package/dist/index16.js +20 -76
  10. package/dist/index17.js +72 -58
  11. package/dist/index18.js +56 -35
  12. package/dist/index19.js +40 -31
  13. package/dist/index20.js +30 -25
  14. package/dist/index21.js +260 -19
  15. package/dist/index22.js +15 -36
  16. package/dist/index23.js +39 -46
  17. package/dist/index24.js +39 -124
  18. package/dist/index25.js +132 -18
  19. package/dist/index26.js +18 -23
  20. package/dist/index27.js +23 -55
  21. package/dist/index28.js +55 -19
  22. package/dist/index29.js +19 -46
  23. package/dist/index3.js +2 -2
  24. package/dist/index30.js +46 -5
  25. package/dist/index31.js +5 -17
  26. package/dist/index32.js +26 -10
  27. package/dist/index33.js +25 -39
  28. package/dist/index34.js +17 -7
  29. package/dist/index35.js +8 -26
  30. package/dist/index36.js +4 -17
  31. package/dist/index37.js +16 -22
  32. package/dist/index38.js +22 -20
  33. package/dist/index39.js +8 -13
  34. package/dist/index4.js +7 -7
  35. package/dist/index40.js +14 -23
  36. package/dist/index41.js +7 -7
  37. package/dist/index42.js +6 -13
  38. package/dist/index43.js +7 -8
  39. package/dist/index44.js +26 -7
  40. package/dist/index45.js +15 -11
  41. package/dist/index46.js +20 -16
  42. package/dist/index47.js +13 -8
  43. package/dist/index48.js +23 -4
  44. package/dist/index49.js +11 -27
  45. package/dist/index5.js +3 -3
  46. package/dist/index50.js +25 -16
  47. package/dist/index51.js +12 -20
  48. package/dist/index52.js +16 -12
  49. package/dist/index53.js +26 -30
  50. package/dist/index55.js +10 -16
  51. package/dist/index56.js +42 -14
  52. package/dist/index57.js +3 -3
  53. package/dist/index58.js +4 -15
  54. package/dist/index59.js +14 -18
  55. package/dist/index6.js +3 -3
  56. package/dist/index60.js +4 -13
  57. package/dist/index61.js +12 -25
  58. package/dist/index62.js +20 -41
  59. package/dist/index63.js +42 -4
  60. package/dist/index64.js +4 -27
  61. package/dist/index65.js +14 -25
  62. package/dist/index66.js +40 -35
  63. package/dist/index67.js +15 -2
  64. package/dist/index68.js +31 -4
  65. package/dist/index69.js +16 -20
  66. package/dist/index7.js +4 -4
  67. package/dist/index70.js +35 -2
  68. package/dist/index71.js +2 -2
  69. package/dist/index72.js +4 -6
  70. package/dist/index73.js +21 -34
  71. package/dist/index74.js +2 -12
  72. package/dist/index75.js +2 -7
  73. package/dist/index76.js +6 -5
  74. package/dist/index77.js +36 -0
  75. package/dist/index78.js +14 -0
  76. package/dist/index79.js +9 -0
  77. package/dist/index8.js +12 -12
  78. package/dist/index80.js +7 -0
  79. package/dist/index9.js +2 -2
  80. package/package.json +1 -1
package/dist/index22.js CHANGED
@@ -1,42 +1,21 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import i from "./index30.js";
3
- import r from "./index55.js";
4
- const m = ({
5
- size: s = "md",
6
- className: n,
7
- ...o
8
- }) => /* @__PURE__ */ t(
9
- "svg",
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import n from "./index31.js";
3
+ import t from "./index51.js";
4
+ const c = ({
5
+ width: e,
6
+ height: r,
7
+ variant: o = "text",
8
+ className: s,
9
+ ...m
10
+ }) => /* @__PURE__ */ i(
11
+ "div",
10
12
  {
11
- className: i(r.spinner, r[s], n),
12
- xmlns: "http://www.w3.org/2000/svg",
13
- fill: "none",
14
- viewBox: "0 0 24 24",
15
13
  "aria-hidden": "true",
16
- ...o,
17
- children: [
18
- /* @__PURE__ */ e(
19
- "circle",
20
- {
21
- className: r.spinnerTrack,
22
- cx: "12",
23
- cy: "12",
24
- r: "10",
25
- stroke: "currentColor",
26
- strokeWidth: "4"
27
- }
28
- ),
29
- /* @__PURE__ */ e(
30
- "path",
31
- {
32
- className: r.spinnerHead,
33
- fill: "currentColor",
34
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
35
- }
36
- )
37
- ]
14
+ className: n(t.skeleton, t[o], s),
15
+ style: { width: e, height: r },
16
+ ...m
38
17
  }
39
18
  );
40
19
  export {
41
- m as Spinner
20
+ c as Skeleton
42
21
  };
package/dist/index23.js CHANGED
@@ -1,49 +1,42 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import l from "./index30.js";
3
- import r from "./index38.js";
4
- const u = ({
5
- id: t,
6
- checked: s,
7
- onChange: n,
8
- label: c,
9
- description: a,
10
- disabled: i = !1,
11
- className: p,
12
- ...h
13
- }) => {
14
- const m = a && t ? `${t}-description` : void 0;
15
- return /* @__PURE__ */ o(
16
- "label",
17
- {
18
- className: l(
19
- r.wrapper,
20
- i && r.wrapperDisabled,
21
- p
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import i from "./index31.js";
3
+ import r from "./index45.js";
4
+ const m = ({
5
+ size: s = "md",
6
+ className: n,
7
+ ...o
8
+ }) => /* @__PURE__ */ t(
9
+ "svg",
10
+ {
11
+ className: i(r.spinner, r[s], n),
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ fill: "none",
14
+ viewBox: "0 0 24 24",
15
+ "aria-hidden": "true",
16
+ ...o,
17
+ children: [
18
+ /* @__PURE__ */ e(
19
+ "circle",
20
+ {
21
+ className: r.spinnerTrack,
22
+ cx: "12",
23
+ cy: "12",
24
+ r: "10",
25
+ stroke: "currentColor",
26
+ strokeWidth: "4"
27
+ }
22
28
  ),
23
- ...h,
24
- children: [
25
- /* @__PURE__ */ e(
26
- "button",
27
- {
28
- id: t,
29
- type: "button",
30
- role: "switch",
31
- "aria-checked": s,
32
- "aria-describedby": m,
33
- disabled: i,
34
- onClick: () => n(!s),
35
- className: l(r.track, s && r.trackChecked),
36
- children: /* @__PURE__ */ e("span", { className: l(r.thumb, s && r.thumbChecked) })
37
- }
38
- ),
39
- (c || a) && /* @__PURE__ */ o("div", { className: r.labels, children: [
40
- c && /* @__PURE__ */ e("p", { className: r.label, children: c }),
41
- a && /* @__PURE__ */ e("p", { id: m, className: r.description, children: a })
42
- ] })
43
- ]
44
- }
45
- );
46
- };
29
+ /* @__PURE__ */ e(
30
+ "path",
31
+ {
32
+ className: r.spinnerHead,
33
+ fill: "currentColor",
34
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ );
47
40
  export {
48
- u as Switch
41
+ m as Spinner
49
42
  };
package/dist/index24.js CHANGED
@@ -1,134 +1,49 @@
1
- import { jsx as b, jsxs as D } from "react/jsx-runtime";
2
- import f from "./index30.js";
3
- import { useRef as w, useState as I, useCallback as E, useEffect as g } from "react";
4
- import a from "./index58.js";
5
- const j = ({
6
- tabs: l,
7
- value: i,
8
- onChange: s,
9
- className: o,
10
- ...u
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import l from "./index31.js";
3
+ import r from "./index62.js";
4
+ const u = ({
5
+ id: t,
6
+ checked: s,
7
+ onChange: n,
8
+ label: c,
9
+ description: a,
10
+ disabled: i = !1,
11
+ className: p,
12
+ ...h
11
13
  }) => {
12
- const m = w(null), d = w(/* @__PURE__ */ new Map()), [v, R] = I({
13
- left: 0,
14
- width: 0
15
- }), [k, A] = I(!1), x = E(() => {
16
- const e = d.current.get(i), n = m.current;
17
- if (e && n) {
18
- const t = n.getBoundingClientRect(), r = e.getBoundingClientRect();
19
- R({
20
- left: r.left - t.left + n.scrollLeft,
21
- width: r.width
22
- });
23
- }
24
- }, [i]);
25
- g(() => {
26
- x();
27
- }, [x]), g(() => {
28
- const e = requestAnimationFrame(() => A(!0));
29
- return () => cancelAnimationFrame(e);
30
- }, []);
31
- const h = (e, n) => {
32
- const t = l.length;
33
- let r = (e + n + t) % t;
34
- for (; l[r].disabled && r !== e; )
35
- r = (r + n + t) % t;
36
- return r;
37
- }, y = (e) => {
38
- const n = l.findIndex((c) => c.value === i);
39
- let t = null;
40
- switch (e.key) {
41
- case "ArrowRight":
42
- t = h(n, 1);
43
- break;
44
- case "ArrowLeft":
45
- t = h(n, -1);
46
- break;
47
- case "Home":
48
- t = l.findIndex((c) => !c.disabled);
49
- break;
50
- case "End": {
51
- const p = [...l].reverse().findIndex((T) => !T.disabled);
52
- t = p !== -1 ? l.length - 1 - p : null;
53
- break;
54
- }
55
- default:
56
- return;
57
- }
58
- if (t === null || t === -1) return;
59
- e.preventDefault();
60
- const r = l[t];
61
- s(r.value), d.current.get(r.value)?.focus();
62
- };
63
- return /* @__PURE__ */ D(
64
- "div",
14
+ const m = a && t ? `${t}-description` : void 0;
15
+ return /* @__PURE__ */ o(
16
+ "label",
65
17
  {
66
- ref: m,
67
- className: f(a.tabList, o),
68
- role: "tablist",
69
- onKeyDown: y,
70
- ...u,
18
+ className: l(
19
+ r.wrapper,
20
+ i && r.wrapperDisabled,
21
+ p
22
+ ),
23
+ ...h,
71
24
  children: [
72
- l.map((e) => {
73
- const n = i === e.value;
74
- return /* @__PURE__ */ b(
75
- "button",
76
- {
77
- ref: (t) => {
78
- t ? d.current.set(e.value, t) : d.current.delete(e.value);
79
- },
80
- id: `tab-${e.value}`,
81
- role: "tab",
82
- "aria-selected": n,
83
- "aria-controls": `tabpanel-${e.value}`,
84
- "aria-disabled": e.disabled || void 0,
85
- tabIndex: n ? 0 : -1,
86
- onClick: () => {
87
- e.disabled || s(e.value);
88
- },
89
- className: f(
90
- a.tab,
91
- n && a.tabActive,
92
- e.disabled && a.tabDisabled
93
- ),
94
- children: e.label
95
- },
96
- e.value
97
- );
98
- }),
99
- /* @__PURE__ */ b(
100
- "span",
25
+ /* @__PURE__ */ e(
26
+ "button",
101
27
  {
102
- className: f(
103
- a.indicator,
104
- k && a.indicatorAnimated
105
- ),
106
- style: { left: v.left, width: v.width },
107
- "aria-hidden": "true"
28
+ id: t,
29
+ type: "button",
30
+ role: "switch",
31
+ "aria-checked": s,
32
+ "aria-describedby": m,
33
+ disabled: i,
34
+ onClick: () => n(!s),
35
+ className: l(r.track, s && r.trackChecked),
36
+ children: /* @__PURE__ */ e("span", { className: l(r.thumb, s && r.thumbChecked) })
108
37
  }
109
- )
38
+ ),
39
+ (c || a) && /* @__PURE__ */ o("div", { className: r.labels, children: [
40
+ c && /* @__PURE__ */ e("p", { className: r.label, children: c }),
41
+ a && /* @__PURE__ */ e("p", { id: m, className: r.description, children: a })
42
+ ] })
110
43
  ]
111
44
  }
112
45
  );
113
- }, B = ({
114
- value: l,
115
- activeValue: i,
116
- children: s,
117
- className: o,
118
- ...u
119
- }) => l !== i ? null : /* @__PURE__ */ b(
120
- "div",
121
- {
122
- id: `tabpanel-${l}`,
123
- role: "tabpanel",
124
- "aria-labelledby": `tab-${l}`,
125
- tabIndex: 0,
126
- className: o,
127
- ...u,
128
- children: s
129
- }
130
- );
46
+ };
131
47
  export {
132
- B as TabPanel,
133
- j as Tabs
48
+ u as Switch
134
49
  };
package/dist/index25.js CHANGED
@@ -1,20 +1,134 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import l from "./index30.js";
3
- import s from "./index36.js";
4
- const m = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("div", { className: l(s.wrapper, a), children: /* @__PURE__ */ t("table", { className: s.table, ...r, children: e }) }), d = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("thead", { className: l(s.header, a), ...r, children: e }), b = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("tbody", { className: l(s.body, a), ...r, children: e }), N = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("tr", { className: l(s.row, a), ...r, children: e }), p = ({
5
- children: e,
6
- className: a,
7
- ...r
8
- }) => /* @__PURE__ */ t("th", { className: l(s.head, a), ...r, children: e }), u = ({
9
- children: e,
10
- className: a,
11
- ...r
12
- }) => /* @__PURE__ */ t("td", { className: l(s.cell, a), ...r, children: e });
1
+ import { jsx as b, jsxs as D } from "react/jsx-runtime";
2
+ import f from "./index31.js";
3
+ import { useRef as w, useState as I, useCallback as E, useEffect as g } from "react";
4
+ import a from "./index65.js";
5
+ const j = ({
6
+ tabs: l,
7
+ value: i,
8
+ onChange: s,
9
+ className: o,
10
+ ...u
11
+ }) => {
12
+ const m = w(null), d = w(/* @__PURE__ */ new Map()), [v, R] = I({
13
+ left: 0,
14
+ width: 0
15
+ }), [k, A] = I(!1), x = E(() => {
16
+ const e = d.current.get(i), n = m.current;
17
+ if (e && n) {
18
+ const t = n.getBoundingClientRect(), r = e.getBoundingClientRect();
19
+ R({
20
+ left: r.left - t.left + n.scrollLeft,
21
+ width: r.width
22
+ });
23
+ }
24
+ }, [i]);
25
+ g(() => {
26
+ x();
27
+ }, [x]), g(() => {
28
+ const e = requestAnimationFrame(() => A(!0));
29
+ return () => cancelAnimationFrame(e);
30
+ }, []);
31
+ const h = (e, n) => {
32
+ const t = l.length;
33
+ let r = (e + n + t) % t;
34
+ for (; l[r].disabled && r !== e; )
35
+ r = (r + n + t) % t;
36
+ return r;
37
+ }, y = (e) => {
38
+ const n = l.findIndex((c) => c.value === i);
39
+ let t = null;
40
+ switch (e.key) {
41
+ case "ArrowRight":
42
+ t = h(n, 1);
43
+ break;
44
+ case "ArrowLeft":
45
+ t = h(n, -1);
46
+ break;
47
+ case "Home":
48
+ t = l.findIndex((c) => !c.disabled);
49
+ break;
50
+ case "End": {
51
+ const p = [...l].reverse().findIndex((T) => !T.disabled);
52
+ t = p !== -1 ? l.length - 1 - p : null;
53
+ break;
54
+ }
55
+ default:
56
+ return;
57
+ }
58
+ if (t === null || t === -1) return;
59
+ e.preventDefault();
60
+ const r = l[t];
61
+ s(r.value), d.current.get(r.value)?.focus();
62
+ };
63
+ return /* @__PURE__ */ D(
64
+ "div",
65
+ {
66
+ ref: m,
67
+ className: f(a.tabList, o),
68
+ role: "tablist",
69
+ onKeyDown: y,
70
+ ...u,
71
+ children: [
72
+ l.map((e) => {
73
+ const n = i === e.value;
74
+ return /* @__PURE__ */ b(
75
+ "button",
76
+ {
77
+ ref: (t) => {
78
+ t ? d.current.set(e.value, t) : d.current.delete(e.value);
79
+ },
80
+ id: `tab-${e.value}`,
81
+ role: "tab",
82
+ "aria-selected": n,
83
+ "aria-controls": `tabpanel-${e.value}`,
84
+ "aria-disabled": e.disabled || void 0,
85
+ tabIndex: n ? 0 : -1,
86
+ onClick: () => {
87
+ e.disabled || s(e.value);
88
+ },
89
+ className: f(
90
+ a.tab,
91
+ n && a.tabActive,
92
+ e.disabled && a.tabDisabled
93
+ ),
94
+ children: e.label
95
+ },
96
+ e.value
97
+ );
98
+ }),
99
+ /* @__PURE__ */ b(
100
+ "span",
101
+ {
102
+ className: f(
103
+ a.indicator,
104
+ k && a.indicatorAnimated
105
+ ),
106
+ style: { left: v.left, width: v.width },
107
+ "aria-hidden": "true"
108
+ }
109
+ )
110
+ ]
111
+ }
112
+ );
113
+ }, B = ({
114
+ value: l,
115
+ activeValue: i,
116
+ children: s,
117
+ className: o,
118
+ ...u
119
+ }) => l !== i ? null : /* @__PURE__ */ b(
120
+ "div",
121
+ {
122
+ id: `tabpanel-${l}`,
123
+ role: "tabpanel",
124
+ "aria-labelledby": `tab-${l}`,
125
+ tabIndex: 0,
126
+ className: o,
127
+ ...u,
128
+ children: s
129
+ }
130
+ );
13
131
  export {
14
- m as Table,
15
- b as TableBody,
16
- u as TableCell,
17
- p as TableHead,
18
- d as TableHeader,
19
- N as TableRow
132
+ B as TabPanel,
133
+ j as Tabs
20
134
  };
package/dist/index26.js CHANGED
@@ -1,25 +1,20 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import c from "./index30.js";
3
- import { forwardRef as d } from "react";
4
- import a from "./index60.js";
5
- const p = d(
6
- ({ label: s, error: r, id: e, className: l, ...o }, i) => /* @__PURE__ */ m("div", { className: a.wrapper, children: [
7
- s && /* @__PURE__ */ t("label", { htmlFor: e, className: a.label, children: s }),
8
- /* @__PURE__ */ t(
9
- "textarea",
10
- {
11
- id: e,
12
- ref: i,
13
- "aria-invalid": r ? !0 : void 0,
14
- "aria-describedby": r ? `${e}-error` : void 0,
15
- className: c(a.textarea, r && a.textareaError, l),
16
- ...o
17
- }
18
- ),
19
- r && /* @__PURE__ */ t("p", { id: `${e}-error`, role: "alert", className: a.error, children: r })
20
- ] })
21
- );
22
- p.displayName = "Textarea";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import l from "./index31.js";
3
+ import s from "./index69.js";
4
+ const m = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("div", { className: l(s.wrapper, a), children: /* @__PURE__ */ t("table", { className: s.table, ...r, children: e }) }), d = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("thead", { className: l(s.header, a), ...r, children: e }), b = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("tbody", { className: l(s.body, a), ...r, children: e }), N = ({ children: e, className: a, ...r }) => /* @__PURE__ */ t("tr", { className: l(s.row, a), ...r, children: e }), p = ({
5
+ children: e,
6
+ className: a,
7
+ ...r
8
+ }) => /* @__PURE__ */ t("th", { className: l(s.head, a), ...r, children: e }), u = ({
9
+ children: e,
10
+ className: a,
11
+ ...r
12
+ }) => /* @__PURE__ */ t("td", { className: l(s.cell, a), ...r, children: e });
23
13
  export {
24
- p as Textarea
14
+ m as Table,
15
+ b as TableBody,
16
+ u as TableCell,
17
+ p as TableHead,
18
+ d as TableHeader,
19
+ N as TableRow
25
20
  };
package/dist/index27.js CHANGED
@@ -1,57 +1,25 @@
1
- import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
- import n from "./index30.js";
3
- import r from "./index62.js";
4
- import t from "./index63.js";
5
- import o from "./index41.js";
6
- import d from "./index42.js";
7
- import f from "./index43.js";
8
- import p from "./index44.js";
9
- import g from "./index34.js";
10
- const u = {
11
- default: o,
12
- success: p,
13
- error: f,
14
- warning: d,
15
- info: o,
16
- loading: t
17
- }, z = ({ toast: i, onDismiss: e, onRemove: m }) => {
18
- const a = i.variant === "error", c = u[i.variant];
19
- return /* @__PURE__ */ l(
20
- "div",
21
- {
22
- role: a ? "alert" : "status",
23
- "aria-atomic": "true",
24
- className: n(
25
- r.toast,
26
- r[i.variant],
27
- i.dismissing && r.dismissing
28
- ),
29
- onAnimationEnd: () => {
30
- i.dismissing && m(i.id);
31
- },
32
- children: [
33
- /* @__PURE__ */ s(
34
- c,
35
- {
36
- size: 18,
37
- className: n(r.icon, i.variant === "loading" && r.iconSpin),
38
- "aria-hidden": "true"
39
- }
40
- ),
41
- /* @__PURE__ */ s("p", { className: r.message, children: i.message }),
42
- /* @__PURE__ */ s(
43
- "button",
44
- {
45
- onClick: () => e(i.id),
46
- "aria-label": "Dismiss notification",
47
- className: r.dismiss,
48
- children: /* @__PURE__ */ s(g, { size: 16 })
49
- }
50
- )
51
- ]
52
- }
53
- );
54
- };
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import c from "./index31.js";
3
+ import { forwardRef as d } from "react";
4
+ import a from "./index47.js";
5
+ const p = d(
6
+ ({ label: s, error: r, id: e, className: l, ...o }, i) => /* @__PURE__ */ m("div", { className: a.wrapper, children: [
7
+ s && /* @__PURE__ */ t("label", { htmlFor: e, className: a.label, children: s }),
8
+ /* @__PURE__ */ t(
9
+ "textarea",
10
+ {
11
+ id: e,
12
+ ref: i,
13
+ "aria-invalid": r ? !0 : void 0,
14
+ "aria-describedby": r ? `${e}-error` : void 0,
15
+ className: c(a.textarea, r && a.textareaError, l),
16
+ ...o
17
+ }
18
+ ),
19
+ r && /* @__PURE__ */ t("p", { id: `${e}-error`, role: "alert", className: a.error, children: r })
20
+ ] })
21
+ );
22
+ p.displayName = "Textarea";
55
23
  export {
56
- z as Toast
24
+ p as Textarea
57
25
  };
package/dist/index28.js CHANGED
@@ -1,21 +1,57 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import m from "./index30.js";
3
- import { Toast as l } from "./index27.js";
4
- import t from "./index62.js";
5
- const f = ({
6
- toasts: r,
7
- position: e = "top-right",
8
- onDismiss: n,
9
- onRemove: a
10
- }) => r.length === 0 ? null : /* @__PURE__ */ o(
11
- "div",
12
- {
13
- className: m(t.container, t[e]),
14
- "aria-live": "polite",
15
- "aria-relevant": "additions",
16
- children: r.map((i) => /* @__PURE__ */ o(l, { toast: i, onDismiss: n, onRemove: a }, i.id))
17
- }
18
- );
1
+ import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
+ import n from "./index31.js";
3
+ import r from "./index63.js";
4
+ import t from "./index64.js";
5
+ import o from "./index39.js";
6
+ import d from "./index40.js";
7
+ import f from "./index41.js";
8
+ import p from "./index42.js";
9
+ import g from "./index43.js";
10
+ const u = {
11
+ default: o,
12
+ success: p,
13
+ error: f,
14
+ warning: d,
15
+ info: o,
16
+ loading: t
17
+ }, z = ({ toast: i, onDismiss: e, onRemove: m }) => {
18
+ const a = i.variant === "error", c = u[i.variant];
19
+ return /* @__PURE__ */ l(
20
+ "div",
21
+ {
22
+ role: a ? "alert" : "status",
23
+ "aria-atomic": "true",
24
+ className: n(
25
+ r.toast,
26
+ r[i.variant],
27
+ i.dismissing && r.dismissing
28
+ ),
29
+ onAnimationEnd: () => {
30
+ i.dismissing && m(i.id);
31
+ },
32
+ children: [
33
+ /* @__PURE__ */ s(
34
+ c,
35
+ {
36
+ size: 18,
37
+ className: n(r.icon, i.variant === "loading" && r.iconSpin),
38
+ "aria-hidden": "true"
39
+ }
40
+ ),
41
+ /* @__PURE__ */ s("p", { className: r.message, children: i.message }),
42
+ /* @__PURE__ */ s(
43
+ "button",
44
+ {
45
+ onClick: () => e(i.id),
46
+ "aria-label": "Dismiss notification",
47
+ className: r.dismiss,
48
+ children: /* @__PURE__ */ s(g, { size: 16 })
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ );
54
+ };
19
55
  export {
20
- f as ToastContainer
56
+ z as Toast
21
57
  };