meticulous-ui 3.0.2 → 3.0.4
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.
|
@@ -1,71 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Logo as
|
|
5
|
-
import
|
|
6
|
-
import { COLOR_MAP as
|
|
7
|
-
import { ToastWrapper as D, Message as I, Title as W, Subtitle as _, CloseButtonContainer as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useRef as h, useEffect as R, createElement as N } from "react";
|
|
3
|
+
import { createPortal as b } from "react-dom";
|
|
4
|
+
import { Logo as j } from "./helpers.js";
|
|
5
|
+
import k from "../../colors/grey.js";
|
|
6
|
+
import { COLOR_MAP as y, INFO as A, INFO_COLORS as B, ERROR as M } from "./constants.js";
|
|
7
|
+
import { ToastWrapper as D, Message as I, Title as W, Subtitle as _, CloseButtonContainer as z, ProgressRing as q, CloseWrapper as G, ToastsContainer as H } from "./styles.js";
|
|
8
8
|
const w = () => {
|
|
9
|
-
},
|
|
10
|
-
const [o, s] =
|
|
11
|
-
|
|
9
|
+
}, ee = ({ toasts: e, ...r }) => {
|
|
10
|
+
const [o, s] = i(e);
|
|
11
|
+
R(() => {
|
|
12
12
|
s(e);
|
|
13
13
|
}, [e]);
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
/* @__PURE__ */ t(
|
|
14
|
+
const l = ({ type: a, id: u, title: m, subtitle: n, onExpire: d = w }, f) => /* @__PURE__ */ N(J, { type: a, title: m, subtitle: n, key: u, onExpire: d });
|
|
15
|
+
return b(
|
|
16
|
+
/* @__PURE__ */ t(H, { ...r, children: [...o].reverse().map(l) }),
|
|
17
17
|
document.body
|
|
18
18
|
);
|
|
19
|
-
},
|
|
19
|
+
}, v = (e, r, o) => () => {
|
|
20
20
|
e(!0), setTimeout(() => {
|
|
21
21
|
r(!1), o();
|
|
22
22
|
}, 500);
|
|
23
|
-
},
|
|
23
|
+
}, J = ({
|
|
24
24
|
type: e = A,
|
|
25
25
|
visible: r = !0,
|
|
26
26
|
duration: o = 5,
|
|
27
27
|
onExpire: s = w,
|
|
28
|
-
title:
|
|
29
|
-
subtitle:
|
|
30
|
-
...
|
|
28
|
+
title: l,
|
|
29
|
+
subtitle: a,
|
|
30
|
+
...u
|
|
31
31
|
}) => {
|
|
32
|
-
const [m, n] =
|
|
33
|
-
O.current = Date.now(),
|
|
32
|
+
const [m, n] = i(r), [d, f] = i(!1), [x, C] = i(!1), T = h(null), p = h((o - 0.5) * 1e3), O = h(null), g = (F) => {
|
|
33
|
+
O.current = Date.now(), T.current = setTimeout(v(f, n, s), F);
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
R(() => {
|
|
36
36
|
n(r);
|
|
37
|
-
}, [r]),
|
|
37
|
+
}, [r]), R(() => (g(p.current), () => clearTimeout(T.current)), []);
|
|
38
38
|
const L = () => {
|
|
39
|
-
clearTimeout(
|
|
40
|
-
},
|
|
41
|
-
C(!1),
|
|
42
|
-
}, { main: $, side: P, bg: S } =
|
|
39
|
+
clearTimeout(T.current), p.current -= Date.now() - O.current, C(!0);
|
|
40
|
+
}, E = () => {
|
|
41
|
+
C(!1), g(p.current);
|
|
42
|
+
}, { main: $, side: P, bg: S } = y[e] ?? B;
|
|
43
43
|
if (m)
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ c(
|
|
45
45
|
D,
|
|
46
46
|
{
|
|
47
47
|
$bg: S,
|
|
48
|
+
role: e === M ? "alert" : "status",
|
|
49
|
+
"aria-live": e === M ? "assertive" : "polite",
|
|
50
|
+
"aria-atomic": "true",
|
|
48
51
|
className: `${d ? "fade-out" : "fade-in"}`,
|
|
49
52
|
onMouseEnter: L,
|
|
50
|
-
onMouseLeave:
|
|
51
|
-
...
|
|
53
|
+
onMouseLeave: E,
|
|
54
|
+
...u,
|
|
52
55
|
children: [
|
|
53
|
-
/* @__PURE__ */ t(
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ t(W, { children:
|
|
56
|
-
|
|
56
|
+
/* @__PURE__ */ t(j, { type: e, $main: $, $side: P }),
|
|
57
|
+
/* @__PURE__ */ c(I, { children: [
|
|
58
|
+
/* @__PURE__ */ t(W, { children: l }),
|
|
59
|
+
a && /* @__PURE__ */ t(_, { children: a })
|
|
57
60
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" }),
|
|
61
|
-
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" })
|
|
62
|
-
] }),
|
|
63
|
-
/* @__PURE__ */ t(
|
|
61
|
+
/* @__PURE__ */ c(z, { children: [
|
|
62
|
+
/* @__PURE__ */ c(
|
|
64
63
|
q,
|
|
65
64
|
{
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
viewBox: "0 0 28 28",
|
|
67
|
+
$duration: o,
|
|
68
|
+
$color: $,
|
|
69
|
+
$paused: x,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" }),
|
|
72
|
+
/* @__PURE__ */ t("circle", { cx: "14", cy: "14", r: "12" })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
G,
|
|
78
|
+
{
|
|
79
|
+
"aria-label": "Close notification",
|
|
66
80
|
size: 13,
|
|
67
|
-
color:
|
|
68
|
-
onClick:
|
|
81
|
+
color: k.m600,
|
|
82
|
+
onClick: v(f, n, s)
|
|
69
83
|
}
|
|
70
84
|
)
|
|
71
85
|
] })
|
|
@@ -74,6 +88,6 @@ const w = () => {
|
|
|
74
88
|
);
|
|
75
89
|
};
|
|
76
90
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
91
|
+
ee as ToastContainer,
|
|
92
|
+
J as default
|
|
79
93
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ERROR as t, SUCCESS as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { WARNING as e, ERROR as t, SUCCESS as n } from "./constants.js";
|
|
3
|
+
import c from "../Icons/Close/Close.js";
|
|
4
|
+
import l from "../Icons/Check/Check.js";
|
|
5
|
+
import u from "../Icons/Info/Info.js";
|
|
6
|
+
import g from "../Icons/WarningTriangleFilled/WarningTriangleFilled.js";
|
|
7
|
+
import C from "../../colors/white.js";
|
|
8
|
+
import { Outer as d, OuterChild as h, LogoContainer as z, Icon as I } from "./styles.js";
|
|
9
|
+
const L = (r, o) => r === t ? /* @__PURE__ */ i(c, { size: 16, color: o }) : r === n ? /* @__PURE__ */ i(l, { size: 18, color: o }) : r === e ? /* @__PURE__ */ i(g, { size: 28, color: C }) : /* @__PURE__ */ i(u, { size: 22, color: o }), R = (r) => r === t ? 1.6 : r === n ? 1.76 : r === e ? 2.8 : 2.08, W = ({ type: r, $main: o, $side: f }) => {
|
|
10
|
+
const m = L(r, o);
|
|
11
|
+
return /* @__PURE__ */ s(d, { "aria-hidden": "true", $side: f, children: [
|
|
12
|
+
/* @__PURE__ */ i(h, { $main: o }),
|
|
13
|
+
r !== e && /* @__PURE__ */ i(z, { $main: o, type: r }),
|
|
14
|
+
/* @__PURE__ */ i(I, { size: R(r), children: m })
|
|
13
15
|
] });
|
|
14
16
|
};
|
|
15
17
|
export {
|
|
16
|
-
|
|
18
|
+
W as Logo
|
|
17
19
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import t, { keyframes as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import t, { keyframes as r } from "styled-components";
|
|
2
|
+
import s from "../../colors/white.js";
|
|
3
|
+
import n from "../Icons/Close/Close.js";
|
|
4
|
+
import i from "../../colors/grey.js";
|
|
5
|
+
const a = r`
|
|
6
|
+
from { transform: scale(0); }
|
|
7
|
+
to { transform: scale(1); }
|
|
8
|
+
`, d = r`
|
|
9
|
+
from { transform: translate(-50%, -50%) scale(0); }
|
|
10
|
+
to { transform: translate(-50%, -50%) scale(1); }
|
|
11
|
+
`, m = r`
|
|
7
12
|
from {
|
|
8
13
|
opacity: 0;
|
|
9
14
|
transform: translateX(100%); /* Start off-screen to the right */
|
|
@@ -12,7 +17,7 @@ const l = a`
|
|
|
12
17
|
opacity: 1;
|
|
13
18
|
transform: translateX(0); /* Move to its final position */
|
|
14
19
|
}
|
|
15
|
-
`, c =
|
|
20
|
+
`, c = r`
|
|
16
21
|
from {
|
|
17
22
|
opacity: 1;
|
|
18
23
|
transform: translateX(0);
|
|
@@ -21,7 +26,7 @@ const l = a`
|
|
|
21
26
|
opacity: 0;
|
|
22
27
|
transform: translateX(100%); /* Move off-screen to the right */
|
|
23
28
|
}
|
|
24
|
-
`,
|
|
29
|
+
`, u = t.div`
|
|
25
30
|
position: fixed;
|
|
26
31
|
top: 1.6rem;
|
|
27
32
|
right: 1.6rem;
|
|
@@ -30,7 +35,7 @@ const l = a`
|
|
|
30
35
|
display: flex;
|
|
31
36
|
flex-direction: column;
|
|
32
37
|
gap: 1.6rem;
|
|
33
|
-
`,
|
|
38
|
+
`, w = t.div`
|
|
34
39
|
display: flex;
|
|
35
40
|
align-items: center;
|
|
36
41
|
justify-content: space-between;
|
|
@@ -44,7 +49,7 @@ const l = a`
|
|
|
44
49
|
|
|
45
50
|
&.fade-in {
|
|
46
51
|
opacity: 1;
|
|
47
|
-
animation: ${
|
|
52
|
+
animation: ${m} 0.5s ease-out forwards; /* slide down + fade */
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
&.fade-out {
|
|
@@ -58,60 +63,42 @@ const l = a`
|
|
|
58
63
|
border-radius: 0.96rem;
|
|
59
64
|
padding: 0.48rem 1.28rem;
|
|
60
65
|
}
|
|
61
|
-
`,
|
|
66
|
+
`, x = t.div`
|
|
62
67
|
position: absolute;
|
|
63
68
|
top: 50%;
|
|
64
69
|
left: 50%;
|
|
65
70
|
transform: translate(-50%, -50%);
|
|
66
|
-
background-color: ${
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
border-color: ${r} ${r} ${i} ${r};
|
|
71
|
-
border-style: solid;
|
|
72
|
-
border-width: 0 1.44rem 2.24rem 1.44rem;
|
|
73
|
-
height: 0;
|
|
74
|
-
width: 0;
|
|
75
|
-
` : o`
|
|
76
|
-
top: 50%;
|
|
77
|
-
width: 2.88rem;
|
|
78
|
-
height: 2.88rem;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
`}
|
|
71
|
+
background-color: ${s};
|
|
72
|
+
width: 2.88rem;
|
|
73
|
+
height: 2.88rem;
|
|
74
|
+
border-radius: 50%;
|
|
81
75
|
|
|
82
76
|
@media screen and (max-width: 768px) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
border-color: ${r} ${r} ${i} ${r};
|
|
86
|
-
border-style: solid;
|
|
87
|
-
border-width: 0 1.12rem 1.68rem 1.088rem;
|
|
88
|
-
height: 0;
|
|
89
|
-
width: 0;
|
|
90
|
-
` : o`
|
|
91
|
-
top: 50%;
|
|
92
|
-
width: 2.16rem;
|
|
93
|
-
height: 2.16rem;
|
|
94
|
-
border-radius: 50%;
|
|
95
|
-
`}
|
|
77
|
+
width: 2.16rem;
|
|
78
|
+
height: 2.16rem;
|
|
96
79
|
}
|
|
97
|
-
`,
|
|
80
|
+
`, b = t.div`
|
|
98
81
|
position: relative;
|
|
99
82
|
width: 6.4rem;
|
|
100
83
|
height: 6.4rem;
|
|
101
84
|
border-radius: 50%;
|
|
102
85
|
background-color: ${({ $side: e }) => e};
|
|
86
|
+
animation: ${a} 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
|
|
103
87
|
|
|
104
88
|
@media screen and (max-width: 768px) {
|
|
105
89
|
width: 4.8rem;
|
|
106
90
|
height: 4.8rem;
|
|
107
91
|
}
|
|
108
|
-
`,
|
|
92
|
+
`, y = t.div`
|
|
109
93
|
position: absolute;
|
|
110
94
|
top: 50%;
|
|
111
95
|
left: 50%;
|
|
112
96
|
transform: translate(-50%, -50%);
|
|
113
97
|
width: ${({ size: e }) => e}rem;
|
|
114
98
|
height: ${({ size: e }) => e}rem;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
115
102
|
|
|
116
103
|
@media screen and (max-width: 768px) {
|
|
117
104
|
top: 42.8%;
|
|
@@ -119,7 +106,7 @@ const l = a`
|
|
|
119
106
|
transform: translate(-42.8%, -42.8%);
|
|
120
107
|
scale: 0.75;
|
|
121
108
|
}
|
|
122
|
-
`,
|
|
109
|
+
`, $ = t.div`
|
|
123
110
|
position: absolute;
|
|
124
111
|
top: 50%;
|
|
125
112
|
left: 50%;
|
|
@@ -128,15 +115,16 @@ const l = a`
|
|
|
128
115
|
height: 4.8rem;
|
|
129
116
|
border-radius: 50%;
|
|
130
117
|
background-color: ${({ $main: e }) => e};
|
|
118
|
+
animation: ${d} 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
|
|
131
119
|
|
|
132
120
|
@media screen and (max-width: 768px) {
|
|
133
121
|
width: 3.6rem;
|
|
134
122
|
height: 3.6rem;
|
|
135
123
|
}
|
|
136
|
-
`,
|
|
137
|
-
from { stroke-dashoffset: ${
|
|
124
|
+
`, o = 75.4, l = r`
|
|
125
|
+
from { stroke-dashoffset: ${o}; }
|
|
138
126
|
to { stroke-dashoffset: 0; }
|
|
139
|
-
`,
|
|
127
|
+
`, v = t.div`
|
|
140
128
|
position: relative;
|
|
141
129
|
display: inline-flex;
|
|
142
130
|
align-items: center;
|
|
@@ -144,7 +132,7 @@ const l = a`
|
|
|
144
132
|
flex-shrink: 0;
|
|
145
133
|
width: 2.8rem;
|
|
146
134
|
height: 2.8rem;
|
|
147
|
-
`,
|
|
135
|
+
`, k = t.svg`
|
|
148
136
|
position: absolute;
|
|
149
137
|
inset: 0;
|
|
150
138
|
transform: rotate(-90deg);
|
|
@@ -155,7 +143,7 @@ const l = a`
|
|
|
155
143
|
stroke: ${({ $color: e }) => e};
|
|
156
144
|
stroke-width: 2;
|
|
157
145
|
stroke-linecap: round;
|
|
158
|
-
stroke-dasharray: ${
|
|
146
|
+
stroke-dasharray: ${o};
|
|
159
147
|
}
|
|
160
148
|
|
|
161
149
|
circle:first-child {
|
|
@@ -164,17 +152,17 @@ const l = a`
|
|
|
164
152
|
}
|
|
165
153
|
|
|
166
154
|
circle:last-child {
|
|
167
|
-
stroke-dashoffset: ${
|
|
168
|
-
animation: ${
|
|
155
|
+
stroke-dashoffset: ${o};
|
|
156
|
+
animation: ${l} ${({ $duration: e }) => e - 0.5}s linear forwards;
|
|
169
157
|
animation-play-state: ${({ $paused: e }) => e ? "paused" : "running"};
|
|
170
158
|
}
|
|
171
|
-
`,
|
|
159
|
+
`, C = t(n)`
|
|
172
160
|
cursor: pointer;
|
|
173
|
-
`,
|
|
161
|
+
`, R = t.div`
|
|
174
162
|
font-weight: 600;
|
|
175
163
|
font-size: 1.92rem;
|
|
176
|
-
color: ${
|
|
177
|
-
`,
|
|
164
|
+
color: ${i.m800};
|
|
165
|
+
`, z = t.div`
|
|
178
166
|
display: flex;
|
|
179
167
|
flex-direction: column;
|
|
180
168
|
gap: 0.32rem;
|
|
@@ -183,22 +171,22 @@ const l = a`
|
|
|
183
171
|
@media screen and (max-width: 768px) {
|
|
184
172
|
width: 24rem;
|
|
185
173
|
}
|
|
186
|
-
`,
|
|
174
|
+
`, I = t.div`
|
|
187
175
|
font-weight: 400;
|
|
188
176
|
font-size: 1.6rem;
|
|
189
|
-
color: ${
|
|
177
|
+
color: ${i.m700};
|
|
190
178
|
`;
|
|
191
179
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
180
|
+
v as CloseButtonContainer,
|
|
181
|
+
C as CloseWrapper,
|
|
182
|
+
y as Icon,
|
|
183
|
+
x as LogoContainer,
|
|
184
|
+
z as Message,
|
|
185
|
+
b as Outer,
|
|
186
|
+
$ as OuterChild,
|
|
187
|
+
k as ProgressRing,
|
|
188
|
+
I as Subtitle,
|
|
189
|
+
R as Title,
|
|
190
|
+
w as ToastWrapper,
|
|
191
|
+
u as ToastsContainer
|
|
204
192
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
|
|
6
6
|
"main": "./index.js",
|