@wealthx/shadcn 1.5.29 → 1.5.31

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 (39) hide show
  1. package/.turbo/turbo-build.log +98 -98
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-DWJHPNFL.mjs → chunk-4UT3RZ2D.mjs} +32 -16
  4. package/dist/{chunk-RNLIZRAK.mjs → chunk-C6R42PCL.mjs} +1 -1
  5. package/dist/{chunk-EVUY67CY.mjs → chunk-FTQ2AKZ2.mjs} +1 -1
  6. package/dist/{chunk-7T4TYUO3.mjs → chunk-H5ZD63NT.mjs} +31 -16
  7. package/dist/{chunk-SO4RB3XB.mjs → chunk-IEQX4UVP.mjs} +2 -2
  8. package/dist/chunk-IKVF4XE2.mjs +94 -0
  9. package/dist/{chunk-KPGARKFC.mjs → chunk-MS3GNXMB.mjs} +1 -1
  10. package/dist/{chunk-M32QNCD3.mjs → chunk-OSSS56CB.mjs} +1 -1
  11. package/dist/{chunk-36IN7YRM.mjs → chunk-SCGCGVDN.mjs} +1 -1
  12. package/dist/{chunk-KJQ3BVTB.mjs → chunk-X2NIDXFB.mjs} +1 -1
  13. package/dist/components/ui/backoffice-signup-steps.js +98 -48
  14. package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
  15. package/dist/components/ui/bank-statement-generate-dialog.mjs +2 -2
  16. package/dist/components/ui/chat-widget.js +1 -1
  17. package/dist/components/ui/chat-widget.mjs +2 -2
  18. package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
  19. package/dist/components/ui/field.js +1 -1
  20. package/dist/components/ui/field.mjs +1 -1
  21. package/dist/components/ui/frontend-signup-steps.js +166 -90
  22. package/dist/components/ui/frontend-signup-steps.mjs +4 -5
  23. package/dist/components/ui/password-strength-tooltip.js +81 -107
  24. package/dist/components/ui/password-strength-tooltip.mjs +3 -2
  25. package/dist/components/ui/property-report-dialog.mjs +2 -2
  26. package/dist/components/ui/signup-form-primitives.js +117 -114
  27. package/dist/components/ui/signup-form-primitives.mjs +3 -4
  28. package/dist/components/ui/two-fa-setup-form.js +31 -16
  29. package/dist/components/ui/two-fa-setup-form.mjs +2 -2
  30. package/dist/index.js +133 -68
  31. package/dist/index.mjs +10 -10
  32. package/dist/styles.css +1 -1
  33. package/package.json +1 -1
  34. package/src/components/ui/field.tsx +12 -12
  35. package/src/components/ui/password-strength-tooltip.tsx +89 -47
  36. package/src/components/ui/signup-form-primitives.tsx +34 -16
  37. package/src/components/ui/two-fa-setup-form.tsx +41 -31
  38. package/src/styles/styles-css.ts +1 -1
  39. package/dist/chunk-WHIW6KOB.mjs +0 -57
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-HK4HUQTV.mjs";
7
7
  import {
8
8
  FormField
9
- } from "./chunk-DWJHPNFL.mjs";
9
+ } from "./chunk-4UT3RZ2D.mjs";
10
10
  import {
11
11
  AddressAutocomplete
12
12
  } from "./chunk-LDC6V6DJ.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Field,
3
3
  FieldLabel
4
- } from "./chunk-KPGARKFC.mjs";
4
+ } from "./chunk-MS3GNXMB.mjs";
5
5
  import {
6
6
  PaginationNavButtons
7
7
  } from "./chunk-6WRDXE7A.mjs";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  Field,
7
7
  FieldError
8
- } from "./chunk-KPGARKFC.mjs";
8
+ } from "./chunk-MS3GNXMB.mjs";
9
9
  import {
10
10
  Label
11
11
  } from "./chunk-LSRGA5BI.mjs";
