@turinhub/atomix-common-ui 0.5.0 → 0.6.0
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/AuthPanel-CTKx618F.cjs +2 -0
- package/dist/AuthPanel-CTKx618F.cjs.map +1 -0
- package/dist/{AuthPanel-D2HFX8eN.js → AuthPanel-Cn_WwmjX.js} +259 -212
- package/dist/AuthPanel-Cn_WwmjX.js.map +1 -0
- package/dist/PDFSidebar-4DtXqqzN.cjs +2 -0
- package/dist/PDFSidebar-4DtXqqzN.cjs.map +1 -0
- package/dist/PDFSidebar-ClnrF4Br.js +239 -0
- package/dist/PDFSidebar-ClnrF4Br.js.map +1 -0
- package/dist/auth.cjs +1 -1
- package/dist/auth.js +1 -1
- package/dist/components/AuthLoginPanel.d.ts.map +1 -1
- package/dist/components/AuthRegisterPanel.d.ts.map +1 -1
- package/dist/components/AuthVisualCarousel.d.ts +2 -0
- package/dist/components/AuthVisualCarousel.d.ts.map +1 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/ImageReader.d.ts.map +1 -1
- package/dist/components/MarkdownReader.d.ts.map +1 -1
- package/dist/components/PDFReader.d.ts.map +1 -1
- package/dist/components/PDFSidebar.d.ts.map +1 -1
- package/dist/components/SimplePDFReader.d.ts.map +1 -1
- package/dist/components/TableHeader.d.ts.map +1 -1
- package/dist/components/TablePagination.d.ts +2 -1
- package/dist/components/TablePagination.d.ts.map +1 -1
- package/dist/components/VideoReader.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/file-upload.cjs +1 -1
- package/dist/file-upload.cjs.map +1 -1
- package/dist/file-upload.js +36 -36
- package/dist/file-upload.js.map +1 -1
- package/dist/image-reader.cjs +1 -1
- package/dist/image-reader.cjs.map +1 -1
- package/dist/image-reader.js +1 -0
- package/dist/image-reader.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/markdown-reader.cjs +1 -1
- package/dist/markdown-reader.cjs.map +1 -1
- package/dist/markdown-reader.js +28 -24
- package/dist/markdown-reader.js.map +1 -1
- package/dist/pdf-reader.cjs +1 -1
- package/dist/pdf-reader.cjs.map +1 -1
- package/dist/pdf-reader.js +169 -120
- package/dist/pdf-reader.js.map +1 -1
- package/dist/pdf-sidebar.cjs +1 -1
- package/dist/pdf-sidebar.js +1 -1
- package/dist/simple-pdf-reader.cjs +1 -1
- package/dist/simple-pdf-reader.cjs.map +1 -1
- package/dist/simple-pdf-reader.js +137 -104
- package/dist/simple-pdf-reader.js.map +1 -1
- package/dist/table-header.cjs +1 -1
- package/dist/table-header.cjs.map +1 -1
- package/dist/table-header.js +42 -34
- package/dist/table-header.js.map +1 -1
- package/dist/table-pagination.cjs +1 -1
- package/dist/table-pagination.cjs.map +1 -1
- package/dist/table-pagination.js +49 -43
- package/dist/table-pagination.js.map +1 -1
- package/dist/types/component-types.d.ts +1 -0
- package/dist/types/component-types.d.ts.map +1 -1
- package/dist/video-reader.cjs.map +1 -1
- package/dist/video-reader.js.map +1 -1
- package/package.json +2 -1
- package/dist/AuthPanel-C_2JBE7t.cjs +0 -2
- package/dist/AuthPanel-C_2JBE7t.cjs.map +0 -1
- package/dist/AuthPanel-D2HFX8eN.js.map +0 -1
- package/dist/PDFSidebar-BBtucLK6.js +0 -232
- package/dist/PDFSidebar-BBtucLK6.js.map +0 -1
- package/dist/PDFSidebar-Di0D-yPS.cjs +0 -2
- package/dist/PDFSidebar-Di0D-yPS.cjs.map +0 -1
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B4hRZ52C.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Layers3 as
|
|
5
|
-
const
|
|
2
|
+
import { c as y } from "./utils-B6yFEsav.js";
|
|
3
|
+
import { useState as l, useMemo as ge, useEffect as re } from "react";
|
|
4
|
+
import { Layers3 as ce, MessageCircle as oe, Loader2 as Q, ArrowRight as te, UserRound as de, LockKeyhole as ae } from "lucide-react";
|
|
5
|
+
const fe = (s) => /^1[3-9]\d{9}$/.test(s) ? void 0 : "请输入正确的手机号", se = (s, i) => s instanceof Error && s.message ? s.message : typeof s == "string" && s ? s : i, be = (s) => s.replace(/\D/g, "").slice(0, 11), je = (s) => s.length <= 3 ? s : s.length <= 7 ? `${s.slice(0, 3)} ${s.slice(3)}` : `${s.slice(0, 3)} ${s.slice(3, 7)} ${s.slice(7)}`;
|
|
6
6
|
function we({
|
|
7
7
|
components: s,
|
|
8
|
-
title:
|
|
8
|
+
title: i = "欢迎登录",
|
|
9
9
|
description: p = "使用账号密码或手机号验证码进入系统",
|
|
10
|
-
brandIcon:
|
|
11
|
-
defaultMethod:
|
|
10
|
+
brandIcon: g,
|
|
11
|
+
defaultMethod: u = "password",
|
|
12
12
|
enabledMethods: m = ["password", "sms"],
|
|
13
13
|
error: A,
|
|
14
14
|
extraActions: k,
|
|
15
|
-
footer:
|
|
16
|
-
socialProviders:
|
|
15
|
+
footer: c,
|
|
16
|
+
socialProviders: f,
|
|
17
17
|
className: j,
|
|
18
18
|
smsCountdownSeconds: w = 60,
|
|
19
|
-
validatePhone: x =
|
|
19
|
+
validatePhone: x = fe,
|
|
20
20
|
validatePassword: h,
|
|
21
|
-
onPasswordLogin:
|
|
22
|
-
onSendSmsCode:
|
|
23
|
-
onSmsLogin:
|
|
21
|
+
onPasswordLogin: v,
|
|
22
|
+
onSendSmsCode: C,
|
|
23
|
+
onSmsLogin: F
|
|
24
24
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
m.includes(
|
|
27
|
-
), [r,
|
|
25
|
+
const [z, t] = l(
|
|
26
|
+
m.includes(u) ? u : m[0]
|
|
27
|
+
), [r, W] = l(""), [X, Y] = l(), [Z, B] = l(), [R, b] = l(), [$, K] = l(!1), [U, V] = l(!1), [H, E] = l(!1), [D, O] = l(0), I = ge(
|
|
28
28
|
() => m.filter(
|
|
29
|
-
(a,
|
|
29
|
+
(a, d, T) => T.indexOf(a) === d
|
|
30
30
|
),
|
|
31
31
|
[m]
|
|
32
|
-
),
|
|
32
|
+
), _ = I.length > 1, S = R || A;
|
|
33
33
|
if (re(() => {
|
|
34
34
|
if (D <= 0) return;
|
|
35
|
-
const a = setTimeout(() =>
|
|
35
|
+
const a = setTimeout(() => O((d) => d - 1), 1e3);
|
|
36
36
|
return () => clearTimeout(a);
|
|
37
37
|
}, [D]), !s)
|
|
38
38
|
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
39
|
-
const { Button:
|
|
39
|
+
const { Button: q, Input: M, Label: L, Tabs: n, TabsList: o, TabsTrigger: N, TabsContent: G } = s, P = async (a) => {
|
|
40
40
|
a.preventDefault();
|
|
41
|
-
const
|
|
42
|
-
username: String(
|
|
43
|
-
password: String(
|
|
44
|
-
},
|
|
45
|
-
if (
|
|
46
|
-
|
|
41
|
+
const d = new FormData(a.currentTarget), T = {
|
|
42
|
+
username: String(d.get("username") || "").trim(),
|
|
43
|
+
password: String(d.get("password") || "")
|
|
44
|
+
}, J = !T.username || !T.password ? "请输入账号和密码" : h == null ? void 0 : h(T);
|
|
45
|
+
if (J) {
|
|
46
|
+
b(J);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
K(!0), b(void 0), await (v == null ? void 0 : v(T));
|
|
51
51
|
} catch (ee) {
|
|
52
|
-
|
|
52
|
+
b(se(ee, "登录失败,请稍后重试"));
|
|
53
53
|
} finally {
|
|
54
|
-
|
|
54
|
+
K(!1);
|
|
55
55
|
}
|
|
56
|
-
},
|
|
56
|
+
}, ue = async () => {
|
|
57
57
|
const a = x(r);
|
|
58
58
|
if (a) {
|
|
59
|
-
|
|
59
|
+
b(a);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
try {
|
|
63
|
-
E(!0),
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
63
|
+
E(!0), b(void 0);
|
|
64
|
+
const d = await (C == null ? void 0 : C(r));
|
|
65
|
+
Y(d == null ? void 0 : d.smsId), B(d == null ? void 0 : d.smsType), O(w);
|
|
66
|
+
} catch (d) {
|
|
67
|
+
b(se(d, "发送验证码失败,请稍后重试"));
|
|
68
68
|
} finally {
|
|
69
69
|
E(!1);
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, me = async (a) => {
|
|
72
72
|
a.preventDefault();
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
|
|
73
|
+
const d = new FormData(a.currentTarget), T = String(d.get("code") || "").trim(), J = x(r);
|
|
74
|
+
if (J) {
|
|
75
|
+
b(J);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
if (!
|
|
79
|
-
|
|
78
|
+
if (!T) {
|
|
79
|
+
b("请输入验证码");
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
try {
|
|
83
|
-
|
|
83
|
+
V(!0), b(void 0), await (F == null ? void 0 : F({ phone: r, code: T, smsId: X, smsType: Z }));
|
|
84
84
|
} catch (ee) {
|
|
85
|
-
|
|
85
|
+
b(se(ee, "验证码错误或已过期"));
|
|
86
86
|
} finally {
|
|
87
|
-
|
|
87
|
+
V(!1);
|
|
88
88
|
}
|
|
89
89
|
}, he = () => /* @__PURE__ */ e.jsxs("div", { className: "mb-7", children: [
|
|
90
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-4 flex h-11 w-11 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm", children:
|
|
91
|
-
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-semibold", children:
|
|
92
|
-
p && /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: p })
|
|
93
|
-
] }), xe = () =>
|
|
94
|
-
|
|
90
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-4 flex h-11 w-11 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm ring-1 ring-primary/10", children: g || /* @__PURE__ */ e.jsx(ce, { className: "h-5 w-5" }) }),
|
|
91
|
+
/* @__PURE__ */ e.jsx("h1", { className: "text-balance text-2xl font-semibold leading-tight", children: i }),
|
|
92
|
+
p && /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-pretty text-sm leading-6 text-muted-foreground", children: p })
|
|
93
|
+
] }), xe = () => f != null && f.length ? /* @__PURE__ */ e.jsx("div", { className: "mb-6 grid gap-2", children: f.map((a) => /* @__PURE__ */ e.jsxs(
|
|
94
|
+
q,
|
|
95
95
|
{
|
|
96
96
|
type: "button",
|
|
97
97
|
variant: "outline",
|
|
@@ -104,30 +104,31 @@ function we({
|
|
|
104
104
|
]
|
|
105
105
|
},
|
|
106
106
|
a.id
|
|
107
|
-
)) }) : null,
|
|
107
|
+
)) }) : null, ne = () => /* @__PURE__ */ e.jsx("form", { className: "flex flex-col", onSubmit: P, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
108
108
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
109
|
-
/* @__PURE__ */ e.jsx(
|
|
109
|
+
/* @__PURE__ */ e.jsx(L, { htmlFor: "auth-username", children: "用户名" }),
|
|
110
110
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
111
111
|
/* @__PURE__ */ e.jsx(de, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
112
112
|
/* @__PURE__ */ e.jsx(
|
|
113
|
-
|
|
113
|
+
M,
|
|
114
114
|
{
|
|
115
115
|
id: "auth-username",
|
|
116
116
|
name: "username",
|
|
117
117
|
className: "bg-background/80 pl-9 backdrop-blur",
|
|
118
118
|
placeholder: "请输入用户名",
|
|
119
119
|
autoComplete: "username",
|
|
120
|
+
spellCheck: !1,
|
|
120
121
|
required: !0
|
|
121
122
|
}
|
|
122
123
|
)
|
|
123
124
|
] })
|
|
124
125
|
] }),
|
|
125
126
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
+
/* @__PURE__ */ e.jsx(L, { htmlFor: "auth-password", children: "密码" }),
|
|
127
128
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
128
129
|
/* @__PURE__ */ e.jsx(ae, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
129
130
|
/* @__PURE__ */ e.jsx(
|
|
130
|
-
|
|
131
|
+
M,
|
|
131
132
|
{
|
|
132
133
|
id: "auth-password",
|
|
133
134
|
name: "password",
|
|
@@ -141,13 +142,13 @@ function we({
|
|
|
141
142
|
] })
|
|
142
143
|
] }),
|
|
143
144
|
/* @__PURE__ */ e.jsx(
|
|
144
|
-
|
|
145
|
+
q,
|
|
145
146
|
{
|
|
146
147
|
type: "submit",
|
|
147
148
|
className: "mt-4 h-11 w-full",
|
|
148
|
-
disabled:
|
|
149
|
-
children:
|
|
150
|
-
/* @__PURE__ */ e.jsx(
|
|
149
|
+
disabled: $,
|
|
150
|
+
children: $ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
151
|
+
/* @__PURE__ */ e.jsx(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
151
152
|
"登录中..."
|
|
152
153
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
153
154
|
"登录",
|
|
@@ -155,44 +156,46 @@ function we({
|
|
|
155
156
|
] })
|
|
156
157
|
}
|
|
157
158
|
)
|
|
158
|
-
] }) }),
|
|
159
|
+
] }) }), le = () => /* @__PURE__ */ e.jsx("form", { className: "flex flex-col", onSubmit: me, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
159
160
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
160
|
-
/* @__PURE__ */ e.jsx(
|
|
161
|
+
/* @__PURE__ */ e.jsx(L, { htmlFor: "auth-phone", children: "手机号" }),
|
|
161
162
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
162
163
|
/* @__PURE__ */ e.jsxs("div", { className: "relative w-full", children: [
|
|
163
164
|
/* @__PURE__ */ e.jsx(oe, { className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
164
165
|
/* @__PURE__ */ e.jsx(
|
|
165
|
-
|
|
166
|
+
M,
|
|
166
167
|
{
|
|
167
168
|
id: "auth-phone",
|
|
168
169
|
name: "phone",
|
|
169
170
|
className: "bg-background/80 pl-9 backdrop-blur",
|
|
170
171
|
placeholder: "请输入手机号",
|
|
171
172
|
value: je(r),
|
|
172
|
-
onChange: (a) =>
|
|
173
|
+
onChange: (a) => W(be(a.target.value)),
|
|
173
174
|
required: !0,
|
|
174
175
|
maxLength: 13,
|
|
175
|
-
inputMode: "numeric"
|
|
176
|
+
inputMode: "numeric",
|
|
177
|
+
autoComplete: "tel",
|
|
178
|
+
spellCheck: !1
|
|
176
179
|
}
|
|
177
180
|
)
|
|
178
181
|
] }),
|
|
179
182
|
/* @__PURE__ */ e.jsx(
|
|
180
|
-
|
|
183
|
+
q,
|
|
181
184
|
{
|
|
182
185
|
type: "button",
|
|
183
186
|
variant: "outline",
|
|
184
187
|
className: "h-10 w-28 shrink-0 bg-background/70 backdrop-blur hover:bg-background/90",
|
|
185
|
-
onClick:
|
|
186
|
-
disabled: !r ||
|
|
187
|
-
children:
|
|
188
|
+
onClick: ue,
|
|
189
|
+
disabled: !r || H || D > 0,
|
|
190
|
+
children: H ? /* @__PURE__ */ e.jsx(Q, { className: "h-4 w-4 animate-spin" }) : D > 0 ? `${D}秒` : "发送验证码"
|
|
188
191
|
}
|
|
189
192
|
)
|
|
190
193
|
] })
|
|
191
194
|
] }),
|
|
192
195
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
193
|
-
/* @__PURE__ */ e.jsx(
|
|
196
|
+
/* @__PURE__ */ e.jsx(L, { htmlFor: "auth-code", children: "验证码" }),
|
|
194
197
|
/* @__PURE__ */ e.jsx(
|
|
195
|
-
|
|
198
|
+
M,
|
|
196
199
|
{
|
|
197
200
|
id: "auth-code",
|
|
198
201
|
name: "code",
|
|
@@ -204,34 +207,42 @@ function we({
|
|
|
204
207
|
}
|
|
205
208
|
)
|
|
206
209
|
] }),
|
|
207
|
-
/* @__PURE__ */ e.jsx(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
/* @__PURE__ */ e.jsx(
|
|
211
|
+
q,
|
|
212
|
+
{
|
|
213
|
+
type: "submit",
|
|
214
|
+
className: "mt-4 h-11 w-full",
|
|
215
|
+
disabled: U,
|
|
216
|
+
children: U ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ e.jsx(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
218
|
+
"验证中..."
|
|
219
|
+
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
220
|
+
"验证并登录",
|
|
221
|
+
/* @__PURE__ */ e.jsx(te, { className: "ml-2 h-4 w-4" })
|
|
222
|
+
] })
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] }) }), pe = () => _ ? /* @__PURE__ */ e.jsxs(
|
|
226
|
+
n,
|
|
216
227
|
{
|
|
217
|
-
value:
|
|
228
|
+
value: z,
|
|
218
229
|
onValueChange: (a) => t(a),
|
|
219
230
|
className: "w-full",
|
|
220
231
|
children: [
|
|
221
|
-
/* @__PURE__ */ e.jsxs(
|
|
222
|
-
I.includes("password") && /* @__PURE__ */ e.jsx(
|
|
223
|
-
I.includes("sms") && /* @__PURE__ */ e.jsx(
|
|
232
|
+
/* @__PURE__ */ e.jsxs(o, { className: "mb-6 grid h-11 w-full grid-cols-2 bg-background/60 backdrop-blur", children: [
|
|
233
|
+
I.includes("password") && /* @__PURE__ */ e.jsx(N, { value: "password", children: "账号密码登录" }),
|
|
234
|
+
I.includes("sms") && /* @__PURE__ */ e.jsx(N, { value: "sms", children: "手机号登录" })
|
|
224
235
|
] }),
|
|
225
|
-
/* @__PURE__ */ e.jsx(
|
|
226
|
-
/* @__PURE__ */ e.jsx(
|
|
236
|
+
/* @__PURE__ */ e.jsx(G, { value: "password", children: ne() }),
|
|
237
|
+
/* @__PURE__ */ e.jsx(G, { value: "sms", children: le() })
|
|
227
238
|
]
|
|
228
239
|
}
|
|
229
|
-
) : I[0] === "sms" ?
|
|
240
|
+
) : I[0] === "sms" ? le() : ne();
|
|
230
241
|
return /* @__PURE__ */ e.jsxs(
|
|
231
242
|
"div",
|
|
232
243
|
{
|
|
233
|
-
className:
|
|
234
|
-
"w-full max-w-[calc(100vw-2rem)] rounded-lg border border-white/45 bg-background/
|
|
244
|
+
className: y(
|
|
245
|
+
"w-full max-w-[calc(100vw-2rem)] rounded-lg border border-white/45 bg-background/70 p-5 shadow-2xl shadow-slate-950/25 backdrop-blur-md supports-[backdrop-filter]:bg-background/55 md:p-8",
|
|
235
246
|
j
|
|
236
247
|
),
|
|
237
248
|
children: [
|
|
@@ -239,120 +250,128 @@ function we({
|
|
|
239
250
|
xe(),
|
|
240
251
|
pe(),
|
|
241
252
|
k && /* @__PURE__ */ e.jsx("div", { className: "mt-5", children: k }),
|
|
242
|
-
S && /* @__PURE__ */ e.jsx(
|
|
243
|
-
|
|
253
|
+
S && /* @__PURE__ */ e.jsx(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
className: "mt-4 border-l-2 border-destructive bg-destructive/5 px-4 py-3 text-sm text-destructive",
|
|
257
|
+
"aria-live": "polite",
|
|
258
|
+
children: S
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
c && /* @__PURE__ */ e.jsx("div", { className: "mt-6 text-sm text-muted-foreground", children: c })
|
|
244
262
|
]
|
|
245
263
|
}
|
|
246
264
|
);
|
|
247
265
|
}
|
|
248
|
-
const
|
|
266
|
+
const ve = (s) => /^1[3-9]\d{9}$/.test(s) ? void 0 : "请输入正确的手机号", ie = (s, i) => s instanceof Error && s.message ? s.message : typeof s == "string" && s ? s : i, Ne = (s) => s.replace(/\D/g, "").slice(0, 11), ye = (s) => s.length <= 3 ? s : s.length <= 7 ? `${s.slice(0, 3)} ${s.slice(3)}` : `${s.slice(0, 3)} ${s.slice(3, 7)} ${s.slice(7)}`;
|
|
249
267
|
function ke({
|
|
250
268
|
components: s,
|
|
251
|
-
title:
|
|
269
|
+
title: i = "创建账号",
|
|
252
270
|
description: p = "填写账号信息并完成手机号验证",
|
|
253
|
-
brandIcon:
|
|
254
|
-
requirePhoneVerification:
|
|
271
|
+
brandIcon: g,
|
|
272
|
+
requirePhoneVerification: u = !0,
|
|
255
273
|
requireTermsAccepted: m = !1,
|
|
256
274
|
termsLabel: A = "我已阅读并同意服务条款",
|
|
257
275
|
error: k,
|
|
258
|
-
extraActions:
|
|
259
|
-
footer:
|
|
276
|
+
extraActions: c,
|
|
277
|
+
footer: f,
|
|
260
278
|
socialProviders: j,
|
|
261
279
|
className: w,
|
|
262
280
|
smsCountdownSeconds: x = 60,
|
|
263
|
-
validatePhone: h =
|
|
264
|
-
validatePassword:
|
|
265
|
-
validateRegister:
|
|
266
|
-
onSendSmsCode:
|
|
267
|
-
onRegister:
|
|
281
|
+
validatePhone: h = ve,
|
|
282
|
+
validatePassword: v,
|
|
283
|
+
validateRegister: C,
|
|
284
|
+
onSendSmsCode: F,
|
|
285
|
+
onRegister: z
|
|
268
286
|
}) {
|
|
269
|
-
const [t, r] =
|
|
287
|
+
const [t, r] = l(""), [W, X] = l(), [Y, Z] = l(), [B, R] = l(!1), [b, $] = l(), [K, U] = l(!1), [V, H] = l(!1), [E, D] = l(0), O = b || k;
|
|
270
288
|
if (re(() => {
|
|
271
289
|
if (E <= 0) return;
|
|
272
|
-
const
|
|
273
|
-
return () => clearTimeout(
|
|
290
|
+
const n = setTimeout(() => D((o) => o - 1), 1e3);
|
|
291
|
+
return () => clearTimeout(n);
|
|
274
292
|
}, [E]), !s)
|
|
275
293
|
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
276
|
-
const { Button: I, Input:
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
|
|
294
|
+
const { Button: I, Input: _, Label: S } = s, q = async () => {
|
|
295
|
+
const n = h(t);
|
|
296
|
+
if (n) {
|
|
297
|
+
$(n);
|
|
280
298
|
return;
|
|
281
299
|
}
|
|
282
300
|
try {
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
} catch (
|
|
287
|
-
|
|
301
|
+
H(!0), $(void 0);
|
|
302
|
+
const o = await (F == null ? void 0 : F(t));
|
|
303
|
+
X(o == null ? void 0 : o.smsId), Z(o == null ? void 0 : o.smsType), D(x);
|
|
304
|
+
} catch (o) {
|
|
305
|
+
$(ie(o, "发送验证码失败,请稍后重试"));
|
|
288
306
|
} finally {
|
|
289
|
-
|
|
307
|
+
H(!1);
|
|
290
308
|
}
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
username: String(
|
|
295
|
-
password: String(
|
|
296
|
-
confirmPassword: String(
|
|
309
|
+
}, M = async (n) => {
|
|
310
|
+
n.preventDefault();
|
|
311
|
+
const o = new FormData(n.currentTarget), N = {
|
|
312
|
+
username: String(o.get("username") || "").trim(),
|
|
313
|
+
password: String(o.get("password") || ""),
|
|
314
|
+
confirmPassword: String(o.get("confirmPassword") || ""),
|
|
297
315
|
phone: t,
|
|
298
|
-
code: String(
|
|
299
|
-
smsId:
|
|
300
|
-
smsType:
|
|
301
|
-
termsAccepted:
|
|
302
|
-
},
|
|
303
|
-
if (
|
|
304
|
-
|
|
316
|
+
code: String(o.get("code") || "").trim(),
|
|
317
|
+
smsId: W,
|
|
318
|
+
smsType: Y,
|
|
319
|
+
termsAccepted: B
|
|
320
|
+
}, G = !N.username && "请输入用户名" || !N.password && "请输入密码" || N.password !== N.confirmPassword && "两次输入的密码不一致" || u && h(t) || u && !N.code && "请输入验证码" || m && !B && "请先同意服务条款" || (v == null ? void 0 : v(N)) || (C == null ? void 0 : C(N));
|
|
321
|
+
if (G) {
|
|
322
|
+
$(G);
|
|
305
323
|
return;
|
|
306
324
|
}
|
|
307
325
|
try {
|
|
308
|
-
|
|
326
|
+
U(!0), $(void 0), await (z == null ? void 0 : z(N));
|
|
309
327
|
} catch (P) {
|
|
310
|
-
|
|
328
|
+
$(ie(P, "注册失败,请稍后重试"));
|
|
311
329
|
} finally {
|
|
312
|
-
|
|
330
|
+
U(!1);
|
|
313
331
|
}
|
|
314
|
-
},
|
|
332
|
+
}, L = () => j != null && j.length ? /* @__PURE__ */ e.jsx("div", { className: "mb-6 grid gap-2", children: j.map((n) => /* @__PURE__ */ e.jsxs(
|
|
315
333
|
I,
|
|
316
334
|
{
|
|
317
335
|
type: "button",
|
|
318
336
|
variant: "outline",
|
|
319
337
|
className: "h-10 w-full",
|
|
320
|
-
disabled:
|
|
321
|
-
onClick:
|
|
338
|
+
disabled: n.disabled,
|
|
339
|
+
onClick: n.onClick,
|
|
322
340
|
children: [
|
|
323
|
-
|
|
324
|
-
|
|
341
|
+
n.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex h-4 w-4 items-center justify-center", children: n.icon }),
|
|
342
|
+
n.label
|
|
325
343
|
]
|
|
326
344
|
},
|
|
327
|
-
|
|
345
|
+
n.id
|
|
328
346
|
)) }) : null;
|
|
329
347
|
return /* @__PURE__ */ e.jsxs(
|
|
330
348
|
"div",
|
|
331
349
|
{
|
|
332
|
-
className:
|
|
333
|
-
"w-full max-w-[calc(100vw-2rem)] rounded-lg border border-white/45 bg-background/
|
|
350
|
+
className: y(
|
|
351
|
+
"w-full max-w-[calc(100vw-2rem)] rounded-lg border border-white/45 bg-background/70 p-5 shadow-2xl shadow-slate-950/25 backdrop-blur-md supports-[backdrop-filter]:bg-background/55 md:p-8",
|
|
334
352
|
w
|
|
335
353
|
),
|
|
336
354
|
children: [
|
|
337
355
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-7", children: [
|
|
338
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-4 flex h-11 w-11 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm", children:
|
|
339
|
-
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-semibold", children:
|
|
340
|
-
p && /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: p })
|
|
356
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-4 flex h-11 w-11 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm ring-1 ring-primary/10", children: g || /* @__PURE__ */ e.jsx(ce, { className: "h-5 w-5" }) }),
|
|
357
|
+
/* @__PURE__ */ e.jsx("h1", { className: "text-balance text-2xl font-semibold leading-tight", children: i }),
|
|
358
|
+
p && /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-pretty text-sm leading-6 text-muted-foreground", children: p })
|
|
341
359
|
] }),
|
|
342
|
-
|
|
343
|
-
/* @__PURE__ */ e.jsx("form", { className: "flex flex-col", onSubmit:
|
|
360
|
+
L(),
|
|
361
|
+
/* @__PURE__ */ e.jsx("form", { className: "flex flex-col", onSubmit: M, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
344
362
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
345
363
|
/* @__PURE__ */ e.jsx(S, { htmlFor: "auth-register-username", children: "用户名" }),
|
|
346
364
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
347
365
|
/* @__PURE__ */ e.jsx(de, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
348
366
|
/* @__PURE__ */ e.jsx(
|
|
349
|
-
|
|
367
|
+
_,
|
|
350
368
|
{
|
|
351
369
|
id: "auth-register-username",
|
|
352
370
|
name: "username",
|
|
353
371
|
className: "bg-background/80 pl-9 backdrop-blur",
|
|
354
372
|
placeholder: "请输入用户名",
|
|
355
373
|
autoComplete: "username",
|
|
374
|
+
spellCheck: !1,
|
|
356
375
|
required: !0
|
|
357
376
|
}
|
|
358
377
|
)
|
|
@@ -363,7 +382,7 @@ function ke({
|
|
|
363
382
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
364
383
|
/* @__PURE__ */ e.jsx(ae, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
365
384
|
/* @__PURE__ */ e.jsx(
|
|
366
|
-
|
|
385
|
+
_,
|
|
367
386
|
{
|
|
368
387
|
id: "auth-register-password",
|
|
369
388
|
name: "password",
|
|
@@ -381,7 +400,7 @@ function ke({
|
|
|
381
400
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
382
401
|
/* @__PURE__ */ e.jsx(ae, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
383
402
|
/* @__PURE__ */ e.jsx(
|
|
384
|
-
|
|
403
|
+
_,
|
|
385
404
|
{
|
|
386
405
|
id: "auth-register-confirm-password",
|
|
387
406
|
name: "confirmPassword",
|
|
@@ -394,24 +413,26 @@ function ke({
|
|
|
394
413
|
)
|
|
395
414
|
] })
|
|
396
415
|
] }),
|
|
397
|
-
|
|
416
|
+
u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
398
417
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
399
418
|
/* @__PURE__ */ e.jsx(S, { htmlFor: "auth-register-phone", children: "手机号" }),
|
|
400
419
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
401
420
|
/* @__PURE__ */ e.jsxs("div", { className: "relative w-full", children: [
|
|
402
421
|
/* @__PURE__ */ e.jsx(oe, { className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
403
422
|
/* @__PURE__ */ e.jsx(
|
|
404
|
-
|
|
423
|
+
_,
|
|
405
424
|
{
|
|
406
425
|
id: "auth-register-phone",
|
|
407
426
|
name: "phone",
|
|
408
427
|
className: "bg-background/80 pl-9 backdrop-blur",
|
|
409
428
|
placeholder: "请输入手机号",
|
|
410
|
-
value:
|
|
411
|
-
onChange: (
|
|
429
|
+
value: ye(t),
|
|
430
|
+
onChange: (n) => r(Ne(n.target.value)),
|
|
412
431
|
required: !0,
|
|
413
432
|
maxLength: 13,
|
|
414
|
-
inputMode: "numeric"
|
|
433
|
+
inputMode: "numeric",
|
|
434
|
+
autoComplete: "tel",
|
|
435
|
+
spellCheck: !1
|
|
415
436
|
}
|
|
416
437
|
)
|
|
417
438
|
] }),
|
|
@@ -421,9 +442,9 @@ function ke({
|
|
|
421
442
|
type: "button",
|
|
422
443
|
variant: "outline",
|
|
423
444
|
className: "h-10 w-28 shrink-0 bg-background/70 backdrop-blur hover:bg-background/90",
|
|
424
|
-
onClick:
|
|
425
|
-
disabled: !t ||
|
|
426
|
-
children:
|
|
445
|
+
onClick: q,
|
|
446
|
+
disabled: !t || V || E > 0,
|
|
447
|
+
children: V ? /* @__PURE__ */ e.jsx(Q, { className: "h-4 w-4 animate-spin" }) : E > 0 ? `${E}秒` : "发送验证码"
|
|
427
448
|
}
|
|
428
449
|
)
|
|
429
450
|
] })
|
|
@@ -431,7 +452,7 @@ function ke({
|
|
|
431
452
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
432
453
|
/* @__PURE__ */ e.jsx(S, { htmlFor: "auth-register-code", children: "验证码" }),
|
|
433
454
|
/* @__PURE__ */ e.jsx(
|
|
434
|
-
|
|
455
|
+
_,
|
|
435
456
|
{
|
|
436
457
|
id: "auth-register-code",
|
|
437
458
|
name: "code",
|
|
@@ -449,9 +470,9 @@ function ke({
|
|
|
449
470
|
"input",
|
|
450
471
|
{
|
|
451
472
|
type: "checkbox",
|
|
452
|
-
className: "mt-0.5 h-4 w-4 rounded border-input",
|
|
453
|
-
checked:
|
|
454
|
-
onChange: (
|
|
473
|
+
className: "mt-0.5 h-4 w-4 rounded border-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
474
|
+
checked: B,
|
|
475
|
+
onChange: (n) => R(n.target.checked)
|
|
455
476
|
}
|
|
456
477
|
),
|
|
457
478
|
/* @__PURE__ */ e.jsx("span", { children: A })
|
|
@@ -461,9 +482,9 @@ function ke({
|
|
|
461
482
|
{
|
|
462
483
|
type: "submit",
|
|
463
484
|
className: "mt-4 h-11 w-full",
|
|
464
|
-
disabled:
|
|
465
|
-
children:
|
|
466
|
-
/* @__PURE__ */ e.jsx(
|
|
485
|
+
disabled: K,
|
|
486
|
+
children: K ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
487
|
+
/* @__PURE__ */ e.jsx(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
467
488
|
"注册中..."
|
|
468
489
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
469
490
|
"创建账号",
|
|
@@ -472,70 +493,77 @@ function ke({
|
|
|
472
493
|
}
|
|
473
494
|
)
|
|
474
495
|
] }) }),
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
496
|
+
c && /* @__PURE__ */ e.jsx("div", { className: "mt-5", children: c }),
|
|
497
|
+
O && /* @__PURE__ */ e.jsx(
|
|
498
|
+
"div",
|
|
499
|
+
{
|
|
500
|
+
className: "mt-4 border-l-2 border-destructive bg-destructive/5 px-4 py-3 text-sm text-destructive",
|
|
501
|
+
"aria-live": "polite",
|
|
502
|
+
children: O
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
f && /* @__PURE__ */ e.jsx("div", { className: "mt-6 text-sm text-muted-foreground", children: f })
|
|
478
506
|
]
|
|
479
507
|
}
|
|
480
508
|
);
|
|
481
509
|
}
|
|
482
510
|
function Ee({
|
|
483
511
|
children: s,
|
|
484
|
-
visual:
|
|
512
|
+
visual: i,
|
|
485
513
|
overlay: p,
|
|
486
|
-
className:
|
|
487
|
-
contentClassName:
|
|
514
|
+
className: g,
|
|
515
|
+
contentClassName: u,
|
|
488
516
|
panelClassName: m
|
|
489
517
|
}) {
|
|
490
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
491
|
-
|
|
518
|
+
return /* @__PURE__ */ e.jsx("div", { className: y("min-h-screen", g), children: /* @__PURE__ */ e.jsxs("main", { className: "relative flex min-h-screen w-full overflow-hidden", children: [
|
|
519
|
+
i && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0", children: i }),
|
|
492
520
|
p ?? /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 z-10 bg-black/35" }),
|
|
493
521
|
/* @__PURE__ */ e.jsx(
|
|
494
522
|
"div",
|
|
495
523
|
{
|
|
496
|
-
className:
|
|
524
|
+
className: y(
|
|
497
525
|
"relative z-20 flex min-h-screen w-full items-center justify-center px-4 py-6 sm:px-6 lg:p-12 xl:p-16",
|
|
498
|
-
|
|
526
|
+
u
|
|
499
527
|
),
|
|
500
|
-
children: /* @__PURE__ */ e.jsx("div", { className:
|
|
528
|
+
children: /* @__PURE__ */ e.jsx("div", { className: y("w-full min-w-0 max-w-[420px]", m), children: s })
|
|
501
529
|
}
|
|
502
530
|
)
|
|
503
531
|
] }) });
|
|
504
532
|
}
|
|
505
533
|
function De({
|
|
506
534
|
items: s,
|
|
507
|
-
intervalMs:
|
|
535
|
+
intervalMs: i = 5e3,
|
|
508
536
|
showIndicators: p = !0,
|
|
509
|
-
showText:
|
|
510
|
-
className:
|
|
537
|
+
showText: g = !0,
|
|
538
|
+
className: u,
|
|
511
539
|
imageClassName: m,
|
|
512
540
|
contentClassName: A,
|
|
513
541
|
ariaLabel: k = "认证页视觉轮播"
|
|
514
542
|
}) {
|
|
515
|
-
const [
|
|
516
|
-
x &&
|
|
517
|
-
},
|
|
543
|
+
const [c, f] = l(0), [j, w] = l(!1), x = s.length > 0, h = x ? s[c] : void 0, v = (t) => {
|
|
544
|
+
x && f((t + s.length) % s.length);
|
|
545
|
+
}, C = () => v(c + 1), F = () => v(c - 1);
|
|
518
546
|
re(() => {
|
|
519
|
-
if (!x || j ||
|
|
547
|
+
if (!x || j || i <= 0 || s.length < 2) return;
|
|
520
548
|
const t = setTimeout(() => {
|
|
521
|
-
|
|
522
|
-
},
|
|
549
|
+
f((r) => (r + 1) % s.length);
|
|
550
|
+
}, i);
|
|
523
551
|
return () => clearTimeout(t);
|
|
524
|
-
}, [x,
|
|
525
|
-
const
|
|
526
|
-
t.key === "ArrowLeft" && (t.preventDefault(),
|
|
552
|
+
}, [x, i, j, s.length, c]);
|
|
553
|
+
const z = (t) => {
|
|
554
|
+
t.key === "ArrowLeft" && (t.preventDefault(), F()), t.key === "ArrowRight" && (t.preventDefault(), C());
|
|
527
555
|
};
|
|
528
556
|
return x ? /* @__PURE__ */ e.jsxs(
|
|
529
557
|
"div",
|
|
530
558
|
{
|
|
531
|
-
className:
|
|
532
|
-
"relative h-full min-h-[360px] w-full overflow-hidden bg-slate-950 outline-none",
|
|
533
|
-
|
|
559
|
+
className: y(
|
|
560
|
+
"relative h-full min-h-[360px] w-full overflow-hidden bg-slate-950 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-slate-950",
|
|
561
|
+
u
|
|
534
562
|
),
|
|
535
563
|
tabIndex: 0,
|
|
536
564
|
"aria-label": k,
|
|
537
565
|
role: "region",
|
|
538
|
-
onKeyDown:
|
|
566
|
+
onKeyDown: z,
|
|
539
567
|
onMouseEnter: () => w(!0),
|
|
540
568
|
onMouseLeave: () => w(!1),
|
|
541
569
|
onFocus: () => w(!0),
|
|
@@ -546,41 +574,60 @@ function De({
|
|
|
546
574
|
{
|
|
547
575
|
src: t.image,
|
|
548
576
|
alt: t.alt,
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
577
|
+
width: t.width ?? 1600,
|
|
578
|
+
height: t.height ?? 900,
|
|
579
|
+
fetchPriority: r === c ? "high" : "auto",
|
|
580
|
+
loading: r === 0 ? "eager" : "lazy",
|
|
581
|
+
decoding: "async",
|
|
582
|
+
className: y(
|
|
583
|
+
"absolute inset-0 h-full w-full object-cover transition-opacity duration-700 ease-out motion-reduce:transition-none",
|
|
584
|
+
r === c ? "opacity-100" : "opacity-0",
|
|
552
585
|
m
|
|
553
586
|
),
|
|
554
|
-
"aria-hidden": r !==
|
|
587
|
+
"aria-hidden": r !== c
|
|
555
588
|
},
|
|
556
589
|
`${t.image}-${r}`
|
|
557
590
|
)),
|
|
558
591
|
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-slate-950/80 via-slate-950/30 to-slate-950/10" }),
|
|
559
|
-
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-x-0 bottom-0 bg-gradient-to-t from-slate-950/
|
|
560
|
-
|
|
592
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-x-0 bottom-0 bg-gradient-to-t from-slate-950/80 via-slate-950/30 to-transparent pb-16 pt-24" }),
|
|
593
|
+
/* @__PURE__ */ e.jsx(
|
|
594
|
+
"div",
|
|
595
|
+
{
|
|
596
|
+
className: "pointer-events-none absolute inset-0 opacity-[0.18] [background-image:linear-gradient(to_right,rgba(255,255,255,0.32)_1px,transparent_1px),linear-gradient(to_bottom,rgba(255,255,255,0.26)_1px,transparent_1px)] [background-size:44px_44px]",
|
|
597
|
+
"aria-hidden": "true"
|
|
598
|
+
}
|
|
599
|
+
),
|
|
600
|
+
/* @__PURE__ */ e.jsx(
|
|
601
|
+
"div",
|
|
602
|
+
{
|
|
603
|
+
className: "pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/60 to-transparent",
|
|
604
|
+
"aria-hidden": "true"
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
(g || p) && /* @__PURE__ */ e.jsxs(
|
|
561
608
|
"div",
|
|
562
609
|
{
|
|
563
|
-
className:
|
|
610
|
+
className: y(
|
|
564
611
|
"absolute inset-x-5 bottom-6 text-white sm:inset-x-8 sm:bottom-8 lg:inset-x-12 lg:bottom-10",
|
|
565
612
|
A
|
|
566
613
|
),
|
|
567
614
|
children: [
|
|
568
|
-
|
|
615
|
+
g && h && /* @__PURE__ */ e.jsxs("div", { className: "max-w-[min(28rem,calc(100vw-2.5rem))]", children: [
|
|
569
616
|
h.eyebrow && /* @__PURE__ */ e.jsx("p", { className: "mb-2 text-[0.68rem] font-medium uppercase tracking-normal text-cyan-100/80 sm:text-xs", children: h.eyebrow }),
|
|
570
|
-
h.title && /* @__PURE__ */ e.jsx("h2", { className: "text-xl font-semibold leading-tight sm:text-2xl lg:text-3xl", children: h.title }),
|
|
617
|
+
h.title && /* @__PURE__ */ e.jsx("h2", { className: "text-balance text-xl font-semibold leading-tight sm:text-2xl lg:text-3xl", children: h.title }),
|
|
571
618
|
h.description && /* @__PURE__ */ e.jsx("p", { className: "mt-2 line-clamp-3 text-sm leading-6 text-slate-100/80 sm:text-base", children: h.description })
|
|
572
619
|
] }),
|
|
573
620
|
p && s.length > 1 && /* @__PURE__ */ e.jsx("div", { className: "mt-5 flex items-center gap-2", children: s.map((t, r) => /* @__PURE__ */ e.jsx(
|
|
574
621
|
"button",
|
|
575
622
|
{
|
|
576
623
|
type: "button",
|
|
577
|
-
className:
|
|
578
|
-
"h-1.5 rounded-full transition-
|
|
579
|
-
r ===
|
|
624
|
+
className: y(
|
|
625
|
+
"h-1.5 rounded-full transition-[background-color,width] duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-slate-950 motion-reduce:transition-none",
|
|
626
|
+
r === c ? "w-8 bg-white" : "w-3 bg-white/40 hover:bg-white/70"
|
|
580
627
|
),
|
|
581
628
|
"aria-label": `切换到第 ${r + 1} 张轮播图`,
|
|
582
|
-
"aria-current": r ===
|
|
583
|
-
onClick: () =>
|
|
629
|
+
"aria-current": r === c,
|
|
630
|
+
onClick: () => v(r)
|
|
584
631
|
},
|
|
585
632
|
`${t.image}-indicator-${r}`
|
|
586
633
|
)) })
|
|
@@ -592,9 +639,9 @@ function De({
|
|
|
592
639
|
) : /* @__PURE__ */ e.jsx(
|
|
593
640
|
"div",
|
|
594
641
|
{
|
|
595
|
-
className:
|
|
642
|
+
className: y(
|
|
596
643
|
"relative h-full min-h-[360px] w-full overflow-hidden bg-slate-950",
|
|
597
|
-
|
|
644
|
+
u
|
|
598
645
|
),
|
|
599
646
|
"aria-label": k,
|
|
600
647
|
role: "region"
|
|
@@ -603,16 +650,16 @@ function De({
|
|
|
603
650
|
}
|
|
604
651
|
function Ie({
|
|
605
652
|
components: s,
|
|
606
|
-
mode:
|
|
653
|
+
mode: i,
|
|
607
654
|
defaultMode: p = "login",
|
|
608
|
-
onModeChange:
|
|
609
|
-
loginProps:
|
|
655
|
+
onModeChange: g,
|
|
656
|
+
loginProps: u,
|
|
610
657
|
registerProps: m,
|
|
611
658
|
loginLabel: A = "已有账号?登录",
|
|
612
659
|
registerLabel: k = "没有账号?注册"
|
|
613
660
|
}) {
|
|
614
|
-
const [
|
|
615
|
-
|
|
661
|
+
const [c, f] = l(p), j = i ?? c, w = (x) => {
|
|
662
|
+
i || f(x), g == null || g(x);
|
|
616
663
|
};
|
|
617
664
|
return j === "register" ? /* @__PURE__ */ e.jsx(
|
|
618
665
|
ke,
|
|
@@ -632,9 +679,9 @@ function Ie({
|
|
|
632
679
|
) : /* @__PURE__ */ e.jsx(
|
|
633
680
|
we,
|
|
634
681
|
{
|
|
635
|
-
...
|
|
682
|
+
...u,
|
|
636
683
|
components: s,
|
|
637
|
-
footer: (
|
|
684
|
+
footer: (u == null ? void 0 : u.footer) ?? /* @__PURE__ */ e.jsx(
|
|
638
685
|
"button",
|
|
639
686
|
{
|
|
640
687
|
type: "button",
|
|
@@ -653,4 +700,4 @@ export {
|
|
|
653
700
|
ke as c,
|
|
654
701
|
De as d
|
|
655
702
|
};
|
|
656
|
-
//# sourceMappingURL=AuthPanel-
|
|
703
|
+
//# sourceMappingURL=AuthPanel-Cn_WwmjX.js.map
|