@sawabona/forms 1.0.7 → 1.0.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.
|
@@ -9,7 +9,7 @@ var ze = (e, o, r) => o in e ? qe(e, o, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var r of ae(o))
|
|
10
10
|
Ae.call(o, r) && ze(e, r, o[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, j = (e, o) => et(e, tt(o));
|
|
13
13
|
var Ie = (e) => typeof e == "symbol" ? e : e + "", Fe = (e, o) => {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var t in e)
|
|
@@ -21,7 +21,7 @@ var Ie = (e) => typeof e == "symbol" ? e : e + "", Fe = (e, o) => {
|
|
|
21
21
|
};
|
|
22
22
|
import { jsxs as N, jsx as g } from "react/jsx-runtime";
|
|
23
23
|
import { useState as rt, useMemo as ot, useCallback as K, createContext as nt, useContext as st, useRef as it, useEffect as he } from "react";
|
|
24
|
-
import { motion as
|
|
24
|
+
import { motion as L, AnimatePresence as at } from "framer-motion";
|
|
25
25
|
import { Check as Ee, Star as lt, ChevronLeft as ct, ChevronRight as dt } from "lucide-react";
|
|
26
26
|
function mt({ schema: e, onSubmit: o }) {
|
|
27
27
|
var C;
|
|
@@ -36,23 +36,23 @@ function mt({ schema: e, onSubmit: o }) {
|
|
|
36
36
|
() => e.questions.findIndex((m) => m.id === r.currentStepId),
|
|
37
37
|
[e.questions, r.currentStepId]
|
|
38
38
|
), i = e.questions[n], s = K((m, u) => {
|
|
39
|
-
t((w) =>
|
|
40
|
-
answers:
|
|
39
|
+
t((w) => j(y({}, w), {
|
|
40
|
+
answers: j(y({}, w.answers), {
|
|
41
41
|
[m]: u
|
|
42
42
|
}),
|
|
43
43
|
// Clear error on modification
|
|
44
|
-
errors:
|
|
44
|
+
errors: j(y({}, w.errors), {
|
|
45
45
|
[m]: ""
|
|
46
46
|
})
|
|
47
47
|
}));
|
|
48
48
|
}, []), p = K((m, u) => {
|
|
49
49
|
t((w) => {
|
|
50
50
|
if (u === null) {
|
|
51
|
-
const
|
|
52
|
-
return
|
|
51
|
+
const F = w.errors, { [m]: A } = F, P = Fe(F, [Ie(m)]);
|
|
52
|
+
return j(y({}, w), { errors: P });
|
|
53
53
|
}
|
|
54
|
-
return
|
|
55
|
-
errors:
|
|
54
|
+
return j(y({}, w), {
|
|
55
|
+
errors: j(y({}, w.errors), { [m]: u })
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
}, []), c = K(() => {
|
|
@@ -66,14 +66,14 @@ function mt({ schema: e, onSubmit: o }) {
|
|
|
66
66
|
}, [e.questions]), v = K(() => {
|
|
67
67
|
if (!c()) return;
|
|
68
68
|
const m = b(i);
|
|
69
|
-
m === "submit" ? (t((u) =>
|
|
69
|
+
m === "submit" ? (t((u) => j(y({}, u), { isCompleted: !0 })), o == null || o(r.answers)) : t((u) => j(y({}, u), {
|
|
70
70
|
history: [...u.history, u.currentStepId],
|
|
71
71
|
currentStepId: m
|
|
72
72
|
}));
|
|
73
73
|
}, [i, r.answers, c, b, o]), h = K(() => {
|
|
74
74
|
if (r.history.length === 0) return;
|
|
75
75
|
const m = r.history[r.history.length - 1];
|
|
76
|
-
t((u) =>
|
|
76
|
+
t((u) => j(y({}, u), {
|
|
77
77
|
history: u.history.slice(0, -1),
|
|
78
78
|
currentStepId: m
|
|
79
79
|
}));
|
|
@@ -82,7 +82,7 @@ function mt({ schema: e, onSubmit: o }) {
|
|
|
82
82
|
console.warn(`Step ${m} does not exist`);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
t((w) =>
|
|
85
|
+
t((w) => j(y({}, w), {
|
|
86
86
|
history: [...w.history, w.currentStepId],
|
|
87
87
|
currentStepId: m
|
|
88
88
|
}));
|
|
@@ -97,7 +97,7 @@ function mt({ schema: e, onSubmit: o }) {
|
|
|
97
97
|
isCompleted: !1
|
|
98
98
|
});
|
|
99
99
|
}, [e.questions]);
|
|
100
|
-
return
|
|
100
|
+
return j(y({}, r), {
|
|
101
101
|
setAnswer: s,
|
|
102
102
|
nextStep: v,
|
|
103
103
|
prevStep: h,
|
|
@@ -109,23 +109,23 @@ function mt({ schema: e, onSubmit: o }) {
|
|
|
109
109
|
progress: n / e.questions.length * 100
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
const e = st(
|
|
112
|
+
const je = nt(void 0), re = () => {
|
|
113
|
+
const e = st(je);
|
|
114
114
|
if (!e)
|
|
115
115
|
throw new Error("useFormContext must be used within a FormProvider");
|
|
116
116
|
return e;
|
|
117
117
|
};
|
|
118
|
-
function
|
|
118
|
+
function Ge(e) {
|
|
119
119
|
var o, r, t = "";
|
|
120
120
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
121
121
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
122
122
|
var n = e.length;
|
|
123
|
-
for (o = 0; o < n; o++) e[o] && (r =
|
|
123
|
+
for (o = 0; o < n; o++) e[o] && (r = Ge(e[o])) && (t && (t += " "), t += r);
|
|
124
124
|
} else for (r in e) e[r] && (t && (t += " "), t += r);
|
|
125
125
|
return t;
|
|
126
126
|
}
|
|
127
127
|
function pt() {
|
|
128
|
-
for (var e, o, r = 0, t = "", n = arguments.length; r < n; r++) (e = arguments[r]) && (o =
|
|
128
|
+
for (var e, o, r = 0, t = "", n = arguments.length; r < n; r++) (e = arguments[r]) && (o = Ge(e)) && (t && (t += " "), t += o);
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
131
|
const ut = (e, o) => {
|
|
@@ -361,14 +361,14 @@ const ut = (e, o) => {
|
|
|
361
361
|
}
|
|
362
362
|
u = !1;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
if (s.indexOf(
|
|
364
|
+
const F = k.length === 0 ? "" : k.length === 1 ? k[0] : i(k).join(":"), A = z ? F + ge : F, P = A + w;
|
|
365
|
+
if (s.indexOf(P) > -1)
|
|
366
366
|
continue;
|
|
367
|
-
s.push(
|
|
368
|
-
const
|
|
369
|
-
for (let
|
|
370
|
-
const O =
|
|
371
|
-
s.push(
|
|
367
|
+
s.push(P);
|
|
368
|
+
const R = n(w, u);
|
|
369
|
+
for (let E = 0; E < R.length; ++E) {
|
|
370
|
+
const O = R[E];
|
|
371
|
+
s.push(A + O);
|
|
372
372
|
}
|
|
373
373
|
c = v + (c.length > 0 ? " " + c : c);
|
|
374
374
|
}
|
|
@@ -398,14 +398,14 @@ const ut = (e, o) => {
|
|
|
398
398
|
return n(c, v), v;
|
|
399
399
|
};
|
|
400
400
|
return i = s, (...c) => i(Pt(...c));
|
|
401
|
-
}, Mt = [],
|
|
401
|
+
}, Mt = [], I = (e) => {
|
|
402
402
|
const o = (r) => r[e] || Mt;
|
|
403
403
|
return o.isThemeGetter = !0, o;
|
|
404
|
-
}, _e = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, De = /^\((?:(\w[\w-]*):)?(.+)\)$/i, Lt = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, Et = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,
|
|
404
|
+
}, _e = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, De = /^\((?:(\w[\w-]*):)?(.+)\)$/i, Lt = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, Et = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, jt = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Gt = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Ot = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Bt = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, Q = (e) => Lt.test(e), x = (e) => !!e && !Number.isNaN(Number(e)), H = (e) => !!e && Number.isInteger(Number(e)), be = (e) => e.endsWith("%") && x(e.slice(0, -1)), _ = (e) => Et.test(e), Ue = () => !0, Wt = (e) => (
|
|
405
405
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
406
406
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
407
407
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
408
|
-
|
|
408
|
+
jt.test(e) && !Gt.test(e)
|
|
409
409
|
), we = () => !1, Vt = (e) => Ot.test(e), _t = (e) => Bt.test(e), Dt = (e) => !a(e) && !l(e), Ut = (e) => X(e, He, we), a = (e) => _e.test(e), J = (e) => X(e, Xe, Wt), Te = (e) => X(e, qt, x), Kt = (e) => X(e, Je, Ue), Qt = (e) => X(e, Ye, we), Me = (e) => X(e, Ke, we), Ht = (e) => X(e, Qe, _t), le = (e) => X(e, Ze, Vt), l = (e) => De.test(e), te = (e) => Z(e, Xe), Xt = (e) => Z(e, Ye), Le = (e) => Z(e, Ke), Yt = (e) => Z(e, He), Jt = (e) => Z(e, Qe), ce = (e) => Z(e, Ze, !0), Zt = (e) => Z(e, Je, !0), X = (e, o, r) => {
|
|
410
410
|
const t = _e.exec(e);
|
|
411
411
|
return t ? t[1] ? o(t[1]) : r(t[2]) : !1;
|
|
@@ -413,7 +413,7 @@ const ut = (e, o) => {
|
|
|
413
413
|
const t = De.exec(e);
|
|
414
414
|
return t ? t[1] ? o(t[1]) : r : !1;
|
|
415
415
|
}, Ke = (e) => e === "position" || e === "percentage", Qe = (e) => e === "image" || e === "url", He = (e) => e === "length" || e === "size" || e === "bg-size", Xe = (e) => e === "length", qt = (e) => e === "number", Ye = (e) => e === "family-name", Je = (e) => e === "number" || e === "weight", Ze = (e) => e === "shadow", er = () => {
|
|
416
|
-
const e =
|
|
416
|
+
const e = I("color"), o = I("font"), r = I("text"), t = I("font-weight"), n = I("tracking"), i = I("leading"), s = I("breakpoint"), p = I("container"), c = I("spacing"), b = I("radius"), v = I("shadow"), h = I("inset-shadow"), k = I("text-shadow"), z = I("drop-shadow"), C = I("blur"), m = I("perspective"), u = I("aspect"), w = I("ease"), F = I("animate"), A = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], P = () => [
|
|
417
417
|
"center",
|
|
418
418
|
"top",
|
|
419
419
|
"bottom",
|
|
@@ -431,15 +431,15 @@ const ut = (e, o) => {
|
|
|
431
431
|
"bottom-left",
|
|
432
432
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
433
433
|
"left-bottom"
|
|
434
|
-
],
|
|
434
|
+
], R = () => [...P(), l, a], E = () => ["auto", "hidden", "clip", "visible", "scroll"], O = () => ["auto", "contain", "none"], d = () => [l, a, c], S = () => [Q, "full", "auto", ...d()], D = () => [H, "none", "subgrid", l, a], U = () => ["auto", {
|
|
435
435
|
span: ["full", H, l, a]
|
|
436
|
-
}, H, l, a],
|
|
436
|
+
}, H, l, a], V = () => [H, "auto", l, a], G = () => ["auto", "min", "max", "fr", l, a], ee = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], q = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], B = () => ["auto", ...d()], Y = () => [Q, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...d()], me = () => [Q, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...d()], pe = () => [Q, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...d()], f = () => [e, l, a], ye = () => [...P(), Le, Me, {
|
|
437
437
|
position: [l, a]
|
|
438
438
|
}], ve = () => ["no-repeat", {
|
|
439
439
|
repeat: ["", "x", "y", "space", "round"]
|
|
440
440
|
}], ke = () => ["auto", "cover", "contain", Yt, Ut, {
|
|
441
441
|
size: [l, a]
|
|
442
|
-
}], ue = () => [be, te, J],
|
|
442
|
+
}], ue = () => [be, te, J], T = () => [
|
|
443
443
|
// Deprecated since Tailwind CSS v4.0.0
|
|
444
444
|
"",
|
|
445
445
|
"none",
|
|
@@ -447,7 +447,7 @@ const ut = (e, o) => {
|
|
|
447
447
|
b,
|
|
448
448
|
l,
|
|
449
449
|
a
|
|
450
|
-
],
|
|
450
|
+
], M = () => ["", x, te, J], oe = () => ["solid", "dashed", "dotted", "double"], Ce = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], $ = () => [x, be, Le, Me], Se = () => [
|
|
451
451
|
// Deprecated since Tailwind CSS v4.0.0
|
|
452
452
|
"",
|
|
453
453
|
"none",
|
|
@@ -507,14 +507,14 @@ const ut = (e, o) => {
|
|
|
507
507
|
* @see https://tailwindcss.com/docs/break-after
|
|
508
508
|
*/
|
|
509
509
|
"break-after": [{
|
|
510
|
-
"break-after":
|
|
510
|
+
"break-after": A()
|
|
511
511
|
}],
|
|
512
512
|
/**
|
|
513
513
|
* Break Before
|
|
514
514
|
* @see https://tailwindcss.com/docs/break-before
|
|
515
515
|
*/
|
|
516
516
|
"break-before": [{
|
|
517
|
-
"break-before":
|
|
517
|
+
"break-before": A()
|
|
518
518
|
}],
|
|
519
519
|
/**
|
|
520
520
|
* Break Inside
|
|
@@ -578,28 +578,28 @@ const ut = (e, o) => {
|
|
|
578
578
|
* @see https://tailwindcss.com/docs/object-position
|
|
579
579
|
*/
|
|
580
580
|
"object-position": [{
|
|
581
|
-
object:
|
|
581
|
+
object: R()
|
|
582
582
|
}],
|
|
583
583
|
/**
|
|
584
584
|
* Overflow
|
|
585
585
|
* @see https://tailwindcss.com/docs/overflow
|
|
586
586
|
*/
|
|
587
587
|
overflow: [{
|
|
588
|
-
overflow:
|
|
588
|
+
overflow: E()
|
|
589
589
|
}],
|
|
590
590
|
/**
|
|
591
591
|
* Overflow X
|
|
592
592
|
* @see https://tailwindcss.com/docs/overflow
|
|
593
593
|
*/
|
|
594
594
|
"overflow-x": [{
|
|
595
|
-
"overflow-x":
|
|
595
|
+
"overflow-x": E()
|
|
596
596
|
}],
|
|
597
597
|
/**
|
|
598
598
|
* Overflow Y
|
|
599
599
|
* @see https://tailwindcss.com/docs/overflow
|
|
600
600
|
*/
|
|
601
601
|
"overflow-y": [{
|
|
602
|
-
"overflow-y":
|
|
602
|
+
"overflow-y": E()
|
|
603
603
|
}],
|
|
604
604
|
/**
|
|
605
605
|
* Overscroll Behavior
|
|
@@ -799,14 +799,14 @@ const ut = (e, o) => {
|
|
|
799
799
|
* @see https://tailwindcss.com/docs/grid-column
|
|
800
800
|
*/
|
|
801
801
|
"col-start": [{
|
|
802
|
-
"col-start":
|
|
802
|
+
"col-start": V()
|
|
803
803
|
}],
|
|
804
804
|
/**
|
|
805
805
|
* Grid Column End
|
|
806
806
|
* @see https://tailwindcss.com/docs/grid-column
|
|
807
807
|
*/
|
|
808
808
|
"col-end": [{
|
|
809
|
-
"col-end":
|
|
809
|
+
"col-end": V()
|
|
810
810
|
}],
|
|
811
811
|
/**
|
|
812
812
|
* Grid Template Rows
|
|
@@ -827,14 +827,14 @@ const ut = (e, o) => {
|
|
|
827
827
|
* @see https://tailwindcss.com/docs/grid-row
|
|
828
828
|
*/
|
|
829
829
|
"row-start": [{
|
|
830
|
-
"row-start":
|
|
830
|
+
"row-start": V()
|
|
831
831
|
}],
|
|
832
832
|
/**
|
|
833
833
|
* Grid Row End
|
|
834
834
|
* @see https://tailwindcss.com/docs/grid-row
|
|
835
835
|
*/
|
|
836
836
|
"row-end": [{
|
|
837
|
-
"row-end":
|
|
837
|
+
"row-end": V()
|
|
838
838
|
}],
|
|
839
839
|
/**
|
|
840
840
|
* Grid Auto Flow
|
|
@@ -848,14 +848,14 @@ const ut = (e, o) => {
|
|
|
848
848
|
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
849
849
|
*/
|
|
850
850
|
"auto-cols": [{
|
|
851
|
-
"auto-cols":
|
|
851
|
+
"auto-cols": G()
|
|
852
852
|
}],
|
|
853
853
|
/**
|
|
854
854
|
* Grid Auto Rows
|
|
855
855
|
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
856
856
|
*/
|
|
857
857
|
"auto-rows": [{
|
|
858
|
-
"auto-rows":
|
|
858
|
+
"auto-rows": G()
|
|
859
859
|
}],
|
|
860
860
|
/**
|
|
861
861
|
* Gap
|
|
@@ -1595,189 +1595,189 @@ const ut = (e, o) => {
|
|
|
1595
1595
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1596
1596
|
*/
|
|
1597
1597
|
rounded: [{
|
|
1598
|
-
rounded:
|
|
1598
|
+
rounded: T()
|
|
1599
1599
|
}],
|
|
1600
1600
|
/**
|
|
1601
1601
|
* Border Radius Start
|
|
1602
1602
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1603
1603
|
*/
|
|
1604
1604
|
"rounded-s": [{
|
|
1605
|
-
"rounded-s":
|
|
1605
|
+
"rounded-s": T()
|
|
1606
1606
|
}],
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Border Radius End
|
|
1609
1609
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1610
1610
|
*/
|
|
1611
1611
|
"rounded-e": [{
|
|
1612
|
-
"rounded-e":
|
|
1612
|
+
"rounded-e": T()
|
|
1613
1613
|
}],
|
|
1614
1614
|
/**
|
|
1615
1615
|
* Border Radius Top
|
|
1616
1616
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1617
1617
|
*/
|
|
1618
1618
|
"rounded-t": [{
|
|
1619
|
-
"rounded-t":
|
|
1619
|
+
"rounded-t": T()
|
|
1620
1620
|
}],
|
|
1621
1621
|
/**
|
|
1622
1622
|
* Border Radius Right
|
|
1623
1623
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1624
1624
|
*/
|
|
1625
1625
|
"rounded-r": [{
|
|
1626
|
-
"rounded-r":
|
|
1626
|
+
"rounded-r": T()
|
|
1627
1627
|
}],
|
|
1628
1628
|
/**
|
|
1629
1629
|
* Border Radius Bottom
|
|
1630
1630
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1631
1631
|
*/
|
|
1632
1632
|
"rounded-b": [{
|
|
1633
|
-
"rounded-b":
|
|
1633
|
+
"rounded-b": T()
|
|
1634
1634
|
}],
|
|
1635
1635
|
/**
|
|
1636
1636
|
* Border Radius Left
|
|
1637
1637
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1638
1638
|
*/
|
|
1639
1639
|
"rounded-l": [{
|
|
1640
|
-
"rounded-l":
|
|
1640
|
+
"rounded-l": T()
|
|
1641
1641
|
}],
|
|
1642
1642
|
/**
|
|
1643
1643
|
* Border Radius Start Start
|
|
1644
1644
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1645
1645
|
*/
|
|
1646
1646
|
"rounded-ss": [{
|
|
1647
|
-
"rounded-ss":
|
|
1647
|
+
"rounded-ss": T()
|
|
1648
1648
|
}],
|
|
1649
1649
|
/**
|
|
1650
1650
|
* Border Radius Start End
|
|
1651
1651
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1652
1652
|
*/
|
|
1653
1653
|
"rounded-se": [{
|
|
1654
|
-
"rounded-se":
|
|
1654
|
+
"rounded-se": T()
|
|
1655
1655
|
}],
|
|
1656
1656
|
/**
|
|
1657
1657
|
* Border Radius End End
|
|
1658
1658
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1659
1659
|
*/
|
|
1660
1660
|
"rounded-ee": [{
|
|
1661
|
-
"rounded-ee":
|
|
1661
|
+
"rounded-ee": T()
|
|
1662
1662
|
}],
|
|
1663
1663
|
/**
|
|
1664
1664
|
* Border Radius End Start
|
|
1665
1665
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1666
1666
|
*/
|
|
1667
1667
|
"rounded-es": [{
|
|
1668
|
-
"rounded-es":
|
|
1668
|
+
"rounded-es": T()
|
|
1669
1669
|
}],
|
|
1670
1670
|
/**
|
|
1671
1671
|
* Border Radius Top Left
|
|
1672
1672
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1673
1673
|
*/
|
|
1674
1674
|
"rounded-tl": [{
|
|
1675
|
-
"rounded-tl":
|
|
1675
|
+
"rounded-tl": T()
|
|
1676
1676
|
}],
|
|
1677
1677
|
/**
|
|
1678
1678
|
* Border Radius Top Right
|
|
1679
1679
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1680
1680
|
*/
|
|
1681
1681
|
"rounded-tr": [{
|
|
1682
|
-
"rounded-tr":
|
|
1682
|
+
"rounded-tr": T()
|
|
1683
1683
|
}],
|
|
1684
1684
|
/**
|
|
1685
1685
|
* Border Radius Bottom Right
|
|
1686
1686
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1687
1687
|
*/
|
|
1688
1688
|
"rounded-br": [{
|
|
1689
|
-
"rounded-br":
|
|
1689
|
+
"rounded-br": T()
|
|
1690
1690
|
}],
|
|
1691
1691
|
/**
|
|
1692
1692
|
* Border Radius Bottom Left
|
|
1693
1693
|
* @see https://tailwindcss.com/docs/border-radius
|
|
1694
1694
|
*/
|
|
1695
1695
|
"rounded-bl": [{
|
|
1696
|
-
"rounded-bl":
|
|
1696
|
+
"rounded-bl": T()
|
|
1697
1697
|
}],
|
|
1698
1698
|
/**
|
|
1699
1699
|
* Border Width
|
|
1700
1700
|
* @see https://tailwindcss.com/docs/border-width
|
|
1701
1701
|
*/
|
|
1702
1702
|
"border-w": [{
|
|
1703
|
-
border:
|
|
1703
|
+
border: M()
|
|
1704
1704
|
}],
|
|
1705
1705
|
/**
|
|
1706
1706
|
* Border Width Inline
|
|
1707
1707
|
* @see https://tailwindcss.com/docs/border-width
|
|
1708
1708
|
*/
|
|
1709
1709
|
"border-w-x": [{
|
|
1710
|
-
"border-x":
|
|
1710
|
+
"border-x": M()
|
|
1711
1711
|
}],
|
|
1712
1712
|
/**
|
|
1713
1713
|
* Border Width Block
|
|
1714
1714
|
* @see https://tailwindcss.com/docs/border-width
|
|
1715
1715
|
*/
|
|
1716
1716
|
"border-w-y": [{
|
|
1717
|
-
"border-y":
|
|
1717
|
+
"border-y": M()
|
|
1718
1718
|
}],
|
|
1719
1719
|
/**
|
|
1720
1720
|
* Border Width Inline Start
|
|
1721
1721
|
* @see https://tailwindcss.com/docs/border-width
|
|
1722
1722
|
*/
|
|
1723
1723
|
"border-w-s": [{
|
|
1724
|
-
"border-s":
|
|
1724
|
+
"border-s": M()
|
|
1725
1725
|
}],
|
|
1726
1726
|
/**
|
|
1727
1727
|
* Border Width Inline End
|
|
1728
1728
|
* @see https://tailwindcss.com/docs/border-width
|
|
1729
1729
|
*/
|
|
1730
1730
|
"border-w-e": [{
|
|
1731
|
-
"border-e":
|
|
1731
|
+
"border-e": M()
|
|
1732
1732
|
}],
|
|
1733
1733
|
/**
|
|
1734
1734
|
* Border Width Block Start
|
|
1735
1735
|
* @see https://tailwindcss.com/docs/border-width
|
|
1736
1736
|
*/
|
|
1737
1737
|
"border-w-bs": [{
|
|
1738
|
-
"border-bs":
|
|
1738
|
+
"border-bs": M()
|
|
1739
1739
|
}],
|
|
1740
1740
|
/**
|
|
1741
1741
|
* Border Width Block End
|
|
1742
1742
|
* @see https://tailwindcss.com/docs/border-width
|
|
1743
1743
|
*/
|
|
1744
1744
|
"border-w-be": [{
|
|
1745
|
-
"border-be":
|
|
1745
|
+
"border-be": M()
|
|
1746
1746
|
}],
|
|
1747
1747
|
/**
|
|
1748
1748
|
* Border Width Top
|
|
1749
1749
|
* @see https://tailwindcss.com/docs/border-width
|
|
1750
1750
|
*/
|
|
1751
1751
|
"border-w-t": [{
|
|
1752
|
-
"border-t":
|
|
1752
|
+
"border-t": M()
|
|
1753
1753
|
}],
|
|
1754
1754
|
/**
|
|
1755
1755
|
* Border Width Right
|
|
1756
1756
|
* @see https://tailwindcss.com/docs/border-width
|
|
1757
1757
|
*/
|
|
1758
1758
|
"border-w-r": [{
|
|
1759
|
-
"border-r":
|
|
1759
|
+
"border-r": M()
|
|
1760
1760
|
}],
|
|
1761
1761
|
/**
|
|
1762
1762
|
* Border Width Bottom
|
|
1763
1763
|
* @see https://tailwindcss.com/docs/border-width
|
|
1764
1764
|
*/
|
|
1765
1765
|
"border-w-b": [{
|
|
1766
|
-
"border-b":
|
|
1766
|
+
"border-b": M()
|
|
1767
1767
|
}],
|
|
1768
1768
|
/**
|
|
1769
1769
|
* Border Width Left
|
|
1770
1770
|
* @see https://tailwindcss.com/docs/border-width
|
|
1771
1771
|
*/
|
|
1772
1772
|
"border-w-l": [{
|
|
1773
|
-
"border-l":
|
|
1773
|
+
"border-l": M()
|
|
1774
1774
|
}],
|
|
1775
1775
|
/**
|
|
1776
1776
|
* Divide Width X
|
|
1777
1777
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1778
1778
|
*/
|
|
1779
1779
|
"divide-x": [{
|
|
1780
|
-
"divide-x":
|
|
1780
|
+
"divide-x": M()
|
|
1781
1781
|
}],
|
|
1782
1782
|
/**
|
|
1783
1783
|
* Divide Width X Reverse
|
|
@@ -1789,7 +1789,7 @@ const ut = (e, o) => {
|
|
|
1789
1789
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1790
1790
|
*/
|
|
1791
1791
|
"divide-y": [{
|
|
1792
|
-
"divide-y":
|
|
1792
|
+
"divide-y": M()
|
|
1793
1793
|
}],
|
|
1794
1794
|
/**
|
|
1795
1795
|
* Divide Width Y Reverse
|
|
@@ -1965,7 +1965,7 @@ const ut = (e, o) => {
|
|
|
1965
1965
|
* @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
|
|
1966
1966
|
*/
|
|
1967
1967
|
"ring-w": [{
|
|
1968
|
-
ring:
|
|
1968
|
+
ring: M()
|
|
1969
1969
|
}],
|
|
1970
1970
|
/**
|
|
1971
1971
|
* Ring Width Inset
|
|
@@ -2004,7 +2004,7 @@ const ut = (e, o) => {
|
|
|
2004
2004
|
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
|
|
2005
2005
|
*/
|
|
2006
2006
|
"inset-ring-w": [{
|
|
2007
|
-
"inset-ring":
|
|
2007
|
+
"inset-ring": M()
|
|
2008
2008
|
}],
|
|
2009
2009
|
/**
|
|
2010
2010
|
* Inset Ring Color
|
|
@@ -2178,7 +2178,7 @@ const ut = (e, o) => {
|
|
|
2178
2178
|
}]
|
|
2179
2179
|
}],
|
|
2180
2180
|
"mask-image-radial-pos": [{
|
|
2181
|
-
"mask-radial-at":
|
|
2181
|
+
"mask-radial-at": P()
|
|
2182
2182
|
}],
|
|
2183
2183
|
"mask-image-conic-pos": [{
|
|
2184
2184
|
"mask-conic": [x]
|
|
@@ -2501,7 +2501,7 @@ const ut = (e, o) => {
|
|
|
2501
2501
|
* @see https://tailwindcss.com/docs/animation
|
|
2502
2502
|
*/
|
|
2503
2503
|
animate: [{
|
|
2504
|
-
animate: ["none",
|
|
2504
|
+
animate: ["none", F, l, a]
|
|
2505
2505
|
}],
|
|
2506
2506
|
// ------------------
|
|
2507
2507
|
// --- Transforms ---
|
|
@@ -2525,7 +2525,7 @@ const ut = (e, o) => {
|
|
|
2525
2525
|
* @see https://tailwindcss.com/docs/perspective-origin
|
|
2526
2526
|
*/
|
|
2527
2527
|
"perspective-origin": [{
|
|
2528
|
-
"perspective-origin":
|
|
2528
|
+
"perspective-origin": R()
|
|
2529
2529
|
}],
|
|
2530
2530
|
/**
|
|
2531
2531
|
* Rotate
|
|
@@ -2621,7 +2621,7 @@ const ut = (e, o) => {
|
|
|
2621
2621
|
* @see https://tailwindcss.com/docs/transform-origin
|
|
2622
2622
|
*/
|
|
2623
2623
|
"transform-origin": [{
|
|
2624
|
-
origin:
|
|
2624
|
+
origin: R()
|
|
2625
2625
|
}],
|
|
2626
2626
|
/**
|
|
2627
2627
|
* Transform Style
|
|
@@ -3042,7 +3042,7 @@ const ut = (e, o) => {
|
|
|
3042
3042
|
orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
|
|
3043
3043
|
};
|
|
3044
3044
|
}, tr = /* @__PURE__ */ Tt(er);
|
|
3045
|
-
function
|
|
3045
|
+
function W(...e) {
|
|
3046
3046
|
return tr(pt(e));
|
|
3047
3047
|
}
|
|
3048
3048
|
function rr(e, o, r) {
|
|
@@ -3065,7 +3065,7 @@ function rr(e, o, r) {
|
|
|
3065
3065
|
return e;
|
|
3066
3066
|
}
|
|
3067
3067
|
function or({ question: e }) {
|
|
3068
|
-
var C, m, u, w,
|
|
3068
|
+
var C, m, u, w, F, A, P, R, E, O;
|
|
3069
3069
|
const { answers: o, setAnswer: r, nextStep: t, schema: n } = re(), i = o[e.id], s = i != null ? String(i) : "", p = it(null), c = n.questions[0].id === e.id, b = !n.disableAutoFocus || !c;
|
|
3070
3070
|
he(() => {
|
|
3071
3071
|
if (b) {
|
|
@@ -3077,29 +3077,29 @@ function or({ question: e }) {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
}, [e.id, b]);
|
|
3079
3079
|
const v = (d) => {
|
|
3080
|
-
var U,
|
|
3080
|
+
var U, V, G;
|
|
3081
3081
|
let S = d.target.value;
|
|
3082
|
-
((U = e.validation) != null && U.maskType || (
|
|
3083
|
-
const D = ((
|
|
3082
|
+
((U = e.validation) != null && U.maskType || (V = e.validation) != null && V.mask) && (S = rr(S, e.validation.maskType, e.validation.mask));
|
|
3083
|
+
const D = ((G = e.validation) == null ? void 0 : G.maxLength) || 2048;
|
|
3084
3084
|
if (S.length > D && (S = S.slice(0, D)), e.type === "number") {
|
|
3085
3085
|
const ee = S === "" ? "" : parseFloat(S);
|
|
3086
3086
|
r(e.id, ee);
|
|
3087
3087
|
} else
|
|
3088
3088
|
r(e.id, S);
|
|
3089
3089
|
}, h = () => {
|
|
3090
|
-
var d, S, D, U,
|
|
3090
|
+
var d, S, D, U, V;
|
|
3091
3091
|
if ((d = e.validation) != null && d.required && !s) return !1;
|
|
3092
3092
|
if (s) {
|
|
3093
3093
|
if ((S = e.validation) != null && S.minLength && s.length < e.validation.minLength || e.type === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)) return !1;
|
|
3094
3094
|
if ((D = e.validation) != null && D.pattern)
|
|
3095
3095
|
try {
|
|
3096
3096
|
if (!new RegExp(e.validation.pattern).test(s)) return !1;
|
|
3097
|
-
} catch (
|
|
3098
|
-
console.error("Invalid regex pattern in schema",
|
|
3097
|
+
} catch (G) {
|
|
3098
|
+
console.error("Invalid regex pattern in schema", G);
|
|
3099
3099
|
}
|
|
3100
3100
|
if (e.type === "number") {
|
|
3101
|
-
const
|
|
3102
|
-
if (!isNaN(
|
|
3101
|
+
const G = parseFloat(s);
|
|
3102
|
+
if (!isNaN(G) && (((U = e.validation) == null ? void 0 : U.min) !== void 0 && G < e.validation.min || ((V = e.validation) == null ? void 0 : V.max) !== void 0 && G > e.validation.max))
|
|
3103
3103
|
return !1;
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
@@ -3128,16 +3128,16 @@ function or({ question: e }) {
|
|
|
3128
3128
|
maxLength: ((m = e.validation) == null ? void 0 : m.maxLength) || 2048,
|
|
3129
3129
|
min: (u = e.validation) == null ? void 0 : u.min,
|
|
3130
3130
|
max: (w = e.validation) == null ? void 0 : w.max,
|
|
3131
|
-
pattern: (
|
|
3132
|
-
className:
|
|
3131
|
+
pattern: (F = e.validation) == null ? void 0 : F.pattern,
|
|
3132
|
+
className: W(
|
|
3133
3133
|
`w-full bg-transparent border-b-2 border-sw-text-secondary/20
|
|
3134
3134
|
py-4 text-2xl md:text-3xl font-medium outline-none transition-colors
|
|
3135
3135
|
placeholder:text-sw-text-secondary/30
|
|
3136
3136
|
focus:border-sw-primary
|
|
3137
3137
|
font-sw-heading`,
|
|
3138
|
-
(
|
|
3138
|
+
(P = (A = n.theme) == null ? void 0 : A.customClasses) == null ? void 0 : P.input
|
|
3139
3139
|
),
|
|
3140
|
-
style: y(y({}, ((
|
|
3140
|
+
style: y(y({}, ((R = n.theme) == null ? void 0 : R.labelFont) && { fontFamily: "var(--font-sw-label)" }), ((E = n.theme) == null ? void 0 : E.labelFontSize) && { fontSize: "var(--size-sw-label)" })
|
|
3141
3141
|
}
|
|
3142
3142
|
),
|
|
3143
3143
|
void 0,
|
|
@@ -3171,16 +3171,16 @@ function nr({ question: e }) {
|
|
|
3171
3171
|
scrollbarColor: "var(--sw-primary) transparent"
|
|
3172
3172
|
},
|
|
3173
3173
|
children: (v = e.options) == null ? void 0 : v.map((h, k) => {
|
|
3174
|
-
var C, m, u, w,
|
|
3174
|
+
var C, m, u, w, F, A, P, R, E, O;
|
|
3175
3175
|
const z = i ? p.includes(h.value) : p === h.value;
|
|
3176
3176
|
return /* @__PURE__ */ N(
|
|
3177
|
-
|
|
3177
|
+
L.button,
|
|
3178
3178
|
{
|
|
3179
3179
|
initial: { opacity: 0, y: 10 },
|
|
3180
3180
|
animate: { opacity: 1, y: 0 },
|
|
3181
3181
|
transition: { delay: Math.min(k * 0.05, 0.5) },
|
|
3182
3182
|
onClick: () => c(h.value),
|
|
3183
|
-
className:
|
|
3183
|
+
className: W(
|
|
3184
3184
|
`w-full text-left p-4 rounded-lg border-2 transition-all duration-200
|
|
3185
3185
|
flex items-center justify-between group flex-shrink-0`,
|
|
3186
3186
|
z ? "border-sw-primary bg-sw-primary/5 text-sw-primary" : "border-sw-text-secondary/10 hover:border-sw-primary/50 hover:bg-sw-primary/5",
|
|
@@ -3191,21 +3191,21 @@ function nr({ question: e }) {
|
|
|
3191
3191
|
padding: "var(--sw-option-padding, 1rem)",
|
|
3192
3192
|
borderRadius: "var(--sw-option-radius, 0.5rem)",
|
|
3193
3193
|
borderWidth: "var(--sw-option-border, 2px)"
|
|
3194
|
-
}, z && ((
|
|
3194
|
+
}, z && ((F = n.theme) != null && F.optionActiveColor) ? {
|
|
3195
3195
|
borderColor: "var(--sw-option-active)"
|
|
3196
3196
|
} : {}),
|
|
3197
3197
|
children: [
|
|
3198
|
-
/* @__PURE__ */ N("span", { className: "text-base md:text-lg font-medium flex items-center gap-3 w-full", style: y(y({}, ((
|
|
3198
|
+
/* @__PURE__ */ N("span", { className: "text-base md:text-lg font-medium flex items-center gap-3 w-full", style: y(y({}, ((A = n.theme) == null ? void 0 : A.labelFont) && { fontFamily: "var(--font-sw-label)" }), ((P = n.theme) == null ? void 0 : P.labelFontSize) && { fontSize: "var(--size-sw-label)" }), children: [
|
|
3199
3199
|
/* @__PURE__ */ g("span", { className: `
|
|
3200
3200
|
flex-shrink-0 w-5 h-5 md:w-6 md:h-6 rounded-full border-2 flex items-center justify-center transition-colors
|
|
3201
3201
|
${z ? "border-sw-primary bg-sw-primary" : "border-sw-text-secondary/30 group-hover:border-sw-primary/50"}
|
|
3202
|
-
`, style: y({}, z && ((
|
|
3202
|
+
`, style: y({}, z && ((R = n.theme) != null && R.optionActiveColor) ? {
|
|
3203
3203
|
borderColor: "var(--sw-option-active)",
|
|
3204
3204
|
backgroundColor: "var(--sw-option-active)"
|
|
3205
3205
|
} : {}), children: z && /* @__PURE__ */ g(Ee, { size: 14, className: "text-sw-background" }) }),
|
|
3206
3206
|
/* @__PURE__ */ g("span", { className: "break-words whitespace-pre-wrap", children: h.label })
|
|
3207
3207
|
] }),
|
|
3208
|
-
!((
|
|
3208
|
+
!((E = n.i18n) != null && E.hideSelectText) && /* @__PURE__ */ N("span", { className: "opacity-0 group-hover:opacity-100 transition-opacity text-[10px] md:text-xs font-mono uppercase tracking-widest text-sw-text-secondary/50 flex-shrink-0 ml-4 hidden sm:inline-block", children: [
|
|
3209
3209
|
((O = n.i18n) == null ? void 0 : O.selectKey) || "Select",
|
|
3210
3210
|
" ",
|
|
3211
3211
|
/* @__PURE__ */ N("span", { className: "hidden md:inline", children: [
|
|
@@ -3229,7 +3229,7 @@ function sr({ question: e }) {
|
|
|
3229
3229
|
var h, k, z, C;
|
|
3230
3230
|
const b = c + 1, v = b <= n;
|
|
3231
3231
|
return /* @__PURE__ */ g(
|
|
3232
|
-
|
|
3232
|
+
L.button,
|
|
3233
3233
|
{
|
|
3234
3234
|
initial: { opacity: 0, scale: 0 },
|
|
3235
3235
|
animate: { opacity: 1, scale: 1 },
|
|
@@ -3237,7 +3237,7 @@ function sr({ question: e }) {
|
|
|
3237
3237
|
onClick: () => r(e.id, b),
|
|
3238
3238
|
whileHover: { scale: 1.2, rotate: 5 },
|
|
3239
3239
|
whileTap: { scale: 0.9 },
|
|
3240
|
-
className:
|
|
3240
|
+
className: W(
|
|
3241
3241
|
"focus:outline-none",
|
|
3242
3242
|
(k = (h = t.theme) == null ? void 0 : h.customClasses) == null ? void 0 : k.option,
|
|
3243
3243
|
v && ((C = (z = t.theme) == null ? void 0 : z.customClasses) == null ? void 0 : C.optionActive)
|
|
@@ -3256,7 +3256,7 @@ function sr({ question: e }) {
|
|
|
3256
3256
|
/* @__PURE__ */ N("div", { className: "flex justify-between w-full max-w-[300px] md:max-w-[400px] px-2 items-center", children: [
|
|
3257
3257
|
/* @__PURE__ */ g("span", { className: "text-sm md:text-base font-medium text-sw-text-secondary/50 uppercase tracking-wide", children: e.minLabel || "Poor" }),
|
|
3258
3258
|
/* @__PURE__ */ g(
|
|
3259
|
-
|
|
3259
|
+
L.div,
|
|
3260
3260
|
{
|
|
3261
3261
|
initial: { opacity: 0, scale: 0.8 },
|
|
3262
3262
|
animate: { opacity: n ? 1 : 0, scale: n ? 1 : 0.8 },
|
|
@@ -3273,12 +3273,12 @@ function ir({ question: e }) {
|
|
|
3273
3273
|
const { schema: o } = re(), r = o.questions.findIndex((u) => u.id === e.id) + 1, t = o.questions.length, n = {
|
|
3274
3274
|
hidden: { opacity: 0, y: 20 },
|
|
3275
3275
|
visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.22, 1, 0.36, 1] } }
|
|
3276
|
-
}, i = (u) => u && u.replace(/\{\{(\w+)\}\}/g, (w,
|
|
3277
|
-
const
|
|
3278
|
-
return
|
|
3276
|
+
}, i = (u) => u && u.replace(/\{\{(\w+)\}\}/g, (w, F) => {
|
|
3277
|
+
const A = s.answers[F];
|
|
3278
|
+
return A != null ? String(A) : "";
|
|
3279
3279
|
}), s = re();
|
|
3280
3280
|
return /* @__PURE__ */ N(
|
|
3281
|
-
|
|
3281
|
+
L.div,
|
|
3282
3282
|
{
|
|
3283
3283
|
className: "flex flex-col gap-8 w-full max-w-4xl mx-auto",
|
|
3284
3284
|
initial: "hidden",
|
|
@@ -3288,16 +3288,16 @@ function ir({ question: e }) {
|
|
|
3288
3288
|
},
|
|
3289
3289
|
children: [
|
|
3290
3290
|
/* @__PURE__ */ N("div", { className: "flex flex-col gap-2", children: [
|
|
3291
|
-
/* @__PURE__ */ g(
|
|
3291
|
+
/* @__PURE__ */ g(L.div, { variants: n, className: "flex gap-4 items-baseline", children: /* @__PURE__ */ N("span", { className: "flex items-center gap-2 text-sm md:text-base font-medium text-sw-primary/90 bg-sw-primary/10 px-3 py-1 rounded-full border border-sw-primary/20 backdrop-blur-sm", children: [
|
|
3292
3292
|
/* @__PURE__ */ g("span", { children: r }),
|
|
3293
3293
|
/* @__PURE__ */ g("span", { className: "opacity-40 text-xs", children: "/" }),
|
|
3294
3294
|
/* @__PURE__ */ g("span", { className: "opacity-60", children: t })
|
|
3295
3295
|
] }) }),
|
|
3296
3296
|
/* @__PURE__ */ N(
|
|
3297
|
-
|
|
3297
|
+
L.h2,
|
|
3298
3298
|
{
|
|
3299
3299
|
variants: n,
|
|
3300
|
-
className:
|
|
3300
|
+
className: W(
|
|
3301
3301
|
"text-3xl md:text-4xl lg:text-5xl font-bold leading-tight tracking-tight text-pretty mt-2 font-sw-heading",
|
|
3302
3302
|
(c = (p = o.theme) == null ? void 0 : p.customClasses) == null ? void 0 : c.title
|
|
3303
3303
|
),
|
|
@@ -3310,10 +3310,10 @@ function ir({ question: e }) {
|
|
|
3310
3310
|
}
|
|
3311
3311
|
),
|
|
3312
3312
|
e.description && /* @__PURE__ */ g(
|
|
3313
|
-
|
|
3313
|
+
L.p,
|
|
3314
3314
|
{
|
|
3315
3315
|
variants: n,
|
|
3316
|
-
className:
|
|
3316
|
+
className: W(
|
|
3317
3317
|
"text-lg md:text-xl text-muted-foreground font-normal leading-relaxed max-w-2xl mt-2",
|
|
3318
3318
|
(z = (k = o.theme) == null ? void 0 : k.customClasses) == null ? void 0 : z.description
|
|
3319
3319
|
),
|
|
@@ -3322,7 +3322,7 @@ function ir({ question: e }) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
)
|
|
3324
3324
|
] }),
|
|
3325
|
-
/* @__PURE__ */ g(
|
|
3325
|
+
/* @__PURE__ */ g(L.div, { variants: n, className: "w-full mt-6", children: e.type === "text" || e.type === "email" || e.type === "number" || e.type === "url" ? /* @__PURE__ */ g(or, { question: e }) : e.type === "select" || e.type === "multi-select" ? /* @__PURE__ */ g(nr, { question: e }) : e.type === "rating" ? /* @__PURE__ */ g(sr, { question: e }) : /* @__PURE__ */ N("div", { className: "p-4 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-200 rounded", children: [
|
|
3326
3326
|
"Unsupported question type: ",
|
|
3327
3327
|
e.type,
|
|
3328
3328
|
" (ID: ",
|
|
@@ -3342,7 +3342,7 @@ const ar = {
|
|
|
3342
3342
|
stepInfo: "Question {{current}} of {{total}}"
|
|
3343
3343
|
};
|
|
3344
3344
|
function ur({ schema: e, onSubmit: o }) {
|
|
3345
|
-
var C, m, u, w,
|
|
3345
|
+
var C, m, u, w, F, A, P;
|
|
3346
3346
|
const r = mt({ schema: e, onSubmit: o }), t = e.theme || {
|
|
3347
3347
|
backgroundColor: "#ffffff",
|
|
3348
3348
|
textColor: "#000000",
|
|
@@ -3374,16 +3374,16 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3374
3374
|
}, { autoReload: b, reloadDelay: v = 3e3 } = e, h = ((C = e.layoutSettings) == null ? void 0 : C.internalScroll) !== !1;
|
|
3375
3375
|
if (he(() => {
|
|
3376
3376
|
if (r.isCompleted && b) {
|
|
3377
|
-
const
|
|
3377
|
+
const R = setTimeout(() => {
|
|
3378
3378
|
r.resetForm();
|
|
3379
3379
|
}, v);
|
|
3380
|
-
return () => clearTimeout(
|
|
3380
|
+
return () => clearTimeout(R);
|
|
3381
3381
|
}
|
|
3382
3382
|
}, [r.isCompleted, b, v, r.resetForm]), r.isCompleted)
|
|
3383
3383
|
return /* @__PURE__ */ N(
|
|
3384
3384
|
"div",
|
|
3385
3385
|
{
|
|
3386
|
-
className:
|
|
3386
|
+
className: W(
|
|
3387
3387
|
"flex flex-col items-center justify-center w-full p-8 text-center relative",
|
|
3388
3388
|
h ? "h-full overflow-hidden" : "min-h-screen",
|
|
3389
3389
|
(m = t.customClasses) == null ? void 0 : m.container
|
|
@@ -3391,7 +3391,7 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3391
3391
|
style: i,
|
|
3392
3392
|
children: [
|
|
3393
3393
|
b && /* @__PURE__ */ g(
|
|
3394
|
-
|
|
3394
|
+
L.div,
|
|
3395
3395
|
{
|
|
3396
3396
|
initial: { width: "0%" },
|
|
3397
3397
|
animate: { width: "100%" },
|
|
@@ -3400,7 +3400,7 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3400
3400
|
}
|
|
3401
3401
|
),
|
|
3402
3402
|
/* @__PURE__ */ N(
|
|
3403
|
-
|
|
3403
|
+
L.div,
|
|
3404
3404
|
{
|
|
3405
3405
|
initial: { scale: 0.9, opacity: 0, y: 20 },
|
|
3406
3406
|
animate: { scale: 1, opacity: 1, y: 0 },
|
|
@@ -3416,11 +3416,11 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3416
3416
|
]
|
|
3417
3417
|
}
|
|
3418
3418
|
);
|
|
3419
|
-
const k = e.questions.find((
|
|
3420
|
-
return /* @__PURE__ */ g(
|
|
3419
|
+
const k = e.questions.find((R) => R.id === r.currentStepId), z = (e.questions.findIndex((R) => R.id === r.currentStepId) + 1) / e.questions.length * 100;
|
|
3420
|
+
return /* @__PURE__ */ g(je.Provider, { value: j(y({}, r), { schema: e }), children: /* @__PURE__ */ N(
|
|
3421
3421
|
"div",
|
|
3422
3422
|
{
|
|
3423
|
-
className:
|
|
3423
|
+
className: W(
|
|
3424
3424
|
"w-full flex flex-col relative transition-colors duration-700",
|
|
3425
3425
|
h ? "h-full overflow-hidden" : "min-h-screen",
|
|
3426
3426
|
(u = t.customClasses) == null ? void 0 : u.container
|
|
@@ -3430,7 +3430,7 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3430
3430
|
/* @__PURE__ */ N("div", { className: "absolute top-0 left-0 w-full h-1 z-50", children: [
|
|
3431
3431
|
/* @__PURE__ */ g("div", { className: "absolute top-0 left-0 w-full h-full bg-current opacity-10" }),
|
|
3432
3432
|
/* @__PURE__ */ g(
|
|
3433
|
-
|
|
3433
|
+
L.div,
|
|
3434
3434
|
{
|
|
3435
3435
|
className: "h-full relative z-10",
|
|
3436
3436
|
initial: { width: 0 },
|
|
@@ -3440,13 +3440,13 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3440
3440
|
}
|
|
3441
3441
|
)
|
|
3442
3442
|
] }),
|
|
3443
|
-
/* @__PURE__ */ N("div", { className:
|
|
3443
|
+
/* @__PURE__ */ N("div", { className: W(
|
|
3444
3444
|
"flex-1 w-full relative z-10 flex flex-col px-6 md:px-12",
|
|
3445
3445
|
h ? "overflow-y-auto" : ""
|
|
3446
3446
|
), style: { scrollbarWidth: "none" }, children: [
|
|
3447
3447
|
/* @__PURE__ */ g("div", { className: "flex-1 flex-shrink-0 min-h-[2rem]" }),
|
|
3448
3448
|
/* @__PURE__ */ g("div", { className: "w-full max-w-5xl mx-auto py-4", children: /* @__PURE__ */ g(at, { mode: "wait", children: k && /* @__PURE__ */ g(
|
|
3449
|
-
|
|
3449
|
+
L.div,
|
|
3450
3450
|
{
|
|
3451
3451
|
initial: { opacity: 0, y: 40 },
|
|
3452
3452
|
animate: { opacity: 1, y: 0 },
|
|
@@ -3480,36 +3480,39 @@ function ur({ schema: e, onSubmit: o }) {
|
|
|
3480
3480
|
]
|
|
3481
3481
|
}
|
|
3482
3482
|
),
|
|
3483
|
-
/* @__PURE__ */ N("div", { className:
|
|
3483
|
+
/* @__PURE__ */ N("div", { className: W(
|
|
3484
|
+
"flex items-center justify-end gap-3 md:gap-4 order-2 md:order-3 w-full md:w-auto md:flex-1",
|
|
3485
|
+
(F = t.customClasses) == null ? void 0 : F.buttonContainer
|
|
3486
|
+
), children: [
|
|
3484
3487
|
/* @__PURE__ */ g(
|
|
3485
|
-
|
|
3488
|
+
L.button,
|
|
3486
3489
|
{
|
|
3487
3490
|
onClick: r.prevStep,
|
|
3488
3491
|
disabled: r.history.length === 0,
|
|
3489
3492
|
whileHover: { scale: 1.05 },
|
|
3490
3493
|
whileTap: { scale: 0.95 },
|
|
3491
|
-
className:
|
|
3492
|
-
"w-
|
|
3493
|
-
(
|
|
3494
|
+
className: W(
|
|
3495
|
+
"w-10 h-10 md:w-12 md:h-12 flex items-center justify-center disabled:opacity-0 disabled:pointer-events-none transition-all hover:bg-black/5 dark:hover:bg-white/5 rounded-full",
|
|
3496
|
+
(A = t.customClasses) == null ? void 0 : A.buttonSecondary
|
|
3494
3497
|
),
|
|
3495
3498
|
style: c,
|
|
3496
|
-
children: /* @__PURE__ */ g(ct, { size:
|
|
3499
|
+
children: /* @__PURE__ */ g(ct, { size: 20 })
|
|
3497
3500
|
}
|
|
3498
3501
|
),
|
|
3499
3502
|
/* @__PURE__ */ N(
|
|
3500
|
-
|
|
3503
|
+
L.button,
|
|
3501
3504
|
{
|
|
3502
3505
|
onClick: r.nextStep,
|
|
3503
3506
|
whileHover: { scale: 1.02 },
|
|
3504
3507
|
whileTap: { scale: 0.98 },
|
|
3505
|
-
className:
|
|
3506
|
-
"px-
|
|
3507
|
-
(
|
|
3508
|
+
className: W(
|
|
3509
|
+
"px-6 py-2.5 md:px-8 md:py-3 text-base md:text-lg font-semibold shadow-lg flex items-center gap-2 transition-all rounded-lg",
|
|
3510
|
+
(P = t.customClasses) == null ? void 0 : P.buttonPrimary
|
|
3508
3511
|
),
|
|
3509
3512
|
style: p,
|
|
3510
3513
|
children: [
|
|
3511
3514
|
/* @__PURE__ */ g("span", { children: r.currentStepId === e.questions[e.questions.length - 1].id ? t.submitText || n.submit : n.next }),
|
|
3512
|
-
r.currentStepId !== e.questions[e.questions.length - 1].id && /* @__PURE__ */ g(dt, { size:
|
|
3515
|
+
r.currentStepId !== e.questions[e.questions.length - 1].id && /* @__PURE__ */ g(dt, { size: 18, strokeWidth: 2.5 })
|
|
3513
3516
|
]
|
|
3514
3517
|
}
|
|
3515
3518
|
)
|