@alfadocs/ui-kit-debug 1.56.0 → 1.57.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/{ai-credits-notice-BoNJtOuE.js → ai-credits-notice-ktklr8fy.js} +2 -2
- package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js.map → ai-credits-notice-ktklr8fy.js.map} +1 -1
- package/dist/_chunks/ai-permission-notice-DyuEGwAt.js +206 -0
- package/dist/_chunks/ai-permission-notice-DyuEGwAt.js.map +1 -0
- package/dist/_chunks/alia-sidebar-BBKBJCv6.js +1284 -0
- package/dist/_chunks/alia-sidebar-BBKBJCv6.js.map +1 -0
- package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js → anamnesis-summary-rows-CCQ62mMN.js} +4 -4
- package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js.map → anamnesis-summary-rows-CCQ62mMN.js.map} +1 -1
- package/dist/_chunks/{appointment-peek-BIZaDeCi.js → appointment-peek-WvNbE4JG.js} +2 -2
- package/dist/_chunks/{appointment-peek-BIZaDeCi.js.map → appointment-peek-WvNbE4JG.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-DmqYEIT9.js → appointment-timeline-Z0494xO-.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DmqYEIT9.js.map → appointment-timeline-Z0494xO-.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js → balance-badge-cell-CII3SDmR.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js.map → balance-badge-cell-CII3SDmR.js.map} +1 -1
- package/dist/_chunks/{booking-WyNGKPE2.js → booking-81WnKDsH.js} +3 -3
- package/dist/_chunks/{booking-WyNGKPE2.js.map → booking-81WnKDsH.js.map} +1 -1
- package/dist/_chunks/{calculator-dialog-pCPWta7h.js → calculator-dialog-CzQv03p0.js} +2 -2
- package/dist/_chunks/{calculator-dialog-pCPWta7h.js.map → calculator-dialog-CzQv03p0.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-Du2ryaI-.js → calendar-workspace-D5-k_9zE.js} +13 -13
- package/dist/_chunks/{calendar-workspace-Du2ryaI-.js.map → calendar-workspace-D5-k_9zE.js.map} +1 -1
- package/dist/_chunks/{care-plan-card-Ddjh5Doc.js → care-plan-card-DxrRLRdW.js} +2 -2
- package/dist/_chunks/{care-plan-card-Ddjh5Doc.js.map → care-plan-card-DxrRLRdW.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-DUX_SVvF.js → care-plan-header-BMwZIgHJ.js} +2 -2
- package/dist/_chunks/{care-plan-header-DUX_SVvF.js.map → care-plan-header-BMwZIgHJ.js.map} +1 -1
- package/dist/_chunks/{chart-HsF1KHbx.js → chart-DQ5GxqgT.js} +347 -350
- package/dist/_chunks/chart-DQ5GxqgT.js.map +1 -0
- package/dist/_chunks/{clinical-note-card-14JIoUR0.js → clinical-note-card-hx939bvw.js} +2 -2
- package/dist/_chunks/{clinical-note-card-14JIoUR0.js.map → clinical-note-card-hx939bvw.js.map} +1 -1
- package/dist/_chunks/{color-picker-BRQ4Y9SO.js → color-picker-BsggJovx.js} +128 -123
- package/dist/_chunks/color-picker-BsggJovx.js.map +1 -0
- package/dist/_chunks/{contact-card-CmK05vNb.js → contact-card-fHBMwEsx.js} +2 -2
- package/dist/_chunks/{contact-card-CmK05vNb.js.map → contact-card-fHBMwEsx.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js → contact-profile-card-CMyBYgRR.js} +2 -2
- package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js.map → contact-profile-card-CMyBYgRR.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js → cycle-calculator-Cww9DzIa.js} +2 -2
- package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js.map → cycle-calculator-Cww9DzIa.js.map} +1 -1
- package/dist/_chunks/{data-table-D8fuhqO1.js → data-table-fAMTeAjM.js} +2 -2
- package/dist/_chunks/{data-table-D8fuhqO1.js.map → data-table-fAMTeAjM.js.map} +1 -1
- package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js → data-table-tabs-CHYAAeHy.js} +2 -2
- package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js.map → data-table-tabs-CHYAAeHy.js.map} +1 -1
- package/dist/_chunks/{date-picker-wRAcq2lt.js → date-picker-BSZuKo13.js} +69 -62
- package/dist/_chunks/date-picker-BSZuKo13.js.map +1 -0
- package/dist/_chunks/{date-range-picker-CtUOI38x.js → date-range-picker-CFk-5O3R.js} +176 -171
- package/dist/_chunks/date-range-picker-CFk-5O3R.js.map +1 -0
- package/dist/_chunks/{date-time-picker-CLeLKuv9.js → date-time-picker-CjxTkblD.js} +92 -85
- package/dist/_chunks/date-time-picker-CjxTkblD.js.map +1 -0
- package/dist/_chunks/{dialog-CUzbnKLw.js → dialog-Dn-iQ0Jp.js} +2 -2
- package/dist/_chunks/{dialog-CUzbnKLw.js.map → dialog-Dn-iQ0Jp.js.map} +1 -1
- package/dist/_chunks/{document-preview-uoTekVR7.js → document-preview-CHGGG0l_.js} +2 -2
- package/dist/_chunks/{document-preview-uoTekVR7.js.map → document-preview-CHGGG0l_.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-CSjklbyw.js → due-date-calculator-D_qFUiHp.js} +2 -2
- package/dist/_chunks/{due-date-calculator-CSjklbyw.js.map → due-date-calculator-D_qFUiHp.js.map} +1 -1
- package/dist/_chunks/{entity-summary-DcB0fIiv.js → entity-summary-CWcCSThK.js} +2 -2
- package/dist/_chunks/{entity-summary-DcB0fIiv.js.map → entity-summary-CWcCSThK.js.map} +1 -1
- package/dist/_chunks/{file-manager-Cc_uO8r2.js → file-manager-CFsL1KVt.js} +3 -3
- package/dist/_chunks/{file-manager-Cc_uO8r2.js.map → file-manager-CFsL1KVt.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js → gestational-age-calculator-CZi43xKG.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js.map → gestational-age-calculator-CZi43xKG.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js → hcg-doubling-Ccvh7OaU.js} +2 -2
- package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js.map → hcg-doubling-Ccvh7OaU.js.map} +1 -1
- package/dist/_chunks/{header-settings-ge_3gYEq.js → header-settings-BMcCx2LC.js} +2 -2
- package/dist/_chunks/{header-settings-ge_3gYEq.js.map → header-settings-BMcCx2LC.js.map} +1 -1
- package/dist/_chunks/{heatmap-Gf9r7Tn1.js → heatmap-BEeOThkW.js} +2 -2
- package/dist/_chunks/{heatmap-Gf9r7Tn1.js.map → heatmap-BEeOThkW.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-fV-Apf72.js → help-me-write-templates-BUoYGo6f.js} +2 -2
- package/dist/_chunks/{help-me-write-templates-fV-Apf72.js.map → help-me-write-templates-BUoYGo6f.js.map} +1 -1
- package/dist/_chunks/{hover-card-BnTueNS2.js → hover-card-U_ZYoh1n.js} +201 -187
- package/dist/_chunks/hover-card-U_ZYoh1n.js.map +1 -0
- package/dist/_chunks/{icon-picker-DWrqmI1c.js → icon-picker-C86lQTIA.js} +2 -2
- package/dist/_chunks/{icon-picker-DWrqmI1c.js.map → icon-picker-C86lQTIA.js.map} +1 -1
- package/dist/_chunks/{info-tip-B0jmIt6M.js → info-tip-CJpNpzZe.js} +2 -2
- package/dist/_chunks/{info-tip-B0jmIt6M.js.map → info-tip-CJpNpzZe.js.map} +1 -1
- package/dist/_chunks/{kit-extensions-Byfxy6sy.js → kit-extensions-DYVxWcqv.js} +4 -4
- package/dist/_chunks/{kit-extensions-Byfxy6sy.js.map → kit-extensions-DYVxWcqv.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-TeJNvymP.js → link-cell-renderer-CxW_oLa5.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-TeJNvymP.js.map → link-cell-renderer-CxW_oLa5.js.map} +1 -1
- package/dist/_chunks/link-gRw3NtOt.js +137 -0
- package/dist/_chunks/link-gRw3NtOt.js.map +1 -0
- package/dist/_chunks/{locale-picker-DfNSdOpy.js → locale-picker-BGfrZyTw.js} +2 -2
- package/dist/_chunks/{locale-picker-DfNSdOpy.js.map → locale-picker-BGfrZyTw.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Dcx-JEjg.js → marketplace-app-shell-BZcA9Z06.js} +143 -129
- package/dist/_chunks/marketplace-app-shell-BZcA9Z06.js.map +1 -0
- package/dist/_chunks/{message-tray-BB95DA82.js → message-tray-QKQutwxj.js} +76 -69
- package/dist/_chunks/message-tray-QKQutwxj.js.map +1 -0
- package/dist/_chunks/{nav-grid-BqCPH8sm.js → nav-grid-Byx8PxuB.js} +2 -2
- package/dist/_chunks/{nav-grid-BqCPH8sm.js.map → nav-grid-Byx8PxuB.js.map} +1 -1
- package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js +89 -0
- package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js.map +1 -0
- package/dist/_chunks/{note-attachment-I1NLoeRZ.js → note-attachment-Bt2cddsZ.js} +2 -2
- package/dist/_chunks/{note-attachment-I1NLoeRZ.js.map → note-attachment-Bt2cddsZ.js.map} +1 -1
- package/dist/_chunks/{note-timeline-CsY8YOE7.js → note-timeline-CX9nAgAR.js} +2 -2
- package/dist/_chunks/{note-timeline-CsY8YOE7.js.map → note-timeline-CX9nAgAR.js.map} +1 -1
- package/dist/_chunks/{notes-panel-DceRhthG.js → notes-panel-Cm4pttpl.js} +4 -4
- package/dist/_chunks/{notes-panel-DceRhthG.js.map → notes-panel-Cm4pttpl.js.map} +1 -1
- package/dist/_chunks/{notification-tray-__sJXnsz.js → notification-tray-C5VtbGjd.js} +83 -76
- package/dist/_chunks/notification-tray-C5VtbGjd.js.map +1 -0
- package/dist/_chunks/{patient-details-DsTtjpuX.js → patient-details-99kEdtc5.js} +2 -2
- package/dist/_chunks/{patient-details-DsTtjpuX.js.map → patient-details-99kEdtc5.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BvZ9luz-.js → patient-field-row-DkxY13T6.js} +5 -5
- package/dist/_chunks/{patient-field-row-BvZ9luz-.js.map → patient-field-row-DkxY13T6.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-9nQWTQf6.js → patient-summary-card-opdyfeW2.js} +4 -4
- package/dist/_chunks/{patient-summary-card-9nQWTQf6.js.map → patient-summary-card-opdyfeW2.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-CwDpwXUC.js → payment-request-card-DAniJNLX.js} +2 -2
- package/dist/_chunks/{payment-request-card-CwDpwXUC.js.map → payment-request-card-DAniJNLX.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-C3minW5b.js → pdf-viewer-CNQxa4tv.js} +396 -391
- package/dist/_chunks/pdf-viewer-CNQxa4tv.js.map +1 -0
- package/dist/_chunks/{phone-input-DxkHMYmu.js → phone-input-O9camxkq.js} +156 -151
- package/dist/_chunks/phone-input-O9camxkq.js.map +1 -0
- package/dist/_chunks/popover-BG75rYjN.js +367 -0
- package/dist/_chunks/popover-BG75rYjN.js.map +1 -0
- package/dist/_chunks/{practice-results-Dhbo-fc_.js → practice-results-CfRkjzsI.js} +2 -2
- package/dist/_chunks/{practice-results-Dhbo-fc_.js.map → practice-results-CfRkjzsI.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js → pregnancy-dating-BFzv9g1N.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js.map → pregnancy-dating-BFzv9g1N.js.map} +1 -1
- package/dist/_chunks/{product-hub-panel-BSSiGGG4.js → product-hub-panel-DlVRK7Ue.js} +103 -96
- package/dist/_chunks/product-hub-panel-DlVRK7Ue.js.map +1 -0
- package/dist/_chunks/{public-footer-CxpG6J1M.js → public-footer-ZWTEG1Rq.js} +2 -2
- package/dist/_chunks/{public-footer-CxpG6J1M.js.map → public-footer-ZWTEG1Rq.js.map} +1 -1
- package/dist/_chunks/{public-header.agent-pr2hyiND.js → public-header.agent-BctevbuY.js} +2 -2
- package/dist/_chunks/{public-header.agent-pr2hyiND.js.map → public-header.agent-BctevbuY.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js → radiograph-panel.agent-DyqbTECc.js} +4 -4
- package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js.map → radiograph-panel.agent-DyqbTECc.js.map} +1 -1
- package/dist/_chunks/{registration-form-D7iNqMBF.js → registration-form-BlTzYywa.js} +2 -2
- package/dist/_chunks/{registration-form-D7iNqMBF.js.map → registration-form-BlTzYywa.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-CkFfmA3v.js → rich-text-editor-DTnNZ4Ff.js} +489 -484
- package/dist/_chunks/rich-text-editor-DTnNZ4Ff.js.map +1 -0
- package/dist/_chunks/{sheet-C7SwIxwB.js → sheet-8qsiMoUI.js} +2 -2
- package/dist/_chunks/{sheet-C7SwIxwB.js.map → sheet-8qsiMoUI.js.map} +1 -1
- package/dist/_chunks/{sign-document-B6HlyCGV.js → sign-document-D4iHS_Ug.js} +2 -2
- package/dist/_chunks/{sign-document-B6HlyCGV.js.map → sign-document-D4iHS_Ug.js.map} +1 -1
- package/dist/_chunks/{signature-request-DhbpB9N9.js → signature-request-DRuYAG5I.js} +2 -2
- package/dist/_chunks/{signature-request-DhbpB9N9.js.map → signature-request-DRuYAG5I.js.map} +1 -1
- package/dist/_chunks/{signed-out-frame-B2GTIeqA.js → signed-out-frame-AhMsNW1r.js} +2 -2
- package/dist/_chunks/{signed-out-frame-B2GTIeqA.js.map → signed-out-frame-AhMsNW1r.js.map} +1 -1
- package/dist/_chunks/{task-editor-ByyRu29Y.js → task-editor-NkcopDna.js} +3 -3
- package/dist/_chunks/{task-editor-ByyRu29Y.js.map → task-editor-NkcopDna.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js → use-appointment-details-read-CfFQNOF_.js} +5 -5
- package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js.map → use-appointment-details-read-CfFQNOF_.js.map} +1 -1
- package/dist/_chunks/{voice-control-panel-Bg1eklL0.js → voice-control-panel-BKbgb7FM.js} +2 -2
- package/dist/_chunks/{voice-control-panel-Bg1eklL0.js.map → voice-control-panel-BKbgb7FM.js.map} +1 -1
- package/dist/_chunks/{widget-picker-DXYBMTfe.js → widget-picker-rBA7MR5P.js} +2 -2
- package/dist/_chunks/{widget-picker-DXYBMTfe.js.map → widget-picker-rBA7MR5P.js.map} +1 -1
- package/dist/agent-catalog.json +2 -2
- package/dist/components/_shared/non-modal-tab-exit.d.ts +15 -4
- package/dist/components/_shared/non-modal-tab-exit.d.ts.map +1 -1
- package/dist/components/ai-credits-notice/index.js +1 -1
- package/dist/components/ai-permission-notice/ai-permission-notice.d.ts +32 -0
- package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -1
- package/dist/components/ai-permission-notice/index.d.ts +1 -1
- package/dist/components/ai-permission-notice/index.d.ts.map +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/chart/chart.d.ts +5 -5
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/link.d.ts +5 -3
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts.map +1 -1
- package/dist/components/nav-grid/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.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/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/product-hub-tray/product-hub-tray.d.ts.map +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +14 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +15 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +14 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +15 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +14 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +15 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +14 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +15 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +14 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +15 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +14 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +15 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +14 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +15 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +14 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +15 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +14 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +15 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +14 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +15 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +14 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +15 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +14 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +15 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +14 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +15 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +14 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +15 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +14 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +15 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +14 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +15 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +14 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +15 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +14 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +15 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +194 -193
- package/dist/locales/ar.json +15 -1
- package/dist/locales/de.json +15 -1
- package/dist/locales/el.json +15 -1
- package/dist/locales/en.json +15 -1
- package/dist/locales/es.json +15 -1
- package/dist/locales/fr.json +15 -1
- package/dist/locales/hi.json +15 -1
- package/dist/locales/it.json +15 -1
- package/dist/locales/ja.json +15 -1
- package/dist/locales/nl.json +15 -1
- package/dist/locales/pl.json +15 -1
- package/dist/locales/pt.json +15 -1
- package/dist/locales/ro.json +15 -1
- package/dist/locales/ru.json +15 -1
- package/dist/locales/sq.json +15 -1
- package/dist/locales/sv.json +15 -1
- package/dist/locales/tr.json +15 -1
- package/dist/locales/zh.json +15 -1
- package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts +10 -13
- package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/alia-chat-surface.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/alia-popout.d.ts +5 -3
- package/dist/patterns/alia-assistant/alia-popout.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/index.d.ts +2 -0
- package/dist/patterns/alia-assistant/index.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/index.js +6 -5
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +7 -2
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts.map +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signed-out-frame/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/ai-permission-notice-5vpblPCx.js +0 -171
- package/dist/_chunks/ai-permission-notice-5vpblPCx.js.map +0 -1
- package/dist/_chunks/alia-sidebar-DOei4Iyu.js +0 -1183
- package/dist/_chunks/alia-sidebar-DOei4Iyu.js.map +0 -1
- package/dist/_chunks/chart-HsF1KHbx.js.map +0 -1
- package/dist/_chunks/color-picker-BRQ4Y9SO.js.map +0 -1
- package/dist/_chunks/date-picker-wRAcq2lt.js.map +0 -1
- package/dist/_chunks/date-range-picker-CtUOI38x.js.map +0 -1
- package/dist/_chunks/date-time-picker-CLeLKuv9.js.map +0 -1
- package/dist/_chunks/hover-card-BnTueNS2.js.map +0 -1
- package/dist/_chunks/link-2HokYuIi.js +0 -130
- package/dist/_chunks/link-2HokYuIi.js.map +0 -1
- package/dist/_chunks/marketplace-app-shell-Dcx-JEjg.js.map +0 -1
- package/dist/_chunks/message-tray-BB95DA82.js.map +0 -1
- package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js +0 -65
- package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js.map +0 -1
- package/dist/_chunks/notification-tray-__sJXnsz.js.map +0 -1
- package/dist/_chunks/pdf-viewer-C3minW5b.js.map +0 -1
- package/dist/_chunks/phone-input-DxkHMYmu.js.map +0 -1
- package/dist/_chunks/popover-BI3oV3eY.js +0 -305
- package/dist/_chunks/popover-BI3oV3eY.js.map +0 -1
- package/dist/_chunks/product-hub-panel-BSSiGGG4.js.map +0 -1
- package/dist/_chunks/rich-text-editor-CkFfmA3v.js.map +0 -1
package/dist/_chunks/{registration-form-D7iNqMBF.js.map → registration-form-BlTzYywa.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration-form-D7iNqMBF.js","sources":["../../src/patterns/registration-form/registration-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* RegistrationForm — the registration form card, for doctors and for */\n/* patients. */\n/* */\n/* One export for the card: name, email and password (each with a */\n/* confirm field), phone, speciality, terms and the submit button. The */\n/* host picks the fields: a doctor form shows them all, a patient form */\n/* shows email, password and terms. The host keeps the page around the */\n/* card, the marketing copy and every server rule. The card checks what */\n/* a browser can check and either hands the values to `onSubmit` or */\n/* posts a real form to the host's own field names. */\n/* */\n/* What happens on submit (the busy guard, the reCAPTCHA wait, telling */\n/* a server answer from a re-render) lives in `useRegistrationSubmit`. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { CircleAlert } from 'lucide-react';\n// The same parser PhoneInput uses, for a number that arrives filled in.\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/min';\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 { Checkbox } from '../../components/checkbox';\nimport { DevBypassButton } from '../../components/dev-bypass-button';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport {\n PasswordInput,\n usePasswordRequirements,\n type UsePasswordRequirementsOptions,\n} from '../../components/password-input';\nimport { PhoneInput } from '../../components/phone-input';\nimport { RecaptchaWidget } from '../../components/recaptcha-widget';\nimport { Select, type SelectOption } from '../../components/select';\nimport { StateBackedTextInput } from '../../components/_shared/state-backed-text-input';\nimport { isDevelopment } from '../../components/_shared/is-development';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { isSafeHref, isSameSiteHref } from '../../components/_shared/safe-href';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport { BrandMark, type BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from './use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const REGISTRATION_FORM_FIELDS = [\n 'firstName',\n 'lastName',\n 'email',\n 'emailConfirm',\n 'password',\n 'passwordConfirm',\n 'phone',\n 'branch',\n 'terms',\n] as const;\n\nexport type RegistrationFormField = (typeof REGISTRATION_FORM_FIELDS)[number];\n\n/** The fields built on `TextInput`, which can refuse paste or copy. */\nexport type RegistrationFormTextField = Extract<\n RegistrationFormField,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'emailConfirm'\n | 'password'\n | 'passwordConfirm'\n>;\n\n/** What `onSubmit` receives once every check has passed. A field the\n * form does not show is empty (`''`, or `false` for the terms). */\nexport interface RegistrationFormValues {\n firstName: string;\n lastName: string;\n email: string;\n /** As typed. It matches `email` apart from case and outer spaces. */\n emailConfirm: string;\n password: string;\n /** Equal to `password` when the confirm field is shown. */\n passwordConfirm: string;\n /** In E.164 form, e.g. `+393331234567`. */\n phone: string;\n /** The chosen `branches` value. */\n branch: string;\n /** True when the terms are shown: the form does not submit without. */\n terms: boolean;\n /** The reCAPTCHA token, when the host passes `recaptchaSiteKey`. */\n captchaToken?: string;\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 RegistrationFormInitialValues = Partial<\n Pick<\n RegistrationFormValues,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'emailConfirm'\n | 'phone'\n | 'branch'\n | 'terms'\n >\n>;\n\n/**\n * What the development shortcut puts in the fields. Unlike\n * `initialValues` it may carry a password: the host passes it only in\n * development, from its own server, and the kit holds no test data of\n * its own.\n */\nexport type RegistrationFormDevValues = Partial<\n Pick<\n RegistrationFormValues,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'password'\n | 'phone'\n | 'branch'\n | 'terms'\n >\n>;\n\n/** The development-only shortcut at the top right of the card. */\nexport interface RegistrationFormDevBypass {\n /** What the shortcut does: the button's name and tooltip. */\n label: string;\n /**\n * The values to put in the fields when the button is pressed, as if\n * typed: the checks, the password checklist and the posted values all\n * see them. The confirm fields are filled from the same values, so\n * they match. A field the form does not show is ignored, and a\n * read-only email is kept.\n */\n values?: RegistrationFormDevValues;\n /**\n * True to submit the form right after filling it, through the normal\n * path: the checks still run, reCAPTCHA still runs, a native form\n * still posts. Default false: fill only.\n */\n submit?: boolean;\n /** Called after filling, for a host with a route of its own. */\n onClick?: () => void;\n}\n\n/** Messages from the server, already translated by the host: one per\n * field, plus `form` for a message about the whole form. */\nexport type RegistrationFormErrors = Partial<\n Record<RegistrationFormField | 'form', string>\n>;\n\n/** The host's own form field names, for a native form post. `captcha`\n * names the hidden field that carries the reCAPTCHA token. */\nexport type RegistrationFormFieldNames = Partial<\n Record<RegistrationFormField | 'captcha', string>\n>;\n\nexport interface RegistrationFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Create your account\". Pass it translated. */\n title?: string;\n /** A line under the heading, e.g. \"No installation needed\". Pass it\n * translated. */\n description?: string;\n /** The heading's level. Default 2, for a page that has its own `h1`. */\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 beside the\n * card.\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 * or a list of benefits. It sits outside the form, so nothing in it is\n * posted. Keep any heading inside it below the card's own level.\n */\n children?: ReactNode;\n /**\n * The fields to show. Default: all of them, which is the doctor form.\n * A patient form is `['email', 'password', 'passwordConfirm', 'terms']`.\n * Leave out `emailConfirm` or `passwordConfirm` to drop that confirm\n * field. The list picks fields, it does not order them; email and\n * password always show; `branch` also needs `branches`.\n */\n fields?: readonly RegistrationFormField[];\n /** Values to show when the form opens, such as the email from an\n * invite link. Read once. Never a password. */\n initialValues?: RegistrationFormInitialValues;\n /**\n * Messages from the server, already translated. Each shows on its\n * field until the user changes that field; `form` shows above the\n * fields, as does a message for a field the form does not show.\n *\n * Messages present when the form opens (a page the server rendered\n * after a failed post) take focus: the error summary at the top of the\n * form, which lists each field with a message, or the message above the\n * fields when no field has one.\n *\n * On a React host, when the messages change, both password fields\n * are emptied and focus moves as above. Set `submitting` while you\n * send: the form then also notices an answer that says the same as\n * the last one (another address, also taken), which the messages\n * alone cannot show. Any object works, kept in state or rebuilt on\n * each render (`errors={{ email: emailError }}`).\n */\n errors?: RegistrationFormErrors;\n /**\n * Shows the email from `initialValues` read-only, for a person invited\n * with an address they cannot change here. Off by default: choose it\n * only when the server will refuse any other address. The value is\n * still posted and still read out, there is no confirm email field,\n * and the browser does not check it. Ignored when there is no initial\n * email, so the field is never both empty and locked.\n */\n emailReadOnly?: boolean;\n /** A line under the email field, e.g. \"You can change it later in the\n * settings\". Pass it translated. */\n emailDescription?: string;\n /**\n * Fields that refuse paste and drop, so the user types them, e.g.\n * `['passwordConfirm']`. Default: none. Autofill from the browser or a\n * password manager still works. A refused paste is announced and shown\n * under the field. The host decides: see the docs for the WCAG\n * position, which differs between the email and password fields.\n */\n blockPaste?: readonly RegistrationFormTextField[];\n /**\n * Fields that refuse copy, cut and dragging text out. Default: none.\n * Browsers already refuse to copy from a password field while it is\n * hidden. See the docs for the WCAG position.\n */\n blockCopy?: readonly RegistrationFormTextField[];\n /** The specialities to choose from. The field shows, and is required,\n * only when this has entries. */\n branches?: SelectOption[];\n /**\n * The password rules, shown as a live checklist. Keep them equal to\n * the server's. Default: 12 characters with an uppercase letter, a\n * lowercase letter and a number, counting only `A-Z`, `a-z` and `0-9`\n * (`charset: 'ascii'`), which is the platform's rule.\n */\n passwordPolicy?: UsePasswordRequirementsOptions;\n /**\n * Where \"terms of use\" leads. A path on the same site, or an address\n * written in full (`https://…`). Anything else, such as an address\n * that would lead off the site without saying so, shows the words\n * without a link.\n */\n termsHref?: string;\n /** Where \"privacy policy\" leads. Same rule as `termsHref`. */\n privacyHref?: string;\n /**\n * Replaces the sentence beside the terms box (\"I accept the terms of\n * use and the privacy policy\") with the host's own wording and links,\n * already translated. The legal wording is the host's to choose. When\n * set, `termsHref` and `privacyHref` are not used. The box stays\n * required.\n */\n termsLabel?: ReactNode;\n /** A line shown with the terms box and read out with it, e.g. \"We\n * will not send you any advertising\". Pass it translated. */\n termsDescription?: ReactNode;\n /** Adds \"Already have an account? Sign in\". Same rule as `termsHref`. */\n loginHref?: string;\n /** A Google reCAPTCHA v2 site key of the invisible type. The check\n * runs when the user submits. Leave it out where the server does not\n * verify a token. */\n recaptchaSiteKey?: string;\n /** Replaces the button's \"Create account\". Pass it translated. */\n submitLabel?: string;\n /** True while the host sends the values: the button shows a spinner\n * and a second submit is ignored. */\n submitting?: boolean;\n /**\n * Shows the development-only shortcut button at the top right of the\n * card: it fills the form with the host's `values`, and submits it\n * when asked to. Pass it only when the server says this is a\n * development environment: the kit never decides that itself, holds\n * no test data, and what the shortcut submits goes through the normal\n * path, so the server's own rules still decide. With neither `values`\n * nor `onClick` there is nothing to do and no button.\n */\n devBypass?: RegistrationFormDevBypass;\n /** For React hosts: called with the values once every check has\n * passed. Not called when `fieldNames` is set. */\n onSubmit?: (values: RegistrationFormValues) => void;\n /**\n * For a native form post: the host's own field names, e.g.\n * `{ email: 'registration[email]' }`. When set, the inputs carry\n * these names and the browser posts the form. A field without a name\n * here is not posted: name a confirm field only if the server's form\n * has one, or it may refuse the post as carrying extra fields.\n */\n fieldNames?: RegistrationFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address, query\n * string included, which is what a page reached through an invite link\n * needs. Only an address on this site is accepted: another site is\n * never sent what the user typed, and the post then goes to the\n * current address instead.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token\n * or similar. Not used with `onSubmit`. A name that is also one of\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\nconst registrationFormVariants = cva(\n 'ds:@container/registration ds:w-full ds:text-start ds:text-[var(--foreground)]',\n);\n\nconst rowVariants = cva(\n 'ds:grid ds:grid-cols-1 ds:items-start ds:gap-[var(--spacing-md)]',\n {\n variants: {\n columns: {\n /** A field alone in its row takes the full width. */\n one: '',\n /** Two fields side by side once the card is wide enough. */\n two: 'ds:@[544px]/registration:grid-cols-2',\n },\n },\n defaultVariants: { columns: 'two' },\n },\n);\n\n/** The top of the card: the mark, the heading and its line. */\nconst headerVariants = cva('ds:relative ds:flex ds:gap-[var(--spacing-sm)]', {\n variants: {\n logo: {\n /** A centred column under the mark. */\n true: 'ds:flex-col ds:items-center',\n /** The heading at the start edge, the shortcut at the end. */\n false: 'ds:items-start ds:justify-between',\n },\n },\n defaultVariants: { logo: true },\n});\n\nconst headingBlockVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]',\n {\n variants: {\n centred: { true: 'ds:items-center ds:text-center', false: '' },\n },\n defaultVariants: { centred: true },\n },\n);\n\n/** Where the development shortcut sits: the top inline-end corner. Out\n * of the flow under the mark, so it cannot push the mark off centre. */\nconst shortcutVariants = cva('ds:shrink-0', {\n variants: {\n corner: { true: 'ds:absolute ds:top-0 ds:end-0', false: '' },\n },\n defaultVariants: { corner: true },\n});\n\n// Links inside the card take the text colour and an underline. The kit\n// Link's own colour (`--primary`) falls just below AA on a card in the\n// dark theme, as the booking form's consent links found.\nconst inlineLinkVariants = cva(\n 'ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] 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)]',\n {\n variants: {\n weight: { normal: '', strong: 'ds:font-semibold' },\n },\n defaultVariants: { weight: 'normal' },\n },\n);\n\n// The message above the fields takes focus when there is no field to\n// send the user to, so it shows a ring like anything else that does.\nconst formMessageVariants = 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)]',\n);\n\n/** The `*` beside a required field, as FormField draws it. Decorative:\n * the control itself says it is required. */\nconst requiredMarkVariants = cva(\n 'ds:text-destructive ds:ms-[var(--spacing-xs)]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n// The platform's rule is written in ASCII (`[A-Z]`, `[a-z]`, `\\d`), so\n// the checklist counts the same characters and never shows green for a\n// password the server will refuse.\nconst DEFAULT_PASSWORD_POLICY: UsePasswordRequirementsOptions = {\n minLength: 12,\n uppercase: true,\n lowercase: true,\n digit: true,\n charset: 'ascii',\n};\n\n// A brand name, not interface copy: it reads the same in every language,\n// so it has no translation key.\nconst BRAND_NAME = 'Alfadocs';\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: RegistrationFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\n/** Whether a number could be a real one, by its length for its country. */\nconst isPossiblePhone = (e164: string): boolean =>\n parsePhoneNumberFromString(e164)?.isPossible() ?? false;\n\ninterface InlineLinkProps {\n href: string;\n /** Opens in a new tab, so the form keeps what the user has typed. */\n newTab?: boolean;\n weight?: 'normal' | 'strong';\n /** Emitted as `data-action`. */\n action?: string;\n /** The link's text: `Trans` fills it in from the translation. */\n children?: ReactNode;\n}\n\n// `Trans` hands every element it fills a bookkeeping prop of its own, so\n// these two take named props only and pass nothing else on to the DOM.\n\n/** A link inside a sentence. */\nfunction InlineLink({\n href,\n newTab = false,\n weight,\n action,\n children,\n}: InlineLinkProps) {\n const { t } = useTranslation('ui');\n return (\n <a\n href={href}\n target={newTab ? '_blank' : undefined}\n rel={newTab ? 'noopener noreferrer' : undefined}\n data-action={action}\n className={inlineLinkVariants({ weight })}\n >\n {children}\n {newTab && <span className=\"ds:sr-only\">{t('link.opensInNewTab')}</span>}\n </a>\n );\n}\n\n/** The words a link would wrap, when the host gives no address for it. */\nfunction PlainText({ children }: { children?: ReactNode }) {\n return <>{children}</>;\n}\n\ntype FieldFlags = Partial<Record<RegistrationFormField, boolean>>;\n\n/** Where focus can be sent: a field, or the message above the fields. */\ntype FocusTarget = RegistrationFormField | 'form';\n\n/** Every field but the terms, which is a checkbox under the grid. */\ntype GridField = Exclude<RegistrationFormField, 'terms'>;\n\n/** A field sits beside the one it belongs with. */\nconst FIELD_PAIRS: ReadonlyArray<readonly [GridField, GridField]> = [\n ['firstName', 'lastName'],\n ['email', 'emailConfirm'],\n ['password', 'passwordConfirm'],\n ['phone', 'branch'],\n];\n\n/** The rows of the form, for the fields that show. A pair keeps its\n * row; two fields left alone one after the other share a row, so a\n * form of just email and password puts them side by side. */\nfunction layOutRows(shows: (field: GridField) => boolean): GridField[][] {\n const rows: GridField[][] = [];\n for (const pair of FIELD_PAIRS) {\n const row = pair.filter(shows);\n if (row.length === 0) continue;\n const last = rows[rows.length - 1];\n if (row.length === 1 && last?.length === 1) last.push(row[0]);\n else rows.push(row);\n }\n return rows;\n}\n\ninterface FormState {\n firstName: string;\n lastName: string;\n email: string;\n emailConfirm: string;\n password: string;\n passwordConfirm: string;\n phone: string;\n branch: string;\n terms: boolean;\n}\n\n/* -------------------------------------------------------------------- */\n/* RegistrationForm */\n/* -------------------------------------------------------------------- */\n\n/**\n * The registration form card, for doctors and for patients. The host\n * picks the fields, supplies the page around the card and owns every\n * server rule; see the props for the two ways to submit. The card's\n * text follows the kit's language, like every kit component.\n */\nexport const RegistrationForm = forwardRef<\n HTMLDivElement,\n RegistrationFormProps\n>(\n (\n {\n title,\n description,\n headingLevel = 2,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n fields,\n initialValues,\n errors,\n emailReadOnly = false,\n emailDescription,\n blockPaste,\n blockCopy,\n branches,\n passwordPolicy = DEFAULT_PASSWORD_POLICY,\n termsHref,\n privacyHref,\n termsLabel,\n termsDescription,\n loginHref,\n recaptchaSiteKey,\n submitLabel,\n submitting = false,\n devBypass,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const titleId = useId();\n const fieldIdBase = useId();\n /** The id of a field's wrapper: where the summary's link leads. */\n const fieldId = (field: RegistrationFormField) => `${fieldIdBase}-${field}`;\n const termsErrorId = useId();\n const termsDescriptionId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const hasBranches = Boolean(branches && branches.length > 0);\n // Locked only when there is an address to lock: an empty read-only\n // field would leave the user with no way forward.\n const [hadEmail] = useState(() => Boolean(initialValues?.email));\n const emailLocked = emailReadOnly && hadEmail;\n\n /** Whether the form shows a field. */\n const shows = (field: RegistrationFormField): boolean => {\n if (field === 'email' || field === 'password') return true;\n if (fields && !fields.includes(field)) return false;\n if (field === 'branch') return hasBranches;\n // Nothing to mistype in an address the user cannot type.\n if (field === 'emailConfirm') return !emailLocked;\n return true;\n };\n const shown = REGISTRATION_FORM_FIELDS.filter(shows);\n\n /* ------------------------------ State ----------------------------- */\n\n // Read once. Passwords always start empty.\n const [values, setValues] = useState<FormState>(() => ({\n firstName: initialValues?.firstName ?? '',\n lastName: initialValues?.lastName ?? '',\n email: initialValues?.email ?? '',\n emailConfirm: initialValues?.emailConfirm ?? '',\n password: '',\n passwordConfirm: '',\n phone: initialValues?.phone ?? '',\n branch: initialValues?.branch ?? '',\n terms: initialValues?.terms ?? false,\n }));\n // PhoneInput says whether a number is possible each time it changes.\n const [phonePossible, setPhonePossible] = useState(() =>\n isPossiblePhone(initialValues?.phone ?? ''),\n );\n // A field the user has left. An email that arrives filled in counts,\n // as it does inside EmailInput: both then flag a bad one at once, so\n // the field is never red without a message.\n const [touched, setTouched] = useState<FieldFlags>(() => ({\n email: Boolean(initialValues?.email),\n }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<RegistrationFormErrors>(\n () => errors ?? {},\n );\n\n const set = <K extends keyof FormState>(field: K, value: FormState[K]) => {\n setValues((previous) => ({ ...previous, [field]: value }));\n // The server's message was about the old value.\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n };\n const leave = (field: RegistrationFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n const emptyPasswords = () => {\n setValues((previous) => ({\n ...previous,\n password: '',\n passwordConfirm: '',\n }));\n setTouched((previous) => ({\n ...previous,\n password: false,\n passwordConfirm: false,\n }));\n };\n\n /** The paste and copy switches for one typed field. */\n const clipboard = (field: RegistrationFormTextField) => ({\n blockPaste: blockPaste?.includes(field) ?? false,\n blockCopy: blockCopy?.includes(field) ?? false,\n });\n\n /* ---------------------------- Validation -------------------------- */\n\n const requirements = usePasswordRequirements(passwordPolicy);\n const emailMatch = useFieldMatch({\n value: values.email,\n confirmValue: values.emailConfirm,\n kind: 'email',\n submitted,\n });\n const passwordMatch = useFieldMatch({\n value: values.password,\n confirmValue: values.passwordConfirm,\n kind: 'password',\n submitted,\n });\n\n /** What stops a submit, whether or not the message shows yet. Only\n * a field that shows can stop it. */\n const invalid: Record<RegistrationFormField, boolean> = {\n firstName: shows('firstName') && values.firstName.trim() === '',\n lastName: shows('lastName') && values.lastName.trim() === '',\n // The user cannot fix a locked address, so the server judges it.\n email: !emailLocked && !isEmail(values.email),\n emailConfirm:\n shows('emailConfirm') &&\n (values.emailConfirm === '' || !emailMatch.matches),\n password:\n values.password === '' ||\n !requirements.every((rule) => rule.test(values.password)),\n passwordConfirm:\n shows('passwordConfirm') &&\n (values.passwordConfirm === '' || !passwordMatch.matches),\n phone: shows('phone') && (values.phone === '' || !phonePossible),\n branch: shows('branch') && values.branch === '',\n terms: shows('terms') && !values.terms,\n };\n\n // A message shows once the user has left the field or tried to\n // submit. The terms box waits for a submit: leaving it to follow one\n // of its own links is not a mistake.\n const due = (field: RegistrationFormField) =>\n submitted || (field !== 'terms' && touched[field] === true);\n const required = t('registrationForm.required');\n /** Each grid field's label: on the field, and in the summary. */\n const labels: Record<GridField, string> = {\n firstName: t('registrationForm.firstName'),\n lastName: t('registrationForm.lastName'),\n email: t('registrationForm.email'),\n emailConfirm: t('registrationForm.emailConfirm'),\n password: t('registrationForm.password'),\n passwordConfirm: t('registrationForm.passwordConfirm'),\n phone: t('registrationForm.phone'),\n branch: t('registrationForm.branch'),\n };\n const whenDue = (field: RegistrationFormField, message: string) =>\n due(field) && invalid[field] ? message : undefined;\n\n const ownErrors: Record<RegistrationFormField, string | undefined> = {\n firstName: whenDue('firstName', required),\n lastName: whenDue('lastName', required),\n email: whenDue(\n 'email',\n values.email === '' ? required : t('inputs.email.invalid'),\n ),\n emailConfirm:\n values.emailConfirm === ''\n ? whenDue('emailConfirm', required)\n : emailMatch.error,\n password: whenDue(\n 'password',\n values.password === ''\n ? required\n : t('registrationForm.passwordInvalid'),\n ),\n passwordConfirm:\n values.passwordConfirm === ''\n ? whenDue('passwordConfirm', required)\n : passwordMatch.error,\n phone: whenDue(\n 'phone',\n values.phone === '' ? required : t('registrationForm.phoneInvalid'),\n ),\n branch: whenDue('branch', required),\n terms: whenDue('terms', t('registrationForm.termsRequired')),\n };\n const errorFor = (field: RegistrationFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const controls = useRef<\n Partial<Record<RegistrationFormField, HTMLElement | null>>\n >({});\n const control = useMemo(() => {\n const bind =\n (field: RegistrationFormField) => (node: HTMLElement | null) => {\n controls.current[field] = node;\n };\n return {\n firstName: bind('firstName'),\n lastName: bind('lastName'),\n email: bind('email'),\n emailConfirm: bind('emailConfirm'),\n password: bind('password'),\n passwordConfirm: bind('passwordConfirm'),\n phone: bind('phone'),\n branch: bind('branch'),\n terms: bind('terms'),\n };\n }, []);\n // The addresses stay out of the inputs' `value` attributes, where a\n // copied outerHTML or a session replay could read them. The names do\n // too, through StateBackedTextInput.\n const emailField = useStateBackedInput(values.email, control.email);\n const emailConfirmField = useStateBackedInput(\n values.emailConfirm,\n control.emailConfirm,\n );\n const formMessage = useRef<HTMLDivElement>(null);\n\n /** Where to send the user for a set of server messages: the first\n * field on screen that has one, or the message above the fields\n * when only that says something. */\n const focusTargetFor = (\n messages: RegistrationFormErrors,\n ): FocusTarget | undefined =>\n shown.find((field) => messages[field]) ??\n (hasMessage(messages) ? 'form' : undefined);\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 shown.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(shown, errorFor, openedWithFieldMessage);\n\n // Any other place focus goes: the message above the fields, when no\n // field has one. A new object for each request, so asking twice for the\n // same place moves focus twice. The effect runs after the messages are\n // drawn, so a screen reader lands on something that already says what\n // is wrong.\n const [focusRequest, setFocusRequest] = useState<{\n target: FocusTarget;\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n if (focusRequest.target === 'form') formMessage.current?.focus();\n else controls.current[focusRequest.target]?.focus();\n }, [focusRequest]);\n\n // PhoneInput has no blur event of its own, so listen on its input.\n const showsPhone = shows('phone');\n useEffect(() => {\n const input = controls.current.phone;\n if (!showsPhone || !input) return undefined;\n const onBlur = () =>\n setTouched((previous) =>\n previous.phone ? previous : { ...previous, phone: true },\n );\n input.addEventListener('blur', onBlur);\n return () => input.removeEventListener('blur', onBlur);\n }, [showsPhone]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const form = useRef<HTMLFormElement>(null);\n const captchaInput = useRef<HTMLInputElement>(null);\n\n /* --------------------- Development shortcut ----------------------- */\n\n // Asks for a submit once the filled values are on the page.\n const [submitRequest, setSubmitRequest] = useState<object | null>(null);\n useEffect(() => {\n if (submitRequest) form.current?.requestSubmit();\n }, [submitRequest]);\n\n const runDevBypass = () => {\n const filled = devBypass?.values;\n if (filled) {\n // Through the same state as the user's typing, and only into\n // fields that show. A locked email keeps its address.\n const email = emailLocked ? undefined : filled.email;\n const next: Partial<FormState> = {};\n if (shows('firstName') && filled.firstName !== undefined)\n next.firstName = filled.firstName;\n if (shows('lastName') && filled.lastName !== undefined)\n next.lastName = filled.lastName;\n if (email !== undefined) next.email = email;\n if (shows('emailConfirm') && email !== undefined)\n next.emailConfirm = email;\n if (filled.password !== undefined) next.password = filled.password;\n if (shows('passwordConfirm') && filled.password !== undefined)\n next.passwordConfirm = filled.password;\n if (shows('phone') && filled.phone !== undefined)\n next.phone = filled.phone;\n if (shows('branch') && filled.branch !== undefined)\n next.branch = filled.branch;\n if (shows('terms') && filled.terms !== undefined)\n next.terms = filled.terms;\n setValues((previous) => ({ ...previous, ...next }));\n if (next.phone !== undefined)\n setPhonePossible(isPossiblePhone(next.phone));\n // The server's messages were about the old values.\n setServerErrors((previous) => {\n const kept = { ...previous };\n for (const field of Object.keys(next) as (keyof FormState)[]) {\n kept[field] = undefined;\n }\n return kept;\n });\n if (devBypass.submit) setSubmitRequest({});\n }\n devBypass?.onClick?.();\n };\n\n const submit = useRegistrationSubmit<RegistrationFormField>({\n errors,\n submitting,\n native,\n captcha: Boolean(recaptchaSiteKey),\n firstProblem: () => shown.find((field) => invalid[field]),\n onRefused: (field) => {\n // Every message now shows, listed in the summary, which takes focus.\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n deliver: (captchaToken) => {\n if (native) {\n if (captchaInput.current && captchaToken) {\n captchaInput.current.value = captchaToken;\n }\n form.current?.submit();\n return;\n }\n // A field that does not show is empty, whatever it started with.\n const text = (field: GridField) => (shows(field) ? values[field] : '');\n onSubmit?.({\n firstName: text('firstName'),\n lastName: text('lastName'),\n email: values.email,\n emailConfirm: text('emailConfirm'),\n password: values.password,\n passwordConfirm: text('passwordConfirm'),\n phone: text('phone'),\n branch: text('branch'),\n terms: shows('terms') && values.terms,\n captchaToken,\n });\n },\n onAnswer: (answer) => {\n const next: RegistrationFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n // Never keep a password the server did not accept.\n emptyPasswords();\n setSubmitted(false);\n // The summary when a field has a message, else the message above.\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:\n // the passwords must not come back with it.\n onRestore: emptyPasswords,\n });\n const { busy, captchaFailed } = submit;\n\n // A failed reCAPTCHA check has no field of its own: send the user to\n // the message above the fields, which may be off screen.\n useEffect(() => {\n if (captchaFailed) setFocusRequest({ target: 'form' });\n }, [captchaFailed]);\n\n /* ------------------------------ Render ---------------------------- */\n\n const name = (field: RegistrationFormField) =>\n native ? fieldNames[field] : field;\n const Heading = `h${headingLevel}` as const;\n const termsLink = linkTo(termsHref);\n const privacyLink = linkTo(privacyHref);\n const loginLink = linkTo(loginHref);\n const formAction =\n native && action && isSameSiteHref(action) ? action : undefined;\n // What shows above the fields: the server's message about the whole\n // form, its message about any field that is not on screen (so nothing\n // it says is lost), and a failed reCAPTCHA check.\n const formError =\n [\n serverErrors.form,\n ...REGISTRATION_FORM_FIELDS.filter((field) => !shows(field)).map(\n (field) => serverErrors[field],\n ),\n captchaFailed ? t('inputs.recaptcha.error') : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\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 const termsError = errorFor('terms');\n const termsDescribedBy =\n [\n termsDescription ? termsDescriptionId : undefined,\n termsError ? termsErrorId : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n // The host's extra hidden inputs. The form's own fields keep their\n // names: an extra one that asks for the same name is left out.\n const ownNames = new Set(Object.values(fieldNames ?? {}));\n const extraFields = native ? Object.entries(hiddenFields ?? {}) : [];\n const clashes = extraFields\n .filter(([extraName]) => ownNames.has(extraName))\n .map(([extraName]) => extraName)\n .join(', ');\n useEffect(() => {\n if (clashes && isDevelopment()) {\n console.warn(\n `RegistrationForm: hiddenFields \"${clashes}\" is also named in fieldNames and was left out. The form's own field wins.`,\n );\n }\n }, [clashes]);\n\n const renderField = (field: GridField): ReactNode => {\n switch (field) {\n case 'firstName':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.firstName}\n required\n error={errorFor('firstName')}\n announceError={!summary.lists('firstName')}\n data-field=\"firstName\"\n >\n <StateBackedTextInput\n ref={control.firstName}\n name={name('firstName')}\n autoComplete=\"given-name\"\n value={values.firstName}\n onChange={(event) => set('firstName', event.target.value)}\n onBlur={() => leave('firstName')}\n {...clipboard('firstName')}\n />\n </FormField>\n );\n case 'lastName':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.lastName}\n required\n error={errorFor('lastName')}\n announceError={!summary.lists('lastName')}\n data-field=\"lastName\"\n >\n <StateBackedTextInput\n ref={control.lastName}\n name={name('lastName')}\n autoComplete=\"family-name\"\n value={values.lastName}\n onChange={(event) => set('lastName', event.target.value)}\n onBlur={() => leave('lastName')}\n {...clipboard('lastName')}\n />\n </FormField>\n );\n case 'email':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.email}\n required={!emailLocked}\n description={emailDescription}\n error={errorFor('email')}\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* EmailInput still checks the format and marks the input.\n Its message goes through FormField, so there is one\n message, in one place. Read-only, not disabled: the\n address is still posted and still read out. */}\n <EmailInput\n ref={emailField.ref}\n name={name('email')}\n errorMessage={null}\n disableBuiltInValidation={emailLocked}\n readOnly={emailLocked}\n onChange={emailField.quiet((event) =>\n set('email', event.target.value),\n )}\n onBlur={() => leave('email')}\n {...clipboard('email')}\n />\n </FormField>\n );\n case 'emailConfirm':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.emailConfirm}\n required\n error={errorFor('emailConfirm')}\n announceError={!summary.lists('emailConfirm')}\n data-field=\"emailConfirm\"\n >\n <EmailInput\n ref={emailConfirmField.ref}\n name={name('emailConfirm')}\n disableBuiltInValidation\n onChange={emailConfirmField.quiet((event) =>\n set('emailConfirm', event.target.value),\n )}\n onBlur={() => {\n leave('emailConfirm');\n emailMatch.confirmProps.onBlur();\n }}\n {...clipboard('emailConfirm')}\n />\n </FormField>\n );\n case 'password':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.password}\n required\n error={errorFor('password')}\n announceError={!summary.lists('password')}\n data-field=\"password\"\n >\n {/* PasswordInput names itself \"password\" when given no\n name; an empty one keeps a field out of the post. */}\n <PasswordInput\n ref={control.password}\n name={name('password') ?? ''}\n autoComplete=\"new-password\"\n requirements={requirements}\n value={values.password}\n onChange={(event) => set('password', event.target.value)}\n onBlur={() => leave('password')}\n {...clipboard('password')}\n />\n </FormField>\n );\n case 'passwordConfirm':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.passwordConfirm}\n required\n error={errorFor('passwordConfirm')}\n announceError={!summary.lists('passwordConfirm')}\n data-field=\"passwordConfirm\"\n >\n <PasswordInput\n ref={control.passwordConfirm}\n name={name('passwordConfirm') ?? ''}\n autoComplete=\"new-password\"\n value={values.passwordConfirm}\n onChange={(event) => set('passwordConfirm', event.target.value)}\n onBlur={() => {\n leave('passwordConfirm');\n passwordMatch.confirmProps.onBlur();\n }}\n {...clipboard('passwordConfirm')}\n />\n </FormField>\n );\n case 'phone':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.phone}\n required\n error={errorFor('phone')}\n announceError={!summary.lists('phone')}\n data-field=\"phone\"\n >\n {/* The visible input holds the number as typed. In a native\n post a hidden input carries the full international\n number instead. */}\n <PhoneInput\n ref={control.phone}\n name={native ? undefined : 'phone'}\n value={values.phone}\n onChange={(e164, meta) => {\n set('phone', e164);\n setPhonePossible(meta.isPossible);\n }}\n />\n </FormField>\n );\n case 'branch':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.branch}\n required\n error={errorFor('branch')}\n announceError={!summary.lists('branch')}\n data-field=\"branch\"\n >\n <Select\n ref={control.branch}\n name={name('branch')}\n options={branches ?? []}\n value={values.branch}\n onValueChange={(value) => set('branch', value)}\n />\n </FormField>\n );\n }\n };\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"registration-form\"\n className={registrationFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <div className={headerVariants({ logo: showLogo })}>\n <div className={headingBlockVariants({ centred: showLogo })}>\n {/* The page's logo: read out once, before the heading. */}\n {showLogo && (\n <BrandMark motion={logoMotion} label={BRAND_NAME} />\n )}\n <Heading id={titleId} className=\"type-title-card\">\n {title ?? t('registrationForm.title')}\n </Heading>\n {description && (\n <p className=\"type-body-sm ds:text-[var(--muted-foreground)]\">\n {description}\n </p>\n )}\n </div>\n {devBypass && (devBypass.values || devBypass.onClick) && (\n <div className={shortcutVariants({ corner: showLogo })}>\n <DevBypassButton\n label={devBypass.label}\n onClick={runDevBypass}\n />\n </div>\n )}\n </div>\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 ref={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 const message = errorFor(field) ?? '';\n return {\n field,\n message,\n // \"This field is required.\" does not say which field:\n // the summary names it.\n label:\n message === required && field !== 'terms'\n ? labels[field]\n : undefined,\n targetId: fieldId(field),\n };\n })}\n />\n\n {formError && (\n <Alert\n ref={formMessage}\n id={formMessageId}\n variant=\"error\"\n announce={formMessageAnnounce}\n tabIndex={-1}\n data-field=\"form\"\n className={formMessageVariants()}\n >\n <Alert.Description>{formError}</Alert.Description>\n </Alert>\n )}\n\n {layOutRows(shows).map((row) => (\n <div\n key={row[0]}\n className={rowVariants({\n columns: row.length === 2 ? 'two' : 'one',\n })}\n >\n {row.map(renderField)}\n </div>\n ))}\n {native && showsPhone && fieldNames.phone && (\n <input\n type=\"hidden\"\n name={fieldNames.phone}\n value={values.phone}\n />\n )}\n {native && fieldNames.captcha && (\n <input\n ref={captchaInput}\n type=\"hidden\"\n name={fieldNames.captcha}\n defaultValue=\"\"\n />\n )}\n {extraFields\n .filter(([extraName]) => !ownNames.has(extraName))\n .map(([extraName, value]) => (\n <input\n key={extraName}\n type=\"hidden\"\n name={extraName}\n value={value}\n />\n ))}\n\n {shows('terms') && (\n <div\n id={fieldId('terms')}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n data-field=\"terms\"\n >\n {termsDescription && (\n <p\n id={termsDescriptionId}\n className=\"type-body-sm ds:text-[var(--muted-foreground)]\"\n >\n {termsDescription}\n </p>\n )}\n <Checkbox\n ref={control.terms}\n name={name('terms')}\n value=\"1\"\n checked={values.terms}\n onCheckedChange={(next) => set('terms', next === true)}\n aria-required=\"true\"\n aria-invalid={termsError ? true : undefined}\n aria-describedby={termsDescribedBy}\n label={\n <>\n {termsLabel ?? (\n <Trans\n i18n={i18n}\n ns=\"ui\"\n i18nKey=\"registrationForm.terms\"\n components={{\n terms: termsLink ? (\n <InlineLink href={termsLink} newTab />\n ) : (\n <PlainText />\n ),\n privacy: privacyLink ? (\n <InlineLink href={privacyLink} newTab />\n ) : (\n <PlainText />\n ),\n }}\n />\n )}\n <span\n aria-hidden=\"true\"\n className={requiredMarkVariants()}\n >\n *\n </span>\n </>\n }\n />\n {termsError && (\n <p\n id={termsErrorId}\n // Quiet while the summary lists it: the summary reads it.\n role={summary.lists('terms') ? undefined : 'alert'}\n data-slot=\"error\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <CircleAlert\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0\"\n />\n <span>{termsError}</span>\n </p>\n )}\n </div>\n )}\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('registrationForm.submit')}\n </Button>\n {/* The spinner is decorative and the button is disabled\n while busy, so say it in words. Always mounted: a live\n region announces a change, not its first content. */}\n <p role=\"status\" className=\"ds:sr-only\">\n {busy ? t('chat.message.status.sending') : ''}\n </p>\n\n {loginLink && (\n <p className=\"type-body-sm ds:text-center ds:text-[var(--muted-foreground)]\">\n <Trans\n i18n={i18n}\n ns=\"ui\"\n i18nKey=\"registrationForm.login\"\n components={{\n login: (\n <InlineLink\n href={loginLink}\n weight=\"strong\"\n action=\"login\"\n />\n ),\n }}\n />\n </p>\n )}\n\n {/* Last, so its badge comes after the button and the login\n link in the tab order. Out of the flow: it takes no\n space, so it must not take a gap either. The card says\n when the check fails, so the widget stays quiet. */}\n {recaptchaSiteKey && (\n <div className=\"ds:absolute\">\n <RecaptchaWidget\n ref={submit.captcha.ref}\n siteKey={recaptchaSiteKey}\n size=\"invisible\"\n announceStatus={false}\n onChange={submit.captcha.onChange}\n onError={submit.captcha.onError}\n />\n </div>\n )}\n </form>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nRegistrationForm.displayName = 'RegistrationForm';\n"],"names":["REGISTRATION_FORM_FIELDS","registrationFormVariants","cva","rowVariants","headerVariants","headingBlockVariants","shortcutVariants","inlineLinkVariants","formMessageVariants","requiredMarkVariants","DEFAULT_PASSWORD_POLICY","BRAND_NAME","linkTo","href","isSafeHref","hasMessage","errors","isPossiblePhone","e164","_a","parsePhoneNumberFromString","InlineLink","newTab","weight","action","children","t","useTranslation","jsxs","jsx","PlainText","FIELD_PAIRS","layOutRows","shows","rows","pair","row","last","RegistrationForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","fields","initialValues","emailReadOnly","emailDescription","blockPaste","blockCopy","branches","passwordPolicy","termsHref","privacyHref","termsLabel","termsDescription","loginHref","recaptchaSiteKey","submitLabel","submitting","devBypass","onSubmit","fieldNames","hiddenFields","className","rest","ref","i18n","titleId","useId","fieldIdBase","fieldId","field","termsErrorId","termsDescriptionId","formMessageId","native","hasBranches","hadEmail","useState","emailLocked","shown","values","setValues","phonePossible","setPhonePossible","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","set","value","previous","leave","emptyPasswords","clipboard","requirements","usePasswordRequirements","emailMatch","useFieldMatch","passwordMatch","invalid","isEmail","rule","due","required","labels","whenDue","message","ownErrors","errorFor","controls","useRef","control","useMemo","bind","node","emailField","useStateBackedInput","emailConfirmField","formMessage","focusTargetFor","messages","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","useEffect","_b","showsPhone","input","onBlur","form","captchaInput","submitRequest","setSubmitRequest","runDevBypass","filled","email","next","kept","submit","useRegistrationSubmit","captchaToken","text","answer","busy","captchaFailed","name","Heading","termsLink","privacyLink","loginLink","formAction","isSameSiteHref","formError","formMessageAnnounce","useFormMessageAnnounce","termsError","termsDescribedBy","ownNames","extraFields","clashes","extraName","isDevelopment","renderField","FormField","StateBackedTextInput","event","EmailInput","PasswordInput","PhoneInput","meta","Select","Card","BrandMark","DevBypassButton","ErrorSummary","Alert","Checkbox","Fragment","Trans","CircleAlert","Button","RecaptchaWidget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAMA,KAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA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C;AAAA,wBAACR;AAAA,wBAAA;AAAA,0BACC,MAAMwI;AAAA,0BACN,QAAO;AAAA,0BACP,QAAO;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACT;AAAA,kBAEJ;AAAA,gBAAA,GAEJ;AAAA,gBAODnG,KACC,gBAAA7B,EAAC,OAAA,EAAI,WAAU,eACb,UAAA,gBAAAA;AAAA,kBAACgK;AAAA,kBAAA;AAAA,oBACC,KAAK3C,EAAO,QAAQ;AAAA,oBACpB,SAASxF;AAAA,oBACT,MAAK;AAAA,oBACL,gBAAgB;AAAA,oBAChB,UAAUwF,EAAO,QAAQ;AAAA,oBACzB,SAASA,EAAO,QAAQ;AAAA,kBAAA;AAAA,gBAAA,EAC1B,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA5G,GAAiB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"registration-form-BlTzYywa.js","sources":["../../src/patterns/registration-form/registration-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* RegistrationForm — the registration form card, for doctors and for */\n/* patients. */\n/* */\n/* One export for the card: name, email and password (each with a */\n/* confirm field), phone, speciality, terms and the submit button. The */\n/* host picks the fields: a doctor form shows them all, a patient form */\n/* shows email, password and terms. The host keeps the page around the */\n/* card, the marketing copy and every server rule. The card checks what */\n/* a browser can check and either hands the values to `onSubmit` or */\n/* posts a real form to the host's own field names. */\n/* */\n/* What happens on submit (the busy guard, the reCAPTCHA wait, telling */\n/* a server answer from a re-render) lives in `useRegistrationSubmit`. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { CircleAlert } from 'lucide-react';\n// The same parser PhoneInput uses, for a number that arrives filled in.\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/min';\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 { Checkbox } from '../../components/checkbox';\nimport { DevBypassButton } from '../../components/dev-bypass-button';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport {\n PasswordInput,\n usePasswordRequirements,\n type UsePasswordRequirementsOptions,\n} from '../../components/password-input';\nimport { PhoneInput } from '../../components/phone-input';\nimport { RecaptchaWidget } from '../../components/recaptcha-widget';\nimport { Select, type SelectOption } from '../../components/select';\nimport { StateBackedTextInput } from '../../components/_shared/state-backed-text-input';\nimport { isDevelopment } from '../../components/_shared/is-development';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { isSafeHref, isSameSiteHref } from '../../components/_shared/safe-href';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport { BrandMark, type BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from './use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const REGISTRATION_FORM_FIELDS = [\n 'firstName',\n 'lastName',\n 'email',\n 'emailConfirm',\n 'password',\n 'passwordConfirm',\n 'phone',\n 'branch',\n 'terms',\n] as const;\n\nexport type RegistrationFormField = (typeof REGISTRATION_FORM_FIELDS)[number];\n\n/** The fields built on `TextInput`, which can refuse paste or copy. */\nexport type RegistrationFormTextField = Extract<\n RegistrationFormField,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'emailConfirm'\n | 'password'\n | 'passwordConfirm'\n>;\n\n/** What `onSubmit` receives once every check has passed. A field the\n * form does not show is empty (`''`, or `false` for the terms). */\nexport interface RegistrationFormValues {\n firstName: string;\n lastName: string;\n email: string;\n /** As typed. It matches `email` apart from case and outer spaces. */\n emailConfirm: string;\n password: string;\n /** Equal to `password` when the confirm field is shown. */\n passwordConfirm: string;\n /** In E.164 form, e.g. `+393331234567`. */\n phone: string;\n /** The chosen `branches` value. */\n branch: string;\n /** True when the terms are shown: the form does not submit without. */\n terms: boolean;\n /** The reCAPTCHA token, when the host passes `recaptchaSiteKey`. */\n captchaToken?: string;\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 RegistrationFormInitialValues = Partial<\n Pick<\n RegistrationFormValues,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'emailConfirm'\n | 'phone'\n | 'branch'\n | 'terms'\n >\n>;\n\n/**\n * What the development shortcut puts in the fields. Unlike\n * `initialValues` it may carry a password: the host passes it only in\n * development, from its own server, and the kit holds no test data of\n * its own.\n */\nexport type RegistrationFormDevValues = Partial<\n Pick<\n RegistrationFormValues,\n | 'firstName'\n | 'lastName'\n | 'email'\n | 'password'\n | 'phone'\n | 'branch'\n | 'terms'\n >\n>;\n\n/** The development-only shortcut at the top right of the card. */\nexport interface RegistrationFormDevBypass {\n /** What the shortcut does: the button's name and tooltip. */\n label: string;\n /**\n * The values to put in the fields when the button is pressed, as if\n * typed: the checks, the password checklist and the posted values all\n * see them. The confirm fields are filled from the same values, so\n * they match. A field the form does not show is ignored, and a\n * read-only email is kept.\n */\n values?: RegistrationFormDevValues;\n /**\n * True to submit the form right after filling it, through the normal\n * path: the checks still run, reCAPTCHA still runs, a native form\n * still posts. Default false: fill only.\n */\n submit?: boolean;\n /** Called after filling, for a host with a route of its own. */\n onClick?: () => void;\n}\n\n/** Messages from the server, already translated by the host: one per\n * field, plus `form` for a message about the whole form. */\nexport type RegistrationFormErrors = Partial<\n Record<RegistrationFormField | 'form', string>\n>;\n\n/** The host's own form field names, for a native form post. `captcha`\n * names the hidden field that carries the reCAPTCHA token. */\nexport type RegistrationFormFieldNames = Partial<\n Record<RegistrationFormField | 'captcha', string>\n>;\n\nexport interface RegistrationFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Create your account\". Pass it translated. */\n title?: string;\n /** A line under the heading, e.g. \"No installation needed\". Pass it\n * translated. */\n description?: string;\n /** The heading's level. Default 2, for a page that has its own `h1`. */\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 beside the\n * card.\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 * or a list of benefits. It sits outside the form, so nothing in it is\n * posted. Keep any heading inside it below the card's own level.\n */\n children?: ReactNode;\n /**\n * The fields to show. Default: all of them, which is the doctor form.\n * A patient form is `['email', 'password', 'passwordConfirm', 'terms']`.\n * Leave out `emailConfirm` or `passwordConfirm` to drop that confirm\n * field. The list picks fields, it does not order them; email and\n * password always show; `branch` also needs `branches`.\n */\n fields?: readonly RegistrationFormField[];\n /** Values to show when the form opens, such as the email from an\n * invite link. Read once. Never a password. */\n initialValues?: RegistrationFormInitialValues;\n /**\n * Messages from the server, already translated. Each shows on its\n * field until the user changes that field; `form` shows above the\n * fields, as does a message for a field the form does not show.\n *\n * Messages present when the form opens (a page the server rendered\n * after a failed post) take focus: the error summary at the top of the\n * form, which lists each field with a message, or the message above the\n * fields when no field has one.\n *\n * On a React host, when the messages change, both password fields\n * are emptied and focus moves as above. Set `submitting` while you\n * send: the form then also notices an answer that says the same as\n * the last one (another address, also taken), which the messages\n * alone cannot show. Any object works, kept in state or rebuilt on\n * each render (`errors={{ email: emailError }}`).\n */\n errors?: RegistrationFormErrors;\n /**\n * Shows the email from `initialValues` read-only, for a person invited\n * with an address they cannot change here. Off by default: choose it\n * only when the server will refuse any other address. The value is\n * still posted and still read out, there is no confirm email field,\n * and the browser does not check it. Ignored when there is no initial\n * email, so the field is never both empty and locked.\n */\n emailReadOnly?: boolean;\n /** A line under the email field, e.g. \"You can change it later in the\n * settings\". Pass it translated. */\n emailDescription?: string;\n /**\n * Fields that refuse paste and drop, so the user types them, e.g.\n * `['passwordConfirm']`. Default: none. Autofill from the browser or a\n * password manager still works. A refused paste is announced and shown\n * under the field. The host decides: see the docs for the WCAG\n * position, which differs between the email and password fields.\n */\n blockPaste?: readonly RegistrationFormTextField[];\n /**\n * Fields that refuse copy, cut and dragging text out. Default: none.\n * Browsers already refuse to copy from a password field while it is\n * hidden. See the docs for the WCAG position.\n */\n blockCopy?: readonly RegistrationFormTextField[];\n /** The specialities to choose from. The field shows, and is required,\n * only when this has entries. */\n branches?: SelectOption[];\n /**\n * The password rules, shown as a live checklist. Keep them equal to\n * the server's. Default: 12 characters with an uppercase letter, a\n * lowercase letter and a number, counting only `A-Z`, `a-z` and `0-9`\n * (`charset: 'ascii'`), which is the platform's rule.\n */\n passwordPolicy?: UsePasswordRequirementsOptions;\n /**\n * Where \"terms of use\" leads. A path on the same site, or an address\n * written in full (`https://…`). Anything else, such as an address\n * that would lead off the site without saying so, shows the words\n * without a link.\n */\n termsHref?: string;\n /** Where \"privacy policy\" leads. Same rule as `termsHref`. */\n privacyHref?: string;\n /**\n * Replaces the sentence beside the terms box (\"I accept the terms of\n * use and the privacy policy\") with the host's own wording and links,\n * already translated. The legal wording is the host's to choose. When\n * set, `termsHref` and `privacyHref` are not used. The box stays\n * required.\n */\n termsLabel?: ReactNode;\n /** A line shown with the terms box and read out with it, e.g. \"We\n * will not send you any advertising\". Pass it translated. */\n termsDescription?: ReactNode;\n /** Adds \"Already have an account? Sign in\". Same rule as `termsHref`. */\n loginHref?: string;\n /** A Google reCAPTCHA v2 site key of the invisible type. The check\n * runs when the user submits. Leave it out where the server does not\n * verify a token. */\n recaptchaSiteKey?: string;\n /** Replaces the button's \"Create account\". Pass it translated. */\n submitLabel?: string;\n /** True while the host sends the values: the button shows a spinner\n * and a second submit is ignored. */\n submitting?: boolean;\n /**\n * Shows the development-only shortcut button at the top right of the\n * card: it fills the form with the host's `values`, and submits it\n * when asked to. Pass it only when the server says this is a\n * development environment: the kit never decides that itself, holds\n * no test data, and what the shortcut submits goes through the normal\n * path, so the server's own rules still decide. With neither `values`\n * nor `onClick` there is nothing to do and no button.\n */\n devBypass?: RegistrationFormDevBypass;\n /** For React hosts: called with the values once every check has\n * passed. Not called when `fieldNames` is set. */\n onSubmit?: (values: RegistrationFormValues) => void;\n /**\n * For a native form post: the host's own field names, e.g.\n * `{ email: 'registration[email]' }`. When set, the inputs carry\n * these names and the browser posts the form. A field without a name\n * here is not posted: name a confirm field only if the server's form\n * has one, or it may refuse the post as carrying extra fields.\n */\n fieldNames?: RegistrationFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address, query\n * string included, which is what a page reached through an invite link\n * needs. Only an address on this site is accepted: another site is\n * never sent what the user typed, and the post then goes to the\n * current address instead.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token\n * or similar. Not used with `onSubmit`. A name that is also one of\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\nconst registrationFormVariants = cva(\n 'ds:@container/registration ds:w-full ds:text-start ds:text-[var(--foreground)]',\n);\n\nconst rowVariants = cva(\n 'ds:grid ds:grid-cols-1 ds:items-start ds:gap-[var(--spacing-md)]',\n {\n variants: {\n columns: {\n /** A field alone in its row takes the full width. */\n one: '',\n /** Two fields side by side once the card is wide enough. */\n two: 'ds:@[544px]/registration:grid-cols-2',\n },\n },\n defaultVariants: { columns: 'two' },\n },\n);\n\n/** The top of the card: the mark, the heading and its line. */\nconst headerVariants = cva('ds:relative ds:flex ds:gap-[var(--spacing-sm)]', {\n variants: {\n logo: {\n /** A centred column under the mark. */\n true: 'ds:flex-col ds:items-center',\n /** The heading at the start edge, the shortcut at the end. */\n false: 'ds:items-start ds:justify-between',\n },\n },\n defaultVariants: { logo: true },\n});\n\nconst headingBlockVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]',\n {\n variants: {\n centred: { true: 'ds:items-center ds:text-center', false: '' },\n },\n defaultVariants: { centred: true },\n },\n);\n\n/** Where the development shortcut sits: the top inline-end corner. Out\n * of the flow under the mark, so it cannot push the mark off centre. */\nconst shortcutVariants = cva('ds:shrink-0', {\n variants: {\n corner: { true: 'ds:absolute ds:top-0 ds:end-0', false: '' },\n },\n defaultVariants: { corner: true },\n});\n\n// Links inside the card take the text colour and an underline. The kit\n// Link's own colour (`--primary`) falls just below AA on a card in the\n// dark theme, as the booking form's consent links found.\nconst inlineLinkVariants = cva(\n 'ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] 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)]',\n {\n variants: {\n weight: { normal: '', strong: 'ds:font-semibold' },\n },\n defaultVariants: { weight: 'normal' },\n },\n);\n\n// The message above the fields takes focus when there is no field to\n// send the user to, so it shows a ring like anything else that does.\nconst formMessageVariants = 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)]',\n);\n\n/** The `*` beside a required field, as FormField draws it. Decorative:\n * the control itself says it is required. */\nconst requiredMarkVariants = cva(\n 'ds:text-destructive ds:ms-[var(--spacing-xs)]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n// The platform's rule is written in ASCII (`[A-Z]`, `[a-z]`, `\\d`), so\n// the checklist counts the same characters and never shows green for a\n// password the server will refuse.\nconst DEFAULT_PASSWORD_POLICY: UsePasswordRequirementsOptions = {\n minLength: 12,\n uppercase: true,\n lowercase: true,\n digit: true,\n charset: 'ascii',\n};\n\n// A brand name, not interface copy: it reads the same in every language,\n// so it has no translation key.\nconst BRAND_NAME = 'Alfadocs';\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: RegistrationFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\n/** Whether a number could be a real one, by its length for its country. */\nconst isPossiblePhone = (e164: string): boolean =>\n parsePhoneNumberFromString(e164)?.isPossible() ?? false;\n\ninterface InlineLinkProps {\n href: string;\n /** Opens in a new tab, so the form keeps what the user has typed. */\n newTab?: boolean;\n weight?: 'normal' | 'strong';\n /** Emitted as `data-action`. */\n action?: string;\n /** The link's text: `Trans` fills it in from the translation. */\n children?: ReactNode;\n}\n\n// `Trans` hands every element it fills a bookkeeping prop of its own, so\n// these two take named props only and pass nothing else on to the DOM.\n\n/** A link inside a sentence. */\nfunction InlineLink({\n href,\n newTab = false,\n weight,\n action,\n children,\n}: InlineLinkProps) {\n const { t } = useTranslation('ui');\n return (\n <a\n href={href}\n target={newTab ? '_blank' : undefined}\n rel={newTab ? 'noopener noreferrer' : undefined}\n data-action={action}\n className={inlineLinkVariants({ weight })}\n >\n {children}\n {newTab && <span className=\"ds:sr-only\">{t('link.opensInNewTab')}</span>}\n </a>\n );\n}\n\n/** The words a link would wrap, when the host gives no address for it. */\nfunction PlainText({ children }: { children?: ReactNode }) {\n return <>{children}</>;\n}\n\ntype FieldFlags = Partial<Record<RegistrationFormField, boolean>>;\n\n/** Where focus can be sent: a field, or the message above the fields. */\ntype FocusTarget = RegistrationFormField | 'form';\n\n/** Every field but the terms, which is a checkbox under the grid. */\ntype GridField = Exclude<RegistrationFormField, 'terms'>;\n\n/** A field sits beside the one it belongs with. */\nconst FIELD_PAIRS: ReadonlyArray<readonly [GridField, GridField]> = [\n ['firstName', 'lastName'],\n ['email', 'emailConfirm'],\n ['password', 'passwordConfirm'],\n ['phone', 'branch'],\n];\n\n/** The rows of the form, for the fields that show. A pair keeps its\n * row; two fields left alone one after the other share a row, so a\n * form of just email and password puts them side by side. */\nfunction layOutRows(shows: (field: GridField) => boolean): GridField[][] {\n const rows: GridField[][] = [];\n for (const pair of FIELD_PAIRS) {\n const row = pair.filter(shows);\n if (row.length === 0) continue;\n const last = rows[rows.length - 1];\n if (row.length === 1 && last?.length === 1) last.push(row[0]);\n else rows.push(row);\n }\n return rows;\n}\n\ninterface FormState {\n firstName: string;\n lastName: string;\n email: string;\n emailConfirm: string;\n password: string;\n passwordConfirm: string;\n phone: string;\n branch: string;\n terms: boolean;\n}\n\n/* -------------------------------------------------------------------- */\n/* RegistrationForm */\n/* -------------------------------------------------------------------- */\n\n/**\n * The registration form card, for doctors and for patients. The host\n * picks the fields, supplies the page around the card and owns every\n * server rule; see the props for the two ways to submit. The card's\n * text follows the kit's language, like every kit component.\n */\nexport const RegistrationForm = forwardRef<\n HTMLDivElement,\n RegistrationFormProps\n>(\n (\n {\n title,\n description,\n headingLevel = 2,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n fields,\n initialValues,\n errors,\n emailReadOnly = false,\n emailDescription,\n blockPaste,\n blockCopy,\n branches,\n passwordPolicy = DEFAULT_PASSWORD_POLICY,\n termsHref,\n privacyHref,\n termsLabel,\n termsDescription,\n loginHref,\n recaptchaSiteKey,\n submitLabel,\n submitting = false,\n devBypass,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const titleId = useId();\n const fieldIdBase = useId();\n /** The id of a field's wrapper: where the summary's link leads. */\n const fieldId = (field: RegistrationFormField) => `${fieldIdBase}-${field}`;\n const termsErrorId = useId();\n const termsDescriptionId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const hasBranches = Boolean(branches && branches.length > 0);\n // Locked only when there is an address to lock: an empty read-only\n // field would leave the user with no way forward.\n const [hadEmail] = useState(() => Boolean(initialValues?.email));\n const emailLocked = emailReadOnly && hadEmail;\n\n /** Whether the form shows a field. */\n const shows = (field: RegistrationFormField): boolean => {\n if (field === 'email' || field === 'password') return true;\n if (fields && !fields.includes(field)) return false;\n if (field === 'branch') return hasBranches;\n // Nothing to mistype in an address the user cannot type.\n if (field === 'emailConfirm') return !emailLocked;\n return true;\n };\n const shown = REGISTRATION_FORM_FIELDS.filter(shows);\n\n /* ------------------------------ State ----------------------------- */\n\n // Read once. Passwords always start empty.\n const [values, setValues] = useState<FormState>(() => ({\n firstName: initialValues?.firstName ?? '',\n lastName: initialValues?.lastName ?? '',\n email: initialValues?.email ?? '',\n emailConfirm: initialValues?.emailConfirm ?? '',\n password: '',\n passwordConfirm: '',\n phone: initialValues?.phone ?? '',\n branch: initialValues?.branch ?? '',\n terms: initialValues?.terms ?? false,\n }));\n // PhoneInput says whether a number is possible each time it changes.\n const [phonePossible, setPhonePossible] = useState(() =>\n isPossiblePhone(initialValues?.phone ?? ''),\n );\n // A field the user has left. An email that arrives filled in counts,\n // as it does inside EmailInput: both then flag a bad one at once, so\n // the field is never red without a message.\n const [touched, setTouched] = useState<FieldFlags>(() => ({\n email: Boolean(initialValues?.email),\n }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<RegistrationFormErrors>(\n () => errors ?? {},\n );\n\n const set = <K extends keyof FormState>(field: K, value: FormState[K]) => {\n setValues((previous) => ({ ...previous, [field]: value }));\n // The server's message was about the old value.\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n };\n const leave = (field: RegistrationFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n const emptyPasswords = () => {\n setValues((previous) => ({\n ...previous,\n password: '',\n passwordConfirm: '',\n }));\n setTouched((previous) => ({\n ...previous,\n password: false,\n passwordConfirm: false,\n }));\n };\n\n /** The paste and copy switches for one typed field. */\n const clipboard = (field: RegistrationFormTextField) => ({\n blockPaste: blockPaste?.includes(field) ?? false,\n blockCopy: blockCopy?.includes(field) ?? false,\n });\n\n /* ---------------------------- Validation -------------------------- */\n\n const requirements = usePasswordRequirements(passwordPolicy);\n const emailMatch = useFieldMatch({\n value: values.email,\n confirmValue: values.emailConfirm,\n kind: 'email',\n submitted,\n });\n const passwordMatch = useFieldMatch({\n value: values.password,\n confirmValue: values.passwordConfirm,\n kind: 'password',\n submitted,\n });\n\n /** What stops a submit, whether or not the message shows yet. Only\n * a field that shows can stop it. */\n const invalid: Record<RegistrationFormField, boolean> = {\n firstName: shows('firstName') && values.firstName.trim() === '',\n lastName: shows('lastName') && values.lastName.trim() === '',\n // The user cannot fix a locked address, so the server judges it.\n email: !emailLocked && !isEmail(values.email),\n emailConfirm:\n shows('emailConfirm') &&\n (values.emailConfirm === '' || !emailMatch.matches),\n password:\n values.password === '' ||\n !requirements.every((rule) => rule.test(values.password)),\n passwordConfirm:\n shows('passwordConfirm') &&\n (values.passwordConfirm === '' || !passwordMatch.matches),\n phone: shows('phone') && (values.phone === '' || !phonePossible),\n branch: shows('branch') && values.branch === '',\n terms: shows('terms') && !values.terms,\n };\n\n // A message shows once the user has left the field or tried to\n // submit. The terms box waits for a submit: leaving it to follow one\n // of its own links is not a mistake.\n const due = (field: RegistrationFormField) =>\n submitted || (field !== 'terms' && touched[field] === true);\n const required = t('registrationForm.required');\n /** Each grid field's label: on the field, and in the summary. */\n const labels: Record<GridField, string> = {\n firstName: t('registrationForm.firstName'),\n lastName: t('registrationForm.lastName'),\n email: t('registrationForm.email'),\n emailConfirm: t('registrationForm.emailConfirm'),\n password: t('registrationForm.password'),\n passwordConfirm: t('registrationForm.passwordConfirm'),\n phone: t('registrationForm.phone'),\n branch: t('registrationForm.branch'),\n };\n const whenDue = (field: RegistrationFormField, message: string) =>\n due(field) && invalid[field] ? message : undefined;\n\n const ownErrors: Record<RegistrationFormField, string | undefined> = {\n firstName: whenDue('firstName', required),\n lastName: whenDue('lastName', required),\n email: whenDue(\n 'email',\n values.email === '' ? required : t('inputs.email.invalid'),\n ),\n emailConfirm:\n values.emailConfirm === ''\n ? whenDue('emailConfirm', required)\n : emailMatch.error,\n password: whenDue(\n 'password',\n values.password === ''\n ? required\n : t('registrationForm.passwordInvalid'),\n ),\n passwordConfirm:\n values.passwordConfirm === ''\n ? whenDue('passwordConfirm', required)\n : passwordMatch.error,\n phone: whenDue(\n 'phone',\n values.phone === '' ? required : t('registrationForm.phoneInvalid'),\n ),\n branch: whenDue('branch', required),\n terms: whenDue('terms', t('registrationForm.termsRequired')),\n };\n const errorFor = (field: RegistrationFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const controls = useRef<\n Partial<Record<RegistrationFormField, HTMLElement | null>>\n >({});\n const control = useMemo(() => {\n const bind =\n (field: RegistrationFormField) => (node: HTMLElement | null) => {\n controls.current[field] = node;\n };\n return {\n firstName: bind('firstName'),\n lastName: bind('lastName'),\n email: bind('email'),\n emailConfirm: bind('emailConfirm'),\n password: bind('password'),\n passwordConfirm: bind('passwordConfirm'),\n phone: bind('phone'),\n branch: bind('branch'),\n terms: bind('terms'),\n };\n }, []);\n // The addresses stay out of the inputs' `value` attributes, where a\n // copied outerHTML or a session replay could read them. The names do\n // too, through StateBackedTextInput.\n const emailField = useStateBackedInput(values.email, control.email);\n const emailConfirmField = useStateBackedInput(\n values.emailConfirm,\n control.emailConfirm,\n );\n const formMessage = useRef<HTMLDivElement>(null);\n\n /** Where to send the user for a set of server messages: the first\n * field on screen that has one, or the message above the fields\n * when only that says something. */\n const focusTargetFor = (\n messages: RegistrationFormErrors,\n ): FocusTarget | undefined =>\n shown.find((field) => messages[field]) ??\n (hasMessage(messages) ? 'form' : undefined);\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 shown.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(shown, errorFor, openedWithFieldMessage);\n\n // Any other place focus goes: the message above the fields, when no\n // field has one. A new object for each request, so asking twice for the\n // same place moves focus twice. The effect runs after the messages are\n // drawn, so a screen reader lands on something that already says what\n // is wrong.\n const [focusRequest, setFocusRequest] = useState<{\n target: FocusTarget;\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n if (focusRequest.target === 'form') formMessage.current?.focus();\n else controls.current[focusRequest.target]?.focus();\n }, [focusRequest]);\n\n // PhoneInput has no blur event of its own, so listen on its input.\n const showsPhone = shows('phone');\n useEffect(() => {\n const input = controls.current.phone;\n if (!showsPhone || !input) return undefined;\n const onBlur = () =>\n setTouched((previous) =>\n previous.phone ? previous : { ...previous, phone: true },\n );\n input.addEventListener('blur', onBlur);\n return () => input.removeEventListener('blur', onBlur);\n }, [showsPhone]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const form = useRef<HTMLFormElement>(null);\n const captchaInput = useRef<HTMLInputElement>(null);\n\n /* --------------------- Development shortcut ----------------------- */\n\n // Asks for a submit once the filled values are on the page.\n const [submitRequest, setSubmitRequest] = useState<object | null>(null);\n useEffect(() => {\n if (submitRequest) form.current?.requestSubmit();\n }, [submitRequest]);\n\n const runDevBypass = () => {\n const filled = devBypass?.values;\n if (filled) {\n // Through the same state as the user's typing, and only into\n // fields that show. A locked email keeps its address.\n const email = emailLocked ? undefined : filled.email;\n const next: Partial<FormState> = {};\n if (shows('firstName') && filled.firstName !== undefined)\n next.firstName = filled.firstName;\n if (shows('lastName') && filled.lastName !== undefined)\n next.lastName = filled.lastName;\n if (email !== undefined) next.email = email;\n if (shows('emailConfirm') && email !== undefined)\n next.emailConfirm = email;\n if (filled.password !== undefined) next.password = filled.password;\n if (shows('passwordConfirm') && filled.password !== undefined)\n next.passwordConfirm = filled.password;\n if (shows('phone') && filled.phone !== undefined)\n next.phone = filled.phone;\n if (shows('branch') && filled.branch !== undefined)\n next.branch = filled.branch;\n if (shows('terms') && filled.terms !== undefined)\n next.terms = filled.terms;\n setValues((previous) => ({ ...previous, ...next }));\n if (next.phone !== undefined)\n setPhonePossible(isPossiblePhone(next.phone));\n // The server's messages were about the old values.\n setServerErrors((previous) => {\n const kept = { ...previous };\n for (const field of Object.keys(next) as (keyof FormState)[]) {\n kept[field] = undefined;\n }\n return kept;\n });\n if (devBypass.submit) setSubmitRequest({});\n }\n devBypass?.onClick?.();\n };\n\n const submit = useRegistrationSubmit<RegistrationFormField>({\n errors,\n submitting,\n native,\n captcha: Boolean(recaptchaSiteKey),\n firstProblem: () => shown.find((field) => invalid[field]),\n onRefused: (field) => {\n // Every message now shows, listed in the summary, which takes focus.\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n deliver: (captchaToken) => {\n if (native) {\n if (captchaInput.current && captchaToken) {\n captchaInput.current.value = captchaToken;\n }\n form.current?.submit();\n return;\n }\n // A field that does not show is empty, whatever it started with.\n const text = (field: GridField) => (shows(field) ? values[field] : '');\n onSubmit?.({\n firstName: text('firstName'),\n lastName: text('lastName'),\n email: values.email,\n emailConfirm: text('emailConfirm'),\n password: values.password,\n passwordConfirm: text('passwordConfirm'),\n phone: text('phone'),\n branch: text('branch'),\n terms: shows('terms') && values.terms,\n captchaToken,\n });\n },\n onAnswer: (answer) => {\n const next: RegistrationFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n // Never keep a password the server did not accept.\n emptyPasswords();\n setSubmitted(false);\n // The summary when a field has a message, else the message above.\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:\n // the passwords must not come back with it.\n onRestore: emptyPasswords,\n });\n const { busy, captchaFailed } = submit;\n\n // A failed reCAPTCHA check has no field of its own: send the user to\n // the message above the fields, which may be off screen.\n useEffect(() => {\n if (captchaFailed) setFocusRequest({ target: 'form' });\n }, [captchaFailed]);\n\n /* ------------------------------ Render ---------------------------- */\n\n const name = (field: RegistrationFormField) =>\n native ? fieldNames[field] : field;\n const Heading = `h${headingLevel}` as const;\n const termsLink = linkTo(termsHref);\n const privacyLink = linkTo(privacyHref);\n const loginLink = linkTo(loginHref);\n const formAction =\n native && action && isSameSiteHref(action) ? action : undefined;\n // What shows above the fields: the server's message about the whole\n // form, its message about any field that is not on screen (so nothing\n // it says is lost), and a failed reCAPTCHA check.\n const formError =\n [\n serverErrors.form,\n ...REGISTRATION_FORM_FIELDS.filter((field) => !shows(field)).map(\n (field) => serverErrors[field],\n ),\n captchaFailed ? t('inputs.recaptcha.error') : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\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 const termsError = errorFor('terms');\n const termsDescribedBy =\n [\n termsDescription ? termsDescriptionId : undefined,\n termsError ? termsErrorId : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n // The host's extra hidden inputs. The form's own fields keep their\n // names: an extra one that asks for the same name is left out.\n const ownNames = new Set(Object.values(fieldNames ?? {}));\n const extraFields = native ? Object.entries(hiddenFields ?? {}) : [];\n const clashes = extraFields\n .filter(([extraName]) => ownNames.has(extraName))\n .map(([extraName]) => extraName)\n .join(', ');\n useEffect(() => {\n if (clashes && isDevelopment()) {\n console.warn(\n `RegistrationForm: hiddenFields \"${clashes}\" is also named in fieldNames and was left out. The form's own field wins.`,\n );\n }\n }, [clashes]);\n\n const renderField = (field: GridField): ReactNode => {\n switch (field) {\n case 'firstName':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.firstName}\n required\n error={errorFor('firstName')}\n announceError={!summary.lists('firstName')}\n data-field=\"firstName\"\n >\n <StateBackedTextInput\n ref={control.firstName}\n name={name('firstName')}\n autoComplete=\"given-name\"\n value={values.firstName}\n onChange={(event) => set('firstName', event.target.value)}\n onBlur={() => leave('firstName')}\n {...clipboard('firstName')}\n />\n </FormField>\n );\n case 'lastName':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.lastName}\n required\n error={errorFor('lastName')}\n announceError={!summary.lists('lastName')}\n data-field=\"lastName\"\n >\n <StateBackedTextInput\n ref={control.lastName}\n name={name('lastName')}\n autoComplete=\"family-name\"\n value={values.lastName}\n onChange={(event) => set('lastName', event.target.value)}\n onBlur={() => leave('lastName')}\n {...clipboard('lastName')}\n />\n </FormField>\n );\n case 'email':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.email}\n required={!emailLocked}\n description={emailDescription}\n error={errorFor('email')}\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* EmailInput still checks the format and marks the input.\n Its message goes through FormField, so there is one\n message, in one place. Read-only, not disabled: the\n address is still posted and still read out. */}\n <EmailInput\n ref={emailField.ref}\n name={name('email')}\n errorMessage={null}\n disableBuiltInValidation={emailLocked}\n readOnly={emailLocked}\n onChange={emailField.quiet((event) =>\n set('email', event.target.value),\n )}\n onBlur={() => leave('email')}\n {...clipboard('email')}\n />\n </FormField>\n );\n case 'emailConfirm':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.emailConfirm}\n required\n error={errorFor('emailConfirm')}\n announceError={!summary.lists('emailConfirm')}\n data-field=\"emailConfirm\"\n >\n <EmailInput\n ref={emailConfirmField.ref}\n name={name('emailConfirm')}\n disableBuiltInValidation\n onChange={emailConfirmField.quiet((event) =>\n set('emailConfirm', event.target.value),\n )}\n onBlur={() => {\n leave('emailConfirm');\n emailMatch.confirmProps.onBlur();\n }}\n {...clipboard('emailConfirm')}\n />\n </FormField>\n );\n case 'password':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.password}\n required\n error={errorFor('password')}\n announceError={!summary.lists('password')}\n data-field=\"password\"\n >\n {/* PasswordInput names itself \"password\" when given no\n name; an empty one keeps a field out of the post. */}\n <PasswordInput\n ref={control.password}\n name={name('password') ?? ''}\n autoComplete=\"new-password\"\n requirements={requirements}\n value={values.password}\n onChange={(event) => set('password', event.target.value)}\n onBlur={() => leave('password')}\n {...clipboard('password')}\n />\n </FormField>\n );\n case 'passwordConfirm':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.passwordConfirm}\n required\n error={errorFor('passwordConfirm')}\n announceError={!summary.lists('passwordConfirm')}\n data-field=\"passwordConfirm\"\n >\n <PasswordInput\n ref={control.passwordConfirm}\n name={name('passwordConfirm') ?? ''}\n autoComplete=\"new-password\"\n value={values.passwordConfirm}\n onChange={(event) => set('passwordConfirm', event.target.value)}\n onBlur={() => {\n leave('passwordConfirm');\n passwordMatch.confirmProps.onBlur();\n }}\n {...clipboard('passwordConfirm')}\n />\n </FormField>\n );\n case 'phone':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.phone}\n required\n error={errorFor('phone')}\n announceError={!summary.lists('phone')}\n data-field=\"phone\"\n >\n {/* The visible input holds the number as typed. In a native\n post a hidden input carries the full international\n number instead. */}\n <PhoneInput\n ref={control.phone}\n name={native ? undefined : 'phone'}\n value={values.phone}\n onChange={(e164, meta) => {\n set('phone', e164);\n setPhonePossible(meta.isPossible);\n }}\n />\n </FormField>\n );\n case 'branch':\n return (\n <FormField\n key={field}\n id={fieldId(field)}\n label={labels.branch}\n required\n error={errorFor('branch')}\n announceError={!summary.lists('branch')}\n data-field=\"branch\"\n >\n <Select\n ref={control.branch}\n name={name('branch')}\n options={branches ?? []}\n value={values.branch}\n onValueChange={(value) => set('branch', value)}\n />\n </FormField>\n );\n }\n };\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"registration-form\"\n className={registrationFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <div className={headerVariants({ logo: showLogo })}>\n <div className={headingBlockVariants({ centred: showLogo })}>\n {/* The page's logo: read out once, before the heading. */}\n {showLogo && (\n <BrandMark motion={logoMotion} label={BRAND_NAME} />\n )}\n <Heading id={titleId} className=\"type-title-card\">\n {title ?? t('registrationForm.title')}\n </Heading>\n {description && (\n <p className=\"type-body-sm ds:text-[var(--muted-foreground)]\">\n {description}\n </p>\n )}\n </div>\n {devBypass && (devBypass.values || devBypass.onClick) && (\n <div className={shortcutVariants({ corner: showLogo })}>\n <DevBypassButton\n label={devBypass.label}\n onClick={runDevBypass}\n />\n </div>\n )}\n </div>\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 ref={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 const message = errorFor(field) ?? '';\n return {\n field,\n message,\n // \"This field is required.\" does not say which field:\n // the summary names it.\n label:\n message === required && field !== 'terms'\n ? labels[field]\n : undefined,\n targetId: fieldId(field),\n };\n })}\n />\n\n {formError && (\n <Alert\n ref={formMessage}\n id={formMessageId}\n variant=\"error\"\n announce={formMessageAnnounce}\n tabIndex={-1}\n data-field=\"form\"\n className={formMessageVariants()}\n >\n <Alert.Description>{formError}</Alert.Description>\n </Alert>\n )}\n\n {layOutRows(shows).map((row) => (\n <div\n key={row[0]}\n className={rowVariants({\n columns: row.length === 2 ? 'two' : 'one',\n })}\n >\n {row.map(renderField)}\n </div>\n ))}\n {native && showsPhone && fieldNames.phone && (\n <input\n type=\"hidden\"\n name={fieldNames.phone}\n value={values.phone}\n />\n )}\n {native && fieldNames.captcha && (\n <input\n ref={captchaInput}\n type=\"hidden\"\n name={fieldNames.captcha}\n defaultValue=\"\"\n />\n )}\n {extraFields\n .filter(([extraName]) => !ownNames.has(extraName))\n .map(([extraName, value]) => (\n <input\n key={extraName}\n type=\"hidden\"\n name={extraName}\n value={value}\n />\n ))}\n\n {shows('terms') && (\n <div\n id={fieldId('terms')}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n data-field=\"terms\"\n >\n {termsDescription && (\n <p\n id={termsDescriptionId}\n className=\"type-body-sm ds:text-[var(--muted-foreground)]\"\n >\n {termsDescription}\n </p>\n )}\n <Checkbox\n ref={control.terms}\n name={name('terms')}\n value=\"1\"\n checked={values.terms}\n onCheckedChange={(next) => set('terms', next === true)}\n aria-required=\"true\"\n aria-invalid={termsError ? true : undefined}\n aria-describedby={termsDescribedBy}\n label={\n <>\n {termsLabel ?? (\n <Trans\n i18n={i18n}\n ns=\"ui\"\n i18nKey=\"registrationForm.terms\"\n components={{\n terms: termsLink ? (\n <InlineLink href={termsLink} newTab />\n ) : (\n <PlainText />\n ),\n privacy: privacyLink ? (\n <InlineLink href={privacyLink} newTab />\n ) : (\n <PlainText />\n ),\n }}\n />\n )}\n <span\n aria-hidden=\"true\"\n className={requiredMarkVariants()}\n >\n *\n </span>\n </>\n }\n />\n {termsError && (\n <p\n id={termsErrorId}\n // Quiet while the summary lists it: the summary reads it.\n role={summary.lists('terms') ? undefined : 'alert'}\n data-slot=\"error\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <CircleAlert\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0\"\n />\n <span>{termsError}</span>\n </p>\n )}\n </div>\n )}\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('registrationForm.submit')}\n </Button>\n {/* The spinner is decorative and the button is disabled\n while busy, so say it in words. Always mounted: a live\n region announces a change, not its first content. */}\n <p role=\"status\" className=\"ds:sr-only\">\n {busy ? t('chat.message.status.sending') : ''}\n </p>\n\n {loginLink && (\n <p className=\"type-body-sm ds:text-center ds:text-[var(--muted-foreground)]\">\n <Trans\n i18n={i18n}\n ns=\"ui\"\n i18nKey=\"registrationForm.login\"\n components={{\n login: (\n <InlineLink\n href={loginLink}\n weight=\"strong\"\n action=\"login\"\n />\n ),\n }}\n />\n </p>\n )}\n\n {/* Last, so its badge comes after the button and the login\n link in the tab order. Out of the flow: it takes no\n space, so it must not take a gap either. The card says\n when the check fails, so the widget stays quiet. */}\n {recaptchaSiteKey && (\n <div className=\"ds:absolute\">\n <RecaptchaWidget\n ref={submit.captcha.ref}\n siteKey={recaptchaSiteKey}\n size=\"invisible\"\n announceStatus={false}\n onChange={submit.captcha.onChange}\n onError={submit.captcha.onError}\n />\n </div>\n )}\n </form>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nRegistrationForm.displayName = 'RegistrationForm';\n"],"names":["REGISTRATION_FORM_FIELDS","registrationFormVariants","cva","rowVariants","headerVariants","headingBlockVariants","shortcutVariants","inlineLinkVariants","formMessageVariants","requiredMarkVariants","DEFAULT_PASSWORD_POLICY","BRAND_NAME","linkTo","href","isSafeHref","hasMessage","errors","isPossiblePhone","e164","_a","parsePhoneNumberFromString","InlineLink","newTab","weight","action","children","t","useTranslation","jsxs","jsx","PlainText","FIELD_PAIRS","layOutRows","shows","rows","pair","row","last","RegistrationForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","fields","initialValues","emailReadOnly","emailDescription","blockPaste","blockCopy","branches","passwordPolicy","termsHref","privacyHref","termsLabel","termsDescription","loginHref","recaptchaSiteKey","submitLabel","submitting","devBypass","onSubmit","fieldNames","hiddenFields","className","rest","ref","i18n","titleId","useId","fieldIdBase","fieldId","field","termsErrorId","termsDescriptionId","formMessageId","native","hasBranches","hadEmail","useState","emailLocked","shown","values","setValues","phonePossible","setPhonePossible","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","set","value","previous","leave","emptyPasswords","clipboard","requirements","usePasswordRequirements","emailMatch","useFieldMatch","passwordMatch","invalid","isEmail","rule","due","required","labels","whenDue","message","ownErrors","errorFor","controls","useRef","control","useMemo","bind","node","emailField","useStateBackedInput","emailConfirmField","formMessage","focusTargetFor","messages","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","useEffect","_b","showsPhone","input","onBlur","form","captchaInput","submitRequest","setSubmitRequest","runDevBypass","filled","email","next","kept","submit","useRegistrationSubmit","captchaToken","text","answer","busy","captchaFailed","name","Heading","termsLink","privacyLink","loginLink","formAction","isSameSiteHref","formError","formMessageAnnounce","useFormMessageAnnounce","termsError","termsDescribedBy","ownNames","extraFields","clashes","extraName","isDevelopment","renderField","FormField","StateBackedTextInput","event","EmailInput","PasswordInput","PhoneInput","meta","Select","Card","BrandMark","DevBypassButton","ErrorSummary","Alert","Checkbox","Fragment","Trans","CircleAlert","Button","RecaptchaWidget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,MAAMA,KAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAgRMC,KAA2BC;AAAA,EAC/B;AACF,GAEMC,KAAcD;AAAA,EAClB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA;AAAA,QAEP,KAAK;AAAA;AAAA,QAEL,KAAK;AAAA,MAAA;AAAA,IACP;AAAA,IAEF,iBAAiB,EAAE,SAAS,MAAA;AAAA,EAAM;AAEtC,GAGME,KAAiBF,EAAI,kDAAkD;AAAA,EAC3E,UAAU;AAAA,IACR,MAAM;AAAA;AAAA,MAEJ,MAAM;AAAA;AAAA,MAEN,OAAO;AAA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