@dss-kit/ui-kit 1.0.3 → 1.1.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 +19 -0
- package/dist/components/builders/Sheet/SheetLayer.js +95 -83
- package/dist/components/builders/Sheet/hooks/index.d.ts +1 -0
- package/dist/components/builders/Sheet/hooks/useMotionValueStyle.d.ts +8 -0
- package/dist/components/builders/Sheet/hooks/useMotionValueStyle.js +14 -0
- package/dist/components/builders/Table/TablePagination/TablePagination.d.ts +10 -4
- package/dist/components/builders/Table/TablePagination/TablePagination.js +230 -177
- package/dist/components/builders/Text/Text.d.ts +4 -1
- package/dist/components/builders/Text/Text.js +78 -76
- package/dist/components/controls/Button/Button.d.ts +1 -1
- package/dist/components/controls/Button/Button.js +47 -46
- package/dist/components/controls/OtpInput/OtpInput.js +121 -143
- package/dist/components/controls/OtpInput/styles.d.ts +1 -0
- package/dist/components/controls/OtpInput/styles.js +9 -3
- package/dist/components/controls/Select/Select.js +72 -70
- package/dist/components/controls/Switch/Switch.d.ts +10 -6
- package/dist/components/controls/Switch/Switch.js +109 -86
- package/dist/components/controls/Switch/styles.d.ts +3 -2
- package/dist/components/controls/Switch/styles.js +76 -73
- package/dist/components/shared/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/shared/Toast/ToastContainer.js +25 -23
- package/dist/fonts/inter-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-600.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-800.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-400.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-500.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-600.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-700.woff2 +0 -0
- package/dist/fonts/inter-latin-cyrillic-800.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-400.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-500.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-600.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-700.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-800.woff2 +0 -0
- package/dist/index.js +34 -32
- package/dist/providers/MotionProvider/MotionProvider.d.ts +9 -0
- package/dist/providers/MotionProvider/MotionProvider.js +21 -0
- package/dist/providers/MotionProvider/MotionProvider.types.d.ts +12 -0
- package/dist/providers/MotionProvider/features.d.ts +1 -0
- package/dist/providers/MotionProvider/features.js +4 -0
- package/dist/providers/MotionProvider/index.d.ts +2 -0
- package/dist/providers/MotionProvider/loadMotionFeatures.d.ts +13 -0
- package/dist/providers/MotionProvider/loadMotionFeatures.js +9 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/styles/utils/breakpoints.d.ts +12 -0
- package/dist/styles/utils/breakpoints.js +20 -13
- package/dist/styles/utils/breakpoints.ts +32 -0
- package/dist/ui-kit.cjs +8 -8
- package/dist/ui-kit.css +1 -1
- package/package.json +3 -1
- package/dist/fonts/inter-normal-200.woff2 +0 -0
- package/dist/fonts/inter-normal-300.woff2 +0 -0
- package/dist/fonts/inter-normal-400.woff2 +0 -0
- package/dist/fonts/inter-normal-500.woff2 +0 -0
- package/dist/fonts/inter-normal-600.woff2 +0 -0
- package/dist/fonts/inter-normal-700.woff2 +0 -0
- package/dist/fonts/inter-normal-800.woff2 +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as _, css as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as m, jsxs as b, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { cx as _, css as P } from "@emotion/css";
|
|
3
|
+
import { m as k } from "framer-motion";
|
|
4
4
|
import { useMemo as n } from "react";
|
|
5
|
-
import { cornerRadiusValues as
|
|
6
|
-
import { Loader as
|
|
7
|
-
import { AnimatedText as
|
|
8
|
-
import { theme as
|
|
9
|
-
import { Box as
|
|
10
|
-
import {
|
|
11
|
-
|
|
5
|
+
import { cornerRadiusValues as o, baseButton as q, getVariantStyles as D, typeStyles as E, sizeValues as G } from "./styles.js";
|
|
6
|
+
import { Loader as H } from "../../builders/Loader/Loader.js";
|
|
7
|
+
import { AnimatedText as I } from "../../builders/Text/Text.js";
|
|
8
|
+
import { theme as J } from "../../../utils/theme/index.js";
|
|
9
|
+
import { Box as K } from "../../builders/Box/Box.js";
|
|
10
|
+
import { MotionProvider as Q } from "../../../providers/MotionProvider/MotionProvider.js";
|
|
11
|
+
import { Ripple as U } from "../../builders/Ripple/Ripple.js";
|
|
12
|
+
const { color: u } = J, or = ({
|
|
12
13
|
disabled: a,
|
|
13
14
|
loading: l,
|
|
14
15
|
className: w,
|
|
@@ -18,14 +19,14 @@ const { color: u } = K, sr = ({
|
|
|
18
19
|
textClassName: S,
|
|
19
20
|
children: v,
|
|
20
21
|
variant: e = "filled",
|
|
21
|
-
backgroundColor:
|
|
22
|
-
textColor:
|
|
23
|
-
textFontWeight:
|
|
24
|
-
borderColor:
|
|
22
|
+
backgroundColor: i,
|
|
23
|
+
textColor: c,
|
|
24
|
+
textFontWeight: X,
|
|
25
|
+
borderColor: f,
|
|
25
26
|
color: r = "accent",
|
|
26
27
|
opacity: p,
|
|
27
28
|
borderRadius: x,
|
|
28
|
-
width:
|
|
29
|
+
width: d = "auto",
|
|
29
30
|
size: s = "md",
|
|
30
31
|
iconLeft: B,
|
|
31
32
|
iconRight: R,
|
|
@@ -35,15 +36,15 @@ const { color: u } = K, sr = ({
|
|
|
35
36
|
...j
|
|
36
37
|
}) => {
|
|
37
38
|
const h = n(() => {
|
|
38
|
-
switch (
|
|
39
|
+
switch (d) {
|
|
39
40
|
case "full":
|
|
40
41
|
return "100%";
|
|
41
42
|
case "auto":
|
|
42
43
|
return "fit-content";
|
|
43
44
|
default:
|
|
44
|
-
return
|
|
45
|
+
return d;
|
|
45
46
|
}
|
|
46
|
-
}, [
|
|
47
|
+
}, [d]), F = n(() => i || (e === "filled" ? r === "neutral" ? u.fill.neutral_secondary : r === "neutral-primary" ? u.fill.neutral_primary : `var(--fill-${r}-${t})` : "transparent"), [e, i, r, t]), M = n(() => {
|
|
47
48
|
if (t === "primary") {
|
|
48
49
|
if (r === "neutral" || r === "neutral-primary")
|
|
49
50
|
return u.text.secondary;
|
|
@@ -58,34 +59,34 @@ const { color: u } = K, sr = ({
|
|
|
58
59
|
} else if (r === "neutral" || r === "neutral-primary")
|
|
59
60
|
return "secondary";
|
|
60
61
|
return r;
|
|
61
|
-
}, [e, r, t]),
|
|
62
|
+
}, [e, r, t]), W = n(() => f || (e === "outline" ? r === "neutral-primary" ? u.border.neutral_alpha_basic : `var(--border-${r}-${t})` : "transparent"), [e, f, r, t]), A = n(() => {
|
|
62
63
|
switch (s) {
|
|
63
64
|
case "lg":
|
|
64
|
-
return
|
|
65
|
+
return o.lg;
|
|
65
66
|
case "md":
|
|
66
67
|
case "sm":
|
|
67
|
-
return
|
|
68
|
+
return o.md;
|
|
68
69
|
case "xs":
|
|
69
|
-
return
|
|
70
|
+
return o.sm;
|
|
70
71
|
default:
|
|
71
|
-
return
|
|
72
|
+
return o.md;
|
|
72
73
|
}
|
|
73
|
-
}, [s]),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
}, [s]), C = _(
|
|
75
|
+
q,
|
|
76
|
+
D(e, r, t, a),
|
|
77
|
+
E[e],
|
|
77
78
|
a ? N : void 0,
|
|
78
|
-
|
|
79
|
-
borderRadius: x ?
|
|
79
|
+
P({
|
|
80
|
+
borderRadius: x ? o[x] : A,
|
|
80
81
|
backgroundColor: F,
|
|
81
|
-
borderColor:
|
|
82
|
-
color:
|
|
82
|
+
borderColor: W,
|
|
83
|
+
color: c ?? `var(--text-${y})`,
|
|
83
84
|
width: h,
|
|
84
|
-
height:
|
|
85
|
+
height: G[s],
|
|
85
86
|
opacity: p || (a ? 0.7 : 1)
|
|
86
87
|
}),
|
|
87
88
|
$
|
|
88
|
-
),
|
|
89
|
+
), L = n(() => {
|
|
89
90
|
switch (s) {
|
|
90
91
|
case "lg":
|
|
91
92
|
case "md":
|
|
@@ -97,16 +98,16 @@ const { color: u } = K, sr = ({
|
|
|
97
98
|
return "body-1";
|
|
98
99
|
}
|
|
99
100
|
}, [s]);
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
|
|
101
|
+
return /* @__PURE__ */ m(
|
|
102
|
+
K,
|
|
102
103
|
{
|
|
103
104
|
className: _(g, w),
|
|
104
105
|
w: h,
|
|
105
106
|
flex: T,
|
|
106
107
|
relative: !0,
|
|
107
108
|
overflow: "hidden",
|
|
108
|
-
children: /* @__PURE__ */ b(
|
|
109
|
-
|
|
109
|
+
children: /* @__PURE__ */ m(Q, { children: /* @__PURE__ */ b(
|
|
110
|
+
k.button,
|
|
110
111
|
{
|
|
111
112
|
...j,
|
|
112
113
|
whileTap: !a && !l ? {
|
|
@@ -115,17 +116,17 @@ const { color: u } = K, sr = ({
|
|
|
115
116
|
transition: { duration: 0 }
|
|
116
117
|
} : {},
|
|
117
118
|
disabled: a || l,
|
|
118
|
-
className:
|
|
119
|
+
className: C,
|
|
119
120
|
type: V,
|
|
120
121
|
children: [
|
|
121
|
-
l ? /* @__PURE__ */
|
|
122
|
+
l ? /* @__PURE__ */ m(H, { color: M }) : /* @__PURE__ */ b(O, { children: [
|
|
122
123
|
B,
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
124
|
+
/* @__PURE__ */ m(
|
|
125
|
+
I,
|
|
125
126
|
{
|
|
126
|
-
style: { color:
|
|
127
|
+
style: { color: c },
|
|
127
128
|
colorName: y,
|
|
128
|
-
variant:
|
|
129
|
+
variant: L,
|
|
129
130
|
className: S,
|
|
130
131
|
textOverflow: "ellipsis",
|
|
131
132
|
overflow: "hidden",
|
|
@@ -134,13 +135,13 @@ const { color: u } = K, sr = ({
|
|
|
134
135
|
),
|
|
135
136
|
R
|
|
136
137
|
] }),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ m(U, {})
|
|
138
139
|
]
|
|
139
140
|
}
|
|
140
|
-
)
|
|
141
|
+
) })
|
|
141
142
|
}
|
|
142
143
|
);
|
|
143
144
|
};
|
|
144
145
|
export {
|
|
145
|
-
|
|
146
|
+
or as Button
|
|
146
147
|
};
|
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { styles as y } from "./styles.js";
|
|
1
|
+
import { jsxs as H, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { cx as k, css as ar } from "@emotion/css";
|
|
3
|
+
import { forwardRef as cr, useState as nr, useRef as $, useEffect as ur, useCallback as D, useImperativeHandle as fr } from "react";
|
|
4
|
+
import { styles as m } from "./styles.js";
|
|
6
5
|
import { usePrevious as lr } from "./usePrevious.js";
|
|
7
|
-
import { useControlled as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { theme as
|
|
10
|
-
import { Text as
|
|
11
|
-
const { spacing:
|
|
6
|
+
import { useControlled as ir } from "../../../utils/hooks/useControlled.js";
|
|
7
|
+
import { Box as V } from "../../builders/Box/Box.js";
|
|
8
|
+
import { theme as mr } from "../../../utils/theme/index.js";
|
|
9
|
+
import { Text as b } from "../../builders/Text/Text.js";
|
|
10
|
+
const { spacing: d } = mr, pr = cr(
|
|
12
11
|
({
|
|
13
|
-
length:
|
|
14
|
-
label:
|
|
15
|
-
prompt:
|
|
16
|
-
error:
|
|
17
|
-
errorText:
|
|
18
|
-
success:
|
|
19
|
-
disabled:
|
|
20
|
-
autoFocus:
|
|
21
|
-
center:
|
|
22
|
-
secure:
|
|
23
|
-
loading:
|
|
24
|
-
background:
|
|
12
|
+
length: o = 6,
|
|
13
|
+
label: _,
|
|
14
|
+
prompt: M,
|
|
15
|
+
error: R,
|
|
16
|
+
errorText: E,
|
|
17
|
+
success: q,
|
|
18
|
+
disabled: f,
|
|
19
|
+
autoFocus: G,
|
|
20
|
+
center: L,
|
|
21
|
+
secure: J,
|
|
22
|
+
loading: C,
|
|
23
|
+
background: Q = "gray",
|
|
25
24
|
numeric: w = !0,
|
|
26
|
-
className:
|
|
27
|
-
inputsContainerClassName:
|
|
28
|
-
inputClassName:
|
|
29
|
-
labelClassName:
|
|
30
|
-
promptClassName:
|
|
25
|
+
className: T,
|
|
26
|
+
inputsContainerClassName: U,
|
|
27
|
+
inputClassName: X,
|
|
28
|
+
labelClassName: Y,
|
|
29
|
+
promptClassName: Z,
|
|
31
30
|
errorClassName: P,
|
|
32
|
-
value:
|
|
31
|
+
value: p,
|
|
33
32
|
defaultValue: x,
|
|
34
|
-
onChange:
|
|
35
|
-
onComplete:
|
|
33
|
+
onChange: W,
|
|
34
|
+
onComplete: z
|
|
36
35
|
}, rr) => {
|
|
37
|
-
const A = typeof
|
|
38
|
-
A ?
|
|
39
|
-
|
|
40
|
-
), [
|
|
41
|
-
const r =
|
|
42
|
-
return Array.from({ length:
|
|
43
|
-
}),
|
|
44
|
-
|
|
36
|
+
const A = typeof p == "string", B = A ? p : x, K = typeof B == "string" ? B.slice(0, o) : "", [O, S] = ir(
|
|
37
|
+
A ? p : void 0,
|
|
38
|
+
K
|
|
39
|
+
), [a, l] = nr(() => {
|
|
40
|
+
const r = K.slice(0, o);
|
|
41
|
+
return Array.from({ length: o }, (e, t) => r[t] ?? "");
|
|
42
|
+
}), N = $(void 0), F = lr(p), c = $([]);
|
|
43
|
+
ur(() => {
|
|
45
44
|
if (!A) return;
|
|
46
|
-
const r =
|
|
47
|
-
if (r ===
|
|
48
|
-
if (r ===
|
|
49
|
-
|
|
45
|
+
const r = p ?? "";
|
|
46
|
+
if (r === F) return;
|
|
47
|
+
if (r === N.current) {
|
|
48
|
+
N.current = void 0;
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
52
|
-
const e = r.slice(0,
|
|
53
|
-
|
|
54
|
-
}, [A,
|
|
55
|
-
const n =
|
|
51
|
+
const e = r.slice(0, o);
|
|
52
|
+
l(Array.from({ length: o }, (t, s) => e[s] ?? ""));
|
|
53
|
+
}, [A, p, o, F]);
|
|
54
|
+
const n = D(
|
|
56
55
|
(r, e) => {
|
|
57
|
-
const t = r.slice(0,
|
|
58
|
-
e?.fromInternal && (
|
|
56
|
+
const t = r.slice(0, o);
|
|
57
|
+
e?.fromInternal && (N.current = t), S(t), W?.(t), t.length === o && z?.(t);
|
|
59
58
|
},
|
|
60
|
-
[
|
|
59
|
+
[o, W, z, S]
|
|
61
60
|
);
|
|
62
61
|
fr(
|
|
63
62
|
rr,
|
|
@@ -69,183 +68,162 @@ const { spacing: q } = pr, yr = nr(
|
|
|
69
68
|
c.current.forEach((r) => r?.blur());
|
|
70
69
|
},
|
|
71
70
|
get value() {
|
|
72
|
-
return
|
|
71
|
+
return O || "";
|
|
73
72
|
},
|
|
74
73
|
setValue: (r) => {
|
|
75
|
-
const e = r.slice(0,
|
|
76
|
-
|
|
74
|
+
const e = r.slice(0, o);
|
|
75
|
+
l(Array.from({ length: o }, (t, s) => e[s] ?? "")), n(e, { fromInternal: !0 });
|
|
77
76
|
},
|
|
78
77
|
clear: () => {
|
|
79
|
-
|
|
78
|
+
l(Array.from({ length: o }, () => "")), n("", { fromInternal: !0 });
|
|
80
79
|
}
|
|
81
80
|
}),
|
|
82
|
-
[
|
|
81
|
+
[o, n, O]
|
|
83
82
|
);
|
|
84
|
-
const tr =
|
|
83
|
+
const tr = D(
|
|
85
84
|
(r, e) => {
|
|
86
|
-
if (
|
|
85
|
+
if (f) return;
|
|
87
86
|
let t = e;
|
|
88
87
|
if (w && (t = t.replace(/\D/g, "")), t.length > 1) {
|
|
89
|
-
const u =
|
|
90
|
-
|
|
91
|
-
const
|
|
88
|
+
const u = a.slice(0, r).join("") + t + a.slice(r + 1).join(""), g = Array.from({ length: o }, (I, sr) => u[sr] ?? "");
|
|
89
|
+
l(g), n(u, { fromInternal: !0 });
|
|
90
|
+
const j = Math.min(r + t.length, o - 1), v = c.current[j];
|
|
92
91
|
v?.focus(), v?.select();
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
if (n(
|
|
94
|
+
const s = a[r], i = [...a];
|
|
95
|
+
i[r] = t, l(i);
|
|
96
|
+
const h = i.join("");
|
|
97
|
+
if (n(h, { fromInternal: !0 }), !s && t && r < o - 1) {
|
|
99
98
|
const u = c.current[r + 1];
|
|
100
99
|
u?.focus(), u?.select();
|
|
101
100
|
}
|
|
102
101
|
},
|
|
103
|
-
[
|
|
104
|
-
), er =
|
|
102
|
+
[a, f, o, w, n]
|
|
103
|
+
), er = D(
|
|
105
104
|
(r, e) => {
|
|
106
|
-
if (!
|
|
105
|
+
if (!f) {
|
|
107
106
|
if (e.key === "Backspace") {
|
|
108
107
|
e.preventDefault();
|
|
109
108
|
const t = c.current[r];
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
109
|
+
if (a[r]) {
|
|
110
|
+
const s = [...a];
|
|
111
|
+
s[r] = "", l(s), n(s.join(""), { fromInternal: !0 }), t?.focus();
|
|
113
112
|
return;
|
|
114
113
|
}
|
|
115
114
|
if (r > 0) {
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
const s = c.current[r - 1];
|
|
116
|
+
s?.focus(), s?.select();
|
|
118
117
|
}
|
|
119
118
|
return;
|
|
120
119
|
}
|
|
121
|
-
e.key === "ArrowLeft" && r > 0 && (e.preventDefault(), c.current[r - 1]?.focus()), e.key === "ArrowRight" && r <
|
|
120
|
+
e.key === "ArrowLeft" && r > 0 && (e.preventDefault(), c.current[r - 1]?.focus()), e.key === "ArrowRight" && r < o - 1 && (e.preventDefault(), c.current[r + 1]?.focus());
|
|
122
121
|
}
|
|
123
122
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
123
|
+
[a, f, o, n]
|
|
124
|
+
), or = D(
|
|
126
125
|
(r, e) => {
|
|
127
|
-
if (
|
|
126
|
+
if (f) return;
|
|
128
127
|
e.preventDefault();
|
|
129
128
|
let t = e.clipboardData.getData("text");
|
|
130
129
|
if (w && (t = t.replace(/\D/g, "")), !t) return;
|
|
131
|
-
const
|
|
132
|
-
for (let I = 0; I <
|
|
133
|
-
u[r + I] =
|
|
134
|
-
|
|
130
|
+
const s = o - r, i = Math.min(t.length, s), h = t.slice(0, i), u = [...a];
|
|
131
|
+
for (let I = 0; I < i; I++)
|
|
132
|
+
u[r + I] = h[I] ?? "";
|
|
133
|
+
l(u);
|
|
135
134
|
const g = u.join("");
|
|
136
135
|
n(g, { fromInternal: !0 });
|
|
137
|
-
const
|
|
136
|
+
const j = Math.min(r + i - 1, o - 1), v = c.current[j];
|
|
138
137
|
v?.focus(), v?.select();
|
|
139
138
|
},
|
|
140
|
-
[
|
|
139
|
+
[a, f, o, w, n]
|
|
141
140
|
);
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
return /* @__PURE__ */ H(V, { w: "full", gap: d.sm, className: T, center: L, children: [
|
|
142
|
+
_ && /* @__PURE__ */ y(
|
|
143
|
+
b,
|
|
145
144
|
{
|
|
146
145
|
variant: "body-2",
|
|
147
146
|
fontWeight: "regular",
|
|
148
147
|
colorName: "tertiary",
|
|
149
|
-
className:
|
|
150
|
-
children:
|
|
148
|
+
className: Y,
|
|
149
|
+
children: _
|
|
151
150
|
}
|
|
152
151
|
),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
152
|
+
/* @__PURE__ */ y(
|
|
153
|
+
V,
|
|
155
154
|
{
|
|
156
155
|
row: !0,
|
|
157
156
|
w: "full",
|
|
158
|
-
gap:
|
|
159
|
-
center:
|
|
160
|
-
className:
|
|
157
|
+
gap: d.sm,
|
|
158
|
+
center: L,
|
|
159
|
+
className: k(
|
|
161
160
|
{
|
|
162
|
-
[
|
|
161
|
+
[m.disabled]: f
|
|
163
162
|
},
|
|
164
|
-
|
|
163
|
+
U
|
|
165
164
|
),
|
|
166
|
-
children: Array.from({ length:
|
|
165
|
+
children: Array.from({ length: o }).map((r, e) => (
|
|
167
166
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ H(V, { relative: !0, display: "inline-block", children: [
|
|
168
|
+
/* @__PURE__ */ y(
|
|
170
169
|
"input",
|
|
171
170
|
{
|
|
172
171
|
ref: (t) => {
|
|
173
172
|
c.current[e] = t;
|
|
174
173
|
},
|
|
175
|
-
className:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
className: k(
|
|
175
|
+
m.input,
|
|
176
|
+
m[Q],
|
|
177
|
+
R && m.error,
|
|
178
|
+
q && m.success,
|
|
179
|
+
a[e] && ar({ caretColor: "transparent" }),
|
|
180
|
+
X
|
|
182
181
|
),
|
|
183
182
|
inputMode: w ? "numeric" : "text",
|
|
184
|
-
type:
|
|
183
|
+
type: J ? "password" : "text",
|
|
185
184
|
maxLength: 1,
|
|
186
|
-
autoFocus:
|
|
187
|
-
disabled:
|
|
188
|
-
value:
|
|
185
|
+
autoFocus: G && e === 0,
|
|
186
|
+
disabled: f || C,
|
|
187
|
+
value: a[e],
|
|
189
188
|
onChange: (t) => tr(e, t.target.value),
|
|
190
189
|
onKeyDown: (t) => er(e, t),
|
|
191
|
-
onPaste: (t) =>
|
|
190
|
+
onPaste: (t) => or(e, t)
|
|
192
191
|
}
|
|
193
192
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
193
|
+
/* @__PURE__ */ y(
|
|
194
|
+
"span",
|
|
196
195
|
{
|
|
197
|
-
className:
|
|
198
|
-
|
|
199
|
-
custom: e,
|
|
200
|
-
initial: "idle",
|
|
201
|
-
animate: R ? "wave" : "idle"
|
|
196
|
+
className: k(m.glow, C && m.glowWave),
|
|
197
|
+
style: C ? { animationDelay: `${e * 150}ms` } : void 0
|
|
202
198
|
}
|
|
203
199
|
)
|
|
204
200
|
] }, e)
|
|
205
201
|
))
|
|
206
202
|
}
|
|
207
203
|
),
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
M && /* @__PURE__ */ y(
|
|
205
|
+
b,
|
|
210
206
|
{
|
|
211
207
|
variant: "caption-1",
|
|
212
208
|
colorName: "tertiary",
|
|
213
|
-
className:
|
|
214
|
-
children:
|
|
209
|
+
className: Z,
|
|
210
|
+
children: M
|
|
215
211
|
}
|
|
216
212
|
),
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
E && R && /* @__PURE__ */ y(
|
|
214
|
+
b,
|
|
219
215
|
{
|
|
220
216
|
variant: "body-2",
|
|
221
217
|
colorName: "negative",
|
|
222
218
|
fontWeight: "regular",
|
|
223
219
|
className: P,
|
|
224
|
-
children:
|
|
220
|
+
children: E
|
|
225
221
|
}
|
|
226
222
|
)
|
|
227
223
|
] });
|
|
228
224
|
}
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
opacity: 0,
|
|
232
|
-
scale: 1,
|
|
233
|
-
// без delay — мгновенное скрытие при переходе в idle
|
|
234
|
-
transition: { duration: 0.18 }
|
|
235
|
-
},
|
|
236
|
-
wave: (a = 0) => ({
|
|
237
|
-
// keyframes: вспышка opacity + небольшой scale для эффекта «волны»
|
|
238
|
-
opacity: [0, 0.2, 0],
|
|
239
|
-
scale: [1, 1.03, 1],
|
|
240
|
-
transition: {
|
|
241
|
-
duration: 1.5,
|
|
242
|
-
delay: a * 0.15,
|
|
243
|
-
repeat: 1 / 0,
|
|
244
|
-
ease: [0.42, 0, 0.58, 1]
|
|
245
|
-
}
|
|
246
|
-
})
|
|
247
|
-
};
|
|
248
|
-
yr.displayName = "OtpInput";
|
|
225
|
+
);
|
|
226
|
+
pr.displayName = "OtpInput";
|
|
249
227
|
export {
|
|
250
|
-
|
|
228
|
+
pr as OtpInput
|
|
251
229
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { css as o } from "@emotion/css";
|
|
1
|
+
import { css as o, keyframes as a } from "@emotion/css";
|
|
2
2
|
import { typography as e } from "../../../styles/utils/typography.js";
|
|
3
3
|
import { theme as i } from "../../../utils/theme/index.js";
|
|
4
|
-
const { color: r } = i,
|
|
4
|
+
const { color: r } = i, t = a({
|
|
5
|
+
"0%, 100%": { opacity: 0, transform: "scale(1)" },
|
|
6
|
+
"50%": { opacity: 0.2, transform: "scale(1.03)" }
|
|
7
|
+
}), l = {
|
|
5
8
|
input: o({
|
|
6
9
|
...e.common,
|
|
7
10
|
...e.body1,
|
|
@@ -52,8 +55,11 @@ const { color: r } = i, s = {
|
|
|
52
55
|
opacity: 0,
|
|
53
56
|
transformOrigin: "center",
|
|
54
57
|
background: r.fill.accent_primary
|
|
58
|
+
}),
|
|
59
|
+
glowWave: o({
|
|
60
|
+
animation: `${t} 1.5s cubic-bezier(0.42, 0, 0.58, 1) infinite`
|
|
55
61
|
})
|
|
56
62
|
};
|
|
57
63
|
export {
|
|
58
|
-
|
|
64
|
+
l as styles
|
|
59
65
|
};
|