@tomny-dev/uzi 0.2.5 → 0.2.6-pr.22.68.1.a53abf5
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/auth-card/AuthCard.d.ts +24 -0
- package/dist/components/auth-card/AuthCard.d.ts.map +1 -0
- package/dist/components/auth-card/AuthCard.test.d.ts +2 -0
- package/dist/components/auth-card/AuthCard.test.d.ts.map +1 -0
- package/dist/components/auth-pages/AuthPages.d.ts +58 -0
- package/dist/components/auth-pages/AuthPages.d.ts.map +1 -0
- package/dist/components/auth-pages/AuthPages.test.d.ts +2 -0
- package/dist/components/auth-pages/AuthPages.test.d.ts.map +1 -0
- package/dist/index.cjs +71 -1925
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -1858
- package/dist/index10.cjs +26 -0
- package/dist/index10.cjs.map +1 -0
- package/dist/index10.js +19 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.cjs +22 -0
- package/dist/index11.cjs.map +1 -0
- package/dist/index11.js +22 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.cjs +22 -0
- package/dist/index12.cjs.map +1 -0
- package/dist/index12.js +41 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.cjs +56 -0
- package/dist/index13.cjs.map +1 -0
- package/dist/index13.js +84 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.cjs +87 -0
- package/dist/index14.cjs.map +1 -0
- package/dist/index14.js +17 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.cjs +22 -0
- package/dist/index15.cjs.map +1 -0
- package/dist/index15.js +16 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.cjs +16 -0
- package/dist/index16.cjs.map +1 -0
- package/dist/index16.js +45 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.cjs +64 -0
- package/dist/index17.cjs.map +1 -0
- package/dist/index17.js +435 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.cjs +438 -0
- package/dist/index18.cjs.map +1 -0
- package/dist/index18.js +7 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.cjs +8 -0
- package/dist/index19.cjs.map +1 -0
- package/dist/index19.js +18 -0
- package/dist/index19.js.map +1 -0
- package/dist/index2.cjs +23 -0
- package/dist/index20.cjs +20 -0
- package/dist/index20.cjs.map +1 -0
- package/dist/index20.js +7 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.cjs +8 -0
- package/dist/index21.cjs.map +1 -0
- package/dist/index21.js +15 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.cjs +17 -0
- package/dist/index22.cjs.map +1 -0
- package/dist/index22.js +7 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.cjs +8 -0
- package/dist/index23.cjs.map +1 -0
- package/dist/index23.js +18 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.cjs +20 -0
- package/dist/index24.cjs.map +1 -0
- package/dist/index24.js +41 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.cjs +58 -0
- package/dist/index25.cjs.map +1 -0
- package/dist/index25.js +123 -0
- package/dist/index25.js.map +1 -0
- package/dist/index26.cjs +126 -0
- package/dist/index26.cjs.map +1 -0
- package/dist/index26.js +29 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.cjs +40 -0
- package/dist/index27.cjs.map +1 -0
- package/dist/index27.js +110 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.cjs +113 -0
- package/dist/index28.cjs.map +1 -0
- package/dist/index28.js +26 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.cjs +28 -0
- package/dist/index29.cjs.map +1 -0
- package/dist/index29.js +29 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.js +8 -0
- package/dist/index3.js.map +1 -0
- package/dist/index30.cjs +40 -0
- package/dist/index30.cjs.map +1 -0
- package/dist/index30.js +118 -0
- package/dist/index30.js.map +1 -0
- package/dist/index31.cjs +134 -0
- package/dist/index31.cjs.map +1 -0
- package/dist/index31.js +20 -0
- package/dist/index31.js.map +1 -0
- package/dist/index32.cjs +23 -0
- package/dist/index32.cjs.map +1 -0
- package/dist/index32.js +114 -0
- package/dist/index32.js.map +1 -0
- package/dist/index33.cjs +115 -0
- package/dist/index33.cjs.map +1 -0
- package/dist/index33.js +7 -0
- package/dist/index33.js.map +1 -0
- package/dist/index34.cjs +8 -0
- package/dist/index34.cjs.map +1 -0
- package/dist/index34.js +66 -0
- package/dist/index34.js.map +1 -0
- package/dist/index35.cjs +66 -0
- package/dist/index35.cjs.map +1 -0
- package/dist/index35.js +25 -0
- package/dist/index35.js.map +1 -0
- package/dist/index36.cjs +34 -0
- package/dist/index36.cjs.map +1 -0
- package/dist/index36.js +55 -0
- package/dist/index36.js.map +1 -0
- package/dist/index37.cjs +55 -0
- package/dist/index37.cjs.map +1 -0
- package/dist/index37.js +35 -0
- package/dist/index37.js.map +1 -0
- package/dist/index38.cjs +49 -0
- package/dist/index38.cjs.map +1 -0
- package/dist/index38.js +150 -0
- package/dist/index38.js.map +1 -0
- package/dist/index39.cjs +150 -0
- package/dist/index39.cjs.map +1 -0
- package/dist/index39.js +43 -0
- package/dist/index39.js.map +1 -0
- package/dist/index4.cjs +8 -0
- package/dist/index4.cjs.map +1 -0
- package/dist/index4.js +29 -0
- package/dist/index4.js.map +1 -0
- package/dist/index40.cjs +61 -0
- package/dist/index40.cjs.map +1 -0
- package/dist/index40.js +173 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.cjs +173 -0
- package/dist/index41.cjs.map +1 -0
- package/dist/index41.js +14 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.cjs +15 -0
- package/dist/index42.cjs.map +1 -0
- package/dist/index42.js +21 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.cjs +21 -0
- package/dist/index43.cjs.map +1 -0
- package/dist/index43.js +15 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.cjs +17 -0
- package/dist/index44.cjs.map +1 -0
- package/dist/index44.js +24 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.cjs +24 -0
- package/dist/index45.cjs.map +1 -0
- package/dist/index45.js +13 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.cjs +16 -0
- package/dist/index46.cjs.map +1 -0
- package/dist/index46.js +96 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.cjs +98 -0
- package/dist/index47.cjs.map +1 -0
- package/dist/index47.js +25 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.cjs +34 -0
- package/dist/index48.cjs.map +1 -0
- package/dist/index48.js +50 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.cjs +52 -0
- package/dist/index49.cjs.map +1 -0
- package/dist/index49.js +61 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.cjs +40 -0
- package/dist/index5.cjs.map +1 -0
- package/dist/index5.js +45 -0
- package/dist/index5.js.map +1 -0
- package/dist/index50.cjs +88 -0
- package/dist/index50.cjs.map +1 -0
- package/dist/index50.js +436 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.cjs +440 -0
- package/dist/index51.cjs.map +1 -0
- package/dist/index6.cjs +47 -0
- package/dist/index6.cjs.map +1 -0
- package/dist/index6.js +17 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.cjs +20 -0
- package/dist/index7.cjs.map +1 -0
- package/dist/index7.js +30 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.cjs +35 -0
- package/dist/index8.cjs.map +1 -0
- package/dist/index8.js +18 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.cjs +20 -0
- package/dist/index9.cjs.map +1 -0
- package/dist/index9.js +26 -0
- package/dist/index9.js.map +1 -0
- package/dist/style.css +395 -0
- package/package.json +1 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index51.cjs
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
const require_runtime = require("./index2.cjs");
|
|
2
|
+
const require_cx = require("./index4.cjs");
|
|
3
|
+
const require_auth_pages_module = require("./index50.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/components/auth-pages/AuthPages.tsx
|
|
8
|
+
function EyeIcon({ open }) {
|
|
9
|
+
if (open) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
className: require_auth_pages_module.default.eyeIcon,
|
|
14
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
15
|
+
d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
strokeWidth: "2"
|
|
18
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
19
|
+
cx: "12",
|
|
20
|
+
cy: "12",
|
|
21
|
+
r: "3",
|
|
22
|
+
stroke: "currentColor",
|
|
23
|
+
strokeWidth: "2"
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
fill: "none",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: require_auth_pages_module.default.eyeIcon,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
33
|
+
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",
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
strokeWidth: "2"
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
38
|
+
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",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "2"
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
43
|
+
x1: "1",
|
|
44
|
+
y1: "1",
|
|
45
|
+
x2: "23",
|
|
46
|
+
y2: "23",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: "2"
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function Field({ label, id, children, error }) {
|
|
54
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
55
|
+
className: require_auth_pages_module.default.field,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
58
|
+
htmlFor: id,
|
|
59
|
+
className: require_auth_pages_module.default.label,
|
|
60
|
+
children: label
|
|
61
|
+
}),
|
|
62
|
+
children,
|
|
63
|
+
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
64
|
+
className: require_auth_pages_module.default.error,
|
|
65
|
+
children: error
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function PasswordField({ id, placeholder, value, onChange, error }) {
|
|
71
|
+
const [show, setShow] = react.useState(false);
|
|
72
|
+
const toggleRef = react.useRef(null);
|
|
73
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
74
|
+
label: "Password",
|
|
75
|
+
id,
|
|
76
|
+
error,
|
|
77
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
78
|
+
className: require_auth_pages_module.default.passwordWrapper,
|
|
79
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
80
|
+
id,
|
|
81
|
+
type: show ? "text" : "password",
|
|
82
|
+
placeholder,
|
|
83
|
+
value,
|
|
84
|
+
onChange,
|
|
85
|
+
className: require_auth_pages_module.default.input
|
|
86
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
87
|
+
ref: toggleRef,
|
|
88
|
+
type: "button",
|
|
89
|
+
tabIndex: -1,
|
|
90
|
+
onClick: () => setShow((s) => !s),
|
|
91
|
+
className: require_auth_pages_module.default.toggle,
|
|
92
|
+
"aria-label": show ? "Hide password" : "Show password",
|
|
93
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EyeIcon, { open: show })
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function CheckboxRow({ label, linkText, linkHref }) {
|
|
99
|
+
if (!label) return null;
|
|
100
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
101
|
+
className: require_auth_pages_module.default.checkboxRow,
|
|
102
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
103
|
+
className: require_auth_pages_module.default.checkboxLabel,
|
|
104
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
105
|
+
type: "checkbox",
|
|
106
|
+
className: require_auth_pages_module.default.checkbox
|
|
107
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label })]
|
|
108
|
+
}), linkHref && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
109
|
+
href: linkHref,
|
|
110
|
+
className: require_auth_pages_module.default.forgotLink,
|
|
111
|
+
children: linkText
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function SignInPage({ title = "Sign in", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", rememberLabel = "Remember me", forgotLinkText = "Forgot password?", forgotLinkHref }) {
|
|
116
|
+
const id = react.useId();
|
|
117
|
+
const formRef = react.useRef(null);
|
|
118
|
+
const [email, setEmail] = react.useState("");
|
|
119
|
+
const [password, setPassword] = react.useState("");
|
|
120
|
+
const [rememberMe, setRememberMe] = react.useState(false);
|
|
121
|
+
const [errors, setErrors] = react.useState({});
|
|
122
|
+
const [submitted, setSubmitted] = react.useState(false);
|
|
123
|
+
const validate = () => {
|
|
124
|
+
const newErrors = {};
|
|
125
|
+
if (!email.trim()) newErrors.email = "Email is required";
|
|
126
|
+
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
127
|
+
if (!password) newErrors.password = "Password is required";
|
|
128
|
+
setErrors(newErrors);
|
|
129
|
+
return Object.keys(newErrors).length === 0;
|
|
130
|
+
};
|
|
131
|
+
const handleSubmit = (e) => {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
setSubmitted(true);
|
|
134
|
+
if (!validate()) return;
|
|
135
|
+
onSubmit?.({
|
|
136
|
+
email,
|
|
137
|
+
password,
|
|
138
|
+
rememberMe
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
142
|
+
className: require_cx.cx(require_auth_pages_module.default.authLayout, className),
|
|
143
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
144
|
+
className: require_auth_pages_module.default.authCard,
|
|
145
|
+
children: [
|
|
146
|
+
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
147
|
+
className: require_auth_pages_module.default.authBrand,
|
|
148
|
+
children: brand
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
151
|
+
className: require_auth_pages_module.default.authHeader,
|
|
152
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
153
|
+
className: require_auth_pages_module.default.authTitle,
|
|
154
|
+
children: title
|
|
155
|
+
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
156
|
+
className: require_auth_pages_module.default.authSubtitle,
|
|
157
|
+
children: subtitle
|
|
158
|
+
})]
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
161
|
+
ref: formRef,
|
|
162
|
+
onSubmit: handleSubmit,
|
|
163
|
+
className: require_auth_pages_module.default.authForm,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
166
|
+
label: emailPlaceholder,
|
|
167
|
+
id: id + "-email",
|
|
168
|
+
error: submitted ? errors.email : void 0,
|
|
169
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
170
|
+
id: id + "-email",
|
|
171
|
+
type: "email",
|
|
172
|
+
placeholder: "you@example.com",
|
|
173
|
+
value: email,
|
|
174
|
+
onChange: (e) => setEmail(e.target.value),
|
|
175
|
+
className: require_auth_pages_module.default.input,
|
|
176
|
+
autoComplete: "email",
|
|
177
|
+
autoFocus: true
|
|
178
|
+
})
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
181
|
+
id: id + "-password",
|
|
182
|
+
placeholder: passwordPlaceholder,
|
|
183
|
+
value: password,
|
|
184
|
+
onChange: (e) => {
|
|
185
|
+
setPassword(e.target.value);
|
|
186
|
+
if (submitted) setSubmitted(false);
|
|
187
|
+
},
|
|
188
|
+
error: submitted ? errors.password : void 0
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxRow, {
|
|
191
|
+
label: rememberLabel,
|
|
192
|
+
linkText: forgotLinkText,
|
|
193
|
+
linkHref: forgotLinkHref
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
196
|
+
type: "submit",
|
|
197
|
+
disabled: loading,
|
|
198
|
+
className: require_auth_pages_module.default.submitButton,
|
|
199
|
+
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Signing in..."] }) : "Sign in"
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
}),
|
|
203
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_pages_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
204
|
+
className: require_auth_pages_module.default.authFooter,
|
|
205
|
+
children: footer
|
|
206
|
+
})] })
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function SignUpPage({ title = "Create an account", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", confirmPasswordPlaceholder = "Confirm password", checkboxLabel, checkboxLinkText, checkboxLinkHref }) {
|
|
212
|
+
const id = react.useId();
|
|
213
|
+
const formRef = react.useRef(null);
|
|
214
|
+
const [email, setEmail] = react.useState("");
|
|
215
|
+
const [password, setPassword] = react.useState("");
|
|
216
|
+
const [confirmPassword, setConfirmPassword] = react.useState("");
|
|
217
|
+
const [agreed, setAgreed] = react.useState(false);
|
|
218
|
+
const [errors, setErrors] = react.useState({});
|
|
219
|
+
const [submitted, setSubmitted] = react.useState(false);
|
|
220
|
+
const validate = () => {
|
|
221
|
+
const newErrors = {};
|
|
222
|
+
if (!email.trim()) newErrors.email = "Email is required";
|
|
223
|
+
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
224
|
+
if (!password) newErrors.password = "Password is required";
|
|
225
|
+
else if (password.length < 8) newErrors.password = "At least 8 characters";
|
|
226
|
+
if (password !== confirmPassword) newErrors.confirmPassword = "Passwords do not match";
|
|
227
|
+
if (!agreed) newErrors.agreed = "You must agree to continue";
|
|
228
|
+
setErrors(newErrors);
|
|
229
|
+
return Object.keys(newErrors).length === 0;
|
|
230
|
+
};
|
|
231
|
+
const handleSubmit = (e) => {
|
|
232
|
+
e.preventDefault();
|
|
233
|
+
setSubmitted(true);
|
|
234
|
+
if (!validate()) return;
|
|
235
|
+
onSubmit?.({
|
|
236
|
+
email,
|
|
237
|
+
password,
|
|
238
|
+
agreed
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
242
|
+
className: require_cx.cx(require_auth_pages_module.default.authLayout, className),
|
|
243
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
244
|
+
className: require_auth_pages_module.default.authCard,
|
|
245
|
+
children: [
|
|
246
|
+
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
247
|
+
className: require_auth_pages_module.default.authBrand,
|
|
248
|
+
children: brand
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
251
|
+
className: require_auth_pages_module.default.authHeader,
|
|
252
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
253
|
+
className: require_auth_pages_module.default.authTitle,
|
|
254
|
+
children: title
|
|
255
|
+
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
256
|
+
className: require_auth_pages_module.default.authSubtitle,
|
|
257
|
+
children: subtitle
|
|
258
|
+
})]
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
261
|
+
ref: formRef,
|
|
262
|
+
onSubmit: handleSubmit,
|
|
263
|
+
className: require_auth_pages_module.default.authForm,
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
266
|
+
label: emailPlaceholder,
|
|
267
|
+
id: id + "-email",
|
|
268
|
+
error: submitted ? errors.email : void 0,
|
|
269
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
270
|
+
id: id + "-email",
|
|
271
|
+
type: "email",
|
|
272
|
+
placeholder: "you@example.com",
|
|
273
|
+
value: email,
|
|
274
|
+
onChange: (e) => {
|
|
275
|
+
setEmail(e.target.value);
|
|
276
|
+
if (submitted) setSubmitted(false);
|
|
277
|
+
},
|
|
278
|
+
className: require_auth_pages_module.default.input,
|
|
279
|
+
autoComplete: "email",
|
|
280
|
+
autoFocus: true
|
|
281
|
+
})
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
284
|
+
id: id + "-password",
|
|
285
|
+
placeholder: passwordPlaceholder,
|
|
286
|
+
value: password,
|
|
287
|
+
onChange: (e) => {
|
|
288
|
+
setPassword(e.target.value);
|
|
289
|
+
if (submitted) setSubmitted(false);
|
|
290
|
+
},
|
|
291
|
+
error: submitted ? errors.password : void 0
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
294
|
+
id: id + "-confirm",
|
|
295
|
+
placeholder: confirmPasswordPlaceholder,
|
|
296
|
+
value: confirmPassword,
|
|
297
|
+
onChange: (e) => {
|
|
298
|
+
setConfirmPassword(e.target.value);
|
|
299
|
+
if (submitted) setSubmitted(false);
|
|
300
|
+
},
|
|
301
|
+
error: submitted ? errors.confirmPassword : void 0
|
|
302
|
+
}),
|
|
303
|
+
checkboxLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
304
|
+
className: require_auth_pages_module.default.checkboxRow,
|
|
305
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
306
|
+
className: require_auth_pages_module.default.checkboxLabel,
|
|
307
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
308
|
+
id: id + "-email",
|
|
309
|
+
type: "checkbox",
|
|
310
|
+
checked: agreed,
|
|
311
|
+
onChange: (e) => {
|
|
312
|
+
setAgreed(e.target.checked);
|
|
313
|
+
if (submitted) setSubmitted(false);
|
|
314
|
+
},
|
|
315
|
+
className: require_auth_pages_module.default.checkbox
|
|
316
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: checkboxLinkText ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
317
|
+
"I agree to the",
|
|
318
|
+
" ",
|
|
319
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
320
|
+
href: checkboxLinkHref,
|
|
321
|
+
className: require_auth_pages_module.default.checkboxLink,
|
|
322
|
+
children: checkboxLinkText
|
|
323
|
+
})
|
|
324
|
+
] }) : checkboxLabel })]
|
|
325
|
+
})
|
|
326
|
+
}),
|
|
327
|
+
submitted && errors.agreed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
328
|
+
className: require_auth_pages_module.default.error,
|
|
329
|
+
children: errors.agreed
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
332
|
+
type: "submit",
|
|
333
|
+
disabled: loading,
|
|
334
|
+
className: require_auth_pages_module.default.submitButton,
|
|
335
|
+
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Creating account..."] }) : "Create account"
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
}),
|
|
339
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_pages_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
340
|
+
className: require_auth_pages_module.default.authFooter,
|
|
341
|
+
children: footer
|
|
342
|
+
})] })
|
|
343
|
+
]
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
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" }) {
|
|
348
|
+
const id = react.useId();
|
|
349
|
+
const formRef = react.useRef(null);
|
|
350
|
+
const [email, setEmail] = react.useState("");
|
|
351
|
+
const [error, setError] = react.useState("");
|
|
352
|
+
const [sent, setSent] = react.useState(false);
|
|
353
|
+
const handleSubmit = (e) => {
|
|
354
|
+
e.preventDefault();
|
|
355
|
+
if (!email.trim()) {
|
|
356
|
+
setError("Email is required");
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
360
|
+
setError("Enter a valid email");
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
onSubmit?.({ email });
|
|
364
|
+
setSent(true);
|
|
365
|
+
};
|
|
366
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
367
|
+
className: require_cx.cx(require_auth_pages_module.default.authLayout, className),
|
|
368
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
369
|
+
className: require_auth_pages_module.default.authCard,
|
|
370
|
+
children: [
|
|
371
|
+
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
372
|
+
className: require_auth_pages_module.default.authBrand,
|
|
373
|
+
children: brand
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
376
|
+
className: require_auth_pages_module.default.authHeader,
|
|
377
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
378
|
+
className: require_auth_pages_module.default.authTitle,
|
|
379
|
+
children: title
|
|
380
|
+
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
381
|
+
className: require_auth_pages_module.default.authSubtitle,
|
|
382
|
+
children: subtitle
|
|
383
|
+
})]
|
|
384
|
+
}),
|
|
385
|
+
sent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
386
|
+
className: require_auth_pages_module.default.sentMessage,
|
|
387
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
388
|
+
className: require_auth_pages_module.default.sentText,
|
|
389
|
+
children: [
|
|
390
|
+
"If an account exists for ",
|
|
391
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: email }),
|
|
392
|
+
", you'll receive a reset link shortly."
|
|
393
|
+
]
|
|
394
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
395
|
+
href: backLinkHref,
|
|
396
|
+
className: require_auth_pages_module.default.backLink,
|
|
397
|
+
children: backLinkText
|
|
398
|
+
})]
|
|
399
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
400
|
+
ref: formRef,
|
|
401
|
+
onSubmit: handleSubmit,
|
|
402
|
+
className: require_auth_pages_module.default.authForm,
|
|
403
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
404
|
+
label: emailPlaceholder,
|
|
405
|
+
id: id + "-email",
|
|
406
|
+
error,
|
|
407
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
408
|
+
id: id + "-email",
|
|
409
|
+
type: "email",
|
|
410
|
+
placeholder: "you@example.com",
|
|
411
|
+
value: email,
|
|
412
|
+
onChange: (e) => {
|
|
413
|
+
setEmail(e.target.value);
|
|
414
|
+
setError("");
|
|
415
|
+
},
|
|
416
|
+
className: require_auth_pages_module.default.input,
|
|
417
|
+
autoComplete: "email",
|
|
418
|
+
autoFocus: true
|
|
419
|
+
})
|
|
420
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
421
|
+
type: "submit",
|
|
422
|
+
disabled: loading,
|
|
423
|
+
className: require_auth_pages_module.default.submitButton,
|
|
424
|
+
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Sending..."] }) : buttonText
|
|
425
|
+
})]
|
|
426
|
+
}),
|
|
427
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_pages_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
428
|
+
className: require_auth_pages_module.default.authFooter,
|
|
429
|
+
children: footer
|
|
430
|
+
})] })
|
|
431
|
+
]
|
|
432
|
+
})
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
exports.ForgotPasswordPage = ForgotPasswordPage;
|
|
437
|
+
exports.SignInPage = SignInPage;
|
|
438
|
+
exports.SignUpPage = SignUpPage;
|
|
439
|
+
|
|
440
|
+
//# sourceMappingURL=index51.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index51.cjs","names":[],"sources":["../src/components/auth-pages/AuthPages.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-pages.module.css\";\n\n// ── Eye icon (show/hide password) ──\nfunction EyeIcon({ open }: { open: boolean }) {\n if (open) {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n }\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path 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\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <path 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\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n}\n\n// ── Internal reusable field ──\ninterface FieldProps {\n label: string;\n id: string;\n children: React.ReactNode;\n error?: string;\n}\n\nfunction Field({ label, id, children, error }: FieldProps) {\n return (\n <div className={styles.field}>\n <label htmlFor={id} className={styles.label}>\n {label}\n </label>\n {children}\n {error && <span className={styles.error}>{error}</span>}\n </div>\n );\n}\n\n// ── Password input with visibility toggle ──\ninterface PasswordFieldProps {\n id: string;\n placeholder?: string;\n value?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n error?: string;\n}\n\nfunction PasswordField({ id, placeholder, value, onChange, error }: PasswordFieldProps) {\n const [show, setShow] = React.useState(false);\n const toggleRef = React.useRef<HTMLButtonElement>(null);\n\n return (\n <Field label=\"Password\" id={id} error={error}>\n <div className={styles.passwordWrapper}>\n <input\n id={id}\n type={show ? \"text\" : \"password\"}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n className={styles.input}\n />\n <button\n ref={toggleRef}\n type=\"button\"\n tabIndex={-1}\n onClick={() => setShow((s) => !s)}\n className={styles.toggle}\n aria-label={show ? \"Hide password\" : \"Show password\"}\n >\n <EyeIcon open={show} />\n </button>\n </div>\n </Field>\n );\n}\n\n// ── Checkbox row ──\ninterface CheckboxRowProps {\n label?: string;\n linkText: string;\n linkHref?: string;\n}\n\nfunction CheckboxRow({ label, linkText, linkHref }: CheckboxRowProps) {\n if (!label) return null;\n return (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input type=\"checkbox\" className={styles.checkbox} />\n <span>{label}</span>\n </label>\n {linkHref && (\n <a href={linkHref} className={styles.forgotLink}>\n {linkText}\n </a>\n )}\n </div>\n );\n}\n\n// ── Shared props ──\ninterface BaseAuthPageProps {\n /** Page title */\n title: string;\n /** Page subtitle */\n subtitle?: string;\n /** Footer content (e.g., \"No account? Sign up\") */\n footer: React.ReactNode;\n /** Called with form data on valid submit */\n onSubmit?: (data: Record<string, string | boolean>) => void;\n /** Loading state for the submit button */\n loading?: boolean;\n /** Optional brand/logo element */\n brand?: React.ReactNode;\n /** Extra class for the outer wrapper */\n className?: string;\n}\n\n// ── Sign In Page ──\nexport interface SignInPageProps extends BaseAuthPageProps {\n /** Email placeholder (default \"Email address\") */\n emailPlaceholder?: string;\n /** Password placeholder (default \"Password\") */\n passwordPlaceholder?: string;\n /** \"Remember me\" checkbox label */\n rememberLabel?: string;\n /** \"Forgot password\" link text */\n forgotLinkText?: string;\n /** \"Forgot password\" link href */\n forgotLinkHref?: string;\n}\n\nexport function SignInPage({\n title = \"Sign in\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n rememberLabel = \"Remember me\",\n forgotLinkText = \"Forgot password?\",\n forgotLinkHref,\n}: SignInPageProps) {\n const id = React.useId();\n const formRef = React.useRef<HTMLFormElement>(null);\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [rememberMe, setRememberMe] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, rememberMe });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form ref={formRef} onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <CheckboxRow\n label={rememberLabel}\n linkText={forgotLinkText}\n linkHref={forgotLinkHref}\n />\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Signing in...\n </>\n ) : (\n \"Sign in\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Sign Up Page ──\nexport interface SignUpPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Password placeholder */\n passwordPlaceholder?: string;\n /** Confirm password placeholder */\n confirmPasswordPlaceholder?: string;\n /** Checkbox label (e.g., \"I agree to the Terms of Service\") */\n checkboxLabel?: string;\n /** Checkbox href */\n checkboxLinkText?: string;\n /** Checkbox href */\n checkboxLinkHref?: string;\n}\n\nexport function SignUpPage({\n title = \"Create an account\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n confirmPasswordPlaceholder = \"Confirm password\",\n checkboxLabel,\n checkboxLinkText,\n checkboxLinkHref,\n}: SignUpPageProps) {\n const id = React.useId();\n const formRef = React.useRef<HTMLFormElement>(null);\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [confirmPassword, setConfirmPassword] = React.useState(\"\");\n const [agreed, setAgreed] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n else if (password.length < 8) newErrors.password = \"At least 8 characters\";\n if (password !== confirmPassword) newErrors.confirmPassword = \"Passwords do not match\";\n if (!agreed) newErrors.agreed = \"You must agree to continue\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, agreed });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form ref={formRef} onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); if (submitted) setSubmitted(false); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <PasswordField\n id={id + \"-confirm\"}\n placeholder={confirmPasswordPlaceholder}\n value={confirmPassword}\n onChange={(e) => { setConfirmPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.confirmPassword : undefined}\n />\n {checkboxLabel && (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input\n id={id + \"-email\"}\n type=\"checkbox\"\n checked={agreed}\n onChange={(e) => { setAgreed(e.target.checked); if (submitted) setSubmitted(false); }}\n className={styles.checkbox}\n />\n <span>\n {checkboxLinkText ? (\n <>\n I agree to the{\" \"}\n <a href={checkboxLinkHref} className={styles.checkboxLink}>\n {checkboxLinkText}\n </a>\n </>\n ) : (\n checkboxLabel\n )}\n </span>\n </label>\n </div>\n )}\n {submitted && errors.agreed && <span className={styles.error}>{errors.agreed}</span>}\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Creating account...\n </>\n ) : (\n \"Create account\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Forgot Password Page ──\nexport interface ForgotPasswordPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Button text */\n buttonText?: string;\n /** Back to sign in link text */\n backLinkText?: string;\n /** Back to sign in link href */\n backLinkHref?: string;\n}\n\nexport function ForgotPasswordPage({\n title = \"Reset password\",\n subtitle = \"Enter your email and we'll send a reset link\",\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n buttonText = \"Send reset link\",\n backLinkText = \"Back to sign in\",\n backLinkHref = \"/signin\",\n}: ForgotPasswordPageProps) {\n const id = React.useId();\n const formRef = React.useRef<HTMLFormElement>(null);\n const [email, setEmail] = React.useState(\"\");\n const [error, setError] = React.useState(\"\");\n const [sent, setSent] = React.useState(false);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!email.trim()) { setError(\"Email is required\"); return; }\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) { setError(\"Enter a valid email\"); return; }\n onSubmit?.({ email });\n setSent(true);\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n {sent ? (\n <div className={styles.sentMessage}>\n <p className={styles.sentText}>\n If an account exists for <strong>{email}</strong>, you'll receive a reset link shortly.\n </p>\n <a href={backLinkHref} className={styles.backLink}>\n {backLinkText}\n </a>\n </div>\n ) : (\n <form ref={formRef} onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={error}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); setError(\"\"); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Sending...\n </>\n ) : (\n buttonText\n )}\n </button>\n </form>\n )}\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAKA,SAAS,QAAQ,EAAE,QAA2B;CAC5C,IAAI,MACF,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,eAAY;EAAO,WAAW,0BAAA,QAAO;YAA1E,CACE,iB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AAG,WAAW,0BAAA,QAAO;eAAa;IAAU,CAAA,CAC5C,EAAA,CAAA;GAED;;CACF,CAAA;AAET"}
|
package/dist/index6.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const require_runtime = require("./index2.cjs");
|
|
2
|
+
const require_cx = require("./index4.cjs");
|
|
3
|
+
const require_button_module = require("./index5.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/button/Button.tsx
|
|
9
|
+
var variantClass = {
|
|
10
|
+
default: "variantPrimary",
|
|
11
|
+
primary: "variantPrimary",
|
|
12
|
+
secondary: "variantSecondary",
|
|
13
|
+
outline: "variantOutline",
|
|
14
|
+
ghost: "variantGhost",
|
|
15
|
+
destructive: "variantDestructive",
|
|
16
|
+
link: "variantLink"
|
|
17
|
+
};
|
|
18
|
+
var sizeClass = {
|
|
19
|
+
default: "sizeMd",
|
|
20
|
+
sm: "sizeSm",
|
|
21
|
+
md: "sizeMd",
|
|
22
|
+
lg: "sizeLg",
|
|
23
|
+
icon: "sizeIcon"
|
|
24
|
+
};
|
|
25
|
+
function Button({ as, variant = "default", size = "default", className, children, asChild = false, ...rest }) {
|
|
26
|
+
const classes = require_cx.cx(require_button_module.default.button, require_button_module.default[variantClass[variant]], require_button_module.default[sizeClass[size]], className);
|
|
27
|
+
if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_slot.Slot, {
|
|
28
|
+
className: classes,
|
|
29
|
+
...rest,
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
if (as === "a") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
33
|
+
className: classes,
|
|
34
|
+
...rest,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
className: classes,
|
|
40
|
+
...rest,
|
|
41
|
+
children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.Button = Button;
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=index6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index6.cjs","names":[],"sources":["../src/components/button/Button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./button.module.css\";\n\nexport type ButtonVariant =\n | \"default\"\n | \"primary\"\n | \"secondary\"\n | \"outline\"\n | \"ghost\"\n | \"destructive\"\n | \"link\";\nexport type ButtonSize = \"default\" | \"sm\" | \"md\" | \"lg\" | \"icon\";\n\ntype BaseProps = {\n variant?: ButtonVariant;\n size?: ButtonSize;\n className?: string;\n children?: React.ReactNode;\n asChild?: boolean;\n};\n\ntype AsButton = BaseProps &\n React.ButtonHTMLAttributes<HTMLButtonElement> & { as?: \"button\" };\n\ntype AsAnchor = BaseProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & { as: \"a\" };\n\nexport type ButtonProps = AsButton | AsAnchor;\n\nconst variantClass: Record<ButtonVariant, string> = {\n default: \"variantPrimary\",\n primary: \"variantPrimary\",\n secondary: \"variantSecondary\",\n outline: \"variantOutline\",\n ghost: \"variantGhost\",\n destructive: \"variantDestructive\",\n link: \"variantLink\",\n};\n\nconst sizeClass: Record<ButtonSize, string> = {\n default: \"sizeMd\",\n sm: \"sizeSm\",\n md: \"sizeMd\",\n lg: \"sizeLg\",\n icon: \"sizeIcon\",\n};\n\nexport function Button({\n as,\n variant = \"default\",\n size = \"default\",\n className,\n children,\n asChild = false,\n ...rest\n}: ButtonProps) {\n const classes = cx(\n styles.button,\n styles[variantClass[variant]],\n styles[sizeClass[size]],\n className,\n );\n\n if (asChild) {\n return (\n <Slot className={classes} {...rest}>\n {children}\n </Slot>\n );\n }\n\n if (as === \"a\") {\n return (\n <a\n className={classes}\n {...(rest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {children}\n </a>\n );\n }\n\n return (\n <button\n type=\"button\"\n className={classes}\n {...(rest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n >\n {children}\n </button>\n );\n}\n"],"mappings":";;;;;;;;AA+BA,IAAM,eAA8C;CAClD,SAAS;CACT,SAAS;CACT,WAAW;CACX,SAAS;CACT,OAAO;CACP,aAAa;CACb,MAAM;AACR;AAEA,IAAM,YAAwC;CAC5C,SAAS;CACT,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAEA,SAAgB,OAAO,EACrB,IACA,UAAU,WACV,OAAO,WACP,WACA,UACA,UAAU,OACV,GAAG,QACW;CACd,MAAM,UAAU,WAAA,GACd,sBAAA,QAAO,QACP,sBAAA,QAAO,aAAa,WACpB,sBAAA,QAAO,UAAU,QACjB,SACF;CAEA,IAAI,SACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,MAAD;EAAM,WAAW;EAAS,GAAI;EAC3B;CACG,CAAA;CAIV,IAAI,OAAO,KACT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,WAAW;EACX,GAAK;EAEJ;CACA,CAAA;CAIP,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,MAAK;EACL,WAAW;EACX,GAAK;EAEJ;CACK,CAAA;AAEZ"}
|
package/dist/index6.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/avatar/avatar.module.css
|
|
2
|
+
var avatar = "uzi-avatar-module__avatar__yPIOs";
|
|
3
|
+
var image = "uzi-avatar-module__image__Ngo7A";
|
|
4
|
+
var fallback = "uzi-avatar-module__fallback__Tf3oZ";
|
|
5
|
+
var avatar_module_default = {
|
|
6
|
+
avatar,
|
|
7
|
+
"size-sm": "uzi-avatar-module__size-sm__v5riJ",
|
|
8
|
+
"size-md": "uzi-avatar-module__size-md__g7IQS",
|
|
9
|
+
"size-lg": "uzi-avatar-module__size-lg__Ca4xk",
|
|
10
|
+
"size-xl": "uzi-avatar-module__size-xl__K0Dfk",
|
|
11
|
+
image,
|
|
12
|
+
fallback
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { avatar, avatar_module_default as default, fallback, image };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index6.js","names":[],"sources":["../src/components/avatar/avatar.module.css"],"sourcesContent":[".avatar {\n position: relative;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 999px;\n background: var(--ts-avatar-bg, var(--muted));\n color: var(--ts-avatar-fg, var(--muted-foreground));\n}\n\n.size-sm {\n width: 1.75rem;\n height: 1.75rem;\n}\n\n.size-md {\n width: 2rem;\n height: 2rem;\n}\n\n.size-lg {\n width: 2.25rem;\n height: 2.25rem;\n}\n\n.size-xl {\n width: 4rem;\n height: 4rem;\n}\n\n.image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.fallback {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n border-radius: inherit;\n background: var(--ts-avatar-fallback-bg, var(--muted));\n color: var(--ts-avatar-fallback-fg, var(--muted-foreground));\n font-size: 0.85rem;\n font-weight: 700;\n line-height: 1;\n text-transform: uppercase;\n}\n"],"mappings":""}
|
package/dist/index7.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/components/avatar/avatar.module.css
|
|
2
|
+
var avatar = "uzi-avatar-module__avatar__yPIOs";
|
|
3
|
+
var image = "uzi-avatar-module__image__Ngo7A";
|
|
4
|
+
var fallback = "uzi-avatar-module__fallback__Tf3oZ";
|
|
5
|
+
var avatar_module_default = {
|
|
6
|
+
avatar,
|
|
7
|
+
"size-sm": "uzi-avatar-module__size-sm__v5riJ",
|
|
8
|
+
"size-md": "uzi-avatar-module__size-md__g7IQS",
|
|
9
|
+
"size-lg": "uzi-avatar-module__size-lg__Ca4xk",
|
|
10
|
+
"size-xl": "uzi-avatar-module__size-xl__K0Dfk",
|
|
11
|
+
image,
|
|
12
|
+
fallback
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.avatar = avatar;
|
|
16
|
+
exports.default = avatar_module_default;
|
|
17
|
+
exports.fallback = fallback;
|
|
18
|
+
exports.image = image;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index7.cjs","names":[],"sources":["../src/components/avatar/avatar.module.css"],"sourcesContent":[".avatar {\n position: relative;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 999px;\n background: var(--ts-avatar-bg, var(--muted));\n color: var(--ts-avatar-fg, var(--muted-foreground));\n}\n\n.size-sm {\n width: 1.75rem;\n height: 1.75rem;\n}\n\n.size-md {\n width: 2rem;\n height: 2rem;\n}\n\n.size-lg {\n width: 2.25rem;\n height: 2.25rem;\n}\n\n.size-xl {\n width: 4rem;\n height: 4rem;\n}\n\n.image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.fallback {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n border-radius: inherit;\n background: var(--ts-avatar-fallback-bg, var(--muted));\n color: var(--ts-avatar-fallback-fg, var(--muted-foreground));\n font-size: 0.85rem;\n font-weight: 700;\n line-height: 1;\n text-transform: uppercase;\n}\n"],"mappings":""}
|
package/dist/index7.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "./index3.js";
|
|
3
|
+
import avatar_module_default from "./index6.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
7
|
+
//#region src/components/avatar/Avatar.tsx
|
|
8
|
+
function Avatar({ className, size = "md", ...props }) {
|
|
9
|
+
const sizeClass = size === "sm" ? avatar_module_default["size-sm"] : size === "lg" ? avatar_module_default["size-lg"] : size === "xl" ? avatar_module_default["size-xl"] : avatar_module_default["size-md"];
|
|
10
|
+
return /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
|
|
11
|
+
className: cx(avatar_module_default.avatar, sizeClass, className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function AvatarImage({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(AvatarPrimitive.Image, {
|
|
17
|
+
className: cx(avatar_module_default.image, className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function AvatarFallback({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, {
|
|
23
|
+
className: cx(avatar_module_default.fallback, className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index7.js","names":[],"sources":["../src/components/avatar/Avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./avatar.module.css\";\n\nexport type AvatarSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport type AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: AvatarSize;\n};\n\nexport function Avatar({\n className,\n size = \"md\",\n ...props\n}: AvatarProps) {\n const sizeClass =\n size === \"sm\" ? styles[\"size-sm\"] : size === \"lg\" ? styles[\"size-lg\"] : size === \"xl\" ? styles[\"size-xl\"] : styles[\"size-md\"];\n\n return (\n <AvatarPrimitive.Root\n className={cx(styles.avatar, sizeClass, className)}\n {...props}\n />\n );\n}\n\nexport function AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n className={cx(styles.image, className)}\n {...props}\n />\n );\n}\n\nexport function AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n className={cx(styles.fallback, className)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,OAAO,EACrB,WACA,OAAO,MACP,GAAG,SACW;CACd,MAAM,YACJ,SAAS,OAAO,sBAAO,aAAa,SAAS,OAAO,sBAAO,aAAa,SAAS,OAAO,sBAAO,aAAa,sBAAO;CAErH,OACE,oBAAC,gBAAgB,MAAjB;EACE,WAAW,GAAG,sBAAO,QAAQ,WAAW,SAAS;EACjD,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,YAAY,EAC1B,WACA,GAAG,SACkD;CACrD,OACE,oBAAC,gBAAgB,OAAjB;EACE,WAAW,GAAG,sBAAO,OAAO,SAAS;EACrC,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,eAAe,EAC7B,WACA,GAAG,SACqD;CACxD,OACE,oBAAC,gBAAgB,UAAjB;EACE,WAAW,GAAG,sBAAO,UAAU,SAAS;EACxC,GAAI;CACL,CAAA;AAEL"}
|