@alfadocs/ui-kit-debug 1.78.0 → 1.80.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.
Files changed (214) hide show
  1. package/dist/_chunks/{address-fields-BUPRs3n-.js → address-fields-GnoSkvh6.js} +2 -2
  2. package/dist/_chunks/{address-fields-BUPRs3n-.js.map → address-fields-GnoSkvh6.js.map} +1 -1
  3. package/dist/_chunks/{anamnesis-summary-rows-vNDyE5HW.js → anamnesis-summary-rows-lONg-zja.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-rows-vNDyE5HW.js.map → anamnesis-summary-rows-lONg-zja.js.map} +1 -1
  5. package/dist/_chunks/{bishop-score-CdbU9Nl4.js → bishop-score-C5di6oAV.js} +2 -2
  6. package/dist/_chunks/{bishop-score-CdbU9Nl4.js.map → bishop-score-C5di6oAV.js.map} +1 -1
  7. package/dist/_chunks/{bmi-calculator-DnfiDh4Q.js → bmi-calculator-BIExHBZV.js} +2 -2
  8. package/dist/_chunks/{bmi-calculator-DnfiDh4Q.js.map → bmi-calculator-BIExHBZV.js.map} +1 -1
  9. package/dist/_chunks/{booking-Cz_QjIJe.js → booking-By4I_1A-.js} +1766 -1749
  10. package/dist/_chunks/booking-By4I_1A-.js.map +1 -0
  11. package/dist/_chunks/{calendar-appointment-editor-dialog-cvUpUjj-.js → calendar-appointment-editor-dialog-DhTTWgXw.js} +3 -3
  12. package/dist/_chunks/{calendar-appointment-editor-dialog-cvUpUjj-.js.map → calendar-appointment-editor-dialog-DhTTWgXw.js.map} +1 -1
  13. package/dist/_chunks/{cycle-calculator-HO3s5InI.js → cycle-calculator-CQkjVSD2.js} +2 -2
  14. package/dist/_chunks/{cycle-calculator-HO3s5InI.js.map → cycle-calculator-CQkjVSD2.js.map} +1 -1
  15. package/dist/_chunks/{due-date-calculator-CDWTSblh.js → due-date-calculator-NjTlmoFK.js} +2 -2
  16. package/dist/_chunks/{due-date-calculator-CDWTSblh.js.map → due-date-calculator-NjTlmoFK.js.map} +1 -1
  17. package/dist/_chunks/{fetal-weight-CrtBFJl-.js → fetal-weight-Brl3n4LN.js} +2 -2
  18. package/dist/_chunks/{fetal-weight-CrtBFJl-.js.map → fetal-weight-Brl3n4LN.js.map} +1 -1
  19. package/dist/_chunks/{forgot-password-form-BSOZVrZG.js → forgot-password-form-BQPvDS7i.js} +2 -2
  20. package/dist/_chunks/{forgot-password-form-BSOZVrZG.js.map → forgot-password-form-BQPvDS7i.js.map} +1 -1
  21. package/dist/_chunks/form-field-CyHfOVKF.js +185 -0
  22. package/dist/_chunks/form-field-CyHfOVKF.js.map +1 -0
  23. package/dist/_chunks/{gestational-age-calculator-CTHeJJdb.js → gestational-age-calculator-Dr9hdDta.js} +2 -2
  24. package/dist/_chunks/{gestational-age-calculator-CTHeJJdb.js.map → gestational-age-calculator-Dr9hdDta.js.map} +1 -1
  25. package/dist/_chunks/{hcg-doubling-BBk-a33g.js → hcg-doubling-K41Wy7LB.js} +2 -2
  26. package/dist/_chunks/{hcg-doubling-BBk-a33g.js.map → hcg-doubling-K41Wy7LB.js.map} +1 -1
  27. package/dist/_chunks/{help-me-write-templates-Ds1FY-WY.js → help-me-write-templates-BJSf24xS.js} +2 -2
  28. package/dist/_chunks/{help-me-write-templates-Ds1FY-WY.js.map → help-me-write-templates-BJSf24xS.js.map} +1 -1
  29. package/dist/_chunks/key-round-DIgsnJSg.js +21 -0
  30. package/dist/_chunks/key-round-DIgsnJSg.js.map +1 -0
  31. package/dist/_chunks/{kit-extensions-sNTZWkoo.js → kit-extensions-a0G4COFH.js} +6 -6
  32. package/dist/_chunks/{kit-extensions-sNTZWkoo.js.map → kit-extensions-a0G4COFH.js.map} +1 -1
  33. package/dist/_chunks/login-dev-card-CvLHj-_N.js +353 -0
  34. package/dist/_chunks/login-dev-card-CvLHj-_N.js.map +1 -0
  35. package/dist/_chunks/{practice-results-BnY2EkzI.js → practice-results-CtOanuzZ.js} +659 -615
  36. package/dist/_chunks/practice-results-CtOanuzZ.js.map +1 -0
  37. package/dist/_chunks/{pregnancy-dating-JBAUbM40.js → pregnancy-dating-BHvfDxz4.js} +2 -2
  38. package/dist/_chunks/{pregnancy-dating-JBAUbM40.js.map → pregnancy-dating-BHvfDxz4.js.map} +1 -1
  39. package/dist/_chunks/{pregnancy-weight-gain--Bqv6AWu.js → pregnancy-weight-gain-BeQRxwdP.js} +2 -2
  40. package/dist/_chunks/{pregnancy-weight-gain--Bqv6AWu.js.map → pregnancy-weight-gain-BeQRxwdP.js.map} +1 -1
  41. package/dist/_chunks/{radiograph-panel.agent-DQh2SX8G.js → radiograph-panel.agent-BQ95uFCd.js} +2 -2
  42. package/dist/_chunks/{radiograph-panel.agent-DQh2SX8G.js.map → radiograph-panel.agent-BQ95uFCd.js.map} +1 -1
  43. package/dist/_chunks/registration-form-CNBfUduG.js +1337 -0
  44. package/dist/_chunks/registration-form-CNBfUduG.js.map +1 -0
  45. package/dist/_chunks/reset-password-form-Cf9QPEJu.js +367 -0
  46. package/dist/_chunks/reset-password-form-Cf9QPEJu.js.map +1 -0
  47. package/dist/_chunks/{send-registration-link-form-__DWY62q.js → send-registration-link-form-vTn1HxjA.js} +2 -2
  48. package/dist/_chunks/{send-registration-link-form-__DWY62q.js.map → send-registration-link-form-vTn1HxjA.js.map} +1 -1
  49. package/dist/_chunks/{task-editor-CRhfwP9T.js → task-editor-Cpw-NmND.js} +2 -2
  50. package/dist/_chunks/{task-editor-CRhfwP9T.js.map → task-editor-Cpw-NmND.js.map} +1 -1
  51. package/dist/_chunks/{unit-converter-D59L-gkf.js → unit-converter-BH5ueIhT.js} +2 -2
  52. package/dist/_chunks/{unit-converter-D59L-gkf.js.map → unit-converter-BH5ueIhT.js.map} +1 -1
  53. package/dist/_chunks/{voice-control-panel-DQJwe6_Q.js → voice-control-panel-BziKE-KK.js} +2 -2
  54. package/dist/_chunks/{voice-control-panel-DQJwe6_Q.js.map → voice-control-panel-BziKE-KK.js.map} +1 -1
  55. package/dist/_chunks/{workflow-webhook-action-BvVPZVpG.js → workflow-webhook-action-DulCpCRz.js} +96 -111
  56. package/dist/_chunks/workflow-webhook-action-DulCpCRz.js.map +1 -0
  57. package/dist/agent-catalog.json +91 -5
  58. package/dist/agent-i18n/en.json +11 -2
  59. package/dist/components/address-fields/index.js +1 -1
  60. package/dist/components/bishop-score/index.js +1 -1
  61. package/dist/components/bmi-calculator/index.js +1 -1
  62. package/dist/components/booking/booking-types.d.ts +16 -1
  63. package/dist/components/booking/booking-types.d.ts.map +1 -1
  64. package/dist/components/booking/booking.d.ts.map +1 -1
  65. package/dist/components/booking/cascade.d.ts +3 -0
  66. package/dist/components/booking/cascade.d.ts.map +1 -1
  67. package/dist/components/booking/details-form.d.ts +2 -0
  68. package/dist/components/booking/details-form.d.ts.map +1 -1
  69. package/dist/components/booking/index.js +1 -1
  70. package/dist/components/cycle-calculator/index.js +1 -1
  71. package/dist/components/due-date-calculator/index.js +1 -1
  72. package/dist/components/fetal-weight/index.js +1 -1
  73. package/dist/components/form-field/form-field.d.ts +6 -0
  74. package/dist/components/form-field/form-field.d.ts.map +1 -1
  75. package/dist/components/form-field/index.js +1 -1
  76. package/dist/components/gestational-age-calculator/index.js +1 -1
  77. package/dist/components/hcg-doubling/index.js +1 -1
  78. package/dist/components/index.d.ts +1 -0
  79. package/dist/components/index.d.ts.map +1 -1
  80. package/dist/components/practice-results/index.js +1 -1
  81. package/dist/components/practice-results/practice-results.d.ts +19 -2
  82. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  83. package/dist/components/pregnancy-dating/index.js +1 -1
  84. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  85. package/dist/components/radiograph-panel/index.js +1 -1
  86. package/dist/components/rich-text-editor/index.js +1 -1
  87. package/dist/components/task-editor/index.js +1 -1
  88. package/dist/components/unit-converter/index.js +1 -1
  89. package/dist/components/voice-control-panel/index.js +1 -1
  90. package/dist/i18n/locales/ar.d.ts +28 -0
  91. package/dist/i18n/locales/ar.d.ts.map +1 -1
  92. package/dist/i18n/locales/ar.js +30 -2
  93. package/dist/i18n/locales/ar.js.map +1 -1
  94. package/dist/i18n/locales/de.d.ts +28 -0
  95. package/dist/i18n/locales/de.d.ts.map +1 -1
  96. package/dist/i18n/locales/de.js +30 -2
  97. package/dist/i18n/locales/de.js.map +1 -1
  98. package/dist/i18n/locales/el.d.ts +28 -0
  99. package/dist/i18n/locales/el.d.ts.map +1 -1
  100. package/dist/i18n/locales/el.js +30 -2
  101. package/dist/i18n/locales/el.js.map +1 -1
  102. package/dist/i18n/locales/en.d.ts +28 -0
  103. package/dist/i18n/locales/en.d.ts.map +1 -1
  104. package/dist/i18n/locales/en.js +29 -1
  105. package/dist/i18n/locales/en.js.map +1 -1
  106. package/dist/i18n/locales/es.d.ts +28 -0
  107. package/dist/i18n/locales/es.d.ts.map +1 -1
  108. package/dist/i18n/locales/es.js +30 -2
  109. package/dist/i18n/locales/es.js.map +1 -1
  110. package/dist/i18n/locales/fr.d.ts +28 -0
  111. package/dist/i18n/locales/fr.d.ts.map +1 -1
  112. package/dist/i18n/locales/fr.js +30 -2
  113. package/dist/i18n/locales/fr.js.map +1 -1
  114. package/dist/i18n/locales/hi.d.ts +28 -0
  115. package/dist/i18n/locales/hi.d.ts.map +1 -1
  116. package/dist/i18n/locales/hi.js +30 -2
  117. package/dist/i18n/locales/hi.js.map +1 -1
  118. package/dist/i18n/locales/it.d.ts +28 -0
  119. package/dist/i18n/locales/it.d.ts.map +1 -1
  120. package/dist/i18n/locales/it.js +30 -2
  121. package/dist/i18n/locales/it.js.map +1 -1
  122. package/dist/i18n/locales/ja.d.ts +28 -0
  123. package/dist/i18n/locales/ja.d.ts.map +1 -1
  124. package/dist/i18n/locales/ja.js +30 -2
  125. package/dist/i18n/locales/ja.js.map +1 -1
  126. package/dist/i18n/locales/nl.d.ts +28 -0
  127. package/dist/i18n/locales/nl.d.ts.map +1 -1
  128. package/dist/i18n/locales/nl.js +30 -2
  129. package/dist/i18n/locales/nl.js.map +1 -1
  130. package/dist/i18n/locales/pl.d.ts +28 -0
  131. package/dist/i18n/locales/pl.d.ts.map +1 -1
  132. package/dist/i18n/locales/pl.js +30 -2
  133. package/dist/i18n/locales/pl.js.map +1 -1
  134. package/dist/i18n/locales/pt.d.ts +28 -0
  135. package/dist/i18n/locales/pt.d.ts.map +1 -1
  136. package/dist/i18n/locales/pt.js +30 -2
  137. package/dist/i18n/locales/pt.js.map +1 -1
  138. package/dist/i18n/locales/ro.d.ts +28 -0
  139. package/dist/i18n/locales/ro.d.ts.map +1 -1
  140. package/dist/i18n/locales/ro.js +30 -2
  141. package/dist/i18n/locales/ro.js.map +1 -1
  142. package/dist/i18n/locales/ru.d.ts +28 -0
  143. package/dist/i18n/locales/ru.d.ts.map +1 -1
  144. package/dist/i18n/locales/ru.js +30 -2
  145. package/dist/i18n/locales/ru.js.map +1 -1
  146. package/dist/i18n/locales/sq.d.ts +28 -0
  147. package/dist/i18n/locales/sq.d.ts.map +1 -1
  148. package/dist/i18n/locales/sq.js +30 -2
  149. package/dist/i18n/locales/sq.js.map +1 -1
  150. package/dist/i18n/locales/sv.d.ts +28 -0
  151. package/dist/i18n/locales/sv.d.ts.map +1 -1
  152. package/dist/i18n/locales/sv.js +30 -2
  153. package/dist/i18n/locales/sv.js.map +1 -1
  154. package/dist/i18n/locales/tr.d.ts +28 -0
  155. package/dist/i18n/locales/tr.d.ts.map +1 -1
  156. package/dist/i18n/locales/tr.js +30 -2
  157. package/dist/i18n/locales/tr.js.map +1 -1
  158. package/dist/i18n/locales/zh.d.ts +28 -0
  159. package/dist/i18n/locales/zh.d.ts.map +1 -1
  160. package/dist/i18n/locales/zh.js +30 -2
  161. package/dist/i18n/locales/zh.js.map +1 -1
  162. package/dist/index.js +90 -87
  163. package/dist/index.js.map +1 -1
  164. package/dist/locales/ar.json +30 -2
  165. package/dist/locales/de.json +30 -2
  166. package/dist/locales/el.json +30 -2
  167. package/dist/locales/en.json +29 -1
  168. package/dist/locales/es.json +30 -2
  169. package/dist/locales/fr.json +30 -2
  170. package/dist/locales/hi.json +30 -2
  171. package/dist/locales/it.json +30 -2
  172. package/dist/locales/ja.json +30 -2
  173. package/dist/locales/nl.json +30 -2
  174. package/dist/locales/pl.json +30 -2
  175. package/dist/locales/pt.json +30 -2
  176. package/dist/locales/ro.json +30 -2
  177. package/dist/locales/ru.json +30 -2
  178. package/dist/locales/sq.json +30 -2
  179. package/dist/locales/sv.json +30 -2
  180. package/dist/locales/tr.json +30 -2
  181. package/dist/locales/zh.json +30 -2
  182. package/dist/patterns/_shared/password-policy.d.ts +3 -0
  183. package/dist/patterns/_shared/password-policy.d.ts.map +1 -0
  184. package/dist/patterns/anamnesis/index.js +1 -1
  185. package/dist/patterns/calendar/index.js +1 -1
  186. package/dist/patterns/forgot-password-form/index.js +1 -1
  187. package/dist/patterns/help-me-write-templates/index.js +1 -1
  188. package/dist/patterns/login-form/index.js +1 -1
  189. package/dist/patterns/login-form/login-form.d.ts +24 -7
  190. package/dist/patterns/login-form/login-form.d.ts.map +1 -1
  191. package/dist/patterns/registration-form/index.d.ts +1 -1
  192. package/dist/patterns/registration-form/index.d.ts.map +1 -1
  193. package/dist/patterns/registration-form/index.js +1 -1
  194. package/dist/patterns/registration-form/registration-form.d.ts +27 -0
  195. package/dist/patterns/registration-form/registration-form.d.ts.map +1 -1
  196. package/dist/patterns/reset-password-form/index.d.ts +3 -0
  197. package/dist/patterns/reset-password-form/index.d.ts.map +1 -0
  198. package/dist/patterns/reset-password-form/index.js +6 -0
  199. package/dist/patterns/reset-password-form/index.js.map +1 -0
  200. package/dist/patterns/reset-password-form/reset-password-form.d.ts +108 -0
  201. package/dist/patterns/reset-password-form/reset-password-form.d.ts.map +1 -0
  202. package/dist/patterns/send-registration-link-form/index.js +1 -1
  203. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  204. package/dist/tokens.css +1 -1
  205. package/package.json +5 -1
  206. package/dist/_chunks/booking-Cz_QjIJe.js.map +0 -1
  207. package/dist/_chunks/form-field-Ani72sVY.js +0 -176
  208. package/dist/_chunks/form-field-Ani72sVY.js.map +0 -1
  209. package/dist/_chunks/login-dev-card-DRxTPkE9.js +0 -332
  210. package/dist/_chunks/login-dev-card-DRxTPkE9.js.map +0 -1
  211. package/dist/_chunks/practice-results-BnY2EkzI.js.map +0 -1
  212. package/dist/_chunks/registration-form-xORq2s4p.js +0 -1310
  213. package/dist/_chunks/registration-form-xORq2s4p.js.map +0 -1
  214. package/dist/_chunks/workflow-webhook-action-BvVPZVpG.js.map +0 -1
