mcr-design-systems 1.0.10 → 1.0.13
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/dist/components/Button/index.js +27 -34
- package/dist/components/CheckBox/index.js +33 -33
- package/dist/components/Icon/helper/index.d.ts +1 -1
- package/dist/components/InputBase/index.js +85 -79
- package/dist/components/InputPassword/index.js +23 -23
- package/dist/components/Loading/index.d.ts +2 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/PIN/index.js +83 -83
- package/dist/components/PhoneInput/helper/variants.d.ts +9 -0
- package/dist/components/PhoneInput/helper/variants.js +10 -7
- package/dist/components/PhoneInput/index.js +43 -43
- package/dist/components/TextField/HelperText.js +45 -39
- package/dist/components/TextField/index.js +22 -22
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as T, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { button as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { dataTestId as
|
|
3
|
+
import { button as v } from "./helper/index.js";
|
|
4
|
+
import { cn as w } from "../../shared/utils/cn.js";
|
|
5
|
+
import { dataTestId as L } from "../../shared/utils/dataTestId.js";
|
|
6
6
|
import a from "../Icon/Icon.js";
|
|
7
|
-
import { Typography as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { Typography as O } from "../Typography/index.js";
|
|
8
|
+
import S from "../Loading/index.js";
|
|
9
|
+
function D({
|
|
10
|
+
variant: i = "primary",
|
|
11
|
+
size: s = "medium",
|
|
11
12
|
iconOnly: u = !1,
|
|
12
13
|
leadingIcon: m,
|
|
13
14
|
trailingIcon: c,
|
|
14
|
-
icon:
|
|
15
|
+
icon: o,
|
|
15
16
|
loading: e = !1,
|
|
16
17
|
className: l,
|
|
17
18
|
children: d,
|
|
18
19
|
disabled: p,
|
|
19
20
|
...f
|
|
20
21
|
}) {
|
|
21
|
-
const
|
|
22
|
-
switch (
|
|
22
|
+
const r = u && !!o, h = () => {
|
|
23
|
+
switch (s) {
|
|
23
24
|
case "xx-small":
|
|
24
25
|
return 16;
|
|
25
26
|
case "x-small":
|
|
@@ -33,7 +34,7 @@ function A({
|
|
|
33
34
|
return 24;
|
|
34
35
|
}
|
|
35
36
|
}, x = () => {
|
|
36
|
-
switch (
|
|
37
|
+
switch (s) {
|
|
37
38
|
case "xx-small":
|
|
38
39
|
return "sm";
|
|
39
40
|
case "x-small":
|
|
@@ -47,40 +48,32 @@ function A({
|
|
|
47
48
|
default:
|
|
48
49
|
return "md";
|
|
49
50
|
}
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
name: "activity-heart",
|
|
54
|
-
size: s,
|
|
55
|
-
className: "animate-spin",
|
|
56
|
-
"aria-hidden": "true"
|
|
57
|
-
}
|
|
58
|
-
) : null, I = m && !e ? /* @__PURE__ */ r(a, { name: m, size: s, "aria-hidden": "true" }) : null, z = c && !e ? /* @__PURE__ */ r(a, { name: c, size: s, "aria-hidden": "true" }) : null, b = t && !e ? /* @__PURE__ */ r(a, { name: i, size: s, "aria-hidden": "true" }) : null;
|
|
59
|
-
return /* @__PURE__ */ v(
|
|
51
|
+
}, t = h(), y = e ? /* @__PURE__ */ n(S, { width: t, thickness: t / 5 }) : null, I = m && !e ? /* @__PURE__ */ n(a, { name: m, size: t, "aria-hidden": "true" }) : null, b = c && !e ? /* @__PURE__ */ n(a, { name: c, size: t, "aria-hidden": "true" }) : null, z = r && !e ? /* @__PURE__ */ n(a, { name: o, size: t, "aria-hidden": "true" }) : null;
|
|
52
|
+
return /* @__PURE__ */ T(
|
|
60
53
|
"button",
|
|
61
54
|
{
|
|
62
|
-
className:
|
|
63
|
-
|
|
64
|
-
variant:
|
|
65
|
-
size:
|
|
66
|
-
iconOnly:
|
|
67
|
-
spacing:
|
|
55
|
+
className: w(
|
|
56
|
+
v({
|
|
57
|
+
variant: i,
|
|
58
|
+
size: s,
|
|
59
|
+
iconOnly: r,
|
|
60
|
+
spacing: r ? void 0 : s
|
|
68
61
|
}),
|
|
69
62
|
l
|
|
70
63
|
),
|
|
71
64
|
disabled: p || e,
|
|
72
|
-
...
|
|
65
|
+
...L("button"),
|
|
73
66
|
...f,
|
|
74
67
|
children: [
|
|
75
68
|
e && y,
|
|
76
|
-
!e && !
|
|
77
|
-
!e &&
|
|
78
|
-
!
|
|
79
|
-
!e && !
|
|
69
|
+
!e && !r && I,
|
|
70
|
+
!e && r && z,
|
|
71
|
+
!r && /* @__PURE__ */ n(O, { as: "div", variants: "action", size: x(), children: d }),
|
|
72
|
+
!e && !r && b
|
|
80
73
|
]
|
|
81
74
|
}
|
|
82
75
|
);
|
|
83
76
|
}
|
|
84
77
|
export {
|
|
85
|
-
|
|
78
|
+
D as default
|
|
86
79
|
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { checkBoxInputContainerVariants as
|
|
4
|
-
import { Typography as
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import b, { useRef as k, useEffect as N } from "react";
|
|
3
|
+
import { checkBoxInputContainerVariants as I, checkBoxVariants as R } from "./variants.js";
|
|
4
|
+
import { Typography as d } from "../Typography/index.js";
|
|
5
5
|
import "clsx";
|
|
6
6
|
import "tailwind-merge";
|
|
7
|
-
import { dataTestId as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
7
|
+
import { dataTestId as z } from "../../shared/utils/dataTestId.js";
|
|
8
|
+
import B from "../Icon/Icon.js";
|
|
9
|
+
const j = b.forwardRef(
|
|
10
10
|
({
|
|
11
11
|
disabled: o,
|
|
12
12
|
label: m,
|
|
13
13
|
helpText: l,
|
|
14
14
|
id: f,
|
|
15
|
-
checked:
|
|
15
|
+
checked: a,
|
|
16
16
|
onChange: s,
|
|
17
17
|
indeterminate: t,
|
|
18
18
|
onCheckedChange: c,
|
|
19
19
|
checkBoxSize: u = "medium",
|
|
20
20
|
...h
|
|
21
|
-
},
|
|
22
|
-
const
|
|
21
|
+
}, n) => {
|
|
22
|
+
const p = k(null);
|
|
23
23
|
N(() => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
}, [t,
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
s && s(
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
24
|
+
const r = p.current || n?.current;
|
|
25
|
+
r && (r.indeterminate = !!t);
|
|
26
|
+
}, [t, n]);
|
|
27
|
+
const x = (r) => {
|
|
28
|
+
const v = r.target.checked;
|
|
29
|
+
s && s(r), c && c(v);
|
|
30
|
+
}, g = () => t ? "minus" : "check", y = () => t || a;
|
|
31
|
+
return /* @__PURE__ */ i("div", { ...z("checkbox"), className: "flex items-start gap-2", children: [
|
|
32
|
+
/* @__PURE__ */ i("div", { className: I({}), children: [
|
|
33
33
|
/* @__PURE__ */ e(
|
|
34
34
|
"input",
|
|
35
35
|
{
|
|
36
36
|
...h,
|
|
37
|
-
ref:
|
|
38
|
-
defaultChecked:
|
|
37
|
+
ref: n || p,
|
|
38
|
+
defaultChecked: a,
|
|
39
39
|
id: f,
|
|
40
|
-
value:
|
|
41
|
-
checked: s || c ?
|
|
42
|
-
className:
|
|
40
|
+
value: a ? "on" : "off",
|
|
41
|
+
checked: s || c ? a : void 0,
|
|
42
|
+
className: R({ disabled: o, indeterminate: t }),
|
|
43
43
|
type: "checkbox",
|
|
44
44
|
disabled: o,
|
|
45
|
-
onChange:
|
|
45
|
+
onChange: x
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
48
|
/* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
B,
|
|
50
50
|
{
|
|
51
|
-
className: `pointer-events-none absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transition-opacity text-fg-checkbox ${
|
|
51
|
+
className: `pointer-events-none absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transition-opacity text-fg-checkbox ${y() ? "opacity-100" : "opacity-0"}`,
|
|
52
52
|
size: 16,
|
|
53
|
-
name:
|
|
53
|
+
name: g()
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
] }),
|
|
57
|
-
m && /* @__PURE__ */
|
|
57
|
+
m && /* @__PURE__ */ i("div", { children: [
|
|
58
58
|
/* @__PURE__ */ e(
|
|
59
|
-
|
|
59
|
+
d,
|
|
60
60
|
{
|
|
61
61
|
htmlFor: f,
|
|
62
62
|
as: "label",
|
|
@@ -67,7 +67,7 @@ const w = k.forwardRef(
|
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
l && /* @__PURE__ */ e(
|
|
70
|
-
|
|
70
|
+
d,
|
|
71
71
|
{
|
|
72
72
|
variants: "paragraph",
|
|
73
73
|
size: u === "medium" ? "sm" : "md",
|
|
@@ -79,7 +79,7 @@ const w = k.forwardRef(
|
|
|
79
79
|
] });
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
|
|
82
|
+
j.displayName = "CheckBox";
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
j as default
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close';
|
|
1
|
+
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close' | 'refresh-cw_01';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { inputBaseVariants as
|
|
4
|
-
import
|
|
5
|
-
import { cn as
|
|
6
|
-
import { dataTestId as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import r, { forwardRef as D, useState as H, useMemo as B, useEffect as R, memo as _ } from "react";
|
|
3
|
+
import { inputBaseVariants as F, textAreaVariants as K } from "./variants.js";
|
|
4
|
+
import W from "../Icon/Icon.js";
|
|
5
|
+
import { cn as f } from "../../shared/utils/cn.js";
|
|
6
|
+
import { dataTestId as q } from "../../shared/utils/dataTestId.js";
|
|
7
|
+
const A = (n) => {
|
|
8
8
|
switch (n) {
|
|
9
9
|
case "sm":
|
|
10
10
|
return 16;
|
|
@@ -15,127 +15,134 @@ const q = (n) => {
|
|
|
15
15
|
default:
|
|
16
16
|
return 20;
|
|
17
17
|
}
|
|
18
|
-
}, N =
|
|
18
|
+
}, N = D(
|
|
19
19
|
({
|
|
20
20
|
disabled: n,
|
|
21
21
|
readOnly: a,
|
|
22
|
-
endAdornment:
|
|
23
|
-
className:
|
|
24
|
-
color:
|
|
25
|
-
sizeVariant:
|
|
26
|
-
startAdornment:
|
|
27
|
-
InputComponent:
|
|
22
|
+
endAdornment: l,
|
|
23
|
+
className: V,
|
|
24
|
+
color: w,
|
|
25
|
+
sizeVariant: v = "md",
|
|
26
|
+
startAdornment: b,
|
|
27
|
+
InputComponent: y,
|
|
28
28
|
containerProps: z,
|
|
29
|
-
containerRef:
|
|
30
|
-
width:
|
|
31
|
-
iconsSize:
|
|
29
|
+
containerRef: T,
|
|
30
|
+
width: C,
|
|
31
|
+
iconsSize: S,
|
|
32
32
|
error: j,
|
|
33
33
|
clearText: M,
|
|
34
34
|
optionalProps: h,
|
|
35
35
|
// inputSize,
|
|
36
36
|
...e
|
|
37
37
|
}, k) => {
|
|
38
|
-
const [L,
|
|
38
|
+
const [L, g] = H(!1), o = S || A(v), m = B(
|
|
39
39
|
() => `inputbase-input-${Math.random().toString(36).substring(2, 9)}`,
|
|
40
40
|
[]
|
|
41
|
-
),
|
|
41
|
+
), p = B(
|
|
42
42
|
() => `inputbase-textarea-${Math.random().toString(36).substring(2, 9)}`,
|
|
43
43
|
[]
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
R(() => {
|
|
46
46
|
const t = e.value;
|
|
47
47
|
if (t !== void 0) {
|
|
48
|
-
|
|
48
|
+
g(String(t).length > 0);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
|
|
51
|
+
const i = () => {
|
|
52
|
+
const c = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
53
|
+
if (c) {
|
|
54
|
+
const x = () => {
|
|
55
|
+
g(c.value.length > 0);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
57
|
+
return x(), c.addEventListener("input", x), () => {
|
|
58
|
+
c.removeEventListener("input", x);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
|
|
61
|
+
}, d = i();
|
|
62
|
+
if (!d) {
|
|
63
|
+
const c = setTimeout(() => {
|
|
64
|
+
i();
|
|
65
65
|
}, 100);
|
|
66
|
-
return () => clearTimeout(
|
|
66
|
+
return () => clearTimeout(c);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
69
|
-
}, [e.type, e.value,
|
|
70
|
-
const
|
|
71
|
-
|
|
68
|
+
return d;
|
|
69
|
+
}, [e.type, e.value, m, p]);
|
|
70
|
+
const E = M && L ? /* @__PURE__ */ u(
|
|
71
|
+
W,
|
|
72
72
|
{
|
|
73
73
|
name: "x-circle",
|
|
74
74
|
variant: "solid",
|
|
75
|
-
size:
|
|
76
|
-
className: "cursor-pointer
|
|
75
|
+
size: o,
|
|
76
|
+
className: "cursor-pointer text-fg-neutral-subtle",
|
|
77
77
|
onClick: () => {
|
|
78
|
-
|
|
79
|
-
const t = e.type === "textarea" ? document.getElementById(
|
|
80
|
-
if (t)
|
|
78
|
+
g(!1);
|
|
79
|
+
const t = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
80
|
+
if (t) {
|
|
81
81
|
if (t.value = "", e.onChange) {
|
|
82
|
-
const
|
|
82
|
+
const i = {
|
|
83
83
|
target: t,
|
|
84
84
|
currentTarget: t,
|
|
85
85
|
type: "change",
|
|
86
86
|
bubbles: !0
|
|
87
87
|
};
|
|
88
|
-
e.onChange(
|
|
88
|
+
e.onChange(i);
|
|
89
89
|
} else {
|
|
90
|
-
const
|
|
91
|
-
t.dispatchEvent(
|
|
90
|
+
const i = new Event("input", { bubbles: !0 }), d = new Event("change", { bubbles: !0 });
|
|
91
|
+
t.dispatchEvent(i), t.dispatchEvent(d);
|
|
92
92
|
}
|
|
93
|
+
t?.focus();
|
|
94
|
+
}
|
|
93
95
|
},
|
|
94
96
|
"aria-label": "Clear text"
|
|
95
97
|
}
|
|
96
|
-
) : null,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
) : null, s = E && l ? /* @__PURE__ */ I("div", { className: "flex items-center gap-2", children: [
|
|
99
|
+
E,
|
|
100
|
+
r.isValidElement(l) ? r.cloneElement(
|
|
101
|
+
l,
|
|
102
|
+
{
|
|
103
|
+
size: o
|
|
104
|
+
}
|
|
105
|
+
) : l
|
|
106
|
+
] }) : E || l, $ = {
|
|
100
107
|
sm: "h-4",
|
|
101
108
|
md: "h-5",
|
|
102
109
|
lg: "h-6"
|
|
103
110
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ u("div", { className: "relative justify-center items-center", children: /* @__PURE__ */ I(
|
|
105
112
|
"div",
|
|
106
113
|
{
|
|
107
|
-
...
|
|
108
|
-
ref:
|
|
114
|
+
...q("InputBase"),
|
|
115
|
+
ref: T,
|
|
109
116
|
...z,
|
|
110
|
-
className:
|
|
117
|
+
className: F({
|
|
111
118
|
disabled: !!n,
|
|
112
|
-
className:
|
|
113
|
-
color:
|
|
114
|
-
size: e?.type === "textarea" ? void 0 :
|
|
119
|
+
className: V,
|
|
120
|
+
color: w,
|
|
121
|
+
size: e?.type === "textarea" ? void 0 : v,
|
|
115
122
|
readOnly: !!a,
|
|
116
123
|
error: !!j
|
|
117
124
|
}),
|
|
118
|
-
style: { minWidth:
|
|
125
|
+
style: { minWidth: C ?? "100%" },
|
|
119
126
|
children: [
|
|
120
|
-
|
|
127
|
+
b && /* @__PURE__ */ u(
|
|
121
128
|
"div",
|
|
122
129
|
{
|
|
123
|
-
className:
|
|
130
|
+
className: f("flex cursor-pointer items-center justify-center", {
|
|
124
131
|
"color-icon-disabled": n || a,
|
|
125
132
|
"cursor-pointer": !n || a
|
|
126
133
|
}),
|
|
127
|
-
children:
|
|
134
|
+
children: r.cloneElement(b, {
|
|
128
135
|
// color: disabled || readOnly ? 'disabled' : 'currentColor',
|
|
129
|
-
size:
|
|
136
|
+
size: o
|
|
130
137
|
})
|
|
131
138
|
}
|
|
132
139
|
),
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
y ? r.cloneElement(
|
|
141
|
+
y,
|
|
135
142
|
{
|
|
136
|
-
id: e?.type === "textarea" ?
|
|
137
|
-
className:
|
|
138
|
-
e?.type === "textarea" ?
|
|
143
|
+
id: e?.type === "textarea" ? p : void 0,
|
|
144
|
+
className: f(
|
|
145
|
+
e?.type === "textarea" ? K({
|
|
139
146
|
size: h?.sizeTextArea,
|
|
140
147
|
disabled: !!n,
|
|
141
148
|
readOnly: !!a
|
|
@@ -147,13 +154,13 @@ const q = (n) => {
|
|
|
147
154
|
...e
|
|
148
155
|
},
|
|
149
156
|
null
|
|
150
|
-
) : /* @__PURE__ */
|
|
157
|
+
) : /* @__PURE__ */ u(
|
|
151
158
|
"input",
|
|
152
159
|
{
|
|
153
|
-
id: e.type === "textarea" ? void 0 :
|
|
154
|
-
className:
|
|
160
|
+
id: e.type === "textarea" ? void 0 : m,
|
|
161
|
+
className: f(
|
|
155
162
|
"w-full appearance-none bg-transparent font-sans outline-none",
|
|
156
|
-
$[
|
|
163
|
+
$[v || "md"]
|
|
157
164
|
),
|
|
158
165
|
ref: k,
|
|
159
166
|
disabled: n || a,
|
|
@@ -163,20 +170,19 @@ const q = (n) => {
|
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
),
|
|
166
|
-
|
|
173
|
+
s && /* @__PURE__ */ u(
|
|
167
174
|
"div",
|
|
168
175
|
{
|
|
169
|
-
className:
|
|
176
|
+
className: f("max-h flex items-center justify-center", {
|
|
170
177
|
"color-icon-disabled": n || a,
|
|
171
178
|
"cursor-pointer": !n || a
|
|
172
179
|
}),
|
|
173
|
-
children:
|
|
174
|
-
|
|
180
|
+
children: r.isValidElement(s) && s.type === "div" ? s : r.isValidElement(s) ? r.cloneElement(
|
|
181
|
+
s,
|
|
175
182
|
{
|
|
176
|
-
|
|
177
|
-
size: g
|
|
183
|
+
size: o
|
|
178
184
|
}
|
|
179
|
-
) :
|
|
185
|
+
) : s
|
|
180
186
|
}
|
|
181
187
|
)
|
|
182
188
|
]
|
|
@@ -185,7 +191,7 @@ const q = (n) => {
|
|
|
185
191
|
}
|
|
186
192
|
);
|
|
187
193
|
N.displayName = "InputBase";
|
|
188
|
-
const P =
|
|
194
|
+
const P = _(N);
|
|
189
195
|
export {
|
|
190
196
|
P as default
|
|
191
197
|
};
|
|
@@ -5,49 +5,49 @@ import I from "../TextField/HelperText.js";
|
|
|
5
5
|
import v from "../Icon/Icon.js";
|
|
6
6
|
const N = y(
|
|
7
7
|
({
|
|
8
|
-
helperText:
|
|
9
|
-
error:
|
|
10
|
-
showHelperIcon:
|
|
8
|
+
helperText: r,
|
|
9
|
+
error: a = !1,
|
|
10
|
+
showHelperIcon: n = !0,
|
|
11
11
|
helperIconCustom: l,
|
|
12
12
|
helperTextClassName: d,
|
|
13
13
|
defaultVisible: m = !1,
|
|
14
|
-
visible:
|
|
14
|
+
visible: t,
|
|
15
15
|
onVisibilityChange: c,
|
|
16
|
-
className:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const [p, w] = g(m),
|
|
20
|
-
if (
|
|
16
|
+
className: u,
|
|
17
|
+
...s
|
|
18
|
+
}, f) => {
|
|
19
|
+
const [p, w] = g(m), o = t !== void 0 ? t : p, b = () => {
|
|
20
|
+
if (s.disabled)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const i = !o;
|
|
23
|
+
t === void 0 && w(i), c?.(i);
|
|
24
24
|
};
|
|
25
25
|
return /* @__PURE__ */ x("div", { className: "w-full [&_input[type='password']::-ms-reveal]:hidden [&_input[type='password']::-ms-clear]:hidden", children: [
|
|
26
26
|
/* @__PURE__ */ e(
|
|
27
27
|
h,
|
|
28
28
|
{
|
|
29
|
-
...
|
|
30
|
-
ref:
|
|
31
|
-
type:
|
|
32
|
-
error:
|
|
33
|
-
className:
|
|
29
|
+
...s,
|
|
30
|
+
ref: f,
|
|
31
|
+
type: o ? "text" : "password",
|
|
32
|
+
error: a,
|
|
33
|
+
className: u,
|
|
34
|
+
clearText: !0,
|
|
34
35
|
endAdornment: /* @__PURE__ */ e(
|
|
35
36
|
v,
|
|
36
37
|
{
|
|
37
|
-
name:
|
|
38
|
-
|
|
39
|
-
className: `transition-colors ${t.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
38
|
+
name: o ? "eye" : "eye-off",
|
|
39
|
+
className: `transition-colors ${s.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
40
40
|
onClick: b
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
|
|
45
|
+
r && /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(
|
|
46
46
|
I,
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
error:
|
|
50
|
-
haveIcon:
|
|
48
|
+
text: r,
|
|
49
|
+
error: a,
|
|
50
|
+
haveIcon: n,
|
|
51
51
|
iconsCustom: l,
|
|
52
52
|
className: d
|
|
53
53
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface LoadingProps {
|
|
2
2
|
width?: string | number;
|
|
3
3
|
thickness?: number;
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
|
-
declare const Loading: ({ width, thickness }: LoadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const Loading: ({ width, thickness, className }: LoadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default Loading;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "clsx";
|
|
3
3
|
import "tailwind-merge";
|
|
4
|
-
import { dataTestId as
|
|
5
|
-
const
|
|
4
|
+
import { dataTestId as o } from "../../shared/utils/dataTestId.js";
|
|
5
|
+
const s = ({ width: a = 80, thickness: r = 12, className: t }) => /* @__PURE__ */ i(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
...
|
|
9
|
-
className:
|
|
8
|
+
...o("Loading"),
|
|
9
|
+
className: `loading-spinner ${t ?? ""}`,
|
|
10
10
|
style: {
|
|
11
|
-
width:
|
|
11
|
+
width: a,
|
|
12
12
|
aspectRatio: "1",
|
|
13
13
|
borderRadius: "50%",
|
|
14
|
-
background: `radial-gradient(farthest-side,
|
|
15
|
-
WebkitMask: `radial-gradient(farthest-side, #0000 calc(100% - ${
|
|
16
|
-
animation: "l13 1s infinite linear"
|
|
14
|
+
background: `radial-gradient(farthest-side, currentColor 94%, #0000) top/${r}px ${r}px no-repeat, conic-gradient(transparent 10%, currentColor)`,
|
|
15
|
+
WebkitMask: `radial-gradient(farthest-side, #0000 calc(100% - ${r}px), #fff 0)`,
|
|
16
|
+
animation: "l13 1s infinite linear",
|
|
17
|
+
color: "inherit"
|
|
18
|
+
// inherit color from Tailwind class
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
);
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
s as default
|
|
22
24
|
};
|