@@ -27,6 +27,16 @@ var DEFAULT_APPS = [
27
27
  { name: "Google Authenticator" },
28
28
  { name: "Microsoft Authenticator" }
29
29
  ];
30
+ var STEP_META = {
31
+ 1: {
32
+ subtitle: "We recommend Google Authenticator or Microsoft Authenticator",
33
+ defaultTitle: "2FA Setup"
34
+ },
35
+ 2: {
36
+ title: "Open Auth App and Scan Code",
37
+ subtitle: "Open your authenticator app and scan the QR code"
38
+ }
39
+ };
30
40
  function AppDownloadStep({
31
41
  apps,
32
42
  onNext,
@@ -34,18 +44,21 @@ function AppDownloadStep({
34
44
  required
35
45
  }) {
36
46
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
37
- /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: apps.map((app) => {
38
- var _a;
47
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: apps.map((app) => {
48
+ var _a, _b;
39
49
  return /* @__PURE__ */ jsxs(
40
50
  "div",
41
51
  {
42
- className: "flex flex-1 flex-col items-center gap-3 border border-border bg-muted/30 p-4 text-center",
52
+ className: "flex items-center gap-4 border border-border bg-muted/30 p-4",
43
53
  children: [
44
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
45
- (_a = app.icon) != null ? _a : /* @__PURE__ */ jsx(Smartphone, { size: 18, className: "text-muted-foreground" }),
46
- app.name
47
- ] }),
48
- app.qrNode ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: app.qrNode }) : /* @__PURE__ */ jsx("div", { className: "flex h-[100px] w-[100px] items-center justify-center border border-dashed border-border bg-muted/50 text-[11px] text-muted-foreground", children: "Scan to download" })
54
+ /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center justify-center", children: (_a = app.qrNode) != null ? _a : /* @__PURE__ */ jsx("div", { className: "flex h-[80px] w-[80px] items-center justify-center border border-dashed border-border bg-muted/50 text-[11px] text-muted-foreground", children: "Scan" }) }),
55
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
56
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
57
+ (_b = app.icon) != null ? _b : /* @__PURE__ */ jsx(Smartphone, { size: 16, className: "text-muted-foreground" }),
58
+ app.name
59
+ ] }),
60
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Scan to download" })
61
+ ] })
49
62
  ]
50
63
  },
51
64
  app.name
@@ -77,15 +90,17 @@ function VerificationStep({
77
90
  setIsLoading(true);
78
91
  try {
79
92
  yield onVerify(token);
80
- } catch (e) {
81
- setError("Invalid code. Please try again.");
93
+ } catch (err) {
94
+ setError(
95
+ err instanceof Error ? err.message : "Invalid code. Please try again."
96
+ );
82
97
  } finally {
83
98
  setIsLoading(false);
84
99
  }
85
100
  });
86
101
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
87
102
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3", children: [
88
- qrCodeNode ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: qrCodeNode }) : /* @__PURE__ */ jsx("div", { className: "flex h-[140px] w-[140px] items-center justify-center border border-dashed border-border bg-muted/50 text-xs text-muted-foreground", children: "QR Code" }),
103
+ qrCodeNode != null ? qrCodeNode : /* @__PURE__ */ jsx("div", { className: "flex h-[140px] w-[140px] items-center justify-center border border-dashed border-border bg-muted/50 text-xs text-muted-foreground", children: "QR Code" }),
89
104
  /* @__PURE__ */ jsx("p", { className: "text-center text-sm text-muted-foreground", children: "The temporary code will show for authentication. Insert below." })
90
105
  ] }),
