meticulous-ui 2.9.3 → 3.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.
Files changed (41) hide show
  1. package/components/Button/Button.js +18 -18
  2. package/components/Button/constants.js +12 -12
  3. package/components/Button/styles.js +3 -3
  4. package/components/Dropdown/Dropdown.js +3 -3
  5. package/components/Dropdown/styles.js +19 -19
  6. package/components/Input/Checkbox/Checkbox.js +1 -1
  7. package/components/Input/Checkbox/styles.js +4 -4
  8. package/components/Input/Input/helpers.js +1 -1
  9. package/components/Input/Input/styles.js +22 -22
  10. package/components/Input/Radio/Radio.js +1 -1
  11. package/components/Input/Radio/styles.js +5 -5
  12. package/components/Input/RadioGroup/styles.js +1 -1
  13. package/components/Input/Textarea/styles.js +20 -20
  14. package/components/Loader/constants.js +3 -3
  15. package/components/MenuItem/MenuItem.js +2 -2
  16. package/components/MenuItem/styles.js +3 -3
  17. package/components/OtpInput/styles.js +6 -6
  18. package/components/Pagination/Pagination.js +46 -46
  19. package/components/Pagination/constants.js +9 -9
  20. package/components/Pagination/styles.js +44 -33
  21. package/components/RootComponent/RootComponent.js +6 -0
  22. package/components/RootComponent/index.js +4 -0
  23. package/components/RootComponent/styles.js +8 -0
  24. package/components/Selectbox/Selectbox.js +4 -4
  25. package/components/Selectbox/styles.js +22 -22
  26. package/components/Shimmer/Shimmer.js +1 -1
  27. package/components/Spinner/Spinner.js +3 -3
  28. package/components/Timer/Timer.js +1 -1
  29. package/components/Toast/Toast.js +34 -30
  30. package/components/Toast/helpers.js +1 -1
  31. package/components/Toast/styles.js +30 -30
  32. package/components/Typography/Headings/H1.js +1 -1
  33. package/components/Typography/Headings/H2.js +1 -1
  34. package/components/Typography/Headings/H3.js +1 -1
  35. package/components/Typography/Headings/H4.js +1 -1
  36. package/components/Typography/Headings/H5.js +1 -1
  37. package/components/Typography/Headings/H6.js +1 -1
  38. package/components/Typography/P/styles.js +1 -1
  39. package/components/VideoPlayer/components/Volumebar/styles.js +9 -9
  40. package/index.js +52 -50
  41. package/package.json +1 -1
@@ -1,94 +1,94 @@
1
1
  import { jsxs as l, jsx as f } from "react/jsx-runtime";
