meticulous-ui 1.6.2 → 1.7.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.
- package/README.md +10 -8
- package/components/Dropdown/Dropdown.js +77 -0
- package/components/Dropdown/constants.js +5 -0
- package/components/Dropdown/index.js +4 -0
- package/components/Dropdown/styles.js +79 -0
- package/components/MenuItem/MenuItem.js +38 -0
- package/components/MenuItem/styles.js +26 -0
- package/components/Spinner/Spinner.js +25 -0
- package/components/Spinner/index.js +4 -0
- package/components/Spinner/styles.js +19 -0
- package/components/Typography/P/P.js +10 -0
- package/components/Typography/P/index.js +4 -0
- package/components/Typography/P/styles.js +11 -0
- package/index.js +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,14 +47,16 @@ export default App;
|
|
|
47
47
|
|
|
48
48
|
## 📦 Components
|
|
49
49
|
|
|
50
|
-
| Component | Description
|
|
51
|
-
| ------------- |
|
|
52
|
-
| `Pagination` | Fully responsive pagination component
|
|
53
|
-
| `Toast` | Push 4 types of notifications on screen
|
|
54
|
-
| `Timer` | Renders analog / digital clock with alarm
|
|
55
|
-
| `OtpInput` | Gives inputs to enter and edit OTP
|
|
56
|
-
| `VideoPlayer` | Renders video with keyboard shortcuts
|
|
57
|
-
| `Input` | Renders input box to let user enter input
|
|
50
|
+
| Component | Description |
|
|
51
|
+
| ------------- | ------------------------------------------- |
|
|
52
|
+
| `Pagination` | Fully responsive pagination component |
|
|
53
|
+
| `Toast` | Push 4 types of notifications on screen |
|
|
54
|
+
| `Timer` | Renders analog / digital clock with alarm |
|
|
55
|
+
| `OtpInput` | Gives inputs to enter and edit OTP |
|
|
56
|
+
| `VideoPlayer` | Renders video with keyboard shortcuts |
|
|
57
|
+
| `Input` | Renders input box to let user enter input |
|
|
58
|
+
| `Dropdown` | Renders dropdown to select from options |
|
|
59
|
+
| `Spinner` | Renders a spinner to show the loading state |
|
|
58
60
|
|
|
59
61
|
## 📦 Icon Components
|
|
60
62
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { j as o } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as a, useRef as h, useEffect as D, useLayoutEffect as k, createElement as y } from "react";
|
|
3
|
+
import z from "../../node_modules/lodash-es/get.js";
|
|
4
|
+
import p from "../../colors/grey.js";
|
|
5
|
+
import H from "../MenuItem/MenuItem.js";
|
|
6
|
+
import L from "../../colors/index.js";
|
|
7
|
+
import P from "../../colors/blue.js";
|
|
8
|
+
import I from "../Spinner/Spinner.js";
|
|
9
|
+
import { DropdownWrapper as M, Box as q, PWrapper as A, ChevronDownWrapper as F, OptionWrapper as G, SpinnerWrapper as J } from "./styles.js";
|
|
10
|
+
const oe = ({
|
|
11
|
+
options: l,
|
|
12
|
+
onChange: g,
|
|
13
|
+
value: r,
|
|
14
|
+
width: n = "20rem",
|
|
15
|
+
menuHeight: b = "20rem",
|
|
16
|
+
placeholder: x,
|
|
17
|
+
theme: $ = "blue",
|
|
18
|
+
isLoading: f,
|
|
19
|
+
isDisabled: w,
|
|
20
|
+
loaderColor: j
|
|
21
|
+
}) => {
|
|
22
|
+
const [i, c] = a(!1), [C, u] = a("bottom"), s = h(null), m = h(null), R = () => {
|
|
23
|
+
c((e) => !e);
|
|
24
|
+
}, O = (e) => {
|
|
25
|
+
e !== r && (g(e), c(!1));
|
|
26
|
+
};
|
|
27
|
+
D(() => {
|
|
28
|
+
const e = (t) => {
|
|
29
|
+
s.current && !s.current.contains(t.target) && c(!1);
|
|
30
|
+
};
|
|
31
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
32
|
+
}, []), k(() => {
|
|
33
|
+
if (i && m.current && s.current) {
|
|
34
|
+
const e = m.current.getBoundingClientRect(), t = s.current.getBoundingClientRect(), d = window.innerHeight - t.bottom;
|
|
35
|
+
d < e.height + 8 && t.top > d ? u("top") : u("bottom");
|
|
36
|
+
}
|
|
37
|
+
}, [i]);
|
|
38
|
+
const {
|
|
39
|
+
m50: E,
|
|
40
|
+
m100: S,
|
|
41
|
+
m200: W,
|
|
42
|
+
m500: v
|
|
43
|
+
} = z(L, $, P), B = ({ value: e, label: t }) => /* @__PURE__ */ y(
|
|
44
|
+
H,
|
|
45
|
+
{
|
|
46
|
+
value: e,
|
|
47
|
+
label: t,
|
|
48
|
+
onSelect: O,
|
|
49
|
+
isSelected: e === r,
|
|
50
|
+
key: e,
|
|
51
|
+
width: n,
|
|
52
|
+
selectedColor: W,
|
|
53
|
+
hoverColor: E,
|
|
54
|
+
activeColor: S
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
return /* @__PURE__ */ o.jsxs(
|
|
58
|
+
M,
|
|
59
|
+
{
|
|
60
|
+
ref: s,
|
|
61
|
+
$width: n,
|
|
62
|
+
$isLoading: f,
|
|
63
|
+
$isDisabled: w,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ o.jsxs(q, { $width: n, onClick: R, $isOpen: i, $border: v, children: [
|
|
66
|
+
/* @__PURE__ */ o.jsx(A, { $width: n, color: r ? p.m700 : p.m500, size: "1.2rem", children: r ? l.find(({ value: e }) => r === e)?.label : x }),
|
|
67
|
+
/* @__PURE__ */ o.jsx(F, { color: p.m500, size: 22, $isOpen: i })
|
|
68
|
+
] }),
|
|
69
|
+
i && /* @__PURE__ */ o.jsx(G, { ref: m, $width: n, $height: b, $top: C === "top", children: l.map(B) }),
|
|
70
|
+
f && /* @__PURE__ */ o.jsx(J, { children: /* @__PURE__ */ o.jsx(I, { size: "small", color: j }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
oe as default
|
|
77
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import o, { css as e, keyframes as i } from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import n from "../../colors/grey.js";
|
|
3
|
+
import p from "../Typography/P/P.js";
|
|
4
|
+
import m from "../Icons/ChevronDown/ChevronDown.js";
|
|
5
|
+
import { DEFAULT_BORDER as a } from "./constants.js";
|
|
6
|
+
import s from "../../colors/white.js";
|
|
7
|
+
const d = i`
|
|
8
|
+
from {
|
|
9
|
+
transform: rotate(0deg);
|
|
10
|
+
}
|
|
11
|
+
to {
|
|
12
|
+
transform: rotate(180deg);
|
|
13
|
+
}
|
|
14
|
+
`, $ = o.div`
|
|
15
|
+
max-width: ${({ $width: r }) => r};
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
${({ $isLoading: r }) => r && e`
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
opacity: 0.8;
|
|
21
|
+
`}
|
|
22
|
+
|
|
23
|
+
${({ $isDisabled: r }) => r && e`
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
`}
|
|
26
|
+
`, v = o.div`
|
|
27
|
+
height: 2rem;
|
|
28
|
+
width: ${({ $width: r }) => r};
|
|
29
|
+
border-radius: 0.6rem;
|
|
30
|
+
border: ${({ $isOpen: r, $border: t }) => r ? `2px solid ${t}` : `1px solid ${a}`};
|
|
31
|
+
padding: 0.4rem 0.6rem 0.4rem;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
`, g = o(p)`
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
max-width: calc(${({ $width: r }) => r} - 2rem);
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
`, u = o(m)`
|
|
43
|
+
${({ $isOpen: r }) => r && e`
|
|
44
|
+
animation: ${d} 0.2s linear;
|
|
45
|
+
`};
|
|
46
|
+
transform: rotate(${({ $isOpen: r }) => r ? 180 : 0}deg);
|
|
47
|
+
`, x = o.div`
|
|
48
|
+
border: 1px solid ${n.m900};
|
|
49
|
+
width: calc(${({ $width: r }) => r} + 1rem);
|
|
50
|
+
max-height: ${({ $height: r }) => r};
|
|
51
|
+
overflow: auto;
|
|
52
|
+
position: absolute;
|
|
53
|
+
z-index: 1000;
|
|
54
|
+
background-color: ${s};
|
|
55
|
+
|
|
56
|
+
${({ $top: r }) => r ? e`
|
|
57
|
+
bottom: 100%;
|
|
58
|
+
border-top-right-radius: 0.6rem;
|
|
59
|
+
border-top-left-radius: 0.6rem;
|
|
60
|
+
border-bottom-width: 0;
|
|
61
|
+
` : e`
|
|
62
|
+
top: 100%;
|
|
63
|
+
border-bottom-right-radius: 0.6rem;
|
|
64
|
+
border-bottom-left-radius: 0.6rem;
|
|
65
|
+
border-top-width: 0;
|
|
66
|
+
`}
|
|
67
|
+
`, y = o.div`
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0.7rem;
|
|
70
|
+
right: 1rem;
|
|
71
|
+
`;
|
|
72
|
+
export {
|
|
73
|
+
v as Box,
|
|
74
|
+
u as ChevronDownWrapper,
|
|
75
|
+
$ as DropdownWrapper,
|
|
76
|
+
x as OptionWrapper,
|
|
77
|
+
g as PWrapper,
|
|
78
|
+
y as SpinnerWrapper
|
|
79
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { j as m } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import i from "../../colors/grey.js";
|
|
3
|
+
import r from "../../colors/blue.js";
|
|
4
|
+
import $ from "../../colors/white.js";
|
|
5
|
+
import { Wrapper as h, PWrapper as u } from "./styles.js";
|
|
6
|
+
const w = ({
|
|
7
|
+
value: l,
|
|
8
|
+
label: o,
|
|
9
|
+
width: e = "20rem",
|
|
10
|
+
isSelected: t,
|
|
11
|
+
defaultColor: p = $,
|
|
12
|
+
selectedColor: c = r.m200,
|
|
13
|
+
hoverColor: n = r.m50,
|
|
14
|
+
activeColor: s = r.m100,
|
|
15
|
+
size: a = "1.2rem",
|
|
16
|
+
onSelect: d
|
|
17
|
+
}) => {
|
|
18
|
+
const f = () => {
|
|
19
|
+
d(l);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ m.jsx(
|
|
22
|
+
h,
|
|
23
|
+
{
|
|
24
|
+
$isSelected: t,
|
|
25
|
+
$width: e,
|
|
26
|
+
$defaultColor: p,
|
|
27
|
+
$selectedColor: c,
|
|
28
|
+
$hoverColor: n,
|
|
29
|
+
$activeColor: s,
|
|
30
|
+
onClick: f,
|
|
31
|
+
title: o,
|
|
32
|
+
children: /* @__PURE__ */ m.jsx(u, { size: a, color: t ? i.m700 : i.m500, $width: e, children: o })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
w as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import t from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import a from "../Typography/P/P.js";
|
|
3
|
+
const p = t.div`
|
|
4
|
+
width: ${({ $width: r }) => r};
|
|
5
|
+
background-color: ${({ $isSelected: r, $defaultColor: o, $selectedColor: e }) => r ? e : o};
|
|
6
|
+
cursor: ${({ $isSelected: r }) => r ? "auto" : "pointer"};
|
|
7
|
+
padding: 0.6rem 0 0.8rem 1rem;
|
|
8
|
+
margin-top: 0.1rem;
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
background-color: ${({ $isSelected: r, $hoverColor: o, $selectedColor: e }) => r ? e : o};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:active {
|
|
15
|
+
background-color: ${({ $isSelected: r, $activeColor: o, $selectedColor: e }) => r ? e : o};
|
|
16
|
+
}
|
|
17
|
+
`, d = t(a)`
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
max-width: calc(${({ $width: r }) => r} - 2rem);
|
|
22
|
+
`;
|
|
23
|
+
export {
|
|
24
|
+
d as PWrapper,
|
|
25
|
+
p as Wrapper
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as t } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import n from "../../node_modules/lodash-es/get.js";
|
|
3
|
+
import { SpinnerWrapper as p } from "./styles.js";
|
|
4
|
+
import i from "../../colors/index.js";
|
|
5
|
+
import l from "../../colors/green.js";
|
|
6
|
+
const s = {
|
|
7
|
+
small: {
|
|
8
|
+
$border: "0.25rem",
|
|
9
|
+
$length: "1rem"
|
|
10
|
+
},
|
|
11
|
+
medium: {
|
|
12
|
+
$border: "0.5rem",
|
|
13
|
+
$length: "2rem"
|
|
14
|
+
},
|
|
15
|
+
large: {
|
|
16
|
+
$border: "0.75rem",
|
|
17
|
+
$length: "3rem"
|
|
18
|
+
}
|
|
19
|
+
}, c = ({ color: r = "green", size: e = "medium" }) => {
|
|
20
|
+
const { $border: m, $length: o } = s[e];
|
|
21
|
+
return /* @__PURE__ */ t.jsx(p, { $color: n(i, r, l)?.m500, $border: m, $length: o });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
c as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import o, { keyframes as e } from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
const i = e`
|
|
3
|
+
0% {
|
|
4
|
+
transform: rotate(0deg);
|
|
5
|
+
}
|
|
6
|
+
100% {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
`, a = o.div`
|
|
10
|
+
border: ${({ $border: r }) => r} solid #f3f3f3;
|
|
11
|
+
border-top: ${({ $border: r, $color: t }) => `${r} solid ${t}`};
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
width: ${({ $length: r }) => r};
|
|
14
|
+
height: ${({ $length: r }) => r};
|
|
15
|
+
animation: ${i} 1s linear infinite;
|
|
16
|
+
`;
|
|
17
|
+
export {
|
|
18
|
+
a as SpinnerWrapper
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as i } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { PWrapper as s } from "./styles.js";
|
|
3
|
+
import m from "../../../node_modules/lodash-es/omit.js";
|
|
4
|
+
const p = (o) => {
|
|
5
|
+
const { color: r, size: t, children: e } = o || {};
|
|
6
|
+
return /* @__PURE__ */ i.jsx(s, { $color: r, $size: t, ...m(o, ["color", "size", "children"]), children: e });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
p as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import r from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import t from "../../../colors/black.js";
|
|
3
|
+
const e = r.p`
|
|
4
|
+
font-size: ${({ $size: o }) => o || "1.2rem"};
|
|
5
|
+
color: ${({ $color: o }) => o || t};
|
|
6
|
+
margin: 0;
|
|
7
|
+
height: auto;
|
|
8
|
+
`;
|
|
9
|
+
export {
|
|
10
|
+
e as PWrapper
|
|
11
|
+
};
|
package/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { default as a } from "./components/Pagination/Pagination.js";
|
|
2
2
|
import { default as e } from "./components/Toast/Toast.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as u } from "./components/
|
|
5
|
-
import { default as d } from "./
|
|
6
|
-
import { default as x } from "./
|
|
7
|
-
import { default as i } from "./
|
|
3
|
+
import { default as p } from "./components/Spinner/Spinner.js";
|
|
4
|
+
import { default as u } from "./components/OtpInput/OtpInput.js";
|
|
5
|
+
import { default as d } from "./components/Dropdown/Dropdown.js";
|
|
6
|
+
import { default as x } from "./components/Input/Input/Input.js";
|
|
7
|
+
import { default as i } from "./colors/index.js";
|
|
8
|
+
import { default as I } from "./utils/index.js";
|
|
9
|
+
import { default as w } from "./components/Icons/index.js";
|
|
8
10
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
d as Dropdown,
|
|
12
|
+
x as Input,
|
|
13
|
+
u as OtpInput,
|
|
11
14
|
a as Pagination,
|
|
15
|
+
p as Spinner,
|
|
12
16
|
e as Toast,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
i as colors,
|
|
18
|
+
w as icons,
|
|
19
|
+
I as utils
|
|
16
20
|
};
|