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