meticulous-ui 3.5.2 → 3.5.3
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,56 +1,52 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as D, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as v } from "react";
|
|
3
|
-
import
|
|
3
|
+
import L from "../Spinner/Spinner.js";
|
|
4
4
|
import I from "../../colors/colorMap.js";
|
|
5
5
|
import { blue as f } from "../../colors/blue.js";
|
|
6
6
|
import { ButtonWrapper as K, SpinnerWrapper as R, Content as B, ButtonContainer as E } from "./styles.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import S from "../Ripple/Ripple.js";
|
|
8
|
+
import j from "../../colors/white.js";
|
|
9
9
|
import k from "../../colors/grey.js";
|
|
10
10
|
import { MEDIUM as z, SIZE as M } from "./constants.js";
|
|
11
|
-
const P = ({ theme: t, children:
|
|
11
|
+
const P = ({ theme: t, children: i }) => /* @__PURE__ */ o(S, { rippleColor: t.m100, children: i }), T = (t) => {
|
|
12
12
|
const {
|
|
13
|
-
children:
|
|
14
|
-
theme:
|
|
13
|
+
children: i,
|
|
14
|
+
theme: n = f,
|
|
15
15
|
size: u = z,
|
|
16
16
|
width: l,
|
|
17
17
|
leftIcon: W,
|
|
18
|
-
rightIcon:
|
|
19
|
-
isLoading:
|
|
18
|
+
rightIcon: U,
|
|
19
|
+
isLoading: e,
|
|
20
20
|
textColor: s,
|
|
21
21
|
onKeyDown: w,
|
|
22
22
|
...C
|
|
23
|
-
} = t || {}, d = v(0), $ = (
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
|
|
23
|
+
} = t || {}, d = v(0), $ = (r) => {
|
|
24
|
+
if (r.key === "Enter" || r.key === " ") {
|
|
25
|
+
const h = Date.now();
|
|
26
|
+
if (h - d.current < 500) {
|
|
27
|
+
r.preventDefault(), r.stopPropagation();
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
d.current =
|
|
30
|
+
d.current = h;
|
|
31
31
|
}
|
|
32
|
-
w?.(
|
|
33
|
-
}, { m400:
|
|
32
|
+
w?.(r);
|
|
33
|
+
}, { m400: g, m500: y, m600: b } = I[n] ?? f, { height: m, width: c, font: x } = M[u] || {}, a = ["white", "yellow"].includes(n) ? k.m600 : j, p = /* @__PURE__ */ D(
|
|
34
34
|
K,
|
|
35
35
|
{
|
|
36
36
|
type: "button",
|
|
37
37
|
...C,
|
|
38
38
|
onKeyDown: $,
|
|
39
|
-
$hoverColor:
|
|
39
|
+
$hoverColor: y,
|
|
40
40
|
$activeColor: b,
|
|
41
|
-
$selectedColor:
|
|
41
|
+
$selectedColor: g,
|
|
42
42
|
$height: m,
|
|
43
43
|
$width: l || c,
|
|
44
44
|
disabled: t.disabled,
|
|
45
|
-
$isLoading:
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
$font: D,
|
|
51
|
-
children: n
|
|
52
|
-
}
|
|
53
|
-
)
|
|
45
|
+
$isLoading: e,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ o(R, { $isLoading: e, children: /* @__PURE__ */ o(L, { size: "small", color: s || a }) }),
|
|
48
|
+
/* @__PURE__ */ o(B, { $isLoading: e, $textColor: s || a, $font: x, children: i })
|
|
49
|
+
]
|
|
54
50
|
}
|
|
55
51
|
);
|
|
56
52
|
return /* @__PURE__ */ o(
|
|
@@ -59,11 +55,11 @@ const P = ({ theme: t, children: n }) => /* @__PURE__ */ o(L, { rippleColor: t.m
|
|
|
59
55
|
$height: m,
|
|
60
56
|
$width: l || c,
|
|
61
57
|
disabled: t.disabled,
|
|
62
|
-
$isLoading:
|
|
63
|
-
children:
|
|
58
|
+
$isLoading: e,
|
|
59
|
+
children: e ? p : /* @__PURE__ */ o(P, { theme: n, children: p })
|
|
64
60
|
}
|
|
65
61
|
);
|
|
66
62
|
};
|
|
67
63
|
export {
|
|
68
|
-
|
|
64
|
+
T as default
|
|
69
65
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r, { css as n } from "styled-components";
|
|
2
2
|
import i from "../../colors/grey.js";
|
|
3
|
-
const d =
|
|
3
|
+
const d = r.button`
|
|
4
4
|
height: ${({ $height: o }) => o}rem;
|
|
5
5
|
width: ${({ $width: o }) => o}rem;
|
|
6
6
|
border-radius: 0.96rem;
|
|
7
7
|
border: none;
|
|
8
8
|
padding: 0.96rem 0.64rem;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
position: relative;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: ${({ $selectedColor: o, disabled: e }) => e ? i.m500 : o};
|
|
12
|
+
cursor: ${({ disabled: o, $isLoading: e }) => o ? "not-allowed" : e ? "auto" : "pointer"};
|
|
11
13
|
|
|
12
14
|
${({ $isLoading: o }) => o && n`
|
|
13
15
|
pointer-events: none;
|
|
14
16
|
`};
|
|
15
17
|
|
|
16
|
-
${({ disabled: o, $isLoading:
|
|
18
|
+
${({ disabled: o, $isLoading: e }) => !(o || e) && n`
|
|
17
19
|
&:hover {
|
|
18
20
|
background-color: ${({ $hoverColor: t }) => t};
|
|
19
21
|
}
|
|
@@ -26,20 +28,22 @@ const d = e.button`
|
|
|
26
28
|
&:focus-visible {
|
|
27
29
|
outline: none;
|
|
28
30
|
}
|
|
29
|
-
`,
|
|
31
|
+
`, c = r.div`
|
|
30
32
|
font-size: ${({ $font: o }) => o}rem;
|
|
31
33
|
font-weight: 500;
|
|
32
34
|
max-width: 100%;
|
|
33
35
|
overflow: hidden;
|
|
34
36
|
color: ${({ $textColor: o }) => o};
|
|
35
|
-
|
|
37
|
+
opacity: ${({ $isLoading: o }) => o ? 0 : 1};
|
|
38
|
+
transition: opacity 0.3s ease;
|
|
39
|
+
`, m = r.div`
|
|
36
40
|
height: ${({ $height: o }) => o}rem;
|
|
37
41
|
width: ${({ $width: o }) => o}rem;
|
|
38
42
|
display: inline-block;
|
|
39
43
|
position: relative;
|
|
40
44
|
border-radius: 0.96rem;
|
|
41
45
|
|
|
42
|
-
${({ disabled: o, $isLoading:
|
|
46
|
+
${({ disabled: o, $isLoading: e }) => !(o || e) && n`
|
|
43
47
|
box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
|
|
44
48
|
transition:
|
|
45
49
|
transform 0.2s,
|
|
@@ -51,15 +55,19 @@ const d = e.button`
|
|
|
51
55
|
transform: translateY(-2px);
|
|
52
56
|
}
|
|
53
57
|
`};
|
|
54
|
-
`,
|
|
55
|
-
|
|
58
|
+
`, p = r.div`
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset: 0;
|
|
56
61
|
display: flex;
|
|
57
|
-
flex-direction: column;
|
|
58
62
|
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
opacity: ${({ $isLoading: o }) => o ? 1 : 0};
|
|
65
|
+
transition: opacity 0.3s ease;
|
|
66
|
+
pointer-events: none;
|
|
59
67
|
`;
|
|
60
68
|
export {
|
|
61
|
-
|
|
69
|
+
m as ButtonContainer,
|
|
62
70
|
d as ButtonWrapper,
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
c as Content,
|
|
72
|
+
p as SpinnerWrapper
|
|
65
73
|
};
|
|
@@ -1,94 +1,88 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import B from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import A from "
|
|
11
|
-
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as w } from "react";
|
|
3
|
+
import E from "../../Spinner/Spinner.js";
|
|
4
|
+
import { UploadBtnContainer as U, Wrapper as j, HiddenInput as M, SpinnerWrapper as S, ContentWrapper as B, PWrapper as F } from "./styles.js";
|
|
5
|
+
import H from "../../../colors/white.js";
|
|
6
|
+
import { blue as y } from "../../../colors/blue.js";
|
|
7
|
+
import P from "../../../colors/grey.js";
|
|
8
|
+
import Z from "../../../colors/colorMap.js";
|
|
9
|
+
import q from "../../Ripple/Ripple.js";
|
|
10
|
+
import { SIZE as A, MEDIUM as G } from "./constants.js";
|
|
11
|
+
import J from "../../Icons/Link/Link.js";
|
|
12
|
+
const L = ({ theme: t, children: l }) => /* @__PURE__ */ r(q, { rippleColor: t.m100, children: l }), tr = ({
|
|
12
13
|
label: t,
|
|
13
14
|
labelColor: l,
|
|
14
|
-
theme:
|
|
15
|
-
size:
|
|
16
|
-
width:
|
|
17
|
-
isLoading:
|
|
18
|
-
disabled:
|
|
19
|
-
prefixIcon:
|
|
20
|
-
suffixIcon:
|
|
15
|
+
theme: c = y,
|
|
16
|
+
size: C = G,
|
|
17
|
+
width: x,
|
|
18
|
+
isLoading: o,
|
|
19
|
+
disabled: e,
|
|
20
|
+
prefixIcon: m = J,
|
|
21
|
+
suffixIcon: s,
|
|
21
22
|
type: D = "file",
|
|
22
|
-
accept:
|
|
23
|
-
isMultiple:
|
|
24
|
-
onChange:
|
|
25
|
-
...
|
|
23
|
+
accept: z,
|
|
24
|
+
isMultiple: I,
|
|
25
|
+
onChange: R,
|
|
26
|
+
...k
|
|
26
27
|
}) => {
|
|
27
|
-
const
|
|
28
|
+
const f = w(null), { m400: K, m500: W, m600: g } = Z[c] ?? y, { height: h, width: v, font: n } = A[C] || {}, i = l || ["white", "yellow"].includes(c) ? P.m600 : H, a = w(0), $ = /* @__PURE__ */ d(
|
|
28
29
|
j,
|
|
29
30
|
{
|
|
30
31
|
$selectedColor: K,
|
|
31
|
-
$hoverColor:
|
|
32
|
-
$height:
|
|
33
|
-
$width:
|
|
34
|
-
$activeColor:
|
|
35
|
-
disabled:
|
|
36
|
-
$isLoading:
|
|
32
|
+
$hoverColor: W,
|
|
33
|
+
$height: h,
|
|
34
|
+
$width: x || v,
|
|
35
|
+
$activeColor: g,
|
|
36
|
+
disabled: e,
|
|
37
|
+
$isLoading: o,
|
|
37
38
|
tabIndex: 0,
|
|
38
|
-
"aria-disabled":
|
|
39
|
-
onKeyDown: (
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
|
|
39
|
+
"aria-disabled": e,
|
|
40
|
+
onKeyDown: (p) => {
|
|
41
|
+
if (p.key === "Enter" || p.key === " ") {
|
|
42
|
+
p.preventDefault();
|
|
43
|
+
const u = Date.now();
|
|
44
|
+
if (u - a.current < 500) {
|
|
45
|
+
p.stopPropagation();
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
a.current =
|
|
48
|
+
a.current = u, !e && !o && f.current?.click();
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ r(
|
|
52
53
|
M,
|
|
53
54
|
{
|
|
54
|
-
ref:
|
|
55
|
+
ref: f,
|
|
55
56
|
type: D,
|
|
56
|
-
accept:
|
|
57
|
-
multiple:
|
|
58
|
-
disabled:
|
|
59
|
-
onChange:
|
|
57
|
+
accept: z,
|
|
58
|
+
multiple: I,
|
|
59
|
+
disabled: e,
|
|
60
|
+
onChange: R,
|
|
60
61
|
tabIndex: -1
|
|
61
62
|
}
|
|
62
63
|
),
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ o
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
64
|
+
/* @__PURE__ */ r(S, { $isLoading: o, children: /* @__PURE__ */ r(E, { size: "small", color: i }) }),
|
|
65
|
+
/* @__PURE__ */ d(B, { $isLoading: o, children: [
|
|
66
|
+
m && /* @__PURE__ */ r(m, { color: i, size: n + 19 }),
|
|
67
|
+
/* @__PURE__ */ r(
|
|
68
|
+
F,
|
|
69
|
+
{
|
|
70
|
+
color: i,
|
|
71
|
+
size: `${n}rem`,
|
|
72
|
+
$prefixIcon: !!m,
|
|
73
|
+
$suffixIcon: !!s,
|
|
74
|
+
$iconSize: n + 19,
|
|
75
|
+
title: t,
|
|
76
|
+
children: t
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
s && /* @__PURE__ */ r(s, { color: i, size: n + 19 })
|
|
80
|
+
] })
|
|
77
81
|
]
|
|
78
82
|
}
|
|
79
83
|
);
|
|
80
|
-
return /* @__PURE__ */ o(
|
|
81
|
-
U,
|
|
82
|
-
{
|
|
83
|
-
$height: u,
|
|
84
|
-
$width: s || $,
|
|
85
|
-
disabled: r,
|
|
86
|
-
$isLoading: e,
|
|
87
|
-
...z,
|
|
88
|
-
children: e || r ? d : /* @__PURE__ */ o(G, { theme: p, children: d })
|
|
89
|
-
}
|
|
90
|
-
);
|
|
84
|
+
return /* @__PURE__ */ r(U, { $height: h, disabled: e, $isLoading: o, ...k, children: o || e ? $ : /* @__PURE__ */ r(L, { theme: c, children: $ }) });
|
|
91
85
|
};
|
|
92
86
|
export {
|
|
93
|
-
|
|
87
|
+
tr as default
|
|
94
88
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import r, { css as i } from "styled-components";
|
|
2
2
|
import n from "../../Typography/P/P.js";
|
|
3
3
|
import a from "../../../colors/grey.js";
|
|
4
|
-
const
|
|
4
|
+
const c = r.div`
|
|
5
5
|
height: ${({ $height: e }) => e}rem;
|
|
6
|
-
width: fit-content;
|
|
7
|
-
max-width: ${({ $width: e }) => e}rem;
|
|
8
6
|
display: inline-block;
|
|
9
7
|
position: relative;
|
|
10
8
|
border-radius: 0.96rem;
|
|
@@ -21,7 +19,7 @@ const l = r.div`
|
|
|
21
19
|
transform: translateY(-2px);
|
|
22
20
|
}
|
|
23
21
|
`};
|
|
24
|
-
`,
|
|
22
|
+
`, d = r.label`
|
|
25
23
|
height: ${({ $height: e }) => `${e}rem`};
|
|
26
24
|
width: ${({ $width: e }) => `${e}rem`};
|
|
27
25
|
border-radius: 0.96rem;
|
|
@@ -31,6 +29,8 @@ const l = r.div`
|
|
|
31
29
|
align-items: center;
|
|
32
30
|
gap: 0.8rem;
|
|
33
31
|
outline: none;
|
|
32
|
+
position: relative;
|
|
33
|
+
overflow: hidden;
|
|
34
34
|
background-color: ${({ $selectedColor: e, disabled: o }) => o ? a.m500 : e};
|
|
35
35
|
cursor: ${({ disabled: e, $isLoading: o }) => e ? "not-allowed" : o ? "auto" : "pointer"};
|
|
36
36
|
|
|
@@ -61,7 +61,24 @@ const l = r.div`
|
|
|
61
61
|
$iconSize: o
|
|
62
62
|
}) => e ? ` - ${o}px - 0.8rem` : ""}
|
|
63
63
|
);
|
|
64
|
-
`, h = r.
|
|
64
|
+
`, h = r.div`
|
|
65
|
+
position: absolute;
|
|
66
|
+
inset: 0;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
opacity: ${({ $isLoading: e }) => e ? 1 : 0};
|
|
71
|
+
transition: opacity 0.3s ease;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
`, $ = r.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 0.8rem;
|
|
77
|
+
flex: 1;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
opacity: ${({ $isLoading: e }) => e ? 0 : 1};
|
|
80
|
+
transition: opacity 0.3s ease;
|
|
81
|
+
`, w = r.input`
|
|
65
82
|
position: absolute;
|
|
66
83
|
width: 1px;
|
|
67
84
|
height: 1px;
|
|
@@ -73,8 +90,10 @@ const l = r.div`
|
|
|
73
90
|
pointer-events: none;
|
|
74
91
|
`;
|
|
75
92
|
export {
|
|
76
|
-
|
|
93
|
+
$ as ContentWrapper,
|
|
94
|
+
w as HiddenInput,
|
|
77
95
|
m as PWrapper,
|
|
78
|
-
|
|
79
|
-
c as
|
|
96
|
+
h as SpinnerWrapper,
|
|
97
|
+
c as UploadBtnContainer,
|
|
98
|
+
d as Wrapper
|
|
80
99
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"license": "ISC",
|
|
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
|
"types": "./index.d.ts",
|