@@ -0,0 +1,353 @@
1
+ import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as ge, useId as M, useState as l, useEffect as le, useRef as ie } from "react";
3
+ import { useTranslation as Se } from "react-i18next";
4
+ import { c as E } from "./index-D2ZczOXr.js";
5
+ import { i as me, E as qe } from "./email-input-C7THAwh2.js";
6
+ import { B as pe } from "./button-DohK_Ak_.js";
7
+ import { C as Pe } from "./checkbox-BjDv-r3o.js";
8
+ import { C as v } from "./card-BA4Ig_kn.js";
9
+ import { E as je } from "./error-summary-mGxIyDAY.js";
10
+ import { F as ce } from "./form-field-CyHfOVKF.js";
11
+ import { P as ze } from "./password-input-BokZ_rnT.js";
12
+ import { i as De } from "./is-development-CLUAnsU7.js";
13
+ import { i as he } from "./safe-href-5dbsfbQn.js";
14
+ import { u as He } from "./use-state-backed-input-DhRQo6gM.js";
15
+ import { u as Oe, a as Te, A as $e, b as _e, d as O, E as Ge, c as Ue } from "./auth-form-parts-B3GWChvG.js";
16
+ import { u as We, b as Je, a as Ke } from "./use-registration-submit-CLGHxwoT.js";
17
+ import { M as Qe } from "./matrix-rain-sDOUUwZp.js";
18
+ import { a as Xe } from "./error-page-illustration-BdJLuMdV.js";
19
+ const $ = ["email", "password"], Ye = E(
20
+ "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"
21
+ ), ue = E("ds:w-full ds:max-w-[400px]"), Ze = E(
22
+ "ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]"
23
+ ), T = (r) => r && he(r) ? r : void 0, Ve = (r) => Object.values(r).some(Boolean), es = (r) => $.some((i) => !!r[i]), fe = (r) => $.find((i) => r[i]) ?? (r.form ? "password" : void 0), ss = ge(
24
+ ({
25
+ title: r,
26
+ description: i,
27
+ headingLevel: b = 1,
28
+ showLogo: I = !0,
29
+ logoMotion: k = "assemble",
30
+ children: w,
31
+ initialValues: o,
32
+ errors: u,
33
+ forgotPasswordHref: L,
34
+ showRememberMe: d = !1,
35
+ registerDoctorHref: C,
36
+ registerPatientHref: ve,
37
+ submitLabel: be,
38
+ submitting: we = !1,
39
+ onSubmit: B,
40
+ fieldNames: t,
41
+ action: xe,
42
+ hiddenFields: Fe,
43
+ devCard: _,
44
+ className: ye,
45
+ ...Me
46
+ }, Ee) => {
47
+ const { t: n } = Se("ui"), G = M(), R = M(), Ie = M(), A = (e) => `${Ie}-${e}`, m = t !== void 0, [g, N] = l(() => (o == null ? void 0 : o.email) ?? ""), [x, F] = l(""), [U, ke] = l(
48
+ () => (o == null ? void 0 : o.rememberMe) === !0
49
+ ), S = d || !!(t != null && t.rememberMe), W = m && S && !(t != null && t.rememberMe);
50
+ le(() => {
51
+ W && De() && console.warn(
52
+ "LoginForm: the remember-me box is shown but `fieldNames.rememberMe` is not set, so the server will not read it."
53
+ );
54
+ }, [W]);
55
+ const [Le, J] = l(() => ({ email: !!(o != null && o.email) })), [Ce, K] = l(!1), [Q, X] = l(
56
+ () => u ?? {}
57
+ ), Y = (e) => J(
58
+ (a) => a[e] ? a : { ...a, [e]: !0 }
59
+ ), Z = (e) => X(
60
+ (a) => a[e] ? { ...a, [e]: void 0 } : a
61
+ ), q = ie(null), P = ie(null), V = He(g, q), ee = () => {
62
+ F(""), J((e) => ({ ...e, password: !1 }));
63
+ }, se = () => {
64
+ var a, h;
65
+ const e = {
66
+ email: ((a = q.current) == null ? void 0 : a.value) ?? g,
67
+ password: ((h = P.current) == null ? void 0 : h.value) ?? x,
68
+ rememberMe: S && U
69
+ };
70
+ return e.email !== g && N(e.email), e.password !== x && F(e.password), e;
71
+ }, re = {
72
+ email: !me(g),
73
+ password: x === ""
74
+ }, ae = (e) => Ce || Le[e] === !0, Be = {
75
+ email: ae("email") && re.email ? n(g === "" ? "loginForm.emailRequired" : "inputs.email.invalid") : void 0,
76
+ password: ae("password") && re.password ? n("loginForm.passwordRequired") : void 0
77
+ }, y = (e) => Q[e] ?? Be[e], [oe] = l(
78
+ () => es(u ?? {})
79
+ ), c = We(
80
+ $,
81
+ y,
82
+ oe
83
+ ), [j, te] = l(() => {
84
+ const e = oe ? void 0 : fe(u ?? {});
85
+ return e ? { target: e } : null;
86
+ });
87
+ le(() => {
88
+ var e;
89
+ j && ((e = (j.target === "email" ? q : P).current) == null || e.focus());
90
+ }, [j]);
91
+ const ne = Je({
92
+ errors: u,
93
+ submitting: we,
94
+ native: m,
95
+ captcha: !1,
96
+ firstProblem: () => {
97
+ const e = se();
98
+ return me(e.email) ? e.password === "" ? "password" : void 0 : "email";
99
+ },
100
+ onRefused: (e) => {
101
+ K(!0), c.open(() => te({ target: e }));
102
+ },
103
+ // Only a React host gets here: a native post is the browser's own.
104
+ deliver: () => B == null ? void 0 : B(se()),
105
+ onAnswer: (e) => {
106
+ const a = e;
107
+ X(a), Ve(a) && (ee(), K(!1), c.open(() => {
108
+ const h = fe(a);
109
+ h && te({ target: h });
110
+ }));
111
+ },
112
+ // The page came back from the browser's cache as it was left: the
113
+ // password must not come back with it.
114
+ onRestore: ee
115
+ }), { busy: z } = ne, Re = Oe("LoginForm", m, xe), de = T(L), D = T(C), H = T(ve), Ae = Te(
116
+ "LoginForm",
117
+ m,
118
+ t,
119
+ Fe
120
+ ), p = Q.form, Ne = Ke(
121
+ p,
122
+ c.listed.length > 0
123
+ );
124
+ return /* @__PURE__ */ f(
125
+ "div",
126
+ {
127
+ ref: Ee,
128
+ ...Me,
129
+ "data-component": "login-form",
130
+ className: Ye({ className: ye }),
131
+ children: [
132
+ /* @__PURE__ */ s("div", { className: ue(), children: /* @__PURE__ */ s(v, { variant: "elevated", className: "ds:h-full", children: /* @__PURE__ */ f(v.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
133
+ /* @__PURE__ */ s(
134
+ $e,
135
+ {
136
+ id: G,
137
+ title: r ?? n("loginForm.title"),
138
+ description: i,
139
+ level: b,
140
+ showLogo: I,
141
+ logoMotion: k
142
+ }
143
+ ),
144
+ w ? /* @__PURE__ */ s(
145
+ "div",
146
+ {
147
+ "data-slot": "host-content",
148
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
149
+ children: w
150
+ }
151
+ ) : null,
152
+ /* @__PURE__ */ f(
153
+ "form",
154
+ {
155
+ noValidate: !0,
156
+ method: "post",
157
+ action: Re,
158
+ "aria-labelledby": G,
159
+ "aria-busy": z || void 0,
160
+ onSubmit: ne.handleSubmit,
161
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
162
+ children: [
163
+ /* @__PURE__ */ s(
164
+ je,
165
+ {
166
+ ref: c.ref,
167
+ headingLevel: b + 1,
168
+ "aria-describedby": p ? R : void 0,
169
+ errors: c.listed.map((e) => ({
170
+ field: e,
171
+ message: y(e) ?? "",
172
+ targetId: A(e)
173
+ }))
174
+ }
175
+ ),
176
+ p && /* @__PURE__ */ s(
177
+ _e,
178
+ {
179
+ id: R,
180
+ announce: Ne,
181
+ children: p
182
+ }
183
+ ),
184
+ /* @__PURE__ */ s(
185
+ ce,
186
+ {
187
+ id: A("email"),
188
+ label: n("loginForm.email"),
189
+ required: !0,
190
+ error: y("email"),
191
+ announceError: !c.lists("email"),
192
+ "data-field": "email",
193
+ children: /* @__PURE__ */ s(
194
+ qe,
195
+ {
196
+ ref: V.ref,
197
+ name: m ? t.email : "email",
198
+ autoComplete: "username",
199
+ disableBuiltInValidation: !0,
200
+ onChange: V.quiet((e) => {
201
+ N(e.target.value), Z("email");
202
+ }),
203
+ onBlur: (e) => {
204
+ N(e.target.value), e.target.value !== "" && Y("email");
205
+ }
206
+ }
207
+ )
208
+ }
209
+ ),
210
+ /* @__PURE__ */ s(
211
+ ce,
212
+ {
213
+ id: A("password"),
214
+ label: n("loginForm.password"),
215
+ required: !0,
216
+ error: y("password"),
217
+ announceError: !c.lists("password"),
218
+ "data-field": "password",
219
+ children: /* @__PURE__ */ s(
220
+ ze,
221
+ {
222
+ ref: P,
223
+ name: m ? t.password : "password",
224
+ autoComplete: "current-password",
225
+ "aria-describedby": p ? R : void 0,
226
+ value: x,
227
+ onChange: (e) => {
228
+ F(e.target.value), Z("password");
229
+ },
230
+ onBlur: (e) => {
231
+ F(e.target.value), e.target.value !== "" && Y("password");
232
+ }
233
+ }
234
+ )
235
+ }
236
+ ),
237
+ de && /* @__PURE__ */ s(
238
+ O,
239
+ {
240
+ href: de,
241
+ action: "forgot-password",
242
+ align: "end",
243
+ children: n("loginForm.forgot")
244
+ }
245
+ ),
246
+ S && /* @__PURE__ */ s("div", { "data-field": "remember-me", children: /* @__PURE__ */ s(
247
+ Pe,
248
+ {
249
+ name: m && t.rememberMe || "rememberMe",
250
+ checked: U,
251
+ onCheckedChange: (e) => ke(e === !0),
252
+ label: n("loginForm.rememberMe")
253
+ }
254
+ ) }),
255
+ /* @__PURE__ */ s(Ge, { fields: Ae }),
256
+ /* @__PURE__ */ s(
257
+ pe,
258
+ {
259
+ type: "submit",
260
+ intent: "primary",
261
+ size: "lg",
262
+ loading: z,
263
+ className: "ds:w-full",
264
+ "data-action": "submit",
265
+ children: be ?? n("loginForm.submit")
266
+ }
267
+ )
268
+ ]
269
+ }
270
+ ),
271
+ (D || H) && /* @__PURE__ */ f(
272
+ "div",
273
+ {
274
+ "data-slot": "register-links",
275
+ className: Ze(),
276
+ children: [
277
+ D && /* @__PURE__ */ s(O, { href: D, action: "register-doctor", children: n("signedOutHeader.registerDoctor") }),
278
+ H && /* @__PURE__ */ s(O, { href: H, action: "register-patient", children: n("signedOutHeader.registerPatient") })
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ s(Ue, { busy: z })
283
+ ] }) }) }),
284
+ _ ? /* @__PURE__ */ s("div", { className: ue(), children: _ }) : null
285
+ ]
286
+ }
287
+ );
288
+ }
289
+ );
290
+ ss.displayName = "LoginForm";
291
+ const rs = E("ds:h-full ds:w-full"), as = ge(
292
+ ({ title: r, options: i, headingLevel: b = 2, className: I, ...k }, w) => {
293
+ const o = M(), u = `h${b}`, L = i.filter((d) => he(d.href));
294
+ return /* @__PURE__ */ s(
295
+ "div",
296
+ {
297
+ ref: w,
298
+ ...k,
299
+ "data-component": "login-dev-card",
300
+ className: rs({ className: I }),
301
+ children: /* @__PURE__ */ f(
302
+ v,
303
+ {
304
+ variant: "elevated",
305
+ "aria-labelledby": o,
306
+ className: "ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden",
307
+ children: [
308
+ /* @__PURE__ */ s("div", { className: "ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]", children: /* @__PURE__ */ s(
309
+ Qe,
310
+ {
311
+ glyphs: "hex",
312
+ decay: "fast",
313
+ mask: "center",
314
+ maskRadius: "xl",
315
+ className: "ds:size-full"
316
+ }
317
+ ) }),
318
+ /* @__PURE__ */ s(v.Header, { className: "ds:relative ds:z-[1]", children: /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center", children: [
319
+ /* @__PURE__ */ s("div", { className: "ds:[&>div]:w-24", children: /* @__PURE__ */ s(Xe, { mood: "melt" }) }),
320
+ /* @__PURE__ */ s(
321
+ u,
322
+ {
323
+ id: o,
324
+ className: "type-title-card ds:text-[var(--foreground)]",
325
+ children: r
326
+ }
327
+ )
328
+ ] }) }),
329
+ /* @__PURE__ */ s(v.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ s("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: L.map((d, C) => /* @__PURE__ */ s(
330
+ pe,
331
+ {
332
+ asChild: !0,
333
+ intent: "primary",
334
+ startIcon: d.icon,
335
+ className: "ds:min-h-[var(--min-target-size)] ds:w-full",
336
+ children: /* @__PURE__ */ s("a", { href: d.href, "data-action": "dev-login", children: d.label })
337
+ },
338
+ `${C}:${d.href}`
339
+ )) }) })
340
+ ]
341
+ }
342
+ )
343
+ }
344
+ );
345
+ }
346
+ );
347
+ as.displayName = "LoginDevCard";
348
+ export {
349
+ $ as L,
350
+ as as a,
351
+ ss as b
352
+ };
353
+ //# sourceMappingURL=login-dev-card-CvLHj-_N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-dev-card-CvLHj-_N.js","sources":["../../src/patterns/login-form/login-form.tsx","../../src/patterns/login-form/login-dev-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* LoginForm — the sign-in card. */\n/* */\n/* One export for the card: the mark, the heading, email and password, */\n/* the way to a new password, the button and the ways to register. The */\n/* host keeps the page around it and every server rule. The card checks */\n/* what a browser can check, then hands the values to `onSubmit` or */\n/* posts a real form to the host's own field names. */\n/* */\n/* The email must be an email address. A server that also signs people */\n/* in by a username cannot use this card for those accounts. */\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 { Button } from '../../components/button';\nimport { Checkbox } from '../../components/checkbox';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { PasswordInput } from '../../components/password-input';\nimport { isDevelopment } from '../../components/_shared/is-development';\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 fields of the form, in the order they appear. */\nexport const LOGIN_FORM_FIELDS = ['email', 'password'] as const;\n\nexport type LoginFormField = (typeof LOGIN_FORM_FIELDS)[number];\n\n/** What `onSubmit` receives once both checks have passed. */\nexport interface LoginFormValues {\n email: string;\n password: string;\n /** True when the \"Remember me\" box is ticked. Always false when the\n * box is not shown. */\n rememberMe: boolean;\n}\n\n/** Values to show when the form opens. There is no password here, on\n * purpose: a password is never sent back to the browser. */\nexport type LoginFormInitialValues = Partial<\n Pick<LoginFormValues, 'email' | 'rememberMe'>\n>;\n\n/** Messages from the server, already translated: one per field, plus\n * `form` for a message about the whole form, such as \"the email or\n * password is incorrect\". */\nexport type LoginFormErrors = Partial<Record<LoginFormField | 'form', string>>;\n\n/** The host's own form field names, for a native form post. `email` and\n * `password` are needed: a field without a name is not posted.\n * `rememberMe` is optional and also turns the \"Remember me\" box on. */\nexport type LoginFormFieldNames = Record<LoginFormField, string> & {\n rememberMe?: string;\n};\n\nexport interface LoginFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Sign in to Alfadocs\". Pass it translated. */\n title?: string;\n /** A line under the heading. Pass it translated. */\n description?: string;\n /**\n * The heading's level. Default 1: a sign-in 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. With `false` the heading sits\n * at the start edge, for a host that shows its own logo.\n */\n showLogo?: boolean;\n /**\n * How the mark arrives when the card opens: its pieces come together\n * (`assemble`, the default), it turns once (`spin`), it beats\n * (`pulse`), or it is still (`none`). It plays once and rests, and\n * holds still under reduced motion and in the accessible themes.\n */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the fields, such as a notice\n * (\"You have been signed out\"). It sits outside the form, so nothing in\n * it is posted. Keep any heading inside it below the card's own level.\n */\n children?: ReactNode;\n /** The email to show when the form opens, such as the one last used,\n * and whether \"Remember me\" starts ticked (default false). Read once.\n * There is never an initial password. */\n initialValues?: LoginFormInitialValues;\n /**\n * Messages from the server, already translated. A field's message\n * shows on that field until the user changes it; `form` shows above\n * the fields.\n *\n * When messages arrive, the password is emptied and focus moves: to\n * the error summary at the top of the form, which lists each field\n * with a message, or, when only `form` says something, to the\n * password, which is then described by that message. The same happens\n * for messages present when the form opens (a page the server rendered\n * after a failed post).\n *\n * Never say which of the two values was wrong: one message for both.\n * Set `submitting` while you send, so the form also notices an answer\n * that says the same as the last one.\n */\n errors?: LoginFormErrors;\n /**\n * Adds \"Forgot password?\" under the password. A path on the same site,\n * or an address written in full (`https://…`). Anything else shows no\n * link. The same rule holds for the two addresses below.\n */\n forgotPasswordHref?: string;\n /**\n * Adds a \"Remember me on this computer\" box under the password, unticked\n * by default. Off unless you set this or name the box in\n * `fieldNames.rememberMe`. What \"remember\" means is the server's: the\n * kit only reports the box (`rememberMe` in `onSubmit`, or the posted\n * field).\n */\n showRememberMe?: boolean;\n /** Adds \"Register as a doctor\" under the button. */\n registerDoctorHref?: string;\n /** Adds \"Register as a patient\" under the button. */\n registerPatientHref?: string;\n /** Replaces the button's \"Sign in\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the values: 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 sign-in.\n */\n submitting?: boolean;\n /** For React hosts: called with the values once both checks have\n * passed. Not called when `fieldNames` is set. */\n onSubmit?: (values: LoginFormValues) => void;\n /**\n * For a native form post: the host's own field names, both of them,\n * e.g. `{ email: 'email', password: 'password' }`. When set, the inputs\n * carry these names and the browser posts the form. Add `rememberMe`\n * (e.g. `'_remember_me'`) to show the \"Remember me\" box: ticked, it posts\n * `<name>=on`; unticked, it posts nothing.\n */\n fieldNames?: LoginFormFieldNames;\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 token,\n * a return address. Not used with `onSubmit`. A name that is also one\n * of `fieldNames` is left out: the form's own field wins. The server\n * must check a return address itself: anyone can change a hidden input.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n /**\n * A second card beside the sign-in, the same height: the development\n * quick sign-in (`LoginDevCard`). Pass it only when the server says\n * this is a development environment: the kit never decides that\n * itself. The two sit side by side where there is room and stack on a\n * phone.\n */\n devCard?: ReactNode;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// The card is 400px wide at most, written in px: a host whose root font\n// size is not 16px would stretch or squeeze a width in rem.\nconst loginFormVariants = cva(\n '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',\n);\n\nconst columnVariants = cva('ds:w-full ds:max-w-[400px]');\n\n// The two ways to register, side by side where they fit. The row gap\n// keeps the links' 44px touch targets apart when they wrap.\nconst registerLinksVariants = cva(\n 'ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** An address a link may use, or nothing. */\nconst linkTo = (href: string | undefined): string | undefined =>\n href && isSafeHref(href) ? href : undefined;\n\nconst hasMessage = (errors: LoginFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst hasFieldMessage = (errors: LoginFormErrors): boolean =>\n LOGIN_FORM_FIELDS.some((field) => Boolean(errors[field]));\n\n/**\n * Where to send the user for a set of server messages: the first field\n * that has one. A message about the whole form sends them to the\n * password, the field they will have to type again.\n */\nconst focusTargetFor = (\n messages: LoginFormErrors,\n): LoginFormField | undefined =>\n LOGIN_FORM_FIELDS.find((field) => messages[field]) ??\n (messages.form ? 'password' : undefined);\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The sign-in card. Mount it on the login page, inside `SignedOutFrame`\n * or the host's own chrome.\n */\nexport const LoginForm = forwardRef<HTMLDivElement, LoginFormProps>(\n (\n {\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n initialValues,\n errors,\n forgotPasswordHref,\n showRememberMe = false,\n registerDoctorHref,\n registerPatientHref,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n devCard,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const formMessageId = useId();\n const fieldIdBase = useId();\n /** The id of a field's wrapper: where the summary's link leads. */\n const fieldId = (field: LoginFormField) => `${fieldIdBase}-${field}`;\n const native = fieldNames !== undefined;\n\n /* ------------------------------ State ----------------------------- */\n\n // Read once. The password always starts empty.\n const [email, setEmail] = useState(() => initialValues?.email ?? '');\n const [password, setPassword] = useState('');\n const [rememberMe, setRememberMe] = useState(\n () => initialValues?.rememberMe === true,\n );\n const rememberShown = showRememberMe || Boolean(fieldNames?.rememberMe);\n const rememberUnnamed = native && rememberShown && !fieldNames?.rememberMe;\n useEffect(() => {\n if (rememberUnnamed && isDevelopment()) {\n console.warn(\n 'LoginForm: the remember-me box is shown but `fieldNames.rememberMe` is not set, so the server will not read it.',\n );\n }\n }, [rememberUnnamed]);\n // A field the user has filled in and left. An email that arrives\n // filled in counts: a bad one is then flagged at once, with its\n // message. An empty field is not flagged for being passed through: a\n // keyboard user on the way to \"Forgot password?\" has made no mistake.\n // Its message waits for a submit.\n const [touched, setTouched] = useState<\n Partial<Record<LoginFormField, boolean>>\n >(() => ({ email: Boolean(initialValues?.email) }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<LoginFormErrors>(\n () => errors ?? {},\n );\n\n const leave = (field: LoginFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n // The server's message was about the old value.\n const forget = (field: LoginFormField) =>\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n\n const emailInput = useRef<HTMLInputElement>(null);\n const passwordInput = 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 const emptyPassword = () => {\n setPassword('');\n setTouched((previous) => ({ ...previous, password: false }));\n };\n /**\n * What the two inputs hold now. Read from the inputs, not from state:\n * a browser or a password manager can fill a field without telling\n * React, and the form must not refuse a field that is visibly filled.\n */\n const held = (): LoginFormValues => {\n const values: LoginFormValues = {\n email: emailInput.current?.value ?? email,\n password: passwordInput.current?.value ?? password,\n rememberMe: rememberShown && rememberMe,\n };\n if (values.email !== email) setEmail(values.email);\n if (values.password !== password) setPassword(values.password);\n return values;\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n /** What stops a submit, whether or not the message shows yet. The\n * password only has to be there: its rules are for a new password. */\n const invalid: Record<LoginFormField, boolean> = {\n email: !isEmail(email),\n password: password === '',\n };\n // A message shows once the user has filled in and left the field, or\n // tried to submit.\n const due = (field: LoginFormField) => submitted || touched[field] === true;\n const ownErrors: Record<LoginFormField, string | undefined> = {\n email:\n due('email') && invalid.email\n ? email === ''\n ? t('loginForm.emailRequired')\n : t('inputs.email.invalid')\n : undefined,\n password:\n due('password') && invalid.password\n ? t('loginForm.passwordRequired')\n : undefined,\n };\n const errorFor = (field: LoginFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n // Every field with a 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 [openedWithFieldMessage] = useState(() =>\n hasFieldMessage(errors ?? {}),\n );\n const summary = useErrorSummary(\n LOGIN_FORM_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n\n // Any other place focus goes: the password, when only the message\n // about the whole form says something. A new object for each request,\n // so asking twice for the same place moves focus twice. The effect runs\n // after the messages are drawn, so a screen reader lands on something\n // that already says what is wrong.\n const [focusRequest, setFocusRequest] = useState<{\n target: LoginFormField;\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n (focusRequest.target === 'email'\n ? emailInput\n : passwordInput\n ).current?.focus();\n }, [focusRequest]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<LoginFormField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () => {\n const values = held();\n if (!isEmail(values.email)) return 'email';\n return values.password === '' ? 'password' : undefined;\n },\n onRefused: (field) => {\n // Both messages now show, listed in the summary, which takes focus.\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () => onSubmit?.(held()),\n onAnswer: (answer) => {\n const next: LoginFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n // Never keep a password the server did not accept.\n emptyPassword();\n setSubmitted(false);\n // The summary when a field has a message, else the password.\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n // The page came back from the browser's cache as it was left: the\n // password must not come back with it.\n onRestore: emptyPassword,\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('LoginForm', native, action);\n const forgotLink = linkTo(forgotPasswordHref);\n const doctorLink = linkTo(registerDoctorHref);\n const patientLink = linkTo(registerPatientHref);\n const extraFields = useExtraFields(\n 'LoginForm',\n native,\n fieldNames,\n hiddenFields,\n );\n const formError = serverErrors.form;\n // Quiet while the summary lists a field: the summary reads it then.\n const formMessageAnnounce = useFormMessageAnnounce(\n formError,\n summary.listed.length > 0,\n );\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-form\"\n className={loginFormVariants({ className })}\n >\n <div className={columnVariants()}>\n <Card variant=\"elevated\" className=\"ds:h-full\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={title ?? t('loginForm.title')}\n description={description}\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 {/* Always POST, in both modes: should the script ever fail to\n run, the browser must not put a password in the address. */}\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={formError ? formMessageId : undefined}\n errors={summary.listed.map((field) => ({\n field,\n message: errorFor(field) ?? '',\n targetId: fieldId(field),\n }))}\n />\n\n {formError && (\n <AuthFormMessage\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {formError}\n </AuthFormMessage>\n )}\n\n <FormField\n id={fieldId('email')}\n label={t('loginForm.email')}\n required\n error={errorFor('email')}\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. `username` is the\n name browsers and password managers give the field\n that goes with `current-password`. */}\n <EmailInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n autoComplete=\"username\"\n disableBuiltInValidation\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n forget('email');\n })}\n onBlur={(event) => {\n // Whatever a browser filled in without saying so.\n setEmail(event.target.value);\n if (event.target.value !== '') leave('email');\n }}\n />\n </FormField>\n\n <FormField\n id={fieldId('password')}\n label={t('loginForm.password')}\n required\n error={errorFor('password')}\n announceError={!summary.lists('password')}\n data-field=\"password\"\n >\n {/* Described by the message above the fields when there is\n one: focus lands here after a refused sign-in, and a\n screen reader then reads why. */}\n <PasswordInput\n ref={passwordInput}\n name={native ? fieldNames.password : 'password'}\n autoComplete=\"current-password\"\n aria-describedby={formError ? formMessageId : undefined}\n value={password}\n onChange={(event) => {\n setPassword(event.target.value);\n forget('password');\n }}\n onBlur={(event) => {\n setPassword(event.target.value);\n if (event.target.value !== '') leave('password');\n }}\n />\n </FormField>\n\n {forgotLink && (\n <AuthTextLink\n href={forgotLink}\n action=\"forgot-password\"\n align=\"end\"\n >\n {t('loginForm.forgot')}\n </AuthTextLink>\n )}\n\n {rememberShown && (\n <div data-field=\"remember-me\">\n {/* No `value`: a ticked box posts `on`, which is what\n a server's remember-me reads. */}\n <Checkbox\n name={\n native\n ? fieldNames.rememberMe || 'rememberMe'\n : 'rememberMe'\n }\n checked={rememberMe}\n onCheckedChange={(next) => setRememberMe(next === true)}\n label={t('loginForm.rememberMe')}\n />\n </div>\n )}\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('loginForm.submit')}\n </Button>\n </form>\n\n {/* Outside the form: they lead to other pages and post\n nothing. The header's own labels, already translated. */}\n {(doctorLink || patientLink) && (\n <div\n data-slot=\"register-links\"\n className={registerLinksVariants()}\n >\n {doctorLink && (\n <AuthTextLink href={doctorLink} action=\"register-doctor\">\n {t('signedOutHeader.registerDoctor')}\n </AuthTextLink>\n )}\n {patientLink && (\n <AuthTextLink href={patientLink} action=\"register-patient\">\n {t('signedOutHeader.registerPatient')}\n </AuthTextLink>\n )}\n </div>\n )}\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </Card.Body>\n </Card>\n </div>\n {devCard ? <div className={columnVariants()}>{devCard}</div> : null}\n </div>\n );\n },\n);\nLoginForm.displayName = 'LoginForm';\n","/* -------------------------------------------------------------------- */\n/* LoginDevCard — the development quick sign-in card. */\n/* */\n/* A second card beside the login, for developers: one link per test */\n/* account the host's server can sign in. The kit only draws it. The */\n/* host decides whether it is rendered, supplies every word on it, and */\n/* its server must refuse the routes outside development. */\n/* -------------------------------------------------------------------- */\n\nimport { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { MatrixRain } from '../../components/matrix-rain';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { ErrorPageIllustration } from '../error-page/error-page-illustration';\n\nexport interface LoginDevOption {\n /** The link's text, e.g. \"Sign in as admin\". The host supplies it, so\n * the kit ships no text for a card that users never see. */\n label: string;\n /** The development-only route that signs the test account in. A path\n * on the same site, or an address written in full. */\n href: string;\n /** A Lucide icon for the link, passed bare: `<ShieldUser />`. */\n icon?: ReactNode;\n}\n\nexport interface LoginDevCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** The card's heading, e.g. \"Developer quick login\". */\n title: string;\n /** One link per test account. An option with an unsafe address is\n * left out. */\n options: readonly LoginDevOption[];\n /** The heading's level. Default 2, under the login's own heading. */\n headingLevel?: 2 | 3;\n}\n\n// As tall as the login beside it, so the two cards read as a pair.\nconst loginDevCardVariants = cva('ds:h-full ds:w-full');\n\n/**\n * The development quick sign-in card. Render it only when the server\n * says this is a development environment: it never checks the\n * environment itself. Pass it to `LoginForm` as `devCard`.\n */\nexport const LoginDevCard = forwardRef<HTMLDivElement, LoginDevCardProps>(\n ({ title, options, headingLevel = 2, className, ...rest }, ref) => {\n const titleId = useId();\n const Heading = `h${headingLevel}` as const;\n const links = options.filter((option) => isSafeHref(option.href));\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-dev-card\"\n className={loginDevCardVariants({ className })}\n >\n <Card\n variant=\"elevated\"\n aria-labelledby={titleId}\n className=\"ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden\"\n >\n {/* Code rain round the edges, clear in the middle so it never runs\n behind the links. MatrixRain holds still under reduced motion by\n itself; it does not know the accessible themes, so the rain is\n taken out there, like the kit's other decorative motion. */}\n <div className=\"ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]\">\n <MatrixRain\n glyphs=\"hex\"\n decay=\"fast\"\n mask=\"center\"\n maskRadius=\"xl\"\n className=\"ds:size-full\"\n />\n </div>\n <Card.Header className=\"ds:relative ds:z-[1]\">\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center\">\n {/* The melting mark from the error pages, at half its size\n there. */}\n <div className=\"ds:[&>div]:w-24\">\n <ErrorPageIllustration mood=\"melt\" />\n </div>\n <Heading\n id={titleId}\n className=\"type-title-card ds:text-[var(--foreground)]\"\n >\n {title}\n </Heading>\n </div>\n </Card.Header>\n <Card.Body className=\"ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center\">\n {/* The top margin keeps the heading clear of the links when the\n cards stack and this one is only as tall as its content. */}\n <div className=\"ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {links.map((option, index) => (\n <Button\n // Two options may share an address, so the place in the\n // list is part of the key.\n key={`${index}:${option.href}`}\n asChild\n intent=\"primary\"\n startIcon={option.icon}\n className=\"ds:min-h-[var(--min-target-size)] ds:w-full\"\n >\n <a href={option.href} data-action=\"dev-login\">\n {option.label}\n </a>\n </Button>\n ))}\n </div>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nLoginDevCard.displayName = 'LoginDevCard';\n"],"names":["LOGIN_FORM_FIELDS","loginFormVariants","cva","columnVariants","registerLinksVariants","linkTo","href","isSafeHref","hasMessage","errors","hasFieldMessage","field","focusTargetFor","messages","LoginForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","children","initialValues","forgotPasswordHref","showRememberMe","registerDoctorHref","registerPatientHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","devCard","className","rest","ref","t","useTranslation","titleId","useId","formMessageId","fieldIdBase","fieldId","native","email","setEmail","useState","password","setPassword","rememberMe","setRememberMe","rememberShown","rememberUnnamed","useEffect","isDevelopment","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","leave","previous","forget","emailInput","useRef","passwordInput","emailField","useStateBackedInput","emptyPassword","held","values","_a","_b","invalid","isEmail","due","ownErrors","errorFor","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","forgotLink","doctorLink","patientLink","extraFields","useExtraFields","formError","formMessageAnnounce","useFormMessageAnnounce","jsxs","jsx","Card","AuthCardHeading","ErrorSummary","AuthFormMessage","FormField","EmailInput","event","PasswordInput","AuthTextLink","Checkbox","ExtraFields","Button","AuthFormStatus","loginDevCardVariants","LoginDevCard","options","Heading","links","option","MatrixRain","ErrorPageIllustration","index"],"mappings":";;;;;;;;;;;;;;;;;;AAyDO,MAAMA,IAAoB,CAAC,SAAS,UAAU,GAuJ/CC,KAAoBC;AAAA,EACxB;AACF,GAEMC,KAAiBD,EAAI,4BAA4B,GAIjDE,KAAwBF;AAAA,EAC5B;AACF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