@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/dist/index.js CHANGED
@@ -1,385 +1,652 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as f, Fragment as q } from "react/jsx-runtime";
3
- import * as K from "@radix-ui/react-popover";
4
- import * as O from "@radix-ui/react-dropdown-menu";
5
- import * as U from "@radix-ui/react-tooltip";
6
- import * as W from "@radix-ui/react-toast";
7
- import { createPortal as st } from "react-dom";
8
- import * as tt from "@radix-ui/react-checkbox";
9
- import * as M from "@radix-ui/react-dialog";
10
- import * as D from "@radix-ui/react-select";
11
- import * as et from "@radix-ui/react-switch";
12
- import * as X from "@radix-ui/react-tabs";
13
- import { useState as H, useEffect as L, useId as j, forwardRef as Z, Children as lt, isValidElement as dt, cloneElement as ut, useRef as F, useCallback as R, useMemo as ft, useContext as S, createContext as it } from "react";
14
- const Q = /* @__PURE__ */ new WeakMap();
15
- function mt(t) {
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
- (o) => o instanceof HTMLElement && !o.hasAttribute("data-radix-focus-guard") && !o.contains(t)
284
+ (a) => a instanceof HTMLElement && !a.hasAttribute("data-radix-focus-guard") && !a.contains(t)
18
285
  );