2
- import { useRef as E, useEffect as K } from "react";
3
- import { PrevArrow as M, renderPageNum as d, NextArrow as R, renderThreeDots as $ } from "./helpers.js";
4
- import a from "../../colors/index.js";
5
- import j from "../../colors/teal.js";
6
- import { ICON_SIZE_MAPPING as G, MEDIUM as L, SIZE_REM_MAPPING as P } from "./constants.js";
7
- import { AllPages as u, MiddleLayer as v } from "./styles.js";
8
- const B = ({
2
+ import { useRef as S, useEffect as u } from "react";
3
+ import { PrevArrow as M, renderPageNum as t, NextArrow as R, renderThreeDots as $ } from "./helpers.js";
4
+ import j from "../../colors/index.js";
5
+ import G from "../../colors/teal.js";
6
+ import { ICON_SIZE_MAPPING as L, MEDIUM as U, SIZE_REM_MAPPING as Z } from "./constants.js";
7
+ import { AllPages as v, MiddleLayer as x } from "./styles.js";
8
+ const F = ({
9
9
  pageNumber: r,
10
- setPageNumber: S,
10
+ setPageNumber: _,
11
11
  totalPages: n,
12
- theme: _ = "lime",
13
- size: o = L,
12
+ theme: K = "lime",
13
+ size: o = U,
14
14
  isDisabled: D = !1,
15
- ...x
15
+ ...E
16
16
  }) => {
17
- const s = E(null), h = E(!1);
18
- K(() => {
19
- var i, w;
20
- h.current && (h.current = !1, (w = (i = s.current) == null ? void 0 : i.querySelector('[aria-current="page"]')) == null || w.focus());
17
+ const s = S(null), h = S(!1);
18
+ u(() => {
19
+ var c, m;
20
+ h.current && (h.current = !1, (m = (c = s.current) == null ? void 0 : c.querySelector('[aria-current="page"]')) == null || m.focus());
21
21
  }, [r]);
22
- const c = (i) => {
23
- i !== r && S(i);
22
+ const e = (c) => {
23
+ c !== r && _(c);
24
24
  }, A = () => {
25
- r > 1 && c(r - 1);
26
- }, m = () => {
27
- r < n && c(r + 1);
28
- }, y = (i) => {
29
- ["ArrowLeft", "ArrowUp"].includes(i.code) && (h.current = !0, A()), ["ArrowRight", "ArrowDown"].includes(i.code) && (h.current = !0, m());
30
- }, e = a[_] ?? j, I = P[o], t = G[o];
25
+ r > 1 && e(r - 1);
26
+ }, w = () => {
27
+ r < n && e(r + 1);
28
+ }, y = (c) => {
29
+ ["ArrowLeft", "ArrowUp"].includes(c.code) && (h.current = !0, A()), ["ArrowRight", "ArrowDown"].includes(c.code) && (h.current = !0, w());
30
+ }, i = j[K] ?? G, I = Z[o], d = L[o];
31
31
  return n <= 7 ? /* @__PURE__ */ l(
32
- u,
32
+ v,
33
33
  {
34
34
  ref: s,
35
35
  onKeyDown: y,
36
36
  "aria-label": "Pagination",
37
37
  $isDisabled: D,
38
- ...x,
38
+ ...E,
39
39
  children: [
40
- /* @__PURE__ */ f(M, { iconSize: t, shades: e, setPrevPage: A }),
41
- /* @__PURE__ */ f(v, { size: `${n * I}rem`, children: Array.from({ length: n }, (i, w) => w + 1).map(
42
- d({ size: o, selected: r, shades: e, changePage: c })
40
+ /* @__PURE__ */ f(M, { iconSize: d, shades: i, setPrevPage: A }),
41
+ /* @__PURE__ */ f(x, { size: `${n * I}rem`, children: Array.from({ length: n }, (c, m) => m + 1).map(
42
+ t({ size: o, selected: r, shades: i, changePage: e })
43
43
  ) }),
44
- /* @__PURE__ */ f(R, { iconSize: t, shades: e, setNextPage: m })
44
+ /* @__PURE__ */ f(R, { iconSize: d, shades: i, setNextPage: w })
45
45
  ]
46
46
  }
47
47
  ) : n < 10 || r < 4 || r > n - 3 && r <= n ? /* @__PURE__ */ l(
48
- u,
48
+ v,
49
49
  {
50
50
  ref: s,
51
51
  onKeyDown: y,
52
52
  "aria-label": "Pagination",
53
53
  $isDisabled: D,
54
- ...x,
54
+ ...E,
55
55
  children: [
56
- /* @__PURE__ */ f(M, { iconSize: t, shades: e, setPrevPage: A }),
57
- /* @__PURE__ */ l(v, { size: `${9 * I}rem`, children: [
58
- [1, 2, 3, 4].map(d({ size: o, selected: r, shades: e, changePage: c })),
56
+ /* @__PURE__ */ f(M, { iconSize: d, shades: i, setPrevPage: A }),
57
+ /* @__PURE__ */ l(x, { size: `${9 * I}rem`, children: [
58
+ [1, 2, 3, 4].map(t({ size: o, selected: r, shades: i, changePage: e })),
59
59
  $(),
60
60
  [n - 3, n - 2, n - 1, n].map(
61
- d({ size: o, selected: r, shades: e, changePage: c })
61
+ t({ size: o, selected: r, shades: i, changePage: e })
62
62
  )
63
63
  ] }),
64
- /* @__PURE__ */ f(R, { iconSize: t, shades: e, setNextPage: m })
64
+ /* @__PURE__ */ f(R, { iconSize: d, shades: i, setNextPage: w })
65
65
  ]
66
66
  }
67
67
  ) : /* @__PURE__ */ l(
68
- u,
68
+ v,
69
69
  {
70
70
  ref: s,
71
71
  onKeyDown: y,
72
72
  "aria-label": "Pagination",
73
73
  $isDisabled: D,
74
74
  children: [
75
- /* @__PURE__ */ f(M, { iconSize: t, shades: e, setPrevPage: A }),
76
- /* @__PURE__ */ l(v, { size: `${9 * I}rem`, children: [
77
- [1, 2].map(d({ size: o, selected: r, shades: e, changePage: c })),
78
- $(),
75
+ /* @__PURE__ */ f(M, { iconSize: d, shades: i, setPrevPage: A }),
76
+ /* @__PURE__ */ l(x, { size: `${9 * I}rem`, children: [
77
+ [1, 2].map(t({ size: o, selected: r, shades: i, changePage: e })),
78
+ r > 4 && $(),
79
79
  [r - 1, r, r + 1].map(
80
- d({ size: o, selected: r, shades: e, changePage: c })
80
+ t({ size: o, selected: r, shades: i, changePage: e })
81
81
  ),
82
- $(),
82
+ r < n - 3 && $(),
83
83
  [n - 1, n].map(
84
- d({ size: o, selected: r, shades: e, changePage: c })
84
+ t({ size: o, selected: r, shades: i, changePage: e })
85
85
  )
86
86
  ] }),
87
- /* @__PURE__ */ f(R, { iconSize: t, shades: e, setNextPage: m })
87
+ /* @__PURE__ */ f(R, { iconSize: d, shades: i, setNextPage: w })
88
88
  ]
89
89
  }
90
90
  );
91
91
  };
92
92
  export {
93
- B as default
93
+ F as default
94
94
  };
@@ -1,15 +1,15 @@
1
1
  const _ = "small", I = "medium", E = "large", M = {
2
- [_]: 1.9,
3
- [I]: 2.6,
4
- [E]: 3.1
2
+ [_]: 3.4,
3
+ [I]: 4.2,
4
+ [E]: 5
5
5
  }, S = {
6
- [_]: 1,
7
- [I]: 1.2,
8
- [E]: 1.4
6
+ [_]: 1.5,
7
+ [I]: 1.7,
8
+ [E]: 1.9
9
9
  }, L = {
10
- [_]: 18,
11
- [I]: 19,
12
- [E]: 20
10
+ [_]: 23,
11
+ [I]: 25,
12
+ [E]: 27
13
13
  }, t = "selected_bg", N = "not_selected_bg", A = "active_not_selected_bg";
14
14
  export {
15
15
  A as ACTIVE_NOT_SELECTED_BG,
@@ -1,20 +1,20 @@
1
- import r, { css as n } from "styled-components";
2
- import f from "../Icons/ChevronLeft/ChevronLeft.js";
3
- import s from "../Icons/ChevronRight/ChevronRight.js";
4
- import l from "../../colors/grey.js";
5
- import c from "../../colors/white.js";
6
- import a from "../../colors/black.js";
7
- import { SELECTED_BG as i, NOT_SELECTED_BG as m, ACTIVE_NOT_SELECTED_BG as u } from "./constants.js";
8
- const t = (o) => ({ $shades: e }) => {
9
- if (["#FFFFFF"].includes(e))
10
- return a.m900;
1
+ import e, { css as n } from "styled-components";
2
+ import u from "../Icons/ChevronLeft/ChevronLeft.js";
3
+ import f from "../Icons/ChevronRight/ChevronRight.js";
4
+ import s from "../../colors/grey.js";
5
+ import l from "../../colors/white.js";
6
+ import p from "../../colors/black.js";
7
+ import { SELECTED_BG as i, NOT_SELECTED_BG as c, ACTIVE_NOT_SELECTED_BG as m } from "./constants.js";
8
+ const t = (o) => ({ $shades: r }) => {
9
+ if (["#FFFFFF"].includes(r))
10
+ return p.m900;
11
11
  if (o === i)
12
- return e.m600;
12
+ return r.m600;
13
+ if (o === c)
14
+ return r.m50;
13
15
  if (o === m)
14
- return e.m50;
15
- if (o === u)
16
- return e.m100;
17
- }, $ = r.nav`
16
+ return r.m100;
17
+ }, E = e.nav`
18
18
  display: flex;
19
19
  justify-content: center;
20
20
  align-items: center;
@@ -26,7 +26,7 @@ const t = (o) => ({ $shades: e }) => {
26
26
  pointer-events: none;
27
27
  opacity: 0.4;
28
28
  `};
29
- `, h = r.button`
29
+ `, $ = e.button`
30
30
  border: none;
31
31
  padding: 0;
32
32
  font-family: inherit;
@@ -43,26 +43,34 @@ const t = (o) => ({ $shades: e }) => {
43
43
  font-size: ${({ $fontRemSize: o }) => o}rem;
44
44
  ${({ $isSelected: o }) => o ? n`
45
45
  cursor: auto;
46
- color: ${c};
46
+ color: ${l};
47
47
  background-color: ${t(i)};
48
- outline-color: ${t(i)};
48
+
49
+ &:focus-visible {
50
+ outline: 1px solid ${t(i)};
51
+ }
49
52
  ` : n`
50
53
  cursor: pointer;
51
- color: ${l.m500};
54
+ color: ${s.m500};
52
55
 
53
56
  &:hover {
54
- background-color: ${t(m)};
57
+ background-color: ${t(c)};
55
58
  }
56
59
 
57
60
  &:active {
58
- background-color: ${t(u)};
59
- color: ${c};
61
+ background-color: ${t(m)};
62
+ color: ${l};
63
+ }
64
+
65
+ &:focus-visible {
66
+ outline: 1px solid ${t(c)};
60
67
  }
61
68
  `}
62
- `, v = r.span`
63
- color: ${l.m500};
69
+ `, C = e.span`
70
+ color: ${s.m700};
71
+ font-size: 1.4rem;
64
72
  user-select: none;
65
- `, x = r.button`
73
+ `, h = e.button`
66
74
  border: none;
67
75
  background: none;
68
76
  padding: 0;
@@ -72,23 +80,26 @@ const t = (o) => ({ $shades: e }) => {
72
80
  justify-content: center;
73
81
  border-radius: 50%;
74
82
  outline-offset: 2px;
75
- outline-color: ${({ $shades: o }) => o == null ? void 0 : o.m600};
76
- `, k = r(f)`
83
+
84
+ &:focus-visible {
85
+ outline: 1px solid ${({ $shades: o }) => o == null ? void 0 : o.m600};
86
+ }
87
+ `, k = e(u)`
77
88
  cursor: pointer;
78
- `, w = r(s)`
89
+ `, w = e(f)`
79
90
  cursor: pointer;
80
- `, F = r.div`
91
+ `, F = e.div`
81
92
  min-width: ${({ size: o }) => o};
82
93
  display: flex;
83
94
  align-items: center;
84
95
  justify-content: space-between;
85
96
  `;
86
97
  export {
87
- $ as AllPages,
88
- x as ArrowButton,
98
+ E as AllPages,
99
+ h as ArrowButton,
89
100
  k as ClickableChevronLeft,
90
101
  w as ClickableChevronRight,
91
- v as Ellipsis,
102
+ C as Ellipsis,
92
103
  F as MiddleLayer,
93
- h as Page
104
+ $ as Page
94
105
  };
@@ -0,0 +1,6 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Root as m } from "./styles.js";
3
+ const p = ({ children: o, ...t }) => /* @__PURE__ */ r(m, { ...t, children: o });
4
+ export {
5
+ p as default
6
+ };
@@ -0,0 +1,4 @@
1
+ import t from "./RootComponent.js";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,8 @@
1
+ import t from "styled-components";
2
+ const e = t.div`
3
+ font-size: 62.5%;
4
+ -webkit-text-size-adjust: 100%;
5
+ `;
6
+ export {
7
+ e as Root
8
+ };
@@ -18,8 +18,8 @@ const ye = (o) => {
18
18
  options: o,
19
19
  onChange: E,
20
20
  value: c = [],
21
- width: f = "20rem",
22
- menuHeight: F = "20rem",
21
+ width: f = "32rem",
22
+ menuHeight: F = "32rem",
23
23
  placeholder: q,
24
24
  theme: N = "blue",
25
25
  isDisabled: m,
@@ -136,7 +136,7 @@ const ye = (o) => {
136
136
  role: "option",
137
137
  "aria-selected": D,
138
138
  "aria-disabled": n || void 0,
139
- $width: `calc(${f} + 1rem)`,
139
+ $width: `calc(${f} + 1.6rem)`,
140
140
  $isHighlighted: p === s,
141
141
  $isDisabled: n,
142
142
  $hoverColor: ee,
@@ -192,7 +192,7 @@ const ye = (o) => {
192
192
  "aria-disabled": m || void 0,
193
193
  "aria-activedescendant": s !== -1 ? Q(s) : void 0,
194
194
  children: [
195
- /* @__PURE__ */ i(he, { $width: f, color: c.length > 0 ? O.m700 : O.m500, size: "1.2rem", children: oe }),
195
+ /* @__PURE__ */ i(he, { $width: f, color: c.length > 0 ? O.m700 : O.m500, size: "1.92rem", children: oe }),
196
196
  /* @__PURE__ */ i(be, { color: O.m500, size: 22, $isOpen: r, "aria-hidden": !0 })
197
197
  ]
198
198
  }
@@ -25,12 +25,12 @@ const c = r.m500, l = i`
25
25
  opacity: 0.7;
26
26
  `}
27
27
  `, w = o.div`
28
- height: 2rem;
28
+ height: 3.2rem;
29
29
  width: ${({ $width: e }) => e};
30
- border-radius: 0.6rem;
30
+ border-radius: 0.96rem;
31
31
  outline: none;
32
32
  border: ${({ $isOpen: e, $isFocused: t, $border: m }) => e || t ? `2px solid ${m}` : `1px solid ${c}`};
33
- padding: 0.4rem 0.6rem 0.4rem;
33
+ padding: 0.64rem 0.96rem 0.64rem;
34
34
  display: flex;
35
35
  align-items: center;
36
36
  justify-content: space-between;
@@ -39,20 +39,20 @@ const c = r.m500, l = i`
39
39
  overflow: hidden;
40
40
  white-space: nowrap;
41
41
  text-overflow: ellipsis;
42
- max-width: calc(${({ $width: e }) => e} - 2rem);
42
+ max-width: calc(${({ $width: e }) => e} - 3.2rem);
43
43
  pointer-events: none;
44
44
  `, k = o(d)`
45
45
  animation: ${({ $isOpen: e }) => e ? l : g} 0.15s linear;
46
46
  transform: rotate(${({ $isOpen: e }) => e ? 180 : 0}deg);
47
47
  `, S = o.div`
48
48
  border: 1px solid ${r.m700};
49
- width: calc(${({ $width: e }) => e} + 1rem);
49
+ width: calc(${({ $width: e }) => e} + 1.6rem);
50
50
  display: flex;
51
51
  flex-direction: column;
52
52
  position: absolute;
53
53
  z-index: 1000;
54
54
  background-color: ${a};
55
- left: 0.15rem;
55
+ left: 0.24rem;
56
56
  max-height: 0;
57
57
  transition: max-height 0.15s ease-out;
58
58
  opacity: 0;
@@ -66,14 +66,14 @@ const c = r.m500, l = i`
66
66
  ${({ $top: e }) => e ? n`
67
67
  bottom: 100%;
68
68
  flex-direction: column-reverse;
69
- border-top-right-radius: 0.6rem;
70
- border-top-left-radius: 0.6rem;
71
- margin-bottom: 0.1rem;
69
+ border-top-right-radius: 0.96rem;
70
+ border-top-left-radius: 0.96rem;
71
+ margin-bottom: 0.16rem;
72
72
  ` : n`
73
73
  top: 100%;
74
- border-bottom-right-radius: 0.6rem;
75
- border-bottom-left-radius: 0.6rem;
76
- margin-top: 0.1rem;
74
+ border-bottom-right-radius: 0.96rem;
75
+ border-bottom-left-radius: 0.96rem;
76
+ margin-top: 0.16rem;
77
77
  `}
78
78
  `, W = o.div`
79
79
  overflow-y: auto;
@@ -83,11 +83,11 @@ const c = r.m500, l = i`
83
83
  box-sizing: border-box;
84
84
  background-color: ${({ $isHighlighted: e, $hoverColor: t }) => e ? t : "transparent"};
85
85
  cursor: ${({ $isDisabled: e }) => e ? "not-allowed" : "pointer"};
86
- padding: 0.6rem 1rem 0.8rem;
87
- margin-top: 0.1rem;
86
+ padding: 0.96rem 1.6rem 1.28rem;
87
+ margin-top: 0.16rem;
88
88
  display: flex;
89
89
  align-items: center;
90
- gap: 0.6rem;
90
+ gap: 0.96rem;
91
91
  pointer-events: ${({ $isDisabled: e }) => e ? "none" : "auto"};
92
92
 
93
93
  &:active {
@@ -107,8 +107,8 @@ const c = r.m500, l = i`
107
107
  width: 100%;
108
108
  box-sizing: border-box;
109
109
  border: none;
110
- padding: 0.5rem 0.75rem 0.5rem 0;
111
- font-size: 1.2rem;
110
+ padding: 0.8rem 1.2rem 0.8rem 0;
111
+ font-size: 1.92rem;
112
112
  color: ${r.m700};
113
113
  background: transparent;
114
114
  outline: none;
@@ -117,17 +117,17 @@ const c = r.m500, l = i`
117
117
  color: ${r.m400};
118
118
  }
119
119
  `, B = o(p)`
120
- margin: 0 0.8rem;
120
+ margin: 0 1.28rem;
121
121
  `, I = o.div`
122
122
  position: absolute;
123
- top: 0.8rem;
124
- right: 1.2rem;
123
+ top: 1.28rem;
124
+ right: 1.92rem;
125
125
  `, L = o.div`
126
126
  display: flex;
127
127
  justify-content: center;
128
128
  align-items: center;
129
- padding: 1rem 0;
130
- min-height: 1rem;
129
+ padding: 1.6rem 0;
130
+ min-height: 1.6rem;
131
131
  width: 100%;
132
132
  `;
133
133
  export {
@@ -6,7 +6,7 @@ const e = (r) => {
6
6
  }, p = ({
7
7
  width: r = "100%",
8
8
  height: t = "100%",
9
- borderRadius: o = "0.4rem",
9
+ borderRadius: o = "0.64rem",
10
10
  label: i = "Loading...",
11
11
  ...m
12
12
  }) => /* @__PURE__ */ n(
@@ -5,9 +5,9 @@ import d from "../../colors/green.js";
5
5
  import p from "../../colors/white.js";
6
6
  import c from "../../colors/grey.js";
7
7
  const g = {
8
- small: { strokeWidth: 6, $length: "1rem" },
9
- medium: { strokeWidth: 5, $length: "2rem" },
10
- large: { strokeWidth: 5, $length: "3rem" }
8
+ small: { strokeWidth: 6, $length: "2.4rem" },
9
+ medium: { strokeWidth: 5, $length: "3.6rem" },
10
+ large: { strokeWidth: 5, $length: "5rem" }
11
11
  }, $ = ({ color: e = "green", size: o = "medium", ...n }) => {
12
12
  var t;
13
13
  const { strokeWidth: m, $length: r } = g[o], l = [p, c.m600].includes(e) ? e : (t = h[e] ?? d) == null ? void 0 : t.m500;
@@ -25,7 +25,7 @@ const c = () => {
25
25
  onTimerRemove: K = c,
26
26
  onTimerPause: q = c,
27
27
  onTimerPlay: J = c,
28
- size: M = 20,
28
+ size: M = 30,
29
29
  ...Q
30
30
  }) => {
31
31
  const [S, V] = a(/* @__PURE__ */ new Date()), [s, T] = a(0), [m, $] = a(!1), [A, X] = a(Ce(o)), [Y, y] = a(0), [R, D] = a(!1), k = de(m), t = Math.round(M), P = Math.round(14 * M / 20);
@@ -1,51 +1,55 @@
1
- import { jsxs as p, jsx as s } from "react/jsx-runtime";
2
- import { useState as d, useEffect as T, createElement as $ } from "react";
3
- import { Logo as F } from "./helpers.js";
4
- import L from "../../colors/grey.js";
5
- import { COLOR_MAP as N, INFO as j, INFO_COLORS as k } from "./constants.js";
6
- import { ToastWrapper as w, Message as x, Title as A, Subtitle as I, CloseWrapper as M, ToastsContainer as R } from "./styles.js";
1
+ import { jsxs as T, jsx as s } from "react/jsx-runtime";
2
+ import { useState as u, useEffect as p, createElement as $ } from "react";
3
+ import { createPortal as F } from "react-dom";
4
+ import { Logo as L } from "./helpers.js";
5
+ import N from "../../colors/grey.js";
6
+ import { COLOR_MAP as j, INFO as k, INFO_COLORS as w } from "./constants.js";
7
+ import { ToastWrapper as x, Message as y, Title as A, Subtitle as I, CloseWrapper as M, ToastsContainer as P } from "./styles.js";
7
8
  const O = () => {
8
- }, b = ({ toasts: e, ...o }) => {
9
- const [t, n] = d(e);
10
- T(() => {
11
- n(e);
9
+ }, B = ({ toasts: e, ...o }) => {
10
+ const [t, a] = u(e);
11
+ p(() => {
12
+ a(e);
12
13
  }, [e]);
13
- const m = ({ type: a, id: c, title: i, subtitle: r, onExpire: l = O }, f) => /* @__PURE__ */ $(W, { type: a, title: i, subtitle: r, key: c, onExpire: l });
14
- return /* @__PURE__ */ s(R, { ...o, children: [...t].reverse().map(m) });
15
- }, u = (e, o, t) => () => {
14
+ const m = ({ type: n, id: c, title: i, subtitle: r, onExpire: l = O }, f) => /* @__PURE__ */ $(R, { type: n, title: i, subtitle: r, key: c, onExpire: l });
15
+ return F(
16
+ /* @__PURE__ */ s(P, { ...o, children: [...t].reverse().map(m) }),
17
+ document.body
18
+ );
19
+ }, d = (e, o, t) => () => {
16
20
  e(!0), setTimeout(() => {
17
21
  o(!1), t();
18
22
  }, 500);
19
- }, W = ({
20
- type: e = j,
23
+ }, R = ({
24
+ type: e = k,
21
25
  visible: o = !0,
22
26
  duration: t = 5,
23
- onExpire: n = O,
27
+ onExpire: a = O,
24
28
  title: m,
25
- subtitle: a,
29
+ subtitle: n,
26
30
  ...c
27
31
  }) => {
28
- const [i, r] = d(o), [l, f] = d(!1);
29
- T(() => {
32
+ const [i, r] = u(o), [l, f] = u(!1);
33
+ p(() => {
30
34
  r(o);
31
- }, [o]), T(() => {
32
- const S = setTimeout(u(f, r, n), t * 1e3 - 500);
35
+ }, [o]), p(() => {
36
+ const S = setTimeout(d(f, r, a), t * 1e3 - 500);
33
37
  return () => {
34
38
  clearTimeout(S);
35
39
  };
36
- }, [t, u]);
37
- const { main: h, side: C, bg: g } = N[e] ?? k;
40
+ }, [t, d]);
41
+ const { main: h, side: C, bg: g } = j[e] ?? w;
38
42
  if (i)
39
- return /* @__PURE__ */ p(w, { $bg: g, className: `${l ? "fade-out" : "fade-in"}`, ...c, children: [
40
- /* @__PURE__ */ s(F, { type: e, $main: h, $side: C }),
41
- /* @__PURE__ */ p(x, { children: [
43
+ return /* @__PURE__ */ T(x, { $bg: g, className: `${l ? "fade-out" : "fade-in"}`, ...c, children: [
44
+ /* @__PURE__ */ s(L, { type: e, $main: h, $side: C }),
45
+ /* @__PURE__ */ T(y, { children: [
42
46
  /* @__PURE__ */ s(A, { children: m }),
43
- a && /* @__PURE__ */ s(I, { children: a })
47
+ n && /* @__PURE__ */ s(I, { children: n })
44
48
  ] }),
45
- /* @__PURE__ */ s(M, { size: 20, color: L.m600, onClick: u(f, r, n) })
49
+ /* @__PURE__ */ s(M, { size: 20, color: N.m600, onClick: d(f, r, a) })
46
50
  ] });
47
51
  };
48
52
  export {
49
- b as ToastContainer,
50
- W as default
53
+ B as ToastContainer,
54
+ R as default
51
55
  };
@@ -4,7 +4,7 @@ import f from "../Icons/Close/Close.js";
4
4
  import m from "../Icons/Check/Check.js";
5
5
  import g from "../Icons/Info/Info.js";
6
6
  import { Outer as u, OuterChild as l, LogoContainer as C, Icon as z } from "./styles.js";
7
- const h = (o, r) => o === t ? /* @__PURE__ */ e(f, { size: 16, color: r }) : o === i ? /* @__PURE__ */ e(m, { size: 18, color: r }) : /* @__PURE__ */ e(g, { size: 22, color: r }), I = (o) => o === t ? 1 : o === i ? 1.1 : 1.3, R = ({ type: o, $main: r, $side: n }) => {
7
+ const h = (o, r) => o === t ? /* @__PURE__ */ e(f, { size: 16, color: r }) : o === i ? /* @__PURE__ */ e(m, { size: 18, color: r }) : /* @__PURE__ */ e(g, { size: 22, color: r }), I = (o) => o === t ? 1.6 : o === i ? 1.76 : 2.08, R = ({ type: o, $main: r, $side: n }) => {
8
8
  const s = h(o, r);
9
9
  return /* @__PURE__ */ c(u, { $side: n, children: [
10
10
  /* @__PURE__ */ e(l, { $main: r }),