@spear-ai/spectral 1.3.58 → 1.3.60
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/.js +51 -49
- package/dist/Alert.d.ts +1 -1
- package/dist/Alert.js +3 -2
- package/dist/Button.d.ts +5 -5
- package/dist/Button.js +4 -5
- package/dist/ButtonIcon.d.ts +4 -4
- package/dist/ButtonIcon.js +1 -0
- package/dist/Dialog/DialogBase.d.ts +14 -14
- package/dist/Dialog/DialogBase.js +1 -1
- package/dist/Drawer.d.ts +6 -6
- package/dist/Icons/DashboardIcon.js +17 -27
- package/dist/Icons/MinusIcon.d.ts +3 -0
- package/dist/Icons/MinusIcon.js +26 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +40 -38
- package/dist/Input.js +1 -0
- package/dist/InputOTP.d.ts +29 -0
- package/dist/InputOTP.js +302 -0
- package/dist/PasswordInput-ClY_hxuN.js +261 -0
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +6 -6
- package/dist/RadioGroup.d.ts +7 -7
- package/dist/Select.d.ts +12 -12
- package/dist/Select.js +1 -0
- package/dist/Switch.d.ts +6 -6
- package/dist/Textarea.js +1 -0
- package/dist/Toggle/ToggleBase.d.ts +6 -4
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +8 -8
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +5 -5
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.ts +4 -4
- package/dist/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/dist/components/Dialog/DialogBase.d.ts +14 -14
- package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +6 -6
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Icons/DashboardIcon.d.ts.map +1 -1
- package/dist/components/Icons/MinusIcon.d.ts +3 -0
- package/dist/components/Icons/MinusIcon.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +1 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/InputOTP/InputOTP.d.ts +29 -0
- package/dist/components/InputOTP/InputOTP.d.ts.map +1 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts +6 -6
- package/dist/components/RadioButtonGroup/RadioButtonGroupBase.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +7 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +12 -12
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +6 -6
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Toggle/ToggleBase.d.ts +6 -4
- package/dist/components/Toggle/ToggleBase.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts +8 -8
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts.map +1 -1
- package/dist/features/AuthCard/AuthCard.d.ts.map +1 -1
- package/dist/features/AuthCard/AuthToggle.d.ts +9 -0
- package/dist/features/AuthCard/AuthToggle.d.ts.map +1 -0
- package/dist/features/AuthCard/AuthToggle.js +36 -0
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +11 -0
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +1 -0
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +92 -0
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +11 -0
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +1 -0
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +66 -0
- package/dist/features/AuthCard/OTPInput.d.ts +12 -0
- package/dist/features/AuthCard/OTPInput.d.ts.map +1 -0
- package/dist/features/AuthCard/OTPInput.js +30 -0
- package/dist/features/AuthCard/PasswordInput.d.ts +13 -0
- package/dist/features/AuthCard/PasswordInput.d.ts.map +1 -0
- package/dist/features/AuthCard/PasswordInput.js +56 -0
- package/dist/features/AuthCard/SignInForm.d.ts +9 -0
- package/dist/features/AuthCard/SignInForm.d.ts.map +1 -0
- package/dist/features/AuthCard/SignInForm.js +120 -0
- package/dist/features/AuthCard/SignUpForm.d.ts +8 -0
- package/dist/features/AuthCard/SignUpForm.d.ts.map +1 -0
- package/dist/features/AuthCard/SignUpForm.js +135 -0
- package/dist/features/AuthCard.js +234 -5124
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +1 -1
- package/dist/features/LabelingTools.js +47 -52
- package/dist/features/SensorMetadata.js +3 -2
- package/dist/features/SettingsPopover.js +3 -2
- package/dist/proxy-DD79Ok6n.js +4670 -0
- package/dist/styles/main.css +1 -1
- package/dist/utils/formFieldUtils.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OTPInputProps } from 'input-otp';
|
|
2
|
+
type InputOTPRootProps = Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerStrategy' | 'pasteTransformer' | 'noScriptCSSFallback' | 'placeholder' | 'containerClassName' | 'render'> & {
|
|
3
|
+
onComplete?: (...args: any[]) => void;
|
|
4
|
+
inputMode?: 'numeric' | 'text' | 'decimal' | 'tel' | 'search' | 'email' | 'url';
|
|
5
|
+
className?: string;
|
|
6
|
+
separator?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type InputOTPProps = InputOTPRootProps & ({
|
|
9
|
+
value: number | string;
|
|
10
|
+
onChange: (newValue: number | string) => void;
|
|
11
|
+
} | {
|
|
12
|
+
value?: never;
|
|
13
|
+
onChange?: never;
|
|
14
|
+
}) & ({
|
|
15
|
+
hasError: true;
|
|
16
|
+
errorMessage: string | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
hasError?: false;
|
|
19
|
+
errorMessage?: never;
|
|
20
|
+
});
|
|
21
|
+
export declare const InputOTP: import('react').ForwardRefExoticComponent<InputOTPProps & import('react').RefAttributes<HTMLInputElement>> & {
|
|
22
|
+
Group: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
Slot: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
index: number;
|
|
25
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Separator: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=InputOTP.d.ts.map
|
package/dist/InputOTP.js
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./styles/main.css";
|
|
3
|
+
import { jsx as j, jsxs as ge } from "react/jsx-runtime";
|
|
4
|
+
import { useFormFieldId as Be, ErrorMessage as _e, getErrorMessageId as Fe } from "./utils/formFieldUtils.js";
|
|
5
|
+
import { c as he } from "./twUtils-CRiPKpXj.js";
|
|
6
|
+
import * as t from "react";
|
|
7
|
+
import { createContext as He, forwardRef as Q, useContext as fe } from "react";
|
|
8
|
+
import { c as Le } from "./createLucideIcon-CI1yJrZf.js";
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.542.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
const Ge = [["path", { d: "M5 12h14", key: "1ays0h" }]], $e = Le("minus", Ge);
|
|
16
|
+
var ze = Object.defineProperty, Ve = Object.defineProperties, qe = Object.getOwnPropertyDescriptors, K = Object.getOwnPropertySymbols, be = Object.prototype.hasOwnProperty, we = Object.prototype.propertyIsEnumerable, ve = (n, r, l) => r in n ? ze(n, r, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[r] = l, Ze = (n, r) => {
|
|
17
|
+
for (var l in r || (r = {})) be.call(r, l) && ve(n, l, r[l]);
|
|
18
|
+
if (K) for (var l of K(r)) we.call(r, l) && ve(n, l, r[l]);
|
|
19
|
+
return n;
|
|
20
|
+
}, Je = (n, r) => Ve(n, qe(r)), Ke = (n, r) => {
|
|
21
|
+
var l = {};
|
|
22
|
+
for (var u in n) be.call(n, u) && r.indexOf(u) < 0 && (l[u] = n[u]);
|
|
23
|
+
if (n != null && K) for (var u of K(n)) r.indexOf(u) < 0 && we.call(n, u) && (l[u] = n[u]);
|
|
24
|
+
return l;
|
|
25
|
+
};
|
|
26
|
+
function Qe(n) {
|
|
27
|
+
let r = setTimeout(n, 0), l = setTimeout(n, 10), u = setTimeout(n, 50);
|
|
28
|
+
return [r, l, u];
|
|
29
|
+
}
|
|
30
|
+
function Ue(n) {
|
|
31
|
+
let r = t.useRef();
|
|
32
|
+
return t.useEffect(() => {
|
|
33
|
+
r.current = n;
|
|
34
|
+
}), r.current;
|
|
35
|
+
}
|
|
36
|
+
var Xe = 18, ye = 40, Ye = `${ye}px`, et = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
37
|
+
function tt({ containerRef: n, inputRef: r, pushPasswordManagerStrategy: l, isFocused: u }) {
|
|
38
|
+
let [g, s] = t.useState(!1), [C, y] = t.useState(!1), [h, D] = t.useState(!1), I = t.useMemo(() => l === "none" ? !1 : (l === "increase-width" || l === "experimental-no-flickering") && g && C, [g, C, l]), M = t.useCallback(() => {
|
|
39
|
+
let m = n.current, E = r.current;
|
|
40
|
+
if (!m || !E || h || l === "none") return;
|
|
41
|
+
let f = m, x = f.getBoundingClientRect().left + f.offsetWidth, T = f.getBoundingClientRect().top + f.offsetHeight / 2, o = x - Xe, L = T;
|
|
42
|
+
document.querySelectorAll(et).length === 0 && document.elementFromPoint(o, L) === m || (s(!0), D(!0));
|
|
43
|
+
}, [n, r, h, l]);
|
|
44
|
+
return t.useEffect(() => {
|
|
45
|
+
let m = n.current;
|
|
46
|
+
if (!m || l === "none") return;
|
|
47
|
+
function E() {
|
|
48
|
+
let x = window.innerWidth - m.getBoundingClientRect().right;
|
|
49
|
+
y(x >= ye);
|
|
50
|
+
}
|
|
51
|
+
E();
|
|
52
|
+
let f = setInterval(E, 1e3);
|
|
53
|
+
return () => {
|
|
54
|
+
clearInterval(f);
|
|
55
|
+
};
|
|
56
|
+
}, [n, l]), t.useEffect(() => {
|
|
57
|
+
let m = u || document.activeElement === r.current;
|
|
58
|
+
if (l === "none" || !m) return;
|
|
59
|
+
let E = setTimeout(M, 0), f = setTimeout(M, 2e3), x = setTimeout(M, 5e3), T = setTimeout(() => {
|
|
60
|
+
D(!0);
|
|
61
|
+
}, 6e3);
|
|
62
|
+
return () => {
|
|
63
|
+
clearTimeout(E), clearTimeout(f), clearTimeout(x), clearTimeout(T);
|
|
64
|
+
};
|
|
65
|
+
}, [r, u, l, M]), { hasPWMBadge: g, willPushPWMBadge: I, PWM_BADGE_SPACE_WIDTH: Ye };
|
|
66
|
+
}
|
|
67
|
+
var xe = t.createContext({}), Se = t.forwardRef((n, r) => {
|
|
68
|
+
var l = n, { value: u, onChange: g, maxLength: s, textAlign: C = "left", pattern: y, placeholder: h, inputMode: D = "numeric", onComplete: I, pushPasswordManagerStrategy: M = "increase-width", pasteTransformer: m, containerClassName: E, noScriptCSSFallback: f = nt, render: x, children: T } = l, o = Ke(l, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), L, ne, re, ae, le;
|
|
69
|
+
let [Te, Re] = t.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""), c = u ?? Te, A = Ue(c), G = t.useCallback((e) => {
|
|
70
|
+
g?.(e), Re(e);
|
|
71
|
+
}, [g]), P = t.useMemo(() => y ? typeof y == "string" ? new RegExp(y) : y : null, [y]), p = t.useRef(null), U = t.useRef(null), X = t.useRef({ value: c, onChange: G, isIOS: typeof window < "u" && ((ne = (L = window?.CSS) == null ? void 0 : L.supports) == null ? void 0 : ne.call(L, "-webkit-touch-callout", "none")) }), Z = t.useRef({ prev: [(re = p.current) == null ? void 0 : re.selectionStart, (ae = p.current) == null ? void 0 : ae.selectionEnd, (le = p.current) == null ? void 0 : le.selectionDirection] });
|
|
72
|
+
t.useImperativeHandle(r, () => p.current, []), t.useEffect(() => {
|
|
73
|
+
let e = p.current, a = U.current;
|
|
74
|
+
if (!e || !a) return;
|
|
75
|
+
X.current.value !== e.value && X.current.onChange(e.value), Z.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
|
|
76
|
+
function d() {
|
|
77
|
+
if (document.activeElement !== e) {
|
|
78
|
+
z(null), V(null);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let i = e.selectionStart, v = e.selectionEnd, J = e.selectionDirection, S = e.maxLength, W = e.value, k = Z.current.prev, R = -1, O = -1, B;
|
|
82
|
+
if (W.length !== 0 && i !== null && v !== null) {
|
|
83
|
+
let Ae = i === v, Ne = i === W.length && W.length < S;
|
|
84
|
+
if (Ae && !Ne) {
|
|
85
|
+
let _ = i;
|
|
86
|
+
if (_ === 0) R = 0, O = 1, B = "forward";
|
|
87
|
+
else if (_ === S) R = _ - 1, O = _, B = "backward";
|
|
88
|
+
else if (S > 1 && W.length > 1) {
|
|
89
|
+
let te = 0;
|
|
90
|
+
if (k[0] !== null && k[1] !== null) {
|
|
91
|
+
B = _ < k[1] ? "backward" : "forward";
|
|
92
|
+
let We = k[0] === k[1] && k[0] < S;
|
|
93
|
+
B === "backward" && !We && (te = -1);
|
|
94
|
+
}
|
|
95
|
+
R = te + _, O = te + _ + 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
R !== -1 && O !== -1 && R !== O && p.current.setSelectionRange(R, O, B);
|
|
99
|
+
}
|
|
100
|
+
let de = R !== -1 ? R : i, me = O !== -1 ? O : v, Ie = B ?? J;
|
|
101
|
+
z(de), V(me), Z.current.prev = [de, me, Ie];
|
|
102
|
+
}
|
|
103
|
+
if (document.addEventListener("selectionchange", d, { capture: !0 }), d(), document.activeElement === e && Y(!0), !document.getElementById("input-otp-style")) {
|
|
104
|
+
let i = document.createElement("style");
|
|
105
|
+
if (i.id = "input-otp-style", document.head.appendChild(i), i.sheet) {
|
|
106
|
+
let v = "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;";
|
|
107
|
+
q(i.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), q(i.sheet, `[data-input-otp]:autofill { ${v} }`), q(i.sheet, `[data-input-otp]:-webkit-autofill { ${v} }`), q(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; } }"), q(i.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
let b = () => {
|
|
111
|
+
a && a.style.setProperty("--root-height", `${e.clientHeight}px`);
|
|
112
|
+
};
|
|
113
|
+
b();
|
|
114
|
+
let w = new ResizeObserver(b);
|
|
115
|
+
return w.observe(e), () => {
|
|
116
|
+
document.removeEventListener("selectionchange", d, { capture: !0 }), w.disconnect();
|
|
117
|
+
};
|
|
118
|
+
}, []);
|
|
119
|
+
let [oe, ie] = t.useState(!1), [$, Y] = t.useState(!1), [N, z] = t.useState(null), [F, V] = t.useState(null);
|
|
120
|
+
t.useEffect(() => {
|
|
121
|
+
Qe(() => {
|
|
122
|
+
var e, a, d, b;
|
|
123
|
+
(e = p.current) == null || e.dispatchEvent(new Event("input"));
|
|
124
|
+
let w = (a = p.current) == null ? void 0 : a.selectionStart, i = (d = p.current) == null ? void 0 : d.selectionEnd, v = (b = p.current) == null ? void 0 : b.selectionDirection;
|
|
125
|
+
w !== null && i !== null && (z(w), V(i), Z.current.prev = [w, i, v]);
|
|
126
|
+
});
|
|
127
|
+
}, [c, $]), t.useEffect(() => {
|
|
128
|
+
A !== void 0 && c !== A && A.length < s && c.length === s && I?.(c);
|
|
129
|
+
}, [s, I, A, c]);
|
|
130
|
+
let H = tt({ containerRef: U, inputRef: p, pushPasswordManagerStrategy: M, isFocused: $ }), ue = t.useCallback((e) => {
|
|
131
|
+
let a = e.currentTarget.value.slice(0, s);
|
|
132
|
+
if (a.length > 0 && P && !P.test(a)) {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
typeof A == "string" && a.length < A.length && document.dispatchEvent(new Event("selectionchange")), G(a);
|
|
137
|
+
}, [s, G, A, P]), se = t.useCallback(() => {
|
|
138
|
+
var e;
|
|
139
|
+
if (p.current) {
|
|
140
|
+
let a = Math.min(p.current.value.length, s - 1), d = p.current.value.length;
|
|
141
|
+
(e = p.current) == null || e.setSelectionRange(a, d), z(a), V(d);
|
|
142
|
+
}
|
|
143
|
+
Y(!0);
|
|
144
|
+
}, [s]), ce = t.useCallback((e) => {
|
|
145
|
+
var a, d;
|
|
146
|
+
let b = p.current;
|
|
147
|
+
if (!m && (!X.current.isIOS || !e.clipboardData || !b)) return;
|
|
148
|
+
let w = e.clipboardData.getData("text/plain"), i = m ? m(w) : w;
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
let v = (a = p.current) == null ? void 0 : a.selectionStart, J = (d = p.current) == null ? void 0 : d.selectionEnd, S = (v !== J ? c.slice(0, v) + i + c.slice(J) : c.slice(0, v) + i + c.slice(v)).slice(0, s);
|
|
151
|
+
if (S.length > 0 && P && !P.test(S)) return;
|
|
152
|
+
b.value = S, G(S);
|
|
153
|
+
let W = Math.min(S.length, s - 1), k = S.length;
|
|
154
|
+
b.setSelectionRange(W, k), z(W), V(k);
|
|
155
|
+
}, [s, G, P, c]), Oe = t.useMemo(() => ({ position: "relative", cursor: o.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [o.disabled]), pe = t.useMemo(() => ({ position: "absolute", inset: 0, width: H.willPushPWMBadge ? `calc(100% + ${H.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: H.willPushPWMBadge ? `inset(0 ${H.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: C, 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" }), [H.PWM_BADGE_SPACE_WIDTH, H.willPushPWMBadge, C]), je = t.useMemo(() => t.createElement("input", Je(Ze({ autoComplete: o.autoComplete || "one-time-code" }, o), { "data-input-otp": !0, "data-input-otp-placeholder-shown": c.length === 0 || void 0, "data-input-otp-mss": N, "data-input-otp-mse": F, inputMode: D, pattern: P?.source, "aria-placeholder": h, style: pe, maxLength: s, value: c, ref: p, onPaste: (e) => {
|
|
156
|
+
var a;
|
|
157
|
+
ce(e), (a = o.onPaste) == null || a.call(o, e);
|
|
158
|
+
}, onChange: ue, onMouseOver: (e) => {
|
|
159
|
+
var a;
|
|
160
|
+
ie(!0), (a = o.onMouseOver) == null || a.call(o, e);
|
|
161
|
+
}, onMouseLeave: (e) => {
|
|
162
|
+
var a;
|
|
163
|
+
ie(!1), (a = o.onMouseLeave) == null || a.call(o, e);
|
|
164
|
+
}, onFocus: (e) => {
|
|
165
|
+
var a;
|
|
166
|
+
se(), (a = o.onFocus) == null || a.call(o, e);
|
|
167
|
+
}, onBlur: (e) => {
|
|
168
|
+
var a;
|
|
169
|
+
Y(!1), (a = o.onBlur) == null || a.call(o, e);
|
|
170
|
+
} })), [ue, se, ce, D, pe, s, F, N, o, P?.source, c]), ee = t.useMemo(() => ({ slots: Array.from({ length: s }).map((e, a) => {
|
|
171
|
+
var d;
|
|
172
|
+
let b = $ && N !== null && F !== null && (N === F && a === N || a >= N && a < F), w = c[a] !== void 0 ? c[a] : null, i = c[0] !== void 0 ? null : (d = h?.[a]) != null ? d : null;
|
|
173
|
+
return { char: w, placeholderChar: i, isActive: b, hasFakeCaret: b && w === null };
|
|
174
|
+
}), isFocused: $, isHovering: !o.disabled && oe }), [$, oe, s, F, N, o.disabled, c]), De = t.useMemo(() => x ? x(ee) : t.createElement(xe.Provider, { value: ee }, T), [T, ee, x]);
|
|
175
|
+
return t.createElement(t.Fragment, null, f !== null && t.createElement("noscript", null, t.createElement("style", null, f)), t.createElement("div", { ref: U, "data-input-otp-container": !0, style: Oe, className: E }, De, t.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, je)));
|
|
176
|
+
});
|
|
177
|
+
Se.displayName = "Input";
|
|
178
|
+
function q(n, r) {
|
|
179
|
+
try {
|
|
180
|
+
n.insertRule(r);
|
|
181
|
+
} catch {
|
|
182
|
+
console.error("input-otp could not insert CSS rule:", r);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
var nt = `
|
|
186
|
+
[data-input-otp] {
|
|
187
|
+
--nojs-bg: white !important;
|
|
188
|
+
--nojs-fg: black !important;
|
|
189
|
+
|
|
190
|
+
background-color: var(--nojs-bg) !important;
|
|
191
|
+
color: var(--nojs-fg) !important;
|
|
192
|
+
caret-color: var(--nojs-fg) !important;
|
|
193
|
+
letter-spacing: .25em !important;
|
|
194
|
+
text-align: center !important;
|
|
195
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
196
|
+
border-radius: 4px !important;
|
|
197
|
+
width: 100% !important;
|
|
198
|
+
}
|
|
199
|
+
@media (prefers-color-scheme: dark) {
|
|
200
|
+
[data-input-otp] {
|
|
201
|
+
--nojs-bg: black !important;
|
|
202
|
+
--nojs-fg: white !important;
|
|
203
|
+
}
|
|
204
|
+
}`;
|
|
205
|
+
const Ee = He({}), Pe = Q(
|
|
206
|
+
({
|
|
207
|
+
className: n,
|
|
208
|
+
children: r,
|
|
209
|
+
id: l,
|
|
210
|
+
name: u,
|
|
211
|
+
errorMessage: g,
|
|
212
|
+
hasError: s,
|
|
213
|
+
inputMode: C = "numeric",
|
|
214
|
+
onComplete: y,
|
|
215
|
+
onChange: h,
|
|
216
|
+
value: D,
|
|
217
|
+
autoFocus: I = !1,
|
|
218
|
+
maxLength: M,
|
|
219
|
+
...m
|
|
220
|
+
}, E) => {
|
|
221
|
+
const f = Be(l, u), x = (T) => {
|
|
222
|
+
const o = T.clipboardData.getData("text/plain").trim();
|
|
223
|
+
o.length === M && typeof h == "function" && (h(""), setTimeout(() => {
|
|
224
|
+
typeof h == "function" && h(o);
|
|
225
|
+
}, 0));
|
|
226
|
+
};
|
|
227
|
+
return /* @__PURE__ */ j(Ee.Provider, { value: { hasError: s }, children: /* @__PURE__ */ ge("div", { className: "flex w-max flex-col gap-y-1", children: [
|
|
228
|
+
/* @__PURE__ */ j(
|
|
229
|
+
Se,
|
|
230
|
+
{
|
|
231
|
+
ref: E,
|
|
232
|
+
value: D,
|
|
233
|
+
onChange: h,
|
|
234
|
+
onComplete: y,
|
|
235
|
+
containerClassName: he(
|
|
236
|
+
"flex items-center gap-2 has-[:disabled]:opacity-50 disabled:cursor-not-allowed",
|
|
237
|
+
n
|
|
238
|
+
),
|
|
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
|
+
"data-1p-ignore": "true",
|
|
249
|
+
"data-lpignore": "true",
|
|
250
|
+
"data-protonpass-ignore": "true",
|
|
251
|
+
"data-dashlane-disabled-on-field": "true",
|
|
252
|
+
children: r
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
s && g && /* @__PURE__ */ j(_e, { id: Fe(f), message: g })
|
|
256
|
+
] }) });
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
Pe.displayName = "InputOTP";
|
|
260
|
+
const Ce = Q(({ ...n }, r) => /* @__PURE__ */ j(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
ref: r,
|
|
264
|
+
className: "flex items-center justify-between gap-x-2 min-[390px]:gap-x-3 md:justify-center md:gap-x-4",
|
|
265
|
+
...n,
|
|
266
|
+
"data-testid": "input-otp-group"
|
|
267
|
+
}
|
|
268
|
+
));
|
|
269
|
+
Ce.displayName = "InputOTP.Group";
|
|
270
|
+
const Me = Q(
|
|
271
|
+
({ index: n, ...r }, l) => {
|
|
272
|
+
const { slots: u } = fe(xe), { hasError: g } = fe(Ee), { char: s, hasFakeCaret: C, isActive: y } = u[n];
|
|
273
|
+
return /* @__PURE__ */ ge(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
ref: l,
|
|
277
|
+
className: he(
|
|
278
|
+
"relative z-10 flex h-10 w-10 items-center justify-center rounded-[8px] text-sm transition duration-200 focus:outline-none",
|
|
279
|
+
y && "outline-input-border--focus outline-2 outline-offset-2",
|
|
280
|
+
g && "border-danger-400 focus-visible:outline-danger-400 border-2"
|
|
281
|
+
),
|
|
282
|
+
...r,
|
|
283
|
+
"data-testid": "input-otp-slot",
|
|
284
|
+
children: [
|
|
285
|
+
s,
|
|
286
|
+
C && /* @__PURE__ */ j("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ j("div", { className: "bg-concrete h-8 w-px" }) })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
Me.displayName = "InputOTP.Slot";
|
|
293
|
+
const ke = Q(({ ...n }, r) => /* @__PURE__ */ j("div", { ref: r, role: "separator", ...n, "data-testid": "input-otp-separator", children: /* @__PURE__ */ j($e, { className: "text-input-text-placeholder" }) }));
|
|
294
|
+
ke.displayName = "InputOTP.Separator";
|
|
295
|
+
const ut = Object.assign(Pe, {
|
|
296
|
+
Group: Ce,
|
|
297
|
+
Slot: Me,
|
|
298
|
+
Separator: ke
|
|
299
|
+
});
|
|
300
|
+
export {
|
|
301
|
+
ut as InputOTP
|
|
302
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import "./styles/main.css";
|
|
2
|
+
import { jsx as p, Fragment as K, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import "./Icons/AnnotationsIcon.js";
|
|
4
|
+
import "./Icons/CalendarIcon.js";
|
|
5
|
+
import "./Icons/CheckCircleIcon.js";
|
|
6
|
+
import "./Icons/CheckSquareIcon.js";
|
|
7
|
+
import "./Icons/CheckmarkIcon.js";
|
|
8
|
+
import "./Icons/ChevronDownIcon.js";
|
|
9
|
+
import "./Icons/ChevronUpIcon.js";
|
|
10
|
+
import "./Icons/ClockIcon.js";
|
|
11
|
+
import "./Icons/CloseCircleIcon.js";
|
|
12
|
+
import "./Icons/CloseIcon.js";
|
|
13
|
+
import "./Icons/DashboardIcon.js";
|
|
14
|
+
import "./Icons/DeleteIcon.js";
|
|
15
|
+
import "./Icons/DurationIcon.js";
|
|
16
|
+
import "./Icons/EmailIcon.js";
|
|
17
|
+
import "./Icons/EraserIcon.js";
|
|
18
|
+
import "./Icons/ErrorIcon.js";
|
|
19
|
+
import { EyeClosedIcon as U } from "./Icons/EyeClosedIcon.js";
|
|
20
|
+
import "./Icons/EyeClosedIcon2.js";
|
|
21
|
+
import { EyeOpenIcon as V } from "./Icons/EyeOpenIcon.js";
|
|
22
|
+
import "./Icons/GoToFirstIcon.js";
|
|
23
|
+
import "./Icons/GoToLastIcon.js";
|
|
24
|
+
import "./Icons/HarmonicCursorsIcon.js";
|
|
25
|
+
import "./Icons/InfoIcon.js";
|
|
26
|
+
import "./Icons/LabelIcon.js";
|
|
27
|
+
import "./Icons/LassoIcon.js";
|
|
28
|
+
import "./Icons/LineToolIcon.js";
|
|
29
|
+
import "./Icons/LiveViewIcon.js";
|
|
30
|
+
import "./Icons/LoaderIcon.js";
|
|
31
|
+
import "./Icons/LocationIcon.js";
|
|
32
|
+
import "./Icons/LogoutIcon.js";
|
|
33
|
+
import "./Icons/MetadataIcon.js";
|
|
34
|
+
import "./Icons/MinusIcon.js";
|
|
35
|
+
import "./Icons/OntologyIcon.js";
|
|
36
|
+
import "./Icons/PanelIconClose.js";
|
|
37
|
+
import "./Icons/PanelIconOpen.js";
|
|
38
|
+
import "./Icons/PlayIcon.js";
|
|
39
|
+
import "./Icons/PlusIcon.js";
|
|
40
|
+
import "./Icons/ResetIcon.js";
|
|
41
|
+
import "./Icons/ScissorsIcon.js";
|
|
42
|
+
import "./Icons/SettingsIcon.js";
|
|
43
|
+
import "./Icons/TrashIcon.js";
|
|
44
|
+
import "./Icons/UndoIcon.js";
|
|
45
|
+
import "./Icons/UserIcon.js";
|
|
46
|
+
import "./Icons/WarningIcon.js";
|
|
47
|
+
import "./Icons/ZoomAllIcon.js";
|
|
48
|
+
import "./Icons/ZoomXIcon.js";
|
|
49
|
+
import "./Icons/ZoomYIcon.js";
|
|
50
|
+
import { Input as X } from "./Input.js";
|
|
51
|
+
import { calculatePasswordStrength as _ } from "./utils/sharedUtils.js";
|
|
52
|
+
import * as b from "react";
|
|
53
|
+
import { useId as A, useRef as E, useContext as T, useInsertionEffect as B, useMemo as k, Children as F, isValidElement as G, useState as M } from "react";
|
|
54
|
+
import { M as Y, i as q, u as D, P as J, a as Q, b as Z, L as tt, m as L } from "./proxy-DD79Ok6n.js";
|
|
55
|
+
function S(t, r) {
|
|
56
|
+
if (typeof t == "function")
|
|
57
|
+
return t(r);
|
|
58
|
+
t != null && (t.current = r);
|
|
59
|
+
}
|
|
60
|
+
function et(...t) {
|
|
61
|
+
return (r) => {
|
|
62
|
+
let e = !1;
|
|
63
|
+
const i = t.map((s) => {
|
|
64
|
+
const o = S(s, r);
|
|
65
|
+
return !e && typeof o == "function" && (e = !0), o;
|
|
66
|
+
});
|
|
67
|
+
if (e)
|
|
68
|
+
return () => {
|
|
69
|
+
for (let s = 0; s < i.length; s++) {
|
|
70
|
+
const o = i[s];
|
|
71
|
+
typeof o == "function" ? o() : S(t[s], null);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function ot(...t) {
|
|
77
|
+
return b.useCallback(et(...t), t);
|
|
78
|
+
}
|
|
79
|
+
class nt extends b.Component {
|
|
80
|
+
getSnapshotBeforeUpdate(r) {
|
|
81
|
+
const e = this.props.childRef.current;
|
|
82
|
+
if (e && r.isPresent && !this.props.isPresent) {
|
|
83
|
+
const i = e.offsetParent, s = q(i) && i.offsetWidth || 0, o = this.props.sizeRef.current;
|
|
84
|
+
o.height = e.offsetHeight || 0, o.width = e.offsetWidth || 0, o.top = e.offsetTop, o.left = e.offsetLeft, o.right = s - o.width - o.left;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
90
|
+
*/
|
|
91
|
+
componentDidUpdate() {
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
return this.props.children;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function rt({ children: t, isPresent: r, anchorX: e, root: i }) {
|
|
98
|
+
const s = A(), o = E(null), f = E({
|
|
99
|
+
width: 0,
|
|
100
|
+
height: 0,
|
|
101
|
+
top: 0,
|
|
102
|
+
left: 0,
|
|
103
|
+
right: 0
|
|
104
|
+
}), { nonce: u } = T(Y), g = ot(o, t?.ref);
|
|
105
|
+
return B(() => {
|
|
106
|
+
const { width: n, height: C, top: l, left: m, right: d } = f.current;
|
|
107
|
+
if (r || !o.current || !n || !C)
|
|
108
|
+
return;
|
|
109
|
+
const y = e === "left" ? `left: ${m}` : `right: ${d}`;
|
|
110
|
+
o.current.dataset.motionPopId = s;
|
|
111
|
+
const a = document.createElement("style");
|
|
112
|
+
u && (a.nonce = u);
|
|
113
|
+
const P = i ?? document.head;
|
|
114
|
+
return P.appendChild(a), a.sheet && a.sheet.insertRule(`
|
|
115
|
+
[data-motion-pop-id="${s}"] {
|
|
116
|
+
position: absolute !important;
|
|
117
|
+
width: ${n}px !important;
|
|
118
|
+
height: ${C}px !important;
|
|
119
|
+
${y}px !important;
|
|
120
|
+
top: ${l}px !important;
|
|
121
|
+
}
|
|
122
|
+
`), () => {
|
|
123
|
+
P.contains(a) && P.removeChild(a);
|
|
124
|
+
};
|
|
125
|
+
}, [r]), p(nt, { isPresent: r, childRef: o, sizeRef: f, children: b.cloneElement(t, { ref: g }) });
|
|
126
|
+
}
|
|
127
|
+
const it = ({ children: t, initial: r, isPresent: e, onExitComplete: i, custom: s, presenceAffectsLayout: o, mode: f, anchorX: u, root: g }) => {
|
|
128
|
+
const n = D(st), C = A();
|
|
129
|
+
let l = !0, m = k(() => (l = !1, {
|
|
130
|
+
id: C,
|
|
131
|
+
initial: r,
|
|
132
|
+
isPresent: e,
|
|
133
|
+
custom: s,
|
|
134
|
+
onExitComplete: (d) => {
|
|
135
|
+
n.set(d, !0);
|
|
136
|
+
for (const y of n.values())
|
|
137
|
+
if (!y)
|
|
138
|
+
return;
|
|
139
|
+
i && i();
|
|
140
|
+
},
|
|
141
|
+
register: (d) => (n.set(d, !1), () => n.delete(d))
|
|
142
|
+
}), [e, n, i]);
|
|
143
|
+
return o && l && (m = { ...m }), k(() => {
|
|
144
|
+
n.forEach((d, y) => n.set(y, !1));
|
|
145
|
+
}, [e]), b.useEffect(() => {
|
|
146
|
+
!e && !n.size && i && i();
|
|
147
|
+
}, [e]), f === "popLayout" && (t = p(rt, { isPresent: e, anchorX: u, root: g, children: t })), p(J.Provider, { value: m, children: t });
|
|
148
|
+
};
|
|
149
|
+
function st() {
|
|
150
|
+
return /* @__PURE__ */ new Map();
|
|
151
|
+
}
|
|
152
|
+
const R = (t) => t.key || "";
|
|
153
|
+
function j(t) {
|
|
154
|
+
const r = [];
|
|
155
|
+
return F.forEach(t, (e) => {
|
|
156
|
+
G(e) && r.push(e);
|
|
157
|
+
}), r;
|
|
158
|
+
}
|
|
159
|
+
const lt = ({ children: t, custom: r, initial: e = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: f = !1, anchorX: u = "left", root: g }) => {
|
|
160
|
+
const [n, C] = Q(f), l = k(() => j(t), [t]), m = f && !n ? [] : l.map(R), d = E(!0), y = E(l), a = D(() => /* @__PURE__ */ new Map()), [P, O] = M(l), [w, $] = M(l);
|
|
161
|
+
Z(() => {
|
|
162
|
+
d.current = !1, y.current = l;
|
|
163
|
+
for (let h = 0; h < w.length; h++) {
|
|
164
|
+
const c = R(w[h]);
|
|
165
|
+
m.includes(c) ? a.delete(c) : a.get(c) !== !0 && a.set(c, !1);
|
|
166
|
+
}
|
|
167
|
+
}, [w, m.length, m.join("-")]);
|
|
168
|
+
const v = [];
|
|
169
|
+
if (l !== P) {
|
|
170
|
+
let h = [...l];
|
|
171
|
+
for (let c = 0; c < w.length; c++) {
|
|
172
|
+
const x = w[c], N = R(x);
|
|
173
|
+
m.includes(N) || (h.splice(c, 0, x), v.push(x));
|
|
174
|
+
}
|
|
175
|
+
return o === "wait" && v.length && (h = v), $(j(h)), O(l), null;
|
|
176
|
+
}
|
|
177
|
+
process.env.NODE_ENV !== "production" && o === "wait" && w.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
178
|
+
const { forceRender: W } = T(tt);
|
|
179
|
+
return p(K, { children: w.map((h) => {
|
|
180
|
+
const c = R(h), x = f && !n ? !1 : l === w || m.includes(c), N = () => {
|
|
181
|
+
if (a.has(c))
|
|
182
|
+
a.set(c, !0);
|
|
183
|
+
else
|
|
184
|
+
return;
|
|
185
|
+
let z = !0;
|
|
186
|
+
a.forEach((H) => {
|
|
187
|
+
H || (z = !1);
|
|
188
|
+
}), z && (W?.(), $(y.current), f && C?.(), i && i());
|
|
189
|
+
};
|
|
190
|
+
return p(it, { isPresent: x, initial: !d.current || e ? void 0 : !1, custom: r, presenceAffectsLayout: s, mode: o, root: g, onExitComplete: x ? void 0 : N, anchorX: u, children: h }, c);
|
|
191
|
+
}) });
|
|
192
|
+
}, se = ({
|
|
193
|
+
value: t,
|
|
194
|
+
onChange: r,
|
|
195
|
+
id: e,
|
|
196
|
+
label: i,
|
|
197
|
+
placeholder: s = "••••••••",
|
|
198
|
+
showStrength: o = !1,
|
|
199
|
+
className: f = ""
|
|
200
|
+
}) => {
|
|
201
|
+
const [u, g] = M(!1), n = t && o ? _(t) : null;
|
|
202
|
+
return /* @__PURE__ */ I("div", { children: [
|
|
203
|
+
/* @__PURE__ */ p(
|
|
204
|
+
X,
|
|
205
|
+
{
|
|
206
|
+
type: u ? "text" : "password",
|
|
207
|
+
value: t,
|
|
208
|
+
onChange: (C) => r(C.target.value),
|
|
209
|
+
className: f,
|
|
210
|
+
id: e,
|
|
211
|
+
label: i,
|
|
212
|
+
placeholder: s,
|
|
213
|
+
endIcon: u ? /* @__PURE__ */ p(
|
|
214
|
+
U,
|
|
215
|
+
{
|
|
216
|
+
size: 22,
|
|
217
|
+
onClick: () => g(!u),
|
|
218
|
+
className: "absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer transition-colors"
|
|
219
|
+
}
|
|
220
|
+
) : /* @__PURE__ */ p(
|
|
221
|
+
V,
|
|
222
|
+
{
|
|
223
|
+
size: 22,
|
|
224
|
+
onClick: () => g(!u),
|
|
225
|
+
className: "absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer transition-colors"
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ p(lt, { children: n && t.length > 0 && /* @__PURE__ */ I(
|
|
231
|
+
L.div,
|
|
232
|
+
{
|
|
233
|
+
initial: { opacity: 0, height: 0 },
|
|
234
|
+
animate: { opacity: 1, height: "auto" },
|
|
235
|
+
exit: { opacity: 0, height: 0 },
|
|
236
|
+
transition: { duration: 0.2 },
|
|
237
|
+
className: "mt-2",
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ I("div", { className: "mb-1 flex items-center justify-between", children: [
|
|
240
|
+
/* @__PURE__ */ p("span", { className: "text-text-secondary text-xs", children: "Password strength" }),
|
|
241
|
+
/* @__PURE__ */ p("span", { className: "text-xs font-medium", style: { color: n.color }, children: n.label })
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ p("div", { className: "h-1.5 overflow-hidden rounded-full bg-white/5", children: /* @__PURE__ */ p(
|
|
244
|
+
L.div,
|
|
245
|
+
{
|
|
246
|
+
className: "h-full rounded-full",
|
|
247
|
+
style: { backgroundColor: n.color },
|
|
248
|
+
initial: { width: 0 },
|
|
249
|
+
animate: { width: `${n.score / 5 * 100}%` },
|
|
250
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
251
|
+
}
|
|
252
|
+
) })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
) })
|
|
256
|
+
] });
|
|
257
|
+
};
|
|
258
|
+
export {
|
|
259
|
+
lt as A,
|
|
260
|
+
se as P
|
|
261
|
+
};
|
|
@@ -3,15 +3,15 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
export type RadioButtonGroupProps = {
|
|
4
4
|
value?: string;
|
|
5
5
|
onValueChange?: (value: string) => void;
|
|
6
|
-
children: ReactNode;
|
|
6
|
+
readonly children: ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
-
isKeptActive?: boolean;
|
|
9
|
-
expanded?: boolean;
|
|
10
|
-
asChild?: boolean;
|
|
8
|
+
readonly isKeptActive?: boolean;
|
|
9
|
+
readonly expanded?: boolean;
|
|
10
|
+
readonly asChild?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type RadioButtonGroupItemProps = AsChildProp & {
|
|
13
|
-
value: string;
|
|
14
|
-
children: ReactNode;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly children: ReactNode;
|
|
15
15
|
className?: string;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
onSelect?: (value: string) => void;
|
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -2,33 +2,33 @@ import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
2
2
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
3
|
type RadioGroupVariant = 'default' | 'tiles' | 'unstyled';
|
|
4
4
|
export type RadioGroupProps = Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'onChange' | 'disabled'> & {
|
|
5
|
-
|
|
5
|
+
onValueChange: (selected: string) => void;
|
|
6
6
|
readonly selected?: string;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly required?: boolean;
|
|
9
9
|
readonly orientation?: 'horizontal' | 'vertical';
|
|
10
10
|
readonly variant?: RadioGroupVariant;
|
|
11
|
-
|
|
11
|
+
className?: string;
|
|
12
12
|
readonly disabled?: boolean | readonly string[];
|
|
13
|
-
|
|
13
|
+
itemClassName?: string;
|
|
14
14
|
};
|
|
15
15
|
export interface RadioGroupItemProps extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
16
|
-
|
|
16
|
+
className?: string;
|
|
17
17
|
readonly children?: ReactNode;
|
|
18
18
|
readonly id?: string;
|
|
19
19
|
readonly value: string;
|
|
20
20
|
readonly description?: string | ReactNode;
|
|
21
21
|
}
|
|
22
22
|
declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<Omit<RadioGroupPrimitive.RadioGroupProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "onChange" | "disabled"> & {
|
|
23
|
-
|
|
23
|
+
onValueChange: (selected: string) => void;
|
|
24
24
|
readonly selected?: string;
|
|
25
25
|
readonly name: string;
|
|
26
26
|
readonly required?: boolean;
|
|
27
27
|
readonly orientation?: "horizontal" | "vertical";
|
|
28
28
|
readonly variant?: RadioGroupVariant;
|
|
29
|
-
|
|
29
|
+
className?: string;
|
|
30
30
|
readonly disabled?: boolean | readonly string[];
|
|
31
|
-
|
|
31
|
+
itemClassName?: string;
|
|
32
32
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
33
|
declare const RadioGroupItem: import('react').ForwardRefExoticComponent<RadioGroupItemProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
34
34
|
declare const RadioGroupLabel: import('react').ForwardRefExoticComponent<Omit<Omit<import('../Label/Label').LabelProps, "ref"> & import('react').RefAttributes<HTMLLabelElement>, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
|