@alfadocs/ui-kit-debug 1.112.2 → 1.113.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/{calendar-appointment-editor-dialog-FvdoKZ54.js → calendar-appointment-editor-dialog-CaZm5wGR.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-FvdoKZ54.js.map → calendar-appointment-editor-dialog-CaZm5wGR.js.map} +1 -1
- package/dist/_chunks/email-input-DxwbREpx.js +156 -0
- package/dist/_chunks/email-input-DxwbREpx.js.map +1 -0
- package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js → forgot-password-form-YQVzSskq.js} +8 -7
- package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js.map → forgot-password-form-YQVzSskq.js.map} +1 -1
- package/dist/_chunks/isEmail-BfVspSvV.js +248 -0
- package/dist/_chunks/isEmail-BfVspSvV.js.map +1 -0
- package/dist/_chunks/{login-dev-card-Cz1Clugq.js → login-dev-card-B6-zCFq3.js} +47 -46
- package/dist/_chunks/{login-dev-card-Cz1Clugq.js.map → login-dev-card-B6-zCFq3.js.map} +1 -1
- package/dist/_chunks/{patient-details-BwkDIm4D.js → patient-details-RsT3SaYh.js} +2 -2
- package/dist/_chunks/{patient-details-BwkDIm4D.js.map → patient-details-RsT3SaYh.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-CBba7w9V.js → patient-field-row-D9rb-QJH.js} +2 -2
- package/dist/_chunks/{patient-field-row-CBba7w9V.js.map → patient-field-row-D9rb-QJH.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DtYTo9w_.js → patient-summary-card-BjZErlbt.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DtYTo9w_.js.map → patient-summary-card-BjZErlbt.js.map} +1 -1
- package/dist/_chunks/{practice-results-BOpaPaav.js → practice-results-BByRCIuR.js} +620 -566
- package/dist/_chunks/practice-results-BByRCIuR.js.map +1 -0
- package/dist/_chunks/{registration-form-DEyUFysm.js → registration-form-Cq5_OSIL.js} +7 -6
- package/dist/_chunks/{registration-form-DEyUFysm.js.map → registration-form-Cq5_OSIL.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-W_Zgj564.js → reserved.agent-BMkapgom.js} +2 -2
- package/dist/_chunks/{reserved.agent-W_Zgj564.js.map → reserved.agent-BMkapgom.js.map} +1 -1
- package/dist/_chunks/{reset-password-form-B0acanDD.js → reset-password-form-BVsL2fOJ.js} +2 -2
- package/dist/_chunks/{reset-password-form-B0acanDD.js.map → reset-password-form-BVsL2fOJ.js.map} +1 -1
- package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js → send-registration-link-form-OgPomrZN.js} +8 -7
- package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js.map → send-registration-link-form-OgPomrZN.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-DYyCYI9f.js → use-appointment-details-read-DvK7Looa.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-DYyCYI9f.js.map → use-appointment-details-read-DvK7Looa.js.map} +1 -1
- package/dist/_chunks/verify-identity-types-C85EXNzy.js +707 -0
- package/dist/_chunks/verify-identity-types-C85EXNzy.js.map +1 -0
- package/dist/agent-catalog.json +106 -2
- package/dist/agent-i18n/en.json +11 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +28 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/i18n/locales/ar.d.ts +67 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +68 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +67 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +68 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +67 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +68 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +67 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +67 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +67 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +68 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +67 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +68 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +67 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +68 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +67 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +68 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +67 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +68 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +67 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +68 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +67 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +68 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +67 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +68 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +67 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +68 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +67 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +68 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +67 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +68 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +67 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +68 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +67 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +68 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +67 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +68 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +345 -340
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +68 -1
- package/dist/locales/de.json +68 -1
- package/dist/locales/el.json +68 -1
- package/dist/locales/en.json +67 -0
- package/dist/locales/es.json +68 -1
- package/dist/locales/fr.json +68 -1
- package/dist/locales/hi.json +68 -1
- package/dist/locales/it.json +68 -1
- package/dist/locales/ja.json +68 -1
- package/dist/locales/nl.json +68 -1
- package/dist/locales/pl.json +68 -1
- package/dist/locales/pt.json +68 -1
- package/dist/locales/ro.json +68 -1
- package/dist/locales/ru.json +68 -1
- package/dist/locales/sq.json +68 -1
- package/dist/locales/sv.json +68 -1
- package/dist/locales/tr.json +68 -1
- package/dist/locales/zh.json +68 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/reset-password-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/patterns/verify-identity/change-email-dialog.d.ts +26 -0
- package/dist/patterns/verify-identity/change-email-dialog.d.ts.map +1 -0
- package/dist/patterns/verify-identity/index.d.ts +7 -0
- package/dist/patterns/verify-identity/index.d.ts.map +1 -0
- package/dist/patterns/verify-identity/index.js +8 -0
- package/dist/patterns/verify-identity/index.js.map +1 -0
- package/dist/patterns/verify-identity/use-countdown.d.ts +12 -0
- package/dist/patterns/verify-identity/use-countdown.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity-steps.d.ts +21 -0
- package/dist/patterns/verify-identity/verify-identity-steps.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity-types.d.ts +47 -0
- package/dist/patterns/verify-identity/verify-identity-types.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity.d.ts +54 -0
- package/dist/patterns/verify-identity/verify-identity.d.ts.map +1 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/email-input-BEO3vonE.js +0 -399
- package/dist/_chunks/email-input-BEO3vonE.js.map +0 -1
- package/dist/_chunks/practice-results-BOpaPaav.js.map +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { jsxs as R, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as U, useRef as T, useId as W, useState as V, useMemo as g, useEffect as X, useCallback as k } from "react";
|
|
3
|
+
import { useTranslation as Y } from "react-i18next";
|
|
4
|
+
import { i as N } from "./isEmail-BfVspSvV.js";
|
|
5
|
+
import { T as Z } from "./text-input-B6iAgCr3.js";
|
|
6
|
+
import { u as _ } from "./form-field-context-DtiROUJV.js";
|
|
7
|
+
import { c as $ } from "./compose-refs-C0k0tdqF.js";
|
|
8
|
+
import { u as C } from "./registry-DvAUVLHh.js";
|
|
9
|
+
import { C as ee } from "./circle-alert-rGDZ73Wh.js";
|
|
10
|
+
const te = {
|
|
11
|
+
id: "email-input",
|
|
12
|
+
capabilities: [],
|
|
13
|
+
state: {
|
|
14
|
+
value: {
|
|
15
|
+
type: "string",
|
|
16
|
+
descriptionKey: "ui.agent.emailInput.state.value",
|
|
17
|
+
description: "The current email address typed into the field.",
|
|
18
|
+
read: (t) => t.getValue()
|
|
19
|
+
},
|
|
20
|
+
isValid: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
descriptionKey: "ui.agent.emailInput.state.isValid",
|
|
23
|
+
description: "True when the value is non-empty AND parses as a valid email per RFC 5322.",
|
|
24
|
+
read: (t) => t.isValid()
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
actions: {},
|
|
28
|
+
domHooks: {
|
|
29
|
+
root: {
|
|
30
|
+
attr: "data-component",
|
|
31
|
+
value: "email-input",
|
|
32
|
+
description: 'Marks the EmailInput wrapper. The inline error element carries `role="alert"` when validation fails.'
|
|
33
|
+
},
|
|
34
|
+
instanceId: {
|
|
35
|
+
attr: "data-component-id",
|
|
36
|
+
sourceProp: "id",
|
|
37
|
+
description: "Sourced from the id prop, when provided."
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
function ie(t) {
|
|
42
|
+
return t.length === 0 ? !0 : N(t);
|
|
43
|
+
}
|
|
44
|
+
const re = U(
|
|
45
|
+
({
|
|
46
|
+
errorMessage: t,
|
|
47
|
+
onValidityChange: n,
|
|
48
|
+
disableBuiltInValidation: A = !1,
|
|
49
|
+
autoComplete: j = "email",
|
|
50
|
+
value: a,
|
|
51
|
+
defaultValue: d,
|
|
52
|
+
onChange: o,
|
|
53
|
+
onBlur: l,
|
|
54
|
+
id: c,
|
|
55
|
+
"aria-describedby": I,
|
|
56
|
+
"aria-invalid": x,
|
|
57
|
+
...F
|
|
58
|
+
}, M) => {
|
|
59
|
+
const { t: S } = Y("ui"), u = _(), p = T(null), H = $(M, p), m = W(), r = a !== void 0, [K, O] = V(() => typeof a == "string" ? a : typeof d == "string" ? d : ""), i = r ? String(a) : K, [f, z] = V(
|
|
60
|
+
() => i.length > 0
|
|
61
|
+
), v = g(
|
|
62
|
+
() => ie(i),
|
|
63
|
+
[i]
|
|
64
|
+
), D = !A && f && i.length > 0 && !v, y = T(null);
|
|
65
|
+
X(() => {
|
|
66
|
+
if (!f) return;
|
|
67
|
+
const e = i.length > 0 && v;
|
|
68
|
+
y.current !== e && (y.current = e, n == null || n(e));
|
|
69
|
+
}, [f, i, v, n]);
|
|
70
|
+
const P = k(
|
|
71
|
+
(e) => {
|
|
72
|
+
r || O(e.target.value), o == null || o(e);
|
|
73
|
+
},
|
|
74
|
+
[r, o]
|
|
75
|
+
), q = k(
|
|
76
|
+
(e) => {
|
|
77
|
+
z(!0), l == null || l(e);
|
|
78
|
+
},
|
|
79
|
+
[l]
|
|
80
|
+
), B = g(
|
|
81
|
+
() => ({
|
|
82
|
+
getValue: () => {
|
|
83
|
+
var e;
|
|
84
|
+
return ((e = p.current) == null ? void 0 : e.value) ?? "";
|
|
85
|
+
},
|
|
86
|
+
isValid: () => {
|
|
87
|
+
var w;
|
|
88
|
+
const e = ((w = p.current) == null ? void 0 : w.value) ?? "";
|
|
89
|
+
return e.length > 0 && N(e);
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
[]
|
|
93
|
+
);
|
|
94
|
+
C(te, B, c);
|
|
95
|
+
const s = D && t !== null && !u.invalid, b = u.describedBy || void 0, G = g(() => {
|
|
96
|
+
const e = [
|
|
97
|
+
I,
|
|
98
|
+
b,
|
|
99
|
+
s ? m : null
|
|
100
|
+
].filter(Boolean);
|
|
101
|
+
return e.length > 0 ? e.join(" ") : void 0;
|
|
102
|
+
}, [
|
|
103
|
+
I,
|
|
104
|
+
b,
|
|
105
|
+
s,
|
|
106
|
+
m
|
|
107
|
+
]), E = x === !0 || x === "true", J = s || t === null && E ? "error" : "default", L = s || u.invalid || E || void 0, Q = t !== void 0 ? t : S("inputs.email.invalid", "Enter a valid email address.");
|
|
108
|
+
return /* @__PURE__ */ R(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
"data-component": "email-input",
|
|
112
|
+
"data-component-id": c,
|
|
113
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ h(
|
|
116
|
+
Z,
|
|
117
|
+
{
|
|
118
|
+
...F,
|
|
119
|
+
ref: H,
|
|
120
|
+
id: c,
|
|
121
|
+
type: "email",
|
|
122
|
+
inputMode: "email",
|
|
123
|
+
autoComplete: j,
|
|
124
|
+
tone: J,
|
|
125
|
+
value: r ? i : void 0,
|
|
126
|
+
defaultValue: r ? void 0 : d,
|
|
127
|
+
onChange: P,
|
|
128
|
+
onBlur: q,
|
|
129
|
+
"aria-invalid": L,
|
|
130
|
+
"aria-describedby": G
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
s ? /* @__PURE__ */ R(
|
|
134
|
+
"p",
|
|
135
|
+
{
|
|
136
|
+
id: m,
|
|
137
|
+
role: "alert",
|
|
138
|
+
"data-slot": "email-input-error",
|
|
139
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ h(ee, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
|
|
142
|
+
/* @__PURE__ */ h("span", { children: Q })
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
) : null
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
re.displayName = "EmailInput";
|
|
152
|
+
export {
|
|
153
|
+
re as E,
|
|
154
|
+
te as e
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=email-input-DxwbREpx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-input-DxwbREpx.js","sources":["../../src/components/email-input/email-input.agent.ts","../../src/components/email-input/email-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — EmailInput. */\n/* */\n/* Presentational specialisation of TextInput — no actions of its own. */\n/* The handle re-exposes the underlying input's value-setter so agents */\n/* can drive the field through the normal TextInput contract without */\n/* needing to know it's wrapped. See `src/docs/26-agent-readiness.mdx` */\n/* for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\n/**\n * Curated agent handle for EmailInput. State stays scoped to the visible\n * value + the kit-derived validity flag; never PHI (per PRS §Security).\n */\nexport interface EmailInputHandle {\n /** Returns the current input value. */\n getValue: () => string;\n /** Returns whether the current value parses as a valid email (non-empty + RFC). */\n isValid: () => boolean;\n}\n\nexport const emailInputAgent: AgentAdapter<EmailInputHandle> = {\n id: 'email-input',\n capabilities: [],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.emailInput.state.value',\n description: 'The current email address typed into the field.',\n read: (handle) => handle.getValue(),\n },\n isValid: {\n type: 'boolean',\n descriptionKey: 'ui.agent.emailInput.state.isValid',\n description:\n 'True when the value is non-empty AND parses as a valid email per RFC 5322.',\n read: (handle) => handle.isValid(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'email-input',\n description:\n 'Marks the EmailInput wrapper. The inline error element carries `role=\"alert\"` when validation fails.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop, when provided.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type FocusEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert } from 'lucide-react';\n// Tree-shaken import — pulling `validator/lib/isEmail` instead of the\n// barrel keeps the bundle to ~3 KB. `import { isEmail } from 'validator'`\n// drags in ~50 KB of unused validators.\nimport isEmail from 'validator/lib/isEmail';\nimport { TextInput, type TextInputProps } from '../text-input';\nimport { useFormField } from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { emailInputAgent, type EmailInputHandle } from './email-input.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* */\n/* `type`, `inputMode`, and `tone` are baked in — the component decides */\n/* those itself. `autoComplete` is `email` unless a sign-in form asks */\n/* for `username`. `tone` is computed from the */\n/* validation state so consumers can never wedge it into an inconsistent*/\n/* visual signal. */\n/* ------------------------------------------------------------------ */\n\nexport interface EmailInputProps extends Omit<\n TextInputProps,\n 'type' | 'autoComplete' | 'inputMode' | 'tone'\n> {\n /**\n * Override the \"Enter a valid email address.\" error message. When omitted, the\n * translated default `t('inputs.email.invalid')` is used.\n *\n * Pass `null` when the host shows the message itself (a `FormField`\n * `error`, or its own element). The input then never marks itself\n * invalid: it turns red only when the host says so, through the\n * FormField's `error` or `aria-invalid`. `onValidityChange` still fires.\n */\n errorMessage?: ReactNode | null;\n /**\n * Called whenever the validation state flips. `valid` is `true` when\n * the value is non-empty AND parses as a valid email, `false`\n * otherwise. The callback fires on every blur AND on every change\n * after the first blur — never before the user has had a chance to\n * type something.\n */\n onValidityChange?: (valid: boolean) => void;\n /**\n * Skip the built-in validation entirely. The input behaves like a\n * plain `<TextInput type=\"email\">` — useful when the consumer is\n * wiring `FormField`'s `invalid` prop themselves, or running their\n * own schema validation (zod, react-hook-form). Default: `false`.\n */\n disableBuiltInValidation?: boolean;\n /**\n * Autocomplete hint. Default `email`. Use `username` on a sign-in form,\n * where the email is what the account is known by: browsers and\n * password managers pair `username` with `current-password`.\n */\n autoComplete?: 'email' | 'username';\n}\n\n/* ------------------------------------------------------------------ */\n/* Validation engine */\n/* */\n/* Pure helper — empty values are NOT flagged (let `required` handle */\n/* empty separately). Whitespace-only values fall through to validator */\n/* which rejects them as malformed. */\n/* ------------------------------------------------------------------ */\n\nfunction checkValidity(value: string): boolean {\n if (value.length === 0) return true;\n return isEmail(value);\n}\n\nexport const EmailInput = forwardRef<HTMLInputElement, EmailInputProps>(\n (\n {\n errorMessage,\n onValidityChange,\n disableBuiltInValidation = false,\n autoComplete = 'email',\n value,\n defaultValue,\n onChange,\n onBlur,\n id,\n 'aria-describedby': consumerDescribedBy,\n 'aria-invalid': consumerAriaInvalid,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n\n const innerRef = useRef<HTMLInputElement | null>(null);\n const composedRef = composeRefs(ref, innerRef);\n\n // An id of its own: the FormField's error element owns `ctx.errorId`.\n const errorElementId = useId();\n\n const isControlled = value !== undefined;\n\n // Seed once from controlled `value` or `defaultValue` so we can\n // validate an already-populated field at mount (e.g. server-side\n // rehydration). Recomputing on prop changes would defeat the React\n // \"defaultValue is initial only\" contract — we read it once via the\n // lazy initialiser and let `currentValue` track every change after.\n const [internalValue, setInternalValue] = useState<string>(() => {\n if (typeof value === 'string') return value;\n if (typeof defaultValue === 'string') return defaultValue;\n return '';\n });\n const currentValue = isControlled ? String(value) : internalValue;\n\n // `touched` flips to `true` on first blur, or immediately if the\n // field is seeded with a non-empty value (consumer is asking us to\n // validate something they already collected).\n const [touched, setTouched] = useState<boolean>(\n () => currentValue.length > 0,\n );\n\n const computedValid = useMemo(\n () => checkValidity(currentValue),\n [currentValue],\n );\n\n // The format fails only when the field has been touched AND the\n // value is non-empty AND the value fails RFC. Empty is always\n // \"not yet invalid\" — `required` covers the empty case separately.\n const formatInvalid =\n !disableBuiltInValidation &&\n touched &&\n currentValue.length > 0 &&\n !computedValid;\n\n // Notify consumers on every validity flip after the first blur.\n // Empty before first blur is reported as `true` so consumers don't\n // light up a \"valid\" indicator prematurely — we only fire after\n // touched so the first emission reflects user intent.\n const lastValidRef = useRef<boolean | null>(null);\n useEffect(() => {\n if (!touched) return;\n // Empty value after touch -> `valid` is `false` because the user\n // emptied a field they were editing. This mirrors the spec note\n // that empty is reported as `false` in `onValidityChange`.\n const nextValid = currentValue.length > 0 && computedValid;\n if (lastValidRef.current !== nextValid) {\n lastValidRef.current = nextValid;\n onValidityChange?.(nextValid);\n }\n }, [touched, currentValue, computedValid, onValidityChange]);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) {\n setInternalValue(event.target.value);\n }\n onChange?.(event);\n },\n [isControlled, onChange],\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setTouched(true);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n /* ------------------------------------------------------------------ */\n /* Agent adapter */\n /* ------------------------------------------------------------------ */\n\n // Stable handle — both `getValue` and `isValid` read the live DOM\n // node, so the closure captures no React state. Empty dep array\n // keeps the agent registry from churning on every keystroke.\n const agentHandle = useMemo<EmailInputHandle>(\n () => ({\n getValue: () => innerRef.current?.value ?? '',\n isValid: () => {\n const v = innerRef.current?.value ?? '';\n return v.length > 0 && isEmail(v);\n },\n }),\n [],\n );\n useAgentRegistration(emailInputAgent, agentHandle, id);\n\n /* ------------------------------------------------------------------ */\n /* One message at a time */\n /* */\n /* A FormField `error` wins: its element is already in the context's */\n /* `describedBy`, so the inline message is not rendered beside it. With */\n /* `errorMessage={null}` the host owns the message, so the input never */\n /* looks invalid on its own account, with nothing to say why. */\n /* ------------------------------------------------------------------ */\n\n const showInlineError =\n formatInvalid && errorMessage !== null && !ctx.invalid;\n const contextDescribedBy = ctx.describedBy || undefined;\n const describedBy = useMemo(() => {\n const parts = [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError ? errorElementId : null,\n ].filter(Boolean) as string[];\n return parts.length > 0 ? parts.join(' ') : undefined;\n }, [\n consumerDescribedBy,\n contextDescribedBy,\n showInlineError,\n errorElementId,\n ]);\n\n // A wrapping consumer may assert invalidity for a BUSINESS reason while the\n // format is fine (e.g. \"already in use\") — honour it on the a11y attribute\n // so it's announced. Visual `tone` stays format-only, except when the\n // host owns the message: then its `aria-invalid` is the only signal.\n const consumerInvalid =\n consumerAriaInvalid === true || consumerAriaInvalid === 'true';\n const hostOwnsMessage = errorMessage === null;\n // The TextInput adds the FormField's own invalid tone.\n const effectiveTone =\n showInlineError || (hostOwnsMessage && consumerInvalid)\n ? 'error'\n : 'default';\n const effectiveAriaInvalid =\n showInlineError || ctx.invalid || consumerInvalid || undefined;\n\n const resolvedErrorMessage =\n errorMessage !== undefined\n ? errorMessage\n : t('inputs.email.invalid', 'Enter a valid email address.');\n\n return (\n <div\n data-component=\"email-input\"\n data-component-id={id}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n <TextInput\n {...rest}\n ref={composedRef}\n id={id}\n type=\"email\"\n inputMode=\"email\"\n autoComplete={autoComplete}\n tone={effectiveTone}\n value={isControlled ? currentValue : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n aria-invalid={effectiveAriaInvalid}\n aria-describedby={describedBy}\n />\n {showInlineError ? (\n <p\n id={errorElementId}\n role=\"alert\"\n data-slot=\"email-input-error\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-4 ds:shrink-0\" />\n <span>{resolvedErrorMessage}</span>\n </p>\n ) : null}\n </div>\n );\n },\n);\n\nEmailInput.displayName = 'EmailInput';\n"],"names":["emailInputAgent","handle","checkValidity","value","isEmail","EmailInput","forwardRef","errorMessage","onValidityChange","disableBuiltInValidation","autoComplete","defaultValue","onChange","onBlur","id","consumerDescribedBy","consumerAriaInvalid","rest","ref","t","useTranslation","ctx","useFormField","innerRef","useRef","composedRef","composeRefs","errorElementId","useId","isControlled","internalValue","setInternalValue","useState","currentValue","touched","setTouched","computedValid","useMemo","formatInvalid","lastValidRef","useEffect","nextValid","handleChange","useCallback","event","handleBlur","agentHandle","_a","v","useAgentRegistration","showInlineError","contextDescribedBy","describedBy","parts","consumerInvalid","effectiveTone","effectiveAriaInvalid","resolvedErrorMessage","jsxs","jsx","TextInput","CircleAlert"],"mappings":";;;;;;;;;AAuBO,MAAMA,KAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,IAEJ,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ;ACwBA,SAASC,GAAcC,GAAwB;AAC7C,SAAIA,EAAM,WAAW,IAAU,KACxBC,EAAQD,CAAK;AACtB;AAEO,MAAME,KAAaC;AAAA,EACxB,CACE;AAAA,IACE,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,0BAAAC,IAA2B;AAAA,IAC3B,cAAAC,IAAe;AAAA,IACf,OAAAP;AAAA,IACA,cAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,IAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,gBAAgBC;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,IAAI,GAC3BC,IAAMC,EAAA,GAENC,IAAWC,EAAgC,IAAI,GAC/CC,IAAcC,EAAYR,GAAK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,cACC,IAAI/B;AAAA,cACJ,MAAK;AAAA,cACL,aAAU;AAAA,cACV,WAAU;AAAA,cAEV,UAAA;AAAA,gBAAA,gBAAAgC,EAACE,IAAA,EAAY,eAAY,QAAO,WAAU,yBAAwB;AAAA,gBAClE,gBAAAF,EAAC,UAAM,UAAAF,EAAA,CAAqB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,IAE5B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEApD,GAAW,cAAc;"}
|
|
@@ -2,17 +2,18 @@ import { jsx as s, jsxs as g, Fragment as go } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as po, useId as f, useState as d, useRef as p, useEffect as H } from "react";
|
|
3
3
|
import { useTranslation as vo } from "react-i18next";
|
|
4
4
|
import { c as U } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { i as J
|
|
5
|
+
import { i as J } from "./isEmail-BfVspSvV.js";
|
|
6
6
|
import { A as P } from "./alert-C4WKViaS.js";
|
|
7
|
-
import { B as
|
|
7
|
+
import { B as Fo } from "./button-DohK_Ak_.js";
|
|
8
8
|
import { C as K } from "./card-C85_Ndhb.js";
|
|
9
|
+
import { E as ho } from "./email-input-DxwbREpx.js";
|
|
9
10
|
import { E as bo } from "./error-summary-DxNhwf_G.js";
|
|
10
11
|
import { F as wo } from "./form-field-CyHfOVKF.js";
|
|
11
12
|
import { i as xo } from "./safe-href-5dbsfbQn.js";
|
|
12
13
|
import { u as Eo } from "./use-state-backed-input-DhRQo6gM.js";
|
|
13
14
|
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-DVHfqnp6.js";
|
|
14
15
|
import { u as Bo, a as Mo, b as No } from "./use-registration-submit-CLGHxwoT.js";
|
|
15
|
-
const
|
|
16
|
+
const os = ["email"], Do = U(
|
|
16
17
|
"ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]"
|
|
17
18
|
), Oo = U(
|
|
18
19
|
"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]"
|
|
@@ -185,7 +186,7 @@ const Vo = ["email"], Do = U(
|
|
|
185
186
|
announceError: !l.lists("email"),
|
|
186
187
|
"data-field": "email",
|
|
187
188
|
children: /* @__PURE__ */ s(
|
|
188
|
-
|
|
189
|
+
ho,
|
|
189
190
|
{
|
|
190
191
|
ref: O.ref,
|
|
191
192
|
name: u ? b.email : "email",
|
|
@@ -204,7 +205,7 @@ const Vo = ["email"], Do = U(
|
|
|
204
205
|
),
|
|
205
206
|
/* @__PURE__ */ s(So, { fields: uo }),
|
|
206
207
|
/* @__PURE__ */ s(
|
|
207
|
-
|
|
208
|
+
Fo,
|
|
208
209
|
{
|
|
209
210
|
type: "submit",
|
|
210
211
|
intent: "primary",
|
|
@@ -228,7 +229,7 @@ const Vo = ["email"], Do = U(
|
|
|
228
229
|
);
|
|
229
230
|
_o.displayName = "ForgotPasswordForm";
|
|
230
231
|
export {
|
|
231
|
-
|
|
232
|
+
os as F,
|
|
232
233
|
_o as a
|
|
233
234
|
};
|
|
234
|
-
//# sourceMappingURL=forgot-password-form-
|
|
235
|
+
//# sourceMappingURL=forgot-password-form-YQVzSskq.js.map
|
package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js.map → forgot-password-form-YQVzSskq.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password-form-vfCO2-Tt.js","sources":["../../src/patterns/forgot-password-form/forgot-password-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* ForgotPasswordForm — the card that asks for a password reset link. */\n/* */\n/* One email field and a button, then a confirmation. The confirmation */\n/* is vague on purpose: it never says whether an account exists for the */\n/* address, and never repeats the address. The host sends the email and */\n/* owns every server rule; the card checks what a browser can check, */\n/* then hands the email to `onSubmit` or posts a real form. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\n// The validator EmailInput itself uses, so the two never disagree.\nimport isEmail from 'validator/lib/isEmail';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n AuthTextLink,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The form's one field. */\nexport const FORGOT_PASSWORD_FORM_FIELDS = ['email'] as const;\n\nexport type ForgotPasswordFormField =\n (typeof FORGOT_PASSWORD_FORM_FIELDS)[number];\n\n/** What `onSubmit` receives once the email has passed its check. */\nexport interface ForgotPasswordFormValues {\n email: string;\n}\n\n/** The email to show when the form opens. */\nexport type ForgotPasswordFormInitialValues = Partial<ForgotPasswordFormValues>;\n\n/** Messages from the server, already translated: one for the email,\n * plus `form` for a message about the whole form, such as \"too many\n * requests, try again later\". */\nexport type ForgotPasswordFormErrors = Partial<\n Record<ForgotPasswordFormField | 'form', string>\n>;\n\n/** The host's own form field name, for a native form post. It is needed:\n * a field without a name is not posted. */\nexport type ForgotPasswordFormFieldNames = Record<\n ForgotPasswordFormField,\n string\n>;\n\nexport interface ForgotPasswordFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Reset your password\". Pass it translated. */\n title?: string;\n /**\n * Replaces the line under the heading (\"Enter the email linked to your\n * account and we will send a reset link.\"). Pass it translated.\n */\n description?: string;\n /**\n * The heading's level. Default 1: this page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /**\n * Shows the Alfadocs mark above the heading, with the heading and its\n * line centred under it. Default true.\n */\n showLogo?: boolean;\n /** How the mark arrives when the card opens. Default `assemble`. It\n * plays once and rests. */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the field, such as a notice. It\n * sits outside the form, so nothing in it is posted.\n */\n children?: ReactNode;\n /** The email to show when the form opens. Read once. */\n initialValues?: ForgotPasswordFormInitialValues;\n /**\n * Messages from the server, already translated. The email's message\n * shows on the field until the user changes it; `form` shows above the\n * field. When messages arrive, focus moves to the error summary at the\n * top of the form when the email has a message, or to the message\n * above the field when only that says something.\n *\n * Do not use a message to say that no account has the address: that\n * tells a stranger who has an account. Show `sent` for every address.\n */\n errors?: ForgotPasswordFormErrors;\n /**\n * Shows the confirmation in place of the form: \"Check your inbox\". Set\n * it once the request has been accepted, whether or not an account\n * exists for the address. The confirmation says \"if an account exists\"\n * and never shows the address.\n */\n sent?: boolean;\n /**\n * Adds \"Back to sign in\" under the card's content. A path on the same\n * site, or an address written in full. Anything else shows no link.\n */\n loginHref?: string;\n /** Replaces the button's \"Send reset link\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the email: the button shows a spinner and\n * a second submit is ignored. Set it inside `onSubmit`, before anything\n * is awaited: until it is true, a second press sends a second request.\n */\n submitting?: boolean;\n /** For React hosts: called with the email once it has passed its\n * check. Not called when `fieldNames` is set. */\n onSubmit?: (values: ForgotPasswordFormValues) => void;\n /**\n * For a native form post: the host's own field name, e.g.\n * `{ email: 'email' }`. When set, the input carries that name and the\n * browser posts the form.\n */\n fieldNames?: ForgotPasswordFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed, and the post then goes to\n * the current address. Does nothing without `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF\n * token. Not used with `onSubmit`. A name that is also the one in\n * `fieldNames` is left out: the form's own field wins.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// 400px at most, in px: a host whose root font size is not 16px would\n// stretch or squeeze a width in rem.\nconst forgotPasswordFormVariants = cva(\n 'ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]',\n);\n\n// The confirmation takes focus when it appears, so it shows a ring.\nconst confirmationVariants = cva(\n '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]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\ntype FocusTarget = 'email' | 'form';\n\n/** The form's one field, as the error summary lists it. */\nconst FIELDS = ['email'] as const;\n\n/** The confirmation's heading, by the level of the card's own. */\nconst CONFIRMATION_HEADING = { 1: 'h2', 2: 'h3', 3: 'h4' } as const;\n\nconst hasMessage = (errors: ForgotPasswordFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst focusTargetFor = (\n messages: ForgotPasswordFormErrors,\n): FocusTarget | undefined =>\n messages.email ? 'email' : messages.form ? 'form' : undefined;\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The card that asks for a password reset link. Mount it on the\n * forgot-password page, inside `SignedOutFrame` or the host's own chrome.\n */\nexport const ForgotPasswordForm = forwardRef<\n HTMLDivElement,\n ForgotPasswordFormProps\n>(\n (\n {\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n initialValues,\n errors,\n sent = false,\n loginHref,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const sentTitleId = useId();\n const sentDescriptionId = useId();\n const emailFieldId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n\n /* ------------------------------ State ----------------------------- */\n\n const [email, setEmail] = useState(() => initialValues?.email ?? '');\n // True once the user has filled in the field and left it. An email\n // that arrives filled in counts: a bad one is then flagged at once,\n // with its message. An empty field is not flagged for being passed\n // through; its message waits for a submit.\n const [touched, setTouched] = useState(() => Boolean(initialValues?.email));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<ForgotPasswordFormErrors>(\n () => errors ?? {},\n );\n\n const emailInput = useRef<HTMLInputElement>(null);\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailField = useStateBackedInput(email, emailInput);\n /**\n * What the input holds now. Read from the input, not from state: a\n * browser can fill the field without telling React, and the form must\n * not refuse a field that is visibly filled.\n */\n const held = (): string => {\n const value = emailInput.current?.value ?? email;\n if (value !== email) setEmail(value);\n return value;\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n const invalid = !isEmail(email);\n // The message shows once the user has left the field or tried to\n // submit.\n const ownError =\n (submitted || touched) && invalid\n ? email === ''\n ? t('forgotPasswordForm.emailRequired')\n : t('inputs.email.invalid')\n : undefined;\n const emailError = serverErrors.email ?? ownError;\n\n /* ------------------------------ Focus ----------------------------- */\n\n const formMessage = useRef<HTMLDivElement>(null);\n const confirmation = useRef<HTMLDivElement>(null);\n\n // The email's message after a refused submit, or after a server\n // answer, is listed at the top of the form, and focus goes there. A\n // page the server rendered after a failed post opens that way too: it\n // announces nothing itself.\n const [openedWithEmailMessage] = useState(() => Boolean(errors?.email));\n const summary = useErrorSummary(\n FIELDS,\n () => emailError,\n openedWithEmailMessage,\n );\n // The message about the whole form: quiet while the summary lists the\n // email, because the summary reads it then.\n const formMessageAnnounce = useFormMessageAnnounce(\n serverErrors.form,\n summary.listed.length > 0,\n );\n\n // Any other place focus goes: the message above the field, when only\n // it says something. A new object for each request, so asking twice\n // for the same place moves focus twice.\n const [focusRequest, setFocusRequest] = useState<{\n target: FocusTarget;\n } | null>(() => {\n const target = openedWithEmailMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n (focusRequest.target === 'email'\n ? emailInput\n : formMessage\n ).current?.focus();\n }, [focusRequest]);\n\n // The form, and the button that had focus, are gone once the\n // confirmation shows. Move focus to it, so a keyboard or screen\n // reader user lands on what happened. Not on a page that opens\n // already sent: that one is read from the top like any other.\n const wasSent = useRef(sent);\n useEffect(() => {\n if (sent && !wasSent.current) confirmation.current?.focus();\n wasSent.current = sent;\n }, [sent]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<'email'>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () => (isEmail(held()) ? undefined : 'email'),\n onRefused: () => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: 'email' }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () => onSubmit?.({ email: held() }),\n onAnswer: (answer) => {\n const next: ForgotPasswordFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n setSubmitted(false);\n // The summary when the email has a message, else the message above.\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('ForgotPasswordForm', native, action);\n const loginLink =\n loginHref && isSafeHref(loginHref) ? loginHref : undefined;\n const extraFields = useExtraFields(\n 'ForgotPasswordForm',\n native,\n fieldNames,\n hiddenFields,\n );\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"forgot-password-form\"\n data-state={sent ? 'sent' : 'asking'}\n className={forgotPasswordFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={title ?? t('forgotPasswordForm.title')}\n // The instruction belongs to the form: once it is sent there\n // is nothing left to enter.\n description={\n sent\n ? undefined\n : (description ?? t('forgotPasswordForm.description'))\n }\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {sent ? (\n // Named and described, so a screen reader that lands here\n // reads the whole confirmation, not only \"status\".\n <Alert\n ref={confirmation}\n variant=\"success\"\n tabIndex={-1}\n aria-labelledby={sentTitleId}\n aria-describedby={sentDescriptionId}\n data-slot=\"confirmation\"\n className={confirmationVariants()}\n >\n {/* One level under the card's own heading. */}\n <Alert.Title\n id={sentTitleId}\n as={CONFIRMATION_HEADING[headingLevel]}\n >\n {t('forgotPasswordForm.sentTitle')}\n </Alert.Title>\n <Alert.Description id={sentDescriptionId}>\n {t('forgotPasswordForm.sentDescription')}\n </Alert.Description>\n </Alert>\n ) : (\n <>\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={\n serverErrors.form ? formMessageId : undefined\n }\n errors={summary.listed.map((field) => ({\n field,\n message: emailError ?? '',\n targetId: emailFieldId,\n }))}\n />\n\n {serverErrors.form && (\n <AuthFormMessage\n ref={formMessage}\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {serverErrors.form}\n </AuthFormMessage>\n )}\n\n <FormField\n id={emailFieldId}\n label={t('forgotPasswordForm.email')}\n required\n error={emailError}\n // Quiet while the summary lists it: the summary reads it.\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* One check, above, drives the message, the red mark and\n aria-invalid through FormField. EmailInput's own check\n is off so the two cannot disagree. */}\n <EmailInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n disableBuiltInValidation\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n // The server's message was about the old value.\n setServerErrors((previous) =>\n previous.email\n ? { ...previous, email: undefined }\n : previous,\n );\n })}\n onBlur={(event) => {\n // Whatever a browser filled in without saying so.\n setEmail(event.target.value);\n if (event.target.value !== '') setTouched(true);\n }}\n />\n </FormField>\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('forgotPasswordForm.submit')}\n </Button>\n </form>\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </>\n )}\n\n {loginLink && (\n <AuthTextLink href={loginLink} action=\"login\">\n {t('forgotPasswordForm.back')}\n </AuthTextLink>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nForgotPasswordForm.displayName = 'ForgotPasswordForm';\n"],"names":["FORGOT_PASSWORD_FORM_FIELDS","forgotPasswordFormVariants","cva","confirmationVariants","FIELDS","CONFIRMATION_HEADING","hasMessage","errors","focusTargetFor","messages","ForgotPasswordForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","children","initialValues","sent","loginHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","className","rest","ref","useTranslation","titleId","useId","sentTitleId","sentDescriptionId","emailFieldId","formMessageId","native","email","setEmail","useState","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","emailInput","useRef","emailField","useStateBackedInput","held","value","_a","invalid","isEmail","ownError","emailError","formMessage","confirmation","openedWithEmailMessage","summary","useErrorSummary","formMessageAnnounce","useFormMessageAnnounce","focusRequest","setFocusRequest","target","useEffect","wasSent","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","loginLink","isSafeHref","extraFields","useExtraFields","jsx","Card","AuthCardHeading","jsxs","Alert","Fragment","ErrorSummary","field","AuthFormMessage","FormField","EmailInput","event","previous","ExtraFields","Button","AuthFormStatus","AuthTextLink"],"mappings":";;;;;;;;;;;;;;AAoDO,MAAMA,KAA8B,CAAC,OAAO,GAuH7CC,KAA6BC;AAAA,EACjC;AACF,GAGMC,KAAuBD;AAAA,EAC3B;AACF,GASME,KAAS,CAAC,OAAO,GAGjBC,KAAuB,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,KAAA,GAE9CC,KAAa,CAACC,MAClB,OAAO,OAAOA,CAAM,EAAE,KAAK,OAAO,GAE9BC,IAAiB,CACrBC,MAEAA,EAAS,QAAQ,UAAUA,EAAS,OAAO,SAAS,QAUzCC,KAAqBC;AAAA,EAIhC,CACE;AAAA,IACE,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAX;AAAA,IACA,MAAAY,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,OACG;AACH,UAAM,EAAE,EAAA,IAAMC,GAAe,IAAI,GAC3BC,IAAUC,EAAA,GACVC,IAAcD,EAAA,GACdE,IAAoBF,EAAA,GACpBG,IAAeH,EAAA,GACfI,IAAgBJ,EAAA,GAChBK,IAASb,MAAe,QAIxB,CAACc,GAAO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BAGF,gBAAAX,EAACa,IAAA,EAAY,QAAQf,GAAA,CAAa;AAAA,kBAElC,gBAAAE;AAAA,oBAACc;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAASrB;AAAA,sBACT,WAAU;AAAA,sBACV,eAAY;AAAA,sBAEX,UAAArD,KAAe,EAAE,2BAA2B;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC/C;AAAA,cAAA;AAAA,YAAA;AAAA,YAIF,gBAAA4D,EAACe,MAAe,MAAAtB,EAAA,CAAY;AAAA,UAAA,GAC9B;AAAA,UAGDG,uBACEoB,IAAA,EAAa,MAAMpB,GAAW,QAAO,SACnC,UAAA,EAAE,yBAAyB,EAAA,CAC9B;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAnE,GAAmB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"forgot-password-form-YQVzSskq.js","sources":["../../src/patterns/forgot-password-form/forgot-password-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* ForgotPasswordForm — the card that asks for a password reset link. */\n/* */\n/* One email field and a button, then a confirmation. The confirmation */\n/* is vague on purpose: it never says whether an account exists for the */\n/* address, and never repeats the address. The host sends the email and */\n/* owns every server rule; the card checks what a browser can check, */\n/* then hands the email to `onSubmit` or posts a real form. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\n// The validator EmailInput itself uses, so the two never disagree.\nimport isEmail from 'validator/lib/isEmail';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n AuthTextLink,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The form's one field. */\nexport const FORGOT_PASSWORD_FORM_FIELDS = ['email'] as const;\n\nexport type ForgotPasswordFormField =\n (typeof FORGOT_PASSWORD_FORM_FIELDS)[number];\n\n/** What `onSubmit` receives once the email has passed its check. */\nexport interface ForgotPasswordFormValues {\n email: string;\n}\n\n/** The email to show when the form opens. */\nexport type ForgotPasswordFormInitialValues = Partial<ForgotPasswordFormValues>;\n\n/** Messages from the server, already translated: one for the email,\n * plus `form` for a message about the whole form, such as \"too many\n * requests, try again later\". */\nexport type ForgotPasswordFormErrors = Partial<\n Record<ForgotPasswordFormField | 'form', string>\n>;\n\n/** The host's own form field name, for a native form post. It is needed:\n * a field without a name is not posted. */\nexport type ForgotPasswordFormFieldNames = Record<\n ForgotPasswordFormField,\n string\n>;\n\nexport interface ForgotPasswordFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Reset your password\". Pass it translated. */\n title?: string;\n /**\n * Replaces the line under the heading (\"Enter the email linked to your\n * account and we will send a reset link.\"). Pass it translated.\n */\n description?: string;\n /**\n * The heading's level. Default 1: this page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /**\n * Shows the Alfadocs mark above the heading, with the heading and its\n * line centred under it. Default true.\n */\n showLogo?: boolean;\n /** How the mark arrives when the card opens. Default `assemble`. It\n * plays once and rests. */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the field, such as a notice. It\n * sits outside the form, so nothing in it is posted.\n */\n children?: ReactNode;\n /** The email to show when the form opens. Read once. */\n initialValues?: ForgotPasswordFormInitialValues;\n /**\n * Messages from the server, already translated. The email's message\n * shows on the field until the user changes it; `form` shows above the\n * field. When messages arrive, focus moves to the error summary at the\n * top of the form when the email has a message, or to the message\n * above the field when only that says something.\n *\n * Do not use a message to say that no account has the address: that\n * tells a stranger who has an account. Show `sent` for every address.\n */\n errors?: ForgotPasswordFormErrors;\n /**\n * Shows the confirmation in place of the form: \"Check your inbox\". Set\n * it once the request has been accepted, whether or not an account\n * exists for the address. The confirmation says \"if an account exists\"\n * and never shows the address.\n */\n sent?: boolean;\n /**\n * Adds \"Back to sign in\" under the card's content. A path on the same\n * site, or an address written in full. Anything else shows no link.\n */\n loginHref?: string;\n /** Replaces the button's \"Send reset link\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the email: the button shows a spinner and\n * a second submit is ignored. Set it inside `onSubmit`, before anything\n * is awaited: until it is true, a second press sends a second request.\n */\n submitting?: boolean;\n /** For React hosts: called with the email once it has passed its\n * check. Not called when `fieldNames` is set. */\n onSubmit?: (values: ForgotPasswordFormValues) => void;\n /**\n * For a native form post: the host's own field name, e.g.\n * `{ email: 'email' }`. When set, the input carries that name and the\n * browser posts the form.\n */\n fieldNames?: ForgotPasswordFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed, and the post then goes to\n * the current address. Does nothing without `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF\n * token. Not used with `onSubmit`. A name that is also the one in\n * `fieldNames` is left out: the form's own field wins.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// 400px at most, in px: a host whose root font size is not 16px would\n// stretch or squeeze a width in rem.\nconst forgotPasswordFormVariants = cva(\n 'ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]',\n);\n\n// The confirmation takes focus when it appears, so it shows a ring.\nconst confirmationVariants = cva(\n '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]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\ntype FocusTarget = 'email' | 'form';\n\n/** The form's one field, as the error summary lists it. */\nconst FIELDS = ['email'] as const;\n\n/** The confirmation's heading, by the level of the card's own. */\nconst CONFIRMATION_HEADING = { 1: 'h2', 2: 'h3', 3: 'h4' } as const;\n\nconst hasMessage = (errors: ForgotPasswordFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst focusTargetFor = (\n messages: ForgotPasswordFormErrors,\n): FocusTarget | undefined =>\n messages.email ? 'email' : messages.form ? 'form' : undefined;\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The card that asks for a password reset link. Mount it on the\n * forgot-password page, inside `SignedOutFrame` or the host's own chrome.\n */\nexport const ForgotPasswordForm = forwardRef<\n HTMLDivElement,\n ForgotPasswordFormProps\n>(\n (\n {\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n initialValues,\n errors,\n sent = false,\n loginHref,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const sentTitleId = useId();\n const sentDescriptionId = useId();\n const emailFieldId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n\n /* ------------------------------ State ----------------------------- */\n\n const [email, setEmail] = useState(() => initialValues?.email ?? '');\n // True once the user has filled in the field and left it. An email\n // that arrives filled in counts: a bad one is then flagged at once,\n // with its message. An empty field is not flagged for being passed\n // through; its message waits for a submit.\n const [touched, setTouched] = useState(() => Boolean(initialValues?.email));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<ForgotPasswordFormErrors>(\n () => errors ?? {},\n );\n\n const emailInput = useRef<HTMLInputElement>(null);\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailField = useStateBackedInput(email, emailInput);\n /**\n * What the input holds now. Read from the input, not from state: a\n * browser can fill the field without telling React, and the form must\n * not refuse a field that is visibly filled.\n */\n const held = (): string => {\n const value = emailInput.current?.value ?? email;\n if (value !== email) setEmail(value);\n return value;\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n const invalid = !isEmail(email);\n // The message shows once the user has left the field or tried to\n // submit.\n const ownError =\n (submitted || touched) && invalid\n ? email === ''\n ? t('forgotPasswordForm.emailRequired')\n : t('inputs.email.invalid')\n : undefined;\n const emailError = serverErrors.email ?? ownError;\n\n /* ------------------------------ Focus ----------------------------- */\n\n const formMessage = useRef<HTMLDivElement>(null);\n const confirmation = useRef<HTMLDivElement>(null);\n\n // The email's message after a refused submit, or after a server\n // answer, is listed at the top of the form, and focus goes there. A\n // page the server rendered after a failed post opens that way too: it\n // announces nothing itself.\n const [openedWithEmailMessage] = useState(() => Boolean(errors?.email));\n const summary = useErrorSummary(\n FIELDS,\n () => emailError,\n openedWithEmailMessage,\n );\n // The message about the whole form: quiet while the summary lists the\n // email, because the summary reads it then.\n const formMessageAnnounce = useFormMessageAnnounce(\n serverErrors.form,\n summary.listed.length > 0,\n );\n\n // Any other place focus goes: the message above the field, when only\n // it says something. A new object for each request, so asking twice\n // for the same place moves focus twice.\n const [focusRequest, setFocusRequest] = useState<{\n target: FocusTarget;\n } | null>(() => {\n const target = openedWithEmailMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n (focusRequest.target === 'email'\n ? emailInput\n : formMessage\n ).current?.focus();\n }, [focusRequest]);\n\n // The form, and the button that had focus, are gone once the\n // confirmation shows. Move focus to it, so a keyboard or screen\n // reader user lands on what happened. Not on a page that opens\n // already sent: that one is read from the top like any other.\n const wasSent = useRef(sent);\n useEffect(() => {\n if (sent && !wasSent.current) confirmation.current?.focus();\n wasSent.current = sent;\n }, [sent]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<'email'>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () => (isEmail(held()) ? undefined : 'email'),\n onRefused: () => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: 'email' }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () => onSubmit?.({ email: held() }),\n onAnswer: (answer) => {\n const next: ForgotPasswordFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n setSubmitted(false);\n // The summary when the email has a message, else the message above.\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('ForgotPasswordForm', native, action);\n const loginLink =\n loginHref && isSafeHref(loginHref) ? loginHref : undefined;\n const extraFields = useExtraFields(\n 'ForgotPasswordForm',\n native,\n fieldNames,\n hiddenFields,\n );\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"forgot-password-form\"\n data-state={sent ? 'sent' : 'asking'}\n className={forgotPasswordFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={title ?? t('forgotPasswordForm.title')}\n // The instruction belongs to the form: once it is sent there\n // is nothing left to enter.\n description={\n sent\n ? undefined\n : (description ?? t('forgotPasswordForm.description'))\n }\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {sent ? (\n // Named and described, so a screen reader that lands here\n // reads the whole confirmation, not only \"status\".\n <Alert\n ref={confirmation}\n variant=\"success\"\n tabIndex={-1}\n aria-labelledby={sentTitleId}\n aria-describedby={sentDescriptionId}\n data-slot=\"confirmation\"\n className={confirmationVariants()}\n >\n {/* One level under the card's own heading. */}\n <Alert.Title\n id={sentTitleId}\n as={CONFIRMATION_HEADING[headingLevel]}\n >\n {t('forgotPasswordForm.sentTitle')}\n </Alert.Title>\n <Alert.Description id={sentDescriptionId}>\n {t('forgotPasswordForm.sentDescription')}\n </Alert.Description>\n </Alert>\n ) : (\n <>\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={\n serverErrors.form ? formMessageId : undefined\n }\n errors={summary.listed.map((field) => ({\n field,\n message: emailError ?? '',\n targetId: emailFieldId,\n }))}\n />\n\n {serverErrors.form && (\n <AuthFormMessage\n ref={formMessage}\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {serverErrors.form}\n </AuthFormMessage>\n )}\n\n <FormField\n id={emailFieldId}\n label={t('forgotPasswordForm.email')}\n required\n error={emailError}\n // Quiet while the summary lists it: the summary reads it.\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* One check, above, drives the message, the red mark and\n aria-invalid through FormField. EmailInput's own check\n is off so the two cannot disagree. */}\n <EmailInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n disableBuiltInValidation\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n // The server's message was about the old value.\n setServerErrors((previous) =>\n previous.email\n ? { ...previous, email: undefined }\n : previous,\n );\n })}\n onBlur={(event) => {\n // Whatever a browser filled in without saying so.\n setEmail(event.target.value);\n if (event.target.value !== '') setTouched(true);\n }}\n />\n </FormField>\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('forgotPasswordForm.submit')}\n </Button>\n </form>\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </>\n )}\n\n {loginLink && (\n <AuthTextLink href={loginLink} action=\"login\">\n {t('forgotPasswordForm.back')}\n </AuthTextLink>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nForgotPasswordForm.displayName = 'ForgotPasswordForm';\n"],"names":["FORGOT_PASSWORD_FORM_FIELDS","forgotPasswordFormVariants","cva","confirmationVariants","FIELDS","CONFIRMATION_HEADING","hasMessage","errors","focusTargetFor","messages","ForgotPasswordForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","children","initialValues","sent","loginHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","className","rest","ref","useTranslation","titleId","useId","sentTitleId","sentDescriptionId","emailFieldId","formMessageId","native","email","setEmail","useState","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","emailInput","useRef","emailField","useStateBackedInput","held","value","_a","invalid","isEmail","ownError","emailError","formMessage","confirmation","openedWithEmailMessage","summary","useErrorSummary","formMessageAnnounce","useFormMessageAnnounce","focusRequest","setFocusRequest","target","useEffect","wasSent","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","loginLink","isSafeHref","extraFields","useExtraFields","jsx","Card","AuthCardHeading","jsxs","Alert","Fragment","ErrorSummary","field","AuthFormMessage","FormField","EmailInput","event","previous","ExtraFields","Button","AuthFormStatus","AuthTextLink"],"mappings":";;;;;;;;;;;;;;;AAoDO,MAAMA,KAA8B,CAAC,OAAO,GAuH7CC,KAA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;AAAA,UAAA,GAC9B;AAAA,UAGDG,uBACEoB,IAAA,EAAa,MAAMpB,GAAW,QAAO,SACnC,UAAA,EAAE,yBAAyB,EAAA,CAC9B;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAnE,GAAmB,cAAc;"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { g as K } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
2
|
+
var b = { exports: {} }, F = { exports: {} }, k;
|
|
3
|
+
function P() {
|
|
4
|
+
return k || (k = 1, (function(f, t) {
|
|
5
|
+
Object.defineProperty(t, "__esModule", {
|
|
6
|
+
value: !0
|
|
7
|
+
}), t.default = s;
|
|
8
|
+
function s(o) {
|
|
9
|
+
if (o == null) throw new TypeError("Expected a string but received a ".concat(o));
|
|
10
|
+
if (o.constructor.name !== "String") throw new TypeError("Expected a string but received a ".concat(o.constructor.name));
|
|
11
|
+
}
|
|
12
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
13
|
+
})(F, F.exports)), F.exports;
|
|
14
|
+
}
|
|
15
|
+
var w = { exports: {} }, L;
|
|
16
|
+
function V() {
|
|
17
|
+
return L || (L = 1, (function(f, t) {
|
|
18
|
+
Object.defineProperty(t, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), t.default = o;
|
|
21
|
+
function s(n) {
|
|
22
|
+
return Object.prototype.toString.call(n) === "[object RegExp]";
|
|
23
|
+
}
|
|
24
|
+
function o(n, l) {
|
|
25
|
+
for (var a = 0; a < l.length; a++) {
|
|
26
|
+
var r = l[a];
|
|
27
|
+
if (n === r || s(r) && r.test(n))
|
|
28
|
+
return !0;
|
|
29
|
+
}
|
|
30
|
+
return !1;
|
|
31
|
+
}
|
|
32
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
33
|
+
})(w, w.exports)), w.exports;
|
|
34
|
+
}
|
|
35
|
+
var q = { exports: {} }, U;
|
|
36
|
+
function Y() {
|
|
37
|
+
return U || (U = 1, (function(f, t) {
|
|
38
|
+
Object.defineProperty(t, "__esModule", {
|
|
39
|
+
value: !0
|
|
40
|
+
}), t.default = l;
|
|
41
|
+
var s = o(/* @__PURE__ */ P());
|
|
42
|
+
function o(a) {
|
|
43
|
+
return a && a.__esModule ? a : { default: a };
|
|
44
|
+
}
|
|
45
|
+
function n(a) {
|
|
46
|
+
"@babel/helpers - typeof";
|
|
47
|
+
return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
48
|
+
return typeof r;
|
|
49
|
+
} : function(r) {
|
|
50
|
+
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
51
|
+
}, n(a);
|
|
52
|
+
}
|
|
53
|
+
function l(a, r) {
|
|
54
|
+
(0, s.default)(a);
|
|
55
|
+
var e, _;
|
|
56
|
+
n(r) === "object" ? (e = r.min || 0, _ = r.max) : (e = arguments[1], _ = arguments[2]);
|
|
57
|
+
var g = encodeURI(a).split(/%..|./).length - 1;
|
|
58
|
+
return g >= e && (typeof _ > "u" || g <= _);
|
|
59
|
+
}
|
|
60
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
61
|
+
})(q, q.exports)), q.exports;
|
|
62
|
+
}
|
|
63
|
+
var S = { exports: {} }, E = { exports: {} }, z;
|
|
64
|
+
function B() {
|
|
65
|
+
return z || (z = 1, (function(f, t) {
|
|
66
|
+
Object.defineProperty(t, "__esModule", {
|
|
67
|
+
value: !0
|
|
68
|
+
}), t.default = o;
|
|
69
|
+
function s(n) {
|
|
70
|
+
"@babel/helpers - typeof";
|
|
71
|
+
return s = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
|
|
72
|
+
return typeof l;
|
|
73
|
+
} : function(l) {
|
|
74
|
+
return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
|
|
75
|
+
}, s(n);
|
|
76
|
+
}
|
|
77
|
+
function o() {
|
|
78
|
+
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = arguments.length > 1 ? arguments[1] : void 0;
|
|
79
|
+
(s(n) !== "object" || n === null) && (n = {});
|
|
80
|
+
for (var a in l)
|
|
81
|
+
typeof n[a] > "u" && (n[a] = l[a]);
|
|
82
|
+
return n;
|
|
83
|
+
}
|
|
84
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
85
|
+
})(E, E.exports)), E.exports;
|
|
86
|
+
}
|
|
87
|
+
var N;
|
|
88
|
+
function $() {
|
|
89
|
+
return N || (N = 1, (function(f, t) {
|
|
90
|
+
Object.defineProperty(t, "__esModule", {
|
|
91
|
+
value: !0
|
|
92
|
+
}), t.default = a;
|
|
93
|
+
var s = n(/* @__PURE__ */ P()), o = n(/* @__PURE__ */ B());
|
|
94
|
+
function n(r) {
|
|
95
|
+
return r && r.__esModule ? r : { default: r };
|
|
96
|
+
}
|
|
97
|
+
var l = {
|
|
98
|
+
require_tld: !0,
|
|
99
|
+
allow_underscores: !1,
|
|
100
|
+
allow_trailing_dot: !1,
|
|
101
|
+
allow_numeric_tld: !1,
|
|
102
|
+
allow_wildcard: !1,
|
|
103
|
+
ignore_max_length: !1
|
|
104
|
+
};
|
|
105
|
+
function a(r, e) {
|
|
106
|
+
(0, s.default)(r), e = (0, o.default)(e, l), e.allow_trailing_dot && r[r.length - 1] === "." && (r = r.substring(0, r.length - 1)), e.allow_wildcard === !0 && r.indexOf("*.") === 0 && (r = r.substring(2));
|
|
107
|
+
var _ = r.split("."), g = _[_.length - 1];
|
|
108
|
+
return e.require_tld && (_.length < 2 || !e.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(g) || /\s/.test(g)) || !e.allow_numeric_tld && /^\d+$/.test(g) ? !1 : _.every(function(i) {
|
|
109
|
+
return !(i.length > 63 && !e.ignore_max_length || !/^[a-z_\u00a1-\uffff0-9-]+$/i.test(i) || /[\uff01-\uff5e]/.test(i) || /^-|-$/.test(i) || !e.allow_underscores && /_/.test(i));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
113
|
+
})(S, S.exports)), S.exports;
|
|
114
|
+
}
|
|
115
|
+
var D = { exports: {} }, H;
|
|
116
|
+
function ee() {
|
|
117
|
+
return H || (H = 1, (function(f, t) {
|
|
118
|
+
Object.defineProperty(t, "__esModule", {
|
|
119
|
+
value: !0
|
|
120
|
+
}), t.default = g;
|
|
121
|
+
var s = o(/* @__PURE__ */ P());
|
|
122
|
+
function o(i) {
|
|
123
|
+
return i && i.__esModule ? i : { default: i };
|
|
124
|
+
}
|
|
125
|
+
function n(i) {
|
|
126
|
+
"@babel/helpers - typeof";
|
|
127
|
+
return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
|
|
128
|
+
return typeof v;
|
|
129
|
+
} : function(v) {
|
|
130
|
+
return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
|
|
131
|
+
}, n(i);
|
|
132
|
+
}
|
|
133
|
+
var l = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])", a = "(".concat(l, "[.]){3}").concat(l), r = new RegExp("^".concat(a, "$")), e = "(?:[0-9a-fA-F]{1,4})", _ = new RegExp("^(" + "(?:".concat(e, ":){7}(?:").concat(e, "|:)|") + "(?:".concat(e, ":){6}(?:").concat(a, "|:").concat(e, "|:)|") + "(?:".concat(e, ":){5}(?::").concat(a, "|(:").concat(e, "){1,2}|:)|") + "(?:".concat(e, ":){4}(?:(:").concat(e, "){0,1}:").concat(a, "|(:").concat(e, "){1,3}|:)|") + "(?:".concat(e, ":){3}(?:(:").concat(e, "){0,2}:").concat(a, "|(:").concat(e, "){1,4}|:)|") + "(?:".concat(e, ":){2}(?:(:").concat(e, "){0,3}:").concat(a, "|(:").concat(e, "){1,5}|:)|") + "(?:".concat(e, ":){1}(?:(:").concat(e, "){0,4}:").concat(a, "|(:").concat(e, "){1,6}|:)|") + "(?::((?::".concat(e, "){0,5}:").concat(a, "|(?::").concat(e, "){1,7}|:))") + ")(%[0-9a-zA-Z.]{1,})?$");
|
|
134
|
+
function g(i) {
|
|
135
|
+
var v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
136
|
+
(0, s.default)(i);
|
|
137
|
+
var p = (n(v) === "object" ? v.version : arguments[1]) || "";
|
|
138
|
+
return p ? p.toString() === "4" ? r.test(i) : p.toString() === "6" ? _.test(i) : !1 : g(i, {
|
|
139
|
+
version: 4
|
|
140
|
+
}) || g(i, {
|
|
141
|
+
version: 6
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
145
|
+
})(D, D.exports)), D.exports;
|
|
146
|
+
}
|
|
147
|
+
var Q;
|
|
148
|
+
function te() {
|
|
149
|
+
return Q || (Q = 1, (function(f, t) {
|
|
150
|
+
Object.defineProperty(t, "__esModule", {
|
|
151
|
+
value: !0
|
|
152
|
+
}), t.default = G;
|
|
153
|
+
var s = e(/* @__PURE__ */ P()), o = e(/* @__PURE__ */ V()), n = e(/* @__PURE__ */ Y()), l = e(/* @__PURE__ */ $()), a = e(/* @__PURE__ */ ee()), r = e(/* @__PURE__ */ B());
|
|
154
|
+
function e(c) {
|
|
155
|
+
return c && c.__esModule ? c : { default: c };
|
|
156
|
+
}
|
|
157
|
+
var _ = {
|
|
158
|
+
allow_display_name: !1,
|
|
159
|
+
allow_underscores: !1,
|
|
160
|
+
require_display_name: !1,
|
|
161
|
+
allow_utf8_local_part: !0,
|
|
162
|
+
require_tld: !0,
|
|
163
|
+
blacklisted_chars: "",
|
|
164
|
+
ignore_max_length: !1,
|
|
165
|
+
host_blacklist: [],
|
|
166
|
+
host_whitelist: []
|
|
167
|
+
}, g = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i, i = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i, v = /^[a-z\d]+$/, p = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i, W = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i, T = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i, X = 254;
|
|
168
|
+
function Z(c) {
|
|
169
|
+
var u = c.replace(/^"(.+)"$/, "$1");
|
|
170
|
+
if (!u.trim())
|
|
171
|
+
return !1;
|
|
172
|
+
var h = /[\.";<>]/.test(u);
|
|
173
|
+
if (h) {
|
|
174
|
+
if (u === c)
|
|
175
|
+
return !1;
|
|
176
|
+
var x = u.split('"').length === u.split('\\"').length;
|
|
177
|
+
if (!x)
|
|
178
|
+
return !1;
|
|
179
|
+
}
|
|
180
|
+
return !0;
|
|
181
|
+
}
|
|
182
|
+
function G(c, u) {
|
|
183
|
+
if ((0, s.default)(c), u = (0, r.default)(u, _), u.require_display_name || u.allow_display_name) {
|
|
184
|
+
var h = c.match(g);
|
|
185
|
+
if (h) {
|
|
186
|
+
var x = h[1];
|
|
187
|
+
if (c = c.replace(x, "").replace(/(^<|>$)/g, ""), x.endsWith(" ") && (x = x.slice(0, -1)), !Z(x))
|
|
188
|
+
return !1;
|
|
189
|
+
} else if (u.require_display_name)
|
|
190
|
+
return !1;
|
|
191
|
+
}
|
|
192
|
+
if (!u.ignore_max_length && c.length > X)
|
|
193
|
+
return !1;
|
|
194
|
+
var j = c.split("@"), m = j.pop(), y = m.toLowerCase();
|
|
195
|
+
if (u.host_blacklist.length > 0 && (0, o.default)(y, u.host_blacklist) || u.host_whitelist.length > 0 && !(0, o.default)(y, u.host_whitelist))
|
|
196
|
+
return !1;
|
|
197
|
+
var d = j.join("@");
|
|
198
|
+
if (u.domain_specific_validation && (y === "gmail.com" || y === "googlemail.com")) {
|
|
199
|
+
d = d.toLowerCase();
|
|
200
|
+
var M = d.split("+")[0];
|
|
201
|
+
if (!(0, n.default)(M.replace(/\./g, ""), {
|
|
202
|
+
min: 6,
|
|
203
|
+
max: 30
|
|
204
|
+
}))
|
|
205
|
+
return !1;
|
|
206
|
+
for (var A = M.split("."), I = 0; I < A.length; I++)
|
|
207
|
+
if (!v.test(A[I]))
|
|
208
|
+
return !1;
|
|
209
|
+
}
|
|
210
|
+
if (u.ignore_max_length === !1 && (!(0, n.default)(d, {
|
|
211
|
+
max: 64
|
|
212
|
+
}) || !(0, n.default)(m, {
|
|
213
|
+
max: 254
|
|
214
|
+
})))
|
|
215
|
+
return !1;
|
|
216
|
+
if (!(0, l.default)(m, {
|
|
217
|
+
require_tld: u.require_tld,
|
|
218
|
+
ignore_max_length: u.ignore_max_length,
|
|
219
|
+
allow_underscores: u.allow_underscores
|
|
220
|
+
})) {
|
|
221
|
+
if (!u.allow_ip_domain)
|
|
222
|
+
return !1;
|
|
223
|
+
if (!(0, a.default)(m)) {
|
|
224
|
+
if (!m.startsWith("[") || !m.endsWith("]"))
|
|
225
|
+
return !1;
|
|
226
|
+
var C = m.slice(1, -1);
|
|
227
|
+
if (C.length === 0 || !(0, a.default)(C))
|
|
228
|
+
return !1;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (u.blacklisted_chars && d.search(new RegExp("[".concat(u.blacklisted_chars, "]+"), "g")) !== -1)
|
|
232
|
+
return !1;
|
|
233
|
+
if (d[0] === '"' && d[d.length - 1] === '"')
|
|
234
|
+
return d = d.slice(1, d.length - 1), u.allow_utf8_local_part ? T.test(d) : p.test(d);
|
|
235
|
+
for (var J = u.allow_utf8_local_part ? W : i, O = d.split("."), R = 0; R < O.length; R++)
|
|
236
|
+
if (!J.test(O[R]))
|
|
237
|
+
return !1;
|
|
238
|
+
return !0;
|
|
239
|
+
}
|
|
240
|
+
f.exports = t.default, f.exports.default = t.default;
|
|
241
|
+
})(b, b.exports)), b.exports;
|
|
242
|
+
}
|
|
243
|
+
var re = /* @__PURE__ */ te();
|
|
244
|
+
const ne = /* @__PURE__ */ K(re);
|
|
245
|
+
export {
|
|
246
|
+
ne as i
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=isEmail-BfVspSvV.js.map
|