19
- for (const o of e) {
20
- const i = Q.get(o);
21
- i ? i.count += 1 : (Q.set(o, { count: 1, wasInert: o.inert }), o.inert = !0);
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 a = !0;
290
+ let o = !0;
24
291
  return () => {
25
- if (a) {
26
- a = !1;
27
- for (const o of e) {
28
- const i = Q.get(o);
29
- i && (i.count -= 1, i.count === 0 && (i.wasInert || (o.inert = !1), Q.delete(o)));
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 A = (...t) => t.filter(Boolean).join(" "), Bt = Z(function(e, a) {
35
- const { leading: o, title: i, description: c, value: r, status: m, trailing: d, className: g } = e, p = /* @__PURE__ */ f(q, { children: [
36
- o != null && /* @__PURE__ */ n("span", { className: "facto-list-row__leading", children: o }),
37
- /* @__PURE__ */ f("span", { className: "facto-list-row__copy", children: [
38
- /* @__PURE__ */ n("span", { className: "facto-list-row__title", children: i }),
39
- c != null && /* @__PURE__ */ n("span", { className: "facto-list-row__description", children: c })
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 || m != null) && /* @__PURE__ */ f("span", { className: "facto-list-row__meta", children: [
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
- m != null && /* @__PURE__ */ n("span", { className: "facto-list-row__status", children: m })
310
+ u != null && /* @__PURE__ */ n("span", { className: "facto-list-row__status", children: u })
44
311
  ] }),
45
- d != null && /* @__PURE__ */ n("span", { className: "facto-list-row__trailing", children: d })
46
- ] }), v = A("facto-list-row", g);
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: h, title: _, description: C, value: N, status: E, trailing: P, className: J, ...I } = e;
49
- return /* @__PURE__ */ n("a", { ...I, ref: a, className: v, children: p });
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: h, title: _, description: C, value: N, status: E, trailing: P, className: J, type: I = "button", ...$ } = e;
53
- return /* @__PURE__ */ n("button", { ...$, ref: a, type: I, className: v, children: p });
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: w, title: k, description: y, value: T, status: x, trailing: s, className: u, ...b } = e;
56
- return /* @__PURE__ */ n("div", { ...b, ref: a, className: v, children: p });
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 St({ heading: t, children: e, className: a, ...o }) {
59
- const i = j();
60
- return /* @__PURE__ */ f("section", { ...o, className: A("facto-list-group", a), "aria-labelledby": t ? i : o["aria-labelledby"], children: [
61
- t && /* @__PURE__ */ n("h2", { id: i, className: "facto-list-group__heading", children: t }),
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 ht({ src: t, alt: e = "", fallback: a, size: o = "md", className: i, onError: c, ...r }) {
66
- const [m, d] = H(!1);
67
- L(() => d(!1), [t]);
68
- const g = a ?? (e ? e.slice(0, 1).toUpperCase() : null);
69
- return /* @__PURE__ */ n("span", { className: A("facto-avatar", `facto-avatar--${o}`, i), children: t && !m ? /* @__PURE__ */ n("img", { ...r, src: t, alt: e, onError: (p) => {
70
- d(!0), c?.(p);
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: g }) });
72
- }
73
- function xt({ logos: t, size: e = "md", max: a, className: o, ...i }) {
74
- const c = a === void 0 ? t : t.slice(0, a), r = t.length - c.length;
75
- return /* @__PURE__ */ f("div", { ...i, className: A("facto-logo-stack", `facto-logo-stack--${e}`, o), children: [
76
- c.map((m, d) => /* @__PURE__ */ n(ht, { ...m, size: e }, `${m.src ?? "fallback"}-${d}`)),
77
- r > 0 && /* @__PURE__ */ f("span", { className: "facto-logo-stack__more", "aria-label": `${r} more logos`, children: [
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 Lt({ title: t, description: e, retryLabel: a = "Try again", onRetry: o, className: i, ...c }) {
84
- return /* @__PURE__ */ f("div", { ...c, className: A("facto-error-state", i), role: "alert", children: [
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
- o && /* @__PURE__ */ n("button", { type: "button", className: "facto-error-state__retry", onClick: o, children: a })
354
+ a && /* @__PURE__ */ n("button", { type: "button", className: "facto-error-state__retry", onClick: a, children: o })
88
355
  ] });
89
356
  }
90
- function Rt({ label: t = "Loading more", className: e, ...a }) {
91
- return /* @__PURE__ */ f("div", { ...a, className: A("facto-loading-more", e), role: "status", "aria-live": "polite", children: [
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 Ft({ steps: t, className: e, ...a }) {
97
- return /* @__PURE__ */ n("ol", { ...a, className: A("facto-step-checklist", e), children: t.map((o, i) => {
98
- const c = o.state ?? "upcoming";
99
- return /* @__PURE__ */ f("li", { className: `facto-step-checklist__item facto-step-checklist__item--${c}`, "aria-current": c === "current" ? "step" : void 0, children: [
100
- /* @__PURE__ */ n("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children: c === "complete" ? "✓" : i + 1 }),
101
- /* @__PURE__ */ f("span", { className: "facto-step-checklist__copy", children: [
102
- /* @__PURE__ */ f("span", { children: [
103
- o.label,
104
- c === "complete" && /* @__PURE__ */ n("span", { className: "facto-visually-hidden", children: ", completed" })
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
- o.description != null && /* @__PURE__ */ n("small", { children: o.description })
373
+ a.description != null && /* @__PURE__ */ n("small", { children: a.description })
107
374
  ] })
108
- ] }, i);
375
+ ] }, c);
109
376
  }) });
110
377
  }
111
- const G = (...t) => t.filter(Boolean).join(" "), pt = (...t) => t.filter(Boolean).join(" ") || void 0;
112
- function jt({
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: a,
116
- children: o,
117
- invalid: i,
118
- inputId: c,
382
+ trailing: o,
383
+ children: a,
384
+ invalid: c,
385
+ inputId: i,
119
386
  className: r,
120
- ...m
387
+ ...u
121
388
  }) {
122
- return /* @__PURE__ */ f(
389
+ return /* @__PURE__ */ _(
123
390
  "div",
124
391
  {
125
- ...m,
126
- className: G("facto-inset-field", i && "facto-inset-field--invalid", r),
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: c, children: t }),
129
- /* @__PURE__ */ f("span", { className: "facto-inset-field__control", children: [
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
- lt.map(o, (d) => dt(d) && typeof d.type == "string" && ["input", "textarea", "select"].includes(d.type) ? ut(d, { id: c, "aria-invalid": i || d.props["aria-invalid"] }) : d),
132
- a && /* @__PURE__ */ n("span", { className: "facto-inset-field__slot facto-inset-field__slot--trailing", children: a })
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 nt = (t, e) => t.replace(/\D/g, "").slice(0, e);
139
- function Et({
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: a = 6,
143
- onComplete: o,
144
- completionDelay: i = 300,
145
- pending: c,
409
+ length: o = 6,
410
+ onComplete: a,
411
+ completionDelay: c = 300,
412
+ pending: i,
146
413
  pendingLabel: r = "Verifying code…",
147
- label: m,
148
- helperText: d,
149
- error: g,
150
- id: p,
151
- className: v,
152
- containerClassName: w,
153
- disabled: k,
154
- readOnly: y,
155
- onPaste: T,
156
- onFocus: x,
157
- onBlur: s,
158
- ...u
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(), h = p ?? b, _ = g || d ? `${h}-description` : void 0, C = Number.isFinite(a) ? Math.min(32, Math.max(1, Math.floor(a))) : 6, N = nt(t, C), E = F(void 0), P = F(o);
161
- L(() => {
162
- P.current = o;
163
- }, [o]), L(() => {
164
- if (k || y || c) return;
165
- if (N.length !== C) {
166
- E.current = void 0;
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 (E.current === N) return;
170
- const I = window.setTimeout(() => {
171
- E.current = N, P.current?.(N);
172
- }, Math.max(0, i));
173
- return () => window.clearTimeout(I);
174
- }, [i, k, C, N, c, y]);
175
- const J = (I) => {
176
- if (k || y || c) return;
177
- const $ = nt(I, C);
178
- $ !== N && e($);
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__ */ f("div", { className: G("facto-otp", w), children: [
181
- m && /* @__PURE__ */ n("label", { className: "facto-otp__label", htmlFor: h, children: m }),
182
- /* @__PURE__ */ f(
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: G("facto-otp__cells", !!g && "facto-otp__cells--error", v),
186
- "data-disabled": k ? "" : void 0,
187
- "data-pending": c ? "" : void 0,
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
- ...u,
193
- id: h,
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: C,
200
- disabled: k || c,
201
- readOnly: y,
202
- value: N,
203
- "aria-invalid": !!g || u["aria-invalid"],
204
- "aria-busy": c || void 0,
205
- "aria-describedby": pt(u["aria-describedby"], _, c ? `${h}-pending` : void 0),
206
- "aria-errormessage": g ? _ : void 0,
207
- onChange: (I) => J(I.currentTarget.value),
208
- onPaste: (I) => {
209
- T?.(I), !I.defaultPrevented && (I.preventDefault(), J(I.clipboardData.getData("text")));
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: x,
212
- onBlur: s
478
+ onFocus: v,
479
+ onBlur: l
213
480
  }
214
481
  ),
215
- /* @__PURE__ */ n("span", { className: "facto-otp__visual", style: { gridTemplateColumns: `repeat(${Math.min(C, 8)}, minmax(0, 1fr))` }, "aria-hidden": "true", children: Array.from({ length: C }, (I, $) => /* @__PURE__ */ n("span", { className: "facto-otp__cell", children: N[$] && /* @__PURE__ */ n("span", { className: "facto-otp__digit", children: N[$] }, `${$}-${N[$]}`) }, $)) })
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
- (g || d) && /* @__PURE__ */ n(
486
+ (f || s) && /* @__PURE__ */ n(
220
487
  "span",
221
488
  {
222
- id: _,
223
- className: G("facto-otp__message", !!g && "facto-otp__message--error"),
224
- role: g ? "alert" : void 0,
225
- children: g ?? d
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
- c && /* @__PURE__ */ n("span", { className: "facto-otp__pending", id: `${h}-pending`, role: "status", children: r })
495
+ i && /* @__PURE__ */ n("span", { className: "facto-otp__pending", id: `${g}-pending`, role: "status", children: r })
229
496
  ] });
230
497
  }
231
- const Y = (t) => t instanceof Date ? t.getTime() : t ?? 0, gt = (t, e) => Math.max(0, Math.ceil((Y(t) - e) / 1e3)), vt = (t) => `Resend code in ${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
232
- function Wt({
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: a,
236
- children: o = "Resend code",
237
- formatCountdown: i = vt,
238
- className: c,
502
+ disabled: o,
503
+ children: a = "Resend code",
504
+ formatCountdown: c = Lt,
505
+ className: i,
239
506
  onClick: r,
240
- ...m
507
+ ...u
241
508
  }) {
242
- const [d, g] = H(null), p = d === null ? 0 : gt(t, d);
243
- L(() => {
244
- let w;
245
- const k = () => {
246
- const y = Date.now();
247
- g(y);
248
- const T = Y(t) - y;
249
- Number.isFinite(T) && T > 0 && (w = window.setTimeout(k, Math.min(T, 250)));
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 k(), () => window.clearTimeout(w);
518
+ return w(), () => window.clearTimeout(y);
252
519
  }, [t]);
253
- const v = d === null ? Y(t) > 0 : p > 0;
254
- return /* @__PURE__ */ f(
520
+ const p = s === null ? ct(t) > 0 : m > 0;
521
+ return /* @__PURE__ */ _(
255
522
  "button",
256
523
  {
257
- ...m,
524
+ ...u,
258
525
  type: "button",
259
- className: G("facto-resend-code", e && "facto-resend-code--pending", c),
260
- disabled: !!(a || e || v),
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
- v && d !== null ? i(p) : o
532
+ p && s !== null ? c(m) : a
266
533
  ]
267
534
  }
268
535
  );
269
536
  }
270
- const ct = it(null);
271
- function At({
537
+ const _t = st(null);
538
+ function le({
272
539
  children: t,
273
540
  duration: e,
274
- maxVisible: a = 3,
275
- label: o = "Notifications ({hotkey})"
541
+ maxVisible: o = 3,
542
+ label: a = "Notifications ({hotkey})"
276
543
  }) {
277
- const [i, c] = H([]), r = F([]), m = F(0), d = F(0), g = Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 3, p = e ?? 2600, v = R((s) => {
278
- r.current = s, c(s);
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
- L(() => {
281
- v(r.current.slice(-g));
282
- }, [v, g]);
283
- const w = R((s, u, b = {}) => {
284
- const h = b.id ?? `toast-${++m.current}`, _ = ++d.current, C = {
285
- id: h,
286
- tone: s,
287
- title: u,
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: s === "loading" ? b.duration ?? 1 / 0 : b.duration,
291
- generation: _
292
- }, N = r.current, E = N.findIndex((P) => P.id === h);
293
- return v(E >= 0 ? N.map((P) => P.id === h ? { ...P, ...C } : P) : [...N, C].slice(-g)), { id: h, generation: _ };
294
- }, [v, g]), k = R((s, u, b) => {
295
- const h = r.current, _ = h.findIndex((N) => N.id === s);
296
- if (_ < 0 || b !== void 0 && h[_].generation !== b) return !1;
297
- const C = ++d.current;
298
- v(h.map((N) => N.id !== s ? N : {
299
- ...N,
300
- ...u.title === void 0 ? {} : { title: u.title },
301
- ...u.tone === void 0 ? {} : { tone: u.tone },
302
- ...u.description === void 0 ? {} : { description: u.description },
303
- ...u.action === void 0 ? {} : { action: u.action },
304
- duration: u.duration ?? (N.tone === "loading" && (u.tone ?? N.tone) !== "loading" ? p : (u.tone ?? N.tone) === "loading" ? 1 / 0 : N.duration),
305
- generation: C
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
- }, [v, p]), y = R((s, u) => (k(s, u), s), [k]), T = R((s, u) => {
308
- const b = r.current, h = s === void 0 ? void 0 : b.find((_) => _.id === s);
309
- s !== void 0 && (!h || u !== void 0 && h.generation !== u) || v(s === void 0 ? [] : b.filter((_) => _.id !== s));
310
- }, [v]), x = ft(() => ({
311
- success: (s, u) => w("success", s, u).id,
312
- error: (s, u) => w("error", s, u).id,
313
- warning: (s, u) => w("warning", s, u).id,
314
- info: (s, u) => w("info", s, u).id,
315
- loading: (s, u) => w("loading", s, u).id,
316
- update: y,
317
- dismiss: T,
318
- promise: (s, u, b) => {
319
- const h = w("loading", u.loading, b);
320
- return Promise.resolve(s).then(
321
- (_) => (k(h.id, {
322
- title: typeof u.success == "function" ? u.success(_) : u.success,
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 ?? p
325
- }, h.generation), _),
326
- (_) => {
327
- throw k(h.id, {
328
- title: typeof u.error == "function" ? u.error(_) : u.error,
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 ?? p
331
- }, h.generation), _;
597
+ duration: b?.duration ?? m
598
+ }, g.generation), N;
332
599
  }
333
600
  );
334
601
  }
335
- }), [w, p, T, y, k]);
336
- return /* @__PURE__ */ n(ct.Provider, { value: x, children: /* @__PURE__ */ f(kt, { duration: e, children: [
602
+ }), [y, m, M, C, w]);
603
+ return /* @__PURE__ */ n(_t.Provider, { value: v, children: /* @__PURE__ */ _(zt, { duration: e, children: [
337
604
  t,
338
- i.map((s) => /* @__PURE__ */ f(
339
- yt,
605
+ c.map((l) => /* @__PURE__ */ _(
606
+ Ot,
340
607
  {
341
- duration: s.duration,
342
- icon: s.tone === "loading" ? /* @__PURE__ */ n("span", { className: "facto-notification-spinner" }) : void 0,
343
- tone: s.tone === "error" ? "danger" : s.tone === "loading" ? "info" : s.tone,
344
- type: s.tone === "error" ? "foreground" : "background",
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: (u) => {
347
- u || T(s.id, s.generation);
613
+ onOpenChange: (d) => {
614
+ d || M(l.id, l.generation);
348
615
  },
349
616
  children: [
350
- /* @__PURE__ */ n(Tt, { children: s.title }),
351
- s.tone === "loading" && /* @__PURE__ */ n(ot, { children: /* @__PURE__ */ n("span", { role: "status", children: "Loading" }) }),
352
- s.description != null && /* @__PURE__ */ n(ot, { children: s.description }),
353
- s.action && /* @__PURE__ */ n(Ct, { altText: s.action.altText, onClick: s.action.onClick, children: s.action.label }),
354
- /* @__PURE__ */ n(It, {})
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
- `${s.id}-${s.generation}`
624
+ `${l.id}-${l.generation}`
358
625
  )),
359
- /* @__PURE__ */ n(Mt, { label: o })
626
+ /* @__PURE__ */ n(Vt, { label: a })
360
627
  ] }) });
361
628
  }
362
- function Ot() {
363
- const t = S(ct);
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 l = (...t) => t.filter(Boolean).join(" "), V = (...t) => t.filter(Boolean).join(" ") || void 0, B = it({}), _t = (t) => Object.fromEntries(
368
- Object.entries(t ?? {}).filter(([e, a]) => e.startsWith("--facto-") && a !== void 0 && a !== null)
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 zt({ className: t, tokens: e, style: a, ...o }) {
371
- const i = S(B), c = { ...e, ...a }, r = { ...i, ..._t(c) };
372
- return /* @__PURE__ */ n(B.Provider, { value: r, children: /* @__PURE__ */ n("div", { ...o, style: c, className: l("facto-theme", t) }) });
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 z({ name: t, size: e = 20, ...a }) {
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", ...a, children: {
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__ */ f(q, { children: [
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__ */ f(q, { children: [
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__ */ f(q, { children: [
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__ */ f(q, { children: [
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 Ht({ className: t, ...e }) {
402
- return /* @__PURE__ */ n("div", { ...e, className: l("facto-modal-header", t) });
668
+ function fe({ className: t, ...e }) {
669
+ return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-header", t) });
403
670
  }
404
- function Vt({ className: t, ...e }) {
405
- return /* @__PURE__ */ n("div", { ...e, className: l("facto-modal-footer", t) });
671
+ function me({ className: t, ...e }) {
672
+ return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-footer", t) });
406
673
  }
407
- const qt = Z(
674
+ const he = X(
408
675
  function({
409
676
  variant: e = "primary",
410
- size: a = "md",
411
- fullWidth: o,
412
- loading: i,
413
- leadingIcon: c,
414
- trailingIcon: r,
415
- className: m,
416
- children: d,
417
- disabled: g,
418
- type: p = "button",
419
- ...v
420
- }, w) {
421
- return /* @__PURE__ */ f(
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
- ...v,
425
- ref: w,
426
- type: p,
427
- disabled: g || i,
428
- "aria-busy": i || void 0,
429
- className: l(
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--${a}`,
433
- o && "facto-button--full",
434
- m
703
+ `facto-button--${o}`,
704
+ a && "facto-button--full",
705
+ f
435
706
  ),
436
707
  children: [
437
- /* @__PURE__ */ f("span", { className: "facto-button__content", style: i ? { opacity: 0 } : void 0, children: [
438
- c,
439
- /* @__PURE__ */ n("span", { children: d }),
440
- r
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
- i && /* @__PURE__ */ n("span", { className: "facto-button__spinner", "aria-hidden": "true" })
713
+ c && /* @__PURE__ */ n("span", { className: "facto-button__spinner", "aria-hidden": "true" })
443
714
  ]
444
715
  }
445
716
  );
446
717
  }
447
- ), Gt = Z(
448
- function({ ariaLabel: e, size: a = "md", className: o, title: i, type: c = "button", children: r, ...m }, d) {
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
- ...m,
453
- ref: d,
454
- type: c,
723
+ ...u,
724
+ ref: s,
725
+ type: i,
455
726
  "aria-label": e,
456
- title: i ?? e,
457
- className: l(
727
+ title: c ?? e,
728
+ className: h(
458
729
  "facto-icon-button",
459
- `facto-icon-button--${a}`,
460
- o
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 rt({ padding: t = "lg", className: e, ...a }) {
738
+ function Nt({ padding: t = "lg", className: e, ...o }) {
468
739
  return /* @__PURE__ */ n(
469
740
  "div",
470
741
  {
471
- ...a,
472
- className: l(
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 Kt(t) {
481
- return /* @__PURE__ */ n(rt, { ...t });
751
+ function ge(t) {
752
+ return /* @__PURE__ */ n(Nt, { ...t });
482
753
  }
483
- function Ut({ span: t = 1, className: e, ...a }) {
754
+ function ve({ span: t = 1, className: e, ...o }) {
484
755
  return /* @__PURE__ */ n(
485
- rt,
756
+ Nt,
486
757
  {
487
- ...a,
758
+ ...o,
488
759
  padding: "md",
489
- className: l(
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 Zt({ className: t, children: e, ...a }) {
498
- return /* @__PURE__ */ n("div", { ...a, className: l("facto-dashboard-container", t), children: /* @__PURE__ */ n("div", { className: "facto-dashboard-grid", children: e }) });
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 Jt({ withAction: t, className: e, ...a }) {
771
+ function _e({ withAction: t, className: e, ...o }) {
501
772
  return /* @__PURE__ */ n(
502
773
  "div",
503
774
  {
504
- ...a,
505
- className: l("facto-widget-head", t && "facto-widget-head--with-action", e)
775
+ ...o,
776
+ className: h("facto-widget-head", t && "facto-widget-head--with-action", e)
506
777
  }
507
778
  );
508
779
  }
509
- function Qt({ className: t, ...e }) {
510
- return /* @__PURE__ */ n("div", { ...e, className: l("facto-widget-list", t) });
780
+ function Ne({ className: t, ...e }) {
781
+ return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-list", t) });
511
782
  }
512
- function Xt({ className: t, ...e }) {
513
- return /* @__PURE__ */ n("div", { ...e, className: l("facto-widget-kv", t) });
783
+ function ye({ className: t, ...e }) {
784
+ return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-kv", t) });
514
785
  }
515
- function Yt({ className: t, ...e }) {
516
- return /* @__PURE__ */ n("div", { ...e, className: l("facto-widget-amount", t) });
786
+ function we({ className: t, ...e }) {
787
+ return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-amount", t) });
517
788
  }
518
- function te(t) {
519
- const e = l("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
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: m, ...d } = t;
522
- return /* @__PURE__ */ n("a", { ...d, className: e });
792
+ const { dark: r, className: u, ...s } = t;
793
+ return /* @__PURE__ */ n("a", { ...s, className: e });
523
794
  }
524
- const { dark: a, className: o, type: i = "button", ...c } = t;
525
- return /* @__PURE__ */ n("button", { ...c, type: i, className: e });
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 ee({
798
+ function Ce({
528
799
  className: t,
529
800
  type: e = "button",
530
- ...a
801
+ ...o
531
802
  }) {
532
803
  return /* @__PURE__ */ n(
533
804
  "button",
534
805
  {
535
- ...a,
806
+ ...o,
536
807
  type: e,
537
- className: l("facto-widget-row", t)
808
+ className: h("facto-widget-row", t)
538
809
  }
539
810
  );
540
811
  }
541
- function Nt({
812
+ function Et({
542
813
  label: t,
543
814
  helperText: e,
544
- error: a,
545
- id: o,
546
- containerClassName: i,
547
- className: c,
815
+ error: o,
816
+ id: a,
817
+ containerClassName: c,
818
+ className: i,
548
819
  ...r
549
820
  }) {
550
- const m = j(), d = o ?? m, g = a || e ? `${d}-description` : void 0;
551
- return /* @__PURE__ */ f("div", { className: l("facto-field", i), children: [
552
- t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: d, children: t }),
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: d,
558
- "aria-invalid": !!a || r["aria-invalid"],
559
- "aria-describedby": V(r["aria-describedby"], g),
560
- className: l(
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
- !!a && "facto-input--error",
563
- c
833
+ !!o && "facto-input--error",
834
+ i
564
835
  )
565
836
  }
566
837
  ),
567
- (a || e) && /* @__PURE__ */ n(
838
+ (o || e) && /* @__PURE__ */ n(
568
839
  "span",
569
840
  {
570
- id: g,
571
- className: l(
841
+ id: f,
842
+ className: h(
572
843
  "facto-field__message",
573
- !!a && "facto-field__message--error"
844
+ !!o && "facto-field__message--error"
574
845
  ),
575
- children: a ?? e
846
+ children: o ?? e
576
847
  }
577
848
  )
578
849
  ] });
579
850
  }
580
- function ne({
851
+ function Te({
581
852
  label: t,
582
853
  helperText: e,
583
- error: a,
584
- id: o,
585
- containerClassName: i,
586
- className: c,
854
+ error: o,
855
+ id: a,
856
+ containerClassName: c,
857
+ className: i,
587
858
  ...r
588
859
  }) {
589
- const m = j(), d = o ?? m, g = a || e ? `${d}-description` : void 0;
590
- return /* @__PURE__ */ f("div", { className: l("facto-field", i), children: [
591
- t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: d, children: t }),
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: d,
597
- "aria-invalid": !!a || r["aria-invalid"],
598
- "aria-describedby": V(r["aria-describedby"], g),
599
- className: l(
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
- !!a && "facto-input--error",
602
- c
872
+ !!o && "facto-input--error",
873
+ i
603
874
  )
604
875
  }
605
876
  ),
606
- (a || e) && /* @__PURE__ */ n(
877
+ (o || e) && /* @__PURE__ */ n(
607
878
  "span",
608
879
  {
609
- id: g,
610
- className: l(
880
+ id: f,
881
+ className: h(
611
882
  "facto-field__message",
612
- !!a && "facto-field__message--error"
883
+ !!o && "facto-field__message--error"
613
884
  ),
614
- children: a ?? e
885
+ children: o ?? e
615
886
  }
616
887
  )
617
888
  ] });
618
889
  }
619
- function ae({ tone: t = "neutral", className: e, ...a }) {
890
+ function Me({ tone: t = "neutral", className: e, ...o }) {
620
891
  return /* @__PURE__ */ n(
621
892
  "span",
622
893
  {
623
- ...a,
624
- className: l("facto-badge", `facto-badge--${t}`, e)
894
+ ...o,
895
+ className: h("facto-badge", `facto-badge--${t}`, e)
625
896
  }
626
897
  );
627
898
  }
628
- function oe({
899
+ function Re({
629
900
  options: t,
630
901
  value: e,
631
- defaultValue: a,
632
- onValueChange: o,
633
- placeholder: i = "Select an option",
634
- label: c,
902
+ defaultValue: o,
903
+ onValueChange: a,
904
+ placeholder: c = "Select an option",
905
+ label: i,
635
906
  error: r,
636
- disabled: m,
637
- name: d,
638
- id: g,
907
+ disabled: u,
908
+ bordered: s = !1,
909
+ name: f,
910
+ id: m,
639
911
  ariaLabel: p,
640
- "aria-describedby": v,
912
+ "aria-describedby": y,
641
913
  className: w
642
914
  }) {
643
- const k = S(B), y = j(), T = g ?? y, x = r ? `${T}-description` : void 0, s = F(null), u = R(() => {
644
- s.current?.(), s.current = null;
645
- }, []), b = R(
646
- (h) => {
647
- u(), h && (s.current = mt(h));
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
- [u]
921
+ [g]
650
922
  );
651
- return L(() => u, [u]), /* @__PURE__ */ f("div", { className: l("facto-field", w), children: [
652
- c && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: T, children: c }),
653
- /* @__PURE__ */ f(
654
- D.Root,
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: a,
658
- onValueChange: o,
659
- disabled: m,
660
- name: d,
929
+ defaultValue: o,
930
+ onValueChange: a,
931
+ disabled: u,
932
+ name: f,
661
933
  children: [
662
- /* @__PURE__ */ f(
663
- D.Trigger,
934
+ /* @__PURE__ */ _(
935
+ L.Trigger,
664
936
  {
665
- id: T,
666
- className: l("facto-select", !!r && "facto-input--error"),
937
+ id: l,
938
+ className: h("facto-select", s && "facto-select--bordered", !!r && "facto-input--error"),
667
939
  "aria-label": p,
668
- "aria-describedby": V(v, x),
940
+ "aria-describedby": G(y, d),
669
941
  "aria-invalid": !!r,
670
942
  children: [
671
- /* @__PURE__ */ n(D.Value, { placeholder: i }),
672
- /* @__PURE__ */ n(D.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ n(z, { name: "chevronDown", size: 16 }) })
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(D.Portal, { children: /* @__PURE__ */ n(
677
- D.Content,
948
+ /* @__PURE__ */ n(L.Portal, { children: /* @__PURE__ */ n(
949
+ L.Content,
678
950
  {
679
- ref: b,
951
+ ref: N,
680
952
  className: "facto-theme facto-select-content",
681
- style: k,
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: u,
688
- children: /* @__PURE__ */ n(D.Viewport, { children: t.map((h) => /* @__PURE__ */ f(
689
- D.Item,
959
+ onCloseAutoFocus: g,
960
+ children: /* @__PURE__ */ n(L.Viewport, { children: t.map((k) => /* @__PURE__ */ _(
961
+ L.Item,
690
962
  {
691
- value: h.value,
692
- disabled: h.disabled,
963
+ value: k.value,
964
+ disabled: k.disabled,
693
965
  className: "facto-select-item",
694
966
  children: [
695
- /* @__PURE__ */ n(D.ItemText, { children: h.label }),
696
- /* @__PURE__ */ n(D.ItemIndicator, { children: /* @__PURE__ */ n(z, { name: "check", size: 16 }) })
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
- h.value
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: x,
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 ie({
988
+ function $e({
717
989
  label: t,
718
990
  description: e,
719
- className: a,
720
- id: o,
721
- ...i
991
+ className: o,
992
+ id: a,
993
+ ...c
722
994
  }) {
723
- const c = j(), r = o ?? c, m = e ? `${r}-description` : void 0, d = /* @__PURE__ */ n(
724
- et.Root,
995
+ const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
996
+ dt.Root,
725
997
  {
726
- ...i,
998
+ ...c,
727
999
  id: r,
728
- "aria-describedby": V(i["aria-describedby"], m),
729
- className: l("facto-switch", a),
730
- children: /* @__PURE__ */ n("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ n(et.Thumb, { className: "facto-switch__thumb" }) })
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__ */ f("div", { className: "facto-check-field", children: [
734
- d,
735
- /* @__PURE__ */ f("span", { children: [
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: m, children: e })
1009
+ e && /* @__PURE__ */ n("small", { id: u, children: e })
738
1010
  ] })
739
- ] }) : d;
1011
+ ] }) : s;
740
1012
  }
741
- function ce({
1013
+ function Se({
742
1014
  label: t,
743
1015
  description: e,
744
- className: a,
745
- id: o,
746
- ...i
1016
+ className: o,
1017
+ id: a,
1018
+ ...c
747
1019
  }) {
748
- const c = j(), r = o ?? c, m = e ? `${r}-description` : void 0, d = /* @__PURE__ */ n(
749
- tt.Root,
1020
+ const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
1021
+ lt.Root,
750
1022
  {
751
- ...i,
1023
+ ...c,
752
1024
  id: r,
753
- "aria-describedby": V(i["aria-describedby"], m),
754
- className: l("facto-checkbox", a),
755
- children: /* @__PURE__ */ n("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ n(tt.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ n(z, { name: "check", size: 16 }) }) })
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__ */ f("div", { className: "facto-check-field", children: [
759
- d,
760
- /* @__PURE__ */ f("span", { children: [
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: m, children: e })
1034
+ e && /* @__PURE__ */ n("small", { id: u, children: e })
763
1035
  ] })
764
- ] }) : d;
1036
+ ] }) : s;
765
1037
  }
766
- const re = X.Root;
767
- function se({
1038
+ const xe = ot.Root;
1039
+ function Be({
768
1040
  className: t,
769
1041
  ...e
770
1042
  }) {
771
1043
  return /* @__PURE__ */ n(
772
- X.List,
1044
+ ot.List,
773
1045
  {
774
1046
  ...e,
775
- className: l("facto-tabs-list", t)
1047
+ className: h("facto-tabs-list", t)
776
1048
  }
777
1049
  );
778
1050
  }
779
- function le({
1051
+ function Ie({
780
1052
  className: t,
781
1053
  ...e
782
1054
  }) {
783
1055
  return /* @__PURE__ */ n(
784
- X.Trigger,
1056
+ ot.Trigger,
785
1057
  {
786
1058
  ...e,
787
- className: l("facto-tabs-trigger", t)
1059
+ className: h("facto-tabs-trigger", t)
788
1060
  }
789
1061
  );
790
1062
  }
791
- function de({
1063
+ function Pe({
792
1064
  className: t,
793
1065
  ...e
794
1066
  }) {
795
1067
  return /* @__PURE__ */ n(
796
- X.Content,
1068
+ ot.Content,
797
1069
  {
798
1070
  ...e,
799
- className: l("facto-tabs-content", t)
1071
+ className: h("facto-tabs-content", t)
800
1072
  }
801
1073
  );
802
1074
  }
803
- const ue = M.Root, fe = M.Trigger, me = M.Close, bt = Z(
804
- function({ className: e, children: a, tabIndex: o, ...i }, c) {
805
- const r = F(null), [m, d] = H(!1), g = R((p) => {
806
- if (r.current = p, typeof c == "function") {
807
- const v = c(p);
808
- if (typeof v == "function")
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 === p && (r.current = null), v();
1082
+ r.current === m && (r.current = null), p();
811
1083
  };
812
- } else c && (c.current = p);
813
- }, [c]);
814
- return L(() => {
815
- const p = r.current;
816
- if (!p) return;
817
- const v = () => d(p.scrollHeight > p.clientHeight + 1);
818
- v();
819
- const w = new ResizeObserver(v), k = new MutationObserver(v);
820
- return w.observe(p), k.observe(p, { childList: !0, characterData: !0, subtree: !0 }), () => {
821
- w.disconnect(), k.disconnect();
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
- }, [a]), /* @__PURE__ */ n(M.Title, { ...i, ref: g, tabIndex: m ? o ?? 0 : o, className: l("facto-modal-title", e), children: a });
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
- ), wt = Z(function({ className: e, ...a }, o) {
826
- return /* @__PURE__ */ n(M.Description, { ...a, ref: o, className: l("facto-modal-description", e) });
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 he({
1100
+ function Fe({
829
1101
  size: t = "sm",
830
1102
  motionVariant: e = "auto",
1103
+ motion: o,
831
1104
  className: a,
832
- style: o,
1105
+ style: c,
833
1106
  children: i,
834
- ...c
1107
+ ...r
835
1108
  }) {
836
- const r = S(B);
837
- return /* @__PURE__ */ f(M.Portal, { children: [
838
- /* @__PURE__ */ n(M.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: r }),
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
- M.Content,
1113
+ x.Content,
841
1114
  {
842
- ...c,
1115
+ ...r,
1116
+ ref: f,
843
1117
  "data-motion": e,
844
- style: { ...r, ...o },
845
- className: l(
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 pe = M.Root, ge = M.Trigger, ve = M.Close, _e = bt, Ne = wt;
857
- function be({
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: o,
1136
+ style: c,
862
1137
  children: i,
863
- ...c
1138
+ ...r
864
1139
  }) {
865
- const r = S(B);
866
- return /* @__PURE__ */ f(M.Portal, { children: [
867
- /* @__PURE__ */ n(M.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: r }),
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
- M.Content,
1144
+ x.Content,
870
1145
  {
871
- ...c,
1146
+ ...r,
1147
+ ref: f,
872
1148
  "data-motion": e,
873
- style: { ...r, ...o },
874
- className: l(
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 at({
1161
+ function mt({
886
1162
  width: t,
887
1163
  height: e,
888
- circle: a,
889
- className: o,
890
- style: i,
891
- ...c
1164
+ circle: o,
1165
+ className: a,
1166
+ style: c,
1167
+ ...i
892
1168
  }) {
893
1169
  return /* @__PURE__ */ n(
894
1170
  "span",
895
1171
  {
896
- ...c,
1172
+ ...i,
897
1173
  "aria-hidden": "true",
898
- className: l(
1174
+ className: h(
899
1175
  "facto-skeleton",
900
- a && "facto-skeleton--circle",
901
- o
1176
+ o && "facto-skeleton--circle",
1177
+ a
902
1178
  ),
903
- style: { ...i, width: t, height: e }
1179
+ style: { ...c, width: t, height: e }
904
1180
  }
905
1181
  );
906
1182
  }
907
- function we({
1183
+ function Ve({
908
1184
  title: t,
909
1185
  description: e,
910
- action: a,
911
- icon: o,
912
- className: i,
913
- ...c
1186
+ action: o,
1187
+ icon: a,
1188
+ className: c,
1189
+ ...i
914
1190
  }) {
915
- return /* @__PURE__ */ f("div", { ...c, className: l("facto-empty-state", i), children: [
916
- o && /* @__PURE__ */ n("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: o }),
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
- a && /* @__PURE__ */ n("div", { children: a })
1195
+ o && /* @__PURE__ */ n("div", { children: o })
920
1196
  ] });
921
1197
  }
922
- function ke({
1198
+ function qe({
923
1199
  tone: t = "info",
924
1200
  title: e,
925
- description: a,
926
- action: o,
927
- className: i,
928
- ...c
1201
+ description: o,
1202
+ action: a,
1203
+ className: c,
1204
+ ...i
929
1205
  }) {
930
- return /* @__PURE__ */ f(
1206
+ return /* @__PURE__ */ _(
931
1207
  "div",
932
1208
  {
933
- ...c,
1209
+ ...i,
934
1210
  role: t === "danger" ? "alert" : "status",
935
- className: l("facto-notice", `facto-notice--${t}`, i),
1211
+ className: h("facto-notice", `facto-notice--${t}`, c),
936
1212
  children: [
937
- /* @__PURE__ */ f("div", { children: [
1213
+ /* @__PURE__ */ _("div", { children: [
938
1214
  /* @__PURE__ */ n("strong", { children: e }),
939
- a && /* @__PURE__ */ n("span", { children: a })
1215
+ o && /* @__PURE__ */ n("span", { children: o })
940
1216
  ] }),
941
- o
1217
+ a
942
1218
  ]
943
1219
  }
944
1220
  );
945
1221
  }
946
- function ye({
1222
+ function Ke({
947
1223
  gap: t = 3,
948
1224
  direction: e = "vertical",
949
- align: a = "stretch",
950
- justify: o = "start",
951
- className: i,
952
- ...c
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
- ...c,
958
- className: l(
1233
+ ...i,
1234
+ className: h(
959
1235
  "facto-stack",
960
1236
  `facto-stack--${e}`,
961
1237
  `facto-stack--gap-${t}`,
962
- `facto-stack--align-${a}`,
963
- `facto-stack--justify-${o}`,
964
- i
1238
+ `facto-stack--align-${o}`,
1239
+ `facto-stack--justify-${a}`,
1240
+ c
965
1241
  )
966
1242
  }
967
1243
  );
968
1244
  }
969
- function Te({ delayDuration: t = 300, ...e }) {
970
- return /* @__PURE__ */ n(U.Provider, { ...e, delayDuration: t });
1245
+ function Ye({ delayDuration: t = 300, ...e }) {
1246
+ return /* @__PURE__ */ n(Q.Provider, { ...e, delayDuration: t });
971
1247
  }
972
- const Ce = U.Root, Ie = U.Trigger;
973
- function Me({ variant: t = "default", className: e, style: a, sideOffset: o = 6, collisionPadding: i = 16, children: c, ...r }) {
974
- const m = S(B);
975
- return /* @__PURE__ */ n(U.Portal, { children: /* @__PURE__ */ n(
976
- U.Content,
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: o,
980
- collisionPadding: i,
981
- className: l("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
982
- style: { ...m, ...a },
983
- children: c
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 kt({ duration: t = 2600, ...e }) {
988
- return /* @__PURE__ */ n(W.Provider, { ...e, duration: t });
1263
+ function zt({ duration: t = 2600, ...e }) {
1264
+ return /* @__PURE__ */ n(V.Provider, { ...e, duration: t });
989
1265
  }
990
- function yt({ tone: t = "success", icon: e, className: a, style: o, children: i, ...c }) {
991
- const r = S(B);
992
- return /* @__PURE__ */ f(W.Root, { ...c, className: l("facto-theme", "facto-toast", `facto-toast--${t}`, a), style: { ...r, ...o }, children: [
993
- /* @__PURE__ */ n("span", { className: "facto-toast__icon", "aria-hidden": "true", children: e ?? /* @__PURE__ */ n(z, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
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 Tt({ className: t, ...e }) {
998
- return /* @__PURE__ */ n(W.Title, { ...e, className: l("facto-toast__title", t) });
1273
+ function Ht({ className: t, ...e }) {
1274
+ return /* @__PURE__ */ n(V.Title, { ...e, className: h("facto-toast__title", t) });
999
1275
  }
1000
- function ot({ className: t, ...e }) {
1001
- return /* @__PURE__ */ n(W.Description, { ...e, className: l("facto-toast__description", t) });
1276
+ function ht({ className: t, ...e }) {
1277
+ return /* @__PURE__ */ n(V.Description, { ...e, className: h("facto-toast__description", t) });
1002
1278
  }
1003
- function Ct({ className: t, ...e }) {
1004
- return /* @__PURE__ */ n(W.Action, { ...e, className: l("facto-button", "facto-button--secondary", "facto-button--sm", t) });
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 It({ className: t, children: e = /* @__PURE__ */ n(z, { name: "close" }), "aria-label": a = "Dismiss notification", ...o }) {
1007
- return /* @__PURE__ */ n(W.Close, { ...o, "aria-label": a, className: l("facto-toast__close", t), children: e });
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 Mt({ className: t, style: e, ...a }) {
1010
- const o = S(B), [i, c] = H(!1);
1011
- return L(() => c(!0), []), i ? st(/* @__PURE__ */ n(W.Viewport, { ...a, className: l("facto-toast-viewport", t), style: { ...o, ...e } }), document.body) : null;
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 Pe({ value: t, defaultValue: e = "", onValueChange: a, clearLabel: o = "Clear search", label: i = "Search", helperText: c, error: r, id: m, containerClassName: d, className: g, disabled: p, readOnly: v, ...w }) {
1014
- const k = j(), y = m ?? k, T = r || c ? `${y}-description` : void 0, [x, s] = H(e), u = t ?? x, b = F(null);
1015
- L(() => {
1016
- const _ = b.current?.form;
1017
- if (!_ || t !== void 0) return;
1018
- const C = (N) => {
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
- N.defaultPrevented || (s(e), a?.(e));
1296
+ R.defaultPrevented || (l(e), o?.(e));
1021
1297
  });
1022
1298
  };
1023
- return _.addEventListener("reset", C), () => _.removeEventListener("reset", C);
1024
- }, [e, t, a]);
1025
- const h = (_) => {
1026
- t === void 0 && s(_), a?.(_);
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__ */ f("div", { className: l("facto-field", d), children: [
1029
- i && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: y, children: i }),
1030
- /* @__PURE__ */ f("div", { className: "facto-search", children: [
1031
- /* @__PURE__ */ f("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: [
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
- ...w,
1314
+ ...y,
1039
1315
  ref: b,
1040
- id: y,
1316
+ id: C,
1041
1317
  type: "search",
1042
- disabled: p,
1043
- readOnly: v,
1044
- value: u,
1045
- onChange: (_) => h(_.target.value),
1046
- "aria-invalid": !!r || w["aria-invalid"],
1047
- "aria-describedby": V(w["aria-describedby"], T),
1048
- className: l("facto-input", "facto-search__input", !!r && "facto-input--error", g)
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
- u && !v && /* @__PURE__ */ n(
1327
+ d && !p && /* @__PURE__ */ n(
1052
1328
  "button",
1053
1329
  {
1054
1330
  type: "button",
1055
1331
  className: "facto-search__clear",
1056
- disabled: p,
1057
- "aria-label": o,
1332
+ disabled: m,
1333
+ "aria-label": a,
1058
1334
  onClick: () => {
1059
- h(""), b.current?.focus();
1335
+ g(""), b.current?.focus();
1060
1336
  },
1061
- children: /* @__PURE__ */ n(z, { name: "close", size: 16 })
1337
+ children: /* @__PURE__ */ n(Y, { name: "close", size: 16 })
1062
1338
  }
1063
1339
  )
1064
1340
  ] }),
1065
- (r || c) && /* @__PURE__ */ n("span", { id: T, className: l("facto-field__message", !!r && "facto-field__message--error"), children: r ?? c })
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 $e({ className: t, ...e }) {
1069
- return /* @__PURE__ */ n(Nt, { ...e, type: "search", className: l("facto-search-field", t) });
1344
+ function Qe({ className: t, ...e }) {
1345
+ return /* @__PURE__ */ n(Et, { ...e, type: "search", className: h("facto-search-field", t) });
1070
1346
  }
1071
- const De = K.Root, Be = K.Trigger, Se = K.Close;
1072
- function xe({ className: t, style: e, sideOffset: a = 8, collisionPadding: o = 16, ...i }) {
1073
- const c = S(B);
1074
- return /* @__PURE__ */ n(K.Portal, { children: /* @__PURE__ */ n(K.Content, { ...i, sideOffset: a, collisionPadding: o, className: l("facto-theme", "facto-popover", t), style: { ...c, ...e } }) });
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 Le({ modal: t = !1, ...e }) {
1077
- return /* @__PURE__ */ n(O.Root, { ...e, modal: t });
1352
+ function on({ modal: t = !1, ...e }) {
1353
+ return /* @__PURE__ */ n(K.Root, { ...e, modal: t });
1078
1354
  }
1079
- const Re = O.Trigger;
1080
- function Fe({ className: t, style: e, sideOffset: a = 8, collisionPadding: o = 16, ...i }) {
1081
- const c = S(B);
1082
- return /* @__PURE__ */ n(O.Portal, { children: /* @__PURE__ */ n(O.Content, { ...i, sideOffset: a, collisionPadding: o, className: l("facto-theme", "facto-menu", t), style: { ...c, ...e } }) });
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 je({ className: t, ...e }) {
1085
- return /* @__PURE__ */ n(O.Item, { ...e, className: l("facto-menu-item", t) });
1360
+ function cn({ className: t, ...e }) {
1361
+ return /* @__PURE__ */ n(K.Item, { ...e, className: h("facto-menu-item", t) });
1086
1362
  }
1087
- function Ee({ className: t, ...e }) {
1088
- return /* @__PURE__ */ n(O.Separator, { ...e, className: l("facto-menu-separator", t) });
1363
+ function sn({ className: t, ...e }) {
1364
+ return /* @__PURE__ */ n(K.Separator, { ...e, className: h("facto-menu-separator", t) });
1089
1365
  }
1090
- function We({ selected: t = !1, className: e, type: a = "button", ...o }) {
1091
- return /* @__PURE__ */ n("button", { ...o, type: a, "aria-pressed": t, className: l("facto-filter-chip", e) });
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 Ae({ rows: t = 3, label: e = "Loading", className: a, ...o }) {
1094
- const i = Number.isFinite(t) ? Math.min(20, Math.max(1, Math.floor(t))) : 3;
1095
- return /* @__PURE__ */ n("div", { ...o, className: l("facto-list-skeleton", a), role: "status", "aria-label": e, children: Array.from({ length: i }, (c, r) => /* @__PURE__ */ f("div", { "aria-hidden": "true", className: "facto-list-skeleton__row", children: [
1096
- /* @__PURE__ */ n(at, { style: { width: 32, height: 32 } }),
1097
- /* @__PURE__ */ n(at, { style: { width: "60%", height: 16 } })
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
- ht as Avatar,
1102
- ae as Badge,
1103
- qt as Button,
1104
- Kt as Card,
1105
- ce as Checkbox,
1106
- Zt as DashboardGrid,
1107
- ue as Dialog,
1108
- me as DialogClose,
1109
- he as DialogContent,
1110
- wt as DialogDescription,
1111
- bt as DialogTitle,
1112
- fe as DialogTrigger,
1113
- Le as DropdownMenu,
1114
- Fe as DropdownMenuContent,
1115
- je as DropdownMenuItem,
1116
- Ee as DropdownMenuSeparator,
1117
- Re as DropdownMenuTrigger,
1118
- we as EmptyState,
1119
- Pe as EnhancedSearchField,
1120
- Lt as ErrorState,
1121
- zt as FactoTheme,
1122
- jt as Field,
1123
- We as FilterChip,
1124
- z as Icon,
1125
- Gt as IconButton,
1126
- St as ListGroup,
1127
- Bt as ListRow,
1128
- Ae as ListSkeleton,
1129
- Rt as LoadingMore,
1130
- xt as LogoStack,
1131
- Vt as ModalFooter,
1132
- Ht as ModalHeader,
1133
- ke as Notice,
1134
- At as NotificationsProvider,
1135
- Et as OtpInput,
1136
- De as Popover,
1137
- Se as PopoverClose,
1138
- xe as PopoverContent,
1139
- Be as PopoverTrigger,
1140
- Wt as ResendCodeButton,
1141
- $e as SearchField,
1142
- oe as Select,
1143
- pe as Sheet,
1144
- ve as SheetClose,
1145
- be as SheetContent,
1146
- Ne as SheetDescription,
1147
- _e as SheetTitle,
1148
- ge as SheetTrigger,
1149
- at as Skeleton,
1150
- ye as Stack,
1151
- Ft as StepChecklist,
1152
- rt as Surface,
1153
- ie as Switch,
1154
- re as Tabs,
1155
- de as TabsContent,
1156
- se as TabsList,
1157
- le as TabsTrigger,
1158
- Nt as TextField,
1159
- ne as Textarea,
1160
- yt as Toast,
1161
- Ct as ToastAction,
1162
- It as ToastClose,
1163
- ot as ToastDescription,
1164
- kt as ToastProvider,
1165
- Tt as ToastTitle,
1166
- Mt as ToastViewport,
1167
- Ce as Tooltip,
1168
- Me as TooltipContent,
1169
- Te as TooltipProvider,
1170
- Ie as TooltipTrigger,
1171
- Ut as Widget,
1172
- te as WidgetAction,
1173
- Yt as WidgetAmount,
1174
- Jt as WidgetHeader,
1175
- Xt as WidgetKeyValue,
1176
- Qt as WidgetList,
1177
- ee as WidgetRow,
1178
- Ot as useToast
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
  };