@facto-to/design-system 0.1.0-beta.7 → 0.1.0-beta.8
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 +88 -8
- package/dist/ai/references/catalog.json +10 -1
- package/dist/ai/references/components.md +2 -1
- package/dist/ai/references/integration.md +1 -1
- package/dist/ai/references/motion.md +31 -0
- package/dist/ai/references/version.json +2 -2
- package/dist/index.d.ts +88 -8
- package/dist/index.js +977 -692
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,385 +1,652 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs 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
|
-
|
|
2
|
+
import { jsx as n, jsxs as _, Fragment as J } from "react/jsx-runtime";
|
|
3
|
+
import * as Z from "@radix-ui/react-popover";
|
|
4
|
+
import * as K from "@radix-ui/react-dropdown-menu";
|
|
5
|
+
import * as Q from "@radix-ui/react-tooltip";
|
|
6
|
+
import * as V from "@radix-ui/react-toast";
|
|
7
|
+
import { createPortal as yt } from "react-dom";
|
|
8
|
+
import * as lt from "@radix-ui/react-checkbox";
|
|
9
|
+
import * as x from "@radix-ui/react-dialog";
|
|
10
|
+
import * as L from "@radix-ui/react-select";
|
|
11
|
+
import * as dt from "@radix-ui/react-switch";
|
|
12
|
+
import * as ot from "@radix-ui/react-tabs";
|
|
13
|
+
import { useContext as B, useSyncExternalStore as wt, createContext as st, useRef as T, useLayoutEffect as O, useState as H, useEffect as E, useId as j, forwardRef as X, Children as kt, isValidElement as Ct, cloneElement as Tt, useCallback as z, useMemo as Mt } from "react";
|
|
14
|
+
const S = {
|
|
15
|
+
duration: { feedback: 160, content: 180, surface: 220, overlay: 240 },
|
|
16
|
+
easing: { standard: "cubic-bezier(.22, 1, .36, 1)" }
|
|
17
|
+
}, pt = st("auto"), gt = "(prefers-reduced-motion: reduce)", Rt = (t) => {
|
|
18
|
+
const e = window.matchMedia?.(gt);
|
|
19
|
+
return e?.addEventListener("change", t), () => e?.removeEventListener("change", t);
|
|
20
|
+
}, $t = () => typeof window < "u" && !!window.matchMedia?.(gt).matches, St = () => !0;
|
|
21
|
+
function tt(t) {
|
|
22
|
+
const e = B(pt), o = wt(Rt, $t, St), a = t ?? e;
|
|
23
|
+
return { motion: a, reduced: o, enabled: a === "auto" && !o };
|
|
24
|
+
}
|
|
25
|
+
function A(t) {
|
|
26
|
+
const { enabled: e } = tt(t);
|
|
27
|
+
return { "--facto-motion-scale": e ? 1 : 0 };
|
|
28
|
+
}
|
|
29
|
+
function at({ motion: t, children: e }) {
|
|
30
|
+
const o = tt(t);
|
|
31
|
+
return /* @__PURE__ */ n(pt.Provider, { value: o.motion, children: /* @__PURE__ */ n("div", { "data-facto-motion": o.motion, style: { display: "contents", "--facto-motion-scale": o.enabled ? 1 : 0 }, children: e }) });
|
|
32
|
+
}
|
|
33
|
+
const rt = (...t) => t.filter(Boolean).join(" ");
|
|
34
|
+
function D(t, e) {
|
|
35
|
+
e.current?.cancel(), e.current = null, t.style.height = "", t.style.overflow = "";
|
|
36
|
+
}
|
|
37
|
+
function it(t) {
|
|
38
|
+
return tt(t).enabled;
|
|
39
|
+
}
|
|
40
|
+
function vt(t, e, o) {
|
|
41
|
+
const a = T(null), c = T(null), i = T(t), r = T(!1), u = T(0), [s, f] = H(t);
|
|
42
|
+
return O(() => {
|
|
43
|
+
const m = a.current;
|
|
44
|
+
if (!m) return;
|
|
45
|
+
const p = i.current !== t;
|
|
46
|
+
if (i.current = t, !e) {
|
|
47
|
+
r.current = !1, D(m, c), f(t);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (p && (u.current = m.getBoundingClientRect().height, D(m, c), r.current = !0, t && !s)) {
|
|
51
|
+
f(!0);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!r.current || !s) return;
|
|
55
|
+
r.current = !1;
|
|
56
|
+
const y = t ? u.current || 0 : u.current, w = t ? m.scrollHeight : 0;
|
|
57
|
+
if (!m.animate || Math.abs(w - y) < 1) {
|
|
58
|
+
D(m, c), t || f(!1);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
m.style.height = `${y}px`, m.style.overflow = "hidden";
|
|
62
|
+
const C = m.animate(
|
|
63
|
+
[{ height: `${y}px`, opacity: t ? 0.85 : 1 }, { height: `${w}px`, opacity: t ? 1 : 0 }],
|
|
64
|
+
{ duration: o, easing: S.easing.standard, fill: "forwards" }
|
|
65
|
+
);
|
|
66
|
+
c.current = C, C.onfinish = () => {
|
|
67
|
+
c.current === C && (D(m, c), t || f(!1));
|
|
68
|
+
};
|
|
69
|
+
}, [e, s, t, o]), O(() => () => {
|
|
70
|
+
const m = a.current;
|
|
71
|
+
m && D(m, c);
|
|
72
|
+
}, []), { rootRef: a, mounted: s };
|
|
73
|
+
}
|
|
74
|
+
function Gt({ stepKey: t, children: e, motion: o, className: a, ...c }) {
|
|
75
|
+
const i = it(o), r = T(null), u = T(null), s = T(null), f = T(null), m = T(t), p = T(null), y = T(null), w = T(null), C = () => {
|
|
76
|
+
const v = r.current, l = u.current;
|
|
77
|
+
!v || !l || (D(v, s), p.current = l.getBoundingClientRect().height, y.current = null);
|
|
78
|
+
}, M = (v, l) => {
|
|
79
|
+
const d = r.current;
|
|
80
|
+
if (!d || !i || !d.animate || Math.abs(l - v) < 1) {
|
|
81
|
+
C();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
D(d, s), d.style.height = `${v}px`, d.style.overflow = "hidden", y.current = l;
|
|
85
|
+
const b = d.animate(
|
|
86
|
+
[{ height: `${v}px` }, { height: `${l}px` }],
|
|
87
|
+
{ duration: S.duration.surface, easing: S.easing.standard, fill: "forwards" }
|
|
88
|
+
);
|
|
89
|
+
s.current = b, b.onfinish = () => {
|
|
90
|
+
s.current === b && C();
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
return O(() => {
|
|
94
|
+
const v = r.current, l = u.current;
|
|
95
|
+
if (!v || !l) return;
|
|
96
|
+
const d = m.current !== t;
|
|
97
|
+
if (m.current = t, !i) {
|
|
98
|
+
D(v, s), f.current?.cancel(), f.current = null, p.current = l.getBoundingClientRect().height, y.current = null;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!d) {
|
|
102
|
+
s.current || (p.current = l.getBoundingClientRect().height);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const b = s.current ? v.getBoundingClientRect().height : p.current ?? v.getBoundingClientRect().height;
|
|
106
|
+
D(v, s), f.current?.cancel(), f.current = null;
|
|
107
|
+
const g = l.getBoundingClientRect().height;
|
|
108
|
+
if (p.current == null) {
|
|
109
|
+
p.current = g;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
M(b, g);
|
|
113
|
+
const N = l.animate?.(
|
|
114
|
+
[{ opacity: 0.35, transform: "translateY(6px)" }, { opacity: 1, transform: "translateY(0)" }],
|
|
115
|
+
{ duration: S.duration.content, easing: S.easing.standard }
|
|
116
|
+
);
|
|
117
|
+
f.current = N ?? null, N?.addEventListener("finish", () => {
|
|
118
|
+
f.current === N && (N.cancel(), f.current = null);
|
|
119
|
+
}, { once: !0 });
|
|
120
|
+
}, [e, i, t]), O(() => {
|
|
121
|
+
if (!r.current || typeof ResizeObserver > "u") return;
|
|
122
|
+
const l = new ResizeObserver(() => w.current?.()), d = u.current;
|
|
123
|
+
if (d)
|
|
124
|
+
return l.observe(d), () => l.disconnect();
|
|
125
|
+
}, []), w.current = () => {
|
|
126
|
+
const v = r.current, l = u.current;
|
|
127
|
+
if (!v || !l) return;
|
|
128
|
+
const d = l.getBoundingClientRect().height;
|
|
129
|
+
if (!s.current) {
|
|
130
|
+
p.current = d;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
y.current != null && Math.abs(d - y.current) >= 1 && M(v.getBoundingClientRect().height, d);
|
|
134
|
+
}, O(() => () => {
|
|
135
|
+
const v = r.current;
|
|
136
|
+
v && D(v, s), f.current?.cancel(), f.current = null;
|
|
137
|
+
}, []), /* @__PURE__ */ n("div", { ...c, ref: r, className: rt("facto-step-transition", a), children: /* @__PURE__ */ n("div", { ref: u, className: "facto-step-transition__content", children: e }) });
|
|
138
|
+
}
|
|
139
|
+
function Jt({ open: t, children: e, motion: o, className: a, ...c }) {
|
|
140
|
+
const { rootRef: i, mounted: r } = vt(t, it(o), S.duration.content);
|
|
141
|
+
return /* @__PURE__ */ n("div", { ...c, ref: i, className: rt("facto-animated-disclosure", a), "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !r, children: e });
|
|
142
|
+
}
|
|
143
|
+
function Ut({ show: t, children: e, motion: o, className: a, role: c = "alert", ...i }) {
|
|
144
|
+
const { rootRef: r, mounted: u } = vt(t, it(o), S.duration.feedback);
|
|
145
|
+
return /* @__PURE__ */ n("div", { ...i, ref: r, className: rt("facto-animated-feedback", a), role: t ? c : void 0, "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !u, children: e });
|
|
146
|
+
}
|
|
147
|
+
function Zt({ children: t, ready: e = !0, motion: o, className: a, ...c }) {
|
|
148
|
+
const i = it(o), r = T(null), u = T(e);
|
|
149
|
+
return O(() => {
|
|
150
|
+
const s = r.current, f = !u.current && e;
|
|
151
|
+
if (u.current = e, !s || !f || !i || !s.animate) return;
|
|
152
|
+
const m = s.animate([{ opacity: 0.85 }, { opacity: 1 }], { duration: S.duration.content, easing: S.easing.standard });
|
|
153
|
+
return m.addEventListener("finish", () => m.cancel(), { once: !0 }), () => m.cancel();
|
|
154
|
+
}, [i, e]), /* @__PURE__ */ n("div", { ...c, ref: r, className: rt("facto-content-reveal", a), "aria-busy": e ? void 0 : !0, children: t });
|
|
155
|
+
}
|
|
156
|
+
const ut = (t) => {
|
|
157
|
+
t.forEach((e) => e.cancel()), t.length = 0;
|
|
158
|
+
};
|
|
159
|
+
function Qt(t, e, { motion: o } = {}) {
|
|
160
|
+
const { enabled: a } = tt(o), c = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Set()), r = T(null), u = T([]), s = JSON.stringify(e);
|
|
161
|
+
O(() => {
|
|
162
|
+
const f = t.current, m = () => {
|
|
163
|
+
if (!f) return /* @__PURE__ */ new Map();
|
|
164
|
+
const M = f.getBoundingClientRect();
|
|
165
|
+
return new Map(
|
|
166
|
+
Array.from(f.querySelectorAll("[data-list-motion-key]")).map((v) => {
|
|
167
|
+
const l = v.dataset.listMotionKey, d = v.getBoundingClientRect();
|
|
168
|
+
return l === void 0 ? null : [l, {
|
|
169
|
+
left: d.left - M.left + f.scrollLeft,
|
|
170
|
+
top: d.top - M.top + f.scrollTop
|
|
171
|
+
}];
|
|
172
|
+
}).filter((v) => v !== null)
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
ut(u.current);
|
|
176
|
+
const p = m();
|
|
177
|
+
if (!f || !a) {
|
|
178
|
+
c.current = p, i.current = new Set(p.keys()), r.current = s;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const y = r.current !== null && r.current !== s, w = c.current, C = i.current;
|
|
182
|
+
if (y) {
|
|
183
|
+
const M = new Map(
|
|
184
|
+
Array.from(f.querySelectorAll("[data-list-motion-key]")).map((v) => [v.dataset.listMotionKey, v]).filter((v) => v[0] !== void 0)
|
|
185
|
+
);
|
|
186
|
+
for (const [v, l] of p) {
|
|
187
|
+
const d = M.get(v);
|
|
188
|
+
if (!d || typeof d.animate != "function") continue;
|
|
189
|
+
const b = C.has(v) ? w.get(v) : void 0, g = b ? (() => {
|
|
190
|
+
const N = b.left - l.left, k = b.top - l.top;
|
|
191
|
+
return Math.abs(N) > 0.5 || Math.abs(k) > 0.5 ? [{ transform: `translate(${N}px, ${k}px)` }, { transform: "none" }] : null;
|
|
192
|
+
})() : [{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }];
|
|
193
|
+
g && u.current.push(d.animate(g, {
|
|
194
|
+
duration: b ? S.duration.content : S.duration.feedback,
|
|
195
|
+
easing: S.easing.standard
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return c.current = p, i.current = new Set(p.keys()), r.current = s, () => ut(u.current);
|
|
200
|
+
}, [a, t, s]);
|
|
201
|
+
}
|
|
202
|
+
function Xt({ motion: t, className: e, children: o, ...a }) {
|
|
203
|
+
const { enabled: c } = tt(t), i = T(null), r = T(null), u = T(null), s = T(null);
|
|
204
|
+
return O(() => {
|
|
205
|
+
const f = i.current, m = r.current;
|
|
206
|
+
if (!f || !m) return;
|
|
207
|
+
const p = (l) => {
|
|
208
|
+
const d = f.querySelector('[aria-pressed="true"], [aria-selected="true"]');
|
|
209
|
+
if (!d) {
|
|
210
|
+
s.current?.cancel(), s.current = null, m.hidden = !0, u.current = null;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const b = f.getBoundingClientRect(), g = d.getBoundingClientRect(), N = u.current, k = !m.hidden && s.current ? m.getBoundingClientRect() : N;
|
|
214
|
+
s.current?.cancel(), s.current = null, m.hidden = !1, Object.assign(m.style, {
|
|
215
|
+
left: `${g.left - b.left + f.scrollLeft}px`,
|
|
216
|
+
top: `${g.top - b.top + f.scrollTop}px`,
|
|
217
|
+
width: `${g.width}px`,
|
|
218
|
+
height: `${g.height}px`
|
|
219
|
+
}), l && c && k && g.width > 0 && g.height > 0 && typeof m.animate == "function" && (s.current = m.animate([
|
|
220
|
+
{
|
|
221
|
+
transform: `translate(${k.left - g.left}px, ${k.top - g.top}px) scale(${k.width / g.width}, ${k.height / g.height})`
|
|
222
|
+
},
|
|
223
|
+
{ transform: "none" }
|
|
224
|
+
], { duration: S.duration.surface, easing: S.easing.standard })), u.current = g;
|
|
225
|
+
}, y = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => p(!1)), w = /* @__PURE__ */ new Set(), C = () => {
|
|
226
|
+
w.forEach((l) => {
|
|
227
|
+
f.contains(l) || (y?.unobserve(l), w.delete(l));
|
|
228
|
+
}), f.querySelectorAll("[aria-pressed], [aria-selected]").forEach((l) => {
|
|
229
|
+
w.has(l) || (w.add(l), y?.observe(l));
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
p(!1), C();
|
|
233
|
+
const M = new MutationObserver((l) => {
|
|
234
|
+
const d = l.some(
|
|
235
|
+
(b) => b.type === "attributes" && (b.attributeName === "aria-pressed" || b.attributeName === "aria-selected")
|
|
236
|
+
);
|
|
237
|
+
C(), p(d);
|
|
238
|
+
});
|
|
239
|
+
M.observe(f, {
|
|
240
|
+
subtree: !0,
|
|
241
|
+
childList: !0,
|
|
242
|
+
characterData: !0,
|
|
243
|
+
attributes: !0,
|
|
244
|
+
attributeFilter: ["aria-pressed", "aria-selected"]
|
|
245
|
+
}), y?.observe(f);
|
|
246
|
+
const v = () => p(!1);
|
|
247
|
+
return window.addEventListener("resize", v), () => {
|
|
248
|
+
s.current?.cancel(), s.current = null, M.disconnect(), y?.disconnect(), window.removeEventListener("resize", v);
|
|
249
|
+
};
|
|
250
|
+
}, [c]), /* @__PURE__ */ _("div", { ...a, ref: i, className: ["facto-selection-motion", e].filter(Boolean).join(" "), children: [
|
|
251
|
+
/* @__PURE__ */ n("span", { ref: r, className: "facto-selection-motion__indicator", "aria-hidden": "true", hidden: !0 }),
|
|
252
|
+
o
|
|
253
|
+
] });
|
|
254
|
+
}
|
|
255
|
+
function bt() {
|
|
256
|
+
const [t, e] = H(null);
|
|
257
|
+
return E(() => {
|
|
258
|
+
const o = window.visualViewport;
|
|
259
|
+
if (!t || !o) return;
|
|
260
|
+
let a = 0;
|
|
261
|
+
const c = () => {
|
|
262
|
+
delete t.dataset.keyboardOpen, t.style.removeProperty("--facto-visible-height"), t.style.removeProperty("--facto-visible-top");
|
|
263
|
+
}, i = () => {
|
|
264
|
+
cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
265
|
+
const r = document.activeElement, u = r instanceof HTMLElement && t.contains(r) && r.matches('input, textarea, [contenteditable="true"]'), s = (window.innerWidth <= 700 || window.matchMedia?.("(pointer: coarse)").matches) && o.scale === 1 && window.innerHeight - o.height > 120, f = t.dataset.keyboardOpen === "true" && r instanceof HTMLElement && t.contains(r);
|
|
266
|
+
if (!s || !u && !f) {
|
|
267
|
+
c();
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (t.dataset.keyboardOpen = "true", t.style.setProperty("--facto-visible-height", `${o.height}px`), t.style.setProperty("--facto-visible-top", `${o.offsetTop}px`), u) {
|
|
271
|
+
const m = r.getBoundingClientRect();
|
|
272
|
+
(m.top < o.offsetTop + 12 || m.bottom > o.offsetTop + o.height - 12) && r.scrollIntoView({ block: "nearest", behavior: "instant" });
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
return o.addEventListener("resize", i), o.addEventListener("scroll", i), t.addEventListener("focusin", i), t.addEventListener("focusout", i), i(), () => {
|
|
277
|
+
cancelAnimationFrame(a), o.removeEventListener("resize", i), o.removeEventListener("scroll", i), t.removeEventListener("focusin", i), t.removeEventListener("focusout", i), c();
|
|
278
|
+
};
|
|
279
|
+
}, [t]), e;
|
|
280
|
+
}
|
|
281
|
+
const nt = /* @__PURE__ */ new WeakMap();
|
|
282
|
+
function xt(t) {
|
|
16
283
|
const e = Array.from(t.ownerDocument.body.children).filter(
|
|
17
|
-
(
|
|
284
|
+
(a) => a instanceof HTMLElement && !a.hasAttribute("data-radix-focus-guard") && !a.contains(t)
|
|
18
285
|
);
|
|
19
|
-
for (const
|
|
20
|
-
const
|
|
21
|
-
|
|
286
|
+
for (const a of e) {
|
|
287
|
+
const c = nt.get(a);
|
|
288
|
+
c ? c.count += 1 : (nt.set(a, { count: 1, wasInert: a.inert }), a.inert = !0);
|
|
22
289
|
}
|
|
23
|
-
let
|
|
290
|
+
let o = !0;
|
|
24
291
|
return () => {
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
|
|
292
|
+
if (o) {
|
|
293
|
+
o = !1;
|
|
294
|
+
for (const a of e) {
|
|
295
|
+
const c = nt.get(a);
|
|
296
|
+
c && (c.count -= 1, c.count === 0 && (c.wasInert || (a.inert = !1), nt.delete(a)));
|
|
30
297
|
}
|
|
31
298
|
}
|
|
32
299
|
};
|
|
33
300
|
}
|
|
34
|
-
const
|
|
35
|
-
const { leading:
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */ n("span", { className: "facto-list-row__title", children:
|
|
39
|
-
|
|
301
|
+
const q = (...t) => t.filter(Boolean).join(" "), te = X(function(e, o) {
|
|
302
|
+
const { leading: a, title: c, description: i, value: r, status: u, trailing: s, className: f } = e, m = /* @__PURE__ */ _(J, { children: [
|
|
303
|
+
a != null && /* @__PURE__ */ n("span", { className: "facto-list-row__leading", children: a }),
|
|
304
|
+
/* @__PURE__ */ _("span", { className: "facto-list-row__copy", children: [
|
|
305
|
+
/* @__PURE__ */ n("span", { className: "facto-list-row__title", children: c }),
|
|
306
|
+
i != null && /* @__PURE__ */ n("span", { className: "facto-list-row__description", children: i })
|
|
40
307
|
] }),
|
|
41
|
-
(r != null ||
|
|
308
|
+
(r != null || u != null) && /* @__PURE__ */ _("span", { className: "facto-list-row__meta", children: [
|
|
42
309
|
r != null && /* @__PURE__ */ n("span", { className: "facto-list-row__value", children: r }),
|
|
43
|
-
|
|
310
|
+
u != null && /* @__PURE__ */ n("span", { className: "facto-list-row__status", children: u })
|
|
44
311
|
] }),
|
|
45
|
-
|
|
46
|
-
] }),
|
|
312
|
+
s != null && /* @__PURE__ */ n("span", { className: "facto-list-row__trailing", children: s })
|
|
313
|
+
] }), p = q("facto-list-row", f);
|
|
47
314
|
if ("href" in e && typeof e.href == "string") {
|
|
48
|
-
const { leading:
|
|
49
|
-
return /* @__PURE__ */ n("a", {
|
|
315
|
+
const { leading: g, title: N, description: k, value: R, status: W, trailing: I, className: et, ...$ } = e;
|
|
316
|
+
return /* @__PURE__ */ n("a", { ...$, ref: o, className: p, children: m });
|
|
50
317
|
}
|
|
51
318
|
if ("onClick" in e && typeof e.onClick == "function") {
|
|
52
|
-
const { leading:
|
|
53
|
-
return /* @__PURE__ */ n("button", {
|
|
319
|
+
const { leading: g, title: N, description: k, value: R, status: W, trailing: I, className: et, type: $ = "button", ...P } = e;
|
|
320
|
+
return /* @__PURE__ */ n("button", { ...P, ref: o, type: $, className: p, children: m });
|
|
54
321
|
}
|
|
55
|
-
const { leading:
|
|
56
|
-
return /* @__PURE__ */ n("div", { ...b, ref:
|
|
322
|
+
const { leading: y, title: w, description: C, value: M, status: v, trailing: l, className: d, ...b } = e;
|
|
323
|
+
return /* @__PURE__ */ n("div", { ...b, ref: o, className: p, children: m });
|
|
57
324
|
});
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
t && /* @__PURE__ */ n("h2", { id:
|
|
325
|
+
function ee({ heading: t, children: e, className: o, ...a }) {
|
|
326
|
+
const c = j();
|
|
327
|
+
return /* @__PURE__ */ _("section", { ...a, className: q("facto-list-group", o), "aria-labelledby": t ? c : a["aria-labelledby"], children: [
|
|
328
|
+
t && /* @__PURE__ */ n("h2", { id: c, className: "facto-list-group__heading", children: t }),
|
|
62
329
|
/* @__PURE__ */ n("div", { className: "facto-list-group__rows", children: e })
|
|
63
330
|
] });
|
|
64
331
|
}
|
|
65
|
-
function
|
|
66
|
-
const [
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
return /* @__PURE__ */ n("span", { className:
|
|
70
|
-
|
|
71
|
-
} }) : /* @__PURE__ */ n("span", { className: "facto-avatar__fallback", role: e ? "img" : void 0, "aria-label": e || void 0, "aria-hidden": e ? void 0 : !0, children:
|
|
72
|
-
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
r > 0 && /* @__PURE__ */
|
|
332
|
+
function Bt({ src: t, alt: e = "", fallback: o, size: a = "md", className: c, onError: i, ...r }) {
|
|
333
|
+
const [u, s] = H(!1);
|
|
334
|
+
E(() => s(!1), [t]);
|
|
335
|
+
const f = o ?? (e ? e.slice(0, 1).toUpperCase() : null);
|
|
336
|
+
return /* @__PURE__ */ n("span", { className: q("facto-avatar", `facto-avatar--${a}`, c), children: t && !u ? /* @__PURE__ */ n("img", { ...r, src: t, alt: e, onError: (m) => {
|
|
337
|
+
s(!0), i?.(m);
|
|
338
|
+
} }) : /* @__PURE__ */ n("span", { className: "facto-avatar__fallback", role: e ? "img" : void 0, "aria-label": e || void 0, "aria-hidden": e ? void 0 : !0, children: f }) });
|
|
339
|
+
}
|
|
340
|
+
function ne({ logos: t, size: e = "md", max: o, className: a, ...c }) {
|
|
341
|
+
const i = o === void 0 ? t : t.slice(0, o), r = t.length - i.length;
|
|
342
|
+
return /* @__PURE__ */ _("div", { ...c, className: q("facto-logo-stack", `facto-logo-stack--${e}`, a), children: [
|
|
343
|
+
i.map((u, s) => /* @__PURE__ */ n(Bt, { ...u, size: e }, `${u.src ?? "fallback"}-${s}`)),
|
|
344
|
+
r > 0 && /* @__PURE__ */ _("span", { className: "facto-logo-stack__more", "aria-label": `${r} more logos`, children: [
|
|
78
345
|
"+",
|
|
79
346
|
r
|
|
80
347
|
] })
|
|
81
348
|
] });
|
|
82
349
|
}
|
|
83
|
-
function
|
|
84
|
-
return /* @__PURE__ */
|
|
350
|
+
function oe({ title: t, description: e, retryLabel: o = "Try again", onRetry: a, className: c, ...i }) {
|
|
351
|
+
return /* @__PURE__ */ _("div", { ...i, className: q("facto-error-state", c), role: "alert", children: [
|
|
85
352
|
/* @__PURE__ */ n("strong", { children: t }),
|
|
86
353
|
e && /* @__PURE__ */ n("p", { children: e }),
|
|
87
|
-
|
|
354
|
+
a && /* @__PURE__ */ n("button", { type: "button", className: "facto-error-state__retry", onClick: a, children: o })
|
|
88
355
|
] });
|
|
89
356
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
357
|
+
function ae({ label: t = "Loading more", className: e, ...o }) {
|
|
358
|
+
return /* @__PURE__ */ _("div", { ...o, className: q("facto-loading-more", e), role: "status", "aria-live": "polite", children: [
|
|
92
359
|
/* @__PURE__ */ n("span", { className: "facto-loading-more__spinner", "aria-hidden": "true" }),
|
|
93
360
|
/* @__PURE__ */ n("span", { children: t })
|
|
94
361
|
] });
|
|
95
362
|
}
|
|
96
|
-
function
|
|
97
|
-
return /* @__PURE__ */ n("ol", { ...
|
|
98
|
-
const
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ n("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children:
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
363
|
+
function re({ steps: t, className: e, ...o }) {
|
|
364
|
+
return /* @__PURE__ */ n("ol", { ...o, className: q("facto-step-checklist", e), children: t.map((a, c) => {
|
|
365
|
+
const i = a.state ?? "upcoming";
|
|
366
|
+
return /* @__PURE__ */ _("li", { className: `facto-step-checklist__item facto-step-checklist__item--${i}`, "aria-current": i === "current" ? "step" : void 0, children: [
|
|
367
|
+
/* @__PURE__ */ n("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children: i === "complete" ? "✓" : c + 1 }),
|
|
368
|
+
/* @__PURE__ */ _("span", { className: "facto-step-checklist__copy", children: [
|
|
369
|
+
/* @__PURE__ */ _("span", { children: [
|
|
370
|
+
a.label,
|
|
371
|
+
i === "complete" && /* @__PURE__ */ n("span", { className: "facto-visually-hidden", children: ", completed" })
|
|
105
372
|
] }),
|
|
106
|
-
|
|
373
|
+
a.description != null && /* @__PURE__ */ n("small", { children: a.description })
|
|
107
374
|
] })
|
|
108
|
-
] },
|
|
375
|
+
] }, c);
|
|
109
376
|
}) });
|
|
110
377
|
}
|
|
111
|
-
const
|
|
112
|
-
function
|
|
378
|
+
const U = (...t) => t.filter(Boolean).join(" "), It = (...t) => t.filter(Boolean).join(" ") || void 0;
|
|
379
|
+
function ie({
|
|
113
380
|
label: t,
|
|
114
381
|
leading: e,
|
|
115
|
-
trailing:
|
|
116
|
-
children:
|
|
117
|
-
invalid:
|
|
118
|
-
inputId:
|
|
382
|
+
trailing: o,
|
|
383
|
+
children: a,
|
|
384
|
+
invalid: c,
|
|
385
|
+
inputId: i,
|
|
119
386
|
className: r,
|
|
120
|
-
...
|
|
387
|
+
...u
|
|
121
388
|
}) {
|
|
122
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ _(
|
|
123
390
|
"div",
|
|
124
391
|
{
|
|
125
|
-
...
|
|
126
|
-
className:
|
|
392
|
+
...u,
|
|
393
|
+
className: U("facto-inset-field", c && "facto-inset-field--invalid", r),
|
|
127
394
|
children: [
|
|
128
|
-
t && /* @__PURE__ */ n("label", { className: "facto-inset-field__label", htmlFor:
|
|
129
|
-
/* @__PURE__ */
|
|
395
|
+
t && /* @__PURE__ */ n("label", { className: "facto-inset-field__label", htmlFor: i, children: t }),
|
|
396
|
+
/* @__PURE__ */ _("span", { className: "facto-inset-field__control", children: [
|
|
130
397
|
e && /* @__PURE__ */ n("span", { className: "facto-inset-field__slot facto-inset-field__slot--leading", children: e }),
|
|
131
|
-
|
|
132
|
-
|
|
398
|
+
kt.map(a, (s) => Ct(s) && typeof s.type == "string" && ["input", "textarea", "select"].includes(s.type) ? Tt(s, { id: i, "aria-invalid": c || s.props["aria-invalid"] }) : s),
|
|
399
|
+
o && /* @__PURE__ */ n("span", { className: "facto-inset-field__slot facto-inset-field__slot--trailing", children: o })
|
|
133
400
|
] })
|
|
134
401
|
]
|
|
135
402
|
}
|
|
136
403
|
);
|
|
137
404
|
}
|
|
138
|
-
const
|
|
139
|
-
function
|
|
405
|
+
const ft = (t, e) => t.replace(/\D/g, "").slice(0, e);
|
|
406
|
+
function ce({
|
|
140
407
|
value: t,
|
|
141
408
|
onValueChange: e,
|
|
142
|
-
length:
|
|
143
|
-
onComplete:
|
|
144
|
-
completionDelay:
|
|
145
|
-
pending:
|
|
409
|
+
length: o = 6,
|
|
410
|
+
onComplete: a,
|
|
411
|
+
completionDelay: c = 300,
|
|
412
|
+
pending: i,
|
|
146
413
|
pendingLabel: r = "Verifying code…",
|
|
147
|
-
label:
|
|
148
|
-
helperText:
|
|
149
|
-
error:
|
|
150
|
-
id:
|
|
151
|
-
className:
|
|
152
|
-
containerClassName:
|
|
153
|
-
disabled:
|
|
154
|
-
readOnly:
|
|
155
|
-
onPaste:
|
|
156
|
-
onFocus:
|
|
157
|
-
onBlur:
|
|
158
|
-
...
|
|
414
|
+
label: u,
|
|
415
|
+
helperText: s,
|
|
416
|
+
error: f,
|
|
417
|
+
id: m,
|
|
418
|
+
className: p,
|
|
419
|
+
containerClassName: y,
|
|
420
|
+
disabled: w,
|
|
421
|
+
readOnly: C,
|
|
422
|
+
onPaste: M,
|
|
423
|
+
onFocus: v,
|
|
424
|
+
onBlur: l,
|
|
425
|
+
...d
|
|
159
426
|
}) {
|
|
160
|
-
const b = j(),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, [
|
|
164
|
-
if (
|
|
165
|
-
if (
|
|
166
|
-
|
|
427
|
+
const b = j(), g = m ?? b, N = f || s ? `${g}-description` : void 0, k = Number.isFinite(o) ? Math.min(32, Math.max(1, Math.floor(o))) : 6, R = ft(t, k), W = T(void 0), I = T(a);
|
|
428
|
+
E(() => {
|
|
429
|
+
I.current = a;
|
|
430
|
+
}, [a]), E(() => {
|
|
431
|
+
if (w || C || i) return;
|
|
432
|
+
if (R.length !== k) {
|
|
433
|
+
W.current = void 0;
|
|
167
434
|
return;
|
|
168
435
|
}
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
}, Math.max(0,
|
|
173
|
-
return () => window.clearTimeout(
|
|
174
|
-
}, [
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
|
|
436
|
+
if (W.current === R) return;
|
|
437
|
+
const $ = window.setTimeout(() => {
|
|
438
|
+
W.current = R, I.current?.(R);
|
|
439
|
+
}, Math.max(0, c));
|
|
440
|
+
return () => window.clearTimeout($);
|
|
441
|
+
}, [c, w, k, R, i, C]);
|
|
442
|
+
const et = ($) => {
|
|
443
|
+
if (w || C || i) return;
|
|
444
|
+
const P = ft($, k);
|
|
445
|
+
P !== R && e(P);
|
|
179
446
|
};
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ _("div", { className: U("facto-otp", y), children: [
|
|
448
|
+
u && /* @__PURE__ */ n("label", { className: "facto-otp__label", htmlFor: g, children: u }),
|
|
449
|
+
/* @__PURE__ */ _(
|
|
183
450
|
"div",
|
|
184
451
|
{
|
|
185
|
-
className:
|
|
186
|
-
"data-disabled":
|
|
187
|
-
"data-pending":
|
|
452
|
+
className: U("facto-otp__cells", !!f && "facto-otp__cells--error", p),
|
|
453
|
+
"data-disabled": w ? "" : void 0,
|
|
454
|
+
"data-pending": i ? "" : void 0,
|
|
188
455
|
children: [
|
|
189
456
|
/* @__PURE__ */ n(
|
|
190
457
|
"input",
|
|
191
458
|
{
|
|
192
|
-
...
|
|
193
|
-
id:
|
|
459
|
+
...d,
|
|
460
|
+
id: g,
|
|
194
461
|
className: "facto-otp__input",
|
|
195
462
|
type: "text",
|
|
196
463
|
inputMode: "numeric",
|
|
197
464
|
autoComplete: "one-time-code",
|
|
198
465
|
pattern: "[0-9]*",
|
|
199
|
-
maxLength:
|
|
200
|
-
disabled:
|
|
201
|
-
readOnly:
|
|
202
|
-
value:
|
|
203
|
-
"aria-invalid": !!
|
|
204
|
-
"aria-busy":
|
|
205
|
-
"aria-describedby":
|
|
206
|
-
"aria-errormessage":
|
|
207
|
-
onChange: (
|
|
208
|
-
onPaste: (
|
|
209
|
-
|
|
466
|
+
maxLength: k,
|
|
467
|
+
disabled: w || i,
|
|
468
|
+
readOnly: C,
|
|
469
|
+
value: R,
|
|
470
|
+
"aria-invalid": !!f || d["aria-invalid"],
|
|
471
|
+
"aria-busy": i || void 0,
|
|
472
|
+
"aria-describedby": It(d["aria-describedby"], N, i ? `${g}-pending` : void 0),
|
|
473
|
+
"aria-errormessage": f ? N : void 0,
|
|
474
|
+
onChange: ($) => et($.currentTarget.value),
|
|
475
|
+
onPaste: ($) => {
|
|
476
|
+
M?.($), !$.defaultPrevented && ($.preventDefault(), et($.clipboardData.getData("text")));
|
|
210
477
|
},
|
|
211
|
-
onFocus:
|
|
212
|
-
onBlur:
|
|
478
|
+
onFocus: v,
|
|
479
|
+
onBlur: l
|
|
213
480
|
}
|
|
214
481
|
),
|
|
215
|
-
/* @__PURE__ */ n("span", { className: "facto-otp__visual", style: { gridTemplateColumns: `repeat(${Math.min(
|
|
482
|
+
/* @__PURE__ */ n("span", { className: "facto-otp__visual", style: { gridTemplateColumns: `repeat(${Math.min(k, 8)}, minmax(0, 1fr))` }, "aria-hidden": "true", children: Array.from({ length: k }, ($, P) => /* @__PURE__ */ n("span", { className: "facto-otp__cell", children: R[P] && /* @__PURE__ */ n("span", { className: "facto-otp__digit", children: R[P] }, `${P}-${R[P]}`) }, P)) })
|
|
216
483
|
]
|
|
217
484
|
}
|
|
218
485
|
),
|
|
219
|
-
(
|
|
486
|
+
(f || s) && /* @__PURE__ */ n(
|
|
220
487
|
"span",
|
|
221
488
|
{
|
|
222
|
-
id:
|
|
223
|
-
className:
|
|
224
|
-
role:
|
|
225
|
-
children:
|
|
489
|
+
id: N,
|
|
490
|
+
className: U("facto-otp__message", !!f && "facto-otp__message--error"),
|
|
491
|
+
role: f ? "alert" : void 0,
|
|
492
|
+
children: f ?? s
|
|
226
493
|
}
|
|
227
494
|
),
|
|
228
|
-
|
|
495
|
+
i && /* @__PURE__ */ n("span", { className: "facto-otp__pending", id: `${g}-pending`, role: "status", children: r })
|
|
229
496
|
] });
|
|
230
497
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
498
|
+
const ct = (t) => t instanceof Date ? t.getTime() : t ?? 0, Pt = (t, e) => Math.max(0, Math.ceil((ct(t) - e) / 1e3)), Lt = (t) => `Resend code in ${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
|
|
499
|
+
function se({
|
|
233
500
|
deadline: t,
|
|
234
501
|
pending: e,
|
|
235
|
-
disabled:
|
|
236
|
-
children:
|
|
237
|
-
formatCountdown:
|
|
238
|
-
className:
|
|
502
|
+
disabled: o,
|
|
503
|
+
children: a = "Resend code",
|
|
504
|
+
formatCountdown: c = Lt,
|
|
505
|
+
className: i,
|
|
239
506
|
onClick: r,
|
|
240
|
-
...
|
|
507
|
+
...u
|
|
241
508
|
}) {
|
|
242
|
-
const [
|
|
243
|
-
|
|
244
|
-
let
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
Number.isFinite(
|
|
509
|
+
const [s, f] = H(null), m = s === null ? 0 : Pt(t, s);
|
|
510
|
+
E(() => {
|
|
511
|
+
let y;
|
|
512
|
+
const w = () => {
|
|
513
|
+
const C = Date.now();
|
|
514
|
+
f(C);
|
|
515
|
+
const M = ct(t) - C;
|
|
516
|
+
Number.isFinite(M) && M > 0 && (y = window.setTimeout(w, Math.min(M, 250)));
|
|
250
517
|
};
|
|
251
|
-
return
|
|
518
|
+
return w(), () => window.clearTimeout(y);
|
|
252
519
|
}, [t]);
|
|
253
|
-
const
|
|
254
|
-
return /* @__PURE__ */
|
|
520
|
+
const p = s === null ? ct(t) > 0 : m > 0;
|
|
521
|
+
return /* @__PURE__ */ _(
|
|
255
522
|
"button",
|
|
256
523
|
{
|
|
257
|
-
...
|
|
524
|
+
...u,
|
|
258
525
|
type: "button",
|
|
259
|
-
className:
|
|
260
|
-
disabled: !!(
|
|
526
|
+
className: U("facto-resend-code", e && "facto-resend-code--pending", i),
|
|
527
|
+
disabled: !!(o || e || p),
|
|
261
528
|
"aria-busy": e || void 0,
|
|
262
529
|
onClick: r,
|
|
263
530
|
children: [
|
|
264
531
|
e && /* @__PURE__ */ n("span", { className: "facto-resend-code__spinner", "aria-hidden": "true" }),
|
|
265
|
-
|
|
532
|
+
p && s !== null ? c(m) : a
|
|
266
533
|
]
|
|
267
534
|
}
|
|
268
535
|
);
|
|
269
536
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
537
|
+
const _t = st(null);
|
|
538
|
+
function le({
|
|
272
539
|
children: t,
|
|
273
540
|
duration: e,
|
|
274
|
-
maxVisible:
|
|
275
|
-
label:
|
|
541
|
+
maxVisible: o = 3,
|
|
542
|
+
label: a = "Notifications ({hotkey})"
|
|
276
543
|
}) {
|
|
277
|
-
const [
|
|
278
|
-
r.current =
|
|
544
|
+
const [c, i] = H([]), r = T([]), u = T(0), s = T(0), f = Number.isFinite(o) ? Math.max(1, Math.floor(o)) : 3, m = e ?? 2600, p = z((l) => {
|
|
545
|
+
r.current = l, i(l);
|
|
279
546
|
}, []);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
id:
|
|
286
|
-
tone:
|
|
287
|
-
title:
|
|
547
|
+
E(() => {
|
|
548
|
+
p(r.current.slice(-f));
|
|
549
|
+
}, [p, f]);
|
|
550
|
+
const y = z((l, d, b = {}) => {
|
|
551
|
+
const g = b.id ?? `toast-${++u.current}`, N = ++s.current, k = {
|
|
552
|
+
id: g,
|
|
553
|
+
tone: l,
|
|
554
|
+
title: d,
|
|
288
555
|
description: b.description,
|
|
289
556
|
action: b.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:
|
|
557
|
+
duration: l === "loading" ? b.duration ?? 1 / 0 : b.duration,
|
|
558
|
+
generation: N
|
|
559
|
+
}, R = r.current, W = R.findIndex((I) => I.id === g);
|
|
560
|
+
return p(W >= 0 ? R.map((I) => I.id === g ? { ...I, ...k } : I) : [...R, k].slice(-f)), { id: g, generation: N };
|
|
561
|
+
}, [p, f]), w = z((l, d, b) => {
|
|
562
|
+
const g = r.current, N = g.findIndex((R) => R.id === l);
|
|
563
|
+
if (N < 0 || b !== void 0 && g[N].generation !== b) return !1;
|
|
564
|
+
const k = ++s.current;
|
|
565
|
+
p(g.map((R) => R.id !== l ? R : {
|
|
566
|
+
...R,
|
|
567
|
+
...d.title === void 0 ? {} : { title: d.title },
|
|
568
|
+
...d.tone === void 0 ? {} : { tone: d.tone },
|
|
569
|
+
...d.description === void 0 ? {} : { description: d.description },
|
|
570
|
+
...d.action === void 0 ? {} : { action: d.action },
|
|
571
|
+
duration: d.duration ?? (R.tone === "loading" && (d.tone ?? R.tone) !== "loading" ? m : (d.tone ?? R.tone) === "loading" ? 1 / 0 : R.duration),
|
|
572
|
+
generation: k
|
|
306
573
|
}));
|
|
307
|
-
}, [
|
|
308
|
-
const b = r.current,
|
|
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
|
|
574
|
+
}, [p, m]), C = z((l, d) => (w(l, d), l), [w]), M = z((l, d) => {
|
|
575
|
+
const b = r.current, g = l === void 0 ? void 0 : b.find((N) => N.id === l);
|
|
576
|
+
l !== void 0 && (!g || d !== void 0 && g.generation !== d) || p(l === void 0 ? [] : b.filter((N) => N.id !== l));
|
|
577
|
+
}, [p]), v = Mt(() => ({
|
|
578
|
+
success: (l, d) => y("success", l, d).id,
|
|
579
|
+
error: (l, d) => y("error", l, d).id,
|
|
580
|
+
warning: (l, d) => y("warning", l, d).id,
|
|
581
|
+
info: (l, d) => y("info", l, d).id,
|
|
582
|
+
loading: (l, d) => y("loading", l, d).id,
|
|
583
|
+
update: C,
|
|
584
|
+
dismiss: M,
|
|
585
|
+
promise: (l, d, b) => {
|
|
586
|
+
const g = y("loading", d.loading, b);
|
|
587
|
+
return Promise.resolve(l).then(
|
|
588
|
+
(N) => (w(g.id, {
|
|
589
|
+
title: typeof d.success == "function" ? d.success(N) : d.success,
|
|
323
590
|
tone: "success",
|
|
324
|
-
duration: b?.duration ??
|
|
325
|
-
},
|
|
326
|
-
(
|
|
327
|
-
throw
|
|
328
|
-
title: typeof
|
|
591
|
+
duration: b?.duration ?? m
|
|
592
|
+
}, g.generation), N),
|
|
593
|
+
(N) => {
|
|
594
|
+
throw w(g.id, {
|
|
595
|
+
title: typeof d.error == "function" ? d.error(N) : d.error,
|
|
329
596
|
tone: "error",
|
|
330
|
-
duration: b?.duration ??
|
|
331
|
-
},
|
|
597
|
+
duration: b?.duration ?? m
|
|
598
|
+
}, g.generation), N;
|
|
332
599
|
}
|
|
333
600
|
);
|
|
334
601
|
}
|
|
335
|
-
}), [
|
|
336
|
-
return /* @__PURE__ */ n(
|
|
602
|
+
}), [y, m, M, C, w]);
|
|
603
|
+
return /* @__PURE__ */ n(_t.Provider, { value: v, children: /* @__PURE__ */ _(zt, { duration: e, children: [
|
|
337
604
|
t,
|
|
338
|
-
|
|
339
|
-
|
|
605
|
+
c.map((l) => /* @__PURE__ */ _(
|
|
606
|
+
Ot,
|
|
340
607
|
{
|
|
341
|
-
duration:
|
|
342
|
-
icon:
|
|
343
|
-
tone:
|
|
344
|
-
type:
|
|
608
|
+
duration: l.duration,
|
|
609
|
+
icon: l.tone === "loading" ? /* @__PURE__ */ n("span", { className: "facto-notification-spinner" }) : void 0,
|
|
610
|
+
tone: l.tone === "error" ? "danger" : l.tone === "loading" ? "info" : l.tone,
|
|
611
|
+
type: l.tone === "error" ? "foreground" : "background",
|
|
345
612
|
open: !0,
|
|
346
|
-
onOpenChange: (
|
|
347
|
-
|
|
613
|
+
onOpenChange: (d) => {
|
|
614
|
+
d || M(l.id, l.generation);
|
|
348
615
|
},
|
|
349
616
|
children: [
|
|
350
|
-
/* @__PURE__ */ n(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
/* @__PURE__ */ n(
|
|
617
|
+
/* @__PURE__ */ n(Ht, { children: l.title }),
|
|
618
|
+
l.tone === "loading" && /* @__PURE__ */ n(ht, { children: /* @__PURE__ */ n("span", { role: "status", children: "Loading" }) }),
|
|
619
|
+
l.description != null && /* @__PURE__ */ n(ht, { children: l.description }),
|
|
620
|
+
l.action && /* @__PURE__ */ n(jt, { altText: l.action.altText, onClick: l.action.onClick, children: l.action.label }),
|
|
621
|
+
/* @__PURE__ */ n(Wt, {})
|
|
355
622
|
]
|
|
356
623
|
},
|
|
357
|
-
`${
|
|
624
|
+
`${l.id}-${l.generation}`
|
|
358
625
|
)),
|
|
359
|
-
/* @__PURE__ */ n(
|
|
626
|
+
/* @__PURE__ */ n(Vt, { label: a })
|
|
360
627
|
] }) });
|
|
361
628
|
}
|
|
362
|
-
function
|
|
363
|
-
const t =
|
|
629
|
+
function de() {
|
|
630
|
+
const t = B(_t);
|
|
364
631
|
if (!t) throw new Error("useToast must be used within a NotificationsProvider");
|
|
365
632
|
return t;
|
|
366
633
|
}
|
|
367
|
-
const
|
|
368
|
-
Object.entries(t ?? {}).filter(([e,
|
|
634
|
+
const h = (...t) => t.filter(Boolean).join(" "), G = (...t) => t.filter(Boolean).join(" ") || void 0, F = st({}), Dt = (t) => Object.fromEntries(
|
|
635
|
+
Object.entries(t ?? {}).filter(([e, o]) => e.startsWith("--facto-") && o !== void 0 && o !== null)
|
|
369
636
|
);
|
|
370
|
-
function
|
|
371
|
-
const i =
|
|
372
|
-
return /* @__PURE__ */ n(
|
|
637
|
+
function ue({ className: t, tokens: e, style: o, motion: a, ...c }) {
|
|
638
|
+
const i = B(F), r = { ...e, ...o }, u = { ...i, ...Dt(r) };
|
|
639
|
+
return /* @__PURE__ */ n(at, { motion: a, children: /* @__PURE__ */ n(F.Provider, { value: u, children: /* @__PURE__ */ n("div", { ...c, style: r, className: h("facto-theme", t) }) }) });
|
|
373
640
|
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...
|
|
641
|
+
function Y({ name: t, size: e = 20, ...o }) {
|
|
642
|
+
return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...o, children: {
|
|
376
643
|
plus: /* @__PURE__ */ n("path", { d: "M12 5v14M5 12h14" }),
|
|
377
644
|
chevronLeft: /* @__PURE__ */ n("path", { d: "m15 6-6 6 6 6" }),
|
|
378
|
-
copy: /* @__PURE__ */
|
|
645
|
+
copy: /* @__PURE__ */ _(J, { children: [
|
|
379
646
|
/* @__PURE__ */ n("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2" }),
|
|
380
647
|
/* @__PURE__ */ n("path", { d: "M16 8V4H4v12h4" })
|
|
381
648
|
] }),
|
|
382
|
-
search: /* @__PURE__ */
|
|
649
|
+
search: /* @__PURE__ */ _(J, { children: [
|
|
383
650
|
/* @__PURE__ */ n("circle", { cx: "10", cy: "10", r: "6" }),
|
|
384
651
|
/* @__PURE__ */ n("path", { d: "m15 15 5 5" })
|
|
385
652
|
] }),
|
|
@@ -388,88 +655,92 @@ function z({ name: t, size: e = 20, ...a }) {
|
|
|
388
655
|
check: /* @__PURE__ */ n("path", { d: "m5 12 4 4L19 6" }),
|
|
389
656
|
chevronDown: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }),
|
|
390
657
|
chevronRight: /* @__PURE__ */ n("path", { d: "m9 6 6 6-6 6" }),
|
|
391
|
-
info: /* @__PURE__ */
|
|
658
|
+
info: /* @__PURE__ */ _(J, { children: [
|
|
392
659
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
|
|
393
660
|
/* @__PURE__ */ n("path", { d: "M12 11v6M12 7v1" })
|
|
394
661
|
] }),
|
|
395
|
-
warning: /* @__PURE__ */
|
|
662
|
+
warning: /* @__PURE__ */ _(J, { children: [
|
|
396
663
|
/* @__PURE__ */ n("path", { d: "m12 3 10 18H2L12 3Z" }),
|
|
397
664
|
/* @__PURE__ */ n("path", { d: "M12 9v5M12 17v1" })
|
|
398
665
|
] })
|
|
399
666
|
}[t] });
|
|
400
667
|
}
|
|
401
|
-
function
|
|
402
|
-
return /* @__PURE__ */ n("div", { ...e, className:
|
|
668
|
+
function fe({ className: t, ...e }) {
|
|
669
|
+
return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-header", t) });
|
|
403
670
|
}
|
|
404
|
-
function
|
|
405
|
-
return /* @__PURE__ */ n("div", { ...e, className:
|
|
671
|
+
function me({ className: t, ...e }) {
|
|
672
|
+
return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-footer", t) });
|
|
406
673
|
}
|
|
407
|
-
const
|
|
674
|
+
const he = X(
|
|
408
675
|
function({
|
|
409
676
|
variant: e = "primary",
|
|
410
|
-
size:
|
|
411
|
-
fullWidth:
|
|
412
|
-
loading:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
677
|
+
size: o = "md",
|
|
678
|
+
fullWidth: a,
|
|
679
|
+
loading: c,
|
|
680
|
+
motion: i,
|
|
681
|
+
style: r,
|
|
682
|
+
leadingIcon: u,
|
|
683
|
+
trailingIcon: s,
|
|
684
|
+
className: f,
|
|
685
|
+
children: m,
|
|
686
|
+
disabled: p,
|
|
687
|
+
type: y = "button",
|
|
688
|
+
...w
|
|
689
|
+
}, C) {
|
|
690
|
+
const M = A(i);
|
|
691
|
+
return /* @__PURE__ */ _(
|
|
422
692
|
"button",
|
|
423
693
|
{
|
|
424
|
-
...
|
|
425
|
-
ref:
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
694
|
+
...w,
|
|
695
|
+
ref: C,
|
|
696
|
+
style: { ...r, ...M },
|
|
697
|
+
type: y,
|
|
698
|
+
disabled: p || c,
|
|
699
|
+
"aria-busy": c || void 0,
|
|
700
|
+
className: h(
|
|
430
701
|
"facto-button",
|
|
431
702
|
`facto-button--${e}`,
|
|
432
|
-
`facto-button--${
|
|
433
|
-
|
|
434
|
-
|
|
703
|
+
`facto-button--${o}`,
|
|
704
|
+
a && "facto-button--full",
|
|
705
|
+
f
|
|
435
706
|
),
|
|
436
707
|
children: [
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
|
|
439
|
-
/* @__PURE__ */ n("span", { children:
|
|
440
|
-
|
|
708
|
+
/* @__PURE__ */ _("span", { className: "facto-button__content", style: c ? { opacity: 0 } : void 0, children: [
|
|
709
|
+
u,
|
|
710
|
+
/* @__PURE__ */ n("span", { children: m }),
|
|
711
|
+
s
|
|
441
712
|
] }),
|
|
442
|
-
|
|
713
|
+
c && /* @__PURE__ */ n("span", { className: "facto-button__spinner", "aria-hidden": "true" })
|
|
443
714
|
]
|
|
444
715
|
}
|
|
445
716
|
);
|
|
446
717
|
}
|
|
447
|
-
),
|
|
448
|
-
function({ ariaLabel: e, size:
|
|
718
|
+
), pe = X(
|
|
719
|
+
function({ ariaLabel: e, size: o = "md", className: a, title: c, type: i = "button", children: r, ...u }, s) {
|
|
449
720
|
return /* @__PURE__ */ n(
|
|
450
721
|
"button",
|
|
451
722
|
{
|
|
452
|
-
...
|
|
453
|
-
ref:
|
|
454
|
-
type:
|
|
723
|
+
...u,
|
|
724
|
+
ref: s,
|
|
725
|
+
type: i,
|
|
455
726
|
"aria-label": e,
|
|
456
|
-
title:
|
|
457
|
-
className:
|
|
727
|
+
title: c ?? e,
|
|
728
|
+
className: h(
|
|
458
729
|
"facto-icon-button",
|
|
459
|
-
`facto-icon-button--${
|
|
460
|
-
|
|
730
|
+
`facto-icon-button--${o}`,
|
|
731
|
+
a
|
|
461
732
|
),
|
|
462
733
|
children: /* @__PURE__ */ n("span", { className: "facto-icon-button__visual", children: r })
|
|
463
734
|
}
|
|
464
735
|
);
|
|
465
736
|
}
|
|
466
737
|
);
|
|
467
|
-
function
|
|
738
|
+
function Nt({ padding: t = "lg", className: e, ...o }) {
|
|
468
739
|
return /* @__PURE__ */ n(
|
|
469
740
|
"div",
|
|
470
741
|
{
|
|
471
|
-
...
|
|
472
|
-
className:
|
|
742
|
+
...o,
|
|
743
|
+
className: h(
|
|
473
744
|
"facto-surface",
|
|
474
745
|
`facto-surface--padding-${t}`,
|
|
475
746
|
e
|
|
@@ -477,16 +748,16 @@ function rt({ padding: t = "lg", className: e, ...a }) {
|
|
|
477
748
|
}
|
|
478
749
|
);
|
|
479
750
|
}
|
|
480
|
-
function
|
|
481
|
-
return /* @__PURE__ */ n(
|
|
751
|
+
function ge(t) {
|
|
752
|
+
return /* @__PURE__ */ n(Nt, { ...t });
|
|
482
753
|
}
|
|
483
|
-
function
|
|
754
|
+
function ve({ span: t = 1, className: e, ...o }) {
|
|
484
755
|
return /* @__PURE__ */ n(
|
|
485
|
-
|
|
756
|
+
Nt,
|
|
486
757
|
{
|
|
487
|
-
...
|
|
758
|
+
...o,
|
|
488
759
|
padding: "md",
|
|
489
|
-
className:
|
|
760
|
+
className: h(
|
|
490
761
|
"facto-widget",
|
|
491
762
|
t === 2 && "facto-widget--span-2",
|
|
492
763
|
e
|
|
@@ -494,209 +765,210 @@ function Ut({ span: t = 1, className: e, ...a }) {
|
|
|
494
765
|
}
|
|
495
766
|
);
|
|
496
767
|
}
|
|
497
|
-
function
|
|
498
|
-
return /* @__PURE__ */ n("div", { ...
|
|
768
|
+
function be({ className: t, children: e, ...o }) {
|
|
769
|
+
return /* @__PURE__ */ n("div", { ...o, className: h("facto-dashboard-container", t), children: /* @__PURE__ */ n("div", { className: "facto-dashboard-grid", children: e }) });
|
|
499
770
|
}
|
|
500
|
-
function
|
|
771
|
+
function _e({ withAction: t, className: e, ...o }) {
|
|
501
772
|
return /* @__PURE__ */ n(
|
|
502
773
|
"div",
|
|
503
774
|
{
|
|
504
|
-
...
|
|
505
|
-
className:
|
|
775
|
+
...o,
|
|
776
|
+
className: h("facto-widget-head", t && "facto-widget-head--with-action", e)
|
|
506
777
|
}
|
|
507
778
|
);
|
|
508
779
|
}
|
|
509
|
-
function
|
|
510
|
-
return /* @__PURE__ */ n("div", { ...e, className:
|
|
780
|
+
function Ne({ className: t, ...e }) {
|
|
781
|
+
return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-list", t) });
|
|
511
782
|
}
|
|
512
|
-
function
|
|
513
|
-
return /* @__PURE__ */ n("div", { ...e, className:
|
|
783
|
+
function ye({ className: t, ...e }) {
|
|
784
|
+
return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-kv", t) });
|
|
514
785
|
}
|
|
515
|
-
function
|
|
516
|
-
return /* @__PURE__ */ n("div", { ...e, className:
|
|
786
|
+
function we({ className: t, ...e }) {
|
|
787
|
+
return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-amount", t) });
|
|
517
788
|
}
|
|
518
|
-
function
|
|
519
|
-
const e =
|
|
789
|
+
function ke(t) {
|
|
790
|
+
const e = h("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
|
|
520
791
|
if (typeof t.href == "string") {
|
|
521
|
-
const { dark: r, className:
|
|
522
|
-
return /* @__PURE__ */ n("a", { ...
|
|
792
|
+
const { dark: r, className: u, ...s } = t;
|
|
793
|
+
return /* @__PURE__ */ n("a", { ...s, className: e });
|
|
523
794
|
}
|
|
524
|
-
const { dark:
|
|
525
|
-
return /* @__PURE__ */ n("button", { ...
|
|
795
|
+
const { dark: o, className: a, type: c = "button", ...i } = t;
|
|
796
|
+
return /* @__PURE__ */ n("button", { ...i, type: c, className: e });
|
|
526
797
|
}
|
|
527
|
-
function
|
|
798
|
+
function Ce({
|
|
528
799
|
className: t,
|
|
529
800
|
type: e = "button",
|
|
530
|
-
...
|
|
801
|
+
...o
|
|
531
802
|
}) {
|
|
532
803
|
return /* @__PURE__ */ n(
|
|
533
804
|
"button",
|
|
534
805
|
{
|
|
535
|
-
...
|
|
806
|
+
...o,
|
|
536
807
|
type: e,
|
|
537
|
-
className:
|
|
808
|
+
className: h("facto-widget-row", t)
|
|
538
809
|
}
|
|
539
810
|
);
|
|
540
811
|
}
|
|
541
|
-
function
|
|
812
|
+
function Et({
|
|
542
813
|
label: t,
|
|
543
814
|
helperText: e,
|
|
544
|
-
error:
|
|
545
|
-
id:
|
|
546
|
-
containerClassName:
|
|
547
|
-
className:
|
|
815
|
+
error: o,
|
|
816
|
+
id: a,
|
|
817
|
+
containerClassName: c,
|
|
818
|
+
className: i,
|
|
548
819
|
...r
|
|
549
820
|
}) {
|
|
550
|
-
const
|
|
551
|
-
return /* @__PURE__ */
|
|
552
|
-
t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor:
|
|
821
|
+
const u = j(), s = a ?? u, f = o || e ? `${s}-description` : void 0;
|
|
822
|
+
return /* @__PURE__ */ _("div", { className: h("facto-field", c), children: [
|
|
823
|
+
t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: s, children: t }),
|
|
553
824
|
/* @__PURE__ */ n(
|
|
554
825
|
"input",
|
|
555
826
|
{
|
|
556
827
|
...r,
|
|
557
|
-
id:
|
|
558
|
-
"aria-invalid": !!
|
|
559
|
-
"aria-describedby":
|
|
560
|
-
className:
|
|
828
|
+
id: s,
|
|
829
|
+
"aria-invalid": !!o || r["aria-invalid"],
|
|
830
|
+
"aria-describedby": G(r["aria-describedby"], f),
|
|
831
|
+
className: h(
|
|
561
832
|
"facto-input",
|
|
562
|
-
!!
|
|
563
|
-
|
|
833
|
+
!!o && "facto-input--error",
|
|
834
|
+
i
|
|
564
835
|
)
|
|
565
836
|
}
|
|
566
837
|
),
|
|
567
|
-
(
|
|
838
|
+
(o || e) && /* @__PURE__ */ n(
|
|
568
839
|
"span",
|
|
569
840
|
{
|
|
570
|
-
id:
|
|
571
|
-
className:
|
|
841
|
+
id: f,
|
|
842
|
+
className: h(
|
|
572
843
|
"facto-field__message",
|
|
573
|
-
!!
|
|
844
|
+
!!o && "facto-field__message--error"
|
|
574
845
|
),
|
|
575
|
-
children:
|
|
846
|
+
children: o ?? e
|
|
576
847
|
}
|
|
577
848
|
)
|
|
578
849
|
] });
|
|
579
850
|
}
|
|
580
|
-
function
|
|
851
|
+
function Te({
|
|
581
852
|
label: t,
|
|
582
853
|
helperText: e,
|
|
583
|
-
error:
|
|
584
|
-
id:
|
|
585
|
-
containerClassName:
|
|
586
|
-
className:
|
|
854
|
+
error: o,
|
|
855
|
+
id: a,
|
|
856
|
+
containerClassName: c,
|
|
857
|
+
className: i,
|
|
587
858
|
...r
|
|
588
859
|
}) {
|
|
589
|
-
const
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor:
|
|
860
|
+
const u = j(), s = a ?? u, f = o || e ? `${s}-description` : void 0;
|
|
861
|
+
return /* @__PURE__ */ _("div", { className: h("facto-field", c), children: [
|
|
862
|
+
t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: s, children: t }),
|
|
592
863
|
/* @__PURE__ */ n(
|
|
593
864
|
"textarea",
|
|
594
865
|
{
|
|
595
866
|
...r,
|
|
596
|
-
id:
|
|
597
|
-
"aria-invalid": !!
|
|
598
|
-
"aria-describedby":
|
|
599
|
-
className:
|
|
867
|
+
id: s,
|
|
868
|
+
"aria-invalid": !!o || r["aria-invalid"],
|
|
869
|
+
"aria-describedby": G(r["aria-describedby"], f),
|
|
870
|
+
className: h(
|
|
600
871
|
"facto-textarea",
|
|
601
|
-
!!
|
|
602
|
-
|
|
872
|
+
!!o && "facto-input--error",
|
|
873
|
+
i
|
|
603
874
|
)
|
|
604
875
|
}
|
|
605
876
|
),
|
|
606
|
-
(
|
|
877
|
+
(o || e) && /* @__PURE__ */ n(
|
|
607
878
|
"span",
|
|
608
879
|
{
|
|
609
|
-
id:
|
|
610
|
-
className:
|
|
880
|
+
id: f,
|
|
881
|
+
className: h(
|
|
611
882
|
"facto-field__message",
|
|
612
|
-
!!
|
|
883
|
+
!!o && "facto-field__message--error"
|
|
613
884
|
),
|
|
614
|
-
children:
|
|
885
|
+
children: o ?? e
|
|
615
886
|
}
|
|
616
887
|
)
|
|
617
888
|
] });
|
|
618
889
|
}
|
|
619
|
-
function
|
|
890
|
+
function Me({ tone: t = "neutral", className: e, ...o }) {
|
|
620
891
|
return /* @__PURE__ */ n(
|
|
621
892
|
"span",
|
|
622
893
|
{
|
|
623
|
-
...
|
|
624
|
-
className:
|
|
894
|
+
...o,
|
|
895
|
+
className: h("facto-badge", `facto-badge--${t}`, e)
|
|
625
896
|
}
|
|
626
897
|
);
|
|
627
898
|
}
|
|
628
|
-
function
|
|
899
|
+
function Re({
|
|
629
900
|
options: t,
|
|
630
901
|
value: e,
|
|
631
|
-
defaultValue:
|
|
632
|
-
onValueChange:
|
|
633
|
-
placeholder:
|
|
634
|
-
label:
|
|
902
|
+
defaultValue: o,
|
|
903
|
+
onValueChange: a,
|
|
904
|
+
placeholder: c = "Select an option",
|
|
905
|
+
label: i,
|
|
635
906
|
error: r,
|
|
636
|
-
disabled:
|
|
637
|
-
|
|
638
|
-
|
|
907
|
+
disabled: u,
|
|
908
|
+
bordered: s = !1,
|
|
909
|
+
name: f,
|
|
910
|
+
id: m,
|
|
639
911
|
ariaLabel: p,
|
|
640
|
-
"aria-describedby":
|
|
912
|
+
"aria-describedby": y,
|
|
641
913
|
className: w
|
|
642
914
|
}) {
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
}, []),
|
|
646
|
-
(
|
|
647
|
-
|
|
915
|
+
const C = B(F), M = A(), v = j(), l = m ?? v, d = r ? `${l}-description` : void 0, b = T(null), g = z(() => {
|
|
916
|
+
b.current?.(), b.current = null;
|
|
917
|
+
}, []), N = z(
|
|
918
|
+
(k) => {
|
|
919
|
+
g(), k && (b.current = xt(k));
|
|
648
920
|
},
|
|
649
|
-
[
|
|
921
|
+
[g]
|
|
650
922
|
);
|
|
651
|
-
return
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
|
|
923
|
+
return E(() => g, [g]), /* @__PURE__ */ _("div", { className: h("facto-field", w), children: [
|
|
924
|
+
i && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: l, children: i }),
|
|
925
|
+
/* @__PURE__ */ _(
|
|
926
|
+
L.Root,
|
|
655
927
|
{
|
|
656
928
|
value: e,
|
|
657
|
-
defaultValue:
|
|
658
|
-
onValueChange:
|
|
659
|
-
disabled:
|
|
660
|
-
name:
|
|
929
|
+
defaultValue: o,
|
|
930
|
+
onValueChange: a,
|
|
931
|
+
disabled: u,
|
|
932
|
+
name: f,
|
|
661
933
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
|
|
934
|
+
/* @__PURE__ */ _(
|
|
935
|
+
L.Trigger,
|
|
664
936
|
{
|
|
665
|
-
id:
|
|
666
|
-
className:
|
|
937
|
+
id: l,
|
|
938
|
+
className: h("facto-select", s && "facto-select--bordered", !!r && "facto-input--error"),
|
|
667
939
|
"aria-label": p,
|
|
668
|
-
"aria-describedby":
|
|
940
|
+
"aria-describedby": G(y, d),
|
|
669
941
|
"aria-invalid": !!r,
|
|
670
942
|
children: [
|
|
671
|
-
/* @__PURE__ */ n(
|
|
672
|
-
/* @__PURE__ */ n(
|
|
943
|
+
/* @__PURE__ */ n(L.Value, { placeholder: c }),
|
|
944
|
+
/* @__PURE__ */ n(L.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ n(Y, { name: "chevronDown", size: 16 }) })
|
|
673
945
|
]
|
|
674
946
|
}
|
|
675
947
|
),
|
|
676
|
-
/* @__PURE__ */ n(
|
|
677
|
-
|
|
948
|
+
/* @__PURE__ */ n(L.Portal, { children: /* @__PURE__ */ n(
|
|
949
|
+
L.Content,
|
|
678
950
|
{
|
|
679
|
-
ref:
|
|
951
|
+
ref: N,
|
|
680
952
|
className: "facto-theme facto-select-content",
|
|
681
|
-
style:
|
|
953
|
+
style: { ...C, ...M },
|
|
682
954
|
position: "popper",
|
|
683
955
|
side: "bottom",
|
|
684
956
|
align: "start",
|
|
685
957
|
sideOffset: 8,
|
|
686
958
|
collisionPadding: 16,
|
|
687
|
-
onCloseAutoFocus:
|
|
688
|
-
children: /* @__PURE__ */ n(
|
|
689
|
-
|
|
959
|
+
onCloseAutoFocus: g,
|
|
960
|
+
children: /* @__PURE__ */ n(L.Viewport, { children: t.map((k) => /* @__PURE__ */ _(
|
|
961
|
+
L.Item,
|
|
690
962
|
{
|
|
691
|
-
value:
|
|
692
|
-
disabled:
|
|
963
|
+
value: k.value,
|
|
964
|
+
disabled: k.disabled,
|
|
693
965
|
className: "facto-select-item",
|
|
694
966
|
children: [
|
|
695
|
-
/* @__PURE__ */ n(
|
|
696
|
-
/* @__PURE__ */ n(
|
|
967
|
+
/* @__PURE__ */ n(L.ItemText, { children: k.label }),
|
|
968
|
+
/* @__PURE__ */ n(L.ItemIndicator, { children: /* @__PURE__ */ n(Y, { name: "check", size: 16 }) })
|
|
697
969
|
]
|
|
698
970
|
},
|
|
699
|
-
|
|
971
|
+
k.value
|
|
700
972
|
)) })
|
|
701
973
|
}
|
|
702
974
|
) })
|
|
@@ -706,143 +978,145 @@ function oe({
|
|
|
706
978
|
r && /* @__PURE__ */ n(
|
|
707
979
|
"span",
|
|
708
980
|
{
|
|
709
|
-
id:
|
|
981
|
+
id: d,
|
|
710
982
|
className: "facto-field__message facto-field__message--error",
|
|
711
983
|
children: r
|
|
712
984
|
}
|
|
713
985
|
)
|
|
714
986
|
] });
|
|
715
987
|
}
|
|
716
|
-
function
|
|
988
|
+
function $e({
|
|
717
989
|
label: t,
|
|
718
990
|
description: e,
|
|
719
|
-
className:
|
|
720
|
-
id:
|
|
721
|
-
...
|
|
991
|
+
className: o,
|
|
992
|
+
id: a,
|
|
993
|
+
...c
|
|
722
994
|
}) {
|
|
723
|
-
const
|
|
724
|
-
|
|
995
|
+
const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
|
|
996
|
+
dt.Root,
|
|
725
997
|
{
|
|
726
|
-
...
|
|
998
|
+
...c,
|
|
727
999
|
id: r,
|
|
728
|
-
"aria-describedby":
|
|
729
|
-
className:
|
|
730
|
-
children: /* @__PURE__ */ n("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1000
|
+
"aria-describedby": G(c["aria-describedby"], u),
|
|
1001
|
+
className: h("facto-switch", o),
|
|
1002
|
+
children: /* @__PURE__ */ n("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ n(dt.Thumb, { className: "facto-switch__thumb" }) })
|
|
731
1003
|
}
|
|
732
1004
|
);
|
|
733
|
-
return t ? /* @__PURE__ */
|
|
734
|
-
|
|
735
|
-
/* @__PURE__ */
|
|
1005
|
+
return t ? /* @__PURE__ */ _("div", { className: "facto-check-field", children: [
|
|
1006
|
+
s,
|
|
1007
|
+
/* @__PURE__ */ _("span", { children: [
|
|
736
1008
|
/* @__PURE__ */ n("label", { htmlFor: r, children: /* @__PURE__ */ n("strong", { children: t }) }),
|
|
737
|
-
e && /* @__PURE__ */ n("small", { id:
|
|
1009
|
+
e && /* @__PURE__ */ n("small", { id: u, children: e })
|
|
738
1010
|
] })
|
|
739
|
-
] }) :
|
|
1011
|
+
] }) : s;
|
|
740
1012
|
}
|
|
741
|
-
function
|
|
1013
|
+
function Se({
|
|
742
1014
|
label: t,
|
|
743
1015
|
description: e,
|
|
744
|
-
className:
|
|
745
|
-
id:
|
|
746
|
-
...
|
|
1016
|
+
className: o,
|
|
1017
|
+
id: a,
|
|
1018
|
+
...c
|
|
747
1019
|
}) {
|
|
748
|
-
const
|
|
749
|
-
|
|
1020
|
+
const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
|
|
1021
|
+
lt.Root,
|
|
750
1022
|
{
|
|
751
|
-
...
|
|
1023
|
+
...c,
|
|
752
1024
|
id: r,
|
|
753
|
-
"aria-describedby":
|
|
754
|
-
className:
|
|
755
|
-
children: /* @__PURE__ */ n("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1025
|
+
"aria-describedby": G(c["aria-describedby"], u),
|
|
1026
|
+
className: h("facto-checkbox", o),
|
|
1027
|
+
children: /* @__PURE__ */ n("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ n(lt.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ n(Y, { name: "check", size: 16 }) }) })
|
|
756
1028
|
}
|
|
757
1029
|
);
|
|
758
|
-
return t ? /* @__PURE__ */
|
|
759
|
-
|
|
760
|
-
/* @__PURE__ */
|
|
1030
|
+
return t ? /* @__PURE__ */ _("div", { className: "facto-check-field", children: [
|
|
1031
|
+
s,
|
|
1032
|
+
/* @__PURE__ */ _("span", { children: [
|
|
761
1033
|
/* @__PURE__ */ n("label", { htmlFor: r, children: /* @__PURE__ */ n("strong", { children: t }) }),
|
|
762
|
-
e && /* @__PURE__ */ n("small", { id:
|
|
1034
|
+
e && /* @__PURE__ */ n("small", { id: u, children: e })
|
|
763
1035
|
] })
|
|
764
|
-
] }) :
|
|
1036
|
+
] }) : s;
|
|
765
1037
|
}
|
|
766
|
-
const
|
|
767
|
-
function
|
|
1038
|
+
const xe = ot.Root;
|
|
1039
|
+
function Be({
|
|
768
1040
|
className: t,
|
|
769
1041
|
...e
|
|
770
1042
|
}) {
|
|
771
1043
|
return /* @__PURE__ */ n(
|
|
772
|
-
|
|
1044
|
+
ot.List,
|
|
773
1045
|
{
|
|
774
1046
|
...e,
|
|
775
|
-
className:
|
|
1047
|
+
className: h("facto-tabs-list", t)
|
|
776
1048
|
}
|
|
777
1049
|
);
|
|
778
1050
|
}
|
|
779
|
-
function
|
|
1051
|
+
function Ie({
|
|
780
1052
|
className: t,
|
|
781
1053
|
...e
|
|
782
1054
|
}) {
|
|
783
1055
|
return /* @__PURE__ */ n(
|
|
784
|
-
|
|
1056
|
+
ot.Trigger,
|
|
785
1057
|
{
|
|
786
1058
|
...e,
|
|
787
|
-
className:
|
|
1059
|
+
className: h("facto-tabs-trigger", t)
|
|
788
1060
|
}
|
|
789
1061
|
);
|
|
790
1062
|
}
|
|
791
|
-
function
|
|
1063
|
+
function Pe({
|
|
792
1064
|
className: t,
|
|
793
1065
|
...e
|
|
794
1066
|
}) {
|
|
795
1067
|
return /* @__PURE__ */ n(
|
|
796
|
-
|
|
1068
|
+
ot.Content,
|
|
797
1069
|
{
|
|
798
1070
|
...e,
|
|
799
|
-
className:
|
|
1071
|
+
className: h("facto-tabs-content", t)
|
|
800
1072
|
}
|
|
801
1073
|
);
|
|
802
1074
|
}
|
|
803
|
-
const
|
|
804
|
-
function({ className: e, children:
|
|
805
|
-
const r =
|
|
806
|
-
if (r.current =
|
|
807
|
-
const
|
|
808
|
-
if (typeof
|
|
1075
|
+
const Le = x.Root, De = x.Trigger, Ee = x.Close, Ft = X(
|
|
1076
|
+
function({ className: e, children: o, tabIndex: a, ...c }, i) {
|
|
1077
|
+
const r = T(null), [u, s] = H(!1), f = z((m) => {
|
|
1078
|
+
if (r.current = m, typeof i == "function") {
|
|
1079
|
+
const p = i(m);
|
|
1080
|
+
if (typeof p == "function")
|
|
809
1081
|
return () => {
|
|
810
|
-
r.current ===
|
|
1082
|
+
r.current === m && (r.current = null), p();
|
|
811
1083
|
};
|
|
812
|
-
} else
|
|
813
|
-
}, [
|
|
814
|
-
return
|
|
815
|
-
const
|
|
816
|
-
if (!
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
|
|
1084
|
+
} else i && (i.current = m);
|
|
1085
|
+
}, [i]);
|
|
1086
|
+
return E(() => {
|
|
1087
|
+
const m = r.current;
|
|
1088
|
+
if (!m) return;
|
|
1089
|
+
const p = () => s(m.scrollHeight > m.clientHeight + 1);
|
|
1090
|
+
p();
|
|
1091
|
+
const y = new ResizeObserver(p), w = new MutationObserver(p);
|
|
1092
|
+
return y.observe(m), w.observe(m, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
1093
|
+
y.disconnect(), w.disconnect();
|
|
822
1094
|
};
|
|
823
|
-
}, [
|
|
1095
|
+
}, [o]), /* @__PURE__ */ n(x.Title, { ...c, ref: f, tabIndex: u ? a ?? 0 : a, className: h("facto-modal-title", e), children: o });
|
|
824
1096
|
}
|
|
825
|
-
),
|
|
826
|
-
return /* @__PURE__ */ n(
|
|
1097
|
+
), At = X(function({ className: e, ...o }, a) {
|
|
1098
|
+
return /* @__PURE__ */ n(x.Description, { ...o, ref: a, className: h("facto-modal-description", e) });
|
|
827
1099
|
});
|
|
828
|
-
function
|
|
1100
|
+
function Fe({
|
|
829
1101
|
size: t = "sm",
|
|
830
1102
|
motionVariant: e = "auto",
|
|
1103
|
+
motion: o,
|
|
831
1104
|
className: a,
|
|
832
|
-
style:
|
|
1105
|
+
style: c,
|
|
833
1106
|
children: i,
|
|
834
|
-
...
|
|
1107
|
+
...r
|
|
835
1108
|
}) {
|
|
836
|
-
const
|
|
837
|
-
return /* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */ n(
|
|
1109
|
+
const u = B(F), s = A(o), f = bt();
|
|
1110
|
+
return /* @__PURE__ */ n(at, { motion: o, children: /* @__PURE__ */ _(x.Portal, { children: [
|
|
1111
|
+
/* @__PURE__ */ n(x.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: { ...u, ...s } }),
|
|
839
1112
|
/* @__PURE__ */ n(
|
|
840
|
-
|
|
1113
|
+
x.Content,
|
|
841
1114
|
{
|
|
842
|
-
...
|
|
1115
|
+
...r,
|
|
1116
|
+
ref: f,
|
|
843
1117
|
"data-motion": e,
|
|
844
|
-
style: { ...
|
|
845
|
-
className:
|
|
1118
|
+
style: { ...u, ...c, ...s },
|
|
1119
|
+
className: h(
|
|
846
1120
|
"facto-theme",
|
|
847
1121
|
"facto-dialog",
|
|
848
1122
|
`facto-dialog--${t}`,
|
|
@@ -851,27 +1125,29 @@ function he({
|
|
|
851
1125
|
children: i
|
|
852
1126
|
}
|
|
853
1127
|
)
|
|
854
|
-
] });
|
|
1128
|
+
] }) });
|
|
855
1129
|
}
|
|
856
|
-
const
|
|
857
|
-
function
|
|
1130
|
+
const Ae = x.Root, ze = x.Trigger, Oe = x.Close, He = Ft, je = At;
|
|
1131
|
+
function We({
|
|
858
1132
|
side: t = "center",
|
|
859
1133
|
motionVariant: e = "auto",
|
|
1134
|
+
motion: o,
|
|
860
1135
|
className: a,
|
|
861
|
-
style:
|
|
1136
|
+
style: c,
|
|
862
1137
|
children: i,
|
|
863
|
-
...
|
|
1138
|
+
...r
|
|
864
1139
|
}) {
|
|
865
|
-
const
|
|
866
|
-
return /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */ n(
|
|
1140
|
+
const u = B(F), s = A(o), f = bt();
|
|
1141
|
+
return /* @__PURE__ */ n(at, { motion: o, children: /* @__PURE__ */ _(x.Portal, { children: [
|
|
1142
|
+
/* @__PURE__ */ n(x.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: { ...u, ...s } }),
|
|
868
1143
|
/* @__PURE__ */ n(
|
|
869
|
-
|
|
1144
|
+
x.Content,
|
|
870
1145
|
{
|
|
871
|
-
...
|
|
1146
|
+
...r,
|
|
1147
|
+
ref: f,
|
|
872
1148
|
"data-motion": e,
|
|
873
|
-
style: { ...
|
|
874
|
-
className:
|
|
1149
|
+
style: { ...u, ...c, ...s },
|
|
1150
|
+
className: h(
|
|
875
1151
|
"facto-theme",
|
|
876
1152
|
"facto-sheet",
|
|
877
1153
|
`facto-sheet--${t}`,
|
|
@@ -880,300 +1156,309 @@ function be({
|
|
|
880
1156
|
children: i
|
|
881
1157
|
}
|
|
882
1158
|
)
|
|
883
|
-
] });
|
|
1159
|
+
] }) });
|
|
884
1160
|
}
|
|
885
|
-
function
|
|
1161
|
+
function mt({
|
|
886
1162
|
width: t,
|
|
887
1163
|
height: e,
|
|
888
|
-
circle:
|
|
889
|
-
className:
|
|
890
|
-
style:
|
|
891
|
-
...
|
|
1164
|
+
circle: o,
|
|
1165
|
+
className: a,
|
|
1166
|
+
style: c,
|
|
1167
|
+
...i
|
|
892
1168
|
}) {
|
|
893
1169
|
return /* @__PURE__ */ n(
|
|
894
1170
|
"span",
|
|
895
1171
|
{
|
|
896
|
-
...
|
|
1172
|
+
...i,
|
|
897
1173
|
"aria-hidden": "true",
|
|
898
|
-
className:
|
|
1174
|
+
className: h(
|
|
899
1175
|
"facto-skeleton",
|
|
900
|
-
|
|
901
|
-
|
|
1176
|
+
o && "facto-skeleton--circle",
|
|
1177
|
+
a
|
|
902
1178
|
),
|
|
903
|
-
style: { ...
|
|
1179
|
+
style: { ...c, width: t, height: e }
|
|
904
1180
|
}
|
|
905
1181
|
);
|
|
906
1182
|
}
|
|
907
|
-
function
|
|
1183
|
+
function Ve({
|
|
908
1184
|
title: t,
|
|
909
1185
|
description: e,
|
|
910
|
-
action:
|
|
911
|
-
icon:
|
|
912
|
-
className:
|
|
913
|
-
...
|
|
1186
|
+
action: o,
|
|
1187
|
+
icon: a,
|
|
1188
|
+
className: c,
|
|
1189
|
+
...i
|
|
914
1190
|
}) {
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
|
|
1191
|
+
return /* @__PURE__ */ _("div", { ...i, className: h("facto-empty-state", c), children: [
|
|
1192
|
+
a && /* @__PURE__ */ n("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: a }),
|
|
917
1193
|
/* @__PURE__ */ n("strong", { children: t }),
|
|
918
1194
|
e && /* @__PURE__ */ n("p", { children: e }),
|
|
919
|
-
|
|
1195
|
+
o && /* @__PURE__ */ n("div", { children: o })
|
|
920
1196
|
] });
|
|
921
1197
|
}
|
|
922
|
-
function
|
|
1198
|
+
function qe({
|
|
923
1199
|
tone: t = "info",
|
|
924
1200
|
title: e,
|
|
925
|
-
description:
|
|
926
|
-
action:
|
|
927
|
-
className:
|
|
928
|
-
...
|
|
1201
|
+
description: o,
|
|
1202
|
+
action: a,
|
|
1203
|
+
className: c,
|
|
1204
|
+
...i
|
|
929
1205
|
}) {
|
|
930
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ _(
|
|
931
1207
|
"div",
|
|
932
1208
|
{
|
|
933
|
-
...
|
|
1209
|
+
...i,
|
|
934
1210
|
role: t === "danger" ? "alert" : "status",
|
|
935
|
-
className:
|
|
1211
|
+
className: h("facto-notice", `facto-notice--${t}`, c),
|
|
936
1212
|
children: [
|
|
937
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ _("div", { children: [
|
|
938
1214
|
/* @__PURE__ */ n("strong", { children: e }),
|
|
939
|
-
|
|
1215
|
+
o && /* @__PURE__ */ n("span", { children: o })
|
|
940
1216
|
] }),
|
|
941
|
-
|
|
1217
|
+
a
|
|
942
1218
|
]
|
|
943
1219
|
}
|
|
944
1220
|
);
|
|
945
1221
|
}
|
|
946
|
-
function
|
|
1222
|
+
function Ke({
|
|
947
1223
|
gap: t = 3,
|
|
948
1224
|
direction: e = "vertical",
|
|
949
|
-
align:
|
|
950
|
-
justify:
|
|
951
|
-
className:
|
|
952
|
-
...
|
|
1225
|
+
align: o = "stretch",
|
|
1226
|
+
justify: a = "start",
|
|
1227
|
+
className: c,
|
|
1228
|
+
...i
|
|
953
1229
|
}) {
|
|
954
1230
|
return /* @__PURE__ */ n(
|
|
955
1231
|
"div",
|
|
956
1232
|
{
|
|
957
|
-
...
|
|
958
|
-
className:
|
|
1233
|
+
...i,
|
|
1234
|
+
className: h(
|
|
959
1235
|
"facto-stack",
|
|
960
1236
|
`facto-stack--${e}`,
|
|
961
1237
|
`facto-stack--gap-${t}`,
|
|
962
|
-
`facto-stack--align-${
|
|
963
|
-
`facto-stack--justify-${
|
|
964
|
-
|
|
1238
|
+
`facto-stack--align-${o}`,
|
|
1239
|
+
`facto-stack--justify-${a}`,
|
|
1240
|
+
c
|
|
965
1241
|
)
|
|
966
1242
|
}
|
|
967
1243
|
);
|
|
968
1244
|
}
|
|
969
|
-
function
|
|
970
|
-
return /* @__PURE__ */ n(
|
|
1245
|
+
function Ye({ delayDuration: t = 300, ...e }) {
|
|
1246
|
+
return /* @__PURE__ */ n(Q.Provider, { ...e, delayDuration: t });
|
|
971
1247
|
}
|
|
972
|
-
const
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
return /* @__PURE__ */ n(
|
|
976
|
-
|
|
1248
|
+
const Ge = Q.Root, Je = Q.Trigger;
|
|
1249
|
+
function Ue({ variant: t = "default", className: e, style: o, sideOffset: a = 6, collisionPadding: c = 16, children: i, ...r }) {
|
|
1250
|
+
const u = B(F), s = A();
|
|
1251
|
+
return /* @__PURE__ */ n(Q.Portal, { children: /* @__PURE__ */ n(
|
|
1252
|
+
Q.Content,
|
|
977
1253
|
{
|
|
978
1254
|
...r,
|
|
979
|
-
sideOffset:
|
|
980
|
-
collisionPadding:
|
|
981
|
-
className:
|
|
982
|
-
style: { ...
|
|
983
|
-
children:
|
|
1255
|
+
sideOffset: a,
|
|
1256
|
+
collisionPadding: c,
|
|
1257
|
+
className: h("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
|
|
1258
|
+
style: { ...u, ...o, ...s },
|
|
1259
|
+
children: i
|
|
984
1260
|
}
|
|
985
1261
|
) });
|
|
986
1262
|
}
|
|
987
|
-
function
|
|
988
|
-
return /* @__PURE__ */ n(
|
|
1263
|
+
function zt({ duration: t = 2600, ...e }) {
|
|
1264
|
+
return /* @__PURE__ */ n(V.Provider, { ...e, duration: t });
|
|
989
1265
|
}
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */ n("span", { className: "facto-toast__icon", "aria-hidden": "true", children: e ?? /* @__PURE__ */ n(
|
|
1266
|
+
function Ot({ tone: t = "success", icon: e, className: o, style: a, motion: c, children: i, ...r }) {
|
|
1267
|
+
const u = B(F), s = A(c);
|
|
1268
|
+
return /* @__PURE__ */ n(at, { motion: c, children: /* @__PURE__ */ _(V.Root, { ...r, className: h("facto-theme", "facto-toast", `facto-toast--${t}`, o), style: { ...u, ...a, ...s }, children: [
|
|
1269
|
+
/* @__PURE__ */ n("span", { className: "facto-toast__icon", "aria-hidden": "true", children: e ?? /* @__PURE__ */ n(Y, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
|
|
994
1270
|
/* @__PURE__ */ n("div", { className: "facto-toast__copy", children: i })
|
|
995
|
-
] });
|
|
1271
|
+
] }) });
|
|
996
1272
|
}
|
|
997
|
-
function
|
|
998
|
-
return /* @__PURE__ */ n(
|
|
1273
|
+
function Ht({ className: t, ...e }) {
|
|
1274
|
+
return /* @__PURE__ */ n(V.Title, { ...e, className: h("facto-toast__title", t) });
|
|
999
1275
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return /* @__PURE__ */ n(
|
|
1276
|
+
function ht({ className: t, ...e }) {
|
|
1277
|
+
return /* @__PURE__ */ n(V.Description, { ...e, className: h("facto-toast__description", t) });
|
|
1002
1278
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return /* @__PURE__ */ n(
|
|
1279
|
+
function jt({ className: t, ...e }) {
|
|
1280
|
+
return /* @__PURE__ */ n(V.Action, { ...e, className: h("facto-button", "facto-button--secondary", "facto-button--sm", t) });
|
|
1005
1281
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return /* @__PURE__ */ n(
|
|
1282
|
+
function Wt({ className: t, children: e = /* @__PURE__ */ n(Y, { name: "close" }), "aria-label": o = "Dismiss notification", ...a }) {
|
|
1283
|
+
return /* @__PURE__ */ n(V.Close, { ...a, "aria-label": o, className: h("facto-toast__close", t), children: e });
|
|
1008
1284
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const
|
|
1011
|
-
return
|
|
1285
|
+
function Vt({ className: t, style: e, ...o }) {
|
|
1286
|
+
const a = B(F), c = A(), [i, r] = H(!1);
|
|
1287
|
+
return E(() => r(!0), []), i ? yt(/* @__PURE__ */ n(V.Viewport, { ...o, className: h("facto-toast-viewport", t), style: { ...a, ...e, ...c } }), document.body) : null;
|
|
1012
1288
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1017
|
-
if (!
|
|
1018
|
-
const
|
|
1289
|
+
function Ze({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: a = "Clear search", label: c = "Search", helperText: i, error: r, id: u, containerClassName: s, className: f, disabled: m, readOnly: p, ...y }) {
|
|
1290
|
+
const w = j(), C = u ?? w, M = r || i ? `${C}-description` : void 0, [v, l] = H(e), d = t ?? v, b = T(null);
|
|
1291
|
+
E(() => {
|
|
1292
|
+
const N = b.current?.form;
|
|
1293
|
+
if (!N || t !== void 0) return;
|
|
1294
|
+
const k = (R) => {
|
|
1019
1295
|
queueMicrotask(() => {
|
|
1020
|
-
|
|
1296
|
+
R.defaultPrevented || (l(e), o?.(e));
|
|
1021
1297
|
});
|
|
1022
1298
|
};
|
|
1023
|
-
return
|
|
1024
|
-
}, [e, t,
|
|
1025
|
-
const
|
|
1026
|
-
t === void 0 &&
|
|
1299
|
+
return N.addEventListener("reset", k), () => N.removeEventListener("reset", k);
|
|
1300
|
+
}, [e, t, o]);
|
|
1301
|
+
const g = (N) => {
|
|
1302
|
+
t === void 0 && l(N), o?.(N);
|
|
1027
1303
|
};
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ _("div", { className: h("facto-field", s), children: [
|
|
1305
|
+
c && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: C, children: c }),
|
|
1306
|
+
/* @__PURE__ */ _("div", { className: "facto-search", children: [
|
|
1307
|
+
/* @__PURE__ */ _("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: [
|
|
1032
1308
|
/* @__PURE__ */ n("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
|
|
1033
1309
|
/* @__PURE__ */ n("path", { d: "m16 16 5 5" })
|
|
1034
1310
|
] }),
|
|
1035
1311
|
/* @__PURE__ */ n(
|
|
1036
1312
|
"input",
|
|
1037
1313
|
{
|
|
1038
|
-
...
|
|
1314
|
+
...y,
|
|
1039
1315
|
ref: b,
|
|
1040
|
-
id:
|
|
1316
|
+
id: C,
|
|
1041
1317
|
type: "search",
|
|
1042
|
-
disabled:
|
|
1043
|
-
readOnly:
|
|
1044
|
-
value:
|
|
1045
|
-
onChange: (
|
|
1046
|
-
"aria-invalid": !!r ||
|
|
1047
|
-
"aria-describedby":
|
|
1048
|
-
className:
|
|
1318
|
+
disabled: m,
|
|
1319
|
+
readOnly: p,
|
|
1320
|
+
value: d,
|
|
1321
|
+
onChange: (N) => g(N.target.value),
|
|
1322
|
+
"aria-invalid": !!r || y["aria-invalid"],
|
|
1323
|
+
"aria-describedby": G(y["aria-describedby"], M),
|
|
1324
|
+
className: h("facto-input", "facto-search__input", !!r && "facto-input--error", f)
|
|
1049
1325
|
}
|
|
1050
1326
|
),
|
|
1051
|
-
|
|
1327
|
+
d && !p && /* @__PURE__ */ n(
|
|
1052
1328
|
"button",
|
|
1053
1329
|
{
|
|
1054
1330
|
type: "button",
|
|
1055
1331
|
className: "facto-search__clear",
|
|
1056
|
-
disabled:
|
|
1057
|
-
"aria-label":
|
|
1332
|
+
disabled: m,
|
|
1333
|
+
"aria-label": a,
|
|
1058
1334
|
onClick: () => {
|
|
1059
|
-
|
|
1335
|
+
g(""), b.current?.focus();
|
|
1060
1336
|
},
|
|
1061
|
-
children: /* @__PURE__ */ n(
|
|
1337
|
+
children: /* @__PURE__ */ n(Y, { name: "close", size: 16 })
|
|
1062
1338
|
}
|
|
1063
1339
|
)
|
|
1064
1340
|
] }),
|
|
1065
|
-
(r ||
|
|
1341
|
+
(r || i) && /* @__PURE__ */ n("span", { id: M, className: h("facto-field__message", !!r && "facto-field__message--error"), children: r ?? i })
|
|
1066
1342
|
] });
|
|
1067
1343
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return /* @__PURE__ */ n(
|
|
1344
|
+
function Qe({ className: t, ...e }) {
|
|
1345
|
+
return /* @__PURE__ */ n(Et, { ...e, type: "search", className: h("facto-search-field", t) });
|
|
1070
1346
|
}
|
|
1071
|
-
const
|
|
1072
|
-
function
|
|
1073
|
-
const
|
|
1074
|
-
return /* @__PURE__ */ n(
|
|
1347
|
+
const Xe = Z.Root, tn = Z.Trigger, en = Z.Close;
|
|
1348
|
+
function nn({ className: t, style: e, sideOffset: o = 8, collisionPadding: a = 16, ...c }) {
|
|
1349
|
+
const i = B(F), r = A();
|
|
1350
|
+
return /* @__PURE__ */ n(Z.Portal, { children: /* @__PURE__ */ n(Z.Content, { ...c, sideOffset: o, collisionPadding: a, className: h("facto-theme", "facto-popover", t), style: { ...i, ...e, ...r } }) });
|
|
1075
1351
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return /* @__PURE__ */ n(
|
|
1352
|
+
function on({ modal: t = !1, ...e }) {
|
|
1353
|
+
return /* @__PURE__ */ n(K.Root, { ...e, modal: t });
|
|
1078
1354
|
}
|
|
1079
|
-
const
|
|
1080
|
-
function
|
|
1081
|
-
const
|
|
1082
|
-
return /* @__PURE__ */ n(
|
|
1355
|
+
const an = K.Trigger;
|
|
1356
|
+
function rn({ className: t, style: e, sideOffset: o = 8, collisionPadding: a = 16, ...c }) {
|
|
1357
|
+
const i = B(F), r = A();
|
|
1358
|
+
return /* @__PURE__ */ n(K.Portal, { children: /* @__PURE__ */ n(K.Content, { ...c, sideOffset: o, collisionPadding: a, className: h("facto-theme", "facto-menu", t), style: { ...i, ...e, ...r } }) });
|
|
1083
1359
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return /* @__PURE__ */ n(
|
|
1360
|
+
function cn({ className: t, ...e }) {
|
|
1361
|
+
return /* @__PURE__ */ n(K.Item, { ...e, className: h("facto-menu-item", t) });
|
|
1086
1362
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return /* @__PURE__ */ n(
|
|
1363
|
+
function sn({ className: t, ...e }) {
|
|
1364
|
+
return /* @__PURE__ */ n(K.Separator, { ...e, className: h("facto-menu-separator", t) });
|
|
1089
1365
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return /* @__PURE__ */ n("button", { ...
|
|
1366
|
+
function ln({ selected: t = !1, className: e, type: o = "button", ...a }) {
|
|
1367
|
+
return /* @__PURE__ */ n("button", { ...a, type: o, "aria-pressed": t, className: h("facto-filter-chip", e) });
|
|
1092
1368
|
}
|
|
1093
|
-
function
|
|
1094
|
-
const
|
|
1095
|
-
return /* @__PURE__ */ n("div", { ...
|
|
1096
|
-
/* @__PURE__ */ n(
|
|
1097
|
-
/* @__PURE__ */ n(
|
|
1369
|
+
function dn({ rows: t = 3, label: e = "Loading", className: o, ...a }) {
|
|
1370
|
+
const c = Number.isFinite(t) ? Math.min(20, Math.max(1, Math.floor(t))) : 3;
|
|
1371
|
+
return /* @__PURE__ */ n("div", { ...a, className: h("facto-list-skeleton", o), role: "status", "aria-label": e, children: Array.from({ length: c }, (i, r) => /* @__PURE__ */ _("div", { "aria-hidden": "true", className: "facto-list-skeleton__row", children: [
|
|
1372
|
+
/* @__PURE__ */ n(mt, { style: { width: 32, height: 32 } }),
|
|
1373
|
+
/* @__PURE__ */ n(mt, { style: { width: "60%", height: 16 } })
|
|
1098
1374
|
] }, r)) });
|
|
1099
1375
|
}
|
|
1100
1376
|
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
|
-
Nt as
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1377
|
+
Jt as AnimatedDisclosure,
|
|
1378
|
+
Ut as AnimatedFeedback,
|
|
1379
|
+
Bt as Avatar,
|
|
1380
|
+
Me as Badge,
|
|
1381
|
+
he as Button,
|
|
1382
|
+
ge as Card,
|
|
1383
|
+
Se as Checkbox,
|
|
1384
|
+
Zt as ContentReveal,
|
|
1385
|
+
be as DashboardGrid,
|
|
1386
|
+
Le as Dialog,
|
|
1387
|
+
Ee as DialogClose,
|
|
1388
|
+
Fe as DialogContent,
|
|
1389
|
+
At as DialogDescription,
|
|
1390
|
+
Ft as DialogTitle,
|
|
1391
|
+
De as DialogTrigger,
|
|
1392
|
+
on as DropdownMenu,
|
|
1393
|
+
rn as DropdownMenuContent,
|
|
1394
|
+
cn as DropdownMenuItem,
|
|
1395
|
+
sn as DropdownMenuSeparator,
|
|
1396
|
+
an as DropdownMenuTrigger,
|
|
1397
|
+
Ve as EmptyState,
|
|
1398
|
+
Ze as EnhancedSearchField,
|
|
1399
|
+
oe as ErrorState,
|
|
1400
|
+
at as FactoMotionProvider,
|
|
1401
|
+
ue as FactoTheme,
|
|
1402
|
+
ie as Field,
|
|
1403
|
+
ln as FilterChip,
|
|
1404
|
+
Y as Icon,
|
|
1405
|
+
pe as IconButton,
|
|
1406
|
+
ee as ListGroup,
|
|
1407
|
+
te as ListRow,
|
|
1408
|
+
dn as ListSkeleton,
|
|
1409
|
+
ae as LoadingMore,
|
|
1410
|
+
ne as LogoStack,
|
|
1411
|
+
me as ModalFooter,
|
|
1412
|
+
fe as ModalHeader,
|
|
1413
|
+
qe as Notice,
|
|
1414
|
+
le as NotificationsProvider,
|
|
1415
|
+
ce as OtpInput,
|
|
1416
|
+
Xe as Popover,
|
|
1417
|
+
en as PopoverClose,
|
|
1418
|
+
nn as PopoverContent,
|
|
1419
|
+
tn as PopoverTrigger,
|
|
1420
|
+
se as ResendCodeButton,
|
|
1421
|
+
Qe as SearchField,
|
|
1422
|
+
Re as Select,
|
|
1423
|
+
Xt as SelectionMotion,
|
|
1424
|
+
Ae as Sheet,
|
|
1425
|
+
Oe as SheetClose,
|
|
1426
|
+
We as SheetContent,
|
|
1427
|
+
je as SheetDescription,
|
|
1428
|
+
He as SheetTitle,
|
|
1429
|
+
ze as SheetTrigger,
|
|
1430
|
+
mt as Skeleton,
|
|
1431
|
+
Ke as Stack,
|
|
1432
|
+
re as StepChecklist,
|
|
1433
|
+
Gt as StepTransition,
|
|
1434
|
+
Nt as Surface,
|
|
1435
|
+
$e as Switch,
|
|
1436
|
+
xe as Tabs,
|
|
1437
|
+
Pe as TabsContent,
|
|
1438
|
+
Be as TabsList,
|
|
1439
|
+
Ie as TabsTrigger,
|
|
1440
|
+
Et as TextField,
|
|
1441
|
+
Te as Textarea,
|
|
1442
|
+
Ot as Toast,
|
|
1443
|
+
jt as ToastAction,
|
|
1444
|
+
Wt as ToastClose,
|
|
1445
|
+
ht as ToastDescription,
|
|
1446
|
+
zt as ToastProvider,
|
|
1447
|
+
Ht as ToastTitle,
|
|
1448
|
+
Vt as ToastViewport,
|
|
1449
|
+
Ge as Tooltip,
|
|
1450
|
+
Ue as TooltipContent,
|
|
1451
|
+
Ye as TooltipProvider,
|
|
1452
|
+
Je as TooltipTrigger,
|
|
1453
|
+
ve as Widget,
|
|
1454
|
+
ke as WidgetAction,
|
|
1455
|
+
we as WidgetAmount,
|
|
1456
|
+
_e as WidgetHeader,
|
|
1457
|
+
ye as WidgetKeyValue,
|
|
1458
|
+
Ne as WidgetList,
|
|
1459
|
+
Ce as WidgetRow,
|
|
1460
|
+
S as motionTokens,
|
|
1461
|
+
Qt as useKeyedListMotion,
|
|
1462
|
+
tt as useMotion,
|
|
1463
|
+
de as useToast
|
|
1179
1464
|
};
|