@alfadocs/ui-kit-debug 1.80.0 → 1.82.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/{address-fields-GnoSkvh6.js → address-fields-CfnXK8RT.js} +4 -4
- package/dist/_chunks/{address-fields-GnoSkvh6.js.map → address-fields-CfnXK8RT.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js → ai-prompt-input-DH_rnV-F.js} +33 -26
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js.map → ai-prompt-input-DH_rnV-F.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js → anamnesis-summary-rows-6gMuu0ZK.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js.map → anamnesis-summary-rows-6gMuu0ZK.js.map} +1 -1
- package/dist/_chunks/{autocomplete-DosDnGie.js → autocomplete-CnB1mHGc.js} +65 -64
- package/dist/_chunks/{autocomplete-DosDnGie.js.map → autocomplete-CnB1mHGc.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js → balance-badge-cell-BHXJS8Ga.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js.map → balance-badge-cell-BHXJS8Ga.js.map} +1 -1
- package/dist/_chunks/{benefit-card-BWBClvdF.js → benefit-card-BcPtRHgM.js} +37 -36
- package/dist/_chunks/{benefit-card-BWBClvdF.js.map → benefit-card-BcPtRHgM.js.map} +1 -1
- package/dist/_chunks/booking-dsgiuhKg.js +4304 -0
- package/dist/_chunks/booking-dsgiuhKg.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js → calendar-appointment-editor-dialog-BuumJbcv.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js.map → calendar-appointment-editor-dialog-BuumJbcv.js.map} +1 -1
- package/dist/_chunks/{city-input-3J3bz9EO.js → city-input-CJVGswxp.js} +2 -2
- package/dist/_chunks/{city-input-3J3bz9EO.js.map → city-input-CJVGswxp.js.map} +1 -1
- package/dist/_chunks/{combobox-vF9O-QoG.js → combobox-CDPm_n0p.js} +93 -92
- package/dist/_chunks/{combobox-vF9O-QoG.js.map → combobox-CDPm_n0p.js.map} +1 -1
- package/dist/_chunks/{command-palette-D9TBzmOG.js → command-palette-B3dVqm9D.js} +68 -68
- package/dist/_chunks/{command-palette-D9TBzmOG.js.map → command-palette-B3dVqm9D.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-DKk94l-d.js → contact-profile-card-Da1vmJQI.js} +115 -102
- package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +1 -0
- package/dist/_chunks/{country-select-CSE2Zm_s.js → country-select-DQ8q7ypA.js} +2 -2
- package/dist/_chunks/{country-select-CSE2Zm_s.js.map → country-select-DQ8q7ypA.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BIPJqw9f.js → face-scheme-BgJGFDTa.js} +2 -2
- package/dist/_chunks/{face-scheme-BIPJqw9f.js.map → face-scheme-BgJGFDTa.js.map} +1 -1
- package/dist/_chunks/{header-settings-BYpVmLip.js → header-settings-CifwJEKB.js} +2 -2
- package/dist/_chunks/{header-settings-BYpVmLip.js.map → header-settings-CifwJEKB.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js → link-cell-renderer-C0ynDik7.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js.map → link-cell-renderer-C0ynDik7.js.map} +1 -1
- package/dist/_chunks/{locale-picker-DzdGDSBI.js → locale-picker-QbT1p60X.js} +39 -38
- package/dist/_chunks/{locale-picker-DzdGDSBI.js.map → locale-picker-QbT1p60X.js.map} +1 -1
- package/dist/_chunks/{map-view-C6MIVaqn.js → map-view-Bvi06RVh.js} +2 -2
- package/dist/_chunks/{map-view-C6MIVaqn.js.map → map-view-Bvi06RVh.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js → marketplace-app-shell-vON3WhD0.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js.map → marketplace-app-shell-vON3WhD0.js.map} +1 -1
- package/dist/_chunks/{multi-select-BOad3za9.js → multi-select-i5MFRpXg.js} +194 -187
- package/dist/_chunks/multi-select-i5MFRpXg.js.map +1 -0
- package/dist/_chunks/{otp-input-BgEZi0py.js → otp-input-gV1446Dw.js} +70 -70
- package/dist/_chunks/otp-input-gV1446Dw.js.map +1 -0
- package/dist/_chunks/{patient-details-B-I9Xkh9.js → patient-details-D0P5eog5.js} +2 -2
- package/dist/_chunks/{patient-details-B-I9Xkh9.js.map → patient-details-D0P5eog5.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js → patient-field-row-R73dZJY6.js} +5 -5
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js.map → patient-field-row-R73dZJY6.js.map} +1 -1
- package/dist/_chunks/{patient-search-CxqNcth4.js → patient-search-Dy0sxcwv.js} +2 -2
- package/dist/_chunks/{patient-search-CxqNcth4.js.map → patient-search-Dy0sxcwv.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js → patient-summary-card-6U74-ivO.js} +2 -2
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js.map → patient-summary-card-6U74-ivO.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js → payment-automation-upsell-D1YdO1xY.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js.map → payment-automation-upsell-D1YdO1xY.js.map} +1 -1
- package/dist/_chunks/{phone-input-C3NrD-nl.js → phone-input-DJ4BN8tG.js} +70 -63
- package/dist/_chunks/{phone-input-C3NrD-nl.js.map → phone-input-DJ4BN8tG.js.map} +1 -1
- package/dist/_chunks/{practice-results-CtOanuzZ.js → practice-results-B61krlwu.js} +2 -2
- package/dist/_chunks/{practice-results-CtOanuzZ.js.map → practice-results-B61krlwu.js.map} +1 -1
- package/dist/_chunks/{province-select-CDjs5obD.js → province-select-CPdTwEob.js} +2 -2
- package/dist/_chunks/{province-select-CDjs5obD.js.map → province-select-CPdTwEob.js.map} +1 -1
- package/dist/_chunks/{registration-form-CNBfUduG.js → registration-form-DmP3YUfp.js} +3 -3
- package/dist/_chunks/{registration-form-CNBfUduG.js.map → registration-form-DmP3YUfp.js.map} +1 -1
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js → send-registration-link-form-CZYOO7NO.js} +2 -2
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js.map → send-registration-link-form-CZYOO7NO.js.map} +1 -1
- package/dist/_chunks/{task-editor-Cpw-NmND.js → task-editor-BOETWbjU.js} +2 -2
- package/dist/_chunks/{task-editor-Cpw-NmND.js.map → task-editor-BOETWbjU.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js → use-appointment-details-read-CWN-nJCZ.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js.map → use-appointment-details-read-CWN-nJCZ.js.map} +1 -1
- package/dist/agent-catalog.json +4 -4
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/benefit-card/benefit-card.d.ts +7 -1
- package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +35 -2
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/code-step.d.ts +4 -2
- package/dist/components/booking/code-step.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +2 -0
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/handover.d.ts +12 -0
- package/dist/components/booking/handover.d.ts.map +1 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/reserved.d.ts +24 -0
- package/dist/components/booking/reserved.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +3 -1
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +4 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/locale-picker/locale-picker.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/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/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +8 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +8 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +8 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +8 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +8 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +8 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +8 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +8 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +8 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +8 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +8 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +8 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +8 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +8 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +8 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +8 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +8 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +8 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +8 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +8 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +8 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +8 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +8 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +8 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +8 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +8 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +8 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +8 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +8 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +8 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +8 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +30 -30
- package/dist/locales/ar.json +8 -0
- package/dist/locales/de.json +8 -0
- package/dist/locales/el.json +8 -0
- package/dist/locales/en.json +8 -0
- package/dist/locales/es.json +8 -0
- package/dist/locales/fr.json +8 -0
- package/dist/locales/hi.json +8 -0
- package/dist/locales/it.json +8 -0
- package/dist/locales/ja.json +8 -0
- package/dist/locales/nl.json +8 -0
- package/dist/locales/pl.json +8 -0
- package/dist/locales/pt.json +8 -0
- package/dist/locales/ro.json +8 -0
- package/dist/locales/ru.json +8 -0
- package/dist/locales/sq.json +8 -0
- package/dist/locales/sv.json +8 -0
- package/dist/locales/tr.json +8 -0
- package/dist/locales/zh.json +8 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-By4I_1A-.js +0 -4068
- package/dist/_chunks/booking-By4I_1A-.js.map +0 -1
- package/dist/_chunks/contact-profile-card-DKk94l-d.js.map +0 -1
- package/dist/_chunks/multi-select-BOad3za9.js.map +0 -1
- package/dist/_chunks/otp-input-BgEZi0py.js.map +0 -1
|
@@ -10,7 +10,7 @@ import { C as B } from "./card-BA4Ig_kn.js";
|
|
|
10
10
|
import { D as Ze } from "./date-picker-CdhXlgVI.js";
|
|
11
11
|
import { E as Ve } from "./error-summary-mGxIyDAY.js";
|
|
12
12
|
import { F } from "./form-field-CyHfOVKF.js";
|
|
13
|
-
import { P as ue } from "./phone-input-
|
|
13
|
+
import { P as ue } from "./phone-input-DJ4BN8tG.js";
|
|
14
14
|
import { a as en, i as nn } from "./safe-href-5dbsfbQn.js";
|
|
15
15
|
import { u as ge } from "./use-state-backed-input-DhRQo6gM.js";
|
|
16
16
|
import { u as Ce } from "./use-field-match-C8ug3sdQ.js";
|
|
@@ -406,4 +406,4 @@ export {
|
|
|
406
406
|
q as S,
|
|
407
407
|
fn as a
|
|
408
408
|
};
|
|
409
|
-
//# sourceMappingURL=send-registration-link-form-
|
|
409
|
+
//# sourceMappingURL=send-registration-link-form-CZYOO7NO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-registration-link-form-vTn1HxjA.js","sources":["../../src/patterns/send-registration-link-form/send-registration-link-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* SendRegistrationLinkForm: the form sales use in the admin area to */\n/* send a doctor a registration link. */\n/* */\n/* Email, confirm email, mobile phone, confirm phone and the last day the link allows */\n/* login. Every prop is data, so a server-rendered page can mount it */\n/* from JSON. The browser posts a real form to the host's own field */\n/* names; the card checks what a browser can check first. The host */\n/* keeps every server rule. The link itself is never shown. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n format,\n isAfter,\n isBefore,\n isValid,\n parseISO,\n startOfDay,\n} from 'date-fns';\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/min';\nimport isEmail from 'validator/lib/isEmail';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { DatePicker } from '../../components/date-picker';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { PhoneInput } from '../../components/phone-input';\nimport { isSafeHref, isSameSiteHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const SEND_REGISTRATION_LINK_FIELDS = [\n 'email',\n 'emailConfirm',\n 'phone',\n 'phoneConfirm',\n 'allowLoginUntil',\n] as const;\n\nexport type SendRegistrationLinkField =\n (typeof SEND_REGISTRATION_LINK_FIELDS)[number];\n\n/** What `onSubmit` receives once every check has passed. */\nexport interface SendRegistrationLinkValues {\n email: string;\n /** As typed. It matches `email` apart from case and outer spaces. */\n emailConfirm: string;\n /** In E.164 form, e.g. `+393331234567`. */\n phone: string;\n /** In E.164 form. Equal to `phone`. */\n phoneConfirm: string;\n /** `yyyy-MM-dd`. */\n allowLoginUntil: string;\n}\n\n/** Values to show when the form opens, e.g. after a refused post.\n * `allowLoginUntil` is `yyyy-MM-dd`. */\nexport type SendRegistrationLinkInitialValues =\n Partial<SendRegistrationLinkValues>;\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 SendRegistrationLinkErrors = Partial<\n Record<SendRegistrationLinkField | 'form', string>\n>;\n\n/** The host's own form field names, e.g. `send_registration_link[email]`. */\nexport type SendRegistrationLinkFieldNames = Partial<\n Record<SendRegistrationLinkField, string>\n>;\n\n/** Guidance for the person sending, in the host's own words. */\nexport interface SendRegistrationLinkGuidance {\n /** The notice's heading. Pass it translated. */\n title: string;\n /** One short point each. Pass them translated. Plain text. */\n points: readonly string[];\n}\n\n/** The result of a send, shown instead of the form. */\nexport interface SendRegistrationLinkSent {\n /** The address the email went to. */\n email: string;\n /** The last day the link allows login, `yyyy-MM-dd`. */\n allowLoginUntil: string;\n}\n\nexport interface SendRegistrationLinkFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Send a registration link\". Pass it translated. */\n title?: string;\n /** The heading's level. Default 2, for a page that has its own `h1`. */\n headingLevel?: 1 | 2 | 3;\n /** A warning-style notice above the form. The kit has no copy for it. */\n guidance?: SendRegistrationLinkGuidance;\n /** The first day that can be chosen, `yyyy-MM-dd`. Default: tomorrow. */\n minDate?: string;\n /** The last day that can be chosen, `yyyy-MM-dd`. Default: no limit.\n * Keep it equal to the server's. */\n maxDate?: string;\n /** Values to show when the form opens. Read once. */\n initialValues?: SendRegistrationLinkInitialValues;\n /** Messages from the server. Each shows on its field until the user\n * changes that field, and the form takes focus when they are present\n * at load. */\n errors?: SendRegistrationLinkErrors;\n /** Fields that refuse paste, so the user types them. Default: none.\n * Refusing a paste in `phoneConfirm` is silent: use it with care. */\n blockPaste?: readonly ('email' | 'emailConfirm' | 'phoneConfirm')[];\n /** Replaces the button's \"Send registration link\". Translated. */\n submitLabel?: string;\n /** True while a React host sends the values. */\n submitting?: boolean;\n /** Shows the result instead of the form. */\n sent?: SendRegistrationLinkSent;\n /** Where \"Send another link\" leads. Same-site path or full address. */\n sendAnotherHref?: string;\n /** For a native form post: the host's field names. When set, the\n * browser posts the form. */\n fieldNames?: SendRegistrationLinkFieldNames;\n /** Where the post goes. Default: the current address. Same site only. */\n action?: string;\n /** Extra hidden inputs for a native post, by name: the CSRF token. */\n hiddenFields?: Readonly<Record<string, string>>;\n /** For React hosts: called once every check has passed. Not called when\n * `fieldNames` is set. */\n onSubmit?: (values: SendRegistrationLinkValues) => void;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:w-full ds:[max-inline-size:36rem] ds:text-start ds:text-[var(--foreground)]',\n);\n\nconst isoDay = (date: Date): string => format(date, 'yyyy-MM-dd');\n\n/** A `yyyy-MM-dd` string as a local date, or nothing. */\nconst readDay = (value: string | undefined): Date | undefined => {\n if (!value) return undefined;\n const day = parseISO(value);\n return isValid(day) ? startOfDay(day) : undefined;\n};\n\nconst isPossiblePhone = (e164: string): boolean =>\n parsePhoneNumberFromString(e164)?.isPossible() ?? false;\n\nconst hasMessage = (errors: SendRegistrationLinkErrors): boolean =>\n Object.values(errors).some(Boolean);\n\n/* -------------------------------------------------------------------- */\n/* SendRegistrationLinkForm */\n/* -------------------------------------------------------------------- */\n\nexport const SendRegistrationLinkForm = forwardRef<\n HTMLDivElement,\n SendRegistrationLinkFormProps\n>(\n (\n {\n title,\n headingLevel = 2,\n guidance,\n minDate,\n maxDate,\n initialValues,\n errors,\n blockPaste,\n submitLabel,\n submitting = false,\n sent,\n sendAnotherHref,\n fieldNames,\n action,\n hiddenFields,\n onSubmit,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const titleId = useId();\n const fieldIdBase = useId();\n const fieldId = (field: SendRegistrationLinkField) =>\n `${fieldIdBase}-${field}`;\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const Heading = `h${headingLevel}` as const;\n\n // The allowed days, whole days in the visitor's time zone. The default\n // first day is tomorrow, worked out once.\n const [tomorrow] = useState(() => {\n const day = startOfDay(new Date());\n day.setDate(day.getDate() + 1);\n return day;\n });\n const first = readDay(minDate) ?? tomorrow;\n const last = readDay(maxDate);\n const inRange = (day: Date) =>\n !isBefore(day, first) && !(last && isAfter(day, last));\n\n /* ------------------------------ State ----------------------------- */\n\n const [values, setValues] = useState(() => ({\n email: initialValues?.email ?? '',\n emailConfirm: initialValues?.emailConfirm ?? '',\n phone: initialValues?.phone ?? '',\n phoneConfirm: initialValues?.phoneConfirm ?? '',\n }));\n const [day, setDay] = useState<Date | undefined>(() =>\n readDay(initialValues?.allowLoginUntil),\n );\n const [phonePossible, setPhonePossible] = useState(() =>\n isPossiblePhone(initialValues?.phone ?? ''),\n );\n const [touched, setTouched] = useState<\n Partial<Record<SendRegistrationLinkField, boolean>>\n >(() => ({ email: Boolean(initialValues?.email) }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] =\n useState<SendRegistrationLinkErrors>(() => errors ?? {});\n\n const clearServer = (field: SendRegistrationLinkField) =>\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n const set = (\n field: 'email' | 'emailConfirm' | 'phone' | 'phoneConfirm',\n value: string,\n ) => {\n setValues((previous) => ({ ...previous, [field]: value }));\n clearServer(field);\n };\n const leave = (field: SendRegistrationLinkField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n\n /* ---------------------------- Validation -------------------------- */\n\n // The same comparison the server makes: trimmed, ignoring case.\n const emailMatch = useFieldMatch({\n value: values.email,\n confirmValue: values.emailConfirm,\n kind: 'email',\n submitted,\n });\n\n // Both phones are E.164 values, the ones the form posts.\n const phoneMatch = useFieldMatch({\n value: values.phone,\n confirmValue: values.phoneConfirm,\n kind: 'phone',\n submitted,\n });\n\n const invalid: Record<SendRegistrationLinkField, boolean> = {\n email: !isEmail(values.email),\n emailConfirm: values.emailConfirm === '' || !emailMatch.matches,\n phone: values.phone === '' || !phonePossible,\n phoneConfirm: values.phoneConfirm === '' || !phoneMatch.matches,\n allowLoginUntil: !day || !inRange(day),\n };\n const required = t('registrationForm.required');\n const formatDay = (value: Date) =>\n new Intl.DateTimeFormat(i18n.language, { dateStyle: 'medium' }).format(\n value,\n );\n const labels: Record<SendRegistrationLinkField, string> = {\n email: t('registrationForm.email'),\n emailConfirm: t('registrationForm.emailConfirm'),\n phone: t('sendRegistrationLink.phone'),\n phoneConfirm: t('sendRegistrationLink.phoneConfirm'),\n allowLoginUntil: t('sendRegistrationLink.allowLoginUntil'),\n };\n // A message shows once the user has left the field or tried to submit.\n // A date waits for a submit, or a value out of range: leaving the\n // field to open the calendar is not a mistake.\n const due = (field: SendRegistrationLinkField) =>\n submitted ||\n (field === 'allowLoginUntil'\n ? day !== undefined\n : touched[field] === true);\n const whenDue = (field: SendRegistrationLinkField, message: string) =>\n due(field) && invalid[field] ? message : undefined;\n const ownErrors: Record<SendRegistrationLinkField, string | undefined> = {\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 phone: whenDue(\n 'phone',\n values.phone === '' ? required : t('registrationForm.phoneInvalid'),\n ),\n phoneConfirm:\n values.phoneConfirm === ''\n ? whenDue('phoneConfirm', required)\n : phoneMatch.error,\n allowLoginUntil: whenDue(\n 'allowLoginUntil',\n !day\n ? required\n : t('sendRegistrationLink.dateOutOfRange', {\n min: formatDay(first),\n max: last ? formatDay(last) : '…',\n }),\n ),\n };\n const errorFor = (field: SendRegistrationLinkField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const form = useRef<HTMLFormElement>(null);\n const formMessage = useRef<HTMLDivElement>(null);\n const emailRef = useRef<HTMLInputElement | null>(null);\n const emailConfirmRef = useRef<HTMLInputElement | null>(null);\n // The addresses stay out of the inputs' `value` attributes.\n const emailField = useStateBackedInput(values.email, emailRef);\n const emailConfirmField = useStateBackedInput(\n values.emailConfirm,\n emailConfirmRef,\n );\n\n const focusField = (field: SendRegistrationLinkField | 'form') => {\n if (field === 'form') {\n formMessage.current?.focus();\n return;\n }\n form.current\n ?.querySelector<HTMLElement>(`[data-field=\"${field}\"] input`)\n ?.focus();\n };\n const focusTargetFor = (messages: SendRegistrationLinkErrors) =>\n SEND_REGISTRATION_LINK_FIELDS.find((field) => messages[field]) ??\n (hasMessage(messages) ? ('form' as const) : undefined);\n\n const [openedWithFieldMessage] = useState(() =>\n SEND_REGISTRATION_LINK_FIELDS.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(\n SEND_REGISTRATION_LINK_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n const [focusRequest, setFocusRequest] = useState<{\n target: SendRegistrationLinkField | 'form';\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (focusRequest) focusField(focusRequest.target);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusRequest]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<SendRegistrationLinkField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () =>\n SEND_REGISTRATION_LINK_FIELDS.find((field) => invalid[field]),\n onRefused: (field) => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n deliver: () =>\n onSubmit?.({\n ...values,\n allowLoginUntil: day ? isoDay(day) : '',\n }),\n onAnswer: (answer) => {\n const next: SendRegistrationLinkErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n setSubmitted(false);\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n });\n\n /* ------------------------------ Render ---------------------------- */\n\n const name = (field: SendRegistrationLinkField) =>\n native ? fieldNames[field] : field;\n const formAction =\n native && action && isSameSiteHref(action) ? action : undefined;\n const formError = serverErrors.form;\n const formMessageAnnounce = useFormMessageAnnounce(\n formError,\n summary.listed.length > 0,\n );\n const ownNames = new Set(Object.values(fieldNames ?? {}));\n const extraFields = native\n ? Object.entries(hiddenFields ?? {}).filter(\n ([extra]) => !ownNames.has(extra),\n )\n : [];\n const anotherLink =\n sendAnotherHref && isSafeHref(sendAnotherHref)\n ? sendAnotherHref\n : undefined;\n const sentDay = readDay(sent?.allowLoginUntil);\n\n if (sent) {\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"send-registration-link-form\"\n data-state=\"sent\"\n className={rootVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <Heading className=\"type-title-card\">\n {title ?? t('sendRegistrationLink.title')}\n </Heading>\n <Alert variant=\"success\" data-slot=\"sent\">\n <Alert.Title as=\"p\">\n {t('sendRegistrationLink.sentTitle')}\n </Alert.Title>\n <Alert.Description>\n {t('sendRegistrationLink.sentEmail', { email: sent.email })}\n </Alert.Description>\n {sentDay && (\n <Alert.Description>\n {t('sendRegistrationLink.sentUntil', {\n date: formatDay(sentDay),\n })}\n </Alert.Description>\n )}\n </Alert>\n {anotherLink && (\n <Button asChild intent=\"secondary\" data-action=\"send-another\">\n <a href={anotherLink}>\n {t('sendRegistrationLink.sendAnother')}\n </a>\n </Button>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"send-registration-link-form\"\n className={rootVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <Heading id={titleId} className=\"type-title-card\">\n {title ?? t('sendRegistrationLink.title')}\n </Heading>\n\n {guidance && (\n <Alert variant=\"warning\" data-slot=\"guidance\">\n <Alert.Title as=\"p\">{guidance.title}</Alert.Title>\n <ul className=\"ds:mx-0 ds:mb-0 ds:mt-[var(--spacing-xs)] ds:ps-[var(--spacing-lg)] ds:list-disc type-body-sm\">\n {guidance.points.map((point) => (\n <li key={point}>{point}</li>\n ))}\n </ul>\n </Alert>\n )}\n\n <form\n ref={form}\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={submit.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 aria-describedby={formError ? formMessageId : undefined}\n errors={summary.listed.map((field) => {\n const message = errorFor(field) ?? '';\n return {\n field,\n message,\n label: message === required ? labels[field] : 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 >\n <Alert.Description>{formError}</Alert.Description>\n </Alert>\n )}\n\n <FormField\n id={fieldId('email')}\n label={labels.email}\n required\n error={errorFor('email')}\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n <EmailInput\n ref={emailField.ref}\n name={name('email')}\n errorMessage={null}\n onChange={emailField.quiet((event) =>\n set('email', event.target.value),\n )}\n onBlur={() => leave('email')}\n blockPaste={blockPaste?.includes('email') ?? false}\n />\n </FormField>\n\n <FormField\n id={fieldId('emailConfirm')}\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 blockPaste={blockPaste?.includes('emailConfirm') ?? false}\n />\n </FormField>\n\n <FormField\n id={fieldId('phone')}\n label={labels.phone}\n required\n description={t('sendRegistrationLink.phoneDescription')}\n error={errorFor('phone')}\n announceError={!summary.lists('phone')}\n data-field=\"phone\"\n onBlur={() => leave('phone')}\n >\n {/* The visible input holds the number as typed; a hidden\n input carries the full international number. */}\n <PhoneInput\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 <FormField\n id={fieldId('phoneConfirm')}\n label={labels.phoneConfirm}\n required\n error={errorFor('phoneConfirm')}\n announceError={!summary.lists('phoneConfirm')}\n data-field=\"phoneConfirm\"\n onBlur={() => {\n leave('phoneConfirm');\n phoneMatch.confirmProps.onBlur();\n }}\n onPasteCapture={\n blockPaste?.includes('phoneConfirm')\n ? (event) => event.preventDefault()\n : undefined\n }\n >\n <PhoneInput\n name={native ? undefined : 'phoneConfirm'}\n value={values.phoneConfirm}\n onChange={(e164) => set('phoneConfirm', e164)}\n />\n </FormField>\n\n <FormField\n id={fieldId('allowLoginUntil')}\n label={labels.allowLoginUntil}\n required\n error={errorFor('allowLoginUntil')}\n announceError={!summary.lists('allowLoginUntil')}\n data-field=\"allowLoginUntil\"\n >\n <DatePicker\n value={day}\n minDate={first}\n maxDate={last}\n onChange={(next) => {\n setDay(next);\n clearServer('allowLoginUntil');\n }}\n />\n </FormField>\n\n {native && fieldNames.phone && (\n <input\n type=\"hidden\"\n name={fieldNames.phone}\n value={values.phone}\n />\n )}\n {native && fieldNames.phoneConfirm && (\n <input\n type=\"hidden\"\n name={fieldNames.phoneConfirm}\n value={values.phoneConfirm}\n />\n )}\n {native && fieldNames.allowLoginUntil && (\n <input\n type=\"hidden\"\n name={fieldNames.allowLoginUntil}\n value={day ? isoDay(day) : ''}\n />\n )}\n {extraFields.map(([extra, value]) => (\n <input key={extra} type=\"hidden\" name={extra} value={value} />\n ))}\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={submit.busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('sendRegistrationLink.submit')}\n </Button>\n <p role=\"status\" className=\"ds:sr-only\">\n {submit.busy ? t('chat.message.status.sending') : ''}\n </p>\n </form>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nSendRegistrationLinkForm.displayName = 'SendRegistrationLinkForm';\n"],"names":["SEND_REGISTRATION_LINK_FIELDS","rootVariants","cva","isoDay","date","format","readDay","value","day","parseISO","isValid","startOfDay","isPossiblePhone","e164","_a","parsePhoneNumberFromString","hasMessage","errors","SendRegistrationLinkForm","forwardRef","title","headingLevel","guidance","minDate","maxDate","initialValues","blockPaste","submitLabel","submitting","sent","sendAnotherHref","fieldNames","action","hiddenFields","onSubmit","className","rest","ref","t","i18n","useTranslation","titleId","useId","fieldIdBase","fieldId","field","formMessageId","native","Heading","tomorrow","useState","first","last","inRange","isBefore","isAfter","values","setValues","setDay","phonePossible","setPhonePossible","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","clearServer","previous","set","leave","emailMatch","useFieldMatch","phoneMatch","invalid","isEmail","required","formatDay","labels","due","whenDue","message","ownErrors","errorFor","form","useRef","formMessage","emailRef","emailConfirmRef","emailField","useStateBackedInput","emailConfirmField","focusField","_c","_b","focusTargetFor","messages","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","useEffect","submit","useRegistrationSubmit","answer","next","name","formAction","isSameSiteHref","formError","formMessageAnnounce","useFormMessageAnnounce","ownNames","extraFields","extra","anotherLink","isSafeHref","sentDay","jsx","Card","jsxs","Alert","Button","point","ErrorSummary","FormField","EmailInput","event","PhoneInput","meta","DatePicker"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,IAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAkGMC,KAAeC;AAAA,EACnB;AACF,GAEMC,KAAS,CAACC,MAAuBC,GAAOD,GAAM,YAAY,GAG1DE,IAAU,CAACC,MAAgD;AAC/D,MAAI,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A;AAAA,oBACC,MAAK;AAAA,oBACL,MAAMzF,EAAW;AAAA,oBACjB,OAAOvB,IAAML,GAAOK,CAAG,IAAI;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAG9B2G,GAAY,IAAI,CAAC,CAACC,GAAO7G,CAAK,MAC7B,gBAAAiH,EAAC,SAAA,EAAkB,MAAK,UAAS,MAAMJ,GAAO,OAAA7G,EAAA,GAAlC6G,CAAgD,CAC7D;AAAA,gBAED,gBAAAI;AAAA,kBAACI;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,MAAK;AAAA,oBACL,SAASpB,EAAO;AAAA,oBAChB,WAAU;AAAA,oBACV,eAAY;AAAA,oBAEX,UAAA7E,MAAeW,EAAE,6BAA6B;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEjD,gBAAAkF,EAAC,KAAA,EAAE,MAAK,UAAS,WAAU,cACxB,UAAAhB,EAAO,OAAOlE,EAAE,6BAA6B,IAAI,GAAA,CACpD;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACApB,GAAyB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"send-registration-link-form-CZYOO7NO.js","sources":["../../src/patterns/send-registration-link-form/send-registration-link-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* SendRegistrationLinkForm: the form sales use in the admin area to */\n/* send a doctor a registration link. */\n/* */\n/* Email, confirm email, mobile phone, confirm phone and the last day the link allows */\n/* login. Every prop is data, so a server-rendered page can mount it */\n/* from JSON. The browser posts a real form to the host's own field */\n/* names; the card checks what a browser can check first. The host */\n/* keeps every server rule. The link itself is never shown. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport {\n format,\n isAfter,\n isBefore,\n isValid,\n parseISO,\n startOfDay,\n} from 'date-fns';\nimport { parsePhoneNumberFromString } from 'libphonenumber-js/min';\nimport isEmail from 'validator/lib/isEmail';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { DatePicker } from '../../components/date-picker';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { PhoneInput } from '../../components/phone-input';\nimport { isSafeHref, isSameSiteHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const SEND_REGISTRATION_LINK_FIELDS = [\n 'email',\n 'emailConfirm',\n 'phone',\n 'phoneConfirm',\n 'allowLoginUntil',\n] as const;\n\nexport type SendRegistrationLinkField =\n (typeof SEND_REGISTRATION_LINK_FIELDS)[number];\n\n/** What `onSubmit` receives once every check has passed. */\nexport interface SendRegistrationLinkValues {\n email: string;\n /** As typed. It matches `email` apart from case and outer spaces. */\n emailConfirm: string;\n /** In E.164 form, e.g. `+393331234567`. */\n phone: string;\n /** In E.164 form. Equal to `phone`. */\n phoneConfirm: string;\n /** `yyyy-MM-dd`. */\n allowLoginUntil: string;\n}\n\n/** Values to show when the form opens, e.g. after a refused post.\n * `allowLoginUntil` is `yyyy-MM-dd`. */\nexport type SendRegistrationLinkInitialValues =\n Partial<SendRegistrationLinkValues>;\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 SendRegistrationLinkErrors = Partial<\n Record<SendRegistrationLinkField | 'form', string>\n>;\n\n/** The host's own form field names, e.g. `send_registration_link[email]`. */\nexport type SendRegistrationLinkFieldNames = Partial<\n Record<SendRegistrationLinkField, string>\n>;\n\n/** Guidance for the person sending, in the host's own words. */\nexport interface SendRegistrationLinkGuidance {\n /** The notice's heading. Pass it translated. */\n title: string;\n /** One short point each. Pass them translated. Plain text. */\n points: readonly string[];\n}\n\n/** The result of a send, shown instead of the form. */\nexport interface SendRegistrationLinkSent {\n /** The address the email went to. */\n email: string;\n /** The last day the link allows login, `yyyy-MM-dd`. */\n allowLoginUntil: string;\n}\n\nexport interface SendRegistrationLinkFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Send a registration link\". Pass it translated. */\n title?: string;\n /** The heading's level. Default 2, for a page that has its own `h1`. */\n headingLevel?: 1 | 2 | 3;\n /** A warning-style notice above the form. The kit has no copy for it. */\n guidance?: SendRegistrationLinkGuidance;\n /** The first day that can be chosen, `yyyy-MM-dd`. Default: tomorrow. */\n minDate?: string;\n /** The last day that can be chosen, `yyyy-MM-dd`. Default: no limit.\n * Keep it equal to the server's. */\n maxDate?: string;\n /** Values to show when the form opens. Read once. */\n initialValues?: SendRegistrationLinkInitialValues;\n /** Messages from the server. Each shows on its field until the user\n * changes that field, and the form takes focus when they are present\n * at load. */\n errors?: SendRegistrationLinkErrors;\n /** Fields that refuse paste, so the user types them. Default: none.\n * Refusing a paste in `phoneConfirm` is silent: use it with care. */\n blockPaste?: readonly ('email' | 'emailConfirm' | 'phoneConfirm')[];\n /** Replaces the button's \"Send registration link\". Translated. */\n submitLabel?: string;\n /** True while a React host sends the values. */\n submitting?: boolean;\n /** Shows the result instead of the form. */\n sent?: SendRegistrationLinkSent;\n /** Where \"Send another link\" leads. Same-site path or full address. */\n sendAnotherHref?: string;\n /** For a native form post: the host's field names. When set, the\n * browser posts the form. */\n fieldNames?: SendRegistrationLinkFieldNames;\n /** Where the post goes. Default: the current address. Same site only. */\n action?: string;\n /** Extra hidden inputs for a native post, by name: the CSRF token. */\n hiddenFields?: Readonly<Record<string, string>>;\n /** For React hosts: called once every check has passed. Not called when\n * `fieldNames` is set. */\n onSubmit?: (values: SendRegistrationLinkValues) => void;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva(\n 'ds:w-full ds:[max-inline-size:36rem] ds:text-start ds:text-[var(--foreground)]',\n);\n\nconst isoDay = (date: Date): string => format(date, 'yyyy-MM-dd');\n\n/** A `yyyy-MM-dd` string as a local date, or nothing. */\nconst readDay = (value: string | undefined): Date | undefined => {\n if (!value) return undefined;\n const day = parseISO(value);\n return isValid(day) ? startOfDay(day) : undefined;\n};\n\nconst isPossiblePhone = (e164: string): boolean =>\n parsePhoneNumberFromString(e164)?.isPossible() ?? false;\n\nconst hasMessage = (errors: SendRegistrationLinkErrors): boolean =>\n Object.values(errors).some(Boolean);\n\n/* -------------------------------------------------------------------- */\n/* SendRegistrationLinkForm */\n/* -------------------------------------------------------------------- */\n\nexport const SendRegistrationLinkForm = forwardRef<\n HTMLDivElement,\n SendRegistrationLinkFormProps\n>(\n (\n {\n title,\n headingLevel = 2,\n guidance,\n minDate,\n maxDate,\n initialValues,\n errors,\n blockPaste,\n submitLabel,\n submitting = false,\n sent,\n sendAnotherHref,\n fieldNames,\n action,\n hiddenFields,\n onSubmit,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const titleId = useId();\n const fieldIdBase = useId();\n const fieldId = (field: SendRegistrationLinkField) =>\n `${fieldIdBase}-${field}`;\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const Heading = `h${headingLevel}` as const;\n\n // The allowed days, whole days in the visitor's time zone. The default\n // first day is tomorrow, worked out once.\n const [tomorrow] = useState(() => {\n const day = startOfDay(new Date());\n day.setDate(day.getDate() + 1);\n return day;\n });\n const first = readDay(minDate) ?? tomorrow;\n const last = readDay(maxDate);\n const inRange = (day: Date) =>\n !isBefore(day, first) && !(last && isAfter(day, last));\n\n /* ------------------------------ State ----------------------------- */\n\n const [values, setValues] = useState(() => ({\n email: initialValues?.email ?? '',\n emailConfirm: initialValues?.emailConfirm ?? '',\n phone: initialValues?.phone ?? '',\n phoneConfirm: initialValues?.phoneConfirm ?? '',\n }));\n const [day, setDay] = useState<Date | undefined>(() =>\n readDay(initialValues?.allowLoginUntil),\n );\n const [phonePossible, setPhonePossible] = useState(() =>\n isPossiblePhone(initialValues?.phone ?? ''),\n );\n const [touched, setTouched] = useState<\n Partial<Record<SendRegistrationLinkField, boolean>>\n >(() => ({ email: Boolean(initialValues?.email) }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] =\n useState<SendRegistrationLinkErrors>(() => errors ?? {});\n\n const clearServer = (field: SendRegistrationLinkField) =>\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n const set = (\n field: 'email' | 'emailConfirm' | 'phone' | 'phoneConfirm',\n value: string,\n ) => {\n setValues((previous) => ({ ...previous, [field]: value }));\n clearServer(field);\n };\n const leave = (field: SendRegistrationLinkField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n\n /* ---------------------------- Validation -------------------------- */\n\n // The same comparison the server makes: trimmed, ignoring case.\n const emailMatch = useFieldMatch({\n value: values.email,\n confirmValue: values.emailConfirm,\n kind: 'email',\n submitted,\n });\n\n // Both phones are E.164 values, the ones the form posts.\n const phoneMatch = useFieldMatch({\n value: values.phone,\n confirmValue: values.phoneConfirm,\n kind: 'phone',\n submitted,\n });\n\n const invalid: Record<SendRegistrationLinkField, boolean> = {\n email: !isEmail(values.email),\n emailConfirm: values.emailConfirm === '' || !emailMatch.matches,\n phone: values.phone === '' || !phonePossible,\n phoneConfirm: values.phoneConfirm === '' || !phoneMatch.matches,\n allowLoginUntil: !day || !inRange(day),\n };\n const required = t('registrationForm.required');\n const formatDay = (value: Date) =>\n new Intl.DateTimeFormat(i18n.language, { dateStyle: 'medium' }).format(\n value,\n );\n const labels: Record<SendRegistrationLinkField, string> = {\n email: t('registrationForm.email'),\n emailConfirm: t('registrationForm.emailConfirm'),\n phone: t('sendRegistrationLink.phone'),\n phoneConfirm: t('sendRegistrationLink.phoneConfirm'),\n allowLoginUntil: t('sendRegistrationLink.allowLoginUntil'),\n };\n // A message shows once the user has left the field or tried to submit.\n // A date waits for a submit, or a value out of range: leaving the\n // field to open the calendar is not a mistake.\n const due = (field: SendRegistrationLinkField) =>\n submitted ||\n (field === 'allowLoginUntil'\n ? day !== undefined\n : touched[field] === true);\n const whenDue = (field: SendRegistrationLinkField, message: string) =>\n due(field) && invalid[field] ? message : undefined;\n const ownErrors: Record<SendRegistrationLinkField, string | undefined> = {\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 phone: whenDue(\n 'phone',\n values.phone === '' ? required : t('registrationForm.phoneInvalid'),\n ),\n phoneConfirm:\n values.phoneConfirm === ''\n ? whenDue('phoneConfirm', required)\n : phoneMatch.error,\n allowLoginUntil: whenDue(\n 'allowLoginUntil',\n !day\n ? required\n : t('sendRegistrationLink.dateOutOfRange', {\n min: formatDay(first),\n max: last ? formatDay(last) : '…',\n }),\n ),\n };\n const errorFor = (field: SendRegistrationLinkField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const form = useRef<HTMLFormElement>(null);\n const formMessage = useRef<HTMLDivElement>(null);\n const emailRef = useRef<HTMLInputElement | null>(null);\n const emailConfirmRef = useRef<HTMLInputElement | null>(null);\n // The addresses stay out of the inputs' `value` attributes.\n const emailField = useStateBackedInput(values.email, emailRef);\n const emailConfirmField = useStateBackedInput(\n values.emailConfirm,\n emailConfirmRef,\n );\n\n const focusField = (field: SendRegistrationLinkField | 'form') => {\n if (field === 'form') {\n formMessage.current?.focus();\n return;\n }\n form.current\n ?.querySelector<HTMLElement>(`[data-field=\"${field}\"] input`)\n ?.focus();\n };\n const focusTargetFor = (messages: SendRegistrationLinkErrors) =>\n SEND_REGISTRATION_LINK_FIELDS.find((field) => messages[field]) ??\n (hasMessage(messages) ? ('form' as const) : undefined);\n\n const [openedWithFieldMessage] = useState(() =>\n SEND_REGISTRATION_LINK_FIELDS.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(\n SEND_REGISTRATION_LINK_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n const [focusRequest, setFocusRequest] = useState<{\n target: SendRegistrationLinkField | 'form';\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (focusRequest) focusField(focusRequest.target);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusRequest]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<SendRegistrationLinkField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () =>\n SEND_REGISTRATION_LINK_FIELDS.find((field) => invalid[field]),\n onRefused: (field) => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n deliver: () =>\n onSubmit?.({\n ...values,\n allowLoginUntil: day ? isoDay(day) : '',\n }),\n onAnswer: (answer) => {\n const next: SendRegistrationLinkErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n setSubmitted(false);\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n });\n\n /* ------------------------------ Render ---------------------------- */\n\n const name = (field: SendRegistrationLinkField) =>\n native ? fieldNames[field] : field;\n const formAction =\n native && action && isSameSiteHref(action) ? action : undefined;\n const formError = serverErrors.form;\n const formMessageAnnounce = useFormMessageAnnounce(\n formError,\n summary.listed.length > 0,\n );\n const ownNames = new Set(Object.values(fieldNames ?? {}));\n const extraFields = native\n ? Object.entries(hiddenFields ?? {}).filter(\n ([extra]) => !ownNames.has(extra),\n )\n : [];\n const anotherLink =\n sendAnotherHref && isSafeHref(sendAnotherHref)\n ? sendAnotherHref\n : undefined;\n const sentDay = readDay(sent?.allowLoginUntil);\n\n if (sent) {\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"send-registration-link-form\"\n data-state=\"sent\"\n className={rootVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <Heading className=\"type-title-card\">\n {title ?? t('sendRegistrationLink.title')}\n </Heading>\n <Alert variant=\"success\" data-slot=\"sent\">\n <Alert.Title as=\"p\">\n {t('sendRegistrationLink.sentTitle')}\n </Alert.Title>\n <Alert.Description>\n {t('sendRegistrationLink.sentEmail', { email: sent.email })}\n </Alert.Description>\n {sentDay && (\n <Alert.Description>\n {t('sendRegistrationLink.sentUntil', {\n date: formatDay(sentDay),\n })}\n </Alert.Description>\n )}\n </Alert>\n {anotherLink && (\n <Button asChild intent=\"secondary\" data-action=\"send-another\">\n <a href={anotherLink}>\n {t('sendRegistrationLink.sendAnother')}\n </a>\n </Button>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"send-registration-link-form\"\n className={rootVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <Heading id={titleId} className=\"type-title-card\">\n {title ?? t('sendRegistrationLink.title')}\n </Heading>\n\n {guidance && (\n <Alert variant=\"warning\" data-slot=\"guidance\">\n <Alert.Title as=\"p\">{guidance.title}</Alert.Title>\n <ul className=\"ds:mx-0 ds:mb-0 ds:mt-[var(--spacing-xs)] ds:ps-[var(--spacing-lg)] ds:list-disc type-body-sm\">\n {guidance.points.map((point) => (\n <li key={point}>{point}</li>\n ))}\n </ul>\n </Alert>\n )}\n\n <form\n ref={form}\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={submit.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 aria-describedby={formError ? formMessageId : undefined}\n errors={summary.listed.map((field) => {\n const message = errorFor(field) ?? '';\n return {\n field,\n message,\n label: message === required ? labels[field] : 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 >\n <Alert.Description>{formError}</Alert.Description>\n </Alert>\n )}\n\n <FormField\n id={fieldId('email')}\n label={labels.email}\n required\n error={errorFor('email')}\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n <EmailInput\n ref={emailField.ref}\n name={name('email')}\n errorMessage={null}\n onChange={emailField.quiet((event) =>\n set('email', event.target.value),\n )}\n onBlur={() => leave('email')}\n blockPaste={blockPaste?.includes('email') ?? false}\n />\n </FormField>\n\n <FormField\n id={fieldId('emailConfirm')}\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 blockPaste={blockPaste?.includes('emailConfirm') ?? false}\n />\n </FormField>\n\n <FormField\n id={fieldId('phone')}\n label={labels.phone}\n required\n description={t('sendRegistrationLink.phoneDescription')}\n error={errorFor('phone')}\n announceError={!summary.lists('phone')}\n data-field=\"phone\"\n onBlur={() => leave('phone')}\n >\n {/* The visible input holds the number as typed; a hidden\n input carries the full international number. */}\n <PhoneInput\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 <FormField\n id={fieldId('phoneConfirm')}\n label={labels.phoneConfirm}\n required\n error={errorFor('phoneConfirm')}\n announceError={!summary.lists('phoneConfirm')}\n data-field=\"phoneConfirm\"\n onBlur={() => {\n leave('phoneConfirm');\n phoneMatch.confirmProps.onBlur();\n }}\n onPasteCapture={\n blockPaste?.includes('phoneConfirm')\n ? (event) => event.preventDefault()\n : undefined\n }\n >\n <PhoneInput\n name={native ? undefined : 'phoneConfirm'}\n value={values.phoneConfirm}\n onChange={(e164) => set('phoneConfirm', e164)}\n />\n </FormField>\n\n <FormField\n id={fieldId('allowLoginUntil')}\n label={labels.allowLoginUntil}\n required\n error={errorFor('allowLoginUntil')}\n announceError={!summary.lists('allowLoginUntil')}\n data-field=\"allowLoginUntil\"\n >\n <DatePicker\n value={day}\n minDate={first}\n maxDate={last}\n onChange={(next) => {\n setDay(next);\n clearServer('allowLoginUntil');\n }}\n />\n </FormField>\n\n {native && fieldNames.phone && (\n <input\n type=\"hidden\"\n name={fieldNames.phone}\n value={values.phone}\n />\n )}\n {native && fieldNames.phoneConfirm && (\n <input\n type=\"hidden\"\n name={fieldNames.phoneConfirm}\n value={values.phoneConfirm}\n />\n )}\n {native && fieldNames.allowLoginUntil && (\n <input\n type=\"hidden\"\n name={fieldNames.allowLoginUntil}\n value={day ? isoDay(day) : ''}\n />\n )}\n {extraFields.map(([extra, value]) => (\n <input key={extra} type=\"hidden\" name={extra} value={value} />\n ))}\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={submit.busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('sendRegistrationLink.submit')}\n </Button>\n <p role=\"status\" className=\"ds:sr-only\">\n {submit.busy ? t('chat.message.status.sending') : ''}\n </p>\n </form>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nSendRegistrationLinkForm.displayName = 'SendRegistrationLinkForm';\n"],"names":["SEND_REGISTRATION_LINK_FIELDS","rootVariants","cva","isoDay","date","format","readDay","value","day","parseISO","isValid","startOfDay","isPossiblePhone","e164","_a","parsePhoneNumberFromString","hasMessage","errors","SendRegistrationLinkForm","forwardRef","title","headingLevel","guidance","minDate","maxDate","initialValues","blockPaste","submitLabel","submitting","sent","sendAnotherHref","fieldNames","action","hiddenFields","onSubmit","className","rest","ref","t","i18n","useTranslation","titleId","useId","fieldIdBase","fieldId","field","formMessageId","native","Heading","tomorrow","useState","first","last","inRange","isBefore","isAfter","values","setValues","setDay","phonePossible","setPhonePossible","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","clearServer","previous","set","leave","emailMatch","useFieldMatch","phoneMatch","invalid","isEmail","required","formatDay","labels","due","whenDue","message","ownErrors","errorFor","form","useRef","formMessage","emailRef","emailConfirmRef","emailField","useStateBackedInput","emailConfirmField","focusField","_c","_b","focusTargetFor","messages","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","useEffect","submit","useRegistrationSubmit","answer","next","name","formAction","isSameSiteHref","formError","formMessageAnnounce","useFormMessageAnnounce","ownNames","extraFields","extra","anotherLink","isSafeHref","sentDay","jsx","Card","jsxs","Alert","Button","point","ErrorSummary","FormField","EmailInput","event","PhoneInput","meta","DatePicker"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,IAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAkGMC,KAAeC;AAAA,EACnB;AACF,GAEMC,KAAS,CAACC,MAAuBC,GAAOD,GAAM,YAAY,GAG1DE,IAAU,CAACC,MAAgD;AAC/D,MAAI,CAACA,EAAO;AACZ,QAAMC,IAAMC,GAASF,CAAK;AAC1B,SAAOG,GAAQF,CAAG,IAAIG,GAAWH,CAAG,IAAI;AAC1C,GAEMI,KAAkB,CAACC,MAAA;;AACvB,WAAAC,IAAAC,GAA2BF,CAAI,MAA/B,gBAAAC,EAAkC,iBAAgB;AAAA,GAE9CE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AAK,UAAS,MAAMJ,GAAO,OAAA7G,EAAA,GAAlC6G,CAAgD,CAC7D;AAAA,gBAED,gBAAAI;AAAA,kBAACI;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,MAAK;AAAA,oBACL,SAASpB,EAAO;AAAA,oBAChB,WAAU;AAAA,oBACV,eAAY;AAAA,oBAEX,UAAA7E,MAAeW,EAAE,6BAA6B;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEjD,gBAAAkF,EAAC,KAAA,EAAE,MAAK,UAAS,WAAU,cACxB,UAAAhB,EAAO,OAAOlE,EAAE,6BAA6B,IAAI,GAAA,CACpD;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACApB,GAAyB,cAAc;"}
|
|
@@ -5,7 +5,7 @@ import { useTranslation as gt } from "react-i18next";
|
|
|
5
5
|
import { A as M } from "./alert-9kEwDza3.js";
|
|
6
6
|
import { B as Me } from "./button-DohK_Ak_.js";
|
|
7
7
|
import { I as We } from "./icon-button-S8_weU3g.js";
|
|
8
|
-
import { C as Qe } from "./combobox-
|
|
8
|
+
import { C as Qe } from "./combobox-CDPm_n0p.js";
|
|
9
9
|
import { D as ce } from "./dialog-C7RWaH08.js";
|
|
10
10
|
import { D as Bt } from "./date-picker-CdhXlgVI.js";
|
|
11
11
|
import { F as H } from "./form-field-CyHfOVKF.js";
|
|
@@ -1239,4 +1239,4 @@ export {
|
|
|
1239
1239
|
vn as T,
|
|
1240
1240
|
ln as t
|
|
1241
1241
|
};
|
|
1242
|
-
//# sourceMappingURL=task-editor-
|
|
1242
|
+
//# sourceMappingURL=task-editor-BOETWbjU.js.map
|