@spear-ai/spectral 1.3.60 → 1.3.62
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/Avatar.d.ts +12 -0
- package/dist/Avatar.js +88 -1
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +20 -20
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +99 -0
- package/dist/Icons/CheckmarkIcon.js +9 -9
- package/dist/Icons/MinusIcon.js +13 -13
- package/dist/InputOTP.d.ts +4 -1
- package/dist/InputOTP.js +268 -203
- package/dist/components/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +14 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/components/Checkbox/CheckboxBase.d.ts.map +1 -1
- package/dist/components/Icons/iconTypes.d.ts +1 -0
- package/dist/components/Icons/iconTypes.d.ts.map +1 -1
- package/dist/components/InputOTP/InputOTP.d.ts +4 -1
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/list.yml.webp +0 -0
- package/dist/styles/main.css +1 -1
- package/package.json +1 -1
- package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts +0 -3
- package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts.map +0 -1
- package/dist/features/HorizonColorGrid.js +0 -71
package/dist/InputOTP.js
CHANGED
|
@@ -1,188 +1,227 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
import { jsx as P, jsxs as it } from "react/jsx-runtime";
|
|
4
|
+
import "./Icons/AnnotationsIcon.js";
|
|
5
|
+
import "./Icons/CalendarIcon.js";
|
|
6
|
+
import "./Icons/CheckCircleIcon.js";
|
|
7
|
+
import "./Icons/CheckSquareIcon.js";
|
|
8
|
+
import "./Icons/CheckmarkIcon.js";
|
|
9
|
+
import "./Icons/ChevronDownIcon.js";
|
|
10
|
+
import "./Icons/ChevronUpIcon.js";
|
|
11
|
+
import "./Icons/ClockIcon.js";
|
|
12
|
+
import "./Icons/CloseCircleIcon.js";
|
|
13
|
+
import "./Icons/CloseIcon.js";
|
|
14
|
+
import "./Icons/DashboardIcon.js";
|
|
15
|
+
import "./Icons/DeleteIcon.js";
|
|
16
|
+
import "./Icons/DurationIcon.js";
|
|
17
|
+
import "./Icons/EmailIcon.js";
|
|
18
|
+
import "./Icons/EraserIcon.js";
|
|
19
|
+
import "./Icons/ErrorIcon.js";
|
|
20
|
+
import "./Icons/EyeClosedIcon.js";
|
|
21
|
+
import "./Icons/EyeClosedIcon2.js";
|
|
22
|
+
import "./Icons/EyeOpenIcon.js";
|
|
23
|
+
import "./Icons/GoToFirstIcon.js";
|
|
24
|
+
import "./Icons/GoToLastIcon.js";
|
|
25
|
+
import "./Icons/HarmonicCursorsIcon.js";
|
|
26
|
+
import "./Icons/InfoIcon.js";
|
|
27
|
+
import "./Icons/LabelIcon.js";
|
|
28
|
+
import "./Icons/LassoIcon.js";
|
|
29
|
+
import "./Icons/LineToolIcon.js";
|
|
30
|
+
import "./Icons/LiveViewIcon.js";
|
|
31
|
+
import "./Icons/LoaderIcon.js";
|
|
32
|
+
import "./Icons/LocationIcon.js";
|
|
33
|
+
import "./Icons/LogoutIcon.js";
|
|
34
|
+
import "./Icons/MetadataIcon.js";
|
|
35
|
+
import { MinusIcon as _t } from "./Icons/MinusIcon.js";
|
|
36
|
+
import "./Icons/OntologyIcon.js";
|
|
37
|
+
import "./Icons/PanelIconClose.js";
|
|
38
|
+
import "./Icons/PanelIconOpen.js";
|
|
39
|
+
import "./Icons/PlayIcon.js";
|
|
40
|
+
import "./Icons/PlusIcon.js";
|
|
41
|
+
import "./Icons/ResetIcon.js";
|
|
42
|
+
import "./Icons/ScissorsIcon.js";
|
|
43
|
+
import "./Icons/SettingsIcon.js";
|
|
44
|
+
import "./Icons/TrashIcon.js";
|
|
45
|
+
import "./Icons/UndoIcon.js";
|
|
46
|
+
import "./Icons/UserIcon.js";
|
|
47
|
+
import "./Icons/WarningIcon.js";
|
|
48
|
+
import "./Icons/ZoomAllIcon.js";
|
|
49
|
+
import "./Icons/ZoomXIcon.js";
|
|
50
|
+
import "./Icons/ZoomYIcon.js";
|
|
51
|
+
import { useFormFieldId as Ht, ErrorMessage as Gt, getErrorMessageId as $t } from "./utils/formFieldUtils.js";
|
|
52
|
+
import { c as yt } from "./twUtils-CRiPKpXj.js";
|
|
53
|
+
import * as n from "react";
|
|
54
|
+
import { createContext as Et, forwardRef as et, Fragment as Lt, useContext as Pt } from "react";
|
|
55
|
+
var zt = Object.defineProperty, Vt = Object.defineProperties, qt = Object.getOwnPropertyDescriptors, tt = Object.getOwnPropertySymbols, St = Object.prototype.hasOwnProperty, xt = Object.prototype.propertyIsEnumerable, wt = (t, r, a) => r in t ? zt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, Zt = (t, r) => {
|
|
56
|
+
for (var a in r || (r = {})) St.call(r, a) && wt(t, a, r[a]);
|
|
57
|
+
if (tt) for (var a of tt(r)) xt.call(r, a) && wt(t, a, r[a]);
|
|
58
|
+
return t;
|
|
59
|
+
}, Jt = (t, r) => Vt(t, qt(r)), Kt = (t, r) => {
|
|
60
|
+
var a = {};
|
|
61
|
+
for (var u in t) St.call(t, u) && r.indexOf(u) < 0 && (a[u] = t[u]);
|
|
62
|
+
if (t != null && tt) for (var u of tt(t)) r.indexOf(u) < 0 && xt.call(t, u) && (a[u] = t[u]);
|
|
63
|
+
return a;
|
|
25
64
|
};
|
|
26
|
-
function
|
|
27
|
-
let r = setTimeout(
|
|
28
|
-
return [r,
|
|
65
|
+
function Qt(t) {
|
|
66
|
+
let r = setTimeout(t, 0), a = setTimeout(t, 10), u = setTimeout(t, 50);
|
|
67
|
+
return [r, a, u];
|
|
29
68
|
}
|
|
30
|
-
function
|
|
31
|
-
let r =
|
|
32
|
-
return
|
|
33
|
-
r.current =
|
|
69
|
+
function Ut(t) {
|
|
70
|
+
let r = n.useRef();
|
|
71
|
+
return n.useEffect(() => {
|
|
72
|
+
r.current = t;
|
|
34
73
|
}), r.current;
|
|
35
74
|
}
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
let [
|
|
39
|
-
let
|
|
40
|
-
if (!
|
|
41
|
-
let
|
|
42
|
-
document.querySelectorAll(
|
|
43
|
-
}, [
|
|
44
|
-
return
|
|
45
|
-
let
|
|
46
|
-
if (!
|
|
47
|
-
function
|
|
48
|
-
let x = window.innerWidth -
|
|
49
|
-
|
|
75
|
+
var Xt = 18, Ct = 40, Yt = `${Ct}px`, te = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
76
|
+
function ee({ containerRef: t, inputRef: r, pushPasswordManagerStrategy: a, isFocused: u }) {
|
|
77
|
+
let [h, s] = n.useState(!1), [w, d] = n.useState(!1), [R, S] = n.useState(!1), D = n.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && h && w, [h, w, a]), T = n.useCallback(() => {
|
|
78
|
+
let f = t.current, g = r.current;
|
|
79
|
+
if (!f || !g || R || a === "none") return;
|
|
80
|
+
let v = f, x = v.getBoundingClientRect().left + v.offsetWidth, O = v.getBoundingClientRect().top + v.offsetHeight / 2, l = x - Xt, W = O;
|
|
81
|
+
document.querySelectorAll(te).length === 0 && document.elementFromPoint(l, W) === f || (s(!0), S(!0));
|
|
82
|
+
}, [t, r, R, a]);
|
|
83
|
+
return n.useEffect(() => {
|
|
84
|
+
let f = t.current;
|
|
85
|
+
if (!f || a === "none") return;
|
|
86
|
+
function g() {
|
|
87
|
+
let x = window.innerWidth - f.getBoundingClientRect().right;
|
|
88
|
+
d(x >= Ct);
|
|
50
89
|
}
|
|
51
|
-
|
|
52
|
-
let
|
|
90
|
+
g();
|
|
91
|
+
let v = setInterval(g, 1e3);
|
|
53
92
|
return () => {
|
|
54
|
-
clearInterval(
|
|
93
|
+
clearInterval(v);
|
|
55
94
|
};
|
|
56
|
-
}, [
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
59
|
-
let
|
|
60
|
-
|
|
95
|
+
}, [t, a]), n.useEffect(() => {
|
|
96
|
+
let f = u || document.activeElement === r.current;
|
|
97
|
+
if (a === "none" || !f) return;
|
|
98
|
+
let g = setTimeout(T, 0), v = setTimeout(T, 2e3), x = setTimeout(T, 5e3), O = setTimeout(() => {
|
|
99
|
+
S(!0);
|
|
61
100
|
}, 6e3);
|
|
62
101
|
return () => {
|
|
63
|
-
clearTimeout(
|
|
102
|
+
clearTimeout(g), clearTimeout(v), clearTimeout(x), clearTimeout(O);
|
|
64
103
|
};
|
|
65
|
-
}, [r, u,
|
|
104
|
+
}, [r, u, a, T]), { hasPWMBadge: h, willPushPWMBadge: D, PWM_BADGE_SPACE_WIDTH: Yt };
|
|
66
105
|
}
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
let [
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
let e = p.current,
|
|
74
|
-
if (!e || !
|
|
75
|
-
|
|
76
|
-
function
|
|
106
|
+
var ne = n.createContext({}), Mt = n.forwardRef((t, r) => {
|
|
107
|
+
var a = t, { value: u, onChange: h, maxLength: s, textAlign: w = "left", pattern: d, placeholder: R, inputMode: S = "numeric", onComplete: D, pushPasswordManagerStrategy: T = "increase-width", pasteTransformer: f, containerClassName: g, noScriptCSSFallback: v = re, render: x, children: O } = a, l = Kt(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), W, Q, U, B, I;
|
|
108
|
+
let [z, It] = n.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), c = u ?? z, F = Ut(c), V = n.useCallback((e) => {
|
|
109
|
+
h?.(e), It(e);
|
|
110
|
+
}, [h]), M = n.useMemo(() => d ? typeof d == "string" ? new RegExp(d) : d : null, [d]), p = n.useRef(null), nt = n.useRef(null), rt = n.useRef({ value: c, onChange: V, isIOS: typeof window < "u" && ((Q = (W = window?.CSS) == null ? void 0 : W.supports) == null ? void 0 : Q.call(W, "-webkit-touch-callout", "none")) }), X = n.useRef({ prev: [(U = p.current) == null ? void 0 : U.selectionStart, (B = p.current) == null ? void 0 : B.selectionEnd, (I = p.current) == null ? void 0 : I.selectionDirection] });
|
|
111
|
+
n.useImperativeHandle(r, () => p.current, []), n.useEffect(() => {
|
|
112
|
+
let e = p.current, o = nt.current;
|
|
113
|
+
if (!e || !o) return;
|
|
114
|
+
rt.current.value !== e.value && rt.current.onChange(e.value), X.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
|
|
115
|
+
function m() {
|
|
77
116
|
if (document.activeElement !== e) {
|
|
78
|
-
|
|
117
|
+
Z(null), J(null);
|
|
79
118
|
return;
|
|
80
119
|
}
|
|
81
|
-
let i = e.selectionStart,
|
|
82
|
-
if (
|
|
83
|
-
let
|
|
84
|
-
if (
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
else if (
|
|
88
|
-
else if (
|
|
89
|
-
let
|
|
120
|
+
let i = e.selectionStart, b = e.selectionEnd, Y = e.selectionDirection, C = e.maxLength, _ = e.value, k = X.current.prev, A = -1, j = -1, H;
|
|
121
|
+
if (_.length !== 0 && i !== null && b !== null) {
|
|
122
|
+
let Bt = i === b, Ft = i === _.length && _.length < C;
|
|
123
|
+
if (Bt && !Ft) {
|
|
124
|
+
let G = i;
|
|
125
|
+
if (G === 0) A = 0, j = 1, H = "forward";
|
|
126
|
+
else if (G === C) A = G - 1, j = G, H = "backward";
|
|
127
|
+
else if (C > 1 && _.length > 1) {
|
|
128
|
+
let lt = 0;
|
|
90
129
|
if (k[0] !== null && k[1] !== null) {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
|
|
130
|
+
H = G < k[1] ? "backward" : "forward";
|
|
131
|
+
let Nt = k[0] === k[1] && k[0] < C;
|
|
132
|
+
H === "backward" && !Nt && (lt = -1);
|
|
94
133
|
}
|
|
95
|
-
|
|
134
|
+
A = lt + G, j = lt + G + 1;
|
|
96
135
|
}
|
|
97
136
|
}
|
|
98
|
-
|
|
137
|
+
A !== -1 && j !== -1 && A !== j && p.current.setSelectionRange(A, j, H);
|
|
99
138
|
}
|
|
100
|
-
let
|
|
101
|
-
|
|
139
|
+
let gt = A !== -1 ? A : i, bt = j !== -1 ? j : b, Wt = H ?? Y;
|
|
140
|
+
Z(gt), J(bt), X.current.prev = [gt, bt, Wt];
|
|
102
141
|
}
|
|
103
|
-
if (document.addEventListener("selectionchange",
|
|
142
|
+
if (document.addEventListener("selectionchange", m, { capture: !0 }), m(), document.activeElement === e && ot(!0), !document.getElementById("input-otp-style")) {
|
|
104
143
|
let i = document.createElement("style");
|
|
105
144
|
if (i.id = "input-otp-style", document.head.appendChild(i), i.sheet) {
|
|
106
|
-
let
|
|
107
|
-
|
|
145
|
+
let b = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
146
|
+
K(i.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), K(i.sheet, `[data-input-otp]:autofill { ${b} }`), K(i.sheet, `[data-input-otp]:-webkit-autofill { ${b} }`), K(i.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), K(i.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
108
147
|
}
|
|
109
148
|
}
|
|
110
|
-
let
|
|
111
|
-
|
|
149
|
+
let y = () => {
|
|
150
|
+
o && o.style.setProperty("--root-height", `${e.clientHeight}px`);
|
|
112
151
|
};
|
|
113
|
-
|
|
114
|
-
let
|
|
115
|
-
return
|
|
116
|
-
document.removeEventListener("selectionchange",
|
|
152
|
+
y();
|
|
153
|
+
let E = new ResizeObserver(y);
|
|
154
|
+
return E.observe(e), () => {
|
|
155
|
+
document.removeEventListener("selectionchange", m, { capture: !0 }), E.disconnect();
|
|
117
156
|
};
|
|
118
157
|
}, []);
|
|
119
|
-
let [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
var e,
|
|
158
|
+
let [pt, dt] = n.useState(!1), [q, ot] = n.useState(!1), [N, Z] = n.useState(null), [$, J] = n.useState(null);
|
|
159
|
+
n.useEffect(() => {
|
|
160
|
+
Qt(() => {
|
|
161
|
+
var e, o, m, y;
|
|
123
162
|
(e = p.current) == null || e.dispatchEvent(new Event("input"));
|
|
124
|
-
let
|
|
125
|
-
|
|
163
|
+
let E = (o = p.current) == null ? void 0 : o.selectionStart, i = (m = p.current) == null ? void 0 : m.selectionEnd, b = (y = p.current) == null ? void 0 : y.selectionDirection;
|
|
164
|
+
E !== null && i !== null && (Z(E), J(i), X.current.prev = [E, i, b]);
|
|
126
165
|
});
|
|
127
|
-
}, [c,
|
|
128
|
-
|
|
129
|
-
}, [s,
|
|
130
|
-
let
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
166
|
+
}, [c, q]), n.useEffect(() => {
|
|
167
|
+
F !== void 0 && c !== F && F.length < s && c.length === s && D?.(c);
|
|
168
|
+
}, [s, D, F, c]);
|
|
169
|
+
let L = ee({ containerRef: nt, inputRef: p, pushPasswordManagerStrategy: T, isFocused: q }), mt = n.useCallback((e) => {
|
|
170
|
+
let o = e.currentTarget.value.slice(0, s);
|
|
171
|
+
if (o.length > 0 && M && !M.test(o)) {
|
|
133
172
|
e.preventDefault();
|
|
134
173
|
return;
|
|
135
174
|
}
|
|
136
|
-
typeof
|
|
137
|
-
}, [s,
|
|
175
|
+
typeof F == "string" && o.length < F.length && document.dispatchEvent(new Event("selectionchange")), V(o);
|
|
176
|
+
}, [s, V, F, M]), ft = n.useCallback(() => {
|
|
138
177
|
var e;
|
|
139
178
|
if (p.current) {
|
|
140
|
-
let
|
|
141
|
-
(e = p.current) == null || e.setSelectionRange(
|
|
179
|
+
let o = Math.min(p.current.value.length, s - 1), m = p.current.value.length;
|
|
180
|
+
(e = p.current) == null || e.setSelectionRange(o, m), Z(o), J(m);
|
|
142
181
|
}
|
|
143
|
-
|
|
144
|
-
}, [s]),
|
|
145
|
-
var
|
|
146
|
-
let
|
|
147
|
-
if (!
|
|
148
|
-
let
|
|
182
|
+
ot(!0);
|
|
183
|
+
}, [s]), vt = n.useCallback((e) => {
|
|
184
|
+
var o, m;
|
|
185
|
+
let y = p.current;
|
|
186
|
+
if (!f && (!rt.current.isIOS || !e.clipboardData || !y)) return;
|
|
187
|
+
let E = e.clipboardData.getData("text/plain"), i = f ? f(E) : E;
|
|
149
188
|
e.preventDefault();
|
|
150
|
-
let
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
let
|
|
154
|
-
|
|
155
|
-
}, [s,
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
}, onChange:
|
|
159
|
-
var
|
|
160
|
-
|
|
189
|
+
let b = (o = p.current) == null ? void 0 : o.selectionStart, Y = (m = p.current) == null ? void 0 : m.selectionEnd, C = (b !== Y ? c.slice(0, b) + i + c.slice(Y) : c.slice(0, b) + i + c.slice(b)).slice(0, s);
|
|
190
|
+
if (C.length > 0 && M && !M.test(C)) return;
|
|
191
|
+
y.value = C, V(C);
|
|
192
|
+
let _ = Math.min(C.length, s - 1), k = C.length;
|
|
193
|
+
y.setSelectionRange(_, k), Z(_), J(k);
|
|
194
|
+
}, [s, V, M, c]), At = n.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), ht = n.useMemo(() => ({ position: "absolute", inset: 0, width: L.willPushPWMBadge ? `calc(100% + ${L.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: L.willPushPWMBadge ? `inset(0 ${L.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: w, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [L.PWM_BADGE_SPACE_WIDTH, L.willPushPWMBadge, w]), jt = n.useMemo(() => n.createElement("input", Jt(Zt({ autoComplete: l.autoComplete || "one-time-code" }, l), { "data-input-otp": !0, "data-input-otp-placeholder-shown": c.length === 0 || void 0, "data-input-otp-mss": N, "data-input-otp-mse": $, inputMode: S, pattern: M?.source, "aria-placeholder": R, style: ht, maxLength: s, value: c, ref: p, onPaste: (e) => {
|
|
195
|
+
var o;
|
|
196
|
+
vt(e), (o = l.onPaste) == null || o.call(l, e);
|
|
197
|
+
}, onChange: mt, onMouseOver: (e) => {
|
|
198
|
+
var o;
|
|
199
|
+
dt(!0), (o = l.onMouseOver) == null || o.call(l, e);
|
|
161
200
|
}, onMouseLeave: (e) => {
|
|
162
|
-
var
|
|
163
|
-
|
|
201
|
+
var o;
|
|
202
|
+
dt(!1), (o = l.onMouseLeave) == null || o.call(l, e);
|
|
164
203
|
}, onFocus: (e) => {
|
|
165
|
-
var
|
|
166
|
-
|
|
204
|
+
var o;
|
|
205
|
+
ft(), (o = l.onFocus) == null || o.call(l, e);
|
|
167
206
|
}, onBlur: (e) => {
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
} })), [
|
|
171
|
-
var
|
|
172
|
-
let
|
|
173
|
-
return { char:
|
|
174
|
-
}), isFocused:
|
|
175
|
-
return
|
|
207
|
+
var o;
|
|
208
|
+
ot(!1), (o = l.onBlur) == null || o.call(l, e);
|
|
209
|
+
} })), [mt, ft, vt, S, ht, s, $, N, l, M?.source, c]), at = n.useMemo(() => ({ slots: Array.from({ length: s }).map((e, o) => {
|
|
210
|
+
var m;
|
|
211
|
+
let y = q && N !== null && $ !== null && (N === $ && o === N || o >= N && o < $), E = c[o] !== void 0 ? c[o] : null, i = c[0] !== void 0 ? null : (m = R?.[o]) != null ? m : null;
|
|
212
|
+
return { char: E, placeholderChar: i, isActive: y, hasFakeCaret: y && E === null };
|
|
213
|
+
}), isFocused: q, isHovering: !l.disabled && pt }), [q, pt, s, $, N, l.disabled, c]), Dt = n.useMemo(() => x ? x(at) : n.createElement(ne.Provider, { value: at }, O), [O, at, x]);
|
|
214
|
+
return n.createElement(n.Fragment, null, v !== null && n.createElement("noscript", null, n.createElement("style", null, v)), n.createElement("div", { ref: nt, "data-input-otp-container": !0, style: At, className: g }, Dt, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, jt)));
|
|
176
215
|
});
|
|
177
|
-
|
|
178
|
-
function
|
|
216
|
+
Mt.displayName = "Input";
|
|
217
|
+
function K(t, r) {
|
|
179
218
|
try {
|
|
180
|
-
|
|
219
|
+
t.insertRule(r);
|
|
181
220
|
} catch {
|
|
182
221
|
console.error("input-otp could not insert CSS rule:", r);
|
|
183
222
|
}
|
|
184
223
|
}
|
|
185
|
-
var
|
|
224
|
+
var re = `
|
|
186
225
|
[data-input-otp] {
|
|
187
226
|
--nojs-bg: white !important;
|
|
188
227
|
--nojs-fg: black !important;
|
|
@@ -202,101 +241,127 @@ var nt = `
|
|
|
202
241
|
--nojs-fg: white !important;
|
|
203
242
|
}
|
|
204
243
|
}`;
|
|
205
|
-
const
|
|
244
|
+
const kt = Et({}), Rt = Et(null), Tt = () => {
|
|
245
|
+
const t = Pt(Rt);
|
|
246
|
+
if (!t)
|
|
247
|
+
throw new Error("useRoot must be used within an InputOTP");
|
|
248
|
+
return t;
|
|
249
|
+
}, Ot = et(
|
|
206
250
|
({
|
|
207
|
-
|
|
251
|
+
autoFocus: t = !1,
|
|
208
252
|
children: r,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
inputMode:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
253
|
+
className: a,
|
|
254
|
+
errorMessage: u,
|
|
255
|
+
hasError: h,
|
|
256
|
+
id: s,
|
|
257
|
+
inputMode: w = "numeric",
|
|
258
|
+
maxLength: d,
|
|
259
|
+
name: R,
|
|
260
|
+
onChange: S,
|
|
261
|
+
onComplete: D,
|
|
262
|
+
value: T,
|
|
263
|
+
variant: f = "outlined",
|
|
264
|
+
groupSize: g,
|
|
265
|
+
separatorPositions: v,
|
|
266
|
+
...x
|
|
267
|
+
}, O) => {
|
|
268
|
+
const l = Ht(s, R), W = (B) => {
|
|
269
|
+
const I = B.clipboardData.getData("text/plain").trim();
|
|
270
|
+
I.length === d && typeof S == "function" && (S(""), setTimeout(() => {
|
|
271
|
+
typeof S == "function" && S(I);
|
|
225
272
|
}, 0));
|
|
226
|
-
};
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
|
|
273
|
+
}, Q = v ?? (g ? Array.from({ length: Math.ceil(d / g) - 1 }, (B, I) => (I + 1) * g) : []), U = g !== void 0 || v !== void 0;
|
|
274
|
+
return /* @__PURE__ */ P(kt.Provider, { value: { hasError: h }, children: /* @__PURE__ */ it("div", { className: "flex w-max flex-col gap-y-1", children: [
|
|
275
|
+
/* @__PURE__ */ P(
|
|
276
|
+
Mt,
|
|
230
277
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
onChange: h,
|
|
234
|
-
onComplete: y,
|
|
235
|
-
containerClassName: he(
|
|
278
|
+
autoFocus: t,
|
|
279
|
+
containerClassName: yt(
|
|
236
280
|
"flex items-center gap-2 has-[:disabled]:opacity-50 disabled:cursor-not-allowed",
|
|
237
|
-
|
|
281
|
+
a
|
|
238
282
|
),
|
|
239
|
-
maxLength: M,
|
|
240
|
-
autoFocus: I,
|
|
241
|
-
id: f,
|
|
242
|
-
inputMode: C,
|
|
243
|
-
textAlign: "center",
|
|
244
|
-
onPaste: x,
|
|
245
|
-
...m,
|
|
246
|
-
"data-testid": "input-otp",
|
|
247
|
-
pushPasswordManagerStrategy: "none",
|
|
248
283
|
"data-1p-ignore": "true",
|
|
284
|
+
"data-dashlane-disabled-on-field": "true",
|
|
249
285
|
"data-lpignore": "true",
|
|
250
286
|
"data-protonpass-ignore": "true",
|
|
251
|
-
"data-
|
|
252
|
-
|
|
287
|
+
"data-testid": "input-otp",
|
|
288
|
+
id: l,
|
|
289
|
+
inputMode: w,
|
|
290
|
+
maxLength: d,
|
|
291
|
+
onChange: S,
|
|
292
|
+
onComplete: D,
|
|
293
|
+
onPaste: W,
|
|
294
|
+
pushPasswordManagerStrategy: "none",
|
|
295
|
+
ref: O,
|
|
296
|
+
textAlign: "center",
|
|
297
|
+
value: T,
|
|
298
|
+
...x,
|
|
299
|
+
render: ({ slots: B }) => /* @__PURE__ */ P(Rt.Provider, { value: { slots: B, variant: f }, children: U ? /* @__PURE__ */ P(ut, { children: [...Array(d)].map((I, z) => /* @__PURE__ */ it(Lt, { children: [
|
|
300
|
+
Q.includes(z) && /* @__PURE__ */ P(ct, {}),
|
|
301
|
+
/* @__PURE__ */ P(st, { index: z })
|
|
302
|
+
] }, z)) }) : r })
|
|
253
303
|
}
|
|
254
304
|
),
|
|
255
|
-
|
|
305
|
+
h && u && /* @__PURE__ */ P(Gt, { id: $t(l), message: u })
|
|
256
306
|
] }) });
|
|
257
307
|
}
|
|
258
308
|
);
|
|
259
|
-
|
|
260
|
-
const
|
|
309
|
+
Ot.displayName = "InputOTP";
|
|
310
|
+
const ut = et(({ ...t }, r) => /* @__PURE__ */ P(
|
|
261
311
|
"div",
|
|
262
312
|
{
|
|
263
313
|
ref: r,
|
|
264
|
-
className: "flex items-center justify-between
|
|
265
|
-
...
|
|
314
|
+
className: "flex items-center justify-between justify-center gap-x-2",
|
|
315
|
+
...t,
|
|
266
316
|
"data-testid": "input-otp-group"
|
|
267
317
|
}
|
|
268
318
|
));
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
({ index:
|
|
272
|
-
const { slots:
|
|
273
|
-
return /* @__PURE__ */
|
|
319
|
+
ut.displayName = "InputOTP.Group";
|
|
320
|
+
const st = et(
|
|
321
|
+
({ index: t, className: r, ...a }, u) => {
|
|
322
|
+
const { variant: h = "outlined", slots: s = [] } = Tt(), { hasError: w } = Pt(kt), d = s[t] || { char: "", hasFakeCaret: !0, isActive: !1 };
|
|
323
|
+
return /* @__PURE__ */ it(
|
|
274
324
|
"div",
|
|
275
325
|
{
|
|
276
|
-
ref:
|
|
277
|
-
className:
|
|
278
|
-
"relative z-10 flex h-
|
|
279
|
-
|
|
280
|
-
|
|
326
|
+
ref: u,
|
|
327
|
+
className: yt(
|
|
328
|
+
"relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border-1 transition duration-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
329
|
+
h === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
|
|
330
|
+
!w && "border",
|
|
331
|
+
w && "border-danger-400 focus-visible:outline-danger-400 border-2",
|
|
332
|
+
d.isActive && !w && "outline-input-otp-border--focus z-10 outline-2 outline-offset-2",
|
|
333
|
+
d.isActive && w && "outline-danger-400 outline-2 outline-offset-2",
|
|
334
|
+
r
|
|
281
335
|
),
|
|
282
|
-
|
|
336
|
+
"data-index": t,
|
|
283
337
|
"data-testid": "input-otp-slot",
|
|
338
|
+
"data-variant": h,
|
|
339
|
+
...a,
|
|
284
340
|
children: [
|
|
285
|
-
|
|
286
|
-
|
|
341
|
+
d.char,
|
|
342
|
+
d.hasFakeCaret && /* @__PURE__ */ P("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ P("div", { className: "bg-input-otp-caret h-8 w-px" }) })
|
|
287
343
|
]
|
|
288
344
|
}
|
|
289
345
|
);
|
|
290
346
|
}
|
|
291
347
|
);
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
348
|
+
st.displayName = "InputOTP.Slot";
|
|
349
|
+
const ct = et(({ ...t }, r) => {
|
|
350
|
+
const { variant: a = "outlined" } = Tt();
|
|
351
|
+
return /* @__PURE__ */ P("div", { ref: r, role: "separator", ...t, "data-testid": "input-otp-separator", "data-variant": a, children: /* @__PURE__ */ P(
|
|
352
|
+
_t,
|
|
353
|
+
{
|
|
354
|
+
size: 24,
|
|
355
|
+
color: a === "filled" ? "var(--color-input-otp-filled-separator)" : "var(--color-input-otp-border)"
|
|
356
|
+
}
|
|
357
|
+
) });
|
|
358
|
+
});
|
|
359
|
+
ct.displayName = "InputOTP.Separator";
|
|
360
|
+
const en = Object.assign(Ot, {
|
|
361
|
+
Group: ut,
|
|
362
|
+
Slot: st,
|
|
363
|
+
Separator: ct
|
|
299
364
|
});
|
|
300
365
|
export {
|
|
301
|
-
|
|
366
|
+
en as InputOTP
|
|
302
367
|
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
type AvatarSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
userFullName?: string;
|
|
5
|
+
imageSource?: string;
|
|
6
|
+
icon?: ReactElement;
|
|
7
|
+
fallback?: ReactNode;
|
|
8
|
+
size?: AvatarSize;
|
|
9
|
+
className?: string;
|
|
10
|
+
alt?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Avatar: ({ userFullName, imageSource, icon, fallback, size, className, alt }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
13
|
export {};
|
|
2
14
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAEd,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE9C,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAgCD,eAAO,MAAM,MAAM,GAAI,qEAAgF,WAAW,4CAyGjH,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CheckboxBase } from './CheckboxBase';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxBase>, 'onCheckedChange'> {
|
|
4
|
+
checked?: boolean | 'indeterminate';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
id: string;
|
|
7
|
+
labelText: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
onCheckedChange: (value: boolean | 'indeterminate') => void;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
value?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAGhE,OAAO,EAAE,KAAK,wBAAwB,EAAiC,MAAM,OAAO,CAAA;AAEpF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAC3G,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,KAAK,IAAI,CAAA;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,QAAQ,6GAyCpB,CAAA"}
|