@facto-to/design-system 0.1.0-beta.7 → 0.1.0-beta.9
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/AI.md +2 -0
- package/README.md +16 -0
- package/dist/ai/SKILL.md +2 -1
- package/dist/ai/references/api.d.ts +292 -12
- package/dist/ai/references/catalog.json +26 -1
- package/dist/ai/references/components.md +15 -1
- package/dist/ai/references/integration.md +1 -1
- package/dist/ai/references/motion.md +31 -0
- package/dist/ai/references/tokens.css +6 -0
- package/dist/ai/references/version.json +3 -3
- package/dist/index.d.ts +292 -12
- package/dist/index.js +1680 -741
- package/dist/styles.css +1 -1
- package/dist/tokens.css +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,1179 +1,2118 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { jsx as e, jsxs as u, Fragment as et } from "react/jsx-runtime";
|
|
3
|
+
import * as it from "@radix-ui/react-popover";
|
|
4
|
+
import * as at from "@radix-ui/react-dropdown-menu";
|
|
5
|
+
import * as st from "@radix-ui/react-tooltip";
|
|
6
|
+
import * as J from "@radix-ui/react-toast";
|
|
7
|
+
import { createPortal as Kt } from "react-dom";
|
|
8
|
+
import * as St from "@radix-ui/react-checkbox";
|
|
9
|
+
import * as F from "@radix-ui/react-dialog";
|
|
10
|
+
import * as V from "@radix-ui/react-select";
|
|
11
|
+
import * as Mt from "@radix-ui/react-switch";
|
|
12
|
+
import * as vt from "@radix-ui/react-tabs";
|
|
13
|
+
import { useContext as W, useSyncExternalStore as Yt, createContext as wt, useRef as x, useLayoutEffect as Z, useState as A, useEffect as q, useId as G, forwardRef as dt, Children as Qt, isValidElement as Xt, cloneElement as Zt, Fragment as Jt, useCallback as X, useMemo as te } from "react";
|
|
14
|
+
const z = {
|
|
15
|
+
duration: { feedback: 160, content: 180, surface: 220, overlay: 240 },
|
|
16
|
+
easing: { standard: "cubic-bezier(.22, 1, .36, 1)" }
|
|
17
|
+
}, It = wt("auto"), Bt = "(prefers-reduced-motion: reduce)", ee = (t) => {
|
|
18
|
+
const n = window.matchMedia?.(Bt);
|
|
19
|
+
return n?.addEventListener("change", t), () => n?.removeEventListener("change", t);
|
|
20
|
+
}, ne = () => typeof window < "u" && !!window.matchMedia?.(Bt).matches, ae = () => !0;
|
|
21
|
+
function ut(t) {
|
|
22
|
+
const n = W(It), a = Yt(ee, ne, ae), o = t ?? n;
|
|
23
|
+
return { motion: o, reduced: a, enabled: o === "auto" && !a };
|
|
24
|
+
}
|
|
25
|
+
function Y(t) {
|
|
26
|
+
const { enabled: n } = ut(t);
|
|
27
|
+
return { "--facto-motion-scale": n ? 1 : 0 };
|
|
28
|
+
}
|
|
29
|
+
function gt({ motion: t, children: n }) {
|
|
30
|
+
const a = ut(t);
|
|
31
|
+
return /* @__PURE__ */ e(It.Provider, { value: a.motion, children: /* @__PURE__ */ e("div", { "data-facto-motion": a.motion, style: { display: "contents", "--facto-motion-scale": a.enabled ? 1 : 0 }, children: n }) });
|
|
32
|
+
}
|
|
33
|
+
const bt = (...t) => t.filter(Boolean).join(" ");
|
|
34
|
+
function H(t, n) {
|
|
35
|
+
n.current?.cancel(), n.current = null, t.style.height = "", t.style.overflow = "";
|
|
36
|
+
}
|
|
37
|
+
function _t(t) {
|
|
38
|
+
return ut(t).enabled;
|
|
39
|
+
}
|
|
40
|
+
function Et(t, n, a) {
|
|
41
|
+
const o = x(null), r = x(null), i = x(t), c = x(!1), l = x(0), [s, h] = A(t);
|
|
42
|
+
return Z(() => {
|
|
43
|
+
const f = o.current;
|
|
44
|
+
if (!f) return;
|
|
45
|
+
const p = i.current !== t;
|
|
46
|
+
if (i.current = t, !n) {
|
|
47
|
+
c.current = !1, H(f, r), h(t);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (p && (l.current = f.getBoundingClientRect().height, H(f, r), c.current = !0, t && !s)) {
|
|
51
|
+
h(!0);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!c.current || !s) return;
|
|
55
|
+
c.current = !1;
|
|
56
|
+
const v = t ? l.current || 0 : l.current, k = t ? f.scrollHeight : 0;
|
|
57
|
+
if (!f.animate || Math.abs(k - v) < 1) {
|
|
58
|
+
H(f, r), t || h(!1);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
f.style.height = `${v}px`, f.style.overflow = "hidden";
|
|
62
|
+
const w = f.animate(
|
|
63
|
+
[{ height: `${v}px`, opacity: t ? 0.85 : 1 }, { height: `${k}px`, opacity: t ? 1 : 0 }],
|
|
64
|
+
{ duration: a, easing: z.easing.standard, fill: "forwards" }
|
|
65
|
+
);
|
|
66
|
+
r.current = w, w.onfinish = () => {
|
|
67
|
+
r.current === w && (H(f, r), t || h(!1));
|
|
68
|
+
};
|
|
69
|
+
}, [n, s, t, a]), Z(() => () => {
|
|
70
|
+
const f = o.current;
|
|
71
|
+
f && H(f, r);
|
|
72
|
+
}, []), { rootRef: o, mounted: s };
|
|
73
|
+
}
|
|
74
|
+
function oe({ stepKey: t, children: n, motion: a, className: o, ...r }) {
|
|
75
|
+
const i = _t(a), c = x(null), l = x(null), s = x(null), h = x(null), f = x(t), p = x(null), v = x(null), k = x(null), w = () => {
|
|
76
|
+
const g = c.current, d = l.current;
|
|
77
|
+
!g || !d || (H(g, s), p.current = d.getBoundingClientRect().height, v.current = null);
|
|
78
|
+
}, C = (g, d) => {
|
|
79
|
+
const m = c.current;
|
|
80
|
+
if (!m || !i || !m.animate || Math.abs(d - g) < 1) {
|
|
81
|
+
w();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
H(m, s), m.style.height = `${g}px`, m.style.overflow = "hidden", v.current = d;
|
|
85
|
+
const y = m.animate(
|
|
86
|
+
[{ height: `${g}px` }, { height: `${d}px` }],
|
|
87
|
+
{ duration: z.duration.surface, easing: z.easing.standard, fill: "forwards" }
|
|
88
|
+
);
|
|
89
|
+
s.current = y, y.onfinish = () => {
|
|
90
|
+
s.current === y && w();
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
return Z(() => {
|
|
94
|
+
const g = c.current, d = l.current;
|
|
95
|
+
if (!g || !d) return;
|
|
96
|
+
const m = f.current !== t;
|
|
97
|
+
if (f.current = t, !i) {
|
|
98
|
+
H(g, s), h.current?.cancel(), h.current = null, p.current = d.getBoundingClientRect().height, v.current = null;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!m) {
|
|
102
|
+
s.current || (p.current = d.getBoundingClientRect().height);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const y = s.current ? g.getBoundingClientRect().height : p.current ?? g.getBoundingClientRect().height;
|
|
106
|
+
H(g, s), h.current?.cancel(), h.current = null;
|
|
107
|
+
const b = d.getBoundingClientRect().height;
|
|
108
|
+
if (p.current == null) {
|
|
109
|
+
p.current = b;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
C(y, b);
|
|
113
|
+
const N = d.animate?.(
|
|
114
|
+
[{ opacity: 0.35, transform: "translateY(6px)" }, { opacity: 1, transform: "translateY(0)" }],
|
|
115
|
+
{ duration: z.duration.content, easing: z.easing.standard }
|
|
116
|
+
);
|
|
117
|
+
h.current = N ?? null, N?.addEventListener("finish", () => {
|
|
118
|
+
h.current === N && (N.cancel(), h.current = null);
|
|
119
|
+
}, { once: !0 });
|
|
120
|
+
}, [n, i, t]), Z(() => {
|
|
121
|
+
if (!c.current || typeof ResizeObserver > "u") return;
|
|
122
|
+
const d = new ResizeObserver(() => k.current?.()), m = l.current;
|
|
123
|
+
if (m)
|
|
124
|
+
return d.observe(m), () => d.disconnect();
|
|
125
|
+
}, []), k.current = () => {
|
|
126
|
+
const g = c.current, d = l.current;
|
|
127
|
+
if (!g || !d) return;
|
|
128
|
+
const m = d.getBoundingClientRect().height;
|
|
129
|
+
if (!s.current) {
|
|
130
|
+
p.current = m;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
v.current != null && Math.abs(m - v.current) >= 1 && C(g.getBoundingClientRect().height, m);
|
|
134
|
+
}, Z(() => () => {
|
|
135
|
+
const g = c.current;
|
|
136
|
+
g && H(g, s), h.current?.cancel(), h.current = null;
|
|
137
|
+
}, []), /* @__PURE__ */ e("div", { ...r, ref: c, className: bt("facto-step-transition", o), children: /* @__PURE__ */ e("div", { ref: l, className: "facto-step-transition__content", children: n }) });
|
|
138
|
+
}
|
|
139
|
+
function Re({ open: t, children: n, motion: a, className: o, ...r }) {
|
|
140
|
+
const { rootRef: i, mounted: c } = Et(t, _t(a), z.duration.content);
|
|
141
|
+
return /* @__PURE__ */ e("div", { ...r, ref: i, className: bt("facto-animated-disclosure", o), "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !c, children: n });
|
|
142
|
+
}
|
|
143
|
+
function $e({ show: t, children: n, motion: a, className: o, role: r = "alert", ...i }) {
|
|
144
|
+
const { rootRef: c, mounted: l } = Et(t, _t(a), z.duration.feedback);
|
|
145
|
+
return /* @__PURE__ */ e("div", { ...i, ref: c, className: bt("facto-animated-feedback", o), role: t ? r : void 0, "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !l, children: n });
|
|
146
|
+
}
|
|
147
|
+
function Le({ children: t, ready: n = !0, motion: a, className: o, ...r }) {
|
|
148
|
+
const i = _t(a), c = x(null), l = x(n);
|
|
149
|
+
return Z(() => {
|
|
150
|
+
const s = c.current, h = !l.current && n;
|
|
151
|
+
if (l.current = n, !s || !h || !i || !s.animate) return;
|
|
152
|
+
const f = s.animate([{ opacity: 0.85 }, { opacity: 1 }], { duration: z.duration.content, easing: z.easing.standard });
|
|
153
|
+
return f.addEventListener("finish", () => f.cancel(), { once: !0 }), () => f.cancel();
|
|
154
|
+
}, [i, n]), /* @__PURE__ */ e("div", { ...r, ref: c, className: bt("facto-content-reveal", o), "aria-busy": n ? void 0 : !0, children: t });
|
|
155
|
+
}
|
|
156
|
+
const Rt = (t) => {
|
|
157
|
+
t.forEach((n) => n.cancel()), t.length = 0;
|
|
158
|
+
};
|
|
159
|
+
function Ie(t, n, { motion: a } = {}) {
|
|
160
|
+
const { enabled: o } = ut(a), r = x(/* @__PURE__ */ new Map()), i = x(/* @__PURE__ */ new Set()), c = x(null), l = x([]), s = JSON.stringify(n);
|
|
161
|
+
Z(() => {
|
|
162
|
+
const h = t.current, f = () => {
|
|
163
|
+
if (!h) return /* @__PURE__ */ new Map();
|
|
164
|
+
const C = h.getBoundingClientRect();
|
|
165
|
+
return new Map(
|
|
166
|
+
Array.from(h.querySelectorAll("[data-list-motion-key]")).map((g) => {
|
|
167
|
+
const d = g.dataset.listMotionKey, m = g.getBoundingClientRect();
|
|
168
|
+
return d === void 0 ? null : [d, {
|
|
169
|
+
left: m.left - C.left + h.scrollLeft,
|
|
170
|
+
top: m.top - C.top + h.scrollTop
|
|
171
|
+
}];
|
|
172
|
+
}).filter((g) => g !== null)
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
Rt(l.current);
|
|
176
|
+
const p = f();
|
|
177
|
+
if (!h || !o) {
|
|
178
|
+
r.current = p, i.current = new Set(p.keys()), c.current = s;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const v = c.current !== null && c.current !== s, k = r.current, w = i.current;
|
|
182
|
+
if (v) {
|
|
183
|
+
const C = new Map(
|
|
184
|
+
Array.from(h.querySelectorAll("[data-list-motion-key]")).map((g) => [g.dataset.listMotionKey, g]).filter((g) => g[0] !== void 0)
|
|
185
|
+
);
|
|
186
|
+
for (const [g, d] of p) {
|
|
187
|
+
const m = C.get(g);
|
|
188
|
+
if (!m || typeof m.animate != "function") continue;
|
|
189
|
+
const y = w.has(g) ? k.get(g) : void 0, b = y ? (() => {
|
|
190
|
+
const N = y.left - d.left, T = y.top - d.top;
|
|
191
|
+
return Math.abs(N) > 0.5 || Math.abs(T) > 0.5 ? [{ transform: `translate(${N}px, ${T}px)` }, { transform: "none" }] : null;
|
|
192
|
+
})() : [{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }];
|
|
193
|
+
b && l.current.push(m.animate(b, {
|
|
194
|
+
duration: y ? z.duration.content : z.duration.feedback,
|
|
195
|
+
easing: z.easing.standard
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return r.current = p, i.current = new Set(p.keys()), c.current = s, () => Rt(l.current);
|
|
200
|
+
}, [o, t, s]);
|
|
201
|
+
}
|
|
202
|
+
function Be({ motion: t, className: n, children: a, ...o }) {
|
|
203
|
+
const { enabled: r } = ut(t), i = x(null), c = x(null), l = x(null), s = x(null);
|
|
204
|
+
return Z(() => {
|
|
205
|
+
const h = i.current, f = c.current;
|
|
206
|
+
if (!h || !f) return;
|
|
207
|
+
const p = (d) => {
|
|
208
|
+
const m = h.querySelector('[aria-pressed="true"], [aria-selected="true"]');
|
|
209
|
+
if (!m) {
|
|
210
|
+
s.current?.cancel(), s.current = null, f.hidden = !0, l.current = null;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const y = h.getBoundingClientRect(), b = m.getBoundingClientRect(), N = l.current, T = !f.hidden && s.current ? f.getBoundingClientRect() : N;
|
|
214
|
+
s.current?.cancel(), s.current = null, f.hidden = !1, Object.assign(f.style, {
|
|
215
|
+
left: `${b.left - y.left + h.scrollLeft}px`,
|
|
216
|
+
top: `${b.top - y.top + h.scrollTop}px`,
|
|
217
|
+
width: `${b.width}px`,
|
|
218
|
+
height: `${b.height}px`
|
|
219
|
+
}), d && r && T && b.width > 0 && b.height > 0 && typeof f.animate == "function" && (s.current = f.animate([
|
|
220
|
+
{
|
|
221
|
+
transform: `translate(${T.left - b.left}px, ${T.top - b.top}px) scale(${T.width / b.width}, ${T.height / b.height})`
|
|
222
|
+
},
|
|
223
|
+
{ transform: "none" }
|
|
224
|
+
], { duration: z.duration.surface, easing: z.easing.standard })), l.current = b;
|
|
225
|
+
}, v = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => p(!1)), k = /* @__PURE__ */ new Set(), w = () => {
|
|
226
|
+
k.forEach((d) => {
|
|
227
|
+
h.contains(d) || (v?.unobserve(d), k.delete(d));
|
|
228
|
+
}), h.querySelectorAll("[aria-pressed], [aria-selected]").forEach((d) => {
|
|
229
|
+
k.has(d) || (k.add(d), v?.observe(d));
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
p(!1), w();
|
|
233
|
+
const C = new MutationObserver((d) => {
|
|
234
|
+
const m = d.some(
|
|
235
|
+
(y) => y.type === "attributes" && (y.attributeName === "aria-pressed" || y.attributeName === "aria-selected")
|
|
236
|
+
);
|
|
237
|
+
w(), p(m);
|
|
238
|
+
});
|
|
239
|
+
C.observe(h, {
|
|
240
|
+
subtree: !0,
|
|
241
|
+
childList: !0,
|
|
242
|
+
characterData: !0,
|
|
243
|
+
attributes: !0,
|
|
244
|
+
attributeFilter: ["aria-pressed", "aria-selected"]
|
|
245
|
+
}), v?.observe(h);
|
|
246
|
+
const g = () => p(!1);
|
|
247
|
+
return window.addEventListener("resize", g), () => {
|
|
248
|
+
s.current?.cancel(), s.current = null, C.disconnect(), v?.disconnect(), window.removeEventListener("resize", g);
|
|
249
|
+
};
|
|
250
|
+
}, [r]), /* @__PURE__ */ u("div", { ...o, ref: i, className: ["facto-selection-motion", n].filter(Boolean).join(" "), children: [
|
|
251
|
+
/* @__PURE__ */ e("span", { ref: c, className: "facto-selection-motion__indicator", "aria-hidden": "true", hidden: !0 }),
|
|
252
|
+
a
|
|
253
|
+
] });
|
|
254
|
+
}
|
|
255
|
+
function Pt() {
|
|
256
|
+
const [t, n] = A(null);
|
|
257
|
+
return q(() => {
|
|
258
|
+
const a = window.visualViewport;
|
|
259
|
+
if (!t || !a) return;
|
|
260
|
+
let o = 0;
|
|
261
|
+
const r = () => {
|
|
262
|
+
delete t.dataset.keyboardOpen, t.style.removeProperty("--facto-visible-height"), t.style.removeProperty("--facto-visible-top");
|
|
263
|
+
}, i = () => {
|
|
264
|
+
cancelAnimationFrame(o), o = requestAnimationFrame(() => {
|
|
265
|
+
const c = document.activeElement, l = c instanceof HTMLElement && t.contains(c) && c.matches('input, textarea, [contenteditable="true"]'), s = (window.innerWidth <= 700 || window.matchMedia?.("(pointer: coarse)").matches) && a.scale === 1 && window.innerHeight - a.height > 120, h = t.dataset.keyboardOpen === "true" && c instanceof HTMLElement && t.contains(c);
|
|
266
|
+
if (!s || !l && !h) {
|
|
267
|
+
r();
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (t.dataset.keyboardOpen = "true", t.style.setProperty("--facto-visible-height", `${a.height}px`), t.style.setProperty("--facto-visible-top", `${a.offsetTop}px`), l) {
|
|
271
|
+
const f = c.getBoundingClientRect();
|
|
272
|
+
(f.top < a.offsetTop + 12 || f.bottom > a.offsetTop + a.height - 12) && c.scrollIntoView({ block: "nearest", behavior: "instant" });
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
return a.addEventListener("resize", i), a.addEventListener("scroll", i), t.addEventListener("focusin", i), t.addEventListener("focusout", i), i(), () => {
|
|
277
|
+
cancelAnimationFrame(o), a.removeEventListener("resize", i), a.removeEventListener("scroll", i), t.removeEventListener("focusin", i), t.removeEventListener("focusout", i), r();
|
|
278
|
+
};
|
|
279
|
+
}, [t]), n;
|
|
280
|
+
}
|
|
281
|
+
const ht = /* @__PURE__ */ new WeakMap();
|
|
282
|
+
function ce(t) {
|
|
283
|
+
const n = Array.from(t.ownerDocument.body.children).filter(
|
|
17
284
|
(o) => o instanceof HTMLElement && !o.hasAttribute("data-radix-focus-guard") && !o.contains(t)
|
|
18
285
|
);
|
|
19
|
-
for (const o of
|
|
20
|
-
const
|
|
21
|
-
|
|
286
|
+
for (const o of n) {
|
|
287
|
+
const r = ht.get(o);
|
|
288
|
+
r ? r.count += 1 : (ht.set(o, { count: 1, wasInert: o.inert }), o.inert = !0);
|
|
22
289
|
}
|
|
23
290
|
let a = !0;
|
|
24
291
|
return () => {
|
|
25
292
|
if (a) {
|
|
26
293
|
a = !1;
|
|
27
|
-
for (const o of
|
|
28
|
-
const
|
|
29
|
-
|
|
294
|
+
for (const o of n) {
|
|
295
|
+
const r = ht.get(o);
|
|
296
|
+
r && (r.count -= 1, r.count === 0 && (r.wasInert || (o.inert = !1), ht.delete(o)));
|
|
30
297
|
}
|
|
31
298
|
}
|
|
32
299
|
};
|
|
33
300
|
}
|
|
34
|
-
const
|
|
35
|
-
const { leading: o, title:
|
|
36
|
-
o != null && /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
301
|
+
const tt = (...t) => t.filter(Boolean).join(" "), Ee = dt(function(n, a) {
|
|
302
|
+
const { leading: o, title: r, description: i, value: c, status: l, trailing: s, className: h } = n, f = /* @__PURE__ */ u(et, { children: [
|
|
303
|
+
o != null && /* @__PURE__ */ e("span", { className: "facto-list-row__leading", children: o }),
|
|
304
|
+
/* @__PURE__ */ u("span", { className: "facto-list-row__copy", children: [
|
|
305
|
+
/* @__PURE__ */ e("span", { className: "facto-list-row__title", children: r }),
|
|
306
|
+
i != null && /* @__PURE__ */ e("span", { className: "facto-list-row__description", children: i })
|
|
40
307
|
] }),
|
|
41
|
-
(
|
|
42
|
-
|
|
43
|
-
|
|
308
|
+
(c != null || l != null) && /* @__PURE__ */ u("span", { className: "facto-list-row__meta", children: [
|
|
309
|
+
c != null && /* @__PURE__ */ e("span", { className: "facto-list-row__value", children: c }),
|
|
310
|
+
l != null && /* @__PURE__ */ e("span", { className: "facto-list-row__status", children: l })
|
|
44
311
|
] }),
|
|
45
|
-
|
|
46
|
-
] }),
|
|
47
|
-
if ("href" in
|
|
48
|
-
const { leading:
|
|
49
|
-
return /* @__PURE__ */
|
|
312
|
+
s != null && /* @__PURE__ */ e("span", { className: "facto-list-row__trailing", children: s })
|
|
313
|
+
] }), p = tt("facto-list-row", h);
|
|
314
|
+
if ("href" in n && typeof n.href == "string") {
|
|
315
|
+
const { leading: b, title: N, description: T, value: L, status: j, trailing: P, className: O, ...M } = n;
|
|
316
|
+
return /* @__PURE__ */ e("a", { ...M, ref: a, className: p, children: f });
|
|
50
317
|
}
|
|
51
|
-
if ("onClick" in
|
|
52
|
-
const { leading:
|
|
53
|
-
return /* @__PURE__ */
|
|
318
|
+
if ("onClick" in n && typeof n.onClick == "function") {
|
|
319
|
+
const { leading: b, title: N, description: T, value: L, status: j, trailing: P, className: O, type: M = "button", ...I } = n;
|
|
320
|
+
return /* @__PURE__ */ e("button", { ...I, ref: a, type: M, className: p, children: f });
|
|
54
321
|
}
|
|
55
|
-
const { leading:
|
|
56
|
-
return /* @__PURE__ */
|
|
322
|
+
const { leading: v, title: k, description: w, value: C, status: g, trailing: d, className: m, ...y } = n;
|
|
323
|
+
return /* @__PURE__ */ e("div", { ...y, ref: a, className: p, children: f });
|
|
57
324
|
});
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
t && /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
325
|
+
function Pe({ heading: t, children: n, className: a, ...o }) {
|
|
326
|
+
const r = G();
|
|
327
|
+
return /* @__PURE__ */ u("section", { ...o, className: tt("facto-list-group", a), "aria-labelledby": t ? r : o["aria-labelledby"], children: [
|
|
328
|
+
t && /* @__PURE__ */ e("h2", { id: r, className: "facto-list-group__heading", children: t }),
|
|
329
|
+
/* @__PURE__ */ e("div", { className: "facto-list-group__rows", children: n })
|
|
63
330
|
] });
|
|
64
331
|
}
|
|
65
|
-
function
|
|
66
|
-
const [
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
} }) : /* @__PURE__ */
|
|
72
|
-
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
332
|
+
function re({ src: t, alt: n = "", fallback: a, size: o = "md", className: r, onError: i, ...c }) {
|
|
333
|
+
const [l, s] = A(!1);
|
|
334
|
+
q(() => s(!1), [t]);
|
|
335
|
+
const h = a ?? (n ? n.slice(0, 1).toUpperCase() : null);
|
|
336
|
+
return /* @__PURE__ */ e("span", { className: tt("facto-avatar", `facto-avatar--${o}`, r), children: t && !l ? /* @__PURE__ */ e("img", { ...c, src: t, alt: n, onError: (f) => {
|
|
337
|
+
s(!0), i?.(f);
|
|
338
|
+
} }) : /* @__PURE__ */ e("span", { className: "facto-avatar__fallback", role: n ? "img" : void 0, "aria-label": n || void 0, "aria-hidden": n ? void 0 : !0, children: h }) });
|
|
339
|
+
}
|
|
340
|
+
function De({ logos: t, size: n = "md", max: a, className: o, ...r }) {
|
|
341
|
+
const i = a === void 0 ? t : t.slice(0, a), c = t.length - i.length;
|
|
342
|
+
return /* @__PURE__ */ u("div", { ...r, className: tt("facto-logo-stack", `facto-logo-stack--${n}`, o), children: [
|
|
343
|
+
i.map((l, s) => /* @__PURE__ */ e(re, { ...l, size: n }, `${l.src ?? "fallback"}-${s}`)),
|
|
344
|
+
c > 0 && /* @__PURE__ */ u("span", { className: "facto-logo-stack__more", "aria-label": `${c} more logos`, children: [
|
|
78
345
|
"+",
|
|
79
|
-
|
|
346
|
+
c
|
|
80
347
|
] })
|
|
81
348
|
] });
|
|
82
349
|
}
|
|
83
|
-
function
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
o && /* @__PURE__ */
|
|
350
|
+
function Ae({ title: t, description: n, retryLabel: a = "Try again", onRetry: o, className: r, ...i }) {
|
|
351
|
+
return /* @__PURE__ */ u("div", { ...i, className: tt("facto-error-state", r), role: "alert", children: [
|
|
352
|
+
/* @__PURE__ */ e("strong", { children: t }),
|
|
353
|
+
n && /* @__PURE__ */ e("p", { children: n }),
|
|
354
|
+
o && /* @__PURE__ */ e("button", { type: "button", className: "facto-error-state__retry", onClick: o, children: a })
|
|
88
355
|
] });
|
|
89
356
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
357
|
+
function ze({ label: t = "Loading more", className: n, ...a }) {
|
|
358
|
+
return /* @__PURE__ */ u("div", { ...a, className: tt("facto-loading-more", n), role: "status", "aria-live": "polite", children: [
|
|
359
|
+
/* @__PURE__ */ e("span", { className: "facto-loading-more__spinner", "aria-hidden": "true" }),
|
|
360
|
+
/* @__PURE__ */ e("span", { children: t })
|
|
94
361
|
] });
|
|
95
362
|
}
|
|
96
|
-
function
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
const
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
363
|
+
function Fe({ steps: t, className: n, ...a }) {
|
|
364
|
+
return /* @__PURE__ */ e("ol", { ...a, className: tt("facto-step-checklist", n), children: t.map((o, r) => {
|
|
365
|
+
const i = o.state ?? "upcoming";
|
|
366
|
+
return /* @__PURE__ */ u("li", { className: `facto-step-checklist__item facto-step-checklist__item--${i}`, "aria-current": i === "current" ? "step" : void 0, children: [
|
|
367
|
+
/* @__PURE__ */ e("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children: i === "complete" ? "✓" : r + 1 }),
|
|
368
|
+
/* @__PURE__ */ u("span", { className: "facto-step-checklist__copy", children: [
|
|
369
|
+
/* @__PURE__ */ u("span", { children: [
|
|
103
370
|
o.label,
|
|
104
|
-
|
|
371
|
+
i === "complete" && /* @__PURE__ */ e("span", { className: "facto-visually-hidden", children: ", completed" })
|
|
105
372
|
] }),
|
|
106
|
-
o.description != null && /* @__PURE__ */
|
|
373
|
+
o.description != null && /* @__PURE__ */ e("small", { children: o.description })
|
|
107
374
|
] })
|
|
108
|
-
] },
|
|
375
|
+
] }, r);
|
|
109
376
|
}) });
|
|
110
377
|
}
|
|
111
|
-
const
|
|
112
|
-
function
|
|
378
|
+
const nt = (...t) => t.filter(Boolean).join(" "), ie = (...t) => t.filter(Boolean).join(" ") || void 0;
|
|
379
|
+
function je({
|
|
113
380
|
label: t,
|
|
114
|
-
leading:
|
|
381
|
+
leading: n,
|
|
115
382
|
trailing: a,
|
|
116
383
|
children: o,
|
|
117
|
-
invalid:
|
|
118
|
-
inputId:
|
|
119
|
-
className:
|
|
120
|
-
...
|
|
384
|
+
invalid: r,
|
|
385
|
+
inputId: i,
|
|
386
|
+
className: c,
|
|
387
|
+
...l
|
|
121
388
|
}) {
|
|
122
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ u(
|
|
123
390
|
"div",
|
|
124
391
|
{
|
|
125
|
-
...
|
|
126
|
-
className:
|
|
392
|
+
...l,
|
|
393
|
+
className: nt("facto-inset-field", r && "facto-inset-field--invalid", c),
|
|
127
394
|
children: [
|
|
128
|
-
t && /* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
a && /* @__PURE__ */
|
|
395
|
+
t && /* @__PURE__ */ e("label", { className: "facto-inset-field__label", htmlFor: i, children: t }),
|
|
396
|
+
/* @__PURE__ */ u("span", { className: "facto-inset-field__control", children: [
|
|
397
|
+
n && /* @__PURE__ */ e("span", { className: "facto-inset-field__slot facto-inset-field__slot--leading", children: n }),
|
|
398
|
+
Qt.map(o, (s) => Xt(s) && typeof s.type == "string" && ["input", "textarea", "select"].includes(s.type) ? Zt(s, { id: i, "aria-invalid": r || s.props["aria-invalid"] }) : s),
|
|
399
|
+
a && /* @__PURE__ */ e("span", { className: "facto-inset-field__slot facto-inset-field__slot--trailing", children: a })
|
|
133
400
|
] })
|
|
134
401
|
]
|
|
135
402
|
}
|
|
136
403
|
);
|
|
137
404
|
}
|
|
138
|
-
const
|
|
139
|
-
function
|
|
405
|
+
const mt = (t, n, a = !1) => (a ? t.replace(/[^a-z0-9]/gi, "").toUpperCase() : t.replace(/\D/g, "")).slice(0, n);
|
|
406
|
+
function pt({
|
|
140
407
|
value: t,
|
|
141
|
-
onValueChange:
|
|
408
|
+
onValueChange: n,
|
|
142
409
|
length: a = 6,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
410
|
+
split: o = !1,
|
|
411
|
+
alphanumeric: r = !1,
|
|
412
|
+
verified: i = !1,
|
|
413
|
+
onComplete: c,
|
|
414
|
+
completionDelay: l = 300,
|
|
415
|
+
pending: s,
|
|
416
|
+
pendingLabel: h = "Verifying code…",
|
|
417
|
+
label: f,
|
|
418
|
+
helperText: p,
|
|
419
|
+
error: v,
|
|
420
|
+
id: k,
|
|
421
|
+
className: w,
|
|
422
|
+
containerClassName: C,
|
|
423
|
+
disabled: g,
|
|
424
|
+
readOnly: d,
|
|
425
|
+
onPaste: m,
|
|
426
|
+
onFocus: y,
|
|
427
|
+
onBlur: b,
|
|
428
|
+
onSelect: N,
|
|
429
|
+
onClick: T,
|
|
430
|
+
...L
|
|
159
431
|
}) {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, [
|
|
164
|
-
if (
|
|
165
|
-
if (
|
|
432
|
+
const j = G(), P = k ?? j, O = v || p ? `${P}-description` : void 0, M = Number.isFinite(a) ? Math.min(32, Math.max(1, Math.floor(a))) : 6, I = mt(t, M, r), [B, R] = A({ start: 0, end: 0 }), E = x(void 0), rt = x(c);
|
|
433
|
+
q(() => {
|
|
434
|
+
rt.current = c;
|
|
435
|
+
}, [c]), q(() => {
|
|
436
|
+
if (g || d || s) return;
|
|
437
|
+
if (I.length !== M) {
|
|
166
438
|
E.current = void 0;
|
|
167
439
|
return;
|
|
168
440
|
}
|
|
169
|
-
if (E.current ===
|
|
170
|
-
const
|
|
171
|
-
E.current =
|
|
172
|
-
}, Math.max(0,
|
|
173
|
-
return () => window.clearTimeout(
|
|
174
|
-
}, [
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
const $ =
|
|
178
|
-
$ !==
|
|
441
|
+
if (E.current === I) return;
|
|
442
|
+
const S = window.setTimeout(() => {
|
|
443
|
+
E.current = I, rt.current?.(I);
|
|
444
|
+
}, Math.max(0, l));
|
|
445
|
+
return () => window.clearTimeout(S);
|
|
446
|
+
}, [l, g, M, I, s, d]);
|
|
447
|
+
const Ct = (S) => {
|
|
448
|
+
if (g || d || s) return;
|
|
449
|
+
const $ = mt(S, M, r);
|
|
450
|
+
$ !== I && n($);
|
|
451
|
+
}, Tt = o && M === 6 ? 2 : o && M === 8 ? 3 : -1, jt = M >= 8 ? 42 : M <= 4 ? 56 : 54, Nt = M >= 8 ? 6 : 8, Ot = Tt >= 0 ? Nt + 6 : 0, Wt = M * jt + (M - 1) * Nt + Ot, Vt = M >= 8 ? 19 : 22, Ht = Math.min(B.start, I.length, M - 1), qt = {
|
|
452
|
+
"--facto-otp-max-width": `${Wt}px`,
|
|
453
|
+
"--facto-otp-gap": `${Nt}px`,
|
|
454
|
+
"--facto-otp-font-size": `${Vt}px`
|
|
179
455
|
};
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ u("div", { className: nt("facto-otp", C), children: [
|
|
457
|
+
f && /* @__PURE__ */ e("label", { className: "facto-otp__label", htmlFor: P, children: f }),
|
|
458
|
+
/* @__PURE__ */ u(
|
|
183
459
|
"div",
|
|
184
460
|
{
|
|
185
|
-
className:
|
|
186
|
-
|
|
187
|
-
|
|
461
|
+
className: nt(
|
|
462
|
+
"facto-otp__cells",
|
|
463
|
+
!!v && "facto-otp__cells--error",
|
|
464
|
+
i && !v && "facto-otp__cells--verified",
|
|
465
|
+
w
|
|
466
|
+
),
|
|
467
|
+
style: qt,
|
|
468
|
+
"data-disabled": g ? "" : void 0,
|
|
469
|
+
"data-pending": s ? "" : void 0,
|
|
188
470
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ e(
|
|
190
472
|
"input",
|
|
191
473
|
{
|
|
192
|
-
...
|
|
193
|
-
id:
|
|
474
|
+
...L,
|
|
475
|
+
id: P,
|
|
194
476
|
className: "facto-otp__input",
|
|
195
477
|
type: "text",
|
|
196
|
-
inputMode: "numeric",
|
|
478
|
+
inputMode: r ? "text" : "numeric",
|
|
197
479
|
autoComplete: "one-time-code",
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
"aria-
|
|
206
|
-
"aria-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
480
|
+
autoCapitalize: r ? "characters" : "off",
|
|
481
|
+
spellCheck: !1,
|
|
482
|
+
pattern: r ? "[A-Za-z0-9]*" : "[0-9]*",
|
|
483
|
+
maxLength: M,
|
|
484
|
+
disabled: g || s,
|
|
485
|
+
readOnly: d,
|
|
486
|
+
value: I,
|
|
487
|
+
"aria-invalid": !!v || L["aria-invalid"],
|
|
488
|
+
"aria-busy": s || void 0,
|
|
489
|
+
"aria-describedby": ie(L["aria-describedby"], O, s ? `${P}-pending` : void 0),
|
|
490
|
+
"aria-errormessage": v ? O : void 0,
|
|
491
|
+
onChange: (S) => {
|
|
492
|
+
const $ = S.currentTarget.selectionStart ?? S.currentTarget.value.length, Q = mt(S.currentTarget.value.slice(0, $), M, r).length;
|
|
493
|
+
R({ start: Q, end: Q }), Ct(S.currentTarget.value);
|
|
494
|
+
},
|
|
495
|
+
onSelect: (S) => {
|
|
496
|
+
R({
|
|
497
|
+
start: S.currentTarget.selectionStart ?? 0,
|
|
498
|
+
end: S.currentTarget.selectionEnd ?? 0
|
|
499
|
+
}), N?.(S);
|
|
210
500
|
},
|
|
211
|
-
|
|
212
|
-
|
|
501
|
+
onClick: (S) => {
|
|
502
|
+
T?.(S);
|
|
503
|
+
const $ = S.currentTarget;
|
|
504
|
+
if (S.detail !== 1 || S.shiftKey || $.selectionStart !== $.selectionEnd) return;
|
|
505
|
+
const Q = $.parentElement?.querySelectorAll(".facto-otp__cell");
|
|
506
|
+
if (!Q || Q.length === 0) return;
|
|
507
|
+
let K = -1;
|
|
508
|
+
if (Q.forEach((Ut, Gt) => {
|
|
509
|
+
const xt = Ut.getBoundingClientRect();
|
|
510
|
+
S.clientX >= xt.left && S.clientX <= xt.right && (K = Gt);
|
|
511
|
+
}), K >= 0 && K < I.length) {
|
|
512
|
+
$.setSelectionRange(K, K + 1), R({ start: K, end: K + 1 });
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const ft = I.length;
|
|
516
|
+
$.setSelectionRange(ft, ft), R({ start: ft, end: ft });
|
|
517
|
+
},
|
|
518
|
+
onPaste: (S) => {
|
|
519
|
+
if (m?.(S), S.defaultPrevented) return;
|
|
520
|
+
S.preventDefault();
|
|
521
|
+
const $ = mt(S.clipboardData.getData("text"), M, r);
|
|
522
|
+
R({ start: $.length, end: $.length }), Ct($);
|
|
523
|
+
},
|
|
524
|
+
onFocus: (S) => {
|
|
525
|
+
R({
|
|
526
|
+
start: S.currentTarget.selectionStart ?? I.length,
|
|
527
|
+
end: S.currentTarget.selectionEnd ?? I.length
|
|
528
|
+
}), y?.(S);
|
|
529
|
+
},
|
|
530
|
+
onBlur: b
|
|
213
531
|
}
|
|
214
532
|
),
|
|
215
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ e("span", { className: "facto-otp__visual", "aria-hidden": "true", children: Array.from({ length: M }, (S, $) => {
|
|
534
|
+
const Q = B.end > B.start && $ >= B.start && $ < B.end, K = $ === Ht && B.start === B.end;
|
|
535
|
+
return /* @__PURE__ */ u(Jt, { children: [
|
|
536
|
+
/* @__PURE__ */ e(
|
|
537
|
+
"span",
|
|
538
|
+
{
|
|
539
|
+
className: nt(
|
|
540
|
+
"facto-otp__cell",
|
|
541
|
+
!!I[$] && "facto-otp__cell--filled",
|
|
542
|
+
K && "facto-otp__cell--active",
|
|
543
|
+
Q && "facto-otp__cell--selected"
|
|
544
|
+
),
|
|
545
|
+
style: { "--facto-otp-index": $ },
|
|
546
|
+
children: I[$] ? /* @__PURE__ */ e("span", { className: "facto-otp__digit", children: I[$] }, `${$}-${I[$]}`) : null
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
$ === Tt ? /* @__PURE__ */ e("span", { className: "facto-otp__sep" }) : null
|
|
550
|
+
] }, $);
|
|
551
|
+
}) })
|
|
216
552
|
]
|
|
217
553
|
}
|
|
218
554
|
),
|
|
219
|
-
(
|
|
555
|
+
(v || p) && /* @__PURE__ */ e(
|
|
220
556
|
"span",
|
|
221
557
|
{
|
|
222
|
-
id:
|
|
223
|
-
className:
|
|
224
|
-
role:
|
|
225
|
-
children:
|
|
558
|
+
id: O,
|
|
559
|
+
className: nt("facto-otp__message", !!v && "facto-otp__message--error"),
|
|
560
|
+
role: v ? "alert" : void 0,
|
|
561
|
+
children: v ?? p
|
|
226
562
|
}
|
|
227
563
|
),
|
|
228
|
-
|
|
564
|
+
s && /* @__PURE__ */ e("span", { className: "facto-otp__pending", id: `${P}-pending`, role: "status", children: h })
|
|
229
565
|
] });
|
|
230
566
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
567
|
+
const kt = (t) => t instanceof Date ? t.getTime() : t ?? 0, se = (t, n) => Math.max(0, Math.ceil((kt(t) - n) / 1e3)), le = (t) => `Resend code in ${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
|
|
568
|
+
function Dt({
|
|
233
569
|
deadline: t,
|
|
234
|
-
pending:
|
|
570
|
+
pending: n,
|
|
235
571
|
disabled: a,
|
|
236
572
|
children: o = "Resend code",
|
|
237
|
-
formatCountdown:
|
|
238
|
-
className:
|
|
239
|
-
onClick:
|
|
240
|
-
...
|
|
573
|
+
formatCountdown: r = le,
|
|
574
|
+
className: i,
|
|
575
|
+
onClick: c,
|
|
576
|
+
...l
|
|
241
577
|
}) {
|
|
242
|
-
const [
|
|
243
|
-
|
|
244
|
-
let
|
|
578
|
+
const [s, h] = A(null), f = s === null ? 0 : se(t, s);
|
|
579
|
+
q(() => {
|
|
580
|
+
let v;
|
|
245
581
|
const k = () => {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
Number.isFinite(
|
|
582
|
+
const w = Date.now();
|
|
583
|
+
h(w);
|
|
584
|
+
const C = kt(t) - w;
|
|
585
|
+
Number.isFinite(C) && C > 0 && (v = window.setTimeout(k, Math.min(C, 250)));
|
|
250
586
|
};
|
|
251
|
-
return k(), () => window.clearTimeout(
|
|
587
|
+
return k(), () => window.clearTimeout(v);
|
|
252
588
|
}, [t]);
|
|
253
|
-
const
|
|
254
|
-
return /* @__PURE__ */
|
|
589
|
+
const p = s === null ? kt(t) > 0 : f > 0;
|
|
590
|
+
return /* @__PURE__ */ u(
|
|
255
591
|
"button",
|
|
256
592
|
{
|
|
257
|
-
...
|
|
593
|
+
...l,
|
|
258
594
|
type: "button",
|
|
259
|
-
className:
|
|
260
|
-
disabled: !!(a ||
|
|
261
|
-
"aria-busy":
|
|
262
|
-
onClick:
|
|
595
|
+
className: nt("facto-resend-code", n && "facto-resend-code--pending", i),
|
|
596
|
+
disabled: !!(a || n || p),
|
|
597
|
+
"aria-busy": n || void 0,
|
|
598
|
+
onClick: c,
|
|
263
599
|
children: [
|
|
264
|
-
|
|
265
|
-
|
|
600
|
+
n && /* @__PURE__ */ e("span", { className: "facto-resend-code__spinner", "aria-hidden": "true" }),
|
|
601
|
+
p && s !== null ? r(f) : o
|
|
266
602
|
]
|
|
267
603
|
}
|
|
268
604
|
);
|
|
269
605
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
606
|
+
const At = wt(null);
|
|
607
|
+
function Oe({
|
|
272
608
|
children: t,
|
|
273
|
-
duration:
|
|
609
|
+
duration: n,
|
|
274
610
|
maxVisible: a = 3,
|
|
275
611
|
label: o = "Notifications ({hotkey})"
|
|
276
612
|
}) {
|
|
277
|
-
const [
|
|
278
|
-
|
|
613
|
+
const [r, i] = A([]), c = x([]), l = x(0), s = x(0), h = Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 3, f = n ?? 2600, p = X((d) => {
|
|
614
|
+
c.current = d, i(d);
|
|
279
615
|
}, []);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
id:
|
|
286
|
-
tone:
|
|
287
|
-
title:
|
|
288
|
-
description:
|
|
289
|
-
action:
|
|
290
|
-
duration:
|
|
291
|
-
generation:
|
|
292
|
-
},
|
|
293
|
-
return
|
|
294
|
-
}, [
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
...
|
|
300
|
-
...
|
|
301
|
-
...
|
|
302
|
-
...
|
|
303
|
-
...
|
|
304
|
-
duration:
|
|
305
|
-
generation:
|
|
616
|
+
q(() => {
|
|
617
|
+
p(c.current.slice(-h));
|
|
618
|
+
}, [p, h]);
|
|
619
|
+
const v = X((d, m, y = {}) => {
|
|
620
|
+
const b = y.id ?? `toast-${++l.current}`, N = ++s.current, T = {
|
|
621
|
+
id: b,
|
|
622
|
+
tone: d,
|
|
623
|
+
title: m,
|
|
624
|
+
description: y.description,
|
|
625
|
+
action: y.action,
|
|
626
|
+
duration: d === "loading" ? y.duration ?? 1 / 0 : y.duration,
|
|
627
|
+
generation: N
|
|
628
|
+
}, L = c.current, j = L.findIndex((P) => P.id === b);
|
|
629
|
+
return p(j >= 0 ? L.map((P) => P.id === b ? { ...P, ...T } : P) : [...L, T].slice(-h)), { id: b, generation: N };
|
|
630
|
+
}, [p, h]), k = X((d, m, y) => {
|
|
631
|
+
const b = c.current, N = b.findIndex((L) => L.id === d);
|
|
632
|
+
if (N < 0 || y !== void 0 && b[N].generation !== y) return !1;
|
|
633
|
+
const T = ++s.current;
|
|
634
|
+
p(b.map((L) => L.id !== d ? L : {
|
|
635
|
+
...L,
|
|
636
|
+
...m.title === void 0 ? {} : { title: m.title },
|
|
637
|
+
...m.tone === void 0 ? {} : { tone: m.tone },
|
|
638
|
+
...m.description === void 0 ? {} : { description: m.description },
|
|
639
|
+
...m.action === void 0 ? {} : { action: m.action },
|
|
640
|
+
duration: m.duration ?? (L.tone === "loading" && (m.tone ?? L.tone) !== "loading" ? f : (m.tone ?? L.tone) === "loading" ? 1 / 0 : L.duration),
|
|
641
|
+
generation: T
|
|
306
642
|
}));
|
|
307
|
-
}, [
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
}, [
|
|
311
|
-
success: (
|
|
312
|
-
error: (
|
|
313
|
-
warning: (
|
|
314
|
-
info: (
|
|
315
|
-
loading: (
|
|
316
|
-
update:
|
|
317
|
-
dismiss:
|
|
318
|
-
promise: (
|
|
319
|
-
const
|
|
320
|
-
return Promise.resolve(
|
|
321
|
-
(
|
|
322
|
-
title: typeof
|
|
643
|
+
}, [p, f]), w = X((d, m) => (k(d, m), d), [k]), C = X((d, m) => {
|
|
644
|
+
const y = c.current, b = d === void 0 ? void 0 : y.find((N) => N.id === d);
|
|
645
|
+
d !== void 0 && (!b || m !== void 0 && b.generation !== m) || p(d === void 0 ? [] : y.filter((N) => N.id !== d));
|
|
646
|
+
}, [p]), g = te(() => ({
|
|
647
|
+
success: (d, m) => v("success", d, m).id,
|
|
648
|
+
error: (d, m) => v("error", d, m).id,
|
|
649
|
+
warning: (d, m) => v("warning", d, m).id,
|
|
650
|
+
info: (d, m) => v("info", d, m).id,
|
|
651
|
+
loading: (d, m) => v("loading", d, m).id,
|
|
652
|
+
update: w,
|
|
653
|
+
dismiss: C,
|
|
654
|
+
promise: (d, m, y) => {
|
|
655
|
+
const b = v("loading", m.loading, y);
|
|
656
|
+
return Promise.resolve(d).then(
|
|
657
|
+
(N) => (k(b.id, {
|
|
658
|
+
title: typeof m.success == "function" ? m.success(N) : m.success,
|
|
323
659
|
tone: "success",
|
|
324
|
-
duration:
|
|
325
|
-
},
|
|
326
|
-
(
|
|
327
|
-
throw k(
|
|
328
|
-
title: typeof
|
|
660
|
+
duration: y?.duration ?? f
|
|
661
|
+
}, b.generation), N),
|
|
662
|
+
(N) => {
|
|
663
|
+
throw k(b.id, {
|
|
664
|
+
title: typeof m.error == "function" ? m.error(N) : m.error,
|
|
329
665
|
tone: "error",
|
|
330
|
-
duration:
|
|
331
|
-
},
|
|
666
|
+
duration: y?.duration ?? f
|
|
667
|
+
}, b.generation), N;
|
|
332
668
|
}
|
|
333
669
|
);
|
|
334
670
|
}
|
|
335
|
-
}), [
|
|
336
|
-
return /* @__PURE__ */
|
|
671
|
+
}), [v, f, C, w, k]);
|
|
672
|
+
return /* @__PURE__ */ e(At.Provider, { value: g, children: /* @__PURE__ */ u(ye, { duration: n, children: [
|
|
337
673
|
t,
|
|
338
|
-
|
|
339
|
-
|
|
674
|
+
r.map((d) => /* @__PURE__ */ u(
|
|
675
|
+
Ne,
|
|
340
676
|
{
|
|
341
|
-
duration:
|
|
342
|
-
icon:
|
|
343
|
-
tone:
|
|
344
|
-
type:
|
|
677
|
+
duration: d.duration,
|
|
678
|
+
icon: d.tone === "loading" ? /* @__PURE__ */ e("span", { className: "facto-notification-spinner" }) : void 0,
|
|
679
|
+
tone: d.tone === "error" ? "danger" : d.tone === "loading" ? "info" : d.tone,
|
|
680
|
+
type: d.tone === "error" ? "foreground" : "background",
|
|
345
681
|
open: !0,
|
|
346
|
-
onOpenChange: (
|
|
347
|
-
|
|
682
|
+
onOpenChange: (m) => {
|
|
683
|
+
m || C(d.id, d.generation);
|
|
348
684
|
},
|
|
349
685
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ e(ke, { children: d.title }),
|
|
687
|
+
d.tone === "loading" && /* @__PURE__ */ e(Lt, { children: /* @__PURE__ */ e("span", { role: "status", children: "Loading" }) }),
|
|
688
|
+
d.description != null && /* @__PURE__ */ e(Lt, { children: d.description }),
|
|
689
|
+
d.action && /* @__PURE__ */ e(we, { altText: d.action.altText, onClick: d.action.onClick, children: d.action.label }),
|
|
690
|
+
/* @__PURE__ */ e(Ce, {})
|
|
355
691
|
]
|
|
356
692
|
},
|
|
357
|
-
`${
|
|
693
|
+
`${d.id}-${d.generation}`
|
|
358
694
|
)),
|
|
359
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ e(Te, { label: o })
|
|
360
696
|
] }) });
|
|
361
697
|
}
|
|
362
|
-
function
|
|
363
|
-
const t =
|
|
698
|
+
function We() {
|
|
699
|
+
const t = W(At);
|
|
364
700
|
if (!t) throw new Error("useToast must be used within a NotificationsProvider");
|
|
365
701
|
return t;
|
|
366
702
|
}
|
|
367
|
-
const
|
|
368
|
-
|
|
703
|
+
const D = (...t) => t.filter(Boolean).join(" "), de = () => /* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [
|
|
704
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5" }),
|
|
705
|
+
/* @__PURE__ */ e("path", { d: "M3.5 7l8.5 6 8.5-6" })
|
|
706
|
+
] }), lt = ({ size: t = 16, className: n }) => /* @__PURE__ */ e("svg", { className: n, width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ e("path", { d: "M5 13l4 4L19 7" }) }), zt = () => /* @__PURE__ */ u("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [
|
|
707
|
+
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
708
|
+
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
709
|
+
] }), ue = () => /* @__PURE__ */ e("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ e("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" }) }), fe = () => /* @__PURE__ */ u("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", "aria-hidden": "true", focusable: "false", children: [
|
|
710
|
+
/* @__PURE__ */ e("rect", { x: "8", y: "8", width: "48", height: "48", rx: "16", fill: "var(--facto-accent-soft)", stroke: "var(--facto-notice-success-border)" }),
|
|
711
|
+
/* @__PURE__ */ e("path", { d: "M24 29v-4a8 8 0 1 1 16 0v4", stroke: "var(--facto-accent-strong)", strokeWidth: "2.4", strokeLinecap: "round" }),
|
|
712
|
+
/* @__PURE__ */ e("rect", { x: "20", y: "29", width: "24", height: "18", rx: "5", fill: "var(--facto-surface)", stroke: "var(--facto-accent-strong)", strokeWidth: "2.2" }),
|
|
713
|
+
/* @__PURE__ */ e("circle", { cx: "32", cy: "37", r: "2.2", fill: "var(--facto-accent-strong)" }),
|
|
714
|
+
/* @__PURE__ */ e("path", { d: "M32 39.2V42", stroke: "var(--facto-accent-strong)", strokeWidth: "2.2", strokeLinecap: "round" })
|
|
715
|
+
] });
|
|
716
|
+
function Ve({
|
|
717
|
+
surface: t = "page",
|
|
718
|
+
wide: n = !1,
|
|
719
|
+
stepKey: a,
|
|
720
|
+
motion: o,
|
|
721
|
+
brand: r,
|
|
722
|
+
badge: i,
|
|
723
|
+
children: c,
|
|
724
|
+
className: l,
|
|
725
|
+
...s
|
|
726
|
+
}) {
|
|
727
|
+
const h = a !== void 0 ? /* @__PURE__ */ e(oe, { stepKey: a, motion: o, children: c }) : c;
|
|
728
|
+
return t === "plain" ? /* @__PURE__ */ e("div", { ...s, className: D("facto-auth-shell", "facto-auth-shell--plain", l), children: /* @__PURE__ */ e("div", { className: D("facto-auth-shell__column", n && "facto-auth-shell__column--wide"), children: h }) }) : /* @__PURE__ */ u("div", { ...s, className: D("facto-auth-shell", "facto-auth-shell--page", l), children: [
|
|
729
|
+
(r || i) && /* @__PURE__ */ u("header", { className: "facto-auth-shell__header", children: [
|
|
730
|
+
/* @__PURE__ */ e("div", { children: r }),
|
|
731
|
+
/* @__PURE__ */ e("div", { children: i })
|
|
732
|
+
] }),
|
|
733
|
+
/* @__PURE__ */ e("div", { className: "facto-auth-shell__body", children: /* @__PURE__ */ e("div", { className: D("facto-auth-shell__column", n && "facto-auth-shell__column--wide"), children: h }) })
|
|
734
|
+
] });
|
|
735
|
+
}
|
|
736
|
+
function yt({
|
|
737
|
+
current: t,
|
|
738
|
+
total: n,
|
|
739
|
+
label: a,
|
|
740
|
+
className: o,
|
|
741
|
+
...r
|
|
742
|
+
}) {
|
|
743
|
+
const i = Math.max(1, Math.floor(n)), c = Math.min(i, Math.max(1, Math.floor(t))), l = a ?? `Step ${c} of ${i}`;
|
|
744
|
+
return /* @__PURE__ */ u(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
...r,
|
|
748
|
+
className: D("facto-step-progress", o),
|
|
749
|
+
role: "progressbar",
|
|
750
|
+
"aria-valuenow": c,
|
|
751
|
+
"aria-valuemin": 1,
|
|
752
|
+
"aria-valuemax": i,
|
|
753
|
+
"aria-label": typeof l == "string" ? l : `Step ${c} of ${i}`,
|
|
754
|
+
children: [
|
|
755
|
+
/* @__PURE__ */ e("div", { className: "facto-step-progress__bars", "aria-hidden": "true", children: Array.from({ length: i }, (s, h) => {
|
|
756
|
+
const f = h + 1;
|
|
757
|
+
return /* @__PURE__ */ e(
|
|
758
|
+
"span",
|
|
759
|
+
{
|
|
760
|
+
className: D(
|
|
761
|
+
"facto-step-progress__bar",
|
|
762
|
+
f < c && "facto-step-progress__bar--done",
|
|
763
|
+
f === c && "facto-step-progress__bar--active"
|
|
764
|
+
)
|
|
765
|
+
},
|
|
766
|
+
f
|
|
767
|
+
);
|
|
768
|
+
}) }),
|
|
769
|
+
/* @__PURE__ */ e("span", { className: "facto-step-progress__label", children: l })
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
function he({
|
|
775
|
+
value: t,
|
|
776
|
+
onEdit: n,
|
|
777
|
+
editLabel: a = "Edit",
|
|
778
|
+
className: o,
|
|
779
|
+
...r
|
|
780
|
+
}) {
|
|
781
|
+
return /* @__PURE__ */ u("div", { ...r, className: D("facto-identity-pill", o), children: [
|
|
782
|
+
/* @__PURE__ */ e("span", { className: "facto-identity-pill__value", children: t }),
|
|
783
|
+
n && /* @__PURE__ */ e(
|
|
784
|
+
"button",
|
|
785
|
+
{
|
|
786
|
+
type: "button",
|
|
787
|
+
className: "facto-auth-link-btn facto-auth-link-btn--accent",
|
|
788
|
+
style: { minHeight: 28, padding: "2px 4px" },
|
|
789
|
+
onClick: n,
|
|
790
|
+
children: a
|
|
791
|
+
}
|
|
792
|
+
)
|
|
793
|
+
] });
|
|
794
|
+
}
|
|
795
|
+
function me({
|
|
796
|
+
value: t,
|
|
797
|
+
displayValue: n,
|
|
798
|
+
copyLabel: a = "Copy",
|
|
799
|
+
copiedLabel: o = "Copied",
|
|
800
|
+
onCopy: r,
|
|
801
|
+
className: i,
|
|
802
|
+
ariaLabel: c = "Copy setup key"
|
|
803
|
+
}) {
|
|
804
|
+
const [l, s] = A(!1), h = () => {
|
|
805
|
+
typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(t).catch(() => {
|
|
806
|
+
}), s(!0), r?.(t), window.setTimeout(() => s(!1), 2e3);
|
|
807
|
+
};
|
|
808
|
+
return /* @__PURE__ */ u(
|
|
809
|
+
"button",
|
|
810
|
+
{
|
|
811
|
+
type: "button",
|
|
812
|
+
className: D("facto-secret-key", l && "facto-secret-key--copied", i),
|
|
813
|
+
"aria-label": c,
|
|
814
|
+
onClick: h,
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ e("code", { className: "facto-secret-key__code", children: n ?? t }),
|
|
817
|
+
/* @__PURE__ */ u("span", { className: "facto-secret-key__action", children: [
|
|
818
|
+
l ? /* @__PURE__ */ e(lt, { size: 15, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(zt, {}),
|
|
819
|
+
/* @__PURE__ */ e("span", { children: l ? o : a })
|
|
820
|
+
] })
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
function He({
|
|
826
|
+
email: t,
|
|
827
|
+
code: n,
|
|
828
|
+
onCodeChange: a,
|
|
829
|
+
onSubmit: o,
|
|
830
|
+
onEmailChange: r,
|
|
831
|
+
onBack: i,
|
|
832
|
+
onResend: c,
|
|
833
|
+
resendDeadline: l,
|
|
834
|
+
resendPending: s,
|
|
835
|
+
step: h,
|
|
836
|
+
title: f = "Check your inbox",
|
|
837
|
+
description: p = "Enter the 6-digit code we sent to your email.",
|
|
838
|
+
helperText: v = "Code expires in 10 minutes",
|
|
839
|
+
error: k,
|
|
840
|
+
pending: w = !1,
|
|
841
|
+
verified: C = !1,
|
|
842
|
+
autoSubmit: g = !1,
|
|
843
|
+
length: d = 6,
|
|
844
|
+
alphanumeric: m = !1,
|
|
845
|
+
unreadCount: y = 1,
|
|
846
|
+
submitLabel: b = "Verify email",
|
|
847
|
+
backLabel: N = "Back",
|
|
848
|
+
className: T
|
|
849
|
+
}) {
|
|
850
|
+
const [L, j] = A(!1), [P, O] = A(t), M = G(), I = (R) => {
|
|
851
|
+
R.preventDefault(), n.length === d && !w && o?.(n);
|
|
852
|
+
}, B = (R) => {
|
|
853
|
+
R.preventDefault();
|
|
854
|
+
const E = P.trim();
|
|
855
|
+
E && (r?.(E), j(!1));
|
|
856
|
+
};
|
|
857
|
+
return /* @__PURE__ */ u("div", { className: D("facto-email-verify", T), children: [
|
|
858
|
+
h && /* @__PURE__ */ e(yt, { current: h.current, total: h.total, label: h.label }),
|
|
859
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-head facto-auth-head--center", children: [
|
|
860
|
+
/* @__PURE__ */ u("div", { className: D("facto-mail-badge", C && "facto-mail-badge--verified"), "aria-hidden": "true", children: [
|
|
861
|
+
C ? /* @__PURE__ */ e(lt, { size: 22, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(de, {}),
|
|
862
|
+
/* @__PURE__ */ e("span", { className: "facto-mail-badge__count", children: C ? "✓" : y })
|
|
863
|
+
] }),
|
|
864
|
+
/* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: f }),
|
|
865
|
+
p && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: p })
|
|
866
|
+
] }),
|
|
867
|
+
L && r ? /* @__PURE__ */ u("form", { className: "facto-email-verify__edit", onSubmit: B, children: [
|
|
868
|
+
/* @__PURE__ */ e("label", { htmlFor: M, className: "facto-visually-hidden", children: "Email address" }),
|
|
869
|
+
/* @__PURE__ */ e(
|
|
870
|
+
"input",
|
|
871
|
+
{
|
|
872
|
+
id: M,
|
|
873
|
+
type: "email",
|
|
874
|
+
className: "facto-email-verify__edit-input",
|
|
875
|
+
value: P,
|
|
876
|
+
onChange: (R) => O(R.target.value),
|
|
877
|
+
required: !0
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-actions-row", children: [
|
|
881
|
+
/* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: () => {
|
|
882
|
+
O(t), j(!1);
|
|
883
|
+
}, children: "Cancel" }),
|
|
884
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "facto-auth-primary-btn", style: { width: "auto", minHeight: 36, padding: "6px 16px" }, children: "Save and resend" })
|
|
885
|
+
] })
|
|
886
|
+
] }) : /* @__PURE__ */ e(
|
|
887
|
+
he,
|
|
888
|
+
{
|
|
889
|
+
value: t,
|
|
890
|
+
onEdit: r ? () => {
|
|
891
|
+
O(t), j(!0);
|
|
892
|
+
} : void 0
|
|
893
|
+
}
|
|
894
|
+
),
|
|
895
|
+
/* @__PURE__ */ u("form", { className: "facto-auth-stack", onSubmit: I, children: [
|
|
896
|
+
/* @__PURE__ */ e("div", { className: "facto-email-verify__otp", children: /* @__PURE__ */ e(
|
|
897
|
+
pt,
|
|
898
|
+
{
|
|
899
|
+
"aria-label": "Verification code",
|
|
900
|
+
value: n,
|
|
901
|
+
onValueChange: a,
|
|
902
|
+
onComplete: g ? o : void 0,
|
|
903
|
+
length: d,
|
|
904
|
+
split: d === 6 || d === 8,
|
|
905
|
+
alphanumeric: m,
|
|
906
|
+
pending: w,
|
|
907
|
+
verified: C,
|
|
908
|
+
error: k,
|
|
909
|
+
helperText: !k && !C ? v : void 0
|
|
910
|
+
}
|
|
911
|
+
) }),
|
|
912
|
+
!g && /* @__PURE__ */ u(
|
|
913
|
+
"button",
|
|
914
|
+
{
|
|
915
|
+
type: "submit",
|
|
916
|
+
className: "facto-auth-primary-btn",
|
|
917
|
+
disabled: w || n.length < d,
|
|
918
|
+
"aria-busy": w || void 0,
|
|
919
|
+
children: [
|
|
920
|
+
w && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
|
|
921
|
+
b
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
)
|
|
925
|
+
] }),
|
|
926
|
+
(i || c) && /* @__PURE__ */ u("div", { className: "facto-auth-actions-row", children: [
|
|
927
|
+
i ? /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: i, children: N }) : /* @__PURE__ */ e("span", {}),
|
|
928
|
+
c ? /* @__PURE__ */ e(
|
|
929
|
+
Dt,
|
|
930
|
+
{
|
|
931
|
+
deadline: l,
|
|
932
|
+
pending: s,
|
|
933
|
+
onClick: c
|
|
934
|
+
}
|
|
935
|
+
) : null
|
|
936
|
+
] })
|
|
937
|
+
] });
|
|
938
|
+
}
|
|
939
|
+
function qe({
|
|
940
|
+
step: t,
|
|
941
|
+
illustration: n,
|
|
942
|
+
title: a = "Secure your account",
|
|
943
|
+
description: o = "Add a passkey for faster, phishing-resistant sign-in on this device.",
|
|
944
|
+
capabilities: r = [
|
|
945
|
+
"Works with Touch ID, Face ID, or a hardware security key",
|
|
946
|
+
"Bound to this domain to protect against phishing links"
|
|
947
|
+
],
|
|
948
|
+
ctaLabel: i = "Create passkey",
|
|
949
|
+
pendingLabel: c = "Waiting for your device…",
|
|
950
|
+
pending: l = !1,
|
|
951
|
+
verified: s = !1,
|
|
952
|
+
verifiedMessage: h = "Passkey registered on this device.",
|
|
953
|
+
error: f,
|
|
954
|
+
onCreatePasskey: p,
|
|
955
|
+
onSwitchAlternative: v,
|
|
956
|
+
alternativeLabel: k = "Use an authenticator app instead",
|
|
957
|
+
className: w
|
|
958
|
+
}) {
|
|
959
|
+
return /* @__PURE__ */ u("div", { className: D("facto-passkey-card", w), children: [
|
|
960
|
+
t && /* @__PURE__ */ e(yt, { current: t.current, total: t.total, label: t.label }),
|
|
961
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-head facto-auth-head--center", children: [
|
|
962
|
+
/* @__PURE__ */ e(
|
|
963
|
+
"div",
|
|
964
|
+
{
|
|
965
|
+
className: D(
|
|
966
|
+
"facto-passkey-card__hero",
|
|
967
|
+
l && "facto-passkey-card__hero--pending",
|
|
968
|
+
s && !f && "facto-passkey-card__hero--verified"
|
|
969
|
+
),
|
|
970
|
+
children: n ?? /* @__PURE__ */ e(fe, {})
|
|
971
|
+
}
|
|
972
|
+
),
|
|
973
|
+
/* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: a }),
|
|
974
|
+
o && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: o })
|
|
975
|
+
] }),
|
|
976
|
+
r.length > 0 && /* @__PURE__ */ e("div", { className: "facto-passkey-card__panel", children: /* @__PURE__ */ e("ul", { className: "facto-passkey-card__list", children: r.map((C, g) => /* @__PURE__ */ u("li", { children: [
|
|
977
|
+
/* @__PURE__ */ e(lt, { size: 15, className: "facto-passkey-card__check" }),
|
|
978
|
+
/* @__PURE__ */ e("span", { children: C })
|
|
979
|
+
] }, g)) }) }),
|
|
980
|
+
f && /* @__PURE__ */ e("div", { className: "facto-auth-alert", role: "alert", children: f }),
|
|
981
|
+
s && !f && /* @__PURE__ */ u("div", { className: "facto-auth-status", role: "status", children: [
|
|
982
|
+
/* @__PURE__ */ e(lt, { size: 15 }),
|
|
983
|
+
/* @__PURE__ */ e("span", { children: h })
|
|
984
|
+
] }),
|
|
985
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-stack facto-auth-stack--tight", children: [
|
|
986
|
+
/* @__PURE__ */ u(
|
|
987
|
+
"button",
|
|
988
|
+
{
|
|
989
|
+
type: "button",
|
|
990
|
+
className: "facto-auth-primary-btn",
|
|
991
|
+
disabled: l,
|
|
992
|
+
"aria-busy": l || void 0,
|
|
993
|
+
onClick: p,
|
|
994
|
+
children: [
|
|
995
|
+
l && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
|
|
996
|
+
l ? c : i
|
|
997
|
+
]
|
|
998
|
+
}
|
|
999
|
+
),
|
|
1000
|
+
v && /* @__PURE__ */ e("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: v, children: k }) })
|
|
1001
|
+
] })
|
|
1002
|
+
] });
|
|
1003
|
+
}
|
|
1004
|
+
function Ue({
|
|
1005
|
+
step: t,
|
|
1006
|
+
title: n = "Set up an authenticator app",
|
|
1007
|
+
description: a = "Scan the QR code in Google Authenticator, 1Password, or another TOTP app.",
|
|
1008
|
+
issuer: o,
|
|
1009
|
+
accountLabel: r,
|
|
1010
|
+
qrCode: i,
|
|
1011
|
+
manualKey: c,
|
|
1012
|
+
displayManualKey: l,
|
|
1013
|
+
code: s,
|
|
1014
|
+
onCodeChange: h,
|
|
1015
|
+
onSubmit: f,
|
|
1016
|
+
emailFactor: p,
|
|
1017
|
+
error: v,
|
|
1018
|
+
pending: k = !1,
|
|
1019
|
+
verified: w = !1,
|
|
1020
|
+
submitLabel: C = "Verify and continue",
|
|
1021
|
+
onSwitchAlternative: g,
|
|
1022
|
+
alternativeLabel: d = "Use a passkey instead",
|
|
1023
|
+
className: m
|
|
1024
|
+
}) {
|
|
1025
|
+
const y = !p || p.code.length === 6, b = s.length === 6 && y && !k, N = (T) => {
|
|
1026
|
+
T.preventDefault(), b && f(s);
|
|
1027
|
+
};
|
|
1028
|
+
return /* @__PURE__ */ u("div", { className: D("facto-totp-card", m), children: [
|
|
1029
|
+
t && /* @__PURE__ */ e(yt, { current: t.current, total: t.total, label: t.label }),
|
|
1030
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-head", children: [
|
|
1031
|
+
/* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: n }),
|
|
1032
|
+
a && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: a })
|
|
1033
|
+
] }),
|
|
1034
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__qr-row", children: [
|
|
1035
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__qr-frame", children: i }),
|
|
1036
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__qr-meta", children: [
|
|
1037
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__issuer", children: [
|
|
1038
|
+
o,
|
|
1039
|
+
": ",
|
|
1040
|
+
r
|
|
1041
|
+
] }),
|
|
1042
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__caption", children: "Scan this QR code or copy the setup key below." })
|
|
1043
|
+
] })
|
|
1044
|
+
] }),
|
|
1045
|
+
/* @__PURE__ */ e(me, { value: c, displayValue: l ?? c }),
|
|
1046
|
+
/* @__PURE__ */ u("form", { className: "facto-auth-stack", onSubmit: N, children: [
|
|
1047
|
+
p ? /* @__PURE__ */ u("div", { className: "facto-totp-card__dual", children: [
|
|
1048
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__factor-row", children: [
|
|
1049
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__factor-head", children: [
|
|
1050
|
+
/* @__PURE__ */ u("div", { children: [
|
|
1051
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__factor-title", children: p.title ?? "Email verification code" }),
|
|
1052
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__factor-sub", children: p.description ?? "Confirm your account email." })
|
|
1053
|
+
] }),
|
|
1054
|
+
/* @__PURE__ */ e(
|
|
1055
|
+
Dt,
|
|
1056
|
+
{
|
|
1057
|
+
deadline: p.deadline,
|
|
1058
|
+
pending: p.sending,
|
|
1059
|
+
onClick: p.onSend,
|
|
1060
|
+
children: "Send code"
|
|
1061
|
+
}
|
|
1062
|
+
)
|
|
1063
|
+
] }),
|
|
1064
|
+
/* @__PURE__ */ e(
|
|
1065
|
+
pt,
|
|
1066
|
+
{
|
|
1067
|
+
"aria-label": "Email verification code",
|
|
1068
|
+
value: p.code,
|
|
1069
|
+
onValueChange: p.onCodeChange,
|
|
1070
|
+
length: 6,
|
|
1071
|
+
split: !0,
|
|
1072
|
+
pending: k
|
|
1073
|
+
}
|
|
1074
|
+
)
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ u("div", { className: "facto-totp-card__factor-row", children: [
|
|
1077
|
+
/* @__PURE__ */ u("div", { children: [
|
|
1078
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__factor-title", children: "Authenticator 6-digit code" }),
|
|
1079
|
+
/* @__PURE__ */ e("div", { className: "facto-totp-card__factor-sub", children: "Enter the current code from your authenticator app." })
|
|
1080
|
+
] }),
|
|
1081
|
+
/* @__PURE__ */ e(
|
|
1082
|
+
pt,
|
|
1083
|
+
{
|
|
1084
|
+
"aria-label": "Authenticator 6-digit code",
|
|
1085
|
+
value: s,
|
|
1086
|
+
onValueChange: h,
|
|
1087
|
+
length: 6,
|
|
1088
|
+
split: !0,
|
|
1089
|
+
pending: k,
|
|
1090
|
+
verified: w,
|
|
1091
|
+
error: void 0
|
|
1092
|
+
}
|
|
1093
|
+
)
|
|
1094
|
+
] })
|
|
1095
|
+
] }) : /* @__PURE__ */ e(
|
|
1096
|
+
pt,
|
|
1097
|
+
{
|
|
1098
|
+
label: "6-digit authenticator code",
|
|
1099
|
+
value: s,
|
|
1100
|
+
onValueChange: h,
|
|
1101
|
+
length: 6,
|
|
1102
|
+
split: !0,
|
|
1103
|
+
pending: k,
|
|
1104
|
+
verified: w,
|
|
1105
|
+
error: v
|
|
1106
|
+
}
|
|
1107
|
+
),
|
|
1108
|
+
p && v && /* @__PURE__ */ e("div", { className: "facto-auth-alert", role: "alert", children: v }),
|
|
1109
|
+
/* @__PURE__ */ u(
|
|
1110
|
+
"button",
|
|
1111
|
+
{
|
|
1112
|
+
type: "submit",
|
|
1113
|
+
className: "facto-auth-primary-btn",
|
|
1114
|
+
disabled: !b,
|
|
1115
|
+
"aria-busy": k || void 0,
|
|
1116
|
+
children: [
|
|
1117
|
+
k && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
|
|
1118
|
+
C
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
] }),
|
|
1123
|
+
g && /* @__PURE__ */ e("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: g, children: d }) })
|
|
1124
|
+
] });
|
|
1125
|
+
}
|
|
1126
|
+
function pe(t, n = {}) {
|
|
1127
|
+
return [...[
|
|
1128
|
+
`${n.issuer ?? "Facto"} — Recovery Codes`,
|
|
1129
|
+
...n.account ? [`Account: ${n.account}`] : [],
|
|
1130
|
+
"",
|
|
1131
|
+
"Each code can be used once to recover account access.",
|
|
1132
|
+
"Store these codes in a password manager or secure offline location.",
|
|
1133
|
+
""
|
|
1134
|
+
], ...t.map((o, r) => `${r + 1}. ${o}`), ""].join(`
|
|
1135
|
+
`);
|
|
1136
|
+
}
|
|
1137
|
+
function Ge({
|
|
1138
|
+
codes: t,
|
|
1139
|
+
usedIndices: n = [],
|
|
1140
|
+
variant: a = "onboarding",
|
|
1141
|
+
step: o,
|
|
1142
|
+
title: r,
|
|
1143
|
+
description: i,
|
|
1144
|
+
confirmationLabel: c = "I have saved these recovery codes in a safe place",
|
|
1145
|
+
continueLabel: l = "Continue",
|
|
1146
|
+
regenerateLabel: s = "Generate new codes",
|
|
1147
|
+
onCopyAll: h,
|
|
1148
|
+
onDownload: f,
|
|
1149
|
+
onContinue: p,
|
|
1150
|
+
onRegenerate: v,
|
|
1151
|
+
className: k
|
|
1152
|
+
}) {
|
|
1153
|
+
const [w, C] = A(!1), [g, d] = A(!1), [m, y] = A(null), b = G(), N = a === "manage", T = new Set(n), L = t.filter((B, R) => !T.has(R)).length, j = r ?? (N ? "Recovery codes" : "Save your recovery codes"), P = i ?? (N ? `${L} of ${t.length} one-time recovery codes remaining. Regenerating invalidates all existing codes.` : "Store these one-time codes somewhere safe. You will need one to register a replacement passkey if you lose this device."), O = (B, R) => {
|
|
1154
|
+
T.has(R) || (typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(B).catch(() => {
|
|
1155
|
+
}), y(R), window.setTimeout(() => y((E) => E === R ? null : E), 1200));
|
|
1156
|
+
}, M = () => {
|
|
1157
|
+
typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(t.join(`
|
|
1158
|
+
`)).catch(() => {
|
|
1159
|
+
}), d(!0), N || C(!0), h?.(t), window.setTimeout(() => d(!1), 2e3);
|
|
1160
|
+
}, I = () => {
|
|
1161
|
+
if (N || C(!0), f) {
|
|
1162
|
+
f(t);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
if (typeof document > "u" || typeof URL > "u") return;
|
|
1166
|
+
const B = new Blob([pe(t)], { type: "text/plain;charset=utf-8" }), R = URL.createObjectURL(B), E = document.createElement("a");
|
|
1167
|
+
E.href = R, E.download = "facto-recovery-codes.txt", document.body.appendChild(E), E.click(), E.remove(), window.setTimeout(() => URL.revokeObjectURL(R), 1e3);
|
|
1168
|
+
};
|
|
1169
|
+
return /* @__PURE__ */ u("div", { className: D("facto-recovery-step", k), children: [
|
|
1170
|
+
o && /* @__PURE__ */ e(yt, { current: o.current, total: o.total, label: o.label }),
|
|
1171
|
+
/* @__PURE__ */ u("div", { className: "facto-auth-head", children: [
|
|
1172
|
+
/* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: j }),
|
|
1173
|
+
/* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: P })
|
|
1174
|
+
] }),
|
|
1175
|
+
/* @__PURE__ */ u("div", { className: "facto-recovery-step__panel", children: [
|
|
1176
|
+
/* @__PURE__ */ e("div", { className: "facto-recovery-step__grid", "aria-label": "Recovery codes", children: t.map((B, R) => {
|
|
1177
|
+
const E = N && T.has(R), rt = m === R;
|
|
1178
|
+
return /* @__PURE__ */ e(
|
|
1179
|
+
"button",
|
|
1180
|
+
{
|
|
1181
|
+
type: "button",
|
|
1182
|
+
className: D(
|
|
1183
|
+
"facto-recovery-step__code",
|
|
1184
|
+
E && "facto-recovery-step__code--used",
|
|
1185
|
+
rt && "facto-recovery-step__code--copied"
|
|
1186
|
+
),
|
|
1187
|
+
disabled: E,
|
|
1188
|
+
"aria-label": E ? `${B}, used` : `Copy recovery code ${B}`,
|
|
1189
|
+
onClick: () => O(B, R),
|
|
1190
|
+
children: rt ? "Copied ✓" : B
|
|
1191
|
+
},
|
|
1192
|
+
`${B}-${R}`
|
|
1193
|
+
);
|
|
1194
|
+
}) }),
|
|
1195
|
+
/* @__PURE__ */ u("div", { className: "facto-recovery-step__toolbar", children: [
|
|
1196
|
+
/* @__PURE__ */ u("button", { type: "button", className: "facto-recovery-step__utility-btn", onClick: M, children: [
|
|
1197
|
+
g ? /* @__PURE__ */ e(lt, { size: 15, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(zt, {}),
|
|
1198
|
+
/* @__PURE__ */ e("span", { children: g ? "Copied all" : "Copy codes" })
|
|
1199
|
+
] }),
|
|
1200
|
+
/* @__PURE__ */ u("button", { type: "button", className: "facto-recovery-step__utility-btn", onClick: I, children: [
|
|
1201
|
+
/* @__PURE__ */ e(ue, {}),
|
|
1202
|
+
/* @__PURE__ */ e("span", { children: "Download .txt" })
|
|
1203
|
+
] })
|
|
1204
|
+
] })
|
|
1205
|
+
] }),
|
|
1206
|
+
N ? v ? /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-primary-btn", onClick: v, children: s }) : null : /* @__PURE__ */ u(et, { children: [
|
|
1207
|
+
/* @__PURE__ */ u("label", { className: "facto-recovery-step__confirm", htmlFor: b, children: [
|
|
1208
|
+
/* @__PURE__ */ e(
|
|
1209
|
+
"input",
|
|
1210
|
+
{
|
|
1211
|
+
id: b,
|
|
1212
|
+
type: "checkbox",
|
|
1213
|
+
className: "facto-recovery-step__checkbox",
|
|
1214
|
+
checked: w,
|
|
1215
|
+
onChange: (B) => C(B.target.checked)
|
|
1216
|
+
}
|
|
1217
|
+
),
|
|
1218
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
1219
|
+
] }),
|
|
1220
|
+
/* @__PURE__ */ e(
|
|
1221
|
+
"button",
|
|
1222
|
+
{
|
|
1223
|
+
type: "button",
|
|
1224
|
+
className: "facto-auth-primary-btn",
|
|
1225
|
+
disabled: !w,
|
|
1226
|
+
onClick: p,
|
|
1227
|
+
children: l
|
|
1228
|
+
}
|
|
1229
|
+
)
|
|
1230
|
+
] })
|
|
1231
|
+
] });
|
|
1232
|
+
}
|
|
1233
|
+
function Ke({
|
|
1234
|
+
options: t,
|
|
1235
|
+
value: n,
|
|
1236
|
+
onValueChange: a,
|
|
1237
|
+
columns: o = 2,
|
|
1238
|
+
ariaLabel: r,
|
|
1239
|
+
className: i,
|
|
1240
|
+
...c
|
|
1241
|
+
}) {
|
|
1242
|
+
return /* @__PURE__ */ e(
|
|
1243
|
+
"div",
|
|
1244
|
+
{
|
|
1245
|
+
...c,
|
|
1246
|
+
role: "radiogroup",
|
|
1247
|
+
"aria-label": r,
|
|
1248
|
+
className: D("facto-selection-group", o === 1 && "facto-selection-group--single", i),
|
|
1249
|
+
children: t.map((l) => {
|
|
1250
|
+
const s = l.value === n;
|
|
1251
|
+
return /* @__PURE__ */ u(
|
|
1252
|
+
"button",
|
|
1253
|
+
{
|
|
1254
|
+
type: "button",
|
|
1255
|
+
role: "radio",
|
|
1256
|
+
"aria-checked": s,
|
|
1257
|
+
disabled: l.disabled,
|
|
1258
|
+
className: D("facto-selection-card", s && "facto-selection-card--selected"),
|
|
1259
|
+
onClick: () => a(l.value),
|
|
1260
|
+
children: [
|
|
1261
|
+
/* @__PURE__ */ u("span", { className: "facto-selection-card__head", children: [
|
|
1262
|
+
/* @__PURE__ */ u("span", { className: "facto-selection-card__title", children: [
|
|
1263
|
+
l.icon,
|
|
1264
|
+
/* @__PURE__ */ e("span", { children: l.title })
|
|
1265
|
+
] }),
|
|
1266
|
+
/* @__PURE__ */ e("span", { className: "facto-selection-card__radio", "aria-hidden": "true" })
|
|
1267
|
+
] }),
|
|
1268
|
+
l.description && /* @__PURE__ */ e("p", { className: "facto-selection-card__desc", children: l.description }),
|
|
1269
|
+
l.meta && /* @__PURE__ */ e("span", { className: D("facto-selection-card__meta", l.metaTone === "accent" && "facto-selection-card__meta--accent"), children: l.meta })
|
|
1270
|
+
]
|
|
1271
|
+
},
|
|
1272
|
+
l.value
|
|
1273
|
+
);
|
|
1274
|
+
})
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
}
|
|
1278
|
+
const _ = (...t) => t.filter(Boolean).join(" "), ct = (...t) => t.filter(Boolean).join(" ") || void 0, U = wt({}), ve = (t) => Object.fromEntries(
|
|
1279
|
+
Object.entries(t ?? {}).filter(([n, a]) => n.startsWith("--facto-") && a !== void 0 && a !== null)
|
|
369
1280
|
);
|
|
370
|
-
function
|
|
371
|
-
const i =
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
plus: /* @__PURE__ */
|
|
377
|
-
chevronLeft: /* @__PURE__ */
|
|
378
|
-
copy: /* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
1281
|
+
function Ye({ className: t, tokens: n, style: a, motion: o, ...r }) {
|
|
1282
|
+
const i = W(U), c = { ...n, ...a }, l = { ...i, ...ve(c) };
|
|
1283
|
+
return /* @__PURE__ */ e(gt, { motion: o, children: /* @__PURE__ */ e(U.Provider, { value: l, children: /* @__PURE__ */ e("div", { ...r, style: c, className: _("facto-theme", t) }) }) });
|
|
1284
|
+
}
|
|
1285
|
+
function ot({ name: t, size: n = 20, ...a }) {
|
|
1286
|
+
return /* @__PURE__ */ e("svg", { width: n, height: n, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...a, children: {
|
|
1287
|
+
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
1288
|
+
chevronLeft: /* @__PURE__ */ e("path", { d: "m15 6-6 6 6 6" }),
|
|
1289
|
+
copy: /* @__PURE__ */ u(et, { children: [
|
|
1290
|
+
/* @__PURE__ */ e("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2" }),
|
|
1291
|
+
/* @__PURE__ */ e("path", { d: "M16 8V4H4v12h4" })
|
|
381
1292
|
] }),
|
|
382
|
-
search: /* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
1293
|
+
search: /* @__PURE__ */ u(et, { children: [
|
|
1294
|
+
/* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "6" }),
|
|
1295
|
+
/* @__PURE__ */ e("path", { d: "m15 15 5 5" })
|
|
385
1296
|
] }),
|
|
386
|
-
close: /* @__PURE__ */
|
|
387
|
-
arrowLeft: /* @__PURE__ */
|
|
388
|
-
check: /* @__PURE__ */
|
|
389
|
-
chevronDown: /* @__PURE__ */
|
|
390
|
-
chevronRight: /* @__PURE__ */
|
|
391
|
-
info: /* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
1297
|
+
close: /* @__PURE__ */ e("path", { d: "m6 6 12 12M18 6 6 18" }),
|
|
1298
|
+
arrowLeft: /* @__PURE__ */ e("path", { d: "m12 5-7 7 7 7M5 12h14" }),
|
|
1299
|
+
check: /* @__PURE__ */ e("path", { d: "m5 12 4 4L19 6" }),
|
|
1300
|
+
chevronDown: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }),
|
|
1301
|
+
chevronRight: /* @__PURE__ */ e("path", { d: "m9 6 6 6-6 6" }),
|
|
1302
|
+
info: /* @__PURE__ */ u(et, { children: [
|
|
1303
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1304
|
+
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7v1" })
|
|
394
1305
|
] }),
|
|
395
|
-
warning: /* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
1306
|
+
warning: /* @__PURE__ */ u(et, { children: [
|
|
1307
|
+
/* @__PURE__ */ e("path", { d: "m12 3 10 18H2L12 3Z" }),
|
|
1308
|
+
/* @__PURE__ */ e("path", { d: "M12 9v5M12 17v1" })
|
|
398
1309
|
] })
|
|
399
1310
|
}[t] });
|
|
400
1311
|
}
|
|
401
|
-
function
|
|
402
|
-
return /* @__PURE__ */
|
|
1312
|
+
function Qe({ className: t, ...n }) {
|
|
1313
|
+
return /* @__PURE__ */ e("div", { ...n, className: _("facto-modal-header", t) });
|
|
403
1314
|
}
|
|
404
|
-
function
|
|
405
|
-
return /* @__PURE__ */
|
|
1315
|
+
function Xe({ className: t, ...n }) {
|
|
1316
|
+
return /* @__PURE__ */ e("div", { ...n, className: _("facto-modal-footer", t) });
|
|
406
1317
|
}
|
|
407
|
-
const
|
|
1318
|
+
const Ze = dt(
|
|
408
1319
|
function({
|
|
409
|
-
variant:
|
|
1320
|
+
variant: n = "primary",
|
|
410
1321
|
size: a = "md",
|
|
411
1322
|
fullWidth: o,
|
|
412
|
-
loading:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
1323
|
+
loading: r,
|
|
1324
|
+
motion: i,
|
|
1325
|
+
style: c,
|
|
1326
|
+
leadingIcon: l,
|
|
1327
|
+
trailingIcon: s,
|
|
1328
|
+
className: h,
|
|
1329
|
+
children: f,
|
|
1330
|
+
disabled: p,
|
|
1331
|
+
type: v = "button",
|
|
1332
|
+
...k
|
|
420
1333
|
}, w) {
|
|
421
|
-
|
|
1334
|
+
const C = Y(i);
|
|
1335
|
+
return /* @__PURE__ */ u(
|
|
422
1336
|
"button",
|
|
423
1337
|
{
|
|
424
|
-
...
|
|
1338
|
+
...k,
|
|
425
1339
|
ref: w,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
1340
|
+
style: { ...c, ...C },
|
|
1341
|
+
type: v,
|
|
1342
|
+
disabled: p || r,
|
|
1343
|
+
"aria-busy": r || void 0,
|
|
1344
|
+
className: _(
|
|
430
1345
|
"facto-button",
|
|
431
|
-
`facto-button--${
|
|
1346
|
+
`facto-button--${n}`,
|
|
432
1347
|
`facto-button--${a}`,
|
|
433
1348
|
o && "facto-button--full",
|
|
434
|
-
|
|
1349
|
+
h
|
|
435
1350
|
),
|
|
436
1351
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
1352
|
+
/* @__PURE__ */ u("span", { className: "facto-button__content", style: r ? { opacity: 0 } : void 0, children: [
|
|
1353
|
+
l,
|
|
1354
|
+
/* @__PURE__ */ e("span", { children: f }),
|
|
1355
|
+
s
|
|
441
1356
|
] }),
|
|
442
|
-
|
|
1357
|
+
r && /* @__PURE__ */ e("span", { className: "facto-button__spinner", "aria-hidden": "true" })
|
|
443
1358
|
]
|
|
444
1359
|
}
|
|
445
1360
|
);
|
|
446
1361
|
}
|
|
447
|
-
),
|
|
448
|
-
function({ ariaLabel:
|
|
449
|
-
return /* @__PURE__ */
|
|
1362
|
+
), Je = dt(
|
|
1363
|
+
function({ ariaLabel: n, size: a = "md", className: o, title: r, type: i = "button", children: c, ...l }, s) {
|
|
1364
|
+
return /* @__PURE__ */ e(
|
|
450
1365
|
"button",
|
|
451
1366
|
{
|
|
452
|
-
...
|
|
453
|
-
ref:
|
|
454
|
-
type:
|
|
455
|
-
"aria-label":
|
|
456
|
-
title:
|
|
457
|
-
className:
|
|
1367
|
+
...l,
|
|
1368
|
+
ref: s,
|
|
1369
|
+
type: i,
|
|
1370
|
+
"aria-label": n,
|
|
1371
|
+
title: r ?? n,
|
|
1372
|
+
className: _(
|
|
458
1373
|
"facto-icon-button",
|
|
459
1374
|
`facto-icon-button--${a}`,
|
|
460
1375
|
o
|
|
461
1376
|
),
|
|
462
|
-
children: /* @__PURE__ */
|
|
1377
|
+
children: /* @__PURE__ */ e("span", { className: "facto-icon-button__visual", children: c })
|
|
463
1378
|
}
|
|
464
1379
|
);
|
|
465
1380
|
}
|
|
466
1381
|
);
|
|
467
|
-
function
|
|
468
|
-
return /* @__PURE__ */
|
|
1382
|
+
function Ft({ padding: t = "lg", className: n, ...a }) {
|
|
1383
|
+
return /* @__PURE__ */ e(
|
|
469
1384
|
"div",
|
|
470
1385
|
{
|
|
471
1386
|
...a,
|
|
472
|
-
className:
|
|
1387
|
+
className: _(
|
|
473
1388
|
"facto-surface",
|
|
474
1389
|
`facto-surface--padding-${t}`,
|
|
475
|
-
|
|
1390
|
+
n
|
|
476
1391
|
)
|
|
477
1392
|
}
|
|
478
1393
|
);
|
|
479
1394
|
}
|
|
480
|
-
function
|
|
481
|
-
return /* @__PURE__ */
|
|
1395
|
+
function tn(t) {
|
|
1396
|
+
return /* @__PURE__ */ e(Ft, { ...t });
|
|
482
1397
|
}
|
|
483
|
-
function
|
|
484
|
-
return /* @__PURE__ */
|
|
485
|
-
|
|
1398
|
+
function en({ span: t = 1, className: n, ...a }) {
|
|
1399
|
+
return /* @__PURE__ */ e(
|
|
1400
|
+
Ft,
|
|
486
1401
|
{
|
|
487
1402
|
...a,
|
|
488
1403
|
padding: "md",
|
|
489
|
-
className:
|
|
1404
|
+
className: _(
|
|
490
1405
|
"facto-widget",
|
|
491
1406
|
t === 2 && "facto-widget--span-2",
|
|
492
|
-
|
|
1407
|
+
n
|
|
493
1408
|
)
|
|
494
1409
|
}
|
|
495
1410
|
);
|
|
496
1411
|
}
|
|
497
|
-
function
|
|
498
|
-
return /* @__PURE__ */
|
|
1412
|
+
function nn({ className: t, children: n, ...a }) {
|
|
1413
|
+
return /* @__PURE__ */ e("div", { ...a, className: _("facto-dashboard-container", t), children: /* @__PURE__ */ e("div", { className: "facto-dashboard-grid", children: n }) });
|
|
499
1414
|
}
|
|
500
|
-
function
|
|
501
|
-
return /* @__PURE__ */
|
|
1415
|
+
function an({ withAction: t, className: n, ...a }) {
|
|
1416
|
+
return /* @__PURE__ */ e(
|
|
502
1417
|
"div",
|
|
503
1418
|
{
|
|
504
1419
|
...a,
|
|
505
|
-
className:
|
|
1420
|
+
className: _("facto-widget-head", t && "facto-widget-head--with-action", n)
|
|
506
1421
|
}
|
|
507
1422
|
);
|
|
508
1423
|
}
|
|
509
|
-
function
|
|
510
|
-
return /* @__PURE__ */
|
|
1424
|
+
function on({ className: t, ...n }) {
|
|
1425
|
+
return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-list", t) });
|
|
511
1426
|
}
|
|
512
|
-
function
|
|
513
|
-
return /* @__PURE__ */
|
|
1427
|
+
function cn({ className: t, ...n }) {
|
|
1428
|
+
return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-kv", t) });
|
|
514
1429
|
}
|
|
515
|
-
function
|
|
516
|
-
return /* @__PURE__ */
|
|
1430
|
+
function rn({ className: t, ...n }) {
|
|
1431
|
+
return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-amount", t) });
|
|
517
1432
|
}
|
|
518
|
-
function
|
|
519
|
-
const
|
|
1433
|
+
function sn(t) {
|
|
1434
|
+
const n = _("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
|
|
520
1435
|
if (typeof t.href == "string") {
|
|
521
|
-
const { dark:
|
|
522
|
-
return /* @__PURE__ */
|
|
1436
|
+
const { dark: c, className: l, ...s } = t;
|
|
1437
|
+
return /* @__PURE__ */ e("a", { ...s, className: n });
|
|
523
1438
|
}
|
|
524
|
-
const { dark: a, className: o, type:
|
|
525
|
-
return /* @__PURE__ */
|
|
1439
|
+
const { dark: a, className: o, type: r = "button", ...i } = t;
|
|
1440
|
+
return /* @__PURE__ */ e("button", { ...i, type: r, className: n });
|
|
526
1441
|
}
|
|
527
|
-
function
|
|
1442
|
+
function ln({
|
|
528
1443
|
className: t,
|
|
529
|
-
type:
|
|
1444
|
+
type: n = "button",
|
|
530
1445
|
...a
|
|
531
1446
|
}) {
|
|
532
|
-
return /* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ e(
|
|
533
1448
|
"button",
|
|
534
1449
|
{
|
|
535
1450
|
...a,
|
|
536
|
-
type:
|
|
537
|
-
className:
|
|
1451
|
+
type: n,
|
|
1452
|
+
className: _("facto-widget-row", t)
|
|
538
1453
|
}
|
|
539
1454
|
);
|
|
540
1455
|
}
|
|
541
|
-
function
|
|
1456
|
+
function ge({
|
|
542
1457
|
label: t,
|
|
543
|
-
helperText:
|
|
1458
|
+
helperText: n,
|
|
544
1459
|
error: a,
|
|
545
1460
|
id: o,
|
|
546
|
-
containerClassName:
|
|
547
|
-
className:
|
|
548
|
-
...
|
|
1461
|
+
containerClassName: r,
|
|
1462
|
+
className: i,
|
|
1463
|
+
...c
|
|
549
1464
|
}) {
|
|
550
|
-
const
|
|
551
|
-
return /* @__PURE__ */
|
|
552
|
-
t && /* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
1465
|
+
const l = G(), s = o ?? l, h = a || n ? `${s}-description` : void 0;
|
|
1466
|
+
return /* @__PURE__ */ u("div", { className: _("facto-field", r), children: [
|
|
1467
|
+
t && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: s, children: t }),
|
|
1468
|
+
/* @__PURE__ */ e(
|
|
554
1469
|
"input",
|
|
555
1470
|
{
|
|
556
|
-
...
|
|
557
|
-
id:
|
|
558
|
-
"aria-invalid": !!a ||
|
|
559
|
-
"aria-describedby":
|
|
560
|
-
className:
|
|
1471
|
+
...c,
|
|
1472
|
+
id: s,
|
|
1473
|
+
"aria-invalid": !!a || c["aria-invalid"],
|
|
1474
|
+
"aria-describedby": ct(c["aria-describedby"], h),
|
|
1475
|
+
className: _(
|
|
561
1476
|
"facto-input",
|
|
562
1477
|
!!a && "facto-input--error",
|
|
563
|
-
|
|
1478
|
+
i
|
|
564
1479
|
)
|
|
565
1480
|
}
|
|
566
1481
|
),
|
|
567
|
-
(a ||
|
|
1482
|
+
(a || n) && /* @__PURE__ */ e(
|
|
568
1483
|
"span",
|
|
569
1484
|
{
|
|
570
|
-
id:
|
|
571
|
-
className:
|
|
1485
|
+
id: h,
|
|
1486
|
+
className: _(
|
|
572
1487
|
"facto-field__message",
|
|
573
1488
|
!!a && "facto-field__message--error"
|
|
574
1489
|
),
|
|
575
|
-
children: a ??
|
|
1490
|
+
children: a ?? n
|
|
576
1491
|
}
|
|
577
1492
|
)
|
|
578
1493
|
] });
|
|
579
1494
|
}
|
|
580
|
-
function
|
|
1495
|
+
function dn({
|
|
581
1496
|
label: t,
|
|
582
|
-
helperText:
|
|
1497
|
+
helperText: n,
|
|
583
1498
|
error: a,
|
|
584
1499
|
id: o,
|
|
585
|
-
containerClassName:
|
|
586
|
-
className:
|
|
587
|
-
...
|
|
1500
|
+
containerClassName: r,
|
|
1501
|
+
className: i,
|
|
1502
|
+
...c
|
|
588
1503
|
}) {
|
|
589
|
-
const
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
t && /* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
1504
|
+
const l = G(), s = o ?? l, h = a || n ? `${s}-description` : void 0;
|
|
1505
|
+
return /* @__PURE__ */ u("div", { className: _("facto-field", r), children: [
|
|
1506
|
+
t && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: s, children: t }),
|
|
1507
|
+
/* @__PURE__ */ e(
|
|
593
1508
|
"textarea",
|
|
594
1509
|
{
|
|
595
|
-
...
|
|
596
|
-
id:
|
|
597
|
-
"aria-invalid": !!a ||
|
|
598
|
-
"aria-describedby":
|
|
599
|
-
className:
|
|
1510
|
+
...c,
|
|
1511
|
+
id: s,
|
|
1512
|
+
"aria-invalid": !!a || c["aria-invalid"],
|
|
1513
|
+
"aria-describedby": ct(c["aria-describedby"], h),
|
|
1514
|
+
className: _(
|
|
600
1515
|
"facto-textarea",
|
|
601
1516
|
!!a && "facto-input--error",
|
|
602
|
-
|
|
1517
|
+
i
|
|
603
1518
|
)
|
|
604
1519
|
}
|
|
605
1520
|
),
|
|
606
|
-
(a ||
|
|
1521
|
+
(a || n) && /* @__PURE__ */ e(
|
|
607
1522
|
"span",
|
|
608
1523
|
{
|
|
609
|
-
id:
|
|
610
|
-
className:
|
|
1524
|
+
id: h,
|
|
1525
|
+
className: _(
|
|
611
1526
|
"facto-field__message",
|
|
612
1527
|
!!a && "facto-field__message--error"
|
|
613
1528
|
),
|
|
614
|
-
children: a ??
|
|
1529
|
+
children: a ?? n
|
|
615
1530
|
}
|
|
616
1531
|
)
|
|
617
1532
|
] });
|
|
618
1533
|
}
|
|
619
|
-
function
|
|
620
|
-
return /* @__PURE__ */
|
|
1534
|
+
function un({ tone: t = "neutral", className: n, ...a }) {
|
|
1535
|
+
return /* @__PURE__ */ e(
|
|
621
1536
|
"span",
|
|
622
1537
|
{
|
|
623
1538
|
...a,
|
|
624
|
-
className:
|
|
1539
|
+
className: _("facto-badge", `facto-badge--${t}`, n)
|
|
625
1540
|
}
|
|
626
1541
|
);
|
|
627
1542
|
}
|
|
628
|
-
function
|
|
1543
|
+
function fn({
|
|
629
1544
|
options: t,
|
|
630
|
-
value:
|
|
1545
|
+
value: n,
|
|
631
1546
|
defaultValue: a,
|
|
632
1547
|
onValueChange: o,
|
|
633
|
-
placeholder:
|
|
634
|
-
label:
|
|
635
|
-
error:
|
|
636
|
-
disabled:
|
|
637
|
-
|
|
638
|
-
|
|
1548
|
+
placeholder: r = "Select an option",
|
|
1549
|
+
label: i,
|
|
1550
|
+
error: c,
|
|
1551
|
+
disabled: l,
|
|
1552
|
+
bordered: s = !1,
|
|
1553
|
+
name: h,
|
|
1554
|
+
id: f,
|
|
639
1555
|
ariaLabel: p,
|
|
640
1556
|
"aria-describedby": v,
|
|
641
|
-
className:
|
|
1557
|
+
className: k
|
|
642
1558
|
}) {
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
}, []),
|
|
646
|
-
(
|
|
647
|
-
|
|
1559
|
+
const w = W(U), C = Y(), g = G(), d = f ?? g, m = c ? `${d}-description` : void 0, y = x(null), b = X(() => {
|
|
1560
|
+
y.current?.(), y.current = null;
|
|
1561
|
+
}, []), N = X(
|
|
1562
|
+
(T) => {
|
|
1563
|
+
b(), T && (y.current = ce(T));
|
|
648
1564
|
},
|
|
649
|
-
[
|
|
1565
|
+
[b]
|
|
650
1566
|
);
|
|
651
|
-
return
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
|
|
1567
|
+
return q(() => b, [b]), /* @__PURE__ */ u("div", { className: _("facto-field", k), children: [
|
|
1568
|
+
i && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: d, children: i }),
|
|
1569
|
+
/* @__PURE__ */ u(
|
|
1570
|
+
V.Root,
|
|
655
1571
|
{
|
|
656
|
-
value:
|
|
1572
|
+
value: n,
|
|
657
1573
|
defaultValue: a,
|
|
658
1574
|
onValueChange: o,
|
|
659
|
-
disabled:
|
|
660
|
-
name:
|
|
1575
|
+
disabled: l,
|
|
1576
|
+
name: h,
|
|
661
1577
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
|
|
1578
|
+
/* @__PURE__ */ u(
|
|
1579
|
+
V.Trigger,
|
|
664
1580
|
{
|
|
665
|
-
id:
|
|
666
|
-
className:
|
|
1581
|
+
id: d,
|
|
1582
|
+
className: _("facto-select", s && "facto-select--bordered", !!c && "facto-input--error"),
|
|
667
1583
|
"aria-label": p,
|
|
668
|
-
"aria-describedby":
|
|
669
|
-
"aria-invalid": !!
|
|
1584
|
+
"aria-describedby": ct(v, m),
|
|
1585
|
+
"aria-invalid": !!c,
|
|
670
1586
|
children: [
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ e(V.Value, { placeholder: r }),
|
|
1588
|
+
/* @__PURE__ */ e(V.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ e(ot, { name: "chevronDown", size: 16 }) })
|
|
673
1589
|
]
|
|
674
1590
|
}
|
|
675
1591
|
),
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
|
|
1592
|
+
/* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
|
|
1593
|
+
V.Content,
|
|
678
1594
|
{
|
|
679
|
-
ref:
|
|
1595
|
+
ref: N,
|
|
680
1596
|
className: "facto-theme facto-select-content",
|
|
681
|
-
style:
|
|
1597
|
+
style: { ...w, ...C },
|
|
682
1598
|
position: "popper",
|
|
683
1599
|
side: "bottom",
|
|
684
1600
|
align: "start",
|
|
685
1601
|
sideOffset: 8,
|
|
686
1602
|
collisionPadding: 16,
|
|
687
|
-
onCloseAutoFocus:
|
|
688
|
-
children: /* @__PURE__ */
|
|
689
|
-
|
|
1603
|
+
onCloseAutoFocus: b,
|
|
1604
|
+
children: /* @__PURE__ */ e(V.Viewport, { children: t.map((T) => /* @__PURE__ */ u(
|
|
1605
|
+
V.Item,
|
|
690
1606
|
{
|
|
691
|
-
value:
|
|
692
|
-
disabled:
|
|
1607
|
+
value: T.value,
|
|
1608
|
+
disabled: T.disabled,
|
|
693
1609
|
className: "facto-select-item",
|
|
694
1610
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ e(V.ItemText, { children: T.label }),
|
|
1612
|
+
/* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(ot, { name: "check", size: 16 }) })
|
|
697
1613
|
]
|
|
698
1614
|
},
|
|
699
|
-
|
|
1615
|
+
T.value
|
|
700
1616
|
)) })
|
|
701
1617
|
}
|
|
702
1618
|
) })
|
|
703
1619
|
]
|
|
704
1620
|
}
|
|
705
1621
|
),
|
|
706
|
-
|
|
1622
|
+
c && /* @__PURE__ */ e(
|
|
707
1623
|
"span",
|
|
708
1624
|
{
|
|
709
|
-
id:
|
|
1625
|
+
id: m,
|
|
710
1626
|
className: "facto-field__message facto-field__message--error",
|
|
711
|
-
children:
|
|
1627
|
+
children: c
|
|
712
1628
|
}
|
|
713
1629
|
)
|
|
714
1630
|
] });
|
|
715
1631
|
}
|
|
716
|
-
function
|
|
1632
|
+
function hn({
|
|
717
1633
|
label: t,
|
|
718
|
-
description:
|
|
1634
|
+
description: n,
|
|
719
1635
|
className: a,
|
|
720
1636
|
id: o,
|
|
721
|
-
...
|
|
1637
|
+
...r
|
|
722
1638
|
}) {
|
|
723
|
-
const
|
|
724
|
-
|
|
1639
|
+
const i = G(), c = o ?? i, l = n ? `${c}-description` : void 0, s = /* @__PURE__ */ e(
|
|
1640
|
+
Mt.Root,
|
|
725
1641
|
{
|
|
726
|
-
...
|
|
727
|
-
id:
|
|
728
|
-
"aria-describedby":
|
|
729
|
-
className:
|
|
730
|
-
children: /* @__PURE__ */
|
|
1642
|
+
...r,
|
|
1643
|
+
id: c,
|
|
1644
|
+
"aria-describedby": ct(r["aria-describedby"], l),
|
|
1645
|
+
className: _("facto-switch", a),
|
|
1646
|
+
children: /* @__PURE__ */ e("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ e(Mt.Thumb, { className: "facto-switch__thumb" }) })
|
|
731
1647
|
}
|
|
732
1648
|
);
|
|
733
|
-
return t ? /* @__PURE__ */
|
|
734
|
-
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
|
|
1649
|
+
return t ? /* @__PURE__ */ u("div", { className: "facto-check-field", children: [
|
|
1650
|
+
s,
|
|
1651
|
+
/* @__PURE__ */ u("span", { children: [
|
|
1652
|
+
/* @__PURE__ */ e("label", { htmlFor: c, children: /* @__PURE__ */ e("strong", { children: t }) }),
|
|
1653
|
+
n && /* @__PURE__ */ e("small", { id: l, children: n })
|
|
738
1654
|
] })
|
|
739
|
-
] }) :
|
|
1655
|
+
] }) : s;
|
|
740
1656
|
}
|
|
741
|
-
function
|
|
1657
|
+
function mn({
|
|
742
1658
|
label: t,
|
|
743
|
-
description:
|
|
1659
|
+
description: n,
|
|
744
1660
|
className: a,
|
|
745
1661
|
id: o,
|
|
746
|
-
...
|
|
1662
|
+
...r
|
|
747
1663
|
}) {
|
|
748
|
-
const
|
|
749
|
-
|
|
1664
|
+
const i = G(), c = o ?? i, l = n ? `${c}-description` : void 0, s = /* @__PURE__ */ e(
|
|
1665
|
+
St.Root,
|
|
750
1666
|
{
|
|
751
|
-
...
|
|
752
|
-
id:
|
|
753
|
-
"aria-describedby":
|
|
754
|
-
className:
|
|
755
|
-
children: /* @__PURE__ */
|
|
1667
|
+
...r,
|
|
1668
|
+
id: c,
|
|
1669
|
+
"aria-describedby": ct(r["aria-describedby"], l),
|
|
1670
|
+
className: _("facto-checkbox", a),
|
|
1671
|
+
children: /* @__PURE__ */ e("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ e(St.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ e(ot, { name: "check", size: 16 }) }) })
|
|
756
1672
|
}
|
|
757
1673
|
);
|
|
758
|
-
return t ? /* @__PURE__ */
|
|
759
|
-
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
|
|
1674
|
+
return t ? /* @__PURE__ */ u("div", { className: "facto-check-field", children: [
|
|
1675
|
+
s,
|
|
1676
|
+
/* @__PURE__ */ u("span", { children: [
|
|
1677
|
+
/* @__PURE__ */ e("label", { htmlFor: c, children: /* @__PURE__ */ e("strong", { children: t }) }),
|
|
1678
|
+
n && /* @__PURE__ */ e("small", { id: l, children: n })
|
|
763
1679
|
] })
|
|
764
|
-
] }) :
|
|
1680
|
+
] }) : s;
|
|
765
1681
|
}
|
|
766
|
-
const
|
|
767
|
-
function
|
|
1682
|
+
const pn = vt.Root;
|
|
1683
|
+
function vn({
|
|
768
1684
|
className: t,
|
|
769
|
-
...
|
|
1685
|
+
...n
|
|
770
1686
|
}) {
|
|
771
|
-
return /* @__PURE__ */
|
|
772
|
-
|
|
1687
|
+
return /* @__PURE__ */ e(
|
|
1688
|
+
vt.List,
|
|
773
1689
|
{
|
|
774
|
-
...
|
|
775
|
-
className:
|
|
1690
|
+
...n,
|
|
1691
|
+
className: _("facto-tabs-list", t)
|
|
776
1692
|
}
|
|
777
1693
|
);
|
|
778
1694
|
}
|
|
779
|
-
function
|
|
1695
|
+
function gn({
|
|
780
1696
|
className: t,
|
|
781
|
-
...
|
|
1697
|
+
...n
|
|
782
1698
|
}) {
|
|
783
|
-
return /* @__PURE__ */
|
|
784
|
-
|
|
1699
|
+
return /* @__PURE__ */ e(
|
|
1700
|
+
vt.Trigger,
|
|
785
1701
|
{
|
|
786
|
-
...
|
|
787
|
-
className:
|
|
1702
|
+
...n,
|
|
1703
|
+
className: _("facto-tabs-trigger", t)
|
|
788
1704
|
}
|
|
789
1705
|
);
|
|
790
1706
|
}
|
|
791
|
-
function
|
|
1707
|
+
function bn({
|
|
792
1708
|
className: t,
|
|
793
|
-
...
|
|
1709
|
+
...n
|
|
794
1710
|
}) {
|
|
795
|
-
return /* @__PURE__ */
|
|
796
|
-
|
|
1711
|
+
return /* @__PURE__ */ e(
|
|
1712
|
+
vt.Content,
|
|
797
1713
|
{
|
|
798
|
-
...
|
|
799
|
-
className:
|
|
1714
|
+
...n,
|
|
1715
|
+
className: _("facto-tabs-content", t)
|
|
800
1716
|
}
|
|
801
1717
|
);
|
|
802
1718
|
}
|
|
803
|
-
const
|
|
804
|
-
function({ className:
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
const
|
|
808
|
-
if (typeof
|
|
1719
|
+
const _n = F.Root, yn = F.Trigger, Nn = F.Close, be = dt(
|
|
1720
|
+
function({ className: n, children: a, tabIndex: o, ...r }, i) {
|
|
1721
|
+
const c = x(null), [l, s] = A(!1), h = X((f) => {
|
|
1722
|
+
if (c.current = f, typeof i == "function") {
|
|
1723
|
+
const p = i(f);
|
|
1724
|
+
if (typeof p == "function")
|
|
809
1725
|
return () => {
|
|
810
|
-
|
|
1726
|
+
c.current === f && (c.current = null), p();
|
|
811
1727
|
};
|
|
812
|
-
} else
|
|
813
|
-
}, [
|
|
814
|
-
return
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
|
|
1728
|
+
} else i && (i.current = f);
|
|
1729
|
+
}, [i]);
|
|
1730
|
+
return q(() => {
|
|
1731
|
+
const f = c.current;
|
|
1732
|
+
if (!f) return;
|
|
1733
|
+
const p = () => s(f.scrollHeight > f.clientHeight + 1);
|
|
1734
|
+
p();
|
|
1735
|
+
const v = new ResizeObserver(p), k = new MutationObserver(p);
|
|
1736
|
+
return v.observe(f), k.observe(f, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
1737
|
+
v.disconnect(), k.disconnect();
|
|
822
1738
|
};
|
|
823
|
-
}, [a]), /* @__PURE__ */
|
|
1739
|
+
}, [a]), /* @__PURE__ */ e(F.Title, { ...r, ref: h, tabIndex: l ? o ?? 0 : o, className: _("facto-modal-title", n), children: a });
|
|
824
1740
|
}
|
|
825
|
-
),
|
|
826
|
-
return /* @__PURE__ */
|
|
1741
|
+
), _e = dt(function({ className: n, ...a }, o) {
|
|
1742
|
+
return /* @__PURE__ */ e(F.Description, { ...a, ref: o, className: _("facto-modal-description", n) });
|
|
827
1743
|
});
|
|
828
|
-
function
|
|
1744
|
+
function kn({
|
|
829
1745
|
size: t = "sm",
|
|
830
|
-
motionVariant:
|
|
831
|
-
|
|
832
|
-
|
|
1746
|
+
motionVariant: n = "auto",
|
|
1747
|
+
motion: a,
|
|
1748
|
+
className: o,
|
|
1749
|
+
style: r,
|
|
833
1750
|
children: i,
|
|
834
1751
|
...c
|
|
835
1752
|
}) {
|
|
836
|
-
const
|
|
837
|
-
return /* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
|
|
1753
|
+
const l = W(U), s = Y(a), h = Pt();
|
|
1754
|
+
return /* @__PURE__ */ e(gt, { motion: a, children: /* @__PURE__ */ u(F.Portal, { children: [
|
|
1755
|
+
/* @__PURE__ */ e(F.Overlay, { className: "facto-dialog-overlay", "data-motion": n, style: { ...l, ...s } }),
|
|
1756
|
+
/* @__PURE__ */ e(
|
|
1757
|
+
F.Content,
|
|
841
1758
|
{
|
|
842
1759
|
...c,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1760
|
+
ref: h,
|
|
1761
|
+
"data-motion": n,
|
|
1762
|
+
style: { ...l, ...r, ...s },
|
|
1763
|
+
className: _(
|
|
846
1764
|
"facto-theme",
|
|
847
1765
|
"facto-dialog",
|
|
848
1766
|
`facto-dialog--${t}`,
|
|
849
|
-
|
|
1767
|
+
o
|
|
850
1768
|
),
|
|
851
1769
|
children: i
|
|
852
1770
|
}
|
|
853
1771
|
)
|
|
854
|
-
] });
|
|
1772
|
+
] }) });
|
|
855
1773
|
}
|
|
856
|
-
const
|
|
857
|
-
function
|
|
1774
|
+
const wn = F.Root, Cn = F.Trigger, Tn = F.Close, xn = be, Sn = _e;
|
|
1775
|
+
function Mn({
|
|
858
1776
|
side: t = "center",
|
|
859
|
-
motionVariant:
|
|
860
|
-
|
|
861
|
-
|
|
1777
|
+
motionVariant: n = "auto",
|
|
1778
|
+
motion: a,
|
|
1779
|
+
className: o,
|
|
1780
|
+
style: r,
|
|
862
1781
|
children: i,
|
|
863
1782
|
...c
|
|
864
1783
|
}) {
|
|
865
|
-
const
|
|
866
|
-
return /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
|
|
1784
|
+
const l = W(U), s = Y(a), h = Pt();
|
|
1785
|
+
return /* @__PURE__ */ e(gt, { motion: a, children: /* @__PURE__ */ u(F.Portal, { children: [
|
|
1786
|
+
/* @__PURE__ */ e(F.Overlay, { className: "facto-dialog-overlay", "data-motion": n, style: { ...l, ...s } }),
|
|
1787
|
+
/* @__PURE__ */ e(
|
|
1788
|
+
F.Content,
|
|
870
1789
|
{
|
|
871
1790
|
...c,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1791
|
+
ref: h,
|
|
1792
|
+
"data-motion": n,
|
|
1793
|
+
style: { ...l, ...r, ...s },
|
|
1794
|
+
className: _(
|
|
875
1795
|
"facto-theme",
|
|
876
1796
|
"facto-sheet",
|
|
877
1797
|
`facto-sheet--${t}`,
|
|
878
|
-
|
|
1798
|
+
o
|
|
879
1799
|
),
|
|
880
1800
|
children: i
|
|
881
1801
|
}
|
|
882
1802
|
)
|
|
883
|
-
] });
|
|
1803
|
+
] }) });
|
|
884
1804
|
}
|
|
885
|
-
function
|
|
1805
|
+
function $t({
|
|
886
1806
|
width: t,
|
|
887
|
-
height:
|
|
1807
|
+
height: n,
|
|
888
1808
|
circle: a,
|
|
889
1809
|
className: o,
|
|
890
|
-
style:
|
|
891
|
-
...
|
|
1810
|
+
style: r,
|
|
1811
|
+
...i
|
|
892
1812
|
}) {
|
|
893
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ e(
|
|
894
1814
|
"span",
|
|
895
1815
|
{
|
|
896
|
-
...
|
|
1816
|
+
...i,
|
|
897
1817
|
"aria-hidden": "true",
|
|
898
|
-
className:
|
|
1818
|
+
className: _(
|
|
899
1819
|
"facto-skeleton",
|
|
900
1820
|
a && "facto-skeleton--circle",
|
|
901
1821
|
o
|
|
902
1822
|
),
|
|
903
|
-
style: { ...
|
|
1823
|
+
style: { ...r, width: t, height: n }
|
|
904
1824
|
}
|
|
905
1825
|
);
|
|
906
1826
|
}
|
|
907
|
-
function
|
|
1827
|
+
function Rn({
|
|
908
1828
|
title: t,
|
|
909
|
-
description:
|
|
1829
|
+
description: n,
|
|
910
1830
|
action: a,
|
|
911
1831
|
icon: o,
|
|
912
|
-
className:
|
|
913
|
-
...
|
|
1832
|
+
className: r,
|
|
1833
|
+
...i
|
|
914
1834
|
}) {
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
o && /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
|
|
919
|
-
a && /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ u("div", { ...i, className: _("facto-empty-state", r), children: [
|
|
1836
|
+
o && /* @__PURE__ */ e("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: o }),
|
|
1837
|
+
/* @__PURE__ */ e("strong", { children: t }),
|
|
1838
|
+
n && /* @__PURE__ */ e("p", { children: n }),
|
|
1839
|
+
a && /* @__PURE__ */ e("div", { children: a })
|
|
920
1840
|
] });
|
|
921
1841
|
}
|
|
922
|
-
function
|
|
1842
|
+
function $n({
|
|
923
1843
|
tone: t = "info",
|
|
924
|
-
title:
|
|
1844
|
+
title: n,
|
|
925
1845
|
description: a,
|
|
926
1846
|
action: o,
|
|
927
|
-
className:
|
|
928
|
-
...
|
|
1847
|
+
className: r,
|
|
1848
|
+
...i
|
|
929
1849
|
}) {
|
|
930
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ u(
|
|
931
1851
|
"div",
|
|
932
1852
|
{
|
|
933
|
-
...
|
|
1853
|
+
...i,
|
|
934
1854
|
role: t === "danger" ? "alert" : "status",
|
|
935
|
-
className:
|
|
1855
|
+
className: _("facto-notice", `facto-notice--${t}`, r),
|
|
936
1856
|
children: [
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
a && /* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ u("div", { children: [
|
|
1858
|
+
/* @__PURE__ */ e("strong", { children: n }),
|
|
1859
|
+
a && /* @__PURE__ */ e("span", { children: a })
|
|
940
1860
|
] }),
|
|
941
1861
|
o
|
|
942
1862
|
]
|
|
943
1863
|
}
|
|
944
1864
|
);
|
|
945
1865
|
}
|
|
946
|
-
function
|
|
1866
|
+
function Ln({
|
|
947
1867
|
gap: t = 3,
|
|
948
|
-
direction:
|
|
1868
|
+
direction: n = "vertical",
|
|
949
1869
|
align: a = "stretch",
|
|
950
1870
|
justify: o = "start",
|
|
951
|
-
className:
|
|
952
|
-
...
|
|
1871
|
+
className: r,
|
|
1872
|
+
...i
|
|
953
1873
|
}) {
|
|
954
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ e(
|
|
955
1875
|
"div",
|
|
956
1876
|
{
|
|
957
|
-
...
|
|
958
|
-
className:
|
|
1877
|
+
...i,
|
|
1878
|
+
className: _(
|
|
959
1879
|
"facto-stack",
|
|
960
|
-
`facto-stack--${
|
|
1880
|
+
`facto-stack--${n}`,
|
|
961
1881
|
`facto-stack--gap-${t}`,
|
|
962
1882
|
`facto-stack--align-${a}`,
|
|
963
1883
|
`facto-stack--justify-${o}`,
|
|
964
|
-
|
|
1884
|
+
r
|
|
965
1885
|
)
|
|
966
1886
|
}
|
|
967
1887
|
);
|
|
968
1888
|
}
|
|
969
|
-
function
|
|
970
|
-
return /* @__PURE__ */
|
|
1889
|
+
function In({ delayDuration: t = 300, ...n }) {
|
|
1890
|
+
return /* @__PURE__ */ e(st.Provider, { ...n, delayDuration: t });
|
|
971
1891
|
}
|
|
972
|
-
const
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
return /* @__PURE__ */
|
|
976
|
-
|
|
1892
|
+
const Bn = st.Root, En = st.Trigger;
|
|
1893
|
+
function Pn({ variant: t = "default", className: n, style: a, sideOffset: o = 6, collisionPadding: r = 16, children: i, ...c }) {
|
|
1894
|
+
const l = W(U), s = Y();
|
|
1895
|
+
return /* @__PURE__ */ e(st.Portal, { children: /* @__PURE__ */ e(
|
|
1896
|
+
st.Content,
|
|
977
1897
|
{
|
|
978
|
-
...
|
|
1898
|
+
...c,
|
|
979
1899
|
sideOffset: o,
|
|
980
|
-
collisionPadding:
|
|
981
|
-
className:
|
|
982
|
-
style: { ...
|
|
983
|
-
children:
|
|
1900
|
+
collisionPadding: r,
|
|
1901
|
+
className: _("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", n),
|
|
1902
|
+
style: { ...l, ...a, ...s },
|
|
1903
|
+
children: i
|
|
984
1904
|
}
|
|
985
1905
|
) });
|
|
986
1906
|
}
|
|
987
|
-
function
|
|
988
|
-
return /* @__PURE__ */
|
|
1907
|
+
function ye({ duration: t = 2600, ...n }) {
|
|
1908
|
+
return /* @__PURE__ */ e(J.Provider, { ...n, duration: t });
|
|
989
1909
|
}
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
] });
|
|
1910
|
+
function Ne({ tone: t = "success", icon: n, className: a, style: o, motion: r, children: i, ...c }) {
|
|
1911
|
+
const l = W(U), s = Y(r);
|
|
1912
|
+
return /* @__PURE__ */ e(gt, { motion: r, children: /* @__PURE__ */ u(J.Root, { ...c, className: _("facto-theme", "facto-toast", `facto-toast--${t}`, a), style: { ...l, ...o, ...s }, children: [
|
|
1913
|
+
/* @__PURE__ */ e("span", { className: "facto-toast__icon", "aria-hidden": "true", children: n ?? /* @__PURE__ */ e(ot, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
|
|
1914
|
+
/* @__PURE__ */ e("div", { className: "facto-toast__copy", children: i })
|
|
1915
|
+
] }) });
|
|
996
1916
|
}
|
|
997
|
-
function
|
|
998
|
-
return /* @__PURE__ */
|
|
1917
|
+
function ke({ className: t, ...n }) {
|
|
1918
|
+
return /* @__PURE__ */ e(J.Title, { ...n, className: _("facto-toast__title", t) });
|
|
999
1919
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return /* @__PURE__ */
|
|
1920
|
+
function Lt({ className: t, ...n }) {
|
|
1921
|
+
return /* @__PURE__ */ e(J.Description, { ...n, className: _("facto-toast__description", t) });
|
|
1002
1922
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return /* @__PURE__ */
|
|
1923
|
+
function we({ className: t, ...n }) {
|
|
1924
|
+
return /* @__PURE__ */ e(J.Action, { ...n, className: _("facto-button", "facto-button--secondary", "facto-button--sm", t) });
|
|
1005
1925
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return /* @__PURE__ */
|
|
1926
|
+
function Ce({ className: t, children: n = /* @__PURE__ */ e(ot, { name: "close" }), "aria-label": a = "Dismiss notification", ...o }) {
|
|
1927
|
+
return /* @__PURE__ */ e(J.Close, { ...o, "aria-label": a, className: _("facto-toast__close", t), children: n });
|
|
1008
1928
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const o =
|
|
1011
|
-
return
|
|
1929
|
+
function Te({ className: t, style: n, ...a }) {
|
|
1930
|
+
const o = W(U), r = Y(), [i, c] = A(!1);
|
|
1931
|
+
return q(() => c(!0), []), i ? Kt(/* @__PURE__ */ e(J.Viewport, { ...a, className: _("facto-toast-viewport", t), style: { ...o, ...n, ...r } }), document.body) : null;
|
|
1012
1932
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const k =
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1017
|
-
if (!
|
|
1018
|
-
const
|
|
1933
|
+
function Dn({ value: t, defaultValue: n = "", onValueChange: a, clearLabel: o = "Clear search", label: r = "Search", helperText: i, error: c, id: l, containerClassName: s, className: h, disabled: f, readOnly: p, ...v }) {
|
|
1934
|
+
const k = G(), w = l ?? k, C = c || i ? `${w}-description` : void 0, [g, d] = A(n), m = t ?? g, y = x(null);
|
|
1935
|
+
q(() => {
|
|
1936
|
+
const N = y.current?.form;
|
|
1937
|
+
if (!N || t !== void 0) return;
|
|
1938
|
+
const T = (L) => {
|
|
1019
1939
|
queueMicrotask(() => {
|
|
1020
|
-
|
|
1940
|
+
L.defaultPrevented || (d(n), a?.(n));
|
|
1021
1941
|
});
|
|
1022
1942
|
};
|
|
1023
|
-
return
|
|
1024
|
-
}, [
|
|
1025
|
-
const
|
|
1026
|
-
t === void 0 &&
|
|
1943
|
+
return N.addEventListener("reset", T), () => N.removeEventListener("reset", T);
|
|
1944
|
+
}, [n, t, a]);
|
|
1945
|
+
const b = (N) => {
|
|
1946
|
+
t === void 0 && d(N), a?.(N);
|
|
1027
1947
|
};
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ u("div", { className: _("facto-field", s), children: [
|
|
1949
|
+
r && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: w, children: r }),
|
|
1950
|
+
/* @__PURE__ */ u("div", { className: "facto-search", children: [
|
|
1951
|
+
/* @__PURE__ */ u("svg", { className: "facto-search__icon", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
|
|
1952
|
+
/* @__PURE__ */ e("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
|
|
1953
|
+
/* @__PURE__ */ e("path", { d: "m16 16 5 5" })
|
|
1034
1954
|
] }),
|
|
1035
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ e(
|
|
1036
1956
|
"input",
|
|
1037
1957
|
{
|
|
1038
|
-
...
|
|
1039
|
-
ref:
|
|
1040
|
-
id:
|
|
1958
|
+
...v,
|
|
1959
|
+
ref: y,
|
|
1960
|
+
id: w,
|
|
1041
1961
|
type: "search",
|
|
1042
|
-
disabled:
|
|
1043
|
-
readOnly:
|
|
1044
|
-
value:
|
|
1045
|
-
onChange: (
|
|
1046
|
-
"aria-invalid": !!
|
|
1047
|
-
"aria-describedby":
|
|
1048
|
-
className:
|
|
1962
|
+
disabled: f,
|
|
1963
|
+
readOnly: p,
|
|
1964
|
+
value: m,
|
|
1965
|
+
onChange: (N) => b(N.target.value),
|
|
1966
|
+
"aria-invalid": !!c || v["aria-invalid"],
|
|
1967
|
+
"aria-describedby": ct(v["aria-describedby"], C),
|
|
1968
|
+
className: _("facto-input", "facto-search__input", !!c && "facto-input--error", h)
|
|
1049
1969
|
}
|
|
1050
1970
|
),
|
|
1051
|
-
|
|
1971
|
+
m && !p && /* @__PURE__ */ e(
|
|
1052
1972
|
"button",
|
|
1053
1973
|
{
|
|
1054
1974
|
type: "button",
|
|
1055
1975
|
className: "facto-search__clear",
|
|
1056
|
-
disabled:
|
|
1976
|
+
disabled: f,
|
|
1057
1977
|
"aria-label": o,
|
|
1058
1978
|
onClick: () => {
|
|
1059
|
-
|
|
1979
|
+
b(""), y.current?.focus();
|
|
1060
1980
|
},
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ e(ot, { name: "close", size: 16 })
|
|
1062
1982
|
}
|
|
1063
1983
|
)
|
|
1064
1984
|
] }),
|
|
1065
|
-
(
|
|
1985
|
+
(c || i) && /* @__PURE__ */ e("span", { id: C, className: _("facto-field__message", !!c && "facto-field__message--error"), children: c ?? i })
|
|
1066
1986
|
] });
|
|
1067
1987
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return /* @__PURE__ */
|
|
1988
|
+
function An({ className: t, ...n }) {
|
|
1989
|
+
return /* @__PURE__ */ e(ge, { ...n, type: "search", className: _("facto-search-field", t) });
|
|
1070
1990
|
}
|
|
1071
|
-
const
|
|
1072
|
-
function
|
|
1073
|
-
const c =
|
|
1074
|
-
return /* @__PURE__ */
|
|
1991
|
+
const zn = it.Root, Fn = it.Trigger, jn = it.Close;
|
|
1992
|
+
function On({ className: t, style: n, sideOffset: a = 8, collisionPadding: o = 16, ...r }) {
|
|
1993
|
+
const i = W(U), c = Y();
|
|
1994
|
+
return /* @__PURE__ */ e(it.Portal, { children: /* @__PURE__ */ e(it.Content, { ...r, sideOffset: a, collisionPadding: o, className: _("facto-theme", "facto-popover", t), style: { ...i, ...n, ...c } }) });
|
|
1075
1995
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return /* @__PURE__ */
|
|
1996
|
+
function Wn({ modal: t = !1, ...n }) {
|
|
1997
|
+
return /* @__PURE__ */ e(at.Root, { ...n, modal: t });
|
|
1078
1998
|
}
|
|
1079
|
-
const
|
|
1080
|
-
function
|
|
1081
|
-
const c =
|
|
1082
|
-
return /* @__PURE__ */
|
|
1999
|
+
const Vn = at.Trigger;
|
|
2000
|
+
function Hn({ className: t, style: n, sideOffset: a = 8, collisionPadding: o = 16, ...r }) {
|
|
2001
|
+
const i = W(U), c = Y();
|
|
2002
|
+
return /* @__PURE__ */ e(at.Portal, { children: /* @__PURE__ */ e(at.Content, { ...r, sideOffset: a, collisionPadding: o, className: _("facto-theme", "facto-menu", t), style: { ...i, ...n, ...c } }) });
|
|
1083
2003
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return /* @__PURE__ */
|
|
2004
|
+
function qn({ className: t, ...n }) {
|
|
2005
|
+
return /* @__PURE__ */ e(at.Item, { ...n, className: _("facto-menu-item", t) });
|
|
1086
2006
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return /* @__PURE__ */
|
|
2007
|
+
function Un({ className: t, ...n }) {
|
|
2008
|
+
return /* @__PURE__ */ e(at.Separator, { ...n, className: _("facto-menu-separator", t) });
|
|
1089
2009
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return /* @__PURE__ */
|
|
2010
|
+
function Gn({ selected: t = !1, className: n, type: a = "button", ...o }) {
|
|
2011
|
+
return /* @__PURE__ */ e("button", { ...o, type: a, "aria-pressed": t, className: _("facto-filter-chip", n) });
|
|
1092
2012
|
}
|
|
1093
|
-
function
|
|
1094
|
-
const
|
|
1095
|
-
return /* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
] },
|
|
2013
|
+
function Kn({ rows: t = 3, label: n = "Loading", className: a, ...o }) {
|
|
2014
|
+
const r = Number.isFinite(t) ? Math.min(20, Math.max(1, Math.floor(t))) : 3;
|
|
2015
|
+
return /* @__PURE__ */ e("div", { ...o, className: _("facto-list-skeleton", a), role: "status", "aria-label": n, children: Array.from({ length: r }, (i, c) => /* @__PURE__ */ u("div", { "aria-hidden": "true", className: "facto-list-skeleton__row", children: [
|
|
2016
|
+
/* @__PURE__ */ e($t, { style: { width: 32, height: 32 } }),
|
|
2017
|
+
/* @__PURE__ */ e($t, { style: { width: "60%", height: 16 } })
|
|
2018
|
+
] }, c)) });
|
|
1099
2019
|
}
|
|
1100
2020
|
export {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
$
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
2021
|
+
Re as AnimatedDisclosure,
|
|
2022
|
+
$e as AnimatedFeedback,
|
|
2023
|
+
Ve as AuthFlowShell,
|
|
2024
|
+
re as Avatar,
|
|
2025
|
+
un as Badge,
|
|
2026
|
+
Ze as Button,
|
|
2027
|
+
tn as Card,
|
|
2028
|
+
mn as Checkbox,
|
|
2029
|
+
Le as ContentReveal,
|
|
2030
|
+
me as CopyableSecretKey,
|
|
2031
|
+
nn as DashboardGrid,
|
|
2032
|
+
_n as Dialog,
|
|
2033
|
+
Nn as DialogClose,
|
|
2034
|
+
kn as DialogContent,
|
|
2035
|
+
_e as DialogDescription,
|
|
2036
|
+
be as DialogTitle,
|
|
2037
|
+
yn as DialogTrigger,
|
|
2038
|
+
Wn as DropdownMenu,
|
|
2039
|
+
Hn as DropdownMenuContent,
|
|
2040
|
+
qn as DropdownMenuItem,
|
|
2041
|
+
Un as DropdownMenuSeparator,
|
|
2042
|
+
Vn as DropdownMenuTrigger,
|
|
2043
|
+
He as EmailVerificationStep,
|
|
2044
|
+
Rn as EmptyState,
|
|
2045
|
+
Dn as EnhancedSearchField,
|
|
2046
|
+
Ae as ErrorState,
|
|
2047
|
+
gt as FactoMotionProvider,
|
|
2048
|
+
Ye as FactoTheme,
|
|
2049
|
+
je as Field,
|
|
2050
|
+
Gn as FilterChip,
|
|
2051
|
+
ot as Icon,
|
|
2052
|
+
Je as IconButton,
|
|
2053
|
+
he as IdentityEchoPill,
|
|
2054
|
+
Pe as ListGroup,
|
|
2055
|
+
Ee as ListRow,
|
|
2056
|
+
Kn as ListSkeleton,
|
|
2057
|
+
ze as LoadingMore,
|
|
2058
|
+
De as LogoStack,
|
|
2059
|
+
Xe as ModalFooter,
|
|
2060
|
+
Qe as ModalHeader,
|
|
2061
|
+
$n as Notice,
|
|
2062
|
+
Oe as NotificationsProvider,
|
|
2063
|
+
pt as OtpInput,
|
|
2064
|
+
qe as PasskeySetupCard,
|
|
2065
|
+
zn as Popover,
|
|
2066
|
+
jn as PopoverClose,
|
|
2067
|
+
On as PopoverContent,
|
|
2068
|
+
Fn as PopoverTrigger,
|
|
2069
|
+
Ge as RecoveryCodesStep,
|
|
2070
|
+
Dt as ResendCodeButton,
|
|
2071
|
+
An as SearchField,
|
|
2072
|
+
fn as Select,
|
|
2073
|
+
Ke as SelectionCardGroup,
|
|
2074
|
+
Be as SelectionMotion,
|
|
2075
|
+
wn as Sheet,
|
|
2076
|
+
Tn as SheetClose,
|
|
2077
|
+
Mn as SheetContent,
|
|
2078
|
+
Sn as SheetDescription,
|
|
2079
|
+
xn as SheetTitle,
|
|
2080
|
+
Cn as SheetTrigger,
|
|
2081
|
+
$t as Skeleton,
|
|
2082
|
+
Ln as Stack,
|
|
2083
|
+
Fe as StepChecklist,
|
|
2084
|
+
yt as StepProgress,
|
|
2085
|
+
oe as StepTransition,
|
|
2086
|
+
Ft as Surface,
|
|
2087
|
+
hn as Switch,
|
|
2088
|
+
pn as Tabs,
|
|
2089
|
+
bn as TabsContent,
|
|
2090
|
+
vn as TabsList,
|
|
2091
|
+
gn as TabsTrigger,
|
|
2092
|
+
ge as TextField,
|
|
2093
|
+
dn as Textarea,
|
|
2094
|
+
Ne as Toast,
|
|
2095
|
+
we as ToastAction,
|
|
2096
|
+
Ce as ToastClose,
|
|
2097
|
+
Lt as ToastDescription,
|
|
2098
|
+
ye as ToastProvider,
|
|
2099
|
+
ke as ToastTitle,
|
|
2100
|
+
Te as ToastViewport,
|
|
2101
|
+
Bn as Tooltip,
|
|
2102
|
+
Pn as TooltipContent,
|
|
2103
|
+
In as TooltipProvider,
|
|
2104
|
+
En as TooltipTrigger,
|
|
2105
|
+
Ue as TotpEnrollmentCard,
|
|
2106
|
+
en as Widget,
|
|
2107
|
+
sn as WidgetAction,
|
|
2108
|
+
rn as WidgetAmount,
|
|
2109
|
+
an as WidgetHeader,
|
|
2110
|
+
cn as WidgetKeyValue,
|
|
2111
|
+
on as WidgetList,
|
|
2112
|
+
ln as WidgetRow,
|
|
2113
|
+
pe as formatRecoveryCodesText,
|
|
2114
|
+
z as motionTokens,
|
|
2115
|
+
Ie as useKeyedListMotion,
|
|
2116
|
+
ut as useMotion,
|
|
2117
|
+
We as useToast
|
|
1179
2118
|
};
|