@tomny-dev/uzi 0.6.3 → 0.7.0-pr.78.214.1.87d1ede
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/conversation/Conversation.d.ts +18 -0
- package/dist/components/conversation/Conversation.d.ts.map +1 -0
- package/dist/components/conversation/Conversation.test.d.ts +2 -0
- package/dist/components/conversation/Conversation.test.d.ts.map +1 -0
- package/dist/components/multi-select/MultiSelect.d.ts +9 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.test.d.ts +2 -0
- package/dist/components/multi-select/MultiSelect.test.d.ts.map +1 -0
- package/dist/index.cjs +19 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/index26.js +10 -2
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +13 -1
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +74 -37
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +74 -37
- package/dist/index28.cjs.map +1 -1
- package/dist/index53.js +26 -16
- package/dist/index53.js.map +1 -1
- package/dist/index54.cjs +37 -20
- package/dist/index54.cjs.map +1 -1
- package/dist/index54.js +57 -23
- package/dist/index54.js.map +1 -1
- package/dist/index55.cjs +63 -24
- package/dist/index55.cjs.map +1 -1
- package/dist/index55.js +16 -16
- package/dist/index55.js.map +1 -1
- package/dist/index56.cjs +19 -20
- package/dist/index56.cjs.map +1 -1
- package/dist/index56.js +24 -21
- package/dist/index56.js.map +1 -1
- package/dist/index57.cjs +25 -22
- package/dist/index57.cjs.map +1 -1
- package/dist/index57.js +17 -10
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +23 -11
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +25 -14
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +25 -13
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +10 -11
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +11 -13
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +13 -16
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +13 -16
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +10 -8
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +11 -10
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +15 -87
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +15 -89
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +9 -21
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +12 -30
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +89 -43
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +88 -42
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +14 -50
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +15 -69
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +25 -414
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +25 -416
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +56 -58
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +82 -85
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +419 -226
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +420 -225
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +58 -42
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +85 -61
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +236 -76
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +235 -75
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +42 -20
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +60 -27
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +73 -88
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +73 -90
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +17 -15
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +22 -19
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +85 -143
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +87 -143
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +23 -0
- package/dist/index75.js.map +1 -0
- package/dist/index76.cjs +31 -0
- package/dist/index76.cjs.map +1 -0
- package/dist/index76.js +159 -0
- package/dist/index76.js.map +1 -0
- package/dist/index77.cjs +161 -0
- package/dist/index77.cjs.map +1 -0
- package/dist/style.css +150 -0
- package/package.json +1 -1
package/dist/index68.js
CHANGED
|
@@ -1,246 +1,439 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cx } from "./index3.js";
|
|
3
|
-
import
|
|
2
|
+
import auth_pages_module_default from "./index67.js";
|
|
4
3
|
import * as React from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/auth-pages/AuthPages.tsx
|
|
6
|
+
function EyeIcon({ open }) {
|
|
7
|
+
if (open) return /* @__PURE__ */ jsxs("svg", {
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className: auth_pages_module_default.eyeIcon,
|
|
12
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
13
|
+
d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
strokeWidth: "2"
|
|
16
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
17
|
+
cx: "12",
|
|
18
|
+
cy: "12",
|
|
19
|
+
r: "3",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeWidth: "2"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "none",
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
className: auth_pages_module_default.eyeIcon,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("path", {
|
|
31
|
+
d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
strokeWidth: "2"
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx("path", {
|
|
36
|
+
d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19",
|
|
37
|
+
stroke: "currentColor",
|
|
38
|
+
strokeWidth: "2"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx("line", {
|
|
41
|
+
x1: "1",
|
|
42
|
+
y1: "1",
|
|
43
|
+
x2: "23",
|
|
44
|
+
y2: "23",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "2"
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function Field({ label, id, children, error }) {
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: auth_pages_module_default.field,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx("label", {
|
|
56
|
+
htmlFor: id,
|
|
57
|
+
className: auth_pages_module_default.label,
|
|
58
|
+
children: label
|
|
59
|
+
}),
|
|
60
|
+
children,
|
|
61
|
+
error && /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: auth_pages_module_default.error,
|
|
63
|
+
children: error
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function PasswordField({ id, label, placeholder, value, onChange, error }) {
|
|
69
|
+
const [show, setShow] = React.useState(false);
|
|
70
|
+
const toggleRef = React.useRef(null);
|
|
71
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
72
|
+
label: label ?? "Password",
|
|
73
|
+
id,
|
|
74
|
+
error,
|
|
75
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
className: auth_pages_module_default.passwordWrapper,
|
|
77
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
78
|
+
id,
|
|
79
|
+
type: show ? "text" : "password",
|
|
80
|
+
placeholder,
|
|
81
|
+
value,
|
|
82
|
+
onChange,
|
|
83
|
+
className: auth_pages_module_default.input
|
|
84
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
85
|
+
ref: toggleRef,
|
|
86
|
+
type: "button",
|
|
87
|
+
onClick: () => setShow((s) => !s),
|
|
88
|
+
className: auth_pages_module_default.toggle,
|
|
89
|
+
"aria-label": show ? "Hide password" : "Show password",
|
|
90
|
+
children: /* @__PURE__ */ jsx(EyeIcon, { open: show })
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function CheckboxRow({ label, linkText, linkHref, checked, onChange }) {
|
|
96
|
+
if (!label) return null;
|
|
97
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
98
|
+
className: auth_pages_module_default.checkboxRow,
|
|
99
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
100
|
+
className: auth_pages_module_default.checkboxLabel,
|
|
101
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
102
|
+
type: "checkbox",
|
|
103
|
+
className: auth_pages_module_default.checkbox,
|
|
104
|
+
checked,
|
|
105
|
+
onChange: (e) => onChange?.(e.target.checked)
|
|
106
|
+
}), /* @__PURE__ */ jsx("span", { children: label })]
|
|
107
|
+
}), linkHref && /* @__PURE__ */ jsx("a", {
|
|
108
|
+
href: linkHref,
|
|
109
|
+
className: auth_pages_module_default.forgotLink,
|
|
110
|
+
children: linkText
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function SignInPage({ title = "Sign in", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", rememberLabel = "Remember me", forgotLinkText = "Forgot password?", forgotLinkHref }) {
|
|
115
|
+
const id = React.useId();
|
|
116
|
+
const [email, setEmail] = React.useState("");
|
|
117
|
+
const [password, setPassword] = React.useState("");
|
|
118
|
+
const [rememberMe, setRememberMe] = React.useState(false);
|
|
119
|
+
const [errors, setErrors] = React.useState({});
|
|
120
|
+
const [submitted, setSubmitted] = React.useState(false);
|
|
121
|
+
const validate = () => {
|
|
122
|
+
const newErrors = {};
|
|
123
|
+
if (!email.trim()) newErrors.email = "Email is required";
|
|
124
|
+
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
125
|
+
if (!password) newErrors.password = "Password is required";
|
|
126
|
+
setErrors(newErrors);
|
|
127
|
+
return Object.keys(newErrors).length === 0;
|
|
18
128
|
};
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
129
|
+
const handleSubmit = (e) => {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
setSubmitted(true);
|
|
132
|
+
if (!validate()) return;
|
|
133
|
+
onSubmit?.({
|
|
134
|
+
email,
|
|
135
|
+
password,
|
|
136
|
+
rememberMe
|
|
137
|
+
});
|
|
25
138
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
139
|
+
return /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: cx(auth_pages_module_default.authLayout, className),
|
|
141
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
142
|
+
className: auth_pages_module_default.authCard,
|
|
143
|
+
children: [
|
|
144
|
+
brand && /* @__PURE__ */ jsx("div", {
|
|
145
|
+
className: auth_pages_module_default.authBrand,
|
|
146
|
+
children: brand
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ jsxs("div", {
|
|
149
|
+
className: auth_pages_module_default.authHeader,
|
|
150
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
151
|
+
className: auth_pages_module_default.authTitle,
|
|
152
|
+
children: title
|
|
153
|
+
}), subtitle && /* @__PURE__ */ jsx("p", {
|
|
154
|
+
className: auth_pages_module_default.authSubtitle,
|
|
155
|
+
children: subtitle
|
|
156
|
+
})]
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ jsxs("form", {
|
|
159
|
+
onSubmit: handleSubmit,
|
|
160
|
+
className: auth_pages_module_default.authForm,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Field, {
|
|
163
|
+
label: emailPlaceholder,
|
|
164
|
+
id: id + "-email",
|
|
165
|
+
error: submitted ? errors.email : void 0,
|
|
166
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
167
|
+
id: id + "-email",
|
|
168
|
+
type: "email",
|
|
169
|
+
placeholder: "you@example.com",
|
|
170
|
+
value: email,
|
|
171
|
+
onChange: (e) => setEmail(e.target.value),
|
|
172
|
+
className: auth_pages_module_default.input,
|
|
173
|
+
autoComplete: "email",
|
|
174
|
+
autoFocus: true
|
|
175
|
+
})
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsx(PasswordField, {
|
|
178
|
+
label: passwordPlaceholder,
|
|
179
|
+
id: id + "-password",
|
|
180
|
+
placeholder: passwordPlaceholder,
|
|
181
|
+
value: password,
|
|
182
|
+
onChange: (e) => {
|
|
183
|
+
setPassword(e.target.value);
|
|
184
|
+
if (submitted) setSubmitted(false);
|
|
185
|
+
},
|
|
186
|
+
error: submitted ? errors.password : void 0
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ jsx(CheckboxRow, {
|
|
189
|
+
label: rememberLabel,
|
|
190
|
+
linkText: forgotLinkText,
|
|
191
|
+
linkHref: forgotLinkHref,
|
|
192
|
+
checked: rememberMe,
|
|
193
|
+
onChange: (c) => {
|
|
194
|
+
setRememberMe(c);
|
|
195
|
+
if (submitted) setSubmitted(false);
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx("button", {
|
|
199
|
+
type: "submit",
|
|
200
|
+
disabled: loading,
|
|
201
|
+
className: auth_pages_module_default.submitButton,
|
|
202
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: auth_pages_module_default.spinner }), "Signing in..."] }) : "Sign in"
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
}),
|
|
206
|
+
footer && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", { className: auth_pages_module_default.divider }), /* @__PURE__ */ jsx("p", {
|
|
207
|
+
className: auth_pages_module_default.authFooter,
|
|
208
|
+
children: footer
|
|
209
|
+
})] })
|
|
210
|
+
]
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function SignUpPage({ title = "Create an account", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", confirmPasswordPlaceholder = "Confirm password", checkboxLabel, checkboxLinkText, checkboxLinkHref }) {
|
|
215
|
+
const id = React.useId();
|
|
216
|
+
const [email, setEmail] = React.useState("");
|
|
217
|
+
const [password, setPassword] = React.useState("");
|
|
218
|
+
const [confirmPassword, setConfirmPassword] = React.useState("");
|
|
219
|
+
const [agreed, setAgreed] = React.useState(false);
|
|
220
|
+
const [errors, setErrors] = React.useState({});
|
|
221
|
+
const [submitted, setSubmitted] = React.useState(false);
|
|
222
|
+
const validate = () => {
|
|
223
|
+
const newErrors = {};
|
|
224
|
+
if (!email.trim()) newErrors.email = "Email is required";
|
|
225
|
+
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
226
|
+
if (!password) newErrors.password = "Password is required";
|
|
227
|
+
else if (password.length < 8) newErrors.password = "At least 8 characters";
|
|
228
|
+
if (password !== confirmPassword) newErrors.confirmPassword = "Passwords do not match";
|
|
229
|
+
if (!agreed) newErrors.agreed = "You must agree to continue";
|
|
230
|
+
setErrors(newErrors);
|
|
231
|
+
return Object.keys(newErrors).length === 0;
|
|
34
232
|
};
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
totalPages
|
|
44
|
-
]);
|
|
45
|
-
const sortedData = React.useMemo(() => {
|
|
46
|
-
if (!sortKey) return data;
|
|
47
|
-
const sortColumn = columns.find((column) => column.key === sortKey);
|
|
48
|
-
const getSortValue = (row) => {
|
|
49
|
-
if (sortColumn?.accessor) {
|
|
50
|
-
const accessed = sortColumn.accessor(row);
|
|
51
|
-
if (typeof accessed === "string" || typeof accessed === "number") return accessed;
|
|
52
|
-
}
|
|
53
|
-
return row[sortKey];
|
|
54
|
-
};
|
|
55
|
-
return [...data].sort((a, b) => {
|
|
56
|
-
const aVal = getSortValue(a);
|
|
57
|
-
const bVal = getSortValue(b);
|
|
58
|
-
if (aVal == null) return 1;
|
|
59
|
-
if (bVal == null) return -1;
|
|
60
|
-
let cmp = 0;
|
|
61
|
-
if (typeof aVal === "number" && typeof bVal === "number") cmp = aVal - bVal;
|
|
62
|
-
else cmp = String(aVal).localeCompare(String(bVal));
|
|
63
|
-
return sortDir === "asc" ? cmp : -cmp;
|
|
233
|
+
const handleSubmit = (e) => {
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
setSubmitted(true);
|
|
236
|
+
if (!validate()) return;
|
|
237
|
+
onSubmit?.({
|
|
238
|
+
email,
|
|
239
|
+
password,
|
|
240
|
+
agreed
|
|
64
241
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"aria-label": "Select all",
|
|
242
|
+
};
|
|
243
|
+
return /* @__PURE__ */ jsx("div", {
|
|
244
|
+
className: cx(auth_pages_module_default.authLayout, className),
|
|
245
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
246
|
+
className: auth_pages_module_default.authCard,
|
|
247
|
+
children: [
|
|
248
|
+
brand && /* @__PURE__ */ jsx("div", {
|
|
249
|
+
className: auth_pages_module_default.authBrand,
|
|
250
|
+
children: brand
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsxs("div", {
|
|
253
|
+
className: auth_pages_module_default.authHeader,
|
|
254
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
255
|
+
className: auth_pages_module_default.authTitle,
|
|
256
|
+
children: title
|
|
257
|
+
}), subtitle && /* @__PURE__ */ jsx("p", {
|
|
258
|
+
className: auth_pages_module_default.authSubtitle,
|
|
259
|
+
children: subtitle
|
|
260
|
+
})]
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsxs("form", {
|
|
263
|
+
onSubmit: handleSubmit,
|
|
264
|
+
className: auth_pages_module_default.authForm,
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ jsx(Field, {
|
|
267
|
+
label: emailPlaceholder,
|
|
268
|
+
id: id + "-email",
|
|
269
|
+
error: submitted ? errors.email : void 0,
|
|
94
270
|
children: /* @__PURE__ */ jsx("input", {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
271
|
+
id: id + "-email",
|
|
272
|
+
type: "email",
|
|
273
|
+
placeholder: "you@example.com",
|
|
274
|
+
value: email,
|
|
275
|
+
onChange: (e) => {
|
|
276
|
+
setEmail(e.target.value);
|
|
277
|
+
if (submitted) setSubmitted(false);
|
|
99
278
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
279
|
+
className: auth_pages_module_default.input,
|
|
280
|
+
autoComplete: "email",
|
|
281
|
+
autoFocus: true
|
|
103
282
|
})
|
|
104
283
|
}),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
116
|
-
className: data_table_module_default.headerLabel,
|
|
117
|
-
children: col.label
|
|
118
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
119
|
-
className: data_table_module_default.sortIcon,
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
children: sortKey === col.key ? sortDir === "asc" ? "▲" : "▼" : "▲▼"
|
|
122
|
-
})]
|
|
123
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
124
|
-
className: data_table_module_default.headerLabel,
|
|
125
|
-
children: col.label
|
|
126
|
-
})
|
|
127
|
-
}, col.key);
|
|
284
|
+
/* @__PURE__ */ jsx(PasswordField, {
|
|
285
|
+
label: passwordPlaceholder,
|
|
286
|
+
id: id + "-password",
|
|
287
|
+
placeholder: passwordPlaceholder,
|
|
288
|
+
value: password,
|
|
289
|
+
onChange: (e) => {
|
|
290
|
+
setPassword(e.target.value);
|
|
291
|
+
if (submitted) setSubmitted(false);
|
|
292
|
+
},
|
|
293
|
+
error: submitted ? errors.password : void 0
|
|
128
294
|
}),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
295
|
+
/* @__PURE__ */ jsx(PasswordField, {
|
|
296
|
+
label: confirmPasswordPlaceholder,
|
|
297
|
+
id: id + "-confirm",
|
|
298
|
+
placeholder: confirmPasswordPlaceholder,
|
|
299
|
+
value: confirmPassword,
|
|
300
|
+
onChange: (e) => {
|
|
301
|
+
setConfirmPassword(e.target.value);
|
|
302
|
+
if (submitted) setSubmitted(false);
|
|
303
|
+
},
|
|
304
|
+
error: submitted ? errors.confirmPassword : void 0
|
|
305
|
+
}),
|
|
306
|
+
checkboxLabel && /* @__PURE__ */ jsx("div", {
|
|
307
|
+
className: auth_pages_module_default.checkboxRow,
|
|
308
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
309
|
+
className: auth_pages_module_default.checkboxLabel,
|
|
310
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
311
|
+
id: id + "-agreed",
|
|
312
|
+
type: "checkbox",
|
|
313
|
+
checked: agreed,
|
|
314
|
+
onChange: (e) => {
|
|
315
|
+
setAgreed(e.target.checked);
|
|
316
|
+
if (submitted) setSubmitted(false);
|
|
317
|
+
},
|
|
318
|
+
className: auth_pages_module_default.checkbox
|
|
319
|
+
}), /* @__PURE__ */ jsx("span", { children: checkboxLinkText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
320
|
+
"I agree to the",
|
|
321
|
+
" ",
|
|
322
|
+
/* @__PURE__ */ jsx("a", {
|
|
323
|
+
href: checkboxLinkHref,
|
|
324
|
+
className: auth_pages_module_default.checkboxLink,
|
|
325
|
+
children: checkboxLinkText
|
|
326
|
+
})
|
|
327
|
+
] }) : checkboxLabel })]
|
|
135
328
|
})
|
|
329
|
+
}),
|
|
330
|
+
submitted && errors.agreed && /* @__PURE__ */ jsx("span", {
|
|
331
|
+
className: auth_pages_module_default.error,
|
|
332
|
+
children: errors.agreed
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ jsx("button", {
|
|
335
|
+
type: "submit",
|
|
336
|
+
disabled: loading,
|
|
337
|
+
className: auth_pages_module_default.submitButton,
|
|
338
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: auth_pages_module_default.spinner }), "Creating account..."] }) : "Create account"
|
|
136
339
|
})
|
|
137
|
-
]
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
340
|
+
]
|
|
341
|
+
}),
|
|
342
|
+
footer && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", { className: auth_pages_module_default.divider }), /* @__PURE__ */ jsx("p", {
|
|
343
|
+
className: auth_pages_module_default.authFooter,
|
|
344
|
+
children: footer
|
|
345
|
+
})] })
|
|
346
|
+
]
|
|
347
|
+
})
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function ForgotPasswordPage({ title = "Reset password", subtitle = "Enter your email and we'll send a reset link", footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", buttonText = "Send reset link", backLinkText = "Back to sign in", backLinkHref = "/signin" }) {
|
|
351
|
+
const id = React.useId();
|
|
352
|
+
const [email, setEmail] = React.useState("");
|
|
353
|
+
const [error, setError] = React.useState("");
|
|
354
|
+
const [sent, setSent] = React.useState(false);
|
|
355
|
+
const handleSubmit = (e) => {
|
|
356
|
+
e.preventDefault();
|
|
357
|
+
if (!email.trim()) {
|
|
358
|
+
setError("Email is required");
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
362
|
+
setError("Enter a valid email");
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
onSubmit?.({ email });
|
|
366
|
+
setSent(true);
|
|
367
|
+
};
|
|
368
|
+
return /* @__PURE__ */ jsx("div", {
|
|
369
|
+
className: cx(auth_pages_module_default.authLayout, className),
|
|
370
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
371
|
+
className: auth_pages_module_default.authCard,
|
|
372
|
+
children: [
|
|
373
|
+
brand && /* @__PURE__ */ jsx("div", {
|
|
374
|
+
className: auth_pages_module_default.authBrand,
|
|
375
|
+
children: brand
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ jsxs("div", {
|
|
378
|
+
className: auth_pages_module_default.authHeader,
|
|
379
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
380
|
+
className: auth_pages_module_default.authTitle,
|
|
381
|
+
children: title
|
|
382
|
+
}), subtitle && /* @__PURE__ */ jsx("p", {
|
|
383
|
+
className: auth_pages_module_default.authSubtitle,
|
|
384
|
+
children: subtitle
|
|
385
|
+
})]
|
|
386
|
+
}),
|
|
387
|
+
sent ? /* @__PURE__ */ jsxs("div", {
|
|
388
|
+
className: auth_pages_module_default.sentMessage,
|
|
389
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
390
|
+
className: auth_pages_module_default.sentText,
|
|
143
391
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
children: [
|
|
148
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
149
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
150
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar })
|
|
151
|
-
]
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ jsxs("div", {
|
|
154
|
-
className: data_table_module_default.loadingRow,
|
|
155
|
-
"aria-busy": "true",
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
158
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
159
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar })
|
|
160
|
-
]
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ jsxs("div", {
|
|
163
|
-
className: data_table_module_default.loadingRow,
|
|
164
|
-
"aria-busy": "true",
|
|
165
|
-
children: [
|
|
166
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
167
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar }),
|
|
168
|
-
/* @__PURE__ */ jsx("div", { className: data_table_module_default.skeletonBar })
|
|
169
|
-
]
|
|
170
|
-
})
|
|
392
|
+
"If an account exists for ",
|
|
393
|
+
/* @__PURE__ */ jsx("strong", { children: email }),
|
|
394
|
+
", you'll receive a reset link shortly."
|
|
171
395
|
]
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
className:
|
|
175
|
-
children:
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
})]
|
|
211
|
-
})
|
|
212
|
-
}), data.length > pageSize && /* @__PURE__ */ jsxs("div", {
|
|
213
|
-
className: data_table_module_default.pagination,
|
|
214
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
215
|
-
className: data_table_module_default.paginationInfo,
|
|
216
|
-
children: [
|
|
217
|
-
"Page ",
|
|
218
|
-
safePage,
|
|
219
|
-
" of ",
|
|
220
|
-
totalPages
|
|
221
|
-
]
|
|
222
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
223
|
-
className: data_table_module_default.paginationButtons,
|
|
224
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
225
|
-
type: "button",
|
|
226
|
-
className: data_table_module_default.pageBtn,
|
|
227
|
-
disabled: safePage <= 1,
|
|
228
|
-
onClick: () => setPage((p) => Math.max(1, p - 1)),
|
|
229
|
-
"aria-label": "Previous page",
|
|
230
|
-
children: "←"
|
|
231
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
232
|
-
type: "button",
|
|
233
|
-
className: data_table_module_default.pageBtn,
|
|
234
|
-
disabled: safePage >= totalPages,
|
|
235
|
-
onClick: () => setPage((p) => Math.min(totalPages, p + 1)),
|
|
236
|
-
"aria-label": "Next page",
|
|
237
|
-
children: "→"
|
|
238
|
-
})]
|
|
239
|
-
})]
|
|
240
|
-
})]
|
|
396
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
397
|
+
href: backLinkHref,
|
|
398
|
+
className: auth_pages_module_default.backLink,
|
|
399
|
+
children: backLinkText
|
|
400
|
+
})]
|
|
401
|
+
}) : /* @__PURE__ */ jsxs("form", {
|
|
402
|
+
onSubmit: handleSubmit,
|
|
403
|
+
className: auth_pages_module_default.authForm,
|
|
404
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
405
|
+
label: emailPlaceholder,
|
|
406
|
+
id: id + "-email",
|
|
407
|
+
error,
|
|
408
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
409
|
+
id: id + "-email",
|
|
410
|
+
type: "email",
|
|
411
|
+
placeholder: "you@example.com",
|
|
412
|
+
value: email,
|
|
413
|
+
onChange: (e) => {
|
|
414
|
+
setEmail(e.target.value);
|
|
415
|
+
setError("");
|
|
416
|
+
},
|
|
417
|
+
className: auth_pages_module_default.input,
|
|
418
|
+
autoComplete: "email",
|
|
419
|
+
autoFocus: true
|
|
420
|
+
})
|
|
421
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
422
|
+
type: "submit",
|
|
423
|
+
disabled: loading,
|
|
424
|
+
className: auth_pages_module_default.submitButton,
|
|
425
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: auth_pages_module_default.spinner }), "Sending..."] }) : buttonText
|
|
426
|
+
})]
|
|
427
|
+
}),
|
|
428
|
+
footer && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", { className: auth_pages_module_default.divider }), /* @__PURE__ */ jsx("p", {
|
|
429
|
+
className: auth_pages_module_default.authFooter,
|
|
430
|
+
children: footer
|
|
431
|
+
})] })
|
|
432
|
+
]
|
|
433
|
+
})
|
|
241
434
|
});
|
|
242
435
|
}
|
|
243
436
|
//#endregion
|
|
244
|
-
export {
|
|
437
|
+
export { ForgotPasswordPage, SignInPage, SignUpPage };
|
|
245
438
|
|
|
246
439
|
//# sourceMappingURL=index68.js.map
|