91
106
  /* @__PURE__ */ jsxs(Field, { children: [
@@ -127,7 +142,7 @@ function VerificationStep({
127
142
  ] });
128
143
  }
129
144
  function TwoFASetupForm({
130
- title = "2FA Setup",
145
+ title,
131
146
  apps = DEFAULT_APPS,
132
147
  qrCodeNode,
133
148
  onVerify,
@@ -136,10 +151,10 @@ function TwoFASetupForm({
136
151
  className
137
152
  }) {
138
153
  const [step, setStep] = useState(1);
139
- const stepTitle = step === 1 ? title : "Open Auth App and Scan Code";
140
- const stepSubtitle = step === 1 ? "We recommend Google Authenticator or Microsoft Authenticator" : "Open your authenticator app and scan the QR code";
154
+ const stepTitle = step === 1 ? title != null ? title : STEP_META[1].defaultTitle : STEP_META[2].title;
155
+ const stepSubtitle = STEP_META[step].subtitle;
141
156
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-6", className), children: [
142
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
157
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 text-center", children: [
143
158
  /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold text-foreground", children: stepTitle }),
144
159
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: stepSubtitle })
145
160
  ] }),
@@ -3,7 +3,7 @@ import {
3
3
  PasswordField,
4
4
  SectionHeading,
5
5
  StaffRowItem
6
- } from "./chunk-DWJHPNFL.mjs";
6
+ } from "./chunk-4UT3RZ2D.mjs";
7
7
  import {
8
8
  UploadCard
9
9
  } from "./chunk-I4KVSZCH.mjs";
@@ -14,7 +14,7 @@ import {
14
14
  Field,
15
15
  FieldError,
16
16
  FieldLabel
17
- } from "./chunk-KPGARKFC.mjs";
17
+ } from "./chunk-MS3GNXMB.mjs";
18
18
  import {
19
19
  Tooltip,
20
20
  TooltipContent,
@@ -0,0 +1,94 @@
1
+ import {
2
+ useThemeVars
3
+ } from "./chunk-XYSRRDBH.mjs";
4
+ import {
5
+ cn
6
+ } from "./chunk-AFML43VJ.mjs";
7
+
8
+ // src/components/ui/password-strength-tooltip.tsx
9
+ import * as React from "react";
10
+ import { Check, X } from "lucide-react";
11
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var PASSWORD_STRENGTH_RULES = [
14
+ { label: "Minimum 8 characters", test: (p) => p.length >= 8 },
15
+ { label: "At least one uppercase letter", test: (p) => /[A-Z]/.test(p) },
16
+ { label: "At least one lowercase letter", test: (p) => /[a-z]/.test(p) },
17
+ { label: "At least one number", test: (p) => /\d/.test(p) },
18
+ {
19
+ label: "At least one special character",
20
+ test: (p) => /[^A-Za-z0-9]/.test(p)
21
+ }
22
+ ];
23
+ var PasswordStrengthTooltip = React.forwardRef(function PasswordStrengthTooltip2({ open = false, password, children, side = "right" }, forwardedRef) {
24
+ const themeVars = useThemeVars();
25
+ const anchorRef = React.useRef(null);
26
+ const composedRef = React.useCallback(
27
+ (node) => {
28
+ anchorRef.current = node;
29
+ if (typeof forwardedRef === "function") {
30
+ forwardedRef(node);
31
+ } else if (forwardedRef) {
32
+ forwardedRef.current = node;
33
+ }
34
+ },
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ [forwardedRef]
37
+ );
38
+ return (
39
+ // PopoverPrimitive.Root with no Trigger — popup is fully controlled via `open` prop.
40
+ // The wrapper div has no trigger behaviors injected, so clicking the input inside
41
+ // works on the first click without interference.
42
+ /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open, children: [
43
+ /* @__PURE__ */ jsx("div", { ref: composedRef, children }),
44
+ /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
45
+ PopoverPrimitive.Positioner,
46
+ {
47
+ anchor: anchorRef,
48
+ side,
49
+ align: "start",
50
+ sideOffset: 8,
51
+ className: "z-[200]",
52
+ children: /* @__PURE__ */ jsx(
53
+ PopoverPrimitive.Popup,
54
+ {
55
+ initialFocus: false,
56
+ finalFocus: false,
57
+ className: cn(
58
+ "border border-border bg-popover shadow-md outline-hidden",
59
+ "w-auto max-w-[280px] p-3 font-sans",
60
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
61
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
62
+ "data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
63
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
64
+ ),
65
+ style: themeVars,
66
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1.5", children: PASSWORD_STRENGTH_RULES.map((rule) => {
67
+ const valid = password ? rule.test(password) : false;
68
+ return /* @__PURE__ */ jsxs(
69
+ "div",
70
+ {
71
+ className: cn(
72
+ "flex items-center gap-1.5 text-[13px] leading-[18px]",
73
+ valid ? "text-success" : "text-destructive"
74
+ ),
75
+ children: [
76
+ valid ? /* @__PURE__ */ jsx(Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ jsx(X, { size: 14, className: "shrink-0" }),
77
+ /* @__PURE__ */ jsx("span", { children: rule.label })
78
+ ]
79
+ },
80
+ rule.label
81
+ );
82
+ }) })
83
+ }
84
+ )
85
+ }
86
+ ) })
87
+ ] })
88
+ );
89
+ });
90
+
91
+ export {
92
+ PASSWORD_STRENGTH_RULES,
93
+ PasswordStrengthTooltip
94
+ };
@@ -237,7 +237,7 @@ function FieldError(_a) {
237
237
  return /* @__PURE__ */ jsx(
238
238
  "div",
239
239
  __spreadProps(__spreadValues({
240
- className: cn("text-caption text-destructive", className),
240
+ className: cn("text-left text-caption text-destructive", className),
241
241
  "data-slot": "field-error",
242
242
  role: "alert"
243
243
  }, props), {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Field,
3
3
  FieldLabel
4
- } from "./chunk-KPGARKFC.mjs";
4
+ } from "./chunk-MS3GNXMB.mjs";
5
5
  import {
6
6
  AddressAutocomplete
7
7
  } from "./chunk-LDC6V6DJ.mjs";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  Field,
9
9
  FieldLabel
10
- } from "./chunk-KPGARKFC.mjs";
10
+ } from "./chunk-MS3GNXMB.mjs";
11
11
  import {
12
12
  Checkbox
13
13
  } from "./chunk-IKXYTCSB.mjs";
