@alfadocs/ui-kit 1.70.0 → 1.71.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/_chunks/auth-form-parts-DHv6LVV2.js +98 -0
- package/dist/_chunks/{forgot-password-form-Dqi7R-NL.js → forgot-password-form-BGPc8TGr.js} +2 -2
- package/dist/_chunks/login-dev-card-CWpoTuVY.js +332 -0
- package/dist/agent-catalog.json +9 -1
- package/dist/agent-i18n/en.json +1 -0
- package/dist/index.js +2 -2
- package/dist/patterns/_shared/auth-form-parts.d.ts +4 -3
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/login-form/login-form.d.ts +6 -2
- package/package.json +1 -1
- package/dist/_chunks/auth-form-parts-B40zvD-a.js +0 -86
- package/dist/_chunks/login-dev-card-vEL-o5wq.js +0 -309
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as f, forwardRef as h } from "react";
|
|
3
|
+
import { c as l } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as g } from "react-i18next";
|
|
5
|
+
import { A as c } from "./alert-9kEwDza3.js";
|
|
6
|
+
import { i as u } from "./is-development-CLUAnsU7.js";
|
|
7
|
+
import { a as p } from "./safe-href-5dbsfbQn.js";
|
|
8
|
+
import { B as b } from "./use-registration-submit-eWAECgUC.js";
|
|
9
|
+
const x = "Alfadocs", w = l(
|
|
10
|
+
"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
centred: { true: "ds:items-center ds:text-center", false: "" }
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: { centred: !0 }
|
|
16
|
+
}
|
|
17
|
+
), A = l(
|
|
18
|
+
"ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
19
|
+
), N = l(
|
|
20
|
+
'type-body-sm ds:relative ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] ds:before:absolute ds:before:inset-x-0 ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]',
|
|
21
|
+
{
|
|
22
|
+
variants: {
|
|
23
|
+
/** Centred under a button, or at the end edge under a field. */
|
|
24
|
+
align: { center: "ds:self-center", end: "ds:self-end" }
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: { align: "center" }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
function B({
|
|
30
|
+
href: e,
|
|
31
|
+
action: s,
|
|
32
|
+
align: t,
|
|
33
|
+
children: a
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ r("a", { href: e, "data-action": s, className: N({ align: t }), children: a });
|
|
36
|
+
}
|
|
37
|
+
function S({
|
|
38
|
+
id: e,
|
|
39
|
+
title: s,
|
|
40
|
+
description: t,
|
|
41
|
+
level: a,
|
|
42
|
+
showLogo: n,
|
|
43
|
+
logoMotion: d
|
|
44
|
+
}) {
|
|
45
|
+
const i = `h${a}`;
|
|
46
|
+
return /* @__PURE__ */ m("div", { className: w({ centred: n }), children: [
|
|
47
|
+
n && /* @__PURE__ */ r(b, { motion: d, label: x }),
|
|
48
|
+
/* @__PURE__ */ r(i, { id: e, className: "type-title-card", children: s }),
|
|
49
|
+
t && /* @__PURE__ */ r("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: t })
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
const y = h(
|
|
53
|
+
({ id: e, announce: s, children: t }, a) => /* @__PURE__ */ r(
|
|
54
|
+
c,
|
|
55
|
+
{
|
|
56
|
+
ref: a,
|
|
57
|
+
id: e,
|
|
58
|
+
variant: "error",
|
|
59
|
+
announce: s,
|
|
60
|
+
tabIndex: -1,
|
|
61
|
+
"data-field": "form",
|
|
62
|
+
className: A(),
|
|
63
|
+
children: /* @__PURE__ */ r(c.Description, { children: t })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
y.displayName = "AuthFormMessage";
|
|
68
|
+
function C(e, s, t, a) {
|
|
69
|
+
const n = new Set(Object.values(t ?? {})), d = s ? Object.entries(a ?? {}) : [], i = d.filter(([o]) => n.has(o)).map(([o]) => o).join(", ");
|
|
70
|
+
return f(() => {
|
|
71
|
+
i && u() && console.warn(
|
|
72
|
+
`${e}: hiddenFields "${i}" is also named in fieldNames and was left out. The form's own field wins.`
|
|
73
|
+
);
|
|
74
|
+
}, [i, e]), d.filter(([o]) => !n.has(o));
|
|
75
|
+
}
|
|
76
|
+
function D(e, s, t) {
|
|
77
|
+
const a = s && t && p(t) ? t : void 0, n = t ? s ? a ? void 0 : "`action` is not a path or an address on this origin and was left out. The form posts to the current address." : "`action` does nothing without `fieldNames`: only a native form post has an address." : void 0;
|
|
78
|
+
return f(() => {
|
|
79
|
+
n && u() && console.warn(`${e}: ${n}`);
|
|
80
|
+
}, [e, n]), a;
|
|
81
|
+
}
|
|
82
|
+
function H({ fields: e }) {
|
|
83
|
+
return /* @__PURE__ */ r(v, { children: e.map(([s, t]) => /* @__PURE__ */ r("input", { type: "hidden", name: s, value: t }, s)) });
|
|
84
|
+
}
|
|
85
|
+
function O({ busy: e }) {
|
|
86
|
+
const { t: s } = g("ui");
|
|
87
|
+
return /* @__PURE__ */ r("p", { role: "status", className: "ds:sr-only", children: e ? s("chat.message.status.sending") : "" });
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
S as A,
|
|
91
|
+
H as E,
|
|
92
|
+
C as a,
|
|
93
|
+
y as b,
|
|
94
|
+
O as c,
|
|
95
|
+
B as d,
|
|
96
|
+
D as u
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=auth-form-parts-DHv6LVV2.js.map
|
|
@@ -10,7 +10,7 @@ import { E as bo } from "./error-summary-mGxIyDAY.js";
|
|
|
10
10
|
import { F as wo } from "./form-field-Ani72sVY.js";
|
|
11
11
|
import { i as xo } from "./safe-href-5dbsfbQn.js";
|
|
12
12
|
import { u as Eo } from "./use-state-backed-input-DhRQo6gM.js";
|
|
13
|
-
import { u as Io, a as Ao, A as Po, b as yo, E as So, c as Ro, d as To } from "./auth-form-parts-
|
|
13
|
+
import { u as Io, a as Ao, A as Po, b as yo, E as So, c as Ro, d as To } from "./auth-form-parts-DHv6LVV2.js";
|
|
14
14
|
import { u as Bo, a as Mo, b as No } from "./use-registration-submit-eWAECgUC.js";
|
|
15
15
|
const Vo = ["email"], Do = U(
|
|
16
16
|
"ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]"
|
|
@@ -231,4 +231,4 @@ export {
|
|
|
231
231
|
Vo as F,
|
|
232
232
|
_o as a
|
|
233
233
|
};
|
|
234
|
-
//# sourceMappingURL=forgot-password-form-
|
|
234
|
+
//# sourceMappingURL=forgot-password-form-BGPc8TGr.js.map
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as cs, useId as N, useState as n, useRef as os, useEffect as ks } from "react";
|
|
3
|
+
import { useTranslation as Bs } from "react-i18next";
|
|
4
|
+
import { c as E } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { i as ds, E as Rs } from "./email-input-C7THAwh2.js";
|
|
6
|
+
import { B as ms } from "./button-D-MQxsA_.js";
|
|
7
|
+
import { C as v } from "./card-BA4Ig_kn.js";
|
|
8
|
+
import { E as As } from "./error-summary-mGxIyDAY.js";
|
|
9
|
+
import { F as ls } from "./form-field-Ani72sVY.js";
|
|
10
|
+
import { P as Cs } from "./password-input-BokZ_rnT.js";
|
|
11
|
+
import { i as us } from "./safe-href-5dbsfbQn.js";
|
|
12
|
+
import { u as Ms } from "./use-state-backed-input-DhRQo6gM.js";
|
|
13
|
+
import { u as Ss, a as qs, A as Ps, b as js, d as D, E as zs, c as Hs } from "./auth-form-parts-DHv6LVV2.js";
|
|
14
|
+
import { u as Ds, b as Os, a as Ts } from "./use-registration-submit-eWAECgUC.js";
|
|
15
|
+
import { M as $s } from "./matrix-rain-sDOUUwZp.js";
|
|
16
|
+
import { a as _s } from "./error-page-illustration-BdJLuMdV.js";
|
|
17
|
+
const T = ["email", "password"], Gs = E(
|
|
18
|
+
"ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch"
|
|
19
|
+
), is = E("ds:w-full ds:max-w-[400px]"), Ws = E(
|
|
20
|
+
"ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]"
|
|
21
|
+
), O = (a) => a && us(a) ? a : void 0, Js = (a) => Object.values(a).some(Boolean), Ks = (a) => T.some((l) => !!a[l]), ns = (a) => T.find((l) => a[l]) ?? (a.form ? "password" : void 0), Qs = cs(
|
|
22
|
+
({
|
|
23
|
+
title: a,
|
|
24
|
+
description: l,
|
|
25
|
+
headingLevel: h = 1,
|
|
26
|
+
showLogo: I = !0,
|
|
27
|
+
logoMotion: L = "assemble",
|
|
28
|
+
children: w,
|
|
29
|
+
initialValues: o,
|
|
30
|
+
errors: c,
|
|
31
|
+
forgotPasswordHref: k,
|
|
32
|
+
registerDoctorHref: d,
|
|
33
|
+
registerPatientHref: B,
|
|
34
|
+
submitLabel: fs,
|
|
35
|
+
submitting: gs = !1,
|
|
36
|
+
onSubmit: R,
|
|
37
|
+
fieldNames: x,
|
|
38
|
+
action: ps,
|
|
39
|
+
hiddenFields: vs,
|
|
40
|
+
devCard: $,
|
|
41
|
+
className: hs,
|
|
42
|
+
...ws
|
|
43
|
+
}, xs) => {
|
|
44
|
+
const { t } = Bs("ui"), _ = N(), A = N(), Fs = N(), C = (s) => `${Fs}-${s}`, u = x !== void 0, [f, M] = n(() => (o == null ? void 0 : o.email) ?? ""), [F, b] = n(""), [bs, G] = n(() => ({ email: !!(o != null && o.email) })), [ys, W] = n(!1), [J, K] = n(
|
|
45
|
+
() => c ?? {}
|
|
46
|
+
), Q = (s) => G(
|
|
47
|
+
(r) => r[s] ? r : { ...r, [s]: !0 }
|
|
48
|
+
), U = (s) => K(
|
|
49
|
+
(r) => r[s] ? { ...r, [s]: void 0 } : r
|
|
50
|
+
), S = os(null), q = os(null), X = Ms(f, S), Y = () => {
|
|
51
|
+
b(""), G((s) => ({ ...s, password: !1 }));
|
|
52
|
+
}, Z = () => {
|
|
53
|
+
var r, p;
|
|
54
|
+
const s = {
|
|
55
|
+
email: ((r = S.current) == null ? void 0 : r.value) ?? f,
|
|
56
|
+
password: ((p = q.current) == null ? void 0 : p.value) ?? F
|
|
57
|
+
};
|
|
58
|
+
return s.email !== f && M(s.email), s.password !== F && b(s.password), s;
|
|
59
|
+
}, V = {
|
|
60
|
+
email: !ds(f),
|
|
61
|
+
password: F === ""
|
|
62
|
+
}, ss = (s) => ys || bs[s] === !0, Ns = {
|
|
63
|
+
email: ss("email") && V.email ? t(f === "" ? "loginForm.emailRequired" : "inputs.email.invalid") : void 0,
|
|
64
|
+
password: ss("password") && V.password ? t("loginForm.passwordRequired") : void 0
|
|
65
|
+
}, y = (s) => J[s] ?? Ns[s], [es] = n(
|
|
66
|
+
() => Ks(c ?? {})
|
|
67
|
+
), i = Ds(
|
|
68
|
+
T,
|
|
69
|
+
y,
|
|
70
|
+
es
|
|
71
|
+
), [P, as] = n(() => {
|
|
72
|
+
const s = es ? void 0 : ns(c ?? {});
|
|
73
|
+
return s ? { target: s } : null;
|
|
74
|
+
});
|
|
75
|
+
ks(() => {
|
|
76
|
+
var s;
|
|
77
|
+
P && ((s = (P.target === "email" ? S : q).current) == null || s.focus());
|
|
78
|
+
}, [P]);
|
|
79
|
+
const rs = Os({
|
|
80
|
+
errors: c,
|
|
81
|
+
submitting: gs,
|
|
82
|
+
native: u,
|
|
83
|
+
captcha: !1,
|
|
84
|
+
firstProblem: () => {
|
|
85
|
+
const s = Z();
|
|
86
|
+
return ds(s.email) ? s.password === "" ? "password" : void 0 : "email";
|
|
87
|
+
},
|
|
88
|
+
onRefused: (s) => {
|
|
89
|
+
W(!0), i.open(() => as({ target: s }));
|
|
90
|
+
},
|
|
91
|
+
// Only a React host gets here: a native post is the browser's own.
|
|
92
|
+
deliver: () => R == null ? void 0 : R(Z()),
|
|
93
|
+
onAnswer: (s) => {
|
|
94
|
+
const r = s;
|
|
95
|
+
K(r), Js(r) && (Y(), W(!1), i.open(() => {
|
|
96
|
+
const p = ns(r);
|
|
97
|
+
p && as({ target: p });
|
|
98
|
+
}));
|
|
99
|
+
},
|
|
100
|
+
// The page came back from the browser's cache as it was left: the
|
|
101
|
+
// password must not come back with it.
|
|
102
|
+
onRestore: Y
|
|
103
|
+
}), { busy: j } = rs, Es = Ss("LoginForm", u, ps), ts = O(k), z = O(d), H = O(B), Is = qs(
|
|
104
|
+
"LoginForm",
|
|
105
|
+
u,
|
|
106
|
+
x,
|
|
107
|
+
vs
|
|
108
|
+
), g = J.form, Ls = Ts(
|
|
109
|
+
g,
|
|
110
|
+
i.listed.length > 0
|
|
111
|
+
);
|
|
112
|
+
return /* @__PURE__ */ m(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
ref: xs,
|
|
116
|
+
...ws,
|
|
117
|
+
"data-component": "login-form",
|
|
118
|
+
className: Gs({ className: hs }),
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ e("div", { className: is(), children: /* @__PURE__ */ e(v, { variant: "elevated", className: "ds:h-full", children: /* @__PURE__ */ m(v.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
121
|
+
/* @__PURE__ */ e(
|
|
122
|
+
Ps,
|
|
123
|
+
{
|
|
124
|
+
id: _,
|
|
125
|
+
title: a ?? t("loginForm.title"),
|
|
126
|
+
description: l,
|
|
127
|
+
level: h,
|
|
128
|
+
showLogo: I,
|
|
129
|
+
logoMotion: L
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
w ? /* @__PURE__ */ e(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
"data-slot": "host-content",
|
|
136
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
137
|
+
children: w
|
|
138
|
+
}
|
|
139
|
+
) : null,
|
|
140
|
+
/* @__PURE__ */ m(
|
|
141
|
+
"form",
|
|
142
|
+
{
|
|
143
|
+
noValidate: !0,
|
|
144
|
+
method: "post",
|
|
145
|
+
action: Es,
|
|
146
|
+
"aria-labelledby": _,
|
|
147
|
+
"aria-busy": j || void 0,
|
|
148
|
+
onSubmit: rs.handleSubmit,
|
|
149
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ e(
|
|
152
|
+
As,
|
|
153
|
+
{
|
|
154
|
+
ref: i.ref,
|
|
155
|
+
headingLevel: h + 1,
|
|
156
|
+
"aria-describedby": g ? A : void 0,
|
|
157
|
+
errors: i.listed.map((s) => ({
|
|
158
|
+
field: s,
|
|
159
|
+
message: y(s) ?? "",
|
|
160
|
+
targetId: C(s)
|
|
161
|
+
}))
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
g && /* @__PURE__ */ e(
|
|
165
|
+
js,
|
|
166
|
+
{
|
|
167
|
+
id: A,
|
|
168
|
+
announce: Ls,
|
|
169
|
+
children: g
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
ls,
|
|
174
|
+
{
|
|
175
|
+
id: C("email"),
|
|
176
|
+
label: t("loginForm.email"),
|
|
177
|
+
required: !0,
|
|
178
|
+
error: y("email"),
|
|
179
|
+
announceError: !i.lists("email"),
|
|
180
|
+
"data-field": "email",
|
|
181
|
+
children: /* @__PURE__ */ e(
|
|
182
|
+
Rs,
|
|
183
|
+
{
|
|
184
|
+
ref: X.ref,
|
|
185
|
+
name: u ? x.email : "email",
|
|
186
|
+
autoComplete: "username",
|
|
187
|
+
disableBuiltInValidation: !0,
|
|
188
|
+
onChange: X.quiet((s) => {
|
|
189
|
+
M(s.target.value), U("email");
|
|
190
|
+
}),
|
|
191
|
+
onBlur: (s) => {
|
|
192
|
+
M(s.target.value), s.target.value !== "" && Q("email");
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ e(
|
|
199
|
+
ls,
|
|
200
|
+
{
|
|
201
|
+
id: C("password"),
|
|
202
|
+
label: t("loginForm.password"),
|
|
203
|
+
required: !0,
|
|
204
|
+
error: y("password"),
|
|
205
|
+
announceError: !i.lists("password"),
|
|
206
|
+
"data-field": "password",
|
|
207
|
+
children: /* @__PURE__ */ e(
|
|
208
|
+
Cs,
|
|
209
|
+
{
|
|
210
|
+
ref: q,
|
|
211
|
+
name: u ? x.password : "password",
|
|
212
|
+
autoComplete: "current-password",
|
|
213
|
+
"aria-describedby": g ? A : void 0,
|
|
214
|
+
value: F,
|
|
215
|
+
onChange: (s) => {
|
|
216
|
+
b(s.target.value), U("password");
|
|
217
|
+
},
|
|
218
|
+
onBlur: (s) => {
|
|
219
|
+
b(s.target.value), s.target.value !== "" && Q("password");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
ts && /* @__PURE__ */ e(
|
|
226
|
+
D,
|
|
227
|
+
{
|
|
228
|
+
href: ts,
|
|
229
|
+
action: "forgot-password",
|
|
230
|
+
align: "end",
|
|
231
|
+
children: t("loginForm.forgot")
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ e(zs, { fields: Is }),
|
|
235
|
+
/* @__PURE__ */ e(
|
|
236
|
+
ms,
|
|
237
|
+
{
|
|
238
|
+
type: "submit",
|
|
239
|
+
intent: "primary",
|
|
240
|
+
size: "lg",
|
|
241
|
+
loading: j,
|
|
242
|
+
className: "ds:w-full",
|
|
243
|
+
"data-action": "submit",
|
|
244
|
+
children: fs ?? t("loginForm.submit")
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
(z || H) && /* @__PURE__ */ m(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
"data-slot": "register-links",
|
|
254
|
+
className: Ws(),
|
|
255
|
+
children: [
|
|
256
|
+
z && /* @__PURE__ */ e(D, { href: z, action: "register-doctor", children: t("signedOutHeader.registerDoctor") }),
|
|
257
|
+
H && /* @__PURE__ */ e(D, { href: H, action: "register-patient", children: t("signedOutHeader.registerPatient") })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ e(Hs, { busy: j })
|
|
262
|
+
] }) }) }),
|
|
263
|
+
$ ? /* @__PURE__ */ e("div", { className: is(), children: $ }) : null
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
Qs.displayName = "LoginForm";
|
|
270
|
+
const Us = E("ds:h-full ds:w-full"), Xs = cs(
|
|
271
|
+
({ title: a, options: l, headingLevel: h = 2, className: I, ...L }, w) => {
|
|
272
|
+
const o = N(), c = `h${h}`, k = l.filter((d) => us(d.href));
|
|
273
|
+
return /* @__PURE__ */ e(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
ref: w,
|
|
277
|
+
...L,
|
|
278
|
+
"data-component": "login-dev-card",
|
|
279
|
+
className: Us({ className: I }),
|
|
280
|
+
children: /* @__PURE__ */ m(
|
|
281
|
+
v,
|
|
282
|
+
{
|
|
283
|
+
variant: "elevated",
|
|
284
|
+
"aria-labelledby": o,
|
|
285
|
+
className: "ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ e("div", { className: "ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]", children: /* @__PURE__ */ e(
|
|
288
|
+
$s,
|
|
289
|
+
{
|
|
290
|
+
glyphs: "hex",
|
|
291
|
+
decay: "fast",
|
|
292
|
+
mask: "center",
|
|
293
|
+
maskRadius: "xl",
|
|
294
|
+
className: "ds:size-full"
|
|
295
|
+
}
|
|
296
|
+
) }),
|
|
297
|
+
/* @__PURE__ */ e(v.Header, { className: "ds:relative ds:z-[1]", children: /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center", children: [
|
|
298
|
+
/* @__PURE__ */ e("div", { className: "ds:[&>div]:w-24", children: /* @__PURE__ */ e(_s, { mood: "melt" }) }),
|
|
299
|
+
/* @__PURE__ */ e(
|
|
300
|
+
c,
|
|
301
|
+
{
|
|
302
|
+
id: o,
|
|
303
|
+
className: "type-title-card ds:text-[var(--foreground)]",
|
|
304
|
+
children: a
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] }) }),
|
|
308
|
+
/* @__PURE__ */ e(v.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: k.map((d, B) => /* @__PURE__ */ e(
|
|
309
|
+
ms,
|
|
310
|
+
{
|
|
311
|
+
asChild: !0,
|
|
312
|
+
intent: "primary",
|
|
313
|
+
startIcon: d.icon,
|
|
314
|
+
className: "ds:min-h-[var(--min-target-size)] ds:w-full",
|
|
315
|
+
children: /* @__PURE__ */ e("a", { href: d.href, "data-action": "dev-login", children: d.label })
|
|
316
|
+
},
|
|
317
|
+
`${B}:${d.href}`
|
|
318
|
+
)) }) })
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
Xs.displayName = "LoginDevCard";
|
|
327
|
+
export {
|
|
328
|
+
T as L,
|
|
329
|
+
Xs as a,
|
|
330
|
+
Qs as b
|
|
331
|
+
};
|
|
332
|
+
//# sourceMappingURL=login-dev-card-CWpoTuVY.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "1.
|
|
3
|
+
"packageVersion": "1.71.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -20259,6 +20259,14 @@
|
|
|
20259
20259
|
"uiActions": [],
|
|
20260
20260
|
"apiActions": []
|
|
20261
20261
|
},
|
|
20262
|
+
{
|
|
20263
|
+
"name": "register",
|
|
20264
|
+
"safety": "read",
|
|
20265
|
+
"description": "Go to a registration page: `data-action=\"register-doctor\"` or `data-action=\"register-patient\"`, under the sign-in button. Each is present only when the host gives its address.",
|
|
20266
|
+
"descriptionKey": "ui.agent.loginForm.workflows.register",
|
|
20267
|
+
"uiActions": [],
|
|
20268
|
+
"apiActions": []
|
|
20269
|
+
},
|
|
20262
20270
|
{
|
|
20263
20271
|
"name": "dev_sign_in",
|
|
20264
20272
|
"safety": "write",
|
package/dist/agent-i18n/en.json
CHANGED
|
@@ -1899,6 +1899,7 @@
|
|
|
1899
1899
|
"readForm": "Read the sign-in form and what is wrong with it. Each field sits in a wrapper with `data-field` (`email`, `password`). A field with a problem has `aria-invalid=\"true\"` on its control and its message in a `data-slot=\"error\"` element inside the wrapper. After a refused submit the fields with a problem are also listed in `data-component=\"error-summary\"` at the top of the form, one item per field (`data-error-field`). A message about the whole form, such as a refused sign-in, is in `data-field=\"form\"`; it never says which of the two values was wrong. Never read or repeat the password.",
|
|
1900
1900
|
"signIn": "Sign in (`data-action=\"submit\"`). The person types the email and the password themselves; the form does not submit until the email is a valid address and the password is not empty; it lists what is wrong in its error summary and moves focus there. The host then signs the person in: through its `onSubmit` handler, or as a native form post to its own field names.",
|
|
1901
1901
|
"forgotPassword": "Go to the page that asks for a password reset link (`data-action=\"forgot-password\"`). Present only when the host gives its address.",
|
|
1902
|
+
"register": "Go to a registration page: `data-action=\"register-doctor\"` or `data-action=\"register-patient\"`, under the sign-in button. Each is present only when the host gives its address.",
|
|
1902
1903
|
"devSignIn": "Development only: follow one of the quick sign-in links (`data-action=\"dev-login\"`, inside `data-component=\"login-dev-card\"`). Each leads to a route on the host that signs a test account in. The kit holds no test data. The card is present only when the host's server reports a development environment, and the server refuses those routes anywhere else."
|
|
1903
1904
|
}
|
|
1904
1905
|
},
|
package/dist/index.js
CHANGED
|
@@ -264,9 +264,9 @@ import { A as iT, a as pT, L as mT, P as lT, S as dT, T as AT, b as fT, c as cT,
|
|
|
264
264
|
import { C as yT, a as kT, b as BT, c as vT, D as GT, d as HT, S as WT, V as wT, W as UT, e as VT, i as KT, m as YT, r as XT, u as qT, f as zT, g as jT } from "./_chunks/calendar-workspace-Ct8_454k.js";
|
|
265
265
|
import { E as ZT, a as JT, b as $T, e as au, r as eu } from "./_chunks/error-page-DirZKDz2.js";
|
|
266
266
|
import { E as ru } from "./_chunks/error-page-illustration-BdJLuMdV.js";
|
|
267
|
-
import { F as tu, a as nu } from "./_chunks/forgot-password-form-
|
|
267
|
+
import { F as tu, a as nu } from "./_chunks/forgot-password-form-BGPc8TGr.js";
|
|
268
268
|
import { A as pu, a as mu, H as lu, b as du, u as Au } from "./_chunks/help-me-write-templates-5WkUfvc_.js";
|
|
269
|
-
import { L as cu, a as Su, b as gu } from "./_chunks/login-dev-card-
|
|
269
|
+
import { L as cu, a as Su, b as gu } from "./_chunks/login-dev-card-CWpoTuVY.js";
|
|
270
270
|
import { C as xu, M as Tu, P as uu } from "./_chunks/marketplace-app-shell-CcLQ0Dn-.js";
|
|
271
271
|
import { P as Eu } from "./_chunks/payment-automation-upsell-CiwF5UrC.js";
|
|
272
272
|
import { R as Ru, a as _u } from "./_chunks/registration-form-1B0PTDal.js";
|
|
@@ -5,11 +5,12 @@ export interface AuthTextLinkProps {
|
|
|
5
5
|
href: string;
|
|
6
6
|
/** Emitted as `data-action`. */
|
|
7
7
|
action: string;
|
|
8
|
+
/** Default `center`. */
|
|
9
|
+
align?: 'center' | 'end';
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
export declare function AuthTextLink({ href, action, children }: AuthTextLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/** A quiet link in the card: "Forgot password?", "Back to sign in". */
|
|
13
|
+
export declare function AuthTextLink({ href, action, align, children, }: AuthTextLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export interface AuthCardHeadingProps {
|
|
14
15
|
/** The id the form is labelled by. */
|
|
15
16
|
id: string;
|
|
@@ -68,11 +68,15 @@ export interface LoginFormProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ti
|
|
|
68
68
|
*/
|
|
69
69
|
errors?: LoginFormErrors;
|
|
70
70
|
/**
|
|
71
|
-
* Adds "Forgot password?" under the
|
|
71
|
+
* Adds "Forgot password?" under the password. A path on the same site,
|
|
72
72
|
* or an address written in full (`https://…`). Anything else shows no
|
|
73
|
-
* link.
|
|
73
|
+
* link. The same rule holds for the two addresses below.
|
|
74
74
|
*/
|
|
75
75
|
forgotPasswordHref?: string;
|
|
76
|
+
/** Adds "Register as a doctor" under the button. */
|
|
77
|
+
registerDoctorHref?: string;
|
|
78
|
+
/** Adds "Register as a patient" under the button. */
|
|
79
|
+
registerPatientHref?: string;
|
|
76
80
|
/** Replaces the button's "Sign in". Pass it translated. */
|
|
77
81
|
submitLabel?: string;
|
|
78
82
|
/**
|
package/package.json
CHANGED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as f, forwardRef as h } from "react";
|
|
3
|
-
import { c as l } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as g } from "react-i18next";
|
|
5
|
-
import { A as c } from "./alert-9kEwDza3.js";
|
|
6
|
-
import { i as u } from "./is-development-CLUAnsU7.js";
|
|
7
|
-
import { a as p } from "./safe-href-5dbsfbQn.js";
|
|
8
|
-
import { B as b } from "./use-registration-submit-eWAECgUC.js";
|
|
9
|
-
const x = "Alfadocs", w = l(
|
|
10
|
-
"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
centred: { true: "ds:items-center ds:text-center", false: "" }
|
|
14
|
-
},
|
|
15
|
-
defaultVariants: { centred: !0 }
|
|
16
|
-
}
|
|
17
|
-
), A = l(
|
|
18
|
-
"ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
19
|
-
), N = l(
|
|
20
|
-
'type-body-sm ds:relative ds:self-center ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] ds:before:absolute ds:before:inset-x-0 ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]'
|
|
21
|
-
);
|
|
22
|
-
function S({ href: s, action: e, children: t }) {
|
|
23
|
-
return /* @__PURE__ */ r("a", { href: s, "data-action": e, className: N(), children: t });
|
|
24
|
-
}
|
|
25
|
-
function V({
|
|
26
|
-
id: s,
|
|
27
|
-
title: e,
|
|
28
|
-
description: t,
|
|
29
|
-
level: a,
|
|
30
|
-
showLogo: o,
|
|
31
|
-
logoMotion: d
|
|
32
|
-
}) {
|
|
33
|
-
const i = `h${a}`;
|
|
34
|
-
return /* @__PURE__ */ m("div", { className: w({ centred: o }), children: [
|
|
35
|
-
o && /* @__PURE__ */ r(b, { motion: d, label: x }),
|
|
36
|
-
/* @__PURE__ */ r(i, { id: s, className: "type-title-card", children: e }),
|
|
37
|
-
t && /* @__PURE__ */ r("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: t })
|
|
38
|
-
] });
|
|
39
|
-
}
|
|
40
|
-
const y = h(
|
|
41
|
-
({ id: s, announce: e, children: t }, a) => /* @__PURE__ */ r(
|
|
42
|
-
c,
|
|
43
|
-
{
|
|
44
|
-
ref: a,
|
|
45
|
-
id: s,
|
|
46
|
-
variant: "error",
|
|
47
|
-
announce: e,
|
|
48
|
-
tabIndex: -1,
|
|
49
|
-
"data-field": "form",
|
|
50
|
-
className: A(),
|
|
51
|
-
children: /* @__PURE__ */ r(c.Description, { children: t })
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
y.displayName = "AuthFormMessage";
|
|
56
|
-
function C(s, e, t, a) {
|
|
57
|
-
const o = new Set(Object.values(t ?? {})), d = e ? Object.entries(a ?? {}) : [], i = d.filter(([n]) => o.has(n)).map(([n]) => n).join(", ");
|
|
58
|
-
return f(() => {
|
|
59
|
-
i && u() && console.warn(
|
|
60
|
-
`${s}: hiddenFields "${i}" is also named in fieldNames and was left out. The form's own field wins.`
|
|
61
|
-
);
|
|
62
|
-
}, [i, s]), d.filter(([n]) => !o.has(n));
|
|
63
|
-
}
|
|
64
|
-
function D(s, e, t) {
|
|
65
|
-
const a = e && t && p(t) ? t : void 0, o = t ? e ? a ? void 0 : "`action` is not a path or an address on this origin and was left out. The form posts to the current address." : "`action` does nothing without `fieldNames`: only a native form post has an address." : void 0;
|
|
66
|
-
return f(() => {
|
|
67
|
-
o && u() && console.warn(`${s}: ${o}`);
|
|
68
|
-
}, [s, o]), a;
|
|
69
|
-
}
|
|
70
|
-
function H({ fields: s }) {
|
|
71
|
-
return /* @__PURE__ */ r(v, { children: s.map(([e, t]) => /* @__PURE__ */ r("input", { type: "hidden", name: e, value: t }, e)) });
|
|
72
|
-
}
|
|
73
|
-
function O({ busy: s }) {
|
|
74
|
-
const { t: e } = g("ui");
|
|
75
|
-
return /* @__PURE__ */ r("p", { role: "status", className: "ds:sr-only", children: s ? e("chat.message.status.sending") : "" });
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
V as A,
|
|
79
|
-
H as E,
|
|
80
|
-
C as a,
|
|
81
|
-
y as b,
|
|
82
|
-
O as c,
|
|
83
|
-
S as d,
|
|
84
|
-
D as u
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=auth-form-parts-B40zvD-a.js.map
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as ls, useId as N, useState as n, useRef as es, useEffect as bs } from "react";
|
|
3
|
-
import { useTranslation as ys } from "react-i18next";
|
|
4
|
-
import { c as j } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { i as as, E as Es } from "./email-input-C7THAwh2.js";
|
|
6
|
-
import { B as ds } from "./button-D-MQxsA_.js";
|
|
7
|
-
import { C as h } from "./card-BA4Ig_kn.js";
|
|
8
|
-
import { E as Ns } from "./error-summary-mGxIyDAY.js";
|
|
9
|
-
import { F as rs } from "./form-field-Ani72sVY.js";
|
|
10
|
-
import { P as Is } from "./password-input-BokZ_rnT.js";
|
|
11
|
-
import { i as is } from "./safe-href-5dbsfbQn.js";
|
|
12
|
-
import { u as Bs } from "./use-state-backed-input-DhRQo6gM.js";
|
|
13
|
-
import { u as Rs, a as Ls, A as As, b as Cs, E as Ms, d as Ss, c as ks } from "./auth-form-parts-B40zvD-a.js";
|
|
14
|
-
import { u as qs, b as zs, a as js } from "./use-registration-submit-eWAECgUC.js";
|
|
15
|
-
import { M as $s } from "./matrix-rain-sDOUUwZp.js";
|
|
16
|
-
import { a as Ds } from "./error-page-illustration-BdJLuMdV.js";
|
|
17
|
-
const $ = ["email", "password"], Ps = j(
|
|
18
|
-
"ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch"
|
|
19
|
-
), os = j("ds:w-full ds:max-w-[400px]"), Ts = (r) => Object.values(r).some(Boolean), Os = (r) => $.some((d) => !!r[d]), ts = (r) => $.find((d) => r[d]) ?? (r.form ? "password" : void 0), Hs = ls(
|
|
20
|
-
({
|
|
21
|
-
title: r,
|
|
22
|
-
description: d,
|
|
23
|
-
headingLevel: w = 1,
|
|
24
|
-
showLogo: I = !0,
|
|
25
|
-
logoMotion: B = "assemble",
|
|
26
|
-
children: x,
|
|
27
|
-
initialValues: o,
|
|
28
|
-
errors: c,
|
|
29
|
-
forgotPasswordHref: m,
|
|
30
|
-
submitLabel: t,
|
|
31
|
-
submitting: R = !1,
|
|
32
|
-
onSubmit: L,
|
|
33
|
-
fieldNames: F,
|
|
34
|
-
action: ns,
|
|
35
|
-
hiddenFields: cs,
|
|
36
|
-
devCard: D,
|
|
37
|
-
className: ms,
|
|
38
|
-
...us
|
|
39
|
-
}, fs) => {
|
|
40
|
-
const { t: l } = ys("ui"), P = N(), A = N(), ps = N(), C = (s) => `${ps}-${s}`, u = F !== void 0, [f, M] = n(() => (o == null ? void 0 : o.email) ?? ""), [b, y] = n(""), [gs, T] = n(() => ({ email: !!(o != null && o.email) })), [vs, O] = n(!1), [H, _] = n(
|
|
41
|
-
() => c ?? {}
|
|
42
|
-
), G = (s) => T(
|
|
43
|
-
(a) => a[s] ? a : { ...a, [s]: !0 }
|
|
44
|
-
), W = (s) => _(
|
|
45
|
-
(a) => a[s] ? { ...a, [s]: void 0 } : a
|
|
46
|
-
), S = es(null), k = es(null), J = Bs(f, S), K = () => {
|
|
47
|
-
y(""), T((s) => ({ ...s, password: !1 }));
|
|
48
|
-
}, Q = () => {
|
|
49
|
-
var a, g;
|
|
50
|
-
const s = {
|
|
51
|
-
email: ((a = S.current) == null ? void 0 : a.value) ?? f,
|
|
52
|
-
password: ((g = k.current) == null ? void 0 : g.value) ?? b
|
|
53
|
-
};
|
|
54
|
-
return s.email !== f && M(s.email), s.password !== b && y(s.password), s;
|
|
55
|
-
}, U = {
|
|
56
|
-
email: !as(f),
|
|
57
|
-
password: b === ""
|
|
58
|
-
}, X = (s) => vs || gs[s] === !0, hs = {
|
|
59
|
-
email: X("email") && U.email ? l(f === "" ? "loginForm.emailRequired" : "inputs.email.invalid") : void 0,
|
|
60
|
-
password: X("password") && U.password ? l("loginForm.passwordRequired") : void 0
|
|
61
|
-
}, E = (s) => H[s] ?? hs[s], [Y] = n(
|
|
62
|
-
() => Os(c ?? {})
|
|
63
|
-
), i = qs(
|
|
64
|
-
$,
|
|
65
|
-
E,
|
|
66
|
-
Y
|
|
67
|
-
), [q, Z] = n(() => {
|
|
68
|
-
const s = Y ? void 0 : ts(c ?? {});
|
|
69
|
-
return s ? { target: s } : null;
|
|
70
|
-
});
|
|
71
|
-
bs(() => {
|
|
72
|
-
var s;
|
|
73
|
-
q && ((s = (q.target === "email" ? S : k).current) == null || s.focus());
|
|
74
|
-
}, [q]);
|
|
75
|
-
const V = zs({
|
|
76
|
-
errors: c,
|
|
77
|
-
submitting: R,
|
|
78
|
-
native: u,
|
|
79
|
-
captcha: !1,
|
|
80
|
-
firstProblem: () => {
|
|
81
|
-
const s = Q();
|
|
82
|
-
return as(s.email) ? s.password === "" ? "password" : void 0 : "email";
|
|
83
|
-
},
|
|
84
|
-
onRefused: (s) => {
|
|
85
|
-
O(!0), i.open(() => Z({ target: s }));
|
|
86
|
-
},
|
|
87
|
-
// Only a React host gets here: a native post is the browser's own.
|
|
88
|
-
deliver: () => L == null ? void 0 : L(Q()),
|
|
89
|
-
onAnswer: (s) => {
|
|
90
|
-
const a = s;
|
|
91
|
-
_(a), Ts(a) && (K(), O(!1), i.open(() => {
|
|
92
|
-
const g = ts(a);
|
|
93
|
-
g && Z({ target: g });
|
|
94
|
-
}));
|
|
95
|
-
},
|
|
96
|
-
// The page came back from the browser's cache as it was left: the
|
|
97
|
-
// password must not come back with it.
|
|
98
|
-
onRestore: K
|
|
99
|
-
}), { busy: z } = V, ws = Rs("LoginForm", u, ns), ss = m && is(m) ? m : void 0, xs = Ls(
|
|
100
|
-
"LoginForm",
|
|
101
|
-
u,
|
|
102
|
-
F,
|
|
103
|
-
cs
|
|
104
|
-
), p = H.form, Fs = js(
|
|
105
|
-
p,
|
|
106
|
-
i.listed.length > 0
|
|
107
|
-
);
|
|
108
|
-
return /* @__PURE__ */ v(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
ref: fs,
|
|
112
|
-
...us,
|
|
113
|
-
"data-component": "login-form",
|
|
114
|
-
className: Ps({ className: ms }),
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ e("div", { className: os(), children: /* @__PURE__ */ e(h, { variant: "elevated", className: "ds:h-full", children: /* @__PURE__ */ v(h.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
As,
|
|
119
|
-
{
|
|
120
|
-
id: P,
|
|
121
|
-
title: r ?? l("loginForm.title"),
|
|
122
|
-
description: d,
|
|
123
|
-
level: w,
|
|
124
|
-
showLogo: I,
|
|
125
|
-
logoMotion: B
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
x ? /* @__PURE__ */ e(
|
|
129
|
-
"div",
|
|
130
|
-
{
|
|
131
|
-
"data-slot": "host-content",
|
|
132
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
133
|
-
children: x
|
|
134
|
-
}
|
|
135
|
-
) : null,
|
|
136
|
-
/* @__PURE__ */ v(
|
|
137
|
-
"form",
|
|
138
|
-
{
|
|
139
|
-
noValidate: !0,
|
|
140
|
-
method: "post",
|
|
141
|
-
action: ws,
|
|
142
|
-
"aria-labelledby": P,
|
|
143
|
-
"aria-busy": z || void 0,
|
|
144
|
-
onSubmit: V.handleSubmit,
|
|
145
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ e(
|
|
148
|
-
Ns,
|
|
149
|
-
{
|
|
150
|
-
ref: i.ref,
|
|
151
|
-
headingLevel: w + 1,
|
|
152
|
-
"aria-describedby": p ? A : void 0,
|
|
153
|
-
errors: i.listed.map((s) => ({
|
|
154
|
-
field: s,
|
|
155
|
-
message: E(s) ?? "",
|
|
156
|
-
targetId: C(s)
|
|
157
|
-
}))
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
p && /* @__PURE__ */ e(
|
|
161
|
-
Cs,
|
|
162
|
-
{
|
|
163
|
-
id: A,
|
|
164
|
-
announce: Fs,
|
|
165
|
-
children: p
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
rs,
|
|
170
|
-
{
|
|
171
|
-
id: C("email"),
|
|
172
|
-
label: l("loginForm.email"),
|
|
173
|
-
required: !0,
|
|
174
|
-
error: E("email"),
|
|
175
|
-
announceError: !i.lists("email"),
|
|
176
|
-
"data-field": "email",
|
|
177
|
-
children: /* @__PURE__ */ e(
|
|
178
|
-
Es,
|
|
179
|
-
{
|
|
180
|
-
ref: J.ref,
|
|
181
|
-
name: u ? F.email : "email",
|
|
182
|
-
autoComplete: "username",
|
|
183
|
-
disableBuiltInValidation: !0,
|
|
184
|
-
onChange: J.quiet((s) => {
|
|
185
|
-
M(s.target.value), W("email");
|
|
186
|
-
}),
|
|
187
|
-
onBlur: (s) => {
|
|
188
|
-
M(s.target.value), s.target.value !== "" && G("email");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
/* @__PURE__ */ e(
|
|
195
|
-
rs,
|
|
196
|
-
{
|
|
197
|
-
id: C("password"),
|
|
198
|
-
label: l("loginForm.password"),
|
|
199
|
-
required: !0,
|
|
200
|
-
error: E("password"),
|
|
201
|
-
announceError: !i.lists("password"),
|
|
202
|
-
"data-field": "password",
|
|
203
|
-
children: /* @__PURE__ */ e(
|
|
204
|
-
Is,
|
|
205
|
-
{
|
|
206
|
-
ref: k,
|
|
207
|
-
name: u ? F.password : "password",
|
|
208
|
-
autoComplete: "current-password",
|
|
209
|
-
"aria-describedby": p ? A : void 0,
|
|
210
|
-
value: b,
|
|
211
|
-
onChange: (s) => {
|
|
212
|
-
y(s.target.value), W("password");
|
|
213
|
-
},
|
|
214
|
-
onBlur: (s) => {
|
|
215
|
-
y(s.target.value), s.target.value !== "" && G("password");
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
}
|
|
220
|
-
),
|
|
221
|
-
/* @__PURE__ */ e(Ms, { fields: xs }),
|
|
222
|
-
/* @__PURE__ */ e(
|
|
223
|
-
ds,
|
|
224
|
-
{
|
|
225
|
-
type: "submit",
|
|
226
|
-
intent: "primary",
|
|
227
|
-
size: "lg",
|
|
228
|
-
loading: z,
|
|
229
|
-
className: "ds:w-full",
|
|
230
|
-
"data-action": "submit",
|
|
231
|
-
children: t ?? l("loginForm.submit")
|
|
232
|
-
}
|
|
233
|
-
),
|
|
234
|
-
ss && /* @__PURE__ */ e(Ss, { href: ss, action: "forgot-password", children: l("loginForm.forgot") })
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
),
|
|
238
|
-
/* @__PURE__ */ e(ks, { busy: z })
|
|
239
|
-
] }) }) }),
|
|
240
|
-
D ? /* @__PURE__ */ e("div", { className: os(), children: D }) : null
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
Hs.displayName = "LoginForm";
|
|
247
|
-
const _s = j("ds:h-full ds:w-full"), Gs = ls(
|
|
248
|
-
({ title: r, options: d, headingLevel: w = 2, className: I, ...B }, x) => {
|
|
249
|
-
const o = N(), c = `h${w}`, m = d.filter((t) => is(t.href));
|
|
250
|
-
return /* @__PURE__ */ e(
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
ref: x,
|
|
254
|
-
...B,
|
|
255
|
-
"data-component": "login-dev-card",
|
|
256
|
-
className: _s({ className: I }),
|
|
257
|
-
children: /* @__PURE__ */ v(
|
|
258
|
-
h,
|
|
259
|
-
{
|
|
260
|
-
variant: "elevated",
|
|
261
|
-
"aria-labelledby": o,
|
|
262
|
-
className: "ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden",
|
|
263
|
-
children: [
|
|
264
|
-
/* @__PURE__ */ e("div", { className: "ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]", children: /* @__PURE__ */ e(
|
|
265
|
-
$s,
|
|
266
|
-
{
|
|
267
|
-
glyphs: "hex",
|
|
268
|
-
decay: "fast",
|
|
269
|
-
mask: "center",
|
|
270
|
-
maskRadius: "xl",
|
|
271
|
-
className: "ds:size-full"
|
|
272
|
-
}
|
|
273
|
-
) }),
|
|
274
|
-
/* @__PURE__ */ e(h.Header, { className: "ds:relative ds:z-[1]", children: /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center", children: [
|
|
275
|
-
/* @__PURE__ */ e("div", { className: "ds:[&>div]:w-24", children: /* @__PURE__ */ e(Ds, { mood: "melt" }) }),
|
|
276
|
-
/* @__PURE__ */ e(
|
|
277
|
-
c,
|
|
278
|
-
{
|
|
279
|
-
id: o,
|
|
280
|
-
className: "type-title-card ds:text-[var(--foreground)]",
|
|
281
|
-
children: r
|
|
282
|
-
}
|
|
283
|
-
)
|
|
284
|
-
] }) }),
|
|
285
|
-
/* @__PURE__ */ e(h.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: m.map((t, R) => /* @__PURE__ */ e(
|
|
286
|
-
ds,
|
|
287
|
-
{
|
|
288
|
-
asChild: !0,
|
|
289
|
-
intent: "primary",
|
|
290
|
-
startIcon: t.icon,
|
|
291
|
-
className: "ds:min-h-[var(--min-target-size)] ds:w-full",
|
|
292
|
-
children: /* @__PURE__ */ e("a", { href: t.href, "data-action": "dev-login", children: t.label })
|
|
293
|
-
},
|
|
294
|
-
`${R}:${t.href}`
|
|
295
|
-
)) }) })
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
)
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
Gs.displayName = "LoginDevCard";
|
|
304
|
-
export {
|
|
305
|
-
$ as L,
|
|
306
|
-
Gs as a,
|
|
307
|
-
Hs as b
|
|
308
|
-
};
|
|
309
|
-
//# sourceMappingURL=login-dev-card-vEL-o5wq.js.map
|