meticulous-ui 2.2.9 → 2.3.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 +15 -14
- package/components/Icons/Link/index.js +4 -0
- package/components/Input/FileUploader/FileUploader.js +76 -0
- package/components/Input/FileUploader/constants.js +29 -0
- package/components/Input/FileUploader/index.js +4 -0
- package/components/Input/FileUploader/styles.js +83 -0
- package/index.js +22 -20
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -47,20 +47,21 @@ export default App;
|
|
|
47
47
|
|
|
48
48
|
## 📦 Components
|
|
49
49
|
|
|
50
|
-
| Component
|
|
51
|
-
|
|
|
52
|
-
| `Pagination`
|
|
53
|
-
| `Toast`
|
|
54
|
-
| `Timer`
|
|
55
|
-
| `OtpInput`
|
|
56
|
-
| `VideoPlayer`
|
|
57
|
-
| `Input`
|
|
58
|
-
| `Checkbox`
|
|
59
|
-
| `RadioGroup`
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
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
|
+
| `Checkbox` | Renders checkbox to let user give boolean value |
|
|
59
|
+
| `RadioGroup` | Renders radio options in a group to let user select |
|
|
60
|
+
| `FileUploader` | Renders a button type input from where user can upload |
|
|
61
|
+
| `Textarea` | Renders textarea box to let user enter description |
|
|
62
|
+
| `Dropdown` | Renders dropdown to select from options |
|
|
63
|
+
| `Spinner` | Renders a spinner to show the loading state |
|
|
64
|
+
| `Button` | Renders a button to click & take an action |
|
|
64
65
|
|
|
65
66
|
## 📦 Icon Components
|
|
66
67
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useRef as U } from "react";
|
|
3
|
+
import a from "../../../node_modules/lodash-es/get.js";
|
|
4
|
+
import { UploadBtnContainer as v, HiddenInput as M, Wrapper as W, PWrapper as g } from "./styles.js";
|
|
5
|
+
import y from "../../../colors/white.js";
|
|
6
|
+
import x from "../../../colors/blue.js";
|
|
7
|
+
import B from "../../Icons/Link/Link.js";
|
|
8
|
+
import D from "../../../colors/index.js";
|
|
9
|
+
import F from "../../Ripple/Ripple.js";
|
|
10
|
+
import { SIZE as H, MEDIUM as Z } from "./constants.js";
|
|
11
|
+
const q = ({ theme: t, children: r }) => /* @__PURE__ */ o.jsx(F, { rippleColor: t.m100, children: r }), X = ({
|
|
12
|
+
label: t,
|
|
13
|
+
labelColor: r = y,
|
|
14
|
+
theme: s = x,
|
|
15
|
+
size: j = Z,
|
|
16
|
+
width: c,
|
|
17
|
+
isLoading: i,
|
|
18
|
+
disabled: e,
|
|
19
|
+
prefixIcon: n = B,
|
|
20
|
+
suffixIcon: m,
|
|
21
|
+
type: d = "file",
|
|
22
|
+
accept: C,
|
|
23
|
+
isMultiple: R,
|
|
24
|
+
onChange: k
|
|
25
|
+
}) => {
|
|
26
|
+
const l = U(null), { m400: w, m500: z, m600: E } = a(D, s, x), { height: f, width: h, font: p } = H[j] || {}, I = () => {
|
|
27
|
+
var u;
|
|
28
|
+
!e && !i && ((u = l.current) == null || u.click());
|
|
29
|
+
}, $ = /* @__PURE__ */ o.jsxs(
|
|
30
|
+
W,
|
|
31
|
+
{
|
|
32
|
+
$selectedColor: w,
|
|
33
|
+
$hoverColor: z,
|
|
34
|
+
$height: f,
|
|
35
|
+
$width: c || h,
|
|
36
|
+
$activeColor: E,
|
|
37
|
+
disabled: e,
|
|
38
|
+
isLoading: i,
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: I,
|
|
41
|
+
children: [
|
|
42
|
+
n && /* @__PURE__ */ o.jsx(n, { color: r, size: p + 19 }),
|
|
43
|
+
/* @__PURE__ */ o.jsx(
|
|
44
|
+
g,
|
|
45
|
+
{
|
|
46
|
+
color: r,
|
|
47
|
+
size: `${p}rem`,
|
|
48
|
+
$prefixIcon: !!n,
|
|
49
|
+
$suffixIcon: !!m,
|
|
50
|
+
$iconSize: p + 19,
|
|
51
|
+
title: t,
|
|
52
|
+
children: t
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
m && /* @__PURE__ */ o.jsx(m, { color: r, size: p + 19 })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
return /* @__PURE__ */ o.jsxs(v, { $height: f, $width: c || h, disabled: e, $isLoading: i, children: [
|
|
60
|
+
/* @__PURE__ */ o.jsx(
|
|
61
|
+
M,
|
|
62
|
+
{
|
|
63
|
+
ref: l,
|
|
64
|
+
type: d,
|
|
65
|
+
accept: C,
|
|
66
|
+
multiple: R,
|
|
67
|
+
disabled: e,
|
|
68
|
+
onChange: k
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
i ? $ : /* @__PURE__ */ o.jsx(q, { theme: s, children: $ })
|
|
72
|
+
] });
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
X as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const t = "small", h = "medium", o = "large", e = "ex-large", i = {
|
|
2
|
+
[t]: {
|
|
3
|
+
height: 2.8,
|
|
4
|
+
width: 6.75,
|
|
5
|
+
font: 1
|
|
6
|
+
},
|
|
7
|
+
[h]: {
|
|
8
|
+
height: 3.2,
|
|
9
|
+
width: 7.5,
|
|
10
|
+
font: 1.2
|
|
11
|
+
},
|
|
12
|
+
[o]: {
|
|
13
|
+
height: 3.6,
|
|
14
|
+
width: 8.25,
|
|
15
|
+
font: 1.4
|
|
16
|
+
},
|
|
17
|
+
[e]: {
|
|
18
|
+
height: 4,
|
|
19
|
+
width: 9,
|
|
20
|
+
font: 1.6
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
e as EX_LARGE,
|
|
25
|
+
o as LARGE,
|
|
26
|
+
h as MEDIUM,
|
|
27
|
+
i as SIZE,
|
|
28
|
+
t as SMALL
|
|
29
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import e, { css as i } from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import n from "../../Typography/P/P.js";
|
|
3
|
+
import a from "../../../colors/grey.js";
|
|
4
|
+
const p = e.button`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 0.8rem;
|
|
8
|
+
padding: 0 0.8rem;
|
|
9
|
+
border-radius: 0.6rem;
|
|
10
|
+
border: none;
|
|
11
|
+
outline-offset: 2px;
|
|
12
|
+
background-color: ${({ $inner: o }) => o};
|
|
13
|
+
transition: background-color 0.2s ease;
|
|
14
|
+
height: ${({ $height: o }) => `${o}rem`};
|
|
15
|
+
width: ${({ $width: o }) => `${o}rem`};
|
|
16
|
+
background-color: ${({ $selectedColor: o, disabled: r }) => r ? a.m500 : o};
|
|
17
|
+
cursor: ${({ disabled: o, $isLoading: r }) => o ? "not-allowed" : r ? "auto" : "pointer"};
|
|
18
|
+
|
|
19
|
+
${({ $isLoading: o }) => o && i`
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
`};
|
|
22
|
+
|
|
23
|
+
${({ disabled: o, $isLoading: r }) => !(o || r) && i`
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: ${({ $hoverColor: t }) => t};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:active {
|
|
29
|
+
background-color: ${({ $activeColor: t }) => t};
|
|
30
|
+
}
|
|
31
|
+
`};
|
|
32
|
+
`, c = e.div`
|
|
33
|
+
height: ${({ $height: o }) => o}rem;
|
|
34
|
+
width: ${({ $width: o }) => o}rem;
|
|
35
|
+
display: inline-block;
|
|
36
|
+
position: relative;
|
|
37
|
+
border-radius: 0.8rem;
|
|
38
|
+
|
|
39
|
+
${({ disabled: o, $isLoading: r }) => !(o || r) && i`
|
|
40
|
+
box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
|
|
41
|
+
transition:
|
|
42
|
+
transform 0.2s,
|
|
43
|
+
box-shadow 0.2s;
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.3);
|
|
47
|
+
transform: translateY(-2px);
|
|
48
|
+
}
|
|
49
|
+
`};
|
|
50
|
+
`, m = e(n)`
|
|
51
|
+
color: ${({ color: o }) => o};
|
|
52
|
+
font-size: ${({ size: o }) => o};
|
|
53
|
+
margin: 0;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
width: calc(
|
|
58
|
+
100%
|
|
59
|
+
${({ $prefixIcon: o, $iconSize: r }) => o ? ` - ${r}px - 0.8rem` : ""}${({
|
|
60
|
+
$suffixIcon: o,
|
|
61
|
+
$iconSize: r
|
|
62
|
+
}) => o ? ` - ${r}px - 0.8rem` : ""}
|
|
63
|
+
);
|
|
64
|
+
`;
|
|
65
|
+
e.div`
|
|
66
|
+
width: 100%;
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
align-items: center;
|
|
70
|
+
`;
|
|
71
|
+
const $ = e.input`
|
|
72
|
+
position: absolute;
|
|
73
|
+
width: 0;
|
|
74
|
+
height: 0;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
`;
|
|
78
|
+
export {
|
|
79
|
+
$ as HiddenInput,
|
|
80
|
+
m as PWrapper,
|
|
81
|
+
c as UploadBtnContainer,
|
|
82
|
+
p as Wrapper
|
|
83
|
+
};
|
package/index.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as t } from "./components/Pagination/Pagination.js";
|
|
2
2
|
import { default as r } from "./components/Toast/Toast.js";
|
|
3
3
|
import { default as p } from "./components/Spinner/Spinner.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
4
|
+
import { default as u } from "./components/OtpInput/OtpInput.js";
|
|
5
|
+
import { default as s } from "./components/Dropdown/Dropdown.js";
|
|
6
6
|
import { default as m } from "./components/Button/Button.js";
|
|
7
|
-
import { default as
|
|
7
|
+
import { default as n } from "./components/Timer/Timer.js";
|
|
8
8
|
import { default as c } from "./components/VideoPlayer/VideoPlayer.js";
|
|
9
9
|
import { default as T } from "./components/Typography/P/P.js";
|
|
10
10
|
import { default as b } from "./components/Input/Input/Input.js";
|
|
11
11
|
import { default as h } from "./components/Input/Textarea/Textarea.js";
|
|
12
12
|
import { default as w } from "./components/Input/Checkbox/Checkbox.js";
|
|
13
13
|
import { default as B } from "./components/Input/RadioGroup/RadioGroup.js";
|
|
14
|
-
import { default as D } from "./
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
14
|
+
import { default as D } from "./components/Input/FileUploader/FileUploader.js";
|
|
15
|
+
import { default as G } from "./colors/index.js";
|
|
16
|
+
import { default as R } from "./utils/index.js";
|
|
17
|
+
import { default as U } from "./components/Icons/index.js";
|
|
17
18
|
import { default as j } from "./components/Typography/Headings/H1.js";
|
|
18
19
|
import { default as v } from "./components/Typography/Headings/H2.js";
|
|
19
20
|
import { default as A } from "./components/Typography/Headings/H3.js";
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
21
|
+
import { default as J } from "./components/Typography/Headings/H4.js";
|
|
22
|
+
import { default as L } from "./components/Typography/Headings/H5.js";
|
|
23
|
+
import { default as N } from "./components/Typography/Headings/H6.js";
|
|
23
24
|
export {
|
|
24
25
|
m as Button,
|
|
25
26
|
w as Checkbox,
|
|
26
|
-
|
|
27
|
+
s as Dropdown,
|
|
28
|
+
D as FileUploader,
|
|
27
29
|
j as H1,
|
|
28
30
|
v as H2,
|
|
29
31
|
A as H3,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
J as H4,
|
|
33
|
+
L as H5,
|
|
34
|
+
N as H6,
|
|
33
35
|
b as Input,
|
|
34
|
-
|
|
36
|
+
u as OtpInput,
|
|
35
37
|
T as P,
|
|
36
|
-
|
|
38
|
+
t as Pagination,
|
|
37
39
|
B as RadioGroup,
|
|
38
40
|
p as Spinner,
|
|
39
41
|
h as Textarea,
|
|
40
|
-
|
|
42
|
+
n as Timer,
|
|
41
43
|
r as Toast,
|
|
42
44
|
c as VideoPlayer,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
G as colors,
|
|
46
|
+
U as icons,
|
|
47
|
+
R as utils
|
|
46
48
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"button",
|
|
37
37
|
"input",
|
|
38
38
|
"textarea",
|
|
39
|
+
"checkbox",
|
|
40
|
+
"radio",
|
|
41
|
+
"file-uploader",
|
|
39
42
|
"notification",
|
|
40
43
|
"dropdown",
|
|
41
44
|
"spinner",
|