@@ -8,7 +8,7 @@ import {
8
8
  Field,
9
9
  FieldError,
10
10
  FieldLabel
11
- } from "./chunk-KPGARKFC.mjs";
11
+ } from "./chunk-MS3GNXMB.mjs";
12
12
  import {
13
13
  Input
14
14
  } from "./chunk-LBTHZSBT.mjs";
@@ -735,7 +735,7 @@ function FieldError(_a) {
735
735
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
736
736
  "div",
737
737
  __spreadProps(__spreadValues({
738
- className: cn("text-caption text-destructive", className),
738
+ className: cn("text-left text-caption text-destructive", className),
739
739
  "data-slot": "field-error",
740
740
  role: "alert"
741
741
  }, props), {
@@ -1047,9 +1047,11 @@ var import_react5 = require("react");
1047
1047
  var import_lucide_react6 = require("lucide-react");
1048
1048
 
1049
1049
  // src/components/ui/password-strength-tooltip.tsx
1050
+ var React5 = __toESM(require("react"));
1050
1051
  var import_lucide_react5 = require("lucide-react");
1052
+ var import_popover3 = require("@base-ui/react/popover");
1051
1053
  var import_jsx_runtime13 = require("react/jsx-runtime");
1052
- var RULES = [
1054
+ var PASSWORD_STRENGTH_RULES = [
1053
1055
  { label: "Minimum 8 characters", test: (p) => p.length >= 8 },
1054
1056
  { label: "At least one uppercase letter", test: (p) => /[A-Z]/.test(p) },
1055
1057
  { label: "At least one lowercase letter", test: (p) => /[a-z]/.test(p) },
@@ -1059,40 +1061,73 @@ var RULES = [
1059
1061
  test: (p) => /[^A-Za-z0-9]/.test(p)
1060
1062
  }
1061
1063
  ];
1062
- function PasswordStrengthTooltip({
1063
- open = false,
1064
- password,
1065
- children,
1066
- side = "right"
1067
- }) {
1068
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Popover, { open, children: [
1069
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children }) }),
1070
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1071
- PopoverContent,
1072
- {
1073
- side,
1074
- align: "start",
1075
- sideOffset: 8,
1076
- onOpenAutoFocus: (e) => e.preventDefault(),
1077
- className: "w-auto max-w-[280px] font-sans",
1078
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-1.5", children: RULES.map((rule) => {
1079
- const valid = password ? rule.test(password) : false;
1080
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1081
- "div",
1082
- {
1083
- className: `flex items-center gap-1.5 text-[13px] leading-[18px] ${valid ? "text-success" : "text-destructive"}`,
1084
- children: [
1085
- valid ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.X, { size: 14, className: "shrink-0" }),
1086
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: rule.label })
1087
- ]
1088
- },
1089
- rule.label
1090
- );
1091
- }) })
1064
+ var PasswordStrengthTooltip = React5.forwardRef(function PasswordStrengthTooltip2({ open = false, password, children, side = "right" }, forwardedRef) {
1065
+ const themeVars = useThemeVars();
1066
+ const anchorRef = React5.useRef(null);
1067
+ const composedRef = React5.useCallback(
1068
+ (node) => {
1069
+ anchorRef.current = node;
1070
+ if (typeof forwardedRef === "function") {
1071
+ forwardedRef(node);
1072
+ } else if (forwardedRef) {
1073
+ forwardedRef.current = node;
1092
1074
  }
1093
- )
1094
- ] });
1095
- }
1075
+ },
1076
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1077
+ [forwardedRef]
1078
+ );
1079
+ return (
1080
+ // PopoverPrimitive.Root with no Trigger — popup is fully controlled via `open` prop.
1081
+ // The wrapper div has no trigger behaviors injected, so clicking the input inside
1082
+ // works on the first click without interference.
1083
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_popover3.Popover.Root, { open, children: [
1084
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: composedRef, children }),
1085
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_popover3.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1086
+ import_popover3.Popover.Positioner,
1087
+ {
1088
+ anchor: anchorRef,
1089
+ side,
1090
+ align: "start",
1091
+ sideOffset: 8,
1092
+ className: "z-[200]",
1093
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1094
+ import_popover3.Popover.Popup,
1095
+ {
1096
+ initialFocus: false,
1097
+ finalFocus: false,
1098
+ className: cn(
1099
+ "border border-border bg-popover shadow-md outline-hidden",
1100
+ "w-auto max-w-[280px] p-3 font-sans",
1101
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
1102
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1103
+ "data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
1104
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
1105
+ ),
1106
+ style: themeVars,
1107
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-1.5", children: PASSWORD_STRENGTH_RULES.map((rule) => {
1108
+ const valid = password ? rule.test(password) : false;
1109
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1110
+ "div",
1111
+ {
1112
+ className: cn(
1113
+ "flex items-center gap-1.5 text-[13px] leading-[18px]",
1114
+ valid ? "text-success" : "text-destructive"
1115
+ ),
1116
+ children: [
1117
+ valid ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.X, { size: 14, className: "shrink-0" }),
1118
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: rule.label })
1119
+ ]
1120
+ },
1121
+ rule.label
1122
+ );
1123
+ }) })
1124
+ }
1125
+ )
1126
+ }
1127
+ ) })
1128
+ ] })
1129
+ );
1130
+ });
1096
1131
 
1097
1132
  // src/components/ui/signup-form-primitives.tsx
1098
1133
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -1108,13 +1143,6 @@ function FormField({ label, required, children }) {
1108
1143
  children
1109
1144
  ] });
1110
1145
  }
1111
- var STRENGTH_RULES = [
1112
- { test: (p) => p.length >= 8 },
1113
- { test: (p) => /[A-Z]/.test(p) },
1114
- { test: (p) => /[a-z]/.test(p) },
1115
- { test: (p) => /\d/.test(p) },
1116
- { test: (p) => /[^A-Za-z0-9]/.test(p) }
1117
- ];
1118
1146
  function PasswordField({
1119
1147
  label,
1120
1148
  placeholder,
@@ -1126,13 +1154,26 @@ function PasswordField({
1126
1154
  const [error, setError] = (0, import_react5.useState)("");
1127
1155
  const [touched, setTouched] = (0, import_react5.useState)(false);
1128
1156
  const [value, setValue] = (0, import_react5.useState)("");
1129
- const [typingStarted, setTypingStarted] = (0, import_react5.useState)(false);
1130
- const allRulesPass = STRENGTH_RULES.every((r) => r.test(value));
1131
- const isPopoverOpen = !!showStrengthPopover && typingStarted && !allRulesPass;
1157
+ const [dismissed, setDismissed] = (0, import_react5.useState)(false);
1158
+ const wrapperRef = (0, import_react5.useRef)(null);
1159
+ const allRulesPass = PASSWORD_STRENGTH_RULES.every((r) => r.test(value));
1160
+ const isPopoverOpen = !!showStrengthPopover && !dismissed && value.length > 0 && !allRulesPass;
1132
1161
  const validate = (v) => {
1133
- if (v.length > 0 && v.length < 8) return "Min. 8 characters required";
1162
+ if (!v) return "";
1163
+ if (v.length < 8) return "Min. 8 characters required";
1164
+ if (!PASSWORD_STRENGTH_RULES.every((r) => r.test(v)))
1165
+ return "Password doesn't meet all requirements";
1134
1166
  return "";
1135
1167
  };
1168
+ (0, import_react5.useEffect)(() => {
1169
+ if (!isPopoverOpen) return;
1170
+ const onMouseDown = (e) => {
1171
+ var _a;
1172
+ if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.target))) setDismissed(true);
1173
+ };
1174
+ document.addEventListener("mousedown", onMouseDown, true);
1175
+ return () => document.removeEventListener("mousedown", onMouseDown, true);
1176
+ }, [isPopoverOpen]);
1136
1177
  const inputEl = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "relative", children: [
1137
1178
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1138
1179
  Input,
@@ -1145,8 +1186,16 @@ function PasswordField({
1145
1186
  const v = e.target.value;
1146
1187
  setValue(v);
1147
1188
  onValueChange == null ? void 0 : onValueChange(v);
1148
- if (!typingStarted && v.length > 0) setTypingStarted(true);
1149
1189
  if (touched) setError(validate(v));
1190
+ setDismissed(false);
1191
+ },
1192
+ onFocus: () => setDismissed(false),
1193
+ onKeyDown: (e) => {
1194
+ if (e.key === "Tab") {
1195
+ setTouched(true);
1196
+ setError(validate(value));
1197
+ setDismissed(true);
1198
+ }
1150
1199
  },
1151
1200
  onBlur: () => {
1152
1201
  setTouched(true);
@@ -1173,13 +1222,14 @@ function PasswordField({
1173
1222
  showStrengthPopover ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1174
1223
  PasswordStrengthTooltip,
1175
1224
  {
1225
+ ref: wrapperRef,
1176
1226
  open: isPopoverOpen,
1177
1227
  password: value,
1178
1228
  side: "right",
1179
1229
  children: inputEl
1180
1230
  }
1181
1231
  ) : inputEl,
1182
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "min-h-5", children: touched && error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldError, { children: error }) })
1232
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "min-h-5", children: touched && error && !isPopoverOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldError, { children: error }) })
1183
1233
  ] });
1184
1234
  }
1185
1235
  var DEFAULT_ROLE_OPTIONS = ["Admin", "Broker", "Support"];
@@ -6,12 +6,12 @@ import {
6
6
  PaymentView,
7
7
  PersonalDetailsStep,
8
8
  StripeView
9
- } from "../../chunk-SO4RB3XB.mjs";
10
- import "../../chunk-DWJHPNFL.mjs";
11
- import "../../chunk-WHIW6KOB.mjs";
9
+ } from "../../chunk-IEQX4UVP.mjs";
10
+ import "../../chunk-4UT3RZ2D.mjs";
11
+ import "../../chunk-IKVF4XE2.mjs";
12
12
  import "../../chunk-I4KVSZCH.mjs";
13
13
  import "../../chunk-IW33VLL5.mjs";
14
- import "../../chunk-KPGARKFC.mjs";
14
+ import "../../chunk-MS3GNXMB.mjs";
15
15
  import "../../chunk-3S6KVFF5.mjs";
16
16
  import "../../chunk-IKXYTCSB.mjs";
17
17
  import "../../chunk-K6VCC2MK.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BankStatementGenerateDialog
3
- } from "../../chunk-EVUY67CY.mjs";
4
- import "../../chunk-KPGARKFC.mjs";
3
+ } from "../../chunk-FTQ2AKZ2.mjs";
4
+ import "../../chunk-MS3GNXMB.mjs";
5
5
  import "../../chunk-6WRDXE7A.mjs";
6
6
  import "../../chunk-GT3RU6GA.mjs";
7
7
  import "../../chunk-IKXYTCSB.mjs";
@@ -387,7 +387,7 @@ function FieldError(_a) {
387
387
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
388
388
  "div",
389
389
  __spreadProps(__spreadValues({
390
- className: cn("text-caption text-destructive", className),
390
+ className: cn("text-left text-caption text-destructive", className),
391
391
  "data-slot": "field-error",
392
392
  role: "alert"
393
393
  }, props), {
@@ -6,9 +6,9 @@ import {
6
6
  ChatWidgetTopicGrid,
7
7
  ChatWidgetWindow,
8
8
  DEFAULT_CHAT_WIDGET_TOPICS
9
- } from "../../chunk-KJQ3BVTB.mjs";
9
+ } from "../../chunk-X2NIDXFB.mjs";
10
10
  import "../../chunk-FQYFPHDO.mjs";
11
- import "../../chunk-KPGARKFC.mjs";
11
+ import "../../chunk-MS3GNXMB.mjs";
12
12
  import "../../chunk-H6NQTIF4.mjs";
13
13
  import "../../chunk-2GIYVERS.mjs";
14
14
  import "../../chunk-X6RC5UWB.mjs";
@@ -4,9 +4,9 @@ import {
4
4
  ContactAlertDialog,
5
5
  ContactAlertQueryBuilder,
6
6
  createAlertTree
7
- } from "../../../chunk-36IN7YRM.mjs";
7
+ } from "../../../chunk-SCGCGVDN.mjs";
8
8
  import "../../../chunk-7YI3HEBH.mjs";
9
- import "../../../chunk-KPGARKFC.mjs";
9
+ import "../../../chunk-MS3GNXMB.mjs";
10
10
  import "../../../chunk-IKXYTCSB.mjs";
11
11
  import "../../../chunk-K6VCC2MK.mjs";
12
12
  import "../../../chunk-T5FRVEJQ.mjs";
@@ -381,7 +381,7 @@ function FieldError(_a) {
381
381
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
382
382
  "div",
383
383
  __spreadProps(__spreadValues({
384
- className: cn("text-caption text-destructive", className),
384
+ className: cn("text-left text-caption text-destructive", className),
385
385
  "data-slot": "field-error",
386
386
  role: "alert"
387
387
  }, props), {
@@ -9,7 +9,7 @@ import {
9
9
  FieldSeparator,
10
10
  FieldSet,
11
11
  FieldTitle
12
- } from "../../chunk-KPGARKFC.mjs";
12
+ } from "../../chunk-MS3GNXMB.mjs";
13
13
  import "../../chunk-2GIYVERS.mjs";
14
14
  import "../../chunk-LSRGA5BI.mjs";
15
15
  import "../../chunk-AFML43VJ.mjs";