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.
- package/components/Button/Button.js +18 -18
- package/components/Button/constants.js +12 -12
- package/components/Button/styles.js +3 -3
- package/components/Dropdown/Dropdown.js +3 -3
- package/components/Dropdown/styles.js +19 -19
- package/components/Input/Checkbox/Checkbox.js +1 -1
- package/components/Input/Checkbox/styles.js +4 -4
- package/components/Input/Input/helpers.js +1 -1
- package/components/Input/Input/styles.js +22 -22
- package/components/Input/Radio/Radio.js +1 -1
- package/components/Input/Radio/styles.js +5 -5
- package/components/Input/RadioGroup/styles.js +1 -1
- package/components/Input/Textarea/styles.js +20 -20
- package/components/Loader/constants.js +3 -3
- package/components/MenuItem/MenuItem.js +2 -2
- package/components/MenuItem/styles.js +3 -3
- package/components/OtpInput/styles.js +6 -6
- package/components/Pagination/Pagination.js +46 -46
- package/components/Pagination/constants.js +9 -9
- package/components/Pagination/styles.js +44 -33
- package/components/RootComponent/RootComponent.js +6 -0
- package/components/RootComponent/index.js +4 -0
- package/components/RootComponent/styles.js +8 -0
- package/components/Selectbox/Selectbox.js +4 -4
- package/components/Selectbox/styles.js +22 -22
- package/components/Shimmer/Shimmer.js +1 -1
- package/components/Spinner/Spinner.js +3 -3
- package/components/Timer/Timer.js +1 -1
- package/components/Toast/Toast.js +34 -30
- package/components/Toast/helpers.js +1 -1
- package/components/Toast/styles.js +30 -30
- package/components/Typography/Headings/H1.js +1 -1
- package/components/Typography/Headings/H2.js +1 -1
- package/components/Typography/Headings/H3.js +1 -1
- package/components/Typography/Headings/H4.js +1 -1
- package/components/Typography/Headings/H5.js +1 -1
- package/components/Typography/Headings/H6.js +1 -1
- package/components/Typography/P/styles.js +1 -1
- package/components/VideoPlayer/components/Volumebar/styles.js +9 -9
- package/index.js +52 -50
- 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
|
|
3
|
-
import { PrevArrow as M, renderPageNum as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ICON_SIZE_MAPPING as
|
|
7
|
-
import { AllPages as
|
|
8
|
-
const
|
|
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:
|
|
10
|
+
setPageNumber: _,
|
|
11
11
|
totalPages: n,
|
|
12
|
-
theme:
|
|
13
|
-
size: o =
|
|
12
|
+
theme: K = "lime",
|
|
13
|
+
size: o = U,
|
|
14
14
|
isDisabled: D = !1,
|
|
15
|
-
...
|
|
15
|
+
...E
|
|
16
16
|
}) => {
|
|
17
|
-
const s =
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
h.current && (h.current = !1, (
|
|
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
|
|
23
|
-
|
|
22
|
+
const e = (c) => {
|
|
23
|
+
c !== r && _(c);
|
|
24
24
|
}, A = () => {
|
|
25
|
-
r > 1 &&
|
|
26
|
-
},
|
|
27
|
-
r < n &&
|
|
28
|
-
}, y = (
|
|
29
|
-
["ArrowLeft", "ArrowUp"].includes(
|
|
30
|
-
},
|
|
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
|
-
|
|
32
|
+
v,
|
|
33
33
|
{
|
|
34
34
|
ref: s,
|
|
35
35
|
onKeyDown: y,
|
|
36
36
|
"aria-label": "Pagination",
|
|
37
37
|
$isDisabled: D,
|
|
38
|
-
...
|
|
38
|
+
...E,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ f(M, { iconSize:
|
|
41
|
-
/* @__PURE__ */ f(
|
|
42
|
-
|
|
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:
|
|
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
|
-
|
|
48
|
+
v,
|
|
49
49
|
{
|
|
50
50
|
ref: s,
|
|
51
51
|
onKeyDown: y,
|
|
52
52
|
"aria-label": "Pagination",
|
|
53
53
|
$isDisabled: D,
|
|
54
|
-
...
|
|
54
|
+
...E,
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */ f(M, { iconSize:
|
|
57
|
-
/* @__PURE__ */ l(
|
|
58
|
-
[1, 2, 3, 4].map(
|
|
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
|
-
|
|
61
|
+
t({ size: o, selected: r, shades: i, changePage: e })
|
|
62
62
|
)
|
|
63
63
|
] }),
|
|
64
|
-
/* @__PURE__ */ f(R, { iconSize:
|
|
64
|
+
/* @__PURE__ */ f(R, { iconSize: d, shades: i, setNextPage: w })
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
) : /* @__PURE__ */ l(
|
|
68
|
-
|
|
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:
|
|
76
|
-
/* @__PURE__ */ l(
|
|
77
|
-
[1, 2].map(
|
|
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
|
-
|
|
80
|
+
t({ size: o, selected: r, shades: i, changePage: e })
|
|
81
81
|
),
|
|
82
|
-
$(),
|
|
82
|
+
r < n - 3 && $(),
|
|
83
83
|
[n - 1, n].map(
|
|
84
|
-
|
|
84
|
+
t({ size: o, selected: r, shades: i, changePage: e })
|
|
85
85
|
)
|
|
86
86
|
] }),
|
|
87
|
-
/* @__PURE__ */ f(R, { iconSize:
|
|
87
|
+
/* @__PURE__ */ f(R, { iconSize: d, shades: i, setNextPage: w })
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
};
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
F as default
|
|
94
94
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const _ = "small", I = "medium", E = "large", M = {
|
|
2
|
-
[_]:
|
|
3
|
-
[I]: 2
|
|
4
|
-
[E]:
|
|
2
|
+
[_]: 3.4,
|
|
3
|
+
[I]: 4.2,
|
|
4
|
+
[E]: 5
|
|
5
5
|
}, S = {
|
|
6
|
-
[_]: 1,
|
|
7
|
-
[I]: 1.
|
|
8
|
-
[E]: 1.
|
|
6
|
+
[_]: 1.5,
|
|
7
|
+
[I]: 1.7,
|
|
8
|
+
[E]: 1.9
|
|
9
9
|
}, L = {
|
|
10
|
-
[_]:
|
|
11
|
-
[I]:
|
|
12
|
-
[E]:
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { SELECTED_BG as i, NOT_SELECTED_BG as
|
|
8
|
-
const t = (o) => ({ $shades:
|
|
9
|
-
if (["#FFFFFF"].includes(
|
|
10
|
-
return
|
|
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
|
|
12
|
+
return r.m600;
|
|
13
|
+
if (o === c)
|
|
14
|
+
return r.m50;
|
|
13
15
|
if (o === m)
|
|
14
|
-
return
|
|
15
|
-
|
|
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
|
-
`,
|
|
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: ${
|
|
46
|
+
color: ${l};
|
|
47
47
|
background-color: ${t(i)};
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline: 1px solid ${t(i)};
|
|
51
|
+
}
|
|
49
52
|
` : n`
|
|
50
53
|
cursor: pointer;
|
|
51
|
-
color: ${
|
|
54
|
+
color: ${s.m500};
|
|
52
55
|
|
|
53
56
|
&:hover {
|
|
54
|
-
background-color: ${t(
|
|
57
|
+
background-color: ${t(c)};
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
&:active {
|
|
58
|
-
background-color: ${t(
|
|
59
|
-
color: ${
|
|
61
|
+
background-color: ${t(m)};
|
|
62
|
+
color: ${l};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus-visible {
|
|
66
|
+
outline: 1px solid ${t(c)};
|
|
60
67
|
}
|
|
61
68
|
`}
|
|
62
|
-
`,
|
|
63
|
-
color: ${
|
|
69
|
+
`, C = e.span`
|
|
70
|
+
color: ${s.m700};
|
|
71
|
+
font-size: 1.4rem;
|
|
64
72
|
user-select: none;
|
|
65
|
-
`,
|
|
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
|
-
|
|
76
|
-
|
|
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 =
|
|
89
|
+
`, w = e(f)`
|
|
79
90
|
cursor: pointer;
|
|
80
|
-
`, F =
|
|
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
|
-
|
|
88
|
-
|
|
98
|
+
E as AllPages,
|
|
99
|
+
h as ArrowButton,
|
|
89
100
|
k as ClickableChevronLeft,
|
|
90
101
|
w as ClickableChevronRight,
|
|
91
|
-
|
|
102
|
+
C as Ellipsis,
|
|
92
103
|
F as MiddleLayer,
|
|
93
|
-
|
|
104
|
+
$ as Page
|
|
94
105
|
};
|
|
@@ -18,8 +18,8 @@ const ye = (o) => {
|
|
|
18
18
|
options: o,
|
|
19
19
|
onChange: E,
|
|
20
20
|
value: c = [],
|
|
21
|
-
width: f = "
|
|
22
|
-
menuHeight: F = "
|
|
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} +
|
|
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.
|
|
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.
|
|
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.
|
|
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} +
|
|
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.
|
|
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.
|
|
70
|
-
border-top-left-radius: 0.
|
|
71
|
-
margin-bottom: 0.
|
|
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.
|
|
75
|
-
border-bottom-left-radius: 0.
|
|
76
|
-
margin-top: 0.
|
|
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
|
|
87
|
-
margin-top: 0.
|
|
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.
|
|
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.
|
|
111
|
-
font-size: 1.
|
|
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
|
|
120
|
+
margin: 0 1.28rem;
|
|
121
121
|
`, I = o.div`
|
|
122
122
|
position: absolute;
|
|
123
|
-
top:
|
|
124
|
-
right: 1.
|
|
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:
|
|
130
|
-
min-height:
|
|
129
|
+
padding: 1.6rem 0;
|
|
130
|
+
min-height: 1.6rem;
|
|
131
131
|
width: 100%;
|
|
132
132
|
`;
|
|
133
133
|
export {
|
|
@@ -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: "
|
|
9
|
-
medium: { strokeWidth: 5, $length: "
|
|
10
|
-
large: { strokeWidth: 5, $length: "
|
|
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 =
|
|
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
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import L from "
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
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
|
-
},
|
|
9
|
-
const [t,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
}, B = ({ toasts: e, ...o }) => {
|
|
10
|
+
const [t, a] = u(e);
|
|
11
|
+
p(() => {
|
|
12
|
+
a(e);
|
|
12
13
|
}, [e]);
|
|
13
|
-
const m = ({ type:
|
|
14
|
-
return
|
|
15
|
-
|
|
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
|
-
},
|
|
20
|
-
type: e =
|
|
23
|
+
}, R = ({
|
|
24
|
+
type: e = k,
|
|
21
25
|
visible: o = !0,
|
|
22
26
|
duration: t = 5,
|
|
23
|
-
onExpire:
|
|
27
|
+
onExpire: a = O,
|
|
24
28
|
title: m,
|
|
25
|
-
subtitle:
|
|
29
|
+
subtitle: n,
|
|
26
30
|
...c
|
|
27
31
|
}) => {
|
|
28
|
-
const [i, r] =
|
|
29
|
-
|
|
32
|
+
const [i, r] = u(o), [l, f] = u(!1);
|
|
33
|
+
p(() => {
|
|
30
34
|
r(o);
|
|
31
|
-
}, [o]),
|
|
32
|
-
const S = setTimeout(
|
|
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,
|
|
37
|
-
const { main: h, side: C, bg: g } =
|
|
40
|
+
}, [t, d]);
|
|
41
|
+
const { main: h, side: C, bg: g } = j[e] ?? w;
|
|
38
42
|
if (i)
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */ s(
|
|
41
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
47
|
+
n && /* @__PURE__ */ s(I, { children: n })
|
|
44
48
|
] }),
|
|
45
|
-
/* @__PURE__ */ s(M, { size: 20, color:
|
|
49
|
+
/* @__PURE__ */ s(M, { size: 20, color: N.m600, onClick: d(f, r, a) })
|
|
46
50
|
] });
|
|
47
51
|
};
|
|
48
52
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
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.
|
|
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 }),
|