@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.
- package/.turbo/turbo-build.log +98 -98
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-DWJHPNFL.mjs → chunk-4UT3RZ2D.mjs} +32 -16
- package/dist/{chunk-RNLIZRAK.mjs → chunk-C6R42PCL.mjs} +1 -1
- package/dist/{chunk-EVUY67CY.mjs → chunk-FTQ2AKZ2.mjs} +1 -1
- package/dist/{chunk-7T4TYUO3.mjs → chunk-H5ZD63NT.mjs} +31 -16
- package/dist/{chunk-SO4RB3XB.mjs → chunk-IEQX4UVP.mjs} +2 -2
- package/dist/chunk-IKVF4XE2.mjs +94 -0
- package/dist/{chunk-KPGARKFC.mjs → chunk-MS3GNXMB.mjs} +1 -1
- package/dist/{chunk-M32QNCD3.mjs → chunk-OSSS56CB.mjs} +1 -1
- package/dist/{chunk-36IN7YRM.mjs → chunk-SCGCGVDN.mjs} +1 -1
- package/dist/{chunk-KJQ3BVTB.mjs → chunk-X2NIDXFB.mjs} +1 -1
- package/dist/components/ui/backoffice-signup-steps.js +98 -48
- package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
- package/dist/components/ui/bank-statement-generate-dialog.mjs +2 -2
- package/dist/components/ui/chat-widget.js +1 -1
- package/dist/components/ui/chat-widget.mjs +2 -2
- package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/field.mjs +1 -1
- package/dist/components/ui/frontend-signup-steps.js +166 -90
- package/dist/components/ui/frontend-signup-steps.mjs +4 -5
- package/dist/components/ui/password-strength-tooltip.js +81 -107
- package/dist/components/ui/password-strength-tooltip.mjs +3 -2
- package/dist/components/ui/property-report-dialog.mjs +2 -2
- package/dist/components/ui/signup-form-primitives.js +117 -114
- package/dist/components/ui/signup-form-primitives.mjs +3 -4
- package/dist/components/ui/two-fa-setup-form.js +31 -16
- package/dist/components/ui/two-fa-setup-form.mjs +2 -2
- package/dist/index.js +133 -68
- package/dist/index.mjs +10 -10
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/field.tsx +12 -12
- package/src/components/ui/password-strength-tooltip.tsx +89 -47
- package/src/components/ui/signup-form-primitives.tsx +34 -16
- package/src/components/ui/two-fa-setup-form.tsx +41 -31
- package/src/styles/styles-css.ts +1 -1
- package/dist/chunk-WHIW6KOB.mjs +0 -57
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
8
|
var __export = (target, all) => {
|
|
33
9
|
for (var name in all)
|
|
34
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -41,17 +17,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
41
17
|
}
|
|
42
18
|
return to;
|
|
43
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
44
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
29
|
|
|
46
30
|
// src/components/ui/password-strength-tooltip.tsx
|
|
47
31
|
var password_strength_tooltip_exports = {};
|
|
48
32
|
__export(password_strength_tooltip_exports, {
|
|
33
|
+
PASSWORD_STRENGTH_RULES: () => PASSWORD_STRENGTH_RULES,
|
|
49
34
|
PasswordStrengthTooltip: () => PasswordStrengthTooltip
|
|
50
35
|
});
|
|
51
36
|
module.exports = __toCommonJS(password_strength_tooltip_exports);
|
|
37
|
+
var React2 = __toESM(require("react"));
|
|
52
38
|
var import_lucide_react = require("lucide-react");
|
|
53
|
-
|
|
54
|
-
// src/components/ui/popover.tsx
|
|
55
39
|
var import_popover = require("@base-ui/react/popover");
|
|
56
40
|
|
|
57
41
|
// src/lib/utils.ts
|
|
@@ -101,53 +85,9 @@ function useThemeVars() {
|
|
|
101
85
|
return (0, import_react.useContext)(ThemeVarsContext);
|
|
102
86
|
}
|
|
103
87
|
|
|
104
|
-
// src/components/ui/popover.tsx
|
|
105
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
106
|
-
function Popover(_a) {
|
|
107
|
-
var props = __objRest(_a, []);
|
|
108
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
109
|
-
}
|
|
110
|
-
function PopoverTrigger(_a) {
|
|
111
|
-
var props = __objRest(_a, []);
|
|
112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
113
|
-
}
|
|
114
|
-
function PopoverContent(_a) {
|
|
115
|
-
var _b = _a, {
|
|
116
|
-
className,
|
|
117
|
-
align = "center",
|
|
118
|
-
sideOffset = 4,
|
|
119
|
-
style
|
|
120
|
-
} = _b, props = __objRest(_b, [
|
|
121
|
-
"className",
|
|
122
|
-
"align",
|
|
123
|
-
"sideOffset",
|
|
124
|
-
"style"
|
|
125
|
-
]);
|
|
126
|
-
const themeVars = useThemeVars();
|
|
127
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
128
|
-
import_popover.Popover.Positioner,
|
|
129
|
-
{
|
|
130
|
-
className: "z-[200]",
|
|
131
|
-
align,
|
|
132
|
-
sideOffset,
|
|
133
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
134
|
-
import_popover.Popover.Popup,
|
|
135
|
-
__spreadValues({
|
|
136
|
-
className: cn(
|
|
137
|
-
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
138
|
-
className
|
|
139
|
-
),
|
|
140
|
-
"data-slot": "popover-content",
|
|
141
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
142
|
-
}, props)
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
) });
|
|
146
|
-
}
|
|
147
|
-
|
|
148
88
|
// src/components/ui/password-strength-tooltip.tsx
|
|
149
|
-
var
|
|
150
|
-
var
|
|
89
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
90
|
+
var PASSWORD_STRENGTH_RULES = [
|
|
151
91
|
{ label: "Minimum 8 characters", test: (p) => p.length >= 8 },
|
|
152
92
|
{ label: "At least one uppercase letter", test: (p) => /[A-Z]/.test(p) },
|
|
153
93
|
{ label: "At least one lowercase letter", test: (p) => /[a-z]/.test(p) },
|
|
@@ -157,41 +97,75 @@ var RULES = [
|
|
|
157
97
|
test: (p) => /[^A-Za-z0-9]/.test(p)
|
|
158
98
|
}
|
|
159
99
|
];
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{
|
|
171
|
-
side,
|
|
172
|
-
align: "start",
|
|
173
|
-
sideOffset: 8,
|
|
174
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
175
|
-
className: "w-auto max-w-[280px] font-sans",
|
|
176
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col gap-1.5", children: RULES.map((rule) => {
|
|
177
|
-
const valid = password ? rule.test(password) : false;
|
|
178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
179
|
-
"div",
|
|
180
|
-
{
|
|
181
|
-
className: `flex items-center gap-1.5 text-[13px] leading-[18px] ${valid ? "text-success" : "text-destructive"}`,
|
|
182
|
-
children: [
|
|
183
|
-
valid ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.X, { size: 14, className: "shrink-0" }),
|
|
184
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: rule.label })
|
|
185
|
-
]
|
|
186
|
-
},
|
|
187
|
-
rule.label
|
|
188
|
-
);
|
|
189
|
-
}) })
|
|
100
|
+
var PasswordStrengthTooltip = React2.forwardRef(function PasswordStrengthTooltip2({ open = false, password, children, side = "right" }, forwardedRef) {
|
|
101
|
+
const themeVars = useThemeVars();
|
|
102
|
+
const anchorRef = React2.useRef(null);
|
|
103
|
+
const composedRef = React2.useCallback(
|
|
104
|
+
(node) => {
|
|
105
|
+
anchorRef.current = node;
|
|
106
|
+
if (typeof forwardedRef === "function") {
|
|
107
|
+
forwardedRef(node);
|
|
108
|
+
} else if (forwardedRef) {
|
|
109
|
+
forwardedRef.current = node;
|
|
190
110
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
111
|
+
},
|
|
112
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
113
|
+
[forwardedRef]
|
|
114
|
+
);
|
|
115
|
+
return (
|
|
116
|
+
// PopoverPrimitive.Root with no Trigger — popup is fully controlled via `open` prop.
|
|
117
|
+
// The wrapper div has no trigger behaviors injected, so clicking the input inside
|
|
118
|
+
// works on the first click without interference.
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_popover.Popover.Root, { open, children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: composedRef, children }),
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
122
|
+
import_popover.Popover.Positioner,
|
|
123
|
+
{
|
|
124
|
+
anchor: anchorRef,
|
|
125
|
+
side,
|
|
126
|
+
align: "start",
|
|
127
|
+
sideOffset: 8,
|
|
128
|
+
className: "z-[200]",
|
|
129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
130
|
+
import_popover.Popover.Popup,
|
|
131
|
+
{
|
|
132
|
+
initialFocus: false,
|
|
133
|
+
finalFocus: false,
|
|
134
|
+
className: cn(
|
|
135
|
+
"border border-border bg-popover shadow-md outline-hidden",
|
|
136
|
+
"w-auto max-w-[280px] p-3 font-sans",
|
|
137
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
138
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
139
|
+
"data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
140
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
141
|
+
),
|
|
142
|
+
style: themeVars,
|
|
143
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex flex-col gap-1.5", children: PASSWORD_STRENGTH_RULES.map((rule) => {
|
|
144
|
+
const valid = password ? rule.test(password) : false;
|
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: cn(
|
|
149
|
+
"flex items-center gap-1.5 text-[13px] leading-[18px]",
|
|
150
|
+
valid ? "text-success" : "text-destructive"
|
|
151
|
+
),
|
|
152
|
+
children: [
|
|
153
|
+
valid ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.X, { size: 14, className: "shrink-0" }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: rule.label })
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
rule.label
|
|
158
|
+
);
|
|
159
|
+
}) })
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
) })
|
|
164
|
+
] })
|
|
165
|
+
);
|
|
166
|
+
});
|
|
194
167
|
// Annotate the CommonJS export names for ESM import in node:
|
|
195
168
|
0 && (module.exports = {
|
|
169
|
+
PASSWORD_STRENGTH_RULES,
|
|
196
170
|
PasswordStrengthTooltip
|
|
197
171
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
+
PASSWORD_STRENGTH_RULES,
|
|
2
3
|
PasswordStrengthTooltip
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-HB5BKRMH.mjs";
|
|
4
|
+
} from "../../chunk-IKVF4XE2.mjs";
|
|
5
5
|
import "../../chunk-XYSRRDBH.mjs";
|
|
6
6
|
import "../../chunk-FRCTOAKZ.mjs";
|
|
7
7
|
import "../../chunk-AFML43VJ.mjs";
|
|
8
8
|
import "../../chunk-WNQUEZJF.mjs";
|
|
9
9
|
export {
|
|
10
|
+
PASSWORD_STRENGTH_RULES,
|
|
10
11
|
PasswordStrengthTooltip
|
|
11
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PropertyReportDialog
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-OSSS56CB.mjs";
|
|
4
|
+
import "../../chunk-MS3GNXMB.mjs";
|
|
5
5
|
import "../../chunk-LDC6V6DJ.mjs";
|
|
6
6
|
import "../../chunk-ISUA7DSB.mjs";
|
|
7
7
|
import "../../chunk-GT3RU6GA.mjs";
|
|
@@ -365,7 +365,7 @@ function FieldError(_a) {
|
|
|
365
365
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
366
366
|
"div",
|
|
367
367
|
__spreadProps(__spreadValues({
|
|
368
|
-
className: cn("text-caption text-destructive", className),
|
|
368
|
+
className: cn("text-left text-caption text-destructive", className),
|
|
369
369
|
"data-slot": "field-error",
|
|
370
370
|
role: "alert"
|
|
371
371
|
}, props), {
|
|
@@ -556,56 +556,11 @@ function SelectScrollDownButton(_a) {
|
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
// src/components/ui/password-strength-tooltip.tsx
|
|
559
|
+
var React4 = __toESM(require("react"));
|
|
559
560
|
var import_lucide_react3 = require("lucide-react");
|
|
560
|
-
|
|
561
|
-
// src/components/ui/popover.tsx
|
|
562
561
|
var import_popover = require("@base-ui/react/popover");
|
|
563
562
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
564
|
-
|
|
565
|
-
var props = __objRest(_a, []);
|
|
566
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
567
|
-
}
|
|
568
|
-
function PopoverTrigger(_a) {
|
|
569
|
-
var props = __objRest(_a, []);
|
|
570
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
571
|
-
}
|
|
572
|
-
function PopoverContent(_a) {
|
|
573
|
-
var _b = _a, {
|
|
574
|
-
className,
|
|
575
|
-
align = "center",
|
|
576
|
-
sideOffset = 4,
|
|
577
|
-
style
|
|
578
|
-
} = _b, props = __objRest(_b, [
|
|
579
|
-
"className",
|
|
580
|
-
"align",
|
|
581
|
-
"sideOffset",
|
|
582
|
-
"style"
|
|
583
|
-
]);
|
|
584
|
-
const themeVars = useThemeVars();
|
|
585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
586
|
-
import_popover.Popover.Positioner,
|
|
587
|
-
{
|
|
588
|
-
className: "z-[200]",
|
|
589
|
-
align,
|
|
590
|
-
sideOffset,
|
|
591
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
592
|
-
import_popover.Popover.Popup,
|
|
593
|
-
__spreadValues({
|
|
594
|
-
className: cn(
|
|
595
|
-
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
596
|
-
className
|
|
597
|
-
),
|
|
598
|
-
"data-slot": "popover-content",
|
|
599
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
600
|
-
}, props)
|
|
601
|
-
)
|
|
602
|
-
}
|
|
603
|
-
) });
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// src/components/ui/password-strength-tooltip.tsx
|
|
607
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
608
|
-
var RULES = [
|
|
563
|
+
var PASSWORD_STRENGTH_RULES = [
|
|
609
564
|
{ label: "Minimum 8 characters", test: (p) => p.length >= 8 },
|
|
610
565
|
{ label: "At least one uppercase letter", test: (p) => /[A-Z]/.test(p) },
|
|
611
566
|
{ label: "At least one lowercase letter", test: (p) => /[a-z]/.test(p) },
|
|
@@ -615,62 +570,88 @@ var RULES = [
|
|
|
615
570
|
test: (p) => /[^A-Za-z0-9]/.test(p)
|
|
616
571
|
}
|
|
617
572
|
];
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
{
|
|
629
|
-
side,
|
|
630
|
-
align: "start",
|
|
631
|
-
sideOffset: 8,
|
|
632
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
633
|
-
className: "w-auto max-w-[280px] font-sans",
|
|
634
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col gap-1.5", children: RULES.map((rule) => {
|
|
635
|
-
const valid = password ? rule.test(password) : false;
|
|
636
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
637
|
-
"div",
|
|
638
|
-
{
|
|
639
|
-
className: `flex items-center gap-1.5 text-[13px] leading-[18px] ${valid ? "text-success" : "text-destructive"}`,
|
|
640
|
-
children: [
|
|
641
|
-
valid ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { size: 14, className: "shrink-0" }),
|
|
642
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: rule.label })
|
|
643
|
-
]
|
|
644
|
-
},
|
|
645
|
-
rule.label
|
|
646
|
-
);
|
|
647
|
-
}) })
|
|
573
|
+
var PasswordStrengthTooltip = React4.forwardRef(function PasswordStrengthTooltip2({ open = false, password, children, side = "right" }, forwardedRef) {
|
|
574
|
+
const themeVars = useThemeVars();
|
|
575
|
+
const anchorRef = React4.useRef(null);
|
|
576
|
+
const composedRef = React4.useCallback(
|
|
577
|
+
(node) => {
|
|
578
|
+
anchorRef.current = node;
|
|
579
|
+
if (typeof forwardedRef === "function") {
|
|
580
|
+
forwardedRef(node);
|
|
581
|
+
} else if (forwardedRef) {
|
|
582
|
+
forwardedRef.current = node;
|
|
648
583
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
584
|
+
},
|
|
585
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
586
|
+
[forwardedRef]
|
|
587
|
+
);
|
|
588
|
+
return (
|
|
589
|
+
// PopoverPrimitive.Root with no Trigger — popup is fully controlled via `open` prop.
|
|
590
|
+
// The wrapper div has no trigger behaviors injected, so clicking the input inside
|
|
591
|
+
// works on the first click without interference.
|
|
592
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_popover.Popover.Root, { open, children: [
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: composedRef, children }),
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
595
|
+
import_popover.Popover.Positioner,
|
|
596
|
+
{
|
|
597
|
+
anchor: anchorRef,
|
|
598
|
+
side,
|
|
599
|
+
align: "start",
|
|
600
|
+
sideOffset: 8,
|
|
601
|
+
className: "z-[200]",
|
|
602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
603
|
+
import_popover.Popover.Popup,
|
|
604
|
+
{
|
|
605
|
+
initialFocus: false,
|
|
606
|
+
finalFocus: false,
|
|
607
|
+
className: cn(
|
|
608
|
+
"border border-border bg-popover shadow-md outline-hidden",
|
|
609
|
+
"w-auto max-w-[280px] p-3 font-sans",
|
|
610
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
611
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
612
|
+
"data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
613
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
|
|
614
|
+
),
|
|
615
|
+
style: themeVars,
|
|
616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col gap-1.5", children: PASSWORD_STRENGTH_RULES.map((rule) => {
|
|
617
|
+
const valid = password ? rule.test(password) : false;
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
className: cn(
|
|
622
|
+
"flex items-center gap-1.5 text-[13px] leading-[18px]",
|
|
623
|
+
valid ? "text-success" : "text-destructive"
|
|
624
|
+
),
|
|
625
|
+
children: [
|
|
626
|
+
valid ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Check, { size: 14, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.X, { size: 14, className: "shrink-0" }),
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: rule.label })
|
|
628
|
+
]
|
|
629
|
+
},
|
|
630
|
+
rule.label
|
|
631
|
+
);
|
|
632
|
+
}) })
|
|
633
|
+
}
|
|
634
|
+
)
|
|
635
|
+
}
|
|
636
|
+
) })
|
|
637
|
+
] })
|
|
638
|
+
);
|
|
639
|
+
});
|
|
652
640
|
|
|
653
641
|
// src/components/ui/signup-form-primitives.tsx
|
|
654
|
-
var
|
|
642
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
655
643
|
function SectionHeading({ children }) {
|
|
656
|
-
return /* @__PURE__ */ (0,
|
|
644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "font-semibold text-lg text-foreground", children });
|
|
657
645
|
}
|
|
658
646
|
function FormField({ label, required, children }) {
|
|
659
|
-
return /* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { children: [
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldLabel, { children: [
|
|
661
649
|
label,
|
|
662
|
-
required && /* @__PURE__ */ (0,
|
|
650
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
|
|
663
651
|
] }),
|
|
664
652
|
children
|
|
665
653
|
] });
|
|
666
654
|
}
|
|
667
|
-
var STRENGTH_RULES = [
|
|
668
|
-
{ test: (p) => p.length >= 8 },
|
|
669
|
-
{ test: (p) => /[A-Z]/.test(p) },
|
|
670
|
-
{ test: (p) => /[a-z]/.test(p) },
|
|
671
|
-
{ test: (p) => /\d/.test(p) },
|
|
672
|
-
{ test: (p) => /[^A-Za-z0-9]/.test(p) }
|
|
673
|
-
];
|
|
674
655
|
function PasswordField({
|
|
675
656
|
label,
|
|
676
657
|
placeholder,
|
|
@@ -682,15 +663,28 @@ function PasswordField({
|
|
|
682
663
|
const [error, setError] = (0, import_react4.useState)("");
|
|
683
664
|
const [touched, setTouched] = (0, import_react4.useState)(false);
|
|
684
665
|
const [value, setValue] = (0, import_react4.useState)("");
|
|
685
|
-
const [
|
|
686
|
-
const
|
|
687
|
-
const
|
|
666
|
+
const [dismissed, setDismissed] = (0, import_react4.useState)(false);
|
|
667
|
+
const wrapperRef = (0, import_react4.useRef)(null);
|
|
668
|
+
const allRulesPass = PASSWORD_STRENGTH_RULES.every((r) => r.test(value));
|
|
669
|
+
const isPopoverOpen = !!showStrengthPopover && !dismissed && value.length > 0 && !allRulesPass;
|
|
688
670
|
const validate = (v) => {
|
|
689
|
-
if (v
|
|
671
|
+
if (!v) return "";
|
|
672
|
+
if (v.length < 8) return "Min. 8 characters required";
|
|
673
|
+
if (!PASSWORD_STRENGTH_RULES.every((r) => r.test(v)))
|
|
674
|
+
return "Password doesn't meet all requirements";
|
|
690
675
|
return "";
|
|
691
676
|
};
|
|
692
|
-
|
|
693
|
-
|
|
677
|
+
(0, import_react4.useEffect)(() => {
|
|
678
|
+
if (!isPopoverOpen) return;
|
|
679
|
+
const onMouseDown = (e) => {
|
|
680
|
+
var _a;
|
|
681
|
+
if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.target))) setDismissed(true);
|
|
682
|
+
};
|
|
683
|
+
document.addEventListener("mousedown", onMouseDown, true);
|
|
684
|
+
return () => document.removeEventListener("mousedown", onMouseDown, true);
|
|
685
|
+
}, [isPopoverOpen]);
|
|
686
|
+
const inputEl = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
694
688
|
Input,
|
|
695
689
|
{
|
|
696
690
|
type: show ? "text" : "password",
|
|
@@ -701,8 +695,16 @@ function PasswordField({
|
|
|
701
695
|
const v = e.target.value;
|
|
702
696
|
setValue(v);
|
|
703
697
|
onValueChange == null ? void 0 : onValueChange(v);
|
|
704
|
-
if (!typingStarted && v.length > 0) setTypingStarted(true);
|
|
705
698
|
if (touched) setError(validate(v));
|
|
699
|
+
setDismissed(false);
|
|
700
|
+
},
|
|
701
|
+
onFocus: () => setDismissed(false),
|
|
702
|
+
onKeyDown: (e) => {
|
|
703
|
+
if (e.key === "Tab") {
|
|
704
|
+
setTouched(true);
|
|
705
|
+
setError(validate(value));
|
|
706
|
+
setDismissed(true);
|
|
707
|
+
}
|
|
706
708
|
},
|
|
707
709
|
onBlur: () => {
|
|
708
710
|
setTouched(true);
|
|
@@ -710,32 +712,33 @@ function PasswordField({
|
|
|
710
712
|
}
|
|
711
713
|
}
|
|
712
714
|
),
|
|
713
|
-
/* @__PURE__ */ (0,
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
714
716
|
"button",
|
|
715
717
|
{
|
|
716
718
|
type: "button",
|
|
717
719
|
"aria-label": show ? "Hide password" : "Show password",
|
|
718
720
|
className: "absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",
|
|
719
721
|
onClick: () => setShow((s) => !s),
|
|
720
|
-
children: show ? /* @__PURE__ */ (0,
|
|
722
|
+
children: show ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.EyeOffIcon, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.EyeIcon, { className: "size-4" })
|
|
721
723
|
}
|
|
722
724
|
)
|
|
723
725
|
] });
|
|
724
|
-
return /* @__PURE__ */ (0,
|
|
725
|
-
/* @__PURE__ */ (0,
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { children: [
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldLabel, { children: [
|
|
726
728
|
label,
|
|
727
|
-
required && /* @__PURE__ */ (0,
|
|
729
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
|
|
728
730
|
] }),
|
|
729
|
-
showStrengthPopover ? /* @__PURE__ */ (0,
|
|
731
|
+
showStrengthPopover ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
730
732
|
PasswordStrengthTooltip,
|
|
731
733
|
{
|
|
734
|
+
ref: wrapperRef,
|
|
732
735
|
open: isPopoverOpen,
|
|
733
736
|
password: value,
|
|
734
737
|
side: "right",
|
|
735
738
|
children: inputEl
|
|
736
739
|
}
|
|
737
740
|
) : inputEl,
|
|
738
|
-
/* @__PURE__ */ (0,
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "min-h-5", children: touched && error && !isPopoverOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FieldError, { children: error }) })
|
|
739
742
|
] });
|
|
740
743
|
}
|
|
741
744
|
var DEFAULT_ROLE_OPTIONS = ["Admin", "Broker", "Support"];
|
|
@@ -746,8 +749,8 @@ function StaffRowItem({
|
|
|
746
749
|
showRemove,
|
|
747
750
|
roleOptions = DEFAULT_ROLE_OPTIONS
|
|
748
751
|
}) {
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
750
|
-
/* @__PURE__ */ (0,
|
|
752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
751
754
|
Input,
|
|
752
755
|
{
|
|
753
756
|
className: "flex-1",
|
|
@@ -756,25 +759,25 @@ function StaffRowItem({
|
|
|
756
759
|
onChange: (e) => onChange(member.id, "email", e.target.value)
|
|
757
760
|
}
|
|
758
761
|
),
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
762
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
760
763
|
Select,
|
|
761
764
|
{
|
|
762
765
|
value: member.role,
|
|
763
766
|
onValueChange: (v) => onChange(member.id, "role", v),
|
|
764
767
|
children: [
|
|
765
|
-
/* @__PURE__ */ (0,
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
768
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: "w-[140px] shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, { placeholder: "Select Role" }) }),
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectContent, { children: roleOptions.map((r) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectItem, { value: r, children: r }, r)) })
|
|
767
770
|
]
|
|
768
771
|
}
|
|
769
772
|
),
|
|
770
|
-
showRemove && /* @__PURE__ */ (0,
|
|
773
|
+
showRemove && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
771
774
|
Button,
|
|
772
775
|
{
|
|
773
776
|
variant: "ghost",
|
|
774
777
|
size: "icon-sm",
|
|
775
778
|
onClick: () => onRemove(member.id),
|
|
776
779
|
"aria-label": "Remove staff member",
|
|
777
|
-
children: /* @__PURE__ */ (0,
|
|
780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Trash2Icon, { className: "size-4" })
|
|
778
781
|
}
|
|
779
782
|
)
|
|
780
783
|
] });
|
|
@@ -3,12 +3,11 @@ import {
|
|
|
3
3
|
PasswordField,
|
|
4
4
|
SectionHeading,
|
|
5
5
|
StaffRowItem
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-4UT3RZ2D.mjs";
|
|
7
|
+
import "../../chunk-IKVF4XE2.mjs";
|
|
8
|
+
import "../../chunk-MS3GNXMB.mjs";
|
|
9
9
|
import "../../chunk-K6VCC2MK.mjs";
|
|
10
10
|
import "../../chunk-2GIYVERS.mjs";
|
|
11
|
-
import "../../chunk-HB5BKRMH.mjs";
|
|
12
11
|
import "../../chunk-LSRGA5BI.mjs";
|
|
13
12
|
import "../../chunk-LBTHZSBT.mjs";
|
|
14
13
|
import "../../chunk-XYSRRDBH.mjs";
|