meticulous-ui 2.2.8 → 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/Dropdown/Dropdown.js +83 -82
- package/components/Dropdown/styles.js +4 -4
- package/components/Glass/Glass.js +6 -0
- package/components/Glass/index.js +4 -0
- package/components/Glass/styles.js +73 -0
- package/components/Icons/Add/index.js +4 -0
- package/components/Icons/Link/index.js +4 -0
- package/components/Icons/MediaPauseFilled/index.js +4 -0
- package/components/Icons/MediaPlayFilled/index.js +4 -0
- package/components/Icons/MediaStopFilled/index.js +4 -0
- package/components/Input/Checkbox/Checkbox.js +39 -0
- package/components/Input/Checkbox/helpers.js +28 -0
- package/components/Input/Checkbox/index.js +4 -0
- package/components/Input/Checkbox/styles.js +30 -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/components/Input/Radio/Radio.js +26 -0
- package/components/Input/Radio/styles.js +45 -0
- package/components/Input/RadioGroup/RadioGroup.js +27 -0
- package/components/Input/RadioGroup/index.js +4 -0
- package/components/Input/RadioGroup/styles.js +18 -0
- package/components/Input/Textarea/styles.js +4 -4
- package/components/MenuItem/styles.js +4 -4
- package/components/OtpInput/OtpInput.js +30 -29
- package/components/Pagination/styles.js +6 -6
- package/components/Spinner/Spinner.js +11 -10
- package/components/Timer/Timer.js +64 -0
- package/components/Timer/components/TimerRing/TimerRing.js +42 -0
- package/components/Timer/components/TimerRing/styles.js +7 -0
- package/components/Timer/constants.js +25 -0
- package/components/Timer/index.js +4 -0
- package/components/Timer/styles.js +164 -0
- package/components/Typography/Headings/H1.js +9 -0
- package/components/Typography/Headings/H2.js +9 -0
- package/components/Typography/Headings/H3.js +9 -0
- package/components/Typography/Headings/H4.js +9 -0
- package/components/Typography/Headings/H5.js +9 -0
- package/components/Typography/Headings/H6.js +9 -0
- package/components/VideoPlayer/VideoPlayer.js +34 -0
- package/components/VideoPlayer/components/Volumebar/Volumebar.js +13 -0
- package/components/VideoPlayer/components/Volumebar/styles.js +38 -0
- package/components/VideoPlayer/index.js +4 -0
- package/components/VideoPlayer/styles.js +34 -0
- package/components/VideoPlayer/useSpacebarToggle.js +37 -0
- package/components/VideoPlayer/useVolumeOverlay.js +10 -0
- package/index.js +40 -16
- package/package.json +12 -6
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
|
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import { j as r } from "../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as C, useRef as S, useMemo as
|
|
3
|
-
import
|
|
2
|
+
import { useState as C, useRef as S, useMemo as ee, useEffect as d, useLayoutEffect as te, useCallback as ne, createElement as re } from "react";
|
|
3
|
+
import se from "../../node_modules/lodash-es/get.js";
|
|
4
4
|
import I from "../../colors/grey.js";
|
|
5
5
|
import oe from "../MenuItem/MenuItem.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { DropdownWrapper as
|
|
10
|
-
const
|
|
11
|
-
if (typeof
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
14
|
-
const E = parseFloat(
|
|
6
|
+
import ie from "../../colors/index.js";
|
|
7
|
+
import ce from "../../colors/blue.js";
|
|
8
|
+
import P from "../Spinner/Spinner.js";
|
|
9
|
+
import { DropdownWrapper as le, Box as fe, PWrapper as ue, ChevronDownWrapper as pe, OptionWrapper as ae, SearchContainer as de, SearchIcon as me, SearchInput as he, OptionsList as xe, LoadMoreSentinel as be, SpinnerWrapper as ge } from "./styles.js";
|
|
10
|
+
const we = (s) => {
|
|
11
|
+
if (typeof s != "string") return s;
|
|
12
|
+
if (s.endsWith("px")) return parseFloat(s);
|
|
13
|
+
if (s.endsWith("rem")) {
|
|
14
|
+
const E = parseFloat(s), i = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
15
15
|
return E * i;
|
|
16
16
|
}
|
|
17
|
-
return parseFloat(
|
|
18
|
-
},
|
|
19
|
-
options:
|
|
17
|
+
return parseFloat(s);
|
|
18
|
+
}, De = ({
|
|
19
|
+
options: s,
|
|
20
20
|
onChange: E,
|
|
21
21
|
value: i,
|
|
22
22
|
width: m = "20rem",
|
|
23
23
|
menuHeight: O = "20rem",
|
|
24
|
-
placeholder:
|
|
25
|
-
theme:
|
|
24
|
+
placeholder: A,
|
|
25
|
+
theme: B = "blue",
|
|
26
26
|
isLoading: $,
|
|
27
27
|
isDisabled: v,
|
|
28
28
|
loaderColor: y,
|
|
29
29
|
searchable: h = !1,
|
|
30
|
-
onLoadMore:
|
|
30
|
+
onLoadMore: c,
|
|
31
31
|
hasMore: x = !1,
|
|
32
|
-
isLoadingMore:
|
|
33
|
-
searchPh:
|
|
32
|
+
isLoadingMore: p = !1,
|
|
33
|
+
searchPh: H = "Search..."
|
|
34
34
|
}) => {
|
|
35
|
-
|
|
35
|
+
var F;
|
|
36
|
+
const [n, j] = C(!1), [V, K] = C("bottom"), [b, D] = C(""), [f, a] = C(-1), g = S(null), w = S(null), k = S(null), R = S(null), Q = S(!0), q = () => j((e) => !e), z = (e) => {
|
|
36
37
|
e !== i && (E(e), j(!1));
|
|
37
|
-
},
|
|
38
|
-
if (!h || !b.trim()) return
|
|
38
|
+
}, l = ee(() => {
|
|
39
|
+
if (!h || !b.trim()) return s;
|
|
39
40
|
const e = b.toLowerCase();
|
|
40
|
-
return
|
|
41
|
-
}, [
|
|
41
|
+
return s.filter(({ label: t }) => t.toLowerCase().includes(e));
|
|
42
|
+
}, [s, b, h]);
|
|
42
43
|
d(() => {
|
|
43
44
|
if (n) {
|
|
44
|
-
const e =
|
|
45
|
-
if (e !== -1 && !
|
|
46
|
-
|
|
45
|
+
const e = l.findIndex((t) => t.value === i);
|
|
46
|
+
if (e !== -1 && !l[e].disabled)
|
|
47
|
+
a(e);
|
|
47
48
|
else {
|
|
48
|
-
const t =
|
|
49
|
-
|
|
49
|
+
const t = l.findIndex((o) => !o.disabled);
|
|
50
|
+
a(t);
|
|
50
51
|
}
|
|
51
52
|
} else
|
|
52
|
-
D(""),
|
|
53
|
-
}, [n, b,
|
|
53
|
+
D(""), a(-1);
|
|
54
|
+
}, [n, b, l, i]), d(() => {
|
|
54
55
|
if (n && f !== -1 && w.current) {
|
|
55
56
|
const e = w.current.children[f];
|
|
56
57
|
e && e.scrollIntoView({
|
|
@@ -61,63 +62,63 @@ const ge = (o) => {
|
|
|
61
62
|
}, [f, n]), d(() => {
|
|
62
63
|
n && h && k.current && k.current.focus();
|
|
63
64
|
}, [n, h]), d(() => {
|
|
64
|
-
n || (
|
|
65
|
+
n || (Q.current = !0);
|
|
65
66
|
}, [n]), d(() => {
|
|
66
67
|
const e = (t) => {
|
|
67
68
|
g.current && !g.current.contains(t.target) && j(!1);
|
|
68
69
|
};
|
|
69
70
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
70
|
-
}, []),
|
|
71
|
+
}, []), te(() => {
|
|
71
72
|
if (n && w.current && g.current) {
|
|
72
|
-
const e = g.current.getBoundingClientRect(), t = window.innerHeight,
|
|
73
|
-
|
|
74
|
-
u <
|
|
73
|
+
const e = g.current.getBoundingClientRect(), t = window.innerHeight, o = we(O), u = t - e.bottom;
|
|
74
|
+
K(
|
|
75
|
+
u < o + 8 && e.top > u ? "top" : "bottom"
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
}, [n, O]);
|
|
78
|
-
const
|
|
79
|
+
const N = (e) => {
|
|
79
80
|
let t = e + 1;
|
|
80
|
-
for (; t <
|
|
81
|
-
if (!
|
|
81
|
+
for (; t < l.length; ) {
|
|
82
|
+
if (!l[t].disabled) return t;
|
|
82
83
|
t++;
|
|
83
84
|
}
|
|
84
85
|
return e;
|
|
85
|
-
},
|
|
86
|
+
}, U = (e) => {
|
|
86
87
|
let t = e - 1;
|
|
87
88
|
for (; t >= 0; ) {
|
|
88
|
-
if (!
|
|
89
|
+
if (!l[t].disabled) return t;
|
|
89
90
|
t--;
|
|
90
91
|
}
|
|
91
92
|
return e;
|
|
92
|
-
},
|
|
93
|
+
}, G = (e) => {
|
|
93
94
|
if (n)
|
|
94
95
|
switch (e.key) {
|
|
95
96
|
case "ArrowDown":
|
|
96
97
|
e.preventDefault();
|
|
97
|
-
const t =
|
|
98
|
-
t === f && x && !
|
|
98
|
+
const t = N(f);
|
|
99
|
+
t === f && x && !p && (c == null || c()), a(t);
|
|
99
100
|
break;
|
|
100
101
|
case "ArrowUp":
|
|
101
|
-
e.preventDefault(),
|
|
102
|
+
e.preventDefault(), a((u) => U(u));
|
|
102
103
|
break;
|
|
103
104
|
case "Enter":
|
|
104
105
|
e.preventDefault();
|
|
105
|
-
const
|
|
106
|
-
|
|
106
|
+
const o = l[f];
|
|
107
|
+
o && !o.disabled && z(o.value);
|
|
107
108
|
break;
|
|
108
109
|
case "Escape":
|
|
109
110
|
j(!1);
|
|
110
111
|
break;
|
|
111
112
|
}
|
|
112
|
-
}, W =
|
|
113
|
-
x && !
|
|
114
|
-
}, [x,
|
|
113
|
+
}, W = ne(() => {
|
|
114
|
+
x && !p && c && c();
|
|
115
|
+
}, [x, p, c]);
|
|
115
116
|
d(() => {
|
|
116
117
|
const e = R.current;
|
|
117
|
-
if (!e || !
|
|
118
|
+
if (!e || !c || !x) return;
|
|
118
119
|
const t = new IntersectionObserver(
|
|
119
|
-
([
|
|
120
|
-
|
|
120
|
+
([o]) => {
|
|
121
|
+
o.isIntersecting && !p && W();
|
|
121
122
|
},
|
|
122
123
|
{
|
|
123
124
|
root: w.current,
|
|
@@ -128,70 +129,70 @@ const ge = (o) => {
|
|
|
128
129
|
}
|
|
129
130
|
);
|
|
130
131
|
return t.observe(e), () => t.disconnect();
|
|
131
|
-
}, [W,
|
|
132
|
+
}, [W, c, x, p]);
|
|
132
133
|
const {
|
|
133
|
-
m50:
|
|
134
|
-
m100:
|
|
135
|
-
m200:
|
|
136
|
-
m500:
|
|
137
|
-
} =
|
|
134
|
+
m50: J,
|
|
135
|
+
m100: T,
|
|
136
|
+
m200: X,
|
|
137
|
+
m500: Y
|
|
138
|
+
} = se(ie, B, ce), Z = (e, t) => () => !e && a(t), _ = ({ value: e, label: t, disabled: o }, u) => /* @__PURE__ */ re(
|
|
138
139
|
oe,
|
|
139
140
|
{
|
|
140
141
|
value: e,
|
|
141
142
|
label: t,
|
|
142
|
-
isDisabled:
|
|
143
|
+
isDisabled: o,
|
|
143
144
|
onSelect: z,
|
|
144
|
-
onMouseEnter:
|
|
145
|
+
onMouseEnter: Z(o, u),
|
|
145
146
|
isSelected: e === i,
|
|
146
147
|
isHighlighted: u === f,
|
|
147
148
|
key: e,
|
|
148
149
|
width: m,
|
|
149
|
-
selectedColor:
|
|
150
|
-
hoverColor:
|
|
151
|
-
activeColor:
|
|
150
|
+
selectedColor: X,
|
|
151
|
+
hoverColor: J,
|
|
152
|
+
activeColor: T
|
|
152
153
|
}
|
|
153
|
-
),
|
|
154
|
+
), L = (e) => {
|
|
154
155
|
D(e.target.value);
|
|
155
|
-
},
|
|
156
|
+
}, M = (e) => {
|
|
156
157
|
e.stopPropagation();
|
|
157
158
|
};
|
|
158
159
|
return /* @__PURE__ */ r.jsxs(
|
|
159
|
-
|
|
160
|
+
le,
|
|
160
161
|
{
|
|
161
162
|
ref: g,
|
|
162
163
|
$width: m,
|
|
163
164
|
tabIndex: v ? -1 : 0,
|
|
164
|
-
onKeyDown:
|
|
165
|
+
onKeyDown: G,
|
|
165
166
|
$isLoading: $,
|
|
166
167
|
$isDisabled: v,
|
|
167
168
|
children: [
|
|
168
|
-
/* @__PURE__ */ r.jsxs(
|
|
169
|
-
/* @__PURE__ */ r.jsx(
|
|
170
|
-
/* @__PURE__ */ r.jsx(
|
|
169
|
+
/* @__PURE__ */ r.jsxs(fe, { $width: m, onClick: q, $isOpen: n, $border: Y, children: [
|
|
170
|
+
/* @__PURE__ */ r.jsx(ue, { $width: m, color: i ? I.m700 : I.m500, size: "1.2rem", children: i ? (F = s.find(({ value: e }) => i === e)) == null ? void 0 : F.label : A }),
|
|
171
|
+
/* @__PURE__ */ r.jsx(pe, { color: I.m500, size: 22, $isOpen: n })
|
|
171
172
|
] }),
|
|
172
|
-
/* @__PURE__ */ r.jsxs(ae, { $isOpen: n, $width: m, $height: O, $top:
|
|
173
|
-
h && /* @__PURE__ */ r.jsxs(
|
|
174
|
-
/* @__PURE__ */ r.jsx(
|
|
173
|
+
/* @__PURE__ */ r.jsxs(ae, { $isOpen: n, $width: m, $height: O, $top: V === "top", children: [
|
|
174
|
+
h && /* @__PURE__ */ r.jsxs(de, { onClick: M, children: [
|
|
175
|
+
/* @__PURE__ */ r.jsx(me, { size: 20, color: I.m600 }),
|
|
175
176
|
/* @__PURE__ */ r.jsx(
|
|
176
|
-
|
|
177
|
+
he,
|
|
177
178
|
{
|
|
178
179
|
ref: k,
|
|
179
180
|
value: b,
|
|
180
|
-
onChange:
|
|
181
|
-
placeholder:
|
|
181
|
+
onChange: L,
|
|
182
|
+
placeholder: H
|
|
182
183
|
}
|
|
183
184
|
)
|
|
184
185
|
] }),
|
|
185
|
-
/* @__PURE__ */ r.jsxs(
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ r.jsxs(xe, { ref: w, children: [
|
|
187
|
+
l.map(_),
|
|
188
|
+
c && /* @__PURE__ */ r.jsx(be, { ref: R, children: p && /* @__PURE__ */ r.jsx(P, { size: "small", color: y }) })
|
|
188
189
|
] })
|
|
189
190
|
] }),
|
|
190
|
-
$ && /* @__PURE__ */ r.jsx(
|
|
191
|
+
$ && /* @__PURE__ */ r.jsx(ge, { children: /* @__PURE__ */ r.jsx(P, { size: "small", color: y }) })
|
|
191
192
|
]
|
|
192
193
|
}
|
|
193
194
|
);
|
|
194
195
|
};
|
|
195
196
|
export {
|
|
196
|
-
|
|
197
|
+
De as default
|
|
197
198
|
};
|
|
@@ -114,9 +114,9 @@ const c = n`
|
|
|
114
114
|
&::placeholder {
|
|
115
115
|
color: ${t.m400};
|
|
116
116
|
}
|
|
117
|
-
`,
|
|
117
|
+
`, E = e(d)`
|
|
118
118
|
margin: 0 0.8rem;
|
|
119
|
-
`,
|
|
119
|
+
`, L = e.div`
|
|
120
120
|
display: flex;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
align-items: center;
|
|
@@ -128,12 +128,12 @@ export {
|
|
|
128
128
|
$ as Box,
|
|
129
129
|
S as ChevronDownWrapper,
|
|
130
130
|
w as DropdownWrapper,
|
|
131
|
-
|
|
131
|
+
L as LoadMoreSentinel,
|
|
132
132
|
k as OptionWrapper,
|
|
133
133
|
D as OptionsList,
|
|
134
134
|
y as PWrapper,
|
|
135
135
|
z as SearchContainer,
|
|
136
|
-
|
|
136
|
+
E as SearchIcon,
|
|
137
137
|
C as SearchInput,
|
|
138
138
|
W as SpinnerWrapper
|
|
139
139
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import a from "../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
const e = a.div`
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
border-radius: ${({ $borderRadius: r }) => r};
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
|
|
10
|
+
background:
|
|
11
|
+
radial-gradient(
|
|
12
|
+
60rem 22rem at 50% 45%,
|
|
13
|
+
rgba(20, 40, 20, 0.06),
|
|
14
|
+
rgba(10, 25, 10, 0.02) 50%,
|
|
15
|
+
transparent 70%
|
|
16
|
+
),
|
|
17
|
+
linear-gradient(
|
|
18
|
+
180deg,
|
|
19
|
+
rgba(255, 255, 255, 0.18) 0%,
|
|
20
|
+
rgba(255, 255, 255, 0.06) 40%,
|
|
21
|
+
rgba(255, 255, 255, 0.03) 100%
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
box-shadow:
|
|
25
|
+
0 3rem 6rem rgba(7, 22, 10, 0.3),
|
|
26
|
+
0 2px 0 rgba(255, 255, 255, 0.03) inset;
|
|
27
|
+
|
|
28
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
29
|
+
color: rgba(8, 34, 16, 0.95);
|
|
30
|
+
|
|
31
|
+
::before {
|
|
32
|
+
content: '';
|
|
33
|
+
position: absolute;
|
|
34
|
+
left: -12%;
|
|
35
|
+
top: -24%;
|
|
36
|
+
width: 62%;
|
|
37
|
+
height: 62%;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
background: radial-gradient(
|
|
40
|
+
circle,
|
|
41
|
+
rgba(255, 255, 255, 0.24),
|
|
42
|
+
rgba(255, 255, 255, 0.06) 40%,
|
|
43
|
+
transparent 60%
|
|
44
|
+
);
|
|
45
|
+
filter: blur(4.6rem);
|
|
46
|
+
opacity: 0.85;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
transform: translateZ(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
::after {
|
|
52
|
+
content: '';
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: -6%;
|
|
55
|
+
bottom: -18%;
|
|
56
|
+
width: 68%;
|
|
57
|
+
height: 68%;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
background: radial-gradient(
|
|
60
|
+
circle at 30% 40%,
|
|
61
|
+
rgba(255, 255, 255, 0.08),
|
|
62
|
+
rgba(255, 255, 255, 0.01) 40%,
|
|
63
|
+
transparent 70%
|
|
64
|
+
);
|
|
65
|
+
filter: blur(5.4rem);
|
|
66
|
+
opacity: 0.45;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
transform: translateZ(0);
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
export {
|
|
72
|
+
e as GlassWrapper
|
|
73
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import m from "../../../node_modules/lodash-es/get.js";
|
|
3
|
+
import f from "../../../colors/grey.js";
|
|
4
|
+
import x from "../../Typography/P/P.js";
|
|
5
|
+
import u from "../../../colors/white.js";
|
|
6
|
+
import c from "../../../colors/blue.js";
|
|
7
|
+
import { Wrapper as j, Box as k } from "./styles.js";
|
|
8
|
+
import { getColor as g } from "./helpers.js";
|
|
9
|
+
const E = ({ label: s, value: r, color: n = "blue", textColor: p = f.m700, disabled: e, onChange: t }) => {
|
|
10
|
+
const h = () => {
|
|
11
|
+
e || t(!r);
|
|
12
|
+
}, i = g(n), a = m(i, "m500", c.m500), l = m(i, "m800", c.m800);
|
|
13
|
+
return /* @__PURE__ */ o.jsxs(j, { onClick: h, $disabled: e, children: [
|
|
14
|
+
/* @__PURE__ */ o.jsx(
|
|
15
|
+
"input",
|
|
16
|
+
{
|
|
17
|
+
type: "checkbox",
|
|
18
|
+
checked: r,
|
|
19
|
+
onChange: (d) => t(d.target.checked),
|
|
20
|
+
disabled: e,
|
|
21
|
+
style: { position: "absolute", opacity: 0, width: 0, height: 0 }
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ o.jsx(
|
|
25
|
+
k,
|
|
26
|
+
{
|
|
27
|
+
$value: r,
|
|
28
|
+
size: 6,
|
|
29
|
+
color: u,
|
|
30
|
+
$innerShade: a,
|
|
31
|
+
$outerShade: l
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ o.jsx(x, { color: p, size: "1.2rem", children: s })
|
|
35
|
+
] });
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
E as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import m from "../../../node_modules/lodash-es/get.js";
|
|
2
|
+
import o from "../../../colors/blue.js";
|
|
3
|
+
import t from "../../../colors/green.js";
|
|
4
|
+
import p from "../../../colors/red.js";
|
|
5
|
+
import i from "../../../colors/yellow.js";
|
|
6
|
+
import e from "../../../colors/orange.js";
|
|
7
|
+
import f from "../../../colors/black.js";
|
|
8
|
+
import l from "../../../colors/grey.js";
|
|
9
|
+
import g from "../../../colors/violet.js";
|
|
10
|
+
import n from "../../../colors/teal.js";
|
|
11
|
+
import a from "../../../colors/purple.js";
|
|
12
|
+
import c from "../../../colors/pink.js";
|
|
13
|
+
const b = {
|
|
14
|
+
blue: o,
|
|
15
|
+
green: t,
|
|
16
|
+
red: p,
|
|
17
|
+
yellow: i,
|
|
18
|
+
orange: e,
|
|
19
|
+
black: f,
|
|
20
|
+
grey: l,
|
|
21
|
+
violet: g,
|
|
22
|
+
teal: n,
|
|
23
|
+
purple: a,
|
|
24
|
+
pink: c
|
|
25
|
+
}, D = (r) => m(b, r, o.m500);
|
|
26
|
+
export {
|
|
27
|
+
D as getColor
|
|
28
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import t, { css as e } from "../../../node_modules/styled-components/dist/styled-components.browser.esm.js";
|
|
2
|
+
import i from "../../Icons/Check/Check.js";
|
|
3
|
+
import n from "../../../colors/grey.js";
|
|
4
|
+
const m = t.div`
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.8rem;
|
|
9
|
+
width: max-content;
|
|
10
|
+
|
|
11
|
+
${({ $disabled: r }) => r && e`
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
opacity: 0.7;
|
|
14
|
+
`}
|
|
15
|
+
`, c = t(i)`
|
|
16
|
+
width: 1.2rem;
|
|
17
|
+
height: 1.2rem;
|
|
18
|
+
border: 1px solid ${({ $value: r, $outerShade: o }) => r ? o : n.m800};
|
|
19
|
+
border-radius: 0.2rem;
|
|
20
|
+
background-color: ${({ $value: r, $innerShade: o }) => r ? o : "transparent"};
|
|
21
|
+
transition: background-color 0.35s ease;
|
|
22
|
+
|
|
23
|
+
path {
|
|
24
|
+
stroke-width: 3;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
export {
|
|
28
|
+
c as Box,
|
|
29
|
+
m as Wrapper
|
|
30
|
+
};
|
|
@@ -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
|
+
};
|