meticulous-ui 1.5.1 → 1.6.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/README.md
CHANGED
|
@@ -54,6 +54,7 @@ export default App;
|
|
|
54
54
|
| `Timer` | Renders analog / digital clock with alarm |
|
|
55
55
|
| `OtpInput` | Gives inputs to enter and edit OTP |
|
|
56
56
|
| `VideoPlayer` | Renders video with keyboard shortcuts |
|
|
57
|
+
| `Input` | Renders input box to let user enter input |
|
|
57
58
|
|
|
58
59
|
## 📦 Icon Components
|
|
59
60
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as F } from "react";
|
|
3
|
+
import { Wrapper as g, InputBox as B, Label as I, HelperText as $ } from "./styles.js";
|
|
4
|
+
import { getColor as b } from "./helpers.js";
|
|
5
|
+
const W = ({
|
|
6
|
+
label: n,
|
|
7
|
+
onChange: l,
|
|
8
|
+
value: r,
|
|
9
|
+
type: p,
|
|
10
|
+
hasError: e,
|
|
11
|
+
name: a = "input",
|
|
12
|
+
color: d = "blue",
|
|
13
|
+
size: i = "20",
|
|
14
|
+
disableAutoComplete: m,
|
|
15
|
+
helperText: u = "",
|
|
16
|
+
...f
|
|
17
|
+
}) => {
|
|
18
|
+
const [t, c] = F(!1), s = b(d), x = () => c(!0), h = () => c(!1), j = (C) => {
|
|
19
|
+
l(C);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ o.jsxs(g, { children: [
|
|
22
|
+
/* @__PURE__ */ o.jsx(
|
|
23
|
+
B,
|
|
24
|
+
{
|
|
25
|
+
type: p,
|
|
26
|
+
name: a,
|
|
27
|
+
hasError: e,
|
|
28
|
+
size: i,
|
|
29
|
+
value: r,
|
|
30
|
+
$isFocused: t,
|
|
31
|
+
$shade: s,
|
|
32
|
+
onFocus: x,
|
|
33
|
+
onBlur: h,
|
|
34
|
+
onChange: j,
|
|
35
|
+
autoComplete: m ? "off" : "on",
|
|
36
|
+
...f
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
n && /* @__PURE__ */ o.jsx(I, { hasError: e, $isFocused: t, $shade: s, value: r, children: n }),
|
|
40
|
+
u && /* @__PURE__ */ o.jsx($, { hasError: e, $isFocused: t, $shade: s, children: u })
|
|
41
|
+
] });
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
W as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import f from "../../../node_modules/lodash-es/get.js";
|
|
2
|
+
import l from "../../../colors/blue.js";
|
|
3
|
+
import t from "../../../colors/green.js";
|
|
4
|
+
import p from "../../../colors/red.js";
|
|
5
|
+
import n from "../../../colors/yellow.js";
|
|
6
|
+
import g from "../../../colors/orange.js";
|
|
7
|
+
import a from "../../../colors/black.js";
|
|
8
|
+
import r from "../../../colors/grey.js";
|
|
9
|
+
import u from "../../../colors/violet.js";
|
|
10
|
+
import y from "../../../colors/teal.js";
|
|
11
|
+
import b from "../../../colors/purple.js";
|
|
12
|
+
import c from "../../../colors/pink.js";
|
|
13
|
+
const k = {
|
|
14
|
+
blue: l.m500,
|
|
15
|
+
green: t.m500,
|
|
16
|
+
red: p.m500,
|
|
17
|
+
green: t.m500,
|
|
18
|
+
yellow: n.m500,
|
|
19
|
+
orange: g.m500,
|
|
20
|
+
black: a.m500,
|
|
21
|
+
grey: r.m500,
|
|
22
|
+
violet: u.m500,
|
|
23
|
+
teal: y.m500,
|
|
24
|
+
purple: b.m500,
|
|
25
|
+
pink: c.m500
|
|
26
|
+
}, E = (m) => f(k, m, r.m500), H = ({ hasError: m, $shade: i, $isFocused: o, value: e }) => m ? typeof e == "string" && !e && !o ? r.m500 : p.m400 : o ? i : r.m500;
|
|
27
|
+
export {
|
|
28
|
+
E as getColor,
|
|
29
|
+
H as getCssShade
|
|
30
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import e, { css as i } from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import n from "../../../colors/black.js";
|
|
3
|
+
import s from "../../../colors/red.js";
|
|
4
|
+
import { getCssShade as r } from "./helpers.js";
|
|
5
|
+
const d = e.input`
|
|
6
|
+
height: 3rem;
|
|
7
|
+
border-radius: 0.4rem;
|
|
8
|
+
font-size: 1.4rem;
|
|
9
|
+
border: 2px solid ${({ hasError: o }) => o ? s.m400 : n.m200};
|
|
10
|
+
padding: 0 0.6rem;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
transition: border-color 0.3s ease;
|
|
13
|
+
background-color: transparent !important;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
|
|
16
|
+
&:-webkit-autofill,
|
|
17
|
+
&:-webkit-autofill:hover,
|
|
18
|
+
&:-webkit-autofill:focus,
|
|
19
|
+
&:-webkit-autofill:active {
|
|
20
|
+
-webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
|
|
21
|
+
-webkit-text-fill-color: var(--input-text);
|
|
22
|
+
transition: background-color 9999s ease-in-out 0s;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:focus {
|
|
26
|
+
border: 2px solid
|
|
27
|
+
${({ $shade: o, hasError: t }) => r({ $shade: o, hasError: t, $isFocused: !0 })};
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
`, f = e.p`
|
|
31
|
+
margin-top: 0.4rem;
|
|
32
|
+
margin-left: 0.4rem;
|
|
33
|
+
font-size: 0.8rem;
|
|
34
|
+
color: ${r};
|
|
35
|
+
`, c = e.div`
|
|
36
|
+
position: relative;
|
|
37
|
+
`, u = e.div`
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: -0.4rem;
|
|
40
|
+
left: 0.5rem;
|
|
41
|
+
font-size: 0.8rem;
|
|
42
|
+
background-color: white;
|
|
43
|
+
padding: 0 0.4rem;
|
|
44
|
+
transition: 0.25s;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
color: ${r};
|
|
48
|
+
|
|
49
|
+
${({ $isFocused: o, value: t }) => o || t ? i`
|
|
50
|
+
top: -0.4rem;
|
|
51
|
+
left: 0.5rem;
|
|
52
|
+
` : i`
|
|
53
|
+
top: 0.8rem;
|
|
54
|
+
left: 0.5rem;
|
|
55
|
+
font-size: 1.4rem;
|
|
56
|
+
`}
|
|
57
|
+
`;
|
|
58
|
+
export {
|
|
59
|
+
f as HelperText,
|
|
60
|
+
d as InputBox,
|
|
61
|
+
u as Label,
|
|
62
|
+
c as Wrapper
|
|
63
|
+
};
|
package/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { default as a } from "./components/Pagination/Pagination.js";
|
|
2
2
|
import { default as e } from "./components/Toast/Toast.js";
|
|
3
3
|
import { default as s } from "./components/OtpInput/OtpInput.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as d } from "./
|
|
6
|
-
import { default as x } from "./
|
|
4
|
+
import { default as u } from "./components/Input/Input/Input.js";
|
|
5
|
+
import { default as d } from "./colors/index.js";
|
|
6
|
+
import { default as x } from "./utils/index.js";
|
|
7
|
+
import { default as i } from "./components/Icons/index.js";
|
|
7
8
|
export {
|
|
9
|
+
u as Input,
|
|
8
10
|
s as OtpInput,
|
|
9
11
|
a as Pagination,
|
|
10
12
|
e as Toast,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
d as colors,
|
|
14
|
+
i as icons,
|
|
15
|
+
x as utils
|
|
14
16
|
};
|