meticulous-ui 1.6.0 → 1.6.2
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,45 +1,69 @@
|
|
|
1
1
|
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import w from "../../../node_modules/lodash-es/omit.js";
|
|
3
|
+
import { useState as z } from "react";
|
|
4
|
+
import { Wrapper as H, InputBox as P, LeftIconWrapper as q, RightIconWrapper as A, Label as D, HelperText as G } from "./styles.js";
|
|
5
|
+
import { getColor as J, getIcon as I } from "./helpers.js";
|
|
6
|
+
import K from "../../../colors/white.js";
|
|
7
|
+
import M from "../../../colors/grey.js";
|
|
8
|
+
const Y = ({
|
|
9
|
+
label: t,
|
|
10
|
+
onChange: g,
|
|
11
|
+
value: n,
|
|
12
|
+
type: F,
|
|
10
13
|
hasError: e,
|
|
11
|
-
name:
|
|
12
|
-
color:
|
|
13
|
-
size:
|
|
14
|
-
disableAutoComplete:
|
|
15
|
-
helperText:
|
|
16
|
-
|
|
14
|
+
name: C = "input",
|
|
15
|
+
color: y = "blue",
|
|
16
|
+
size: B = "20",
|
|
17
|
+
disableAutoComplete: L,
|
|
18
|
+
helperText: m = "",
|
|
19
|
+
background: h = K,
|
|
20
|
+
leftIcon: f,
|
|
21
|
+
rightIcon: d,
|
|
22
|
+
...u
|
|
17
23
|
}) => {
|
|
18
|
-
const [
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ o.jsxs(
|
|
24
|
+
const [s, a] = z(!1), c = J(y), R = () => a(!0), W = () => a(!1), S = ($) => {
|
|
25
|
+
g($);
|
|
26
|
+
}, { placeholder: r } = u, x = { color: M.m500, size: 22 }, i = I(f), p = I(d), l = !!(f && i), j = !!(d && p);
|
|
27
|
+
return /* @__PURE__ */ o.jsxs(H, { children: [
|
|
22
28
|
/* @__PURE__ */ o.jsx(
|
|
23
|
-
|
|
29
|
+
P,
|
|
24
30
|
{
|
|
25
|
-
type:
|
|
26
|
-
name:
|
|
31
|
+
type: F,
|
|
32
|
+
name: C,
|
|
27
33
|
hasError: e,
|
|
28
|
-
size:
|
|
29
|
-
value:
|
|
30
|
-
$isFocused:
|
|
31
|
-
$shade:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
size: B,
|
|
35
|
+
value: n,
|
|
36
|
+
$isFocused: s,
|
|
37
|
+
$shade: c,
|
|
38
|
+
background: h,
|
|
39
|
+
hasLeftIcon: l,
|
|
40
|
+
hasRightIcon: j,
|
|
41
|
+
onFocus: R,
|
|
42
|
+
onBlur: W,
|
|
43
|
+
onChange: S,
|
|
44
|
+
autoComplete: L ? "off" : "on",
|
|
45
|
+
...w(u, "placeholder")
|
|
37
46
|
}
|
|
38
47
|
),
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
i && /* @__PURE__ */ o.jsx(q, { children: i(x) }),
|
|
49
|
+
p && /* @__PURE__ */ o.jsx(A, { children: p(x) }),
|
|
50
|
+
(t || r && !n) && /* @__PURE__ */ o.jsx(
|
|
51
|
+
D,
|
|
52
|
+
{
|
|
53
|
+
hasError: e,
|
|
54
|
+
$isFocused: s,
|
|
55
|
+
$shade: c,
|
|
56
|
+
value: n,
|
|
57
|
+
background: h,
|
|
58
|
+
hasLeftIcon: l,
|
|
59
|
+
hasRightIcon: j,
|
|
60
|
+
onlyPh: r && !t,
|
|
61
|
+
children: t || r
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
m && /* @__PURE__ */ o.jsx(G, { hasError: e, $isFocused: s, $shade: c, hasLeftIcon: l, children: m })
|
|
41
65
|
] });
|
|
42
66
|
};
|
|
43
67
|
export {
|
|
44
|
-
|
|
68
|
+
Y as default
|
|
45
69
|
};
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from "../../../node_modules/lodash-es/get.js";
|
|
2
2
|
import l from "../../../colors/blue.js";
|
|
3
|
-
import
|
|
3
|
+
import i from "../../../colors/green.js";
|
|
4
4
|
import p from "../../../colors/red.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import g from "../../../colors/yellow.js";
|
|
6
|
+
import u from "../../../colors/orange.js";
|
|
7
7
|
import a from "../../../colors/black.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import e from "../../../colors/grey.js";
|
|
9
|
+
import c from "../../../colors/violet.js";
|
|
10
|
+
import s from "../../../colors/teal.js";
|
|
11
|
+
import y from "../../../colors/purple.js";
|
|
12
|
+
import b from "../../../colors/pink.js";
|
|
13
|
+
import d from "../../Icons/index.js";
|
|
13
14
|
const k = {
|
|
14
15
|
blue: l.m500,
|
|
15
|
-
green:
|
|
16
|
+
green: i.m500,
|
|
16
17
|
red: p.m500,
|
|
17
|
-
green:
|
|
18
|
-
yellow:
|
|
19
|
-
orange:
|
|
18
|
+
green: i.m500,
|
|
19
|
+
yellow: g.m500,
|
|
20
|
+
orange: u.m500,
|
|
20
21
|
black: a.m500,
|
|
21
|
-
grey:
|
|
22
|
-
violet:
|
|
23
|
-
teal:
|
|
24
|
-
purple:
|
|
25
|
-
pink:
|
|
26
|
-
},
|
|
22
|
+
grey: e.m500,
|
|
23
|
+
violet: c.m500,
|
|
24
|
+
teal: s.m500,
|
|
25
|
+
purple: y.m500,
|
|
26
|
+
pink: b.m500
|
|
27
|
+
}, j = (r) => n(k, r, e.m500), q = ({ hasError: r, $shade: m, $isFocused: o, value: t, onlyPh: f }) => r ? typeof t == "string" && !t && !o ? e.m500 : p.m400 : o && !f ? m : e.m500, z = (r) => n(d, r, null), B = ({ hasLeftIcon: r, hasRightIcon: m }) => r && m ? "0 2.4rem" : r ? "0 0.6rem 0 2.4rem" : m ? "0 2.4rem 0 0.6rem" : "0 0.6rem";
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
j as getColor,
|
|
30
|
+
q as getCssShade,
|
|
31
|
+
z as getIcon,
|
|
32
|
+
B as getPadding
|
|
30
33
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import t, { css as n } from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import a from "../../../colors/black.js";
|
|
3
|
+
import l from "../../../colors/grey.js";
|
|
4
|
+
import m from "../../../colors/red.js";
|
|
5
|
+
import { getPadding as p, getCssShade as i } from "./helpers.js";
|
|
6
|
+
const g = t.input`
|
|
6
7
|
height: 3rem;
|
|
7
8
|
border-radius: 0.4rem;
|
|
8
9
|
font-size: 1.4rem;
|
|
9
|
-
border: 2px solid ${({ hasError: o }) => o ?
|
|
10
|
-
padding:
|
|
10
|
+
border: 2px solid ${({ hasError: o }) => o ? m.m400 : a.m200};
|
|
11
|
+
padding: ${p};
|
|
11
12
|
font-weight: 400;
|
|
12
13
|
transition: border-color 0.3s ease;
|
|
13
14
|
background-color: transparent !important;
|
|
@@ -22,42 +23,68 @@ const d = e.input`
|
|
|
22
23
|
transition: background-color 9999s ease-in-out 0s;
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
&::placeholder {
|
|
27
|
+
color: ${l.m500};
|
|
28
|
+
font-weight: 300;
|
|
29
|
+
font-size: 1.4rem;
|
|
30
|
+
background-color: ${({ background: o }) => o};
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
&:focus {
|
|
26
35
|
border: 2px solid
|
|
27
|
-
${({ $shade: o, hasError:
|
|
36
|
+
${({ $shade: o, hasError: e }) => i({ $shade: o, hasError: e, $isFocused: !0 })};
|
|
28
37
|
outline: none;
|
|
29
38
|
}
|
|
30
|
-
`,
|
|
39
|
+
`, h = t.p`
|
|
31
40
|
margin-top: 0.4rem;
|
|
32
41
|
margin-left: 0.4rem;
|
|
33
42
|
font-size: 0.8rem;
|
|
34
|
-
color: ${
|
|
35
|
-
`,
|
|
43
|
+
color: ${i};
|
|
44
|
+
`, v = t.div`
|
|
36
45
|
position: relative;
|
|
37
|
-
|
|
46
|
+
width: fit-content;
|
|
47
|
+
`, w = t.div`
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0.8rem;
|
|
50
|
+
left: 0.6rem;
|
|
51
|
+
`, $ = t.div`
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0.8rem;
|
|
54
|
+
right: 0.6rem;
|
|
55
|
+
`;
|
|
56
|
+
t.div`
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 100%;
|
|
59
|
+
`;
|
|
60
|
+
const k = t.div`
|
|
38
61
|
position: absolute;
|
|
39
62
|
top: -0.4rem;
|
|
40
63
|
left: 0.5rem;
|
|
41
64
|
font-size: 0.8rem;
|
|
42
|
-
background-color:
|
|
43
|
-
|
|
65
|
+
background-color: ${({ background: o }) => o};
|
|
66
|
+
margin: 0 0.4rem;
|
|
44
67
|
transition: 0.25s;
|
|
45
68
|
font-weight: 400;
|
|
46
69
|
pointer-events: none;
|
|
47
|
-
color: ${
|
|
70
|
+
color: ${i};
|
|
48
71
|
|
|
49
|
-
${({ $isFocused: o, value:
|
|
72
|
+
${({ $isFocused: o, value: e, onlyPh: s }) => !s && (o || e) ? n`
|
|
50
73
|
top: -0.4rem;
|
|
51
|
-
left: 0.
|
|
52
|
-
|
|
74
|
+
left: ${({ hasLeftIcon: r }) => r ? 2.2 : 0.5}rem;
|
|
75
|
+
padding: 0 0.4rem;
|
|
76
|
+
margin: 0;
|
|
77
|
+
` : n`
|
|
53
78
|
top: 0.8rem;
|
|
54
|
-
left: 0.
|
|
79
|
+
left: ${({ hasLeftIcon: r }) => r ? 2.2 : 0.5}rem;
|
|
55
80
|
font-size: 1.4rem;
|
|
56
81
|
`}
|
|
57
82
|
`;
|
|
58
83
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
84
|
+
h as HelperText,
|
|
85
|
+
g as InputBox,
|
|
86
|
+
k as Label,
|
|
87
|
+
w as LeftIconWrapper,
|
|
88
|
+
$ as RightIconWrapper,
|
|
89
|
+
v as Wrapper
|
|
63
90
|
};
|