meticulous-ui 1.7.3 → 1.8.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 +1 -0
- package/components/Button/Button.js +53 -0
- package/components/Button/constants.js +29 -0
- package/components/Button/index.js +4 -0
- package/components/Button/styles.js +60 -0
- package/components/Ripple/Ripple.js +19 -14
- package/index.js +10 -8
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ export default App;
|
|
|
57
57
|
| `Input` | Renders input box to let user enter input |
|
|
58
58
|
| `Dropdown` | Renders dropdown to select from options |
|
|
59
59
|
| `Spinner` | Renders a spinner to show the loading state |
|
|
60
|
+
| `Button` | Renders a button to click & take an action |
|
|
60
61
|
|
|
61
62
|
## 📦 Icon Components
|
|
62
63
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { j as o } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import x from "../../node_modules/lodash-es/get.js";
|
|
3
|
+
import C from "../Spinner/Spinner.js";
|
|
4
|
+
import $ from "../../colors/index.js";
|
|
5
|
+
import s from "../../colors/blue.js";
|
|
6
|
+
import { ButtonContainer as g, ButtonWrapper as j, SpinnerWrapper as u, Content as w } from "./styles.js";
|
|
7
|
+
import b from "../Ripple/Ripple.js";
|
|
8
|
+
import v from "../../colors/white.js";
|
|
9
|
+
import I from "../../colors/grey.js";
|
|
10
|
+
import { MEDIUM as B, SIZE as E } from "./constants.js";
|
|
11
|
+
const A = (t) => {
|
|
12
|
+
const {
|
|
13
|
+
children: d,
|
|
14
|
+
theme: r = s,
|
|
15
|
+
size: h = B,
|
|
16
|
+
width: i,
|
|
17
|
+
leftIcon: L,
|
|
18
|
+
rightIcon: S,
|
|
19
|
+
isLoading: e
|
|
20
|
+
} = t || {}, { m400: c, m500: p, m600: a } = x($, r, s), { height: n, width: l, font: f } = E[h] || {}, m = r !== "white" ? v : I.m600;
|
|
21
|
+
return /* @__PURE__ */ o.jsx(
|
|
22
|
+
g,
|
|
23
|
+
{
|
|
24
|
+
$height: n,
|
|
25
|
+
$width: i || l,
|
|
26
|
+
disabled: t.disabled,
|
|
27
|
+
$isLoading: e,
|
|
28
|
+
children: /* @__PURE__ */ o.jsx(b, { rippleColor: r.m100, children: /* @__PURE__ */ o.jsx(
|
|
29
|
+
j,
|
|
30
|
+
{
|
|
31
|
+
$hoverColor: p,
|
|
32
|
+
$activeColor: a,
|
|
33
|
+
$selectedColor: c,
|
|
34
|
+
$height: n,
|
|
35
|
+
$width: i || l,
|
|
36
|
+
disabled: t.disabled,
|
|
37
|
+
$isLoading: e,
|
|
38
|
+
children: e ? /* @__PURE__ */ o.jsx(u, { children: /* @__PURE__ */ o.jsx(C, { size: "small", color: m }) }) : /* @__PURE__ */ o.jsx(
|
|
39
|
+
w,
|
|
40
|
+
{
|
|
41
|
+
$textColor: m,
|
|
42
|
+
$font: f,
|
|
43
|
+
children: d
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
A as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const t = "small", h = "medium", o = "large", e = "ex-large", i = {
|
|
2
|
+
[t]: {
|
|
3
|
+
height: 2.8,
|
|
4
|
+
width: 5.25,
|
|
5
|
+
font: 1
|
|
6
|
+
},
|
|
7
|
+
[h]: {
|
|
8
|
+
height: 3.2,
|
|
9
|
+
width: 6,
|
|
10
|
+
font: 1.2
|
|
11
|
+
},
|
|
12
|
+
[o]: {
|
|
13
|
+
height: 3.6,
|
|
14
|
+
width: 6.75,
|
|
15
|
+
font: 1.4
|
|
16
|
+
},
|
|
17
|
+
[e]: {
|
|
18
|
+
height: 4,
|
|
19
|
+
width: 7.5,
|
|
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,60 @@
|
|
|
1
|
+
import e, { css as n } from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import i from "../../colors/grey.js";
|
|
3
|
+
const s = e.button`
|
|
4
|
+
height: ${({ $height: r }) => r}rem;
|
|
5
|
+
width: ${({ $width: r }) => r}rem;
|
|
6
|
+
border-radius: 0.6rem;
|
|
7
|
+
border: none;
|
|
8
|
+
padding: 0.6rem 0.4rem;
|
|
9
|
+
background-color: ${({ $selectedColor: r, disabled: o }) => o ? i.m500 : r};
|
|
10
|
+
cursor: ${({ disabled: r, $isLoading: o }) => r ? "not-allowed" : o ? "auto" : "pointer"};
|
|
11
|
+
|
|
12
|
+
${({ $isLoading: r }) => r && n`
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
`};
|
|
15
|
+
|
|
16
|
+
${({ disabled: r, $isLoading: o }) => !(r || o) && n`
|
|
17
|
+
&:hover {
|
|
18
|
+
background-color: ${({ $hoverColor: t }) => t};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:active {
|
|
22
|
+
background-color: ${({ $activeColor: t }) => t};
|
|
23
|
+
}
|
|
24
|
+
`};
|
|
25
|
+
`, m = e.div`
|
|
26
|
+
font-size: ${({ $font: r }) => r}rem;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
color: ${({ $textColor: r }) => r};
|
|
31
|
+
`, c = e.div`
|
|
32
|
+
height: ${({ $height: r }) => r}rem;
|
|
33
|
+
width: ${({ $width: r }) => r}rem;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
position: relative;
|
|
36
|
+
border-radius: 0.6rem;
|
|
37
|
+
|
|
38
|
+
${({ disabled: r, $isLoading: o }) => !(r || o) && n`
|
|
39
|
+
box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.2);
|
|
40
|
+
transition:
|
|
41
|
+
transform 0.2s,
|
|
42
|
+
box-shadow 0.2s;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.3);
|
|
46
|
+
transform: translateY(-2px);
|
|
47
|
+
}
|
|
48
|
+
`};
|
|
49
|
+
`, l = e.div`
|
|
50
|
+
width: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
align-items: center;
|
|
54
|
+
`;
|
|
55
|
+
export {
|
|
56
|
+
c as ButtonContainer,
|
|
57
|
+
s as ButtonWrapper,
|
|
58
|
+
m as Content,
|
|
59
|
+
l as SpinnerWrapper
|
|
60
|
+
};
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { j as f } from "../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useRef as u } from "react";
|
|
3
3
|
/* empty css */
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const y = ({
|
|
5
|
+
children: s,
|
|
6
|
+
rippleColor: c = "rgba(255, 255, 255, 0.3)",
|
|
7
|
+
className: l = "",
|
|
8
|
+
...p
|
|
9
|
+
}) => {
|
|
10
|
+
const o = u(null), a = (r) => {
|
|
11
|
+
const n = o.current;
|
|
7
12
|
if (!n) return;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
const t = document.createElement("span"), e = n.getBoundingClientRect(), i = Math.max(e.width, e.height), d = r.clientX - e.left - i / 2, m = r.clientY - e.top - i / 2;
|
|
14
|
+
t.style.width = t.style.height = `${i}px`, t.style.left = `${d}px`, t.style.top = `${m}px`, t.style.backgroundColor = c, t.classList.add("ripple-effect"), n.appendChild(t), t.addEventListener("animationend", () => {
|
|
15
|
+
t.remove();
|
|
16
|
+
});
|
|
12
17
|
};
|
|
13
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ f.jsx(
|
|
14
19
|
"div",
|
|
15
20
|
{
|
|
16
|
-
ref:
|
|
21
|
+
ref: o,
|
|
22
|
+
className: `ripple-container ${l}`,
|
|
17
23
|
onClick: a,
|
|
18
|
-
|
|
19
|
-
...c,
|
|
24
|
+
...p,
|
|
20
25
|
children: s
|
|
21
26
|
}
|
|
22
27
|
);
|
|
23
28
|
};
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
y as default
|
|
26
31
|
};
|
package/index.js
CHANGED
|
@@ -3,18 +3,20 @@ import { default as e } from "./components/Toast/Toast.js";
|
|
|
3
3
|
import { default as p } from "./components/Spinner/Spinner.js";
|
|
4
4
|
import { default as u } from "./components/OtpInput/OtpInput.js";
|
|
5
5
|
import { default as d } from "./components/Dropdown/Dropdown.js";
|
|
6
|
-
import { default as x } from "./components/
|
|
7
|
-
import { default as i } from "./
|
|
8
|
-
import { default as I } from "./
|
|
9
|
-
import { default as w } from "./
|
|
6
|
+
import { default as x } from "./components/Button/Button.js";
|
|
7
|
+
import { default as i } from "./components/Input/Input/Input.js";
|
|
8
|
+
import { default as I } from "./colors/index.js";
|
|
9
|
+
import { default as w } from "./utils/index.js";
|
|
10
|
+
import { default as D } from "./components/Icons/index.js";
|
|
10
11
|
export {
|
|
12
|
+
x as Button,
|
|
11
13
|
d as Dropdown,
|
|
12
|
-
|
|
14
|
+
i as Input,
|
|
13
15
|
u as OtpInput,
|
|
14
16
|
a as Pagination,
|
|
15
17
|
p as Spinner,
|
|
16
18
|
e as Toast,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
I as colors,
|
|
20
|
+
D as icons,
|
|
21
|
+
w as utils
|
|
20
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"components",
|
|
34
34
|
"pagination",
|
|
35
35
|
"toasts",
|
|
36
|
+
"button",
|
|
36
37
|
"input",
|
|
37
38
|
"notification",
|
|
38
39
|
"dropdown",
|