@digiform/wizard 0.3.1 → 0.3.2

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.
Files changed (43) hide show
  1. package/features/form-runtime/components/FormFooter.d.ts +5 -0
  2. package/features/form-runtime/hooks/useValidationEvents.d.ts +0 -1
  3. package/features/state-management/machines/formMachine.d.ts +3 -0
  4. package/features/state-management/machines/types.d.ts +4 -0
  5. package/features/state-management/machines/useFormMachine.d.ts +18 -0
  6. package/package.json +1 -3
  7. package/styles.css +1 -1
  8. package/wizard/src/features/api-integration/services/ApiCallService.js +65 -74
  9. package/wizard/src/features/dialog-system/components/ActionDialog/ActionDialog.js +39 -43
  10. package/wizard/src/features/dialog-system/components/ConfirmationDialog/ConfirmationDialog.js +37 -41
  11. package/wizard/src/features/dialog-system/components/EmailVerificationDialog/EmailVerificationDialog.js +44 -45
  12. package/wizard/src/features/form-runtime/FormWizard/FormWizard.js +54 -79
  13. package/wizard/src/features/form-runtime/components/FormFooter.js +53 -184
  14. package/wizard/src/features/form-runtime/components/FormSection/FormSection.js +150 -194
  15. package/wizard/src/features/form-runtime/components/FormStep/FormStep.js +83 -92
  16. package/wizard/src/features/form-runtime/components/StepProgressIndicator/StepProgressIndicator.js +24 -30
  17. package/wizard/src/features/form-runtime/config/templateLoader.js +48 -55
  18. package/wizard/src/features/form-runtime/hooks/useComponentTriggers.js +44 -63
  19. package/wizard/src/features/form-runtime/hooks/useFieldEventHandlers.js +26 -40
  20. package/wizard/src/features/form-runtime/hooks/useValidationEvents.js +22 -25
  21. package/wizard/src/features/form-runtime/utils/formDirtyStateSync.js +26 -37
  22. package/wizard/src/features/form-runtime/utils/logger.js +12 -12
  23. package/wizard/src/features/state-management/machines/actions/navigationActions.js +13 -8
  24. package/wizard/src/features/state-management/machines/componentTriggerEngine.js +167 -432
  25. package/wizard/src/features/state-management/machines/formMachine.js +558 -677
  26. package/wizard/src/features/state-management/machines/useFormMachine.js +172 -190
  27. package/wizard/src/features/trigger-action-system/components/ActionManager.js +35 -86
  28. package/wizard/src/features/validation-system/validation/SchemaBuilder.js +28 -82
  29. package/wizard/src/features/validation-system/validation/ValidationCache.js +11 -27
  30. package/wizard/src/features/validation-system/validation/ValidationExecutor.js +26 -58
  31. package/features/form-runtime/utils/formSaver.d.ts +0 -22
  32. package/features/state-management/components/ValidationBuilder/ValidationBuilder.d.ts +0 -9
  33. package/features/state-management/machines/__tests__/setup.d.ts +0 -0
  34. package/features/state-management/machines/__tests__/vitest.config.d.ts +0 -2
  35. package/features/state-management/machines/actions/validationActions.d.ts +0 -68
  36. package/features/state-management/machines/lazyLoading.d.ts +0 -34
  37. package/features/state-management/machines/validation/index.d.ts +0 -5
  38. package/features/state-management/machines/validation/validateField.d.ts +0 -2
  39. package/features/state-management/machines/validation/validateForm.d.ts +0 -2
  40. package/features/state-management/machines/validation/validateSection.d.ts +0 -2
  41. package/features/state-management/machines/validation/validateStep.d.ts +0 -2
  42. package/features/state-management/machines/validation/validationTypes.d.ts +0 -1
  43. package/features/trigger-action-system/components/FieldWarning/FieldWarning.d.ts +0 -20
@@ -1,54 +1,50 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
3
  /* empty css */
4
4
  import { Button as N } from "../../../../../../ui/src/components/button/button.js";
5
- import { Dialog as g, DialogContent as D, DialogHeader as S, DialogTitle as f, DialogDescription as I } from "../../../../../../ui/src/components/dialog/dialog.js";
6
- import { Sheet as T, SheetContent as M, SheetHeader as _, SheetTitle as B } from "../../../../../../ui/src/components/sheet/sheet.js";
7
- import { memo as H, useState as x } from "react";
5
+ import { Dialog as f, DialogContent as g, DialogHeader as D, DialogTitle as S, DialogDescription as T } from "../../../../../../ui/src/components/dialog/dialog.js";
6
+ import { Sheet as I, SheetContent as _, SheetHeader as B, SheetTitle as H } from "../../../../../../ui/src/components/sheet/sheet.js";
7
+ import { memo as M, useState as x } from "react";
8
8
  import { ConfirmationDialog as $ } from "../ConfirmationDialog/ConfirmationDialog.js";
9
9
  import { EmailVerificationDialog as b } from "../EmailVerificationDialog/EmailVerificationDialog.js";
10
- import l from "./ActionDialog.module.css.js";
11
- const w = H(
12
- ({ config: t, formData: n, onButtonClick: s, onClose: o, isOpen: i }) => {
10
+ import r from "./ActionDialog.module.css.js";
11
+ const w = M(
12
+ ({ config: a, formData: n, onButtonClick: s, onClose: o, isOpen: i }) => {
13
13
  const [c, h] = x(!1);
14
- if (!t) return null;
15
- if (console.log("🔍 ActionDialog config:", {
16
- config: t,
17
- typeId: t.templateMetadata?.typeId,
18
- title: t.title
19
- }), t.templateMetadata?.typeId === "verify-dialog")
14
+ if (!a) return null;
15
+ if (a.templateMetadata?.typeId === "verify-dialog")
20
16
  return /* @__PURE__ */ e(
21
17
  b,
22
18
  {
23
- config: t,
19
+ config: a,
24
20
  formData: n,
25
21
  onButtonClick: s,
26
22
  onClose: o,
27
23
  isOpen: i
28
24
  }
29
25
  );
30
- if (t.templateMetadata?.typeId === "confirmation-dialog")
26
+ if (a.templateMetadata?.typeId === "confirmation-dialog")
31
27
  return /* @__PURE__ */ e(
32
28
  $,
33
29
  {
34
- config: t,
30
+ config: a,
35
31
  formData: n,
36
32
  onButtonClick: s,
37
33
  onClose: o,
38
34
  isOpen: i
39
35
  }
40
36
  );
41
- const y = async (a) => {
37
+ const y = async (t) => {
42
38
  h(!0);
43
39
  try {
44
- s(a.action);
40
+ s(t.action);
45
41
  } finally {
46
42
  h(!1);
47
43
  }
48
44
  }, u = () => {
49
- t.dismissible !== !1 && !c && o();
50
- }, v = (a) => {
51
- switch (a) {
45
+ a.dismissible !== !1 && !c && o();
46
+ }, v = (t) => {
47
+ switch (t) {
52
48
  case "primary":
53
49
  return "default";
54
50
  case "secondary":
@@ -58,53 +54,53 @@ const w = H(
58
54
  default:
59
55
  return "secondary";
60
56
  }
61
- }, d = t.content.replace(
57
+ }, d = a.content.replace(
62
58
  /\$\{data\.([^}]+)\}/g,
63
- (a, C) => {
59
+ (t, C) => {
64
60
  const p = n[C];
65
- return p != null ? String(p) : a;
61
+ return p != null ? String(p) : t;
66
62
  }
67
- ), m = () => /* @__PURE__ */ e("div", { className: l.buttonRow, children: t.buttons.map((a) => /* @__PURE__ */ e(
63
+ ), m = () => /* @__PURE__ */ e("div", { className: r.buttonRow, children: a.buttons.map((t) => /* @__PURE__ */ e(
68
64
  N,
69
65
  {
70
- variant: v(a.variant),
71
- onClick: () => y(a),
66
+ variant: v(t.variant),
67
+ onClick: () => y(t),
72
68
  disabled: c,
73
- className: l.minWidthButton,
74
- children: a.label
69
+ className: r.minWidthButton,
70
+ children: t.label
75
71
  },
76
- `${a.label}-${a.action}`
72
+ `${t.label}-${t.action}`
77
73
  )) });
78
- return t.type === "toast" ? i ? /* @__PURE__ */ e("div", { className: l.toastContainer, children: /* @__PURE__ */ r("div", { className: l.toastCard, children: [
79
- /* @__PURE__ */ r("div", { children: [
80
- /* @__PURE__ */ e("h3", { className: l.toastTitle, children: t.title }),
74
+ return a.type === "toast" ? i ? /* @__PURE__ */ e("div", { className: r.toastContainer, children: /* @__PURE__ */ l("div", { className: r.toastCard, children: [
75
+ /* @__PURE__ */ l("div", { children: [
76
+ /* @__PURE__ */ e("h3", { className: r.toastTitle, children: a.title }),
81
77
  /* @__PURE__ */ e(
82
78
  "div",
83
79
  {
84
- className: l.toastContent,
80
+ className: r.toastContent,
85
81
  dangerouslySetInnerHTML: { __html: d }
86
82
  }
87
83
  )
88
84
  ] }),
89
85
  /* @__PURE__ */ e(m, {})
90
- ] }) }) : null : t.type === "sidebar" ? /* @__PURE__ */ e(T, { open: i, onOpenChange: (a) => !a && u(), children: /* @__PURE__ */ r(M, { className: l.sheetContent, children: [
91
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(B, { children: t.title }) }),
92
- /* @__PURE__ */ r("div", { className: l.sheetBody, children: [
86
+ ] }) }) : null : a.type === "sidebar" ? /* @__PURE__ */ e(I, { open: i, onOpenChange: (t) => !t && u(), children: /* @__PURE__ */ l(_, { className: r.sheetContent, children: [
87
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(H, { children: a.title }) }),
88
+ /* @__PURE__ */ l("div", { className: r.sheetBody, children: [
93
89
  /* @__PURE__ */ e(
94
90
  "div",
95
91
  {
96
- className: l.sheetText,
92
+ className: r.sheetText,
97
93
  dangerouslySetInnerHTML: { __html: d }
98
94
  }
99
95
  ),
100
96
  /* @__PURE__ */ e(m, {})
101
97
  ] })
102
- ] }) }) : /* @__PURE__ */ e(g, { open: i, onOpenChange: (a) => !a && u(), children: /* @__PURE__ */ r(D, { className: l[`size-${t.size || "medium"}`], children: [
103
- /* @__PURE__ */ r(S, { children: [
104
- /* @__PURE__ */ e(f, { children: t.title }),
105
- /* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: d } }) })
98
+ ] }) }) : /* @__PURE__ */ e(f, { open: i, onOpenChange: (t) => !t && u(), children: /* @__PURE__ */ l(g, { className: r[`size-${a.size || "medium"}`], children: [
99
+ /* @__PURE__ */ l(D, { children: [
100
+ /* @__PURE__ */ e(S, { children: a.title }),
101
+ /* @__PURE__ */ e(T, { asChild: !0, children: /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: d } }) })
106
102
  ] }),
107
- /* @__PURE__ */ e("div", { className: l.modalButtonRow, children: /* @__PURE__ */ e(m, {}) })
103
+ /* @__PURE__ */ e("div", { className: r.modalButtonRow, children: /* @__PURE__ */ e(m, {}) })
108
104
  ] }) });
109
105
  }
110
106
  );
@@ -1,64 +1,60 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as a, Fragment as f } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as t, Fragment as h } from "react/jsx-runtime";
3
3
  /* empty css */
4
- import { Button as p } from "../../../../../../ui/src/components/button/button.js";
5
- import { Dialog as h, DialogContent as u, DialogHeader as C, DialogTitle as c, DialogDescription as s } from "../../../../../../ui/src/components/dialog/dialog.js";
6
- import { HelpCircle as m, Info as D, AlertTriangle as N } from "lucide-react";
4
+ import { Button as f } from "../../../../../../ui/src/components/button/button.js";
5
+ import { Dialog as u, DialogContent as g, DialogHeader as C, DialogTitle as l, DialogDescription as c } from "../../../../../../ui/src/components/dialog/dialog.js";
6
+ import { HelpCircle as s, Info as N, AlertTriangle as D } from "lucide-react";
7
7
  import { memo as v } from "react";
8
- import e from "./ConfirmationDialog.module.css.js";
9
- const y = v(
8
+ import n from "./ConfirmationDialog.module.css.js";
9
+ const I = v(
10
10
  ({
11
11
  config: i,
12
- formData: I,
13
- onButtonClick: d,
14
- onClose: w,
15
- isOpen: t
12
+ formData: w,
13
+ onButtonClick: m,
14
+ onClose: y,
15
+ isOpen: d
16
16
  }) => {
17
- console.log("🔍 ConfirmationDialog rendering!", { isOpen: t, config: i });
18
- const l = i.templateMetadata, g = (n) => {
19
- console.log("🔥 ConfirmationDialog: Button clicked with action:", n), console.log("🔥 ConfirmationDialog: Action type:", n.type), console.log(
20
- "🔥 ConfirmationDialog: Action details:",
21
- JSON.stringify(n, null, 2)
22
- ), d(n), console.log("🔥 ConfirmationDialog: onButtonClick called");
17
+ const o = i.templateMetadata, p = (a) => {
18
+ m(a);
23
19
  }, r = (() => {
24
- if (!l?.showIcon) return null;
25
- switch (l?.iconType) {
20
+ if (!o?.showIcon) return null;
21
+ switch (o?.iconType) {
26
22
  case "warning":
27
- return /* @__PURE__ */ o(N, { className: e.iconWarning });
23
+ return /* @__PURE__ */ e(D, { className: n.iconWarning });
28
24
  case "question":
29
- return /* @__PURE__ */ o(m, { className: e.iconInfo });
25
+ return /* @__PURE__ */ e(s, { className: n.iconInfo });
30
26
  case "info":
31
- return /* @__PURE__ */ o(D, { className: e.iconInfo });
27
+ return /* @__PURE__ */ e(N, { className: n.iconInfo });
32
28
  default:
33
- return /* @__PURE__ */ o(m, { className: e.iconInfo });
29
+ return /* @__PURE__ */ e(s, { className: n.iconInfo });
34
30
  }
35
31
  })();
36
- return /* @__PURE__ */ o(h, { open: t, onOpenChange: () => !1, children: /* @__PURE__ */ a(u, { className: e.dialogContent, children: [
37
- /* @__PURE__ */ o(C, { children: r ? /* @__PURE__ */ a("div", { className: e.iconRow, children: [
38
- /* @__PURE__ */ o("div", { className: e.iconCircle, children: r }),
39
- /* @__PURE__ */ a("div", { children: [
40
- /* @__PURE__ */ o(c, { children: i.title }),
41
- /* @__PURE__ */ o(s, { className: e.descriptionSpaced, children: i.content })
32
+ return /* @__PURE__ */ e(u, { open: d, onOpenChange: () => !1, children: /* @__PURE__ */ t(g, { className: n.dialogContent, children: [
33
+ /* @__PURE__ */ e(C, { children: r ? /* @__PURE__ */ t("div", { className: n.iconRow, children: [
34
+ /* @__PURE__ */ e("div", { className: n.iconCircle, children: r }),
35
+ /* @__PURE__ */ t("div", { children: [
36
+ /* @__PURE__ */ e(l, { children: i.title }),
37
+ /* @__PURE__ */ e(c, { className: n.descriptionSpaced, children: i.content })
42
38
  ] })
43
- ] }) : /* @__PURE__ */ a(f, { children: [
44
- /* @__PURE__ */ o(c, { children: i.title }),
45
- /* @__PURE__ */ o(s, { children: i.content })
39
+ ] }) : /* @__PURE__ */ t(h, { children: [
40
+ /* @__PURE__ */ e(l, { children: i.title }),
41
+ /* @__PURE__ */ e(c, { children: i.content })
46
42
  ] }) }),
47
- /* @__PURE__ */ o("div", { className: e.buttonRow, children: i.buttons.map((n) => /* @__PURE__ */ o(
48
- p,
43
+ /* @__PURE__ */ e("div", { className: n.buttonRow, children: i.buttons.map((a) => /* @__PURE__ */ e(
44
+ f,
49
45
  {
50
- variant: n.variant === "danger" ? "destructive" : n.variant === "secondary" ? "outline" : "default",
51
- onClick: () => g(n.action),
52
- className: e.minWidthButton,
53
- children: n.label
46
+ variant: a.variant === "danger" ? "destructive" : a.variant === "secondary" ? "outline" : "default",
47
+ onClick: () => p(a.action),
48
+ className: n.minWidthButton,
49
+ children: a.label
54
50
  },
55
- n.id
51
+ a.id
56
52
  )) })
57
53
  ] }) });
58
54
  }
59
55
  );
60
- y.displayName = "ConfirmationDialog";
56
+ I.displayName = "ConfirmationDialog";
61
57
  export {
62
- y as ConfirmationDialog,
63
- y as default
58
+ I as ConfirmationDialog,
59
+ I as default
64
60
  };
@@ -1,50 +1,49 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
3
3
  /* empty css */
4
4
  import { Alert as E, AlertDescription as $ } from "../../../../../../ui/src/components/alert/alert.js";
5
5
  import { Button as m } from "../../../../../../ui/src/components/button/button.js";
6
- import { Dialog as D, DialogContent as V, DialogHeader as x, DialogTitle as A, DialogDescription as L } from "../../../../../../ui/src/components/dialog/dialog.js";
6
+ import { Dialog as x, DialogContent as D, DialogHeader as V, DialogTitle as A, DialogDescription as L } from "../../../../../../ui/src/components/dialog/dialog.js";
7
7
  import { ValidationCode as P } from "../../../../../../ui/src/components/ValidationCode/ValidationCode.js";
8
8
  import { CheckCircle as _, Mail as j, AlertCircle as q } from "lucide-react";
9
- import { memo as H, useState as f, useEffect as I, useCallback as W } from "react";
9
+ import { memo as H, useState as f, useEffect as I, useCallback as O } from "react";
10
10
  import i from "./EmailVerificationDialog.module.css.js";
11
- const Y = H(
11
+ const W = H(
12
12
  ({
13
13
  config: h,
14
- formData: z,
15
- onButtonClick: g,
16
- onClose: F,
17
- isOpen: u
14
+ formData: Y,
15
+ onButtonClick: u,
16
+ onClose: z,
17
+ isOpen: C
18
18
  }) => {
19
- console.log("🔥 EmailVerificationDialog rendering!", { isOpen: u, config: h });
20
- const t = h.templateMetadata, [c, C] = f(""), [n, r] = f("idle"), [p, l] = f(""), [d, v] = f(0), [b, k] = f(0);
19
+ const t = h.templateMetadata, [c, p] = f(""), [n, s] = f("idle"), [g, l] = f(""), [d, v] = f(0), [b, k] = f(0);
21
20
  I(() => {
22
21
  if (d > 0) {
23
- const a = setTimeout(() => v(d - 1), 1e3);
24
- return () => clearTimeout(a);
22
+ const o = setTimeout(() => v(d - 1), 1e3);
23
+ return () => clearTimeout(o);
25
24
  }
26
25
  }, [d]);
27
- const N = W(async () => {
28
- r("verifying");
29
- const a = b + 1;
30
- k(a);
26
+ const N = O(async () => {
27
+ s("verifying");
28
+ const o = b + 1;
29
+ k(o);
31
30
  try {
32
- if (await new Promise((s) => setTimeout(s, 1500)), c === "123456" || c === "000000" || c === "111111")
33
- r("success");
31
+ if (await new Promise((r) => setTimeout(r, 1500)), c === "123456" || c === "000000" || c === "111111")
32
+ s("success");
34
33
  else {
35
- const s = t?.maxAttempts;
36
- if (s && a >= s)
37
- r("blocked"), l(
34
+ const r = t?.maxAttempts;
35
+ if (r && o >= r)
36
+ s("blocked"), l(
38
37
  "Maximum verification attempts exceeded. Please request a new verification code."
39
38
  );
40
39
  else {
41
- r("error");
42
- const M = s ? s - a : null, R = t?.errorMessage || "Invalid code. Please try again.", S = M ? ` (${M} attempts remaining)` : "";
40
+ s("error");
41
+ const M = r ? r - o : null, R = t?.errorMessage || "Invalid code. Please try again.", S = M ? ` (${M} attempts remaining)` : "";
43
42
  l(R + S);
44
43
  }
45
44
  }
46
45
  } catch {
47
- r("error"), l(
46
+ s("error"), l(
48
47
  t?.errorMessage || "Verification failed. Please try again."
49
48
  );
50
49
  }
@@ -53,18 +52,18 @@ const Y = H(
53
52
  t?.errorMessage,
54
53
  t?.maxAttempts,
55
54
  b
56
- ]), w = (a) => {
57
- C(a), (n === "error" || n === "blocked") && (r("idle"), l(""));
58
- }, T = (a) => {
59
- console.log("completedCode", a), t?.enableAutoSubmit && n === "idle" && N();
55
+ ]), w = (o) => {
56
+ p(o), (n === "error" || n === "blocked") && (s("idle"), l(""));
57
+ }, T = (o) => {
58
+ t?.enableAutoSubmit && n === "idle" && N();
60
59
  }, y = () => {
61
- v(t?.resendTimer || 60), C(""), r("idle"), l(""), k(0);
60
+ v(t?.resendTimer || 60), p(""), s("idle"), l(""), k(0);
62
61
  }, B = () => {
63
- g({ type: "close" });
62
+ u({ type: "close" });
64
63
  };
65
- return n === "success" ? /* @__PURE__ */ e(D, { open: u, onOpenChange: () => !1, children: /* @__PURE__ */ o(V, { className: i.dialogContent, children: [
66
- /* @__PURE__ */ o(x, { children: [
67
- /* @__PURE__ */ o("div", { className: i.headerRow, children: [
64
+ return n === "success" ? /* @__PURE__ */ e(x, { open: C, onOpenChange: () => !1, children: /* @__PURE__ */ a(D, { className: i.dialogContent, children: [
65
+ /* @__PURE__ */ a(V, { children: [
66
+ /* @__PURE__ */ a("div", { className: i.headerRow, children: [
68
67
  /* @__PURE__ */ e(_, { className: `${i.iconMd} ${i.iconSuccess}` }),
69
68
  /* @__PURE__ */ e(A, { children: t?.successTitle || "Verification Successful" })
70
69
  ] }),
@@ -73,7 +72,7 @@ const Y = H(
73
72
  /* @__PURE__ */ e("div", { className: i.successButtonRow, children: /* @__PURE__ */ e(
74
73
  m,
75
74
  {
76
- onClick: () => g(
75
+ onClick: () => u(
77
76
  t?.onVerifiedAction || {
78
77
  type: "navigate",
79
78
  direction: "next"
@@ -83,16 +82,16 @@ const Y = H(
83
82
  children: t?.continueButtonLabel || "Continue"
84
83
  }
85
84
  ) })
86
- ] }) }) : /* @__PURE__ */ e(D, { open: u, onOpenChange: () => !1, children: /* @__PURE__ */ o(V, { className: i.dialogContent, children: [
87
- /* @__PURE__ */ o(x, { children: [
88
- /* @__PURE__ */ o("div", { className: i.headerRow, children: [
85
+ ] }) }) : /* @__PURE__ */ e(x, { open: C, onOpenChange: () => !1, children: /* @__PURE__ */ a(D, { className: i.dialogContent, children: [
86
+ /* @__PURE__ */ a(V, { children: [
87
+ /* @__PURE__ */ a("div", { className: i.headerRow, children: [
89
88
  /* @__PURE__ */ e(j, { className: `${i.iconMd} ${i.iconMail}` }),
90
89
  /* @__PURE__ */ e(A, { children: h.title })
91
90
  ] }),
92
91
  /* @__PURE__ */ e(L, { children: h.content })
93
92
  ] }),
94
- /* @__PURE__ */ o("div", { className: i.formContent, children: [
95
- /* @__PURE__ */ o("div", { className: i.codeSection, children: [
93
+ /* @__PURE__ */ a("div", { className: i.formContent, children: [
94
+ /* @__PURE__ */ a("div", { className: i.codeSection, children: [
96
95
  /* @__PURE__ */ e("div", { className: i.codeLabel, children: "Verification Code" }),
97
96
  /* @__PURE__ */ e("div", { className: i.codeCenter, children: /* @__PURE__ */ e(
98
97
  P,
@@ -105,9 +104,9 @@ const Y = H(
105
104
  }
106
105
  ) })
107
106
  ] }),
108
- (n === "error" || n === "blocked") && p && /* @__PURE__ */ o(E, { variant: "destructive", children: [
107
+ (n === "error" || n === "blocked") && g && /* @__PURE__ */ a(E, { variant: "destructive", children: [
109
108
  /* @__PURE__ */ e(q, { className: i.iconSm }),
110
- /* @__PURE__ */ e($, { children: p })
109
+ /* @__PURE__ */ e($, { children: g })
111
110
  ] }),
112
111
  t?.enableResend && n !== "blocked" && /* @__PURE__ */ e("div", { className: i.resendText, children: d > 0 ? `Resend code in ${d}s` : /* @__PURE__ */ e(
113
112
  m,
@@ -128,7 +127,7 @@ const Y = H(
128
127
  }
129
128
  ) })
130
129
  ] }),
131
- /* @__PURE__ */ o("div", { className: i.footerButtonRow, children: [
130
+ /* @__PURE__ */ a("div", { className: i.footerButtonRow, children: [
132
131
  /* @__PURE__ */ e(m, { variant: "secondary", onClick: B, children: t?.cancelButtonLabel || "Cancel" }),
133
132
  /* @__PURE__ */ e(
134
133
  m,
@@ -142,8 +141,8 @@ const Y = H(
142
141
  ] }) });
143
142
  }
144
143
  );
145
- Y.displayName = "EmailVerificationDialog";
144
+ W.displayName = "EmailVerificationDialog";
146
145
  export {
147
- Y as EmailVerificationDialog,
148
- Y as default
146
+ W as EmailVerificationDialog,
147
+ W as default
149
148
  };
@@ -1,110 +1,85 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
- import { wizardDefaultRenderer as z } from "../../../renderer/wizardRenderer.js";
2
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
3
+ import { wizardDefaultRenderer as E } from "../../../renderer/wizardRenderer.js";
4
4
  /* empty css */
5
- import { FormLayout as m } from "../../../../../ui/src/components/FormLayout/FormLayout.js";
6
- import { formWizardQueryClient as E } from "../../../../../ui/src/lib/queryClient.js";
7
- import { QueryClientProvider as M } from "@tanstack/react-query";
8
- import { clsx as g } from "clsx";
9
- import { memo as N, useState as h, useEffect as w, useMemo as u } from "react";
10
- import n from "./FormWizard.module.css.js";
5
+ import { FormLayout as s } from "../../../../../ui/src/components/FormLayout/FormLayout.js";
6
+ import { formWizardQueryClient as z } from "../../../../../ui/src/lib/queryClient.js";
7
+ import { QueryClientProvider as N } from "@tanstack/react-query";
8
+ import { clsx as u } from "clsx";
9
+ import { memo as M, useState as h, useEffect as P, useMemo as g } from "react";
10
+ import t from "./FormWizard.module.css.js";
11
11
  import W from "../components/FormStep/FormStep.js";
12
- import L from "../components/StepProgressIndicator/StepProgressIndicator.js";
13
- import { hasTemplateSteps as P, resolveFormWizardConfig as T } from "../config/configResolver.js";
14
- import { ThemeProvider as I, useThemeConfig as x } from "../../../../../ui/src/theme/ThemeProvider.js";
15
- import { useFormMachineProvider as b, FormMachineContext as U } from "../../state-management/machines/useFormMachine.js";
16
- import j from "../../../../../ui/src/lib/error-boundaries/FormWizardErrorBoundary.js";
17
- import { FormEditingProvider as O } from "../../../../../ui/src/lib/providers/FormEditingContext.js";
18
- import s from "../../../../../ui/src/lib/error-boundaries/ComponentErrorBoundary.js";
19
- import { ActionManager as R } from "../../trigger-action-system/components/ActionManager.js";
20
- import { registerRenderComponent as V } from "../../../../../ui/src/component-registry/renderComponent.js";
21
- import { ValidationEngine as k } from "../../validation-system/validation/ValidationEngine.js";
22
- import { Heading as A } from "@rijkshuisstijl-community/components-react";
23
- V(z);
24
- const v = N(
12
+ import w from "../components/StepProgressIndicator/StepProgressIndicator.js";
13
+ import { hasTemplateSteps as x, resolveFormWizardConfig as L } from "../config/configResolver.js";
14
+ import { ThemeProvider as T, useThemeConfig as I } from "../../../../../ui/src/theme/ThemeProvider.js";
15
+ import { useFormMachineProvider as R, FormMachineContext as j } from "../../state-management/machines/useFormMachine.js";
16
+ import A from "../../../../../ui/src/lib/error-boundaries/FormWizardErrorBoundary.js";
17
+ import { FormEditingProvider as B } from "../../../../../ui/src/lib/providers/FormEditingContext.js";
18
+ import l from "../../../../../ui/src/lib/error-boundaries/ComponentErrorBoundary.js";
19
+ import { ActionManager as H } from "../../trigger-action-system/components/ActionManager.js";
20
+ import { registerRenderComponent as Q } from "../../../../../ui/src/component-registry/renderComponent.js";
21
+ import { ValidationEngine as b } from "../../validation-system/validation/ValidationEngine.js";
22
+ import { Heading as D } from "@rijkshuisstijl-community/components-react";
23
+ Q(E);
24
+ const v = M(
25
25
  ({
26
- config: r,
27
- initialData: a = {},
26
+ config: e,
27
+ initialData: n = {},
28
28
  onSubmit: C,
29
- queryClient: y = E
29
+ queryClient: y = z
30
30
  }) => {
31
- console.log(
32
- "🏁 [FormWizard] FormWizardCore component MOUNTING with config:",
33
- {
34
- configId: r.id,
35
- configTitle: r.title,
36
- stepCount: r.steps?.length,
37
- validationMessageStyle: r.validationMessageStyle,
38
- hasInitialData: Object.keys(a).length > 0
39
- }
40
- ), typeof window < "u" && setTimeout(() => {
41
- console.log(
42
- "🚨 [FormWizard] MOUNTED SUCCESSFULLY - Check console for detailed logs"
43
- );
44
- }, 100);
45
- const [t, d] = h(null), [c, f] = h(null);
46
- w(() => {
31
+ const [i, d] = h(null), [c, f] = h(null);
32
+ P(() => {
47
33
  (async () => {
48
34
  try {
49
- if (f(null), P(r)) {
50
- const o = await T(r);
35
+ if (f(null), x(e)) {
36
+ const o = await L(e);
51
37
  d(o);
52
38
  } else
53
- d(r);
39
+ d(e);
54
40
  } catch (o) {
55
41
  f(
56
42
  o instanceof Error ? o.message : "Failed to resolve configuration"
57
43
  ), console.error("Error resolving form configuration:", o);
58
44
  }
59
45
  })();
60
- }, [r]);
61
- const p = u(() => {
62
- console.log(
63
- "🚀 [FormWizard] Creating ValidationEngine with messageStyle:",
64
- r.validationMessageStyle || "withLabel"
65
- );
66
- const i = new k({
67
- messageStyle: r.validationMessageStyle || "withLabel"
68
- });
69
- return console.log("✅ [FormWizard] ValidationEngine created:", {
70
- engine: !!i,
71
- validateField: typeof i.validateField,
72
- messageStyle: r.validationMessageStyle || "withLabel"
73
- }), i;
74
- }, [r.validationMessageStyle]), S = u(() => t ? {
75
- ...t,
76
- steps: t.steps.map((i) => {
77
- const o = i;
46
+ }, [e]);
47
+ const p = g(() => new b({
48
+ messageStyle: e.validationMessageStyle || "withLabel"
49
+ }), [e.validationMessageStyle]), S = g(() => i ? {
50
+ ...i,
51
+ steps: i.steps.map((m) => {
52
+ const o = m;
78
53
  return {
79
54
  ...o,
80
55
  schema: o.schema || p.getStepSchema(o)
81
56
  };
82
57
  })
83
- } : null, [t, p]), F = b({
84
- config: S || r,
58
+ } : null, [i, p]), F = R({
59
+ config: S || e,
85
60
  // Fallback to original config if resolution fails
86
- initialData: a,
61
+ initialData: n,
87
62
  onSubmit: C
88
63
  });
89
- return c ? /* @__PURE__ */ l("div", { className: g("form-wizard-error", n.errorState), children: [
90
- /* @__PURE__ */ e("h3", { className: n.errorHeading, children: "Configuration Error" }),
91
- /* @__PURE__ */ e("p", { children: c })
92
- ] }) : t ? /* @__PURE__ */ e(M, { client: y, children: /* @__PURE__ */ e(j, { formId: r.id, children: /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(U.Provider, { value: F, children: [
93
- /* @__PURE__ */ e(s, { componentName: "ActionManager", children: /* @__PURE__ */ e(R, {}) }),
94
- /* @__PURE__ */ l(m, { className: n.formLayout, children: [
95
- /* @__PURE__ */ e(m.Title, { children: /* @__PURE__ */ e(A, { level: 1, children: r.title }) }),
96
- /* @__PURE__ */ e(m.LeftColumn, { children: /* @__PURE__ */ e(s, { componentName: "StepProgressIndicator", children: /* @__PURE__ */ e(L, {}) }) }),
97
- /* @__PURE__ */ e(s, { componentName: "FormStep", children: /* @__PURE__ */ e(W, {}) })
64
+ return c ? /* @__PURE__ */ a("div", { className: u("form-wizard-error", t.errorState), children: [
65
+ /* @__PURE__ */ r("h3", { className: t.errorHeading, children: "Configuration Error" }),
66
+ /* @__PURE__ */ r("p", { children: c })
67
+ ] }) : i ? /* @__PURE__ */ r(N, { client: y, children: /* @__PURE__ */ r(A, { formId: e.id, children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ a(j.Provider, { value: F, children: [
68
+ /* @__PURE__ */ r(l, { componentName: "ActionManager", children: /* @__PURE__ */ r(H, {}) }),
69
+ /* @__PURE__ */ a(s, { className: t.formLayout, children: [
70
+ /* @__PURE__ */ r(s.Title, { children: /* @__PURE__ */ r(D, { level: 1, children: e.title }) }),
71
+ /* @__PURE__ */ r(s.LeftColumn, { children: /* @__PURE__ */ r(l, { componentName: "StepProgressIndicator", children: /* @__PURE__ */ r(w, {}) }) }),
72
+ /* @__PURE__ */ r(l, { componentName: "FormStep", children: /* @__PURE__ */ r(W, {}) })
98
73
  ] })
99
- ] }) }) }) }) : /* @__PURE__ */ e("div", { className: g("form-wizard-loading", n.loadingState), children: /* @__PURE__ */ e("div", { className: n.loadingPulse, children: "Loading form templates..." }) });
74
+ ] }) }) }) }) : /* @__PURE__ */ r("div", { className: u("form-wizard-loading", t.loadingState), children: /* @__PURE__ */ r("div", { className: t.loadingPulse, children: "Loading form templates..." }) });
100
75
  }
101
76
  );
102
77
  v.displayName = "FormWizardCore";
103
- const B = (r) => {
104
- const a = x();
105
- return /* @__PURE__ */ e(I, { config: a, children: /* @__PURE__ */ e(v, { ...r }) });
78
+ const V = (e) => {
79
+ const n = I();
80
+ return /* @__PURE__ */ r(T, { config: n, children: /* @__PURE__ */ r(v, { ...e }) });
106
81
  };
107
- B.displayName = "FormWizard";
82
+ V.displayName = "FormWizard";
108
83
  export {
109
- B as default
84
+ V as default
110
85
  };