meticulous-ui 2.6.2 → 2.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/Dropdown/Dropdown.js +56 -54
- package/components/Glass/Glass.js +4 -4
- package/components/Image/Image.js +49 -0
- package/components/Image/index.js +4 -0
- package/components/Image/styles.js +44 -0
- package/components/Input/Checkbox/Checkbox.js +23 -22
- package/components/Input/Checkbox/styles.js +1 -1
- package/components/Input/FileUploader/FileUploader.js +32 -21
- package/components/Input/Radio/Radio.js +20 -10
- package/components/Input/RadioGroup/RadioGroup.js +19 -17
- package/components/Loader/Loader.js +12 -12
- package/components/MenuItem/MenuItem.js +10 -8
- package/components/OtpInput/OtpInput.js +16 -15
- package/components/Pagination/Pagination.js +17 -14
- package/components/Selectbox/Selectbox.js +48 -46
- package/components/Shimmer/Shimmer.js +19 -3
- package/components/Shimmer/styles.js +3 -3
- package/components/Spinner/Spinner.js +14 -13
- package/components/Timer/Timer.js +35 -34
- package/components/Toast/Toast.js +26 -18
- package/components/Typography/Headings/H1.js +5 -5
- package/components/Typography/Headings/H2.js +5 -5
- package/components/Typography/Headings/H3.js +5 -5
- package/components/Typography/Headings/H4.js +5 -5
- package/components/Typography/Headings/H5.js +5 -5
- package/components/Typography/Headings/H6.js +5 -5
- package/components/VideoPlayer/VideoPlayer.js +18 -11
- package/index.js +40 -38
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ import blue from 'meticulous-ui/colors/blue';
|
|
|
65
65
|
| `Timer` | Renders analog / digital clock with alarm |
|
|
66
66
|
| `OtpInput` | Gives inputs to enter and edit OTP |
|
|
67
67
|
| `VideoPlayer` | Renders video with keyboard shortcuts |
|
|
68
|
+
| `Image` | Renders image with shimmer, lower resolution |
|
|
68
69
|
| `Input` | Renders input box to let user enter input |
|
|
69
70
|
| `Checkbox` | Renders checkbox to let user give boolean value |
|
|
70
71
|
| `RadioGroup` | Renders radio options in a group to let user select |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as C, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as $, useId as
|
|
2
|
+
import { useState as $, useId as le, useRef as v, useMemo as ae, useEffect as h, useLayoutEffect as ue, useCallback as fe, createElement as de } from "react";
|
|
3
3
|
import E from "../../colors/grey.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import pe from "../MenuItem/MenuItem.js";
|
|
5
|
+
import me from "../../colors/index.js";
|
|
6
|
+
import he from "../../colors/blue.js";
|
|
7
7
|
import K from "../Spinner/Spinner.js";
|
|
8
|
-
import { DropdownWrapper as
|
|
9
|
-
const
|
|
8
|
+
import { DropdownWrapper as be, Box as we, PWrapper as xe, ChevronDownWrapper as ge, OptionWrapper as Ie, SearchContainer as ke, SearchIcon as Se, SearchInput as Ce, OptionsList as $e, LoadMoreSentinel as ve, SpinnerWrapper as ye } from "./styles.js";
|
|
9
|
+
const Ee = (n) => {
|
|
10
10
|
if (typeof n != "string") return n;
|
|
11
11
|
if (n.endsWith("px")) return parseFloat(n);
|
|
12
12
|
if (n.endsWith("rem")) {
|
|
@@ -14,7 +14,7 @@ const ye = (n) => {
|
|
|
14
14
|
return O * s;
|
|
15
15
|
}
|
|
16
16
|
return parseFloat(n);
|
|
17
|
-
},
|
|
17
|
+
}, He = ({
|
|
18
18
|
options: n,
|
|
19
19
|
onChange: O,
|
|
20
20
|
value: s,
|
|
@@ -29,12 +29,13 @@ const ye = (n) => {
|
|
|
29
29
|
onLoadMore: c,
|
|
30
30
|
hasMore: I = !1,
|
|
31
31
|
isLoadingMore: f = !1,
|
|
32
|
-
searchPh: R = "Search..."
|
|
32
|
+
searchPh: R = "Search...",
|
|
33
|
+
...q
|
|
33
34
|
}) => {
|
|
34
35
|
var j;
|
|
35
|
-
const [r, d] = $(!1), [
|
|
36
|
+
const [r, d] = $(!1), [N, W] = $(!1), [T, G] = $("bottom"), [k, A] = $(""), [i, p] = $(-1), y = le(), m = v(null), S = v(null), D = v(null), B = v(null), J = v(!0), X = () => !w && !x && d((e) => !e), P = (e) => {
|
|
36
37
|
e !== s && (O(e), d(!1));
|
|
37
|
-
}, l =
|
|
38
|
+
}, l = ae(() => {
|
|
38
39
|
if (!g || !k.trim()) return n;
|
|
39
40
|
const e = k.toLowerCase();
|
|
40
41
|
return n.filter(({ label: t }) => t.toLowerCase().includes(e));
|
|
@@ -61,35 +62,35 @@ const ye = (n) => {
|
|
|
61
62
|
}, [i, r]), h(() => {
|
|
62
63
|
r && g && D.current && D.current.focus();
|
|
63
64
|
}, [r, g]), h(() => {
|
|
64
|
-
r || (
|
|
65
|
+
r || (J.current = !0);
|
|
65
66
|
}, [r]), h(() => {
|
|
66
67
|
const e = (t) => {
|
|
67
68
|
m.current && !m.current.contains(t.target) && d(!1);
|
|
68
69
|
};
|
|
69
70
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
70
|
-
}, []),
|
|
71
|
+
}, []), ue(() => {
|
|
71
72
|
if (r && S.current && m.current) {
|
|
72
|
-
const e = m.current.getBoundingClientRect(), t = window.innerHeight, o =
|
|
73
|
-
|
|
73
|
+
const e = m.current.getBoundingClientRect(), t = window.innerHeight, o = Ee(F), a = t - e.bottom;
|
|
74
|
+
G(
|
|
74
75
|
a < o + 8 && e.top > a ? "top" : "bottom"
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
}, [r, F]);
|
|
78
|
-
const
|
|
79
|
+
const Y = (e) => {
|
|
79
80
|
let t = e + 1;
|
|
80
81
|
for (; t < l.length; ) {
|
|
81
82
|
if (!l[t].disabled) return t;
|
|
82
83
|
t++;
|
|
83
84
|
}
|
|
84
85
|
return e;
|
|
85
|
-
},
|
|
86
|
+
}, Z = (e) => {
|
|
86
87
|
let t = e - 1;
|
|
87
88
|
for (; t >= 0; ) {
|
|
88
89
|
if (!l[t].disabled) return t;
|
|
89
90
|
t--;
|
|
90
91
|
}
|
|
91
92
|
return e;
|
|
92
|
-
},
|
|
93
|
+
}, _ = (e) => {
|
|
93
94
|
if (!(w || x)) {
|
|
94
95
|
if (!r) {
|
|
95
96
|
(e.key === " " || e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), d(!0));
|
|
@@ -98,11 +99,11 @@ const ye = (n) => {
|
|
|
98
99
|
switch (e.key) {
|
|
99
100
|
case "ArrowDown":
|
|
100
101
|
e.preventDefault();
|
|
101
|
-
const t =
|
|
102
|
+
const t = Y(i);
|
|
102
103
|
t === i && I && !f && (c == null || c()), p(t);
|
|
103
104
|
break;
|
|
104
105
|
case "ArrowUp":
|
|
105
|
-
e.preventDefault(), p((a) =>
|
|
106
|
+
e.preventDefault(), p((a) => Z(a));
|
|
106
107
|
break;
|
|
107
108
|
case "Enter":
|
|
108
109
|
e.preventDefault();
|
|
@@ -114,7 +115,7 @@ const ye = (n) => {
|
|
|
114
115
|
break;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
|
-
}, H =
|
|
118
|
+
}, H = fe(() => {
|
|
118
119
|
I && !f && c && c();
|
|
119
120
|
}, [I, f, c]);
|
|
120
121
|
h(() => {
|
|
@@ -135,44 +136,45 @@ const ye = (n) => {
|
|
|
135
136
|
return t.observe(e), () => t.disconnect();
|
|
136
137
|
}, [H, c, I, f]);
|
|
137
138
|
const {
|
|
138
|
-
m50:
|
|
139
|
-
m100:
|
|
140
|
-
m200:
|
|
141
|
-
m500:
|
|
142
|
-
} =
|
|
143
|
-
|
|
139
|
+
m50: L,
|
|
140
|
+
m100: M,
|
|
141
|
+
m200: ee,
|
|
142
|
+
m500: te
|
|
143
|
+
} = me[U] ?? he, re = (e, t) => () => !e && p(t), V = (e) => `${y}-opt-${e}`, ne = ({ value: e, label: t, disabled: o }, a) => /* @__PURE__ */ de(
|
|
144
|
+
pe,
|
|
144
145
|
{
|
|
145
146
|
value: e,
|
|
146
147
|
label: t,
|
|
147
148
|
isDisabled: o,
|
|
148
149
|
onSelect: P,
|
|
149
|
-
onMouseEnter:
|
|
150
|
+
onMouseEnter: re(o, a),
|
|
150
151
|
isSelected: e === s,
|
|
151
152
|
isHighlighted: a === i,
|
|
152
153
|
key: e,
|
|
153
154
|
id: V(a),
|
|
154
155
|
width: b,
|
|
155
|
-
selectedColor:
|
|
156
|
-
hoverColor:
|
|
157
|
-
activeColor:
|
|
156
|
+
selectedColor: ee,
|
|
157
|
+
hoverColor: L,
|
|
158
|
+
activeColor: M
|
|
158
159
|
}
|
|
159
|
-
),
|
|
160
|
+
), oe = (e) => () => {
|
|
160
161
|
W(e);
|
|
161
|
-
},
|
|
162
|
+
}, se = (e) => {
|
|
162
163
|
var t;
|
|
163
164
|
W(!1), (t = m.current) != null && t.contains(e.relatedTarget) || d(!1);
|
|
164
|
-
}, se = (e) => {
|
|
165
|
-
A(e.target.value);
|
|
166
165
|
}, ce = (e) => {
|
|
166
|
+
A(e.target.value);
|
|
167
|
+
}, ie = (e) => {
|
|
167
168
|
e.stopPropagation();
|
|
168
169
|
};
|
|
169
170
|
return /* @__PURE__ */ C(
|
|
170
|
-
|
|
171
|
+
be,
|
|
171
172
|
{
|
|
172
173
|
ref: m,
|
|
173
174
|
$width: b,
|
|
175
|
+
...q,
|
|
174
176
|
tabIndex: x || w ? -1 : 0,
|
|
175
|
-
onKeyDown:
|
|
177
|
+
onKeyDown: _,
|
|
176
178
|
$isLoading: w,
|
|
177
179
|
$isDisabled: x,
|
|
178
180
|
role: "combobox",
|
|
@@ -181,32 +183,32 @@ const ye = (n) => {
|
|
|
181
183
|
"aria-controls": y,
|
|
182
184
|
"aria-disabled": x || void 0,
|
|
183
185
|
"aria-activedescendant": i !== -1 ? V(i) : void 0,
|
|
184
|
-
onFocus:
|
|
185
|
-
onBlur:
|
|
186
|
+
onFocus: oe(!0),
|
|
187
|
+
onBlur: se,
|
|
186
188
|
children: [
|
|
187
189
|
/* @__PURE__ */ C(
|
|
188
|
-
|
|
190
|
+
we,
|
|
189
191
|
{
|
|
190
192
|
$width: b,
|
|
191
|
-
onClick:
|
|
193
|
+
onClick: X,
|
|
192
194
|
$isOpen: r,
|
|
193
|
-
$border:
|
|
194
|
-
$isFocused:
|
|
195
|
+
$border: te,
|
|
196
|
+
$isFocused: N && !r,
|
|
195
197
|
children: [
|
|
196
|
-
/* @__PURE__ */ u(
|
|
197
|
-
/* @__PURE__ */ u(
|
|
198
|
+
/* @__PURE__ */ u(xe, { $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 }),
|
|
199
|
+
/* @__PURE__ */ u(ge, { color: E.m500, size: 22, $isOpen: r, "aria-hidden": !0 })
|
|
198
200
|
]
|
|
199
201
|
}
|
|
200
202
|
),
|
|
201
|
-
/* @__PURE__ */ C(
|
|
202
|
-
g && /* @__PURE__ */ C(
|
|
203
|
-
/* @__PURE__ */ u(
|
|
203
|
+
/* @__PURE__ */ C(Ie, { $isOpen: r, $width: b, $height: F, $top: T === "top", children: [
|
|
204
|
+
g && /* @__PURE__ */ C(ke, { onClick: ie, children: [
|
|
205
|
+
/* @__PURE__ */ u(Se, { size: 20, color: E.m600, "aria-hidden": !0 }),
|
|
204
206
|
/* @__PURE__ */ u(
|
|
205
|
-
|
|
207
|
+
Ce,
|
|
206
208
|
{
|
|
207
209
|
ref: D,
|
|
208
210
|
value: k,
|
|
209
|
-
onChange:
|
|
211
|
+
onChange: ce,
|
|
210
212
|
placeholder: R,
|
|
211
213
|
"aria-label": R,
|
|
212
214
|
"aria-controls": y,
|
|
@@ -217,16 +219,16 @@ const ye = (n) => {
|
|
|
217
219
|
}
|
|
218
220
|
)
|
|
219
221
|
] }),
|
|
220
|
-
/* @__PURE__ */ C(
|
|
221
|
-
l.map(
|
|
222
|
-
c && /* @__PURE__ */ u(
|
|
222
|
+
/* @__PURE__ */ C($e, { ref: S, role: "listbox", id: y, tabIndex: -1, children: [
|
|
223
|
+
l.map(ne),
|
|
224
|
+
c && /* @__PURE__ */ u(ve, { ref: B, children: f && /* @__PURE__ */ u(K, { size: "small", color: z }) })
|
|
223
225
|
] })
|
|
224
226
|
] }),
|
|
225
|
-
w && /* @__PURE__ */ u(
|
|
227
|
+
w && /* @__PURE__ */ u(ye, { children: /* @__PURE__ */ u(K, { size: "small", color: z }) })
|
|
226
228
|
]
|
|
227
229
|
}
|
|
228
230
|
);
|
|
229
231
|
};
|
|
230
232
|
export {
|
|
231
|
-
|
|
233
|
+
He as default
|
|
232
234
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { GlassWrapper as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { GlassWrapper as e } from "./styles.js";
|
|
3
|
+
const d = ({ border: r = "none", borderRadius: o = 0, ...s }) => /* @__PURE__ */ a(e, { $border: r, $borderRadius: o, ...s });
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
d as default
|
|
6
6
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a } from "react";
|
|
3
|
+
import y from "../Shimmer/Shimmer.js";
|
|
4
|
+
import { ImageWrapper as S, ShimmerOverlay as j, LowResImage as E, StyledImage as R } from "./styles.js";
|
|
5
|
+
const o = (e) => {
|
|
6
|
+
if (e != null)
|
|
7
|
+
return typeof e == "number" ? `${e}rem` : e;
|
|
8
|
+
}, k = ({
|
|
9
|
+
src: e,
|
|
10
|
+
alt: l = "",
|
|
11
|
+
width: c = "100%",
|
|
12
|
+
height: f = "100%",
|
|
13
|
+
borderRadius: r = "0.4rem",
|
|
14
|
+
loadLow: m = !1,
|
|
15
|
+
lowSrc: n,
|
|
16
|
+
...u
|
|
17
|
+
}) => {
|
|
18
|
+
const [i, $] = a(!1), [d, h] = a(!1), [s, L] = a(!1), p = () => $(!0), g = () => h(!0), w = () => L(!0), I = m ? i : d;
|
|
19
|
+
return /* @__PURE__ */ x(S, { $width: o(c), $height: o(f), $borderRadius: o(r), children: [
|
|
20
|
+
!s && /* @__PURE__ */ t(j, { $loaded: I, children: /* @__PURE__ */ t(y, { borderRadius: r }) }),
|
|
21
|
+
m && n && !s && /* @__PURE__ */ t(
|
|
22
|
+
E,
|
|
23
|
+
{
|
|
24
|
+
src: n,
|
|
25
|
+
alt: "",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
$lowLoaded: i,
|
|
28
|
+
$loaded: d,
|
|
29
|
+
$borderRadius: o(r),
|
|
30
|
+
onLoad: p
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
!s && /* @__PURE__ */ t(
|
|
34
|
+
R,
|
|
35
|
+
{
|
|
36
|
+
src: e,
|
|
37
|
+
alt: l,
|
|
38
|
+
$loaded: d,
|
|
39
|
+
$borderRadius: o(r),
|
|
40
|
+
onLoad: g,
|
|
41
|
+
onError: w,
|
|
42
|
+
...u
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
k as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
const s = t.span`
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
width: ${({ $width: i }) => i};
|
|
6
|
+
height: ${({ $height: i }) => i};
|
|
7
|
+
border-radius: ${({ $borderRadius: i }) => i};
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
`, a = t.img`
|
|
10
|
+
display: block;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
object-fit: cover;
|
|
14
|
+
border-radius: ${({ $borderRadius: i }) => i};
|
|
15
|
+
opacity: ${({ $loaded: i }) => i ? 1 : 0};
|
|
16
|
+
transition: opacity 0.5s ease-in-out;
|
|
17
|
+
`, n = t.div`
|
|
18
|
+
position: absolute;
|
|
19
|
+
inset: 0;
|
|
20
|
+
z-index: 2;
|
|
21
|
+
opacity: ${({ $loaded: i }) => i ? 0 : 1};
|
|
22
|
+
transition: opacity 0.35s ease-out;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
`, r = t.img`
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
display: block;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
object-fit: cover;
|
|
32
|
+
transform: scale(1.05);
|
|
33
|
+
filter: ${({ $loaded: i }) => i ? "blur(0px)" : "blur(12px)"};
|
|
34
|
+
opacity: ${({ $lowLoaded: i, $loaded: e }) => i && !e ? 1 : 0};
|
|
35
|
+
transition:
|
|
36
|
+
opacity 0.5s ease-in-out,
|
|
37
|
+
filter 0.5s ease-in-out;
|
|
38
|
+
`;
|
|
39
|
+
export {
|
|
40
|
+
s as ImageWrapper,
|
|
41
|
+
r as LowResImage,
|
|
42
|
+
n as ShimmerOverlay,
|
|
43
|
+
a as StyledImage
|
|
44
|
+
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as $, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as H } from "react";
|
|
3
|
+
import P from "../../../colors/grey.js";
|
|
4
|
+
import j from "../../Typography/P/P.js";
|
|
5
|
+
import z from "../../../colors/white.js";
|
|
6
6
|
import m from "../../../colors/blue.js";
|
|
7
|
-
import { Wrapper as
|
|
8
|
-
import { getColor as
|
|
9
|
-
const
|
|
7
|
+
import { Wrapper as B, CbInput as C, Box as E } from "./styles.js";
|
|
8
|
+
import { getColor as F } from "./helpers.js";
|
|
9
|
+
const J = ({
|
|
10
10
|
label: u,
|
|
11
11
|
value: o,
|
|
12
12
|
color: l = "blue",
|
|
13
|
-
textColor: p =
|
|
13
|
+
textColor: p = P.m700,
|
|
14
14
|
disabled: c,
|
|
15
15
|
onChange: t,
|
|
16
16
|
tabIndex: d,
|
|
17
17
|
innerShade: h,
|
|
18
|
-
outerShade: k
|
|
18
|
+
outerShade: k,
|
|
19
|
+
...y
|
|
19
20
|
}) => {
|
|
20
|
-
const [
|
|
21
|
+
const [S, n] = g(!1), r = F(l), b = h ?? (r == null ? void 0 : r.m500) ?? m.m500, x = k ?? (r == null ? void 0 : r.m600) ?? m.m600, a = H(0), w = (e) => t(e.target.checked), D = (e) => {
|
|
21
22
|
if (e.key === "Enter" || e.key === " ") {
|
|
22
23
|
const i = Date.now();
|
|
23
24
|
if (i - a.current < 500) {
|
|
@@ -32,14 +33,14 @@ const G = ({
|
|
|
32
33
|
}
|
|
33
34
|
e.key === "Escape" && n(!1);
|
|
34
35
|
}, f = (e) => () => n(e);
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ $(B, { as: "label", $disabled: c, ...y, children: [
|
|
36
37
|
/* @__PURE__ */ s(
|
|
37
|
-
|
|
38
|
+
C,
|
|
38
39
|
{
|
|
39
40
|
type: "checkbox",
|
|
40
41
|
checked: o,
|
|
41
|
-
onChange:
|
|
42
|
-
onKeyDown:
|
|
42
|
+
onChange: w,
|
|
43
|
+
onKeyDown: D,
|
|
43
44
|
onFocus: f(!0),
|
|
44
45
|
onBlur: f(!1),
|
|
45
46
|
disabled: c,
|
|
@@ -47,20 +48,20 @@ const G = ({
|
|
|
47
48
|
}
|
|
48
49
|
),
|
|
49
50
|
/* @__PURE__ */ s(
|
|
50
|
-
|
|
51
|
+
E,
|
|
51
52
|
{
|
|
52
53
|
$value: o,
|
|
53
|
-
$focused:
|
|
54
|
+
$focused: S,
|
|
54
55
|
size: 6,
|
|
55
|
-
color:
|
|
56
|
-
$innerShade:
|
|
57
|
-
$outerShade:
|
|
56
|
+
color: z,
|
|
57
|
+
$innerShade: b,
|
|
58
|
+
$outerShade: x,
|
|
58
59
|
"aria-hidden": "true"
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
|
-
/* @__PURE__ */ s(
|
|
62
|
+
/* @__PURE__ */ s(j, { color: p, size: "1.2rem", children: u })
|
|
62
63
|
] });
|
|
63
64
|
};
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
J as default
|
|
66
67
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as C } from "react";
|
|
3
|
-
import { UploadBtnContainer as
|
|
4
|
-
import
|
|
3
|
+
import { UploadBtnContainer as j, Wrapper as M, HiddenInput as W, PWrapper as b } from "./styles.js";
|
|
4
|
+
import B from "../../../colors/white.js";
|
|
5
5
|
import x from "../../../colors/blue.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { SIZE as
|
|
11
|
-
const
|
|
6
|
+
import F from "../../../colors/grey.js";
|
|
7
|
+
import H from "../../Icons/Link/Link.js";
|
|
8
|
+
import P from "../../../colors/index.js";
|
|
9
|
+
import Z from "../../Ripple/Ripple.js";
|
|
10
|
+
import { SIZE as q, MEDIUM as A } from "./constants.js";
|
|
11
|
+
const G = ({ theme: e, children: l }) => /* @__PURE__ */ o(Z, { rippleColor: e.m100, children: l }), oo = ({
|
|
12
12
|
label: e,
|
|
13
13
|
labelColor: l,
|
|
14
14
|
theme: p = x,
|
|
15
|
-
size: D =
|
|
15
|
+
size: D = A,
|
|
16
16
|
width: s,
|
|
17
17
|
isLoading: t,
|
|
18
18
|
disabled: r,
|
|
19
|
-
prefixIcon: c =
|
|
19
|
+
prefixIcon: c = H,
|
|
20
20
|
suffixIcon: m,
|
|
21
21
|
type: I = "file",
|
|
22
22
|
accept: R,
|
|
23
23
|
isMultiple: k,
|
|
24
|
-
onChange: z
|
|
24
|
+
onChange: z,
|
|
25
|
+
...K
|
|
25
26
|
}) => {
|
|
26
|
-
const u = C(null), { m400:
|
|
27
|
-
|
|
27
|
+
const u = C(null), { m400: v, m500: E, m600: U } = P[p] ?? x, { height: h, width: a, font: n } = q[D] || {}, f = l || ["white", "yellow"].includes(p) ? F.m600 : B, $ = C(0), w = /* @__PURE__ */ g(
|
|
28
|
+
M,
|
|
28
29
|
{
|
|
29
|
-
$selectedColor:
|
|
30
|
-
$hoverColor:
|
|
30
|
+
$selectedColor: v,
|
|
31
|
+
$hoverColor: E,
|
|
31
32
|
$height: h,
|
|
32
33
|
$width: s || a,
|
|
33
|
-
$activeColor:
|
|
34
|
+
$activeColor: U,
|
|
34
35
|
disabled: r,
|
|
35
36
|
$isLoading: t,
|
|
36
37
|
role: "button",
|
|
@@ -51,7 +52,7 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(P, { rippleColor: e.m
|
|
|
51
52
|
},
|
|
52
53
|
children: [
|
|
53
54
|
/* @__PURE__ */ o(
|
|
54
|
-
|
|
55
|
+
W,
|
|
55
56
|
{
|
|
56
57
|
ref: u,
|
|
57
58
|
type: I,
|
|
@@ -64,7 +65,7 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(P, { rippleColor: e.m
|
|
|
64
65
|
),
|
|
65
66
|
c && /* @__PURE__ */ o(c, { color: f, size: n + 19 }),
|
|
66
67
|
/* @__PURE__ */ o(
|
|
67
|
-
|
|
68
|
+
b,
|
|
68
69
|
{
|
|
69
70
|
color: f,
|
|
70
71
|
size: `${n}rem`,
|
|
@@ -79,8 +80,18 @@ const A = ({ theme: e, children: l }) => /* @__PURE__ */ o(P, { rippleColor: e.m
|
|
|
79
80
|
]
|
|
80
81
|
}
|
|
81
82
|
);
|
|
82
|
-
return /* @__PURE__ */ o(
|
|
83
|
+
return /* @__PURE__ */ o(
|
|
84
|
+
j,
|
|
85
|
+
{
|
|
86
|
+
$height: h,
|
|
87
|
+
$width: s || a,
|
|
88
|
+
disabled: r,
|
|
89
|
+
$isLoading: t,
|
|
90
|
+
...K,
|
|
91
|
+
children: t || r ? w : /* @__PURE__ */ o(G, { theme: p, children: w })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
83
94
|
};
|
|
84
95
|
export {
|
|
85
|
-
|
|
96
|
+
oo as default
|
|
86
97
|
};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import $ from "../../Typography/P/P.js";
|
|
3
3
|
import m from "../../../colors/blue.js";
|
|
4
|
-
import { Wrapper as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { Wrapper as y, HiddenInput as D, CircleBorder as w, Circle as x } from "./styles.js";
|
|
5
|
+
const C = ({
|
|
6
|
+
label: s,
|
|
7
|
+
value: r,
|
|
8
|
+
name: p,
|
|
9
|
+
color: e,
|
|
10
|
+
textColor: f,
|
|
11
|
+
isSelected: d,
|
|
12
|
+
disabled: t,
|
|
13
|
+
onChange: i,
|
|
14
|
+
...c
|
|
15
|
+
}) => {
|
|
16
|
+
const o = (e == null ? void 0 : e.m500) ?? m.m500, a = (e == null ? void 0 : e.m800) ?? m.m800;
|
|
17
|
+
return /* @__PURE__ */ u(y, { $disabled: t, $focusShade: a, ...c, children: [
|
|
8
18
|
/* @__PURE__ */ n(
|
|
9
|
-
|
|
19
|
+
D,
|
|
10
20
|
{
|
|
11
21
|
type: "radio",
|
|
12
22
|
name: p,
|
|
@@ -19,10 +29,10 @@ const k = ({ label: s, value: r, name: p, color: e, textColor: f, isSelected: d,
|
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
31
|
),
|
|
22
|
-
/* @__PURE__ */ n(
|
|
23
|
-
/* @__PURE__ */ n(
|
|
32
|
+
/* @__PURE__ */ n(w, { "aria-hidden": "true", $isSelected: d, $shade: a, children: /* @__PURE__ */ n(x, { $isSelected: d, $shade: o }) }),
|
|
33
|
+
/* @__PURE__ */ n($, { color: f, size: "1.2rem", children: s })
|
|
24
34
|
] });
|
|
25
35
|
};
|
|
26
36
|
export {
|
|
27
|
-
|
|
37
|
+
C as default
|
|
28
38
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createElement as
|
|
3
|
-
import { getColor as
|
|
4
|
-
import
|
|
5
|
-
import { Wrapper as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as u, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as h } from "react";
|
|
3
|
+
import { getColor as x } from "../Checkbox/helpers.js";
|
|
4
|
+
import j from "../Radio/Radio.js";
|
|
5
|
+
import { Wrapper as k } from "./styles.js";
|
|
6
|
+
const y = ({
|
|
7
7
|
options: i,
|
|
8
8
|
color: n = "blue",
|
|
9
9
|
value: o,
|
|
@@ -11,34 +11,36 @@ const v = ({
|
|
|
11
11
|
isHorizonatal: d,
|
|
12
12
|
label: e,
|
|
13
13
|
ariaLabel: m,
|
|
14
|
-
name: c
|
|
14
|
+
name: c,
|
|
15
|
+
...l
|
|
15
16
|
}) => {
|
|
16
|
-
const
|
|
17
|
+
const s = x(n), t = (r) => {
|
|
17
18
|
r !== o && a(r);
|
|
18
|
-
},
|
|
19
|
-
|
|
19
|
+
}, f = (r) => /* @__PURE__ */ h(
|
|
20
|
+
j,
|
|
20
21
|
{
|
|
21
22
|
...r,
|
|
22
23
|
key: r == null ? void 0 : r.value,
|
|
23
24
|
name: c,
|
|
24
|
-
color:
|
|
25
|
+
color: s,
|
|
25
26
|
isSelected: o === (r == null ? void 0 : r.value),
|
|
26
|
-
onChange:
|
|
27
|
+
onChange: t
|
|
27
28
|
}
|
|
28
29
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
30
|
+
return /* @__PURE__ */ u(
|
|
31
|
+
k,
|
|
31
32
|
{
|
|
32
33
|
role: "radiogroup",
|
|
33
34
|
"aria-label": e ? void 0 : m,
|
|
34
35
|
$isHorizonatal: d,
|
|
36
|
+
...l,
|
|
35
37
|
children: [
|
|
36
|
-
e && /* @__PURE__ */
|
|
37
|
-
i.map(
|
|
38
|
+
e && /* @__PURE__ */ g("legend", { children: e }),
|
|
39
|
+
i.map(f)
|
|
38
40
|
]
|
|
39
41
|
}
|
|
40
42
|
);
|
|
41
43
|
};
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
y as default
|
|
44
46
|
};
|