meticulous-ui 2.5.6 → 2.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 +32 -19
- package/components/Button/Button.js +32 -33
- package/components/Dropdown/Dropdown.js +32 -33
- package/components/Input/Checkbox/Checkbox.js +38 -39
- package/components/Input/Checkbox/helpers.js +21 -22
- package/components/Input/FileUploader/FileUploader.js +18 -19
- package/components/Input/Input/Input.js +37 -37
- package/components/Input/Input/helpers.js +26 -27
- package/components/Input/Radio/Radio.js +15 -16
- package/components/Input/Textarea/Textarea.js +38 -38
- package/components/Input/Textarea/helpers.js +20 -21
- package/components/Loader/Loader.js +10 -11
- package/components/Loader/helpers.js +21 -22
- package/components/PageLoader/PageLoader.js +10 -11
- package/components/Pagination/Pagination.js +50 -52
- package/components/Selectbox/Selectbox.js +30 -31
- package/components/Shimmer/Shimmer.js +7 -18
- package/components/Shimmer/styles.js +29 -0
- package/components/Spinner/Spinner.js +14 -15
- package/components/Timer/Timer.js +19 -19
- package/components/Toast/Toast.js +26 -34
- package/components/Typography/P/P.js +3 -7
- package/package.json +9 -4
- package/utils/hasEqualProps.js +6 -4
package/README.md
CHANGED
|
@@ -2,47 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
A lightweight, modern React component library, following Semantic HTML & ARIA, designed for elegance and precision ✨
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/meticulous-ui)
|
|
6
|
+
[](https://www.npmjs.com/package/meticulous-ui)
|
|
7
|
+
[](https://github.com/xe3110/meticulous-ui/blob/main/LICENSE)
|
|
8
|
+
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
## 🚀 Demo
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
[meticulous-ui.vercel.app](https://meticulous-ui.vercel.app/)
|
|
10
14
|
|
|
11
15
|
## 🚀 Installation
|
|
12
16
|
|
|
13
|
-
```
|
|
17
|
+
```bash
|
|
14
18
|
npm install meticulous-ui
|
|
19
|
+
# or
|
|
20
|
+
yarn add meticulous-ui
|
|
15
21
|
```
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
**Peer dependencies** — install these if you haven't already:
|
|
18
24
|
|
|
19
|
-
```
|
|
20
|
-
|
|
25
|
+
```bash
|
|
26
|
+
npm install react react-dom styled-components
|
|
21
27
|
```
|
|
22
28
|
|
|
23
|
-
## 🧩
|
|
29
|
+
## 🧩 Quick Start
|
|
24
30
|
|
|
25
31
|
```jsx
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
import Pagination from 'meticulous-ui/components/Pagination';
|
|
29
|
-
import ChevronLeft from 'meticulous-ui/components/Icons/ChevronLeft';
|
|
32
|
+
import { Button, Input, Shimmer, Toast } from 'meticulous-ui';
|
|
30
33
|
import blue from 'meticulous-ui/colors/blue';
|
|
31
|
-
import capFirstLetter from 'meticulous-ui/utils/capFirstLetter';
|
|
32
34
|
|
|
33
35
|
function App() {
|
|
34
|
-
const [pageNumber, setPageNumber] = useState(1);
|
|
35
|
-
|
|
36
36
|
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
<>
|
|
38
|
+
{/* Loading skeleton */}
|
|
39
|
+
<Shimmer width={200} height={20} />
|
|
40
|
+
|
|
41
|
+
{/* Themed button */}
|
|
42
|
+
<Button theme={blue} onClick={() => console.log('clicked')}>
|
|
43
|
+
Submit
|
|
44
|
+
</Button>
|
|
45
|
+
|
|
46
|
+
{/* Controlled input */}
|
|
47
|
+
<Input label='Email' color='blue' value={email} onChange={handleChange} />
|
|
48
|
+
</>
|
|
42
49
|
);
|
|
43
50
|
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or import directly from the component path for the smallest bundle:
|
|
44
54
|
|
|
45
|
-
|
|
55
|
+
```js
|
|
56
|
+
import Button from 'meticulous-ui/components/Button';
|
|
57
|
+
import blue from 'meticulous-ui/colors/blue';
|
|
46
58
|
```
|
|
47
59
|
|
|
48
60
|
## 📦 Components
|
|
@@ -65,6 +77,7 @@ export default App;
|
|
|
65
77
|
| `Loader` | Renders a loader with dots to show the loading state |
|
|
66
78
|
| `PageLoader` | Renders a loader with line at the top of page |
|
|
67
79
|
| `Button` | Renders a button to click & take an action |
|
|
80
|
+
| `Shimmer` | Animated skeleton loading placeholder |
|
|
68
81
|
|
|
69
82
|
## 📦 Icon Components
|
|
70
83
|
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as x } from "react";
|
|
3
|
-
import D from "
|
|
4
|
-
import I from "
|
|
5
|
-
import R from "../../colors/index.js";
|
|
3
|
+
import D from "../Spinner/Spinner.js";
|
|
4
|
+
import I from "../../colors/index.js";
|
|
6
5
|
import u from "../../colors/blue.js";
|
|
7
|
-
import { ButtonWrapper as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { MEDIUM as
|
|
12
|
-
const
|
|
6
|
+
import { ButtonWrapper as R, SpinnerWrapper as B, Content as E, ButtonContainer as L } from "./styles.js";
|
|
7
|
+
import S from "../Ripple/Ripple.js";
|
|
8
|
+
import k from "../../colors/white.js";
|
|
9
|
+
import z from "../../colors/grey.js";
|
|
10
|
+
import { MEDIUM as K, SIZE as M } from "./constants.js";
|
|
11
|
+
const P = ({ theme: t, children: i }) => /* @__PURE__ */ o(S, { rippleColor: t.m100, children: i }), Q = (t) => {
|
|
13
12
|
const {
|
|
14
13
|
children: i,
|
|
15
14
|
theme: n = u,
|
|
16
|
-
size: C =
|
|
17
|
-
width:
|
|
18
|
-
leftIcon:
|
|
19
|
-
rightIcon:
|
|
20
|
-
isLoading:
|
|
21
|
-
textColor:
|
|
15
|
+
size: C = K,
|
|
16
|
+
width: d,
|
|
17
|
+
leftIcon: W,
|
|
18
|
+
rightIcon: j,
|
|
19
|
+
isLoading: r,
|
|
20
|
+
textColor: s,
|
|
22
21
|
onKeyDown: l,
|
|
23
22
|
...w
|
|
24
|
-
} = t || {},
|
|
25
|
-
if (
|
|
23
|
+
} = t || {}, m = x(0), $ = (e) => {
|
|
24
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
26
25
|
const f = Date.now();
|
|
27
|
-
if (f -
|
|
28
|
-
|
|
26
|
+
if (f - m.current < 500) {
|
|
27
|
+
e.preventDefault(), e.stopPropagation();
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
m.current = f;
|
|
32
31
|
}
|
|
33
|
-
l == null || l(
|
|
34
|
-
}, { m400: g, m500: b, m600: y } =
|
|
35
|
-
|
|
32
|
+
l == null || l(e);
|
|
33
|
+
}, { m400: g, m500: b, m600: y } = I[n] ?? u, { height: c, width: h, font: v } = M[C] || {}, p = ["white", "yellow"].includes(n) ? z.m600 : k, a = /* @__PURE__ */ o(
|
|
34
|
+
R,
|
|
36
35
|
{
|
|
37
36
|
...w,
|
|
38
37
|
onKeyDown: $,
|
|
@@ -40,13 +39,13 @@ const W = ({ theme: t, children: i }) => /* @__PURE__ */ o(k, { rippleColor: t.m
|
|
|
40
39
|
$activeColor: y,
|
|
41
40
|
$selectedColor: g,
|
|
42
41
|
$height: c,
|
|
43
|
-
$width:
|
|
42
|
+
$width: d || h,
|
|
44
43
|
disabled: t.disabled,
|
|
45
|
-
$isLoading:
|
|
46
|
-
children:
|
|
47
|
-
|
|
44
|
+
$isLoading: r,
|
|
45
|
+
children: r ? /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(D, { size: "medium", color: s || p }) }) : /* @__PURE__ */ o(
|
|
46
|
+
E,
|
|
48
47
|
{
|
|
49
|
-
$textColor:
|
|
48
|
+
$textColor: s || p,
|
|
50
49
|
$font: v,
|
|
51
50
|
children: i
|
|
52
51
|
}
|
|
@@ -54,16 +53,16 @@ const W = ({ theme: t, children: i }) => /* @__PURE__ */ o(k, { rippleColor: t.m
|
|
|
54
53
|
}
|
|
55
54
|
);
|
|
56
55
|
return /* @__PURE__ */ o(
|
|
57
|
-
|
|
56
|
+
L,
|
|
58
57
|
{
|
|
59
58
|
$height: c,
|
|
60
|
-
$width:
|
|
59
|
+
$width: d || h,
|
|
61
60
|
disabled: t.disabled,
|
|
62
|
-
$isLoading:
|
|
63
|
-
children:
|
|
61
|
+
$isLoading: r,
|
|
62
|
+
children: r ? a : /* @__PURE__ */ o(P, { theme: n, children: a })
|
|
64
63
|
}
|
|
65
64
|
);
|
|
66
65
|
};
|
|
67
66
|
export {
|
|
68
|
-
|
|
67
|
+
Q as default
|
|
69
68
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsxs as C, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as $, useId as ie, useRef as v, useMemo as le, useEffect as h, useLayoutEffect as ae, useCallback as ue, createElement as fe } from "react";
|
|
3
|
-
import de from "lodash-es/get";
|
|
4
3
|
import E from "../../colors/grey.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import de from "../MenuItem/MenuItem.js";
|
|
5
|
+
import pe from "../../colors/index.js";
|
|
6
|
+
import me from "../../colors/blue.js";
|
|
8
7
|
import K from "../Spinner/Spinner.js";
|
|
9
|
-
import { DropdownWrapper as
|
|
10
|
-
const
|
|
8
|
+
import { DropdownWrapper as he, Box as be, PWrapper as we, ChevronDownWrapper as xe, OptionWrapper as ge, SearchContainer as Ie, SearchIcon as ke, SearchInput as Se, OptionsList as Ce, LoadMoreSentinel as $e, SpinnerWrapper as ve } from "./styles.js";
|
|
9
|
+
const ye = (n) => {
|
|
11
10
|
if (typeof n != "string") return n;
|
|
12
11
|
if (n.endsWith("px")) return parseFloat(n);
|
|
13
12
|
if (n.endsWith("rem")) {
|
|
@@ -15,7 +14,7 @@ const Ee = (n) => {
|
|
|
15
14
|
return O * s;
|
|
16
15
|
}
|
|
17
16
|
return parseFloat(n);
|
|
18
|
-
},
|
|
17
|
+
}, Pe = ({
|
|
19
18
|
options: n,
|
|
20
19
|
onChange: O,
|
|
21
20
|
value: s,
|
|
@@ -33,7 +32,7 @@ const Ee = (n) => {
|
|
|
33
32
|
searchPh: R = "Search..."
|
|
34
33
|
}) => {
|
|
35
34
|
var j;
|
|
36
|
-
const [r, d] = $(!1), [q, W] = $(!1), [N, T] = $("bottom"), [k, A] = $(""), [i, p] = $(-1), y = ie(), m = v(null), S = v(null), D = v(null), B = v(null),
|
|
35
|
+
const [r, d] = $(!1), [q, W] = $(!1), [N, T] = $("bottom"), [k, A] = $(""), [i, p] = $(-1), y = ie(), m = v(null), S = v(null), D = v(null), B = v(null), G = v(!0), J = () => !w && !x && d((e) => !e), P = (e) => {
|
|
37
36
|
e !== s && (O(e), d(!1));
|
|
38
37
|
}, l = le(() => {
|
|
39
38
|
if (!g || !k.trim()) return n;
|
|
@@ -62,7 +61,7 @@ const Ee = (n) => {
|
|
|
62
61
|
}, [i, r]), h(() => {
|
|
63
62
|
r && g && D.current && D.current.focus();
|
|
64
63
|
}, [r, g]), h(() => {
|
|
65
|
-
r || (
|
|
64
|
+
r || (G.current = !0);
|
|
66
65
|
}, [r]), h(() => {
|
|
67
66
|
const e = (t) => {
|
|
68
67
|
m.current && !m.current.contains(t.target) && d(!1);
|
|
@@ -70,27 +69,27 @@ const Ee = (n) => {
|
|
|
70
69
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
71
70
|
}, []), ae(() => {
|
|
72
71
|
if (r && S.current && m.current) {
|
|
73
|
-
const e = m.current.getBoundingClientRect(), t = window.innerHeight, o =
|
|
72
|
+
const e = m.current.getBoundingClientRect(), t = window.innerHeight, o = ye(F), a = t - e.bottom;
|
|
74
73
|
T(
|
|
75
74
|
a < o + 8 && e.top > a ? "top" : "bottom"
|
|
76
75
|
);
|
|
77
76
|
}
|
|
78
77
|
}, [r, F]);
|
|
79
|
-
const
|
|
78
|
+
const X = (e) => {
|
|
80
79
|
let t = e + 1;
|
|
81
80
|
for (; t < l.length; ) {
|
|
82
81
|
if (!l[t].disabled) return t;
|
|
83
82
|
t++;
|
|
84
83
|
}
|
|
85
84
|
return e;
|
|
86
|
-
},
|
|
85
|
+
}, Y = (e) => {
|
|
87
86
|
let t = e - 1;
|
|
88
87
|
for (; t >= 0; ) {
|
|
89
88
|
if (!l[t].disabled) return t;
|
|
90
89
|
t--;
|
|
91
90
|
}
|
|
92
91
|
return e;
|
|
93
|
-
},
|
|
92
|
+
}, Z = (e) => {
|
|
94
93
|
if (!(w || x)) {
|
|
95
94
|
if (!r) {
|
|
96
95
|
(e.key === " " || e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), d(!0));
|
|
@@ -99,11 +98,11 @@ const Ee = (n) => {
|
|
|
99
98
|
switch (e.key) {
|
|
100
99
|
case "ArrowDown":
|
|
101
100
|
e.preventDefault();
|
|
102
|
-
const t =
|
|
101
|
+
const t = X(i);
|
|
103
102
|
t === i && I && !f && (c == null || c()), p(t);
|
|
104
103
|
break;
|
|
105
104
|
case "ArrowUp":
|
|
106
|
-
e.preventDefault(), p((a) =>
|
|
105
|
+
e.preventDefault(), p((a) => Y(a));
|
|
107
106
|
break;
|
|
108
107
|
case "Enter":
|
|
109
108
|
e.preventDefault();
|
|
@@ -136,12 +135,12 @@ const Ee = (n) => {
|
|
|
136
135
|
return t.observe(e), () => t.disconnect();
|
|
137
136
|
}, [H, c, I, f]);
|
|
138
137
|
const {
|
|
139
|
-
m50:
|
|
138
|
+
m50: _,
|
|
140
139
|
m100: L,
|
|
141
140
|
m200: M,
|
|
142
141
|
m500: ee
|
|
143
|
-
} =
|
|
144
|
-
|
|
142
|
+
} = pe[U] ?? me, te = (e, t) => () => !e && p(t), V = (e) => `${y}-opt-${e}`, re = ({ value: e, label: t, disabled: o }, a) => /* @__PURE__ */ fe(
|
|
143
|
+
de,
|
|
145
144
|
{
|
|
146
145
|
value: e,
|
|
147
146
|
label: t,
|
|
@@ -154,7 +153,7 @@ const Ee = (n) => {
|
|
|
154
153
|
id: V(a),
|
|
155
154
|
width: b,
|
|
156
155
|
selectedColor: M,
|
|
157
|
-
hoverColor:
|
|
156
|
+
hoverColor: _,
|
|
158
157
|
activeColor: L
|
|
159
158
|
}
|
|
160
159
|
), ne = (e) => () => {
|
|
@@ -168,12 +167,12 @@ const Ee = (n) => {
|
|
|
168
167
|
e.stopPropagation();
|
|
169
168
|
};
|
|
170
169
|
return /* @__PURE__ */ C(
|
|
171
|
-
|
|
170
|
+
he,
|
|
172
171
|
{
|
|
173
172
|
ref: m,
|
|
174
173
|
$width: b,
|
|
175
174
|
tabIndex: x || w ? -1 : 0,
|
|
176
|
-
onKeyDown:
|
|
175
|
+
onKeyDown: Z,
|
|
177
176
|
$isLoading: w,
|
|
178
177
|
$isDisabled: x,
|
|
179
178
|
role: "combobox",
|
|
@@ -186,24 +185,24 @@ const Ee = (n) => {
|
|
|
186
185
|
onBlur: oe,
|
|
187
186
|
children: [
|
|
188
187
|
/* @__PURE__ */ C(
|
|
189
|
-
|
|
188
|
+
be,
|
|
190
189
|
{
|
|
191
190
|
$width: b,
|
|
192
|
-
onClick:
|
|
191
|
+
onClick: J,
|
|
193
192
|
$isOpen: r,
|
|
194
193
|
$border: ee,
|
|
195
194
|
$isFocused: q && !r,
|
|
196
195
|
children: [
|
|
197
|
-
/* @__PURE__ */ u(
|
|
198
|
-
/* @__PURE__ */ u(
|
|
196
|
+
/* @__PURE__ */ u(we, { $width: b, color: s ? E.m700 : E.m500, size: "1.2rem", children: s ? (j = n.find(({ value: e }) => s === e)) == null ? void 0 : j.label : Q }),
|
|
197
|
+
/* @__PURE__ */ u(xe, { color: E.m500, size: 22, $isOpen: r, "aria-hidden": !0 })
|
|
199
198
|
]
|
|
200
199
|
}
|
|
201
200
|
),
|
|
202
|
-
/* @__PURE__ */ C(
|
|
203
|
-
g && /* @__PURE__ */ C(
|
|
204
|
-
/* @__PURE__ */ u(
|
|
201
|
+
/* @__PURE__ */ C(ge, { $isOpen: r, $width: b, $height: F, $top: N === "top", children: [
|
|
202
|
+
g && /* @__PURE__ */ C(Ie, { onClick: ce, children: [
|
|
203
|
+
/* @__PURE__ */ u(ke, { size: 20, color: E.m600, "aria-hidden": !0 }),
|
|
205
204
|
/* @__PURE__ */ u(
|
|
206
|
-
|
|
205
|
+
Se,
|
|
207
206
|
{
|
|
208
207
|
ref: D,
|
|
209
208
|
value: k,
|
|
@@ -218,16 +217,16 @@ const Ee = (n) => {
|
|
|
218
217
|
}
|
|
219
218
|
)
|
|
220
219
|
] }),
|
|
221
|
-
/* @__PURE__ */ C(
|
|
220
|
+
/* @__PURE__ */ C(Ce, { ref: S, role: "listbox", id: y, tabIndex: -1, children: [
|
|
222
221
|
l.map(re),
|
|
223
|
-
c && /* @__PURE__ */ u(
|
|
222
|
+
c && /* @__PURE__ */ u($e, { ref: B, children: f && /* @__PURE__ */ u(K, { size: "small", color: z }) })
|
|
224
223
|
] })
|
|
225
224
|
] }),
|
|
226
|
-
w && /* @__PURE__ */ u(
|
|
225
|
+
w && /* @__PURE__ */ u(ve, { children: /* @__PURE__ */ u(K, { size: "small", color: z }) })
|
|
227
226
|
]
|
|
228
227
|
}
|
|
229
228
|
);
|
|
230
229
|
};
|
|
231
230
|
export {
|
|
232
|
-
|
|
231
|
+
Pe as default
|
|
233
232
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { jsxs as D, jsx as
|
|
2
|
-
import { useState as $, useRef as
|
|
3
|
-
import
|
|
4
|
-
import P from "
|
|
5
|
-
import j from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
value: r,
|
|
1
|
+
import { jsxs as D, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useRef as g } from "react";
|
|
3
|
+
import H from "../../../colors/grey.js";
|
|
4
|
+
import P from "../../Typography/P/P.js";
|
|
5
|
+
import j from "../../../colors/white.js";
|
|
6
|
+
import m from "../../../colors/blue.js";
|
|
7
|
+
import { Wrapper as z, CbInput as B, Box as C } from "./styles.js";
|
|
8
|
+
import { getColor as E } from "./helpers.js";
|
|
9
|
+
const G = ({
|
|
10
|
+
label: u,
|
|
11
|
+
value: o,
|
|
13
12
|
color: l = "blue",
|
|
14
|
-
textColor: p =
|
|
15
|
-
disabled:
|
|
16
|
-
onChange:
|
|
17
|
-
tabIndex:
|
|
18
|
-
innerShade:
|
|
19
|
-
outerShade:
|
|
13
|
+
textColor: p = H.m700,
|
|
14
|
+
disabled: c,
|
|
15
|
+
onChange: t,
|
|
16
|
+
tabIndex: d,
|
|
17
|
+
innerShade: h,
|
|
18
|
+
outerShade: k
|
|
20
19
|
}) => {
|
|
21
|
-
const [
|
|
20
|
+
const [y, n] = $(!1), r = E(l), S = h ?? (r == null ? void 0 : r.m500) ?? m.m500, b = k ?? (r == null ? void 0 : r.m600) ?? m.m600, a = g(0), x = (e) => t(e.target.checked), w = (e) => {
|
|
22
21
|
if (e.key === "Enter" || e.key === " ") {
|
|
23
22
|
const i = Date.now();
|
|
24
23
|
if (i - a.current < 500) {
|
|
@@ -26,42 +25,42 @@ const J = ({
|
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
27
|
if (a.current = i, e.key === " ") {
|
|
29
|
-
e.preventDefault(),
|
|
28
|
+
e.preventDefault(), t(!o);
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
t(!o), n(!1);
|
|
33
32
|
}
|
|
34
|
-
e.key === "Escape" &&
|
|
35
|
-
}, f = (e) => () =>
|
|
36
|
-
return /* @__PURE__ */ D(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
33
|
+
e.key === "Escape" && n(!1);
|
|
34
|
+
}, f = (e) => () => n(e);
|
|
35
|
+
return /* @__PURE__ */ D(z, { as: "label", $disabled: c, children: [
|
|
36
|
+
/* @__PURE__ */ s(
|
|
37
|
+
B,
|
|
39
38
|
{
|
|
40
39
|
type: "checkbox",
|
|
41
|
-
checked:
|
|
42
|
-
onChange:
|
|
40
|
+
checked: o,
|
|
41
|
+
onChange: x,
|
|
43
42
|
onKeyDown: w,
|
|
44
43
|
onFocus: f(!0),
|
|
45
44
|
onBlur: f(!1),
|
|
46
|
-
disabled:
|
|
47
|
-
tabIndex:
|
|
45
|
+
disabled: c,
|
|
46
|
+
tabIndex: d
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
49
|
+
/* @__PURE__ */ s(
|
|
50
|
+
C,
|
|
52
51
|
{
|
|
53
|
-
$value:
|
|
54
|
-
$focused:
|
|
52
|
+
$value: o,
|
|
53
|
+
$focused: y,
|
|
55
54
|
size: 6,
|
|
56
|
-
color:
|
|
57
|
-
$innerShade:
|
|
58
|
-
$outerShade:
|
|
55
|
+
color: j,
|
|
56
|
+
$innerShade: S,
|
|
57
|
+
$outerShade: b,
|
|
59
58
|
"aria-hidden": "true"
|
|
60
59
|
}
|
|
61
60
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ s(P, { color: p, size: "1.2rem", children: u })
|
|
63
62
|
] });
|
|
64
63
|
};
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
G as default
|
|
67
66
|
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import m from "lodash-es/get";
|
|
2
1
|
import o from "../../../colors/blue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
2
|
+
import m from "../../../colors/green.js";
|
|
3
|
+
import t from "../../../colors/red.js";
|
|
4
|
+
import p from "../../../colors/yellow.js";
|
|
5
|
+
import i from "../../../colors/orange.js";
|
|
6
|
+
import e from "../../../colors/black.js";
|
|
7
|
+
import f from "../../../colors/grey.js";
|
|
8
|
+
import l from "../../../colors/violet.js";
|
|
10
9
|
import n from "../../../colors/teal.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
10
|
+
import g from "../../../colors/purple.js";
|
|
11
|
+
import a from "../../../colors/pink.js";
|
|
12
|
+
const c = {
|
|
14
13
|
blue: o,
|
|
15
|
-
green:
|
|
16
|
-
red:
|
|
17
|
-
yellow:
|
|
18
|
-
orange:
|
|
19
|
-
black:
|
|
20
|
-
grey:
|
|
21
|
-
violet:
|
|
14
|
+
green: m,
|
|
15
|
+
red: t,
|
|
16
|
+
yellow: p,
|
|
17
|
+
orange: i,
|
|
18
|
+
black: e,
|
|
19
|
+
grey: f,
|
|
20
|
+
violet: l,
|
|
22
21
|
teal: n,
|
|
23
|
-
purple:
|
|
24
|
-
pink:
|
|
25
|
-
},
|
|
22
|
+
purple: g,
|
|
23
|
+
pink: a
|
|
24
|
+
}, w = (r) => c[r] ?? o.m500;
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
w as getColor
|
|
28
27
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as U } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as C } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import B from "../../../colors/white.js";
|
|
3
|
+
import { UploadBtnContainer as g, Wrapper as j, HiddenInput as M, PWrapper as W } from "./styles.js";
|
|
4
|
+
import b from "../../../colors/white.js";
|
|
6
5
|
import x from "../../../colors/blue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SIZE as
|
|
12
|
-
const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(
|
|
6
|
+
import B from "../../../colors/grey.js";
|
|
7
|
+
import F from "../../Icons/Link/Link.js";
|
|
8
|
+
import H from "../../../colors/index.js";
|
|
9
|
+
import P from "../../Ripple/Ripple.js";
|
|
10
|
+
import { SIZE as Z, MEDIUM as q } from "./constants.js";
|
|
11
|
+
const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(P, { rippleColor: e.m100, children: l }), L = ({
|
|
13
12
|
label: e,
|
|
14
13
|
labelColor: l,
|
|
15
14
|
theme: p = x,
|
|
@@ -17,21 +16,21 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(Z, { rippleColor: e.m
|
|
|
17
16
|
width: s,
|
|
18
17
|
isLoading: t,
|
|
19
18
|
disabled: r,
|
|
20
|
-
prefixIcon: c =
|
|
19
|
+
prefixIcon: c = F,
|
|
21
20
|
suffixIcon: m,
|
|
22
21
|
type: I = "file",
|
|
23
22
|
accept: R,
|
|
24
23
|
isMultiple: k,
|
|
25
24
|
onChange: z
|
|
26
25
|
}) => {
|
|
27
|
-
const u = C(null), { m400: K, m500:
|
|
28
|
-
|
|
26
|
+
const u = C(null), { m400: K, m500: v, m600: E } = H[p] ?? x, { height: h, width: a, font: n } = Z[D] || {}, f = l || ["white", "yellow"].includes(p) ? B.m600 : b, $ = C(0), w = /* @__PURE__ */ U(
|
|
27
|
+
j,
|
|
29
28
|
{
|
|
30
29
|
$selectedColor: K,
|
|
31
|
-
$hoverColor:
|
|
30
|
+
$hoverColor: v,
|
|
32
31
|
$height: h,
|
|
33
32
|
$width: s || a,
|
|
34
|
-
$activeColor:
|
|
33
|
+
$activeColor: E,
|
|
35
34
|
disabled: r,
|
|
36
35
|
$isLoading: t,
|
|
37
36
|
role: "button",
|
|
@@ -52,7 +51,7 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(Z, { rippleColor: e.m
|
|
|
52
51
|
},
|
|
53
52
|
children: [
|
|
54
53
|
/* @__PURE__ */ o(
|
|
55
|
-
|
|
54
|
+
M,
|
|
56
55
|
{
|
|
57
56
|
ref: u,
|
|
58
57
|
type: I,
|
|
@@ -65,7 +64,7 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(Z, { rippleColor: e.m
|
|
|
65
64
|
),
|
|
66
65
|
c && /* @__PURE__ */ o(c, { color: f, size: n + 19 }),
|
|
67
66
|
/* @__PURE__ */ o(
|
|
68
|
-
|
|
67
|
+
W,
|
|
69
68
|
{
|
|
70
69
|
color: f,
|
|
71
70
|
size: `${n}rem`,
|
|
@@ -80,8 +79,8 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(Z, { rippleColor: e.m
|
|
|
80
79
|
]
|
|
81
80
|
}
|
|
82
81
|
);
|
|
83
|
-
return /* @__PURE__ */ o(
|
|
82
|
+
return /* @__PURE__ */ o(g, { $height: h, $width: s || a, disabled: r, $isLoading: t, children: t || r ? w : /* @__PURE__ */ o(A, { theme: p, children: w }) });
|
|
84
83
|
};
|
|
85
84
|
export {
|
|
86
|
-
|
|
85
|
+
L as default
|
|
87
86
|
};
|