@alfadocs/ui-kit-debug 1.112.1 → 1.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ai-prompt-input-CG9BEggs.js → ai-prompt-input-JIPbrTF3.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-CG9BEggs.js.map → ai-prompt-input-JIPbrTF3.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BrTx7diS.js → anamnesis-summary-rows-DfDulR_c.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-BrTx7diS.js.map → anamnesis-summary-rows-DfDulR_c.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-BlDozxdU.js → audio-recorder-CsnM_WDy.js} +2 -2
- package/dist/_chunks/{audio-recorder-BlDozxdU.js.map → audio-recorder-CsnM_WDy.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-wJ6cTD_h.js → balance-badge-cell-BAZynD--.js} +4 -4
- package/dist/_chunks/{balance-badge-cell-wJ6cTD_h.js.map → balance-badge-cell-BAZynD--.js.map} +1 -1
- package/dist/_chunks/{bishop-score-BhMomGcX.js → bishop-score-CnIft4eV.js} +2 -2
- package/dist/_chunks/{bishop-score-BhMomGcX.js.map → bishop-score-CnIft4eV.js.map} +1 -1
- package/dist/_chunks/{calendar-appointment-editor-dialog-Oc3Df8O3.js → calendar-appointment-editor-dialog-CaZm5wGR.js} +5 -5
- package/dist/_chunks/{calendar-appointment-editor-dialog-Oc3Df8O3.js.map → calendar-appointment-editor-dialog-CaZm5wGR.js.map} +1 -1
- package/dist/_chunks/{data-table-zXBxFYpJ.js → data-table-C9idMvs0.js} +2 -2
- package/dist/_chunks/{data-table-zXBxFYpJ.js.map → data-table-C9idMvs0.js.map} +1 -1
- package/dist/_chunks/{document-preview-BalyZqnn.js → document-preview-5xs64jME.js} +2 -2
- package/dist/_chunks/{document-preview-BalyZqnn.js.map → document-preview-5xs64jME.js.map} +1 -1
- package/dist/_chunks/email-input-DxwbREpx.js +156 -0
- package/dist/_chunks/email-input-DxwbREpx.js.map +1 -0
- package/dist/_chunks/{file-manager-CVxBE4yy.js → file-manager-LG7B_UHB.js} +2 -2
- package/dist/_chunks/{file-manager-CVxBE4yy.js.map → file-manager-LG7B_UHB.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js → forgot-password-form-YQVzSskq.js} +8 -7
- package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js.map → forgot-password-form-YQVzSskq.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-AnaH00nk.js → gestational-age-calculator-Dv3IePb-.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-AnaH00nk.js.map → gestational-age-calculator-Dv3IePb-.js.map} +1 -1
- package/dist/_chunks/{heatmap-D4qqpCEj.js → heatmap-BiwC7Gdx.js} +2 -2
- package/dist/_chunks/{heatmap-D4qqpCEj.js.map → heatmap-BiwC7Gdx.js.map} +1 -1
- package/dist/_chunks/isEmail-BfVspSvV.js +248 -0
- package/dist/_chunks/isEmail-BfVspSvV.js.map +1 -0
- package/dist/_chunks/{kit-extensions-VaJ-u44J.js → kit-extensions-BOsUgWnE.js} +3 -3
- package/dist/_chunks/{kit-extensions-VaJ-u44J.js.map → kit-extensions-BOsUgWnE.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-C8vfCOEp.js → link-cell-renderer-_Fv3WEmb.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-C8vfCOEp.js.map → link-cell-renderer-_Fv3WEmb.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-Cz1Clugq.js → login-dev-card-B6-zCFq3.js} +47 -46
- package/dist/_chunks/{login-dev-card-Cz1Clugq.js.map → login-dev-card-B6-zCFq3.js.map} +1 -1
- package/dist/_chunks/{muscle-scheme-1BZd1-RE.js → muscle-scheme-BkmDUTmk.js} +2 -2
- package/dist/_chunks/{muscle-scheme-1BZd1-RE.js.map → muscle-scheme-BkmDUTmk.js.map} +1 -1
- package/dist/_chunks/{optical-prescription-BGVeDVSP.js → optical-prescription-CvbN8yD2.js} +2 -2
- package/dist/_chunks/{optical-prescription-BGVeDVSP.js.map → optical-prescription-CvbN8yD2.js.map} +1 -1
- package/dist/_chunks/{patient-details-wMgTFtpp.js → patient-details-RsT3SaYh.js} +2 -2
- package/dist/_chunks/{patient-details-wMgTFtpp.js.map → patient-details-RsT3SaYh.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-Bhm2Ig1P.js → patient-field-row-D9rb-QJH.js} +3 -3
- package/dist/_chunks/{patient-field-row-Bhm2Ig1P.js.map → patient-field-row-D9rb-QJH.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DMdPPG3n.js → patient-summary-card-BjZErlbt.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DMdPPG3n.js.map → patient-summary-card-BjZErlbt.js.map} +1 -1
- package/dist/_chunks/{practice-results-BOpaPaav.js → practice-results-BByRCIuR.js} +620 -566
- package/dist/_chunks/practice-results-BByRCIuR.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-D6dLkMpl.js → pregnancy-dating-Cs8xpZA8.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-D6dLkMpl.js.map → pregnancy-dating-Cs8xpZA8.js.map} +1 -1
- package/dist/_chunks/{registration-form-CEJRUS9G.js → registration-form-Cq5_OSIL.js} +8 -7
- package/dist/_chunks/{registration-form-CEJRUS9G.js.map → registration-form-Cq5_OSIL.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-C-C9cvO5.js → reserved.agent-BMkapgom.js} +3 -3
- package/dist/_chunks/{reserved.agent-C-C9cvO5.js.map → reserved.agent-BMkapgom.js.map} +1 -1
- package/dist/_chunks/{reset-password-form-B0acanDD.js → reset-password-form-BVsL2fOJ.js} +2 -2
- package/dist/_chunks/{reset-password-form-B0acanDD.js.map → reset-password-form-BVsL2fOJ.js.map} +1 -1
- package/dist/_chunks/{select-BBDRYxJl.js → select-uESzXTX6.js} +42 -39
- package/dist/_chunks/select-uESzXTX6.js.map +1 -0
- package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js → send-registration-link-form-OgPomrZN.js} +8 -7
- package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js.map → send-registration-link-form-OgPomrZN.js.map} +1 -1
- package/dist/_chunks/{signature-request-DJwdPji_.js → signature-request-BnTihryS.js} +2 -2
- package/dist/_chunks/{signature-request-DJwdPji_.js.map → signature-request-BnTihryS.js.map} +1 -1
- package/dist/_chunks/{tabs-DYHgRVSJ.js → tabs-CXYjr_8O.js} +2 -2
- package/dist/_chunks/{tabs-DYHgRVSJ.js.map → tabs-CXYjr_8O.js.map} +1 -1
- package/dist/_chunks/{task-editor-jqRf2JP6.js → task-editor-gqWF1jI6.js} +2 -2
- package/dist/_chunks/{task-editor-jqRf2JP6.js.map → task-editor-gqWF1jI6.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-CFo5uIHx.js → tasks-panel-OuIaydK5.js} +2 -2
- package/dist/_chunks/{tasks-panel-CFo5uIHx.js.map → tasks-panel-OuIaydK5.js.map} +1 -1
- package/dist/_chunks/{unit-converter-C95sa5y8.js → unit-converter-D77vmlzN.js} +2 -2
- package/dist/_chunks/{unit-converter-C95sa5y8.js.map → unit-converter-D77vmlzN.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-VI26Z-pc.js → use-appointment-details-read-DvK7Looa.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-VI26Z-pc.js.map → use-appointment-details-read-DvK7Looa.js.map} +1 -1
- package/dist/_chunks/verify-identity-types-C85EXNzy.js +707 -0
- package/dist/_chunks/verify-identity-types-C85EXNzy.js.map +1 -0
- package/dist/_chunks/{voice-control-panel-B0TUZAiP.js → voice-control-panel-BGiX4sqB.js} +2 -2
- package/dist/_chunks/{voice-control-panel-B0TUZAiP.js.map → voice-control-panel-BGiX4sqB.js.map} +1 -1
- package/dist/agent-catalog.json +106 -2
- package/dist/agent-i18n/en.json +11 -0
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/email-input/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/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/optical-prescription/index.js +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/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +28 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/i18n/locales/ar.d.ts +67 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +68 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +67 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +68 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +67 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +68 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +67 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +67 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +67 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +68 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +67 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +68 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +67 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +68 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +67 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +68 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +67 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +68 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +67 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +68 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +67 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +68 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +67 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +68 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +67 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +68 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +67 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +68 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +67 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +68 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +67 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +68 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +67 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +68 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +67 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +68 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +352 -347
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +68 -1
- package/dist/locales/de.json +68 -1
- package/dist/locales/el.json +68 -1
- package/dist/locales/en.json +67 -0
- package/dist/locales/es.json +68 -1
- package/dist/locales/fr.json +68 -1
- package/dist/locales/hi.json +68 -1
- package/dist/locales/it.json +68 -1
- package/dist/locales/ja.json +68 -1
- package/dist/locales/nl.json +68 -1
- package/dist/locales/pl.json +68 -1
- package/dist/locales/pt.json +68 -1
- package/dist/locales/ro.json +68 -1
- package/dist/locales/ru.json +68 -1
- package/dist/locales/sq.json +68 -1
- package/dist/locales/sv.json +68 -1
- package/dist/locales/tr.json +68 -1
- package/dist/locales/zh.json +68 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/reset-password-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/verify-identity/change-email-dialog.d.ts +26 -0
- package/dist/patterns/verify-identity/change-email-dialog.d.ts.map +1 -0
- package/dist/patterns/verify-identity/index.d.ts +7 -0
- package/dist/patterns/verify-identity/index.d.ts.map +1 -0
- package/dist/patterns/verify-identity/index.js +8 -0
- package/dist/patterns/verify-identity/index.js.map +1 -0
- package/dist/patterns/verify-identity/use-countdown.d.ts +12 -0
- package/dist/patterns/verify-identity/use-countdown.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity-steps.d.ts +21 -0
- package/dist/patterns/verify-identity/verify-identity-steps.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity-types.d.ts +47 -0
- package/dist/patterns/verify-identity/verify-identity-types.d.ts.map +1 -0
- package/dist/patterns/verify-identity/verify-identity.d.ts +54 -0
- package/dist/patterns/verify-identity/verify-identity.d.ts.map +1 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/email-input-BEO3vonE.js +0 -399
- package/dist/_chunks/email-input-BEO3vonE.js.map +0 -1
- package/dist/_chunks/practice-results-BOpaPaav.js.map +0 -1
- package/dist/_chunks/select-BBDRYxJl.js.map +0 -1
|
@@ -5,7 +5,7 @@ import { c as ws } from "./index-D2ZczOXr.js";
|
|
|
5
5
|
import { A as u } from "./alert-C4WKViaS.js";
|
|
6
6
|
import { B as D } from "./button-DohK_Ak_.js";
|
|
7
7
|
import { C as ms } from "./card-C85_Ndhb.js";
|
|
8
|
-
import { E as ks } from "./email-input-
|
|
8
|
+
import { E as ks } from "./email-input-DxwbREpx.js";
|
|
9
9
|
import { E as Vs } from "./error-summary-DxNhwf_G.js";
|
|
10
10
|
import { F as L } from "./form-field-CyHfOVKF.js";
|
|
11
11
|
import { P as us } from "./password-input-SJGHFdOO.js";
|
|
@@ -364,4 +364,4 @@ export {
|
|
|
364
364
|
b as R,
|
|
365
365
|
nr as a
|
|
366
366
|
};
|
|
367
|
-
//# sourceMappingURL=reset-password-form-
|
|
367
|
+
//# sourceMappingURL=reset-password-form-BVsL2fOJ.js.map
|
package/dist/_chunks/{reset-password-form-B0acanDD.js.map → reset-password-form-BVsL2fOJ.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password-form-B0acanDD.js","sources":["../../src/patterns/_shared/password-policy.ts","../../src/patterns/reset-password-form/reset-password-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* The platform's password rule, as the live checklist shows it. */\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. Shipped with the patterns that */\n/* import it; not an export of its own. */\n/* -------------------------------------------------------------------- */\n\nimport type { UsePasswordRequirementsOptions } from '../../components/password-input';\n\nexport const PLATFORM_PASSWORD_POLICY: UsePasswordRequirementsOptions = {\n minLength: 12,\n uppercase: true,\n lowercase: true,\n digit: true,\n charset: 'ascii',\n};\n","/* -------------------------------------------------------------------- */\n/* ResetPasswordForm — the card the reset email opens, where the person */\n/* chooses a new password. */\n/* */\n/* Two password fields with the live rules checklist, then one of two */\n/* results in place of the form: the password has changed, or the link */\n/* has expired. The host checks the link and the code, sets the state */\n/* and owns every server rule; the card checks what a browser can check, */\n/* then hands the values to `onSubmit` or posts a real form. A password */\n/* is never put in an attribute. */\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 { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport {\n PasswordInput,\n usePasswordRequirements,\n} from '../../components/password-input';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport { PLATFORM_PASSWORD_POLICY } from '../_shared/password-policy';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The form's two fields. */\nexport const RESET_PASSWORD_FORM_FIELDS = [\n 'password',\n 'passwordConfirm',\n] as const;\n\nexport type ResetPasswordFormField =\n (typeof RESET_PASSWORD_FORM_FIELDS)[number];\n\n/** What the card shows: the form, the result after a good change, or the\n * result for a link that no longer works. */\nexport type ResetPasswordFormState = 'form' | 'done' | 'expired';\n\n/** What `onSubmit` receives once both passwords have passed their checks. */\nexport interface ResetPasswordFormValues {\n password: string;\n passwordConfirm: string;\n}\n\n/** Messages from the server, already translated: one for each field, plus\n * `form` for a message about the whole form. */\nexport type ResetPasswordFormErrors = Partial<\n Record<ResetPasswordFormField | 'form', string>\n>;\n\n/** The host's own form field names, for a native form post. They are\n * needed: a field without a name is not posted. */\nexport type ResetPasswordFormFieldNames = Record<\n ResetPasswordFormField,\n string\n>;\n\nexport interface ResetPasswordFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /**\n * What the card shows. Default `form`. `done` and `expired` replace the\n * form and take focus when they appear.\n */\n state?: ResetPasswordFormState;\n /** Replaces the form's heading \"Choose a new password\". Pass it\n * translated. The result states have their own heading. */\n title?: string;\n /** Replaces the line under the form's heading (\"Enter a new password\n * for your account.\"). Pass it translated. */\n description?: string;\n /**\n * The heading's level. Default 1: this page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /** Shows the Alfadocs mark above the heading. Default true. */\n showLogo?: boolean;\n /** How the mark arrives when the card opens. Default `assemble`. */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the fields, such as a notice. It\n * sits outside the form, so nothing in it is posted.\n */\n children?: ReactNode;\n /**\n * The address the password is for. In the form it shows read-only, and\n * is the username a password manager saves the new password under. In\n * the `done` state it is named in the line under the result.\n */\n email?: string;\n /**\n * The `done` state's action, \"Sign in\". A path on the same site, or an\n * address written in full. Anything else shows no button.\n */\n loginHref?: string;\n /**\n * The `expired` state's action, \"Ask for a new link\". A path on the\n * same site, or an address written in full. Anything else shows no\n * button.\n */\n requestHref?: string;\n /**\n * Messages from the server, already translated. A field's message shows\n * on the field until the user changes it; `form` shows above the\n * fields. When messages arrive, focus moves to the error summary when a\n * field has one, or to the message above the fields when only that\n * says something. Passwords the server refused are emptied.\n */\n errors?: ResetPasswordFormErrors;\n /** Replaces the button's \"Change password\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the passwords: the button shows a spinner\n * and a second submit is ignored. Set it inside `onSubmit`, before\n * anything is awaited.\n */\n submitting?: boolean;\n /** For React hosts: called with both passwords once they have passed\n * their checks. Not called when `fieldNames` is set. */\n onSubmit?: (values: ResetPasswordFormValues) => void;\n /**\n * For a native form post: the host's own field names, e.g.\n * `{ password: 'lost_password_reset[password1]', passwordConfirm:\n * 'lost_password_reset[password2]' }`. When set, the inputs carry those\n * names and the browser posts the form.\n */\n fieldNames?: ResetPasswordFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed. Does nothing without\n * `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token,\n * e.g. `{ 'lost_password_reset[_token]': token }`. Not used with\n * `onSubmit`. A name that is also in `fieldNames` is left out.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// 400px at most, in px: a host whose root font size is not 16px would\n// stretch or squeeze a width in rem.\nconst resetPasswordFormVariants = cva(\n 'ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]',\n);\n\n// The result takes focus when it appears, so it shows a ring.\nconst resultVariants = cva(\n 'ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\ntype FocusTarget = ResetPasswordFormField | 'form';\n\n/** Unicode isolates: they keep an address's order inside any sentence. */\nconst LTR_ISOLATE = '\\u2066';\nconst POP_ISOLATE = '\\u2069';\n\n/** The result's heading, by the level of the card's own. */\nconst RESULT_HEADING = { 1: 'h2', 2: 'h3', 3: 'h4' } as const;\n\nconst hasMessage = (errors: ResetPasswordFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst focusTargetFor = (\n messages: ResetPasswordFormErrors,\n): FocusTarget | undefined =>\n RESET_PASSWORD_FORM_FIELDS.find((field) => messages[field]) ??\n (messages.form ? 'form' : undefined);\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The card for the page the reset email opens. Mount it on the\n * reset-password page, inside `SignedOutFrame` or the host's own chrome.\n */\nexport const ResetPasswordForm = forwardRef<\n HTMLDivElement,\n ResetPasswordFormProps\n>(\n (\n {\n state = 'form',\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n email,\n loginHref,\n requestHref,\n errors,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const resultTitleId = useId();\n const resultDescriptionId = useId();\n const emailFieldId = useId();\n const passwordFieldId = useId();\n const passwordConfirmFieldId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const fieldIds: Record<ResetPasswordFormField, string> = {\n password: passwordFieldId,\n passwordConfirm: passwordConfirmFieldId,\n };\n\n /* ------------------------------ State ----------------------------- */\n\n // Passwords always start empty and are held in state only: the inputs\n // get them as a DOM property, never as an attribute.\n const [values, setValues] = useState<ResetPasswordFormValues>({\n password: '',\n passwordConfirm: '',\n });\n const [touched, setTouched] = useState<\n Partial<Record<ResetPasswordFormField, boolean>>\n >({});\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<ResetPasswordFormErrors>(\n () => errors ?? {},\n );\n\n const set = (field: ResetPasswordFormField, value: string) => {\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: ResetPasswordFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n const emptyPasswords = () => {\n setValues({ password: '', passwordConfirm: '' });\n setTouched({});\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n const requirements = usePasswordRequirements(PLATFORM_PASSWORD_POLICY);\n const match = 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. */\n const invalid: Record<ResetPasswordFormField, boolean> = {\n password:\n values.password === '' ||\n !requirements.every((rule) => rule.test(values.password)),\n passwordConfirm: values.passwordConfirm === '' || !match.matches,\n };\n // A message shows once the user has left the field or tried to submit.\n const due = (field: ResetPasswordFormField) =>\n submitted || touched[field] === true;\n const ownErrors: Record<ResetPasswordFormField, string | undefined> = {\n password:\n due('password') && invalid.password\n ? values.password === ''\n ? t('resetPasswordForm.passwordRequired')\n : t('resetPasswordForm.passwordInvalid')\n : undefined,\n passwordConfirm:\n values.passwordConfirm === ''\n ? due('passwordConfirm')\n ? t('resetPasswordForm.passwordConfirmRequired')\n : undefined\n : match.error,\n };\n const errorFor = (field: ResetPasswordFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const controls = useRef<\n Partial<Record<ResetPasswordFormField, HTMLElement | null>>\n >({});\n const control = useMemo(\n () => ({\n password: (node: HTMLElement | null) => {\n controls.current.password = node;\n },\n passwordConfirm: (node: HTMLElement | null) => {\n controls.current.passwordConfirm = node;\n },\n }),\n [],\n );\n const formMessage = useRef<HTMLDivElement>(null);\n const result = useRef<HTMLDivElement>(null);\n\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailInput = useRef<HTMLInputElement>(null);\n const emailField = useStateBackedInput(email ?? '', emailInput);\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.\n const [openedWithFieldMessage] = useState(() =>\n RESET_PASSWORD_FORM_FIELDS.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(\n RESET_PASSWORD_FORM_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n const formMessageAnnounce = useFormMessageAnnounce(\n serverErrors.form,\n summary.listed.length > 0,\n );\n\n // A new object for each request, so asking twice for the same place\n // moves focus twice.\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 // The form, and the button that had focus, are gone once a result\n // shows. Move focus to it. Not on a page that opens on a result: that\n // one is read from the top like any other.\n // A password does not wait in memory behind a result.\n const clearOnResult = state !== 'form';\n useEffect(() => {\n if (clearOnResult) {\n setValues({ password: '', passwordConfirm: '' });\n setTouched({});\n }\n }, [clearOnResult]);\n const wasForm = useRef(state === 'form');\n useEffect(() => {\n if (state !== 'form' && wasForm.current) result.current?.focus();\n wasForm.current = state === 'form';\n }, [state]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<ResetPasswordFormField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () =>\n RESET_PASSWORD_FORM_FIELDS.find((field) => invalid[field]),\n onRefused: (field) => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () =>\n onSubmit?.({\n password: values.password,\n passwordConfirm: values.passwordConfirm,\n }),\n onAnswer: (answer) => {\n const next: ResetPasswordFormErrors = 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 summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n // The page came back from the browser's cache as it was left: the\n // passwords must not come back with it.\n onRestore: emptyPasswords,\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('ResetPasswordForm', native, action);\n const extraFields = useExtraFields(\n 'ResetPasswordForm',\n native,\n fieldNames,\n hiddenFields,\n );\n const name = (field: ResetPasswordFormField) =>\n native ? fieldNames[field] : field;\n const safe = (href: string | undefined) =>\n href && isSafeHref(href) ? href : undefined;\n const loginLink = safe(loginHref);\n const requestLink = safe(requestHref);\n const showingForm = state === 'form';\n const labels: Record<ResetPasswordFormField, string> = {\n password: t('resetPasswordForm.password'),\n passwordConfirm: t('resetPasswordForm.passwordConfirm'),\n };\n const resultHeading = RESULT_HEADING[headingLevel];\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"reset-password-form\"\n data-state={state}\n className={resetPasswordFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={\n showingForm\n ? (title ?? t('resetPasswordForm.title'))\n : t('resetPasswordForm.pageTitle')\n }\n description={\n showingForm\n ? (description ?? t('resetPasswordForm.description'))\n : undefined\n }\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {state === 'done' && (\n <>\n <Alert\n ref={result}\n variant=\"success\"\n tabIndex={-1}\n aria-labelledby={resultTitleId}\n aria-describedby={resultDescriptionId}\n data-slot=\"result\"\n className={resultVariants()}\n >\n <Alert.Title id={resultTitleId} as={resultHeading}>\n {t('resetPasswordForm.doneTitle')}\n </Alert.Title>\n <Alert.Description id={resultDescriptionId}>\n {email\n ? t('resetPasswordForm.doneDescriptionEmail', {\n // Isolated left to right, so the address keeps its\n // order inside a right-to-left sentence.\n email: `${LTR_ISOLATE}${email}${POP_ISOLATE}`,\n })\n : t('resetPasswordForm.doneDescription')}\n </Alert.Description>\n </Alert>\n {loginLink && (\n <Button\n asChild\n intent=\"primary\"\n size=\"lg\"\n className=\"ds:w-full\"\n >\n <a href={loginLink} data-action=\"login\">\n {t('resetPasswordForm.signIn')}\n </a>\n </Button>\n )}\n </>\n )}\n\n {state === 'expired' && (\n <>\n <Alert\n ref={result}\n variant=\"warning\"\n // Focus moves here: an assertive alert as well would read\n // it twice, and over a page that opens on it.\n announce=\"polite\"\n tabIndex={-1}\n aria-labelledby={resultTitleId}\n aria-describedby={resultDescriptionId}\n data-slot=\"result\"\n className={resultVariants()}\n >\n <Alert.Title id={resultTitleId} as={resultHeading}>\n {t('resetPasswordForm.expiredTitle')}\n </Alert.Title>\n <Alert.Description id={resultDescriptionId}>\n {t('resetPasswordForm.expiredDescription')}\n </Alert.Description>\n </Alert>\n {requestLink && (\n <Button\n asChild\n intent=\"primary\"\n size=\"lg\"\n className=\"ds:w-full\"\n >\n <a href={requestLink} data-action=\"request-link\">\n {t('resetPasswordForm.requestLink')}\n </a>\n </Button>\n )}\n </>\n )}\n\n {showingForm && (\n <>\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={\n serverErrors.form ? formMessageId : undefined\n }\n errors={summary.listed.map((field) => ({\n field,\n message: errorFor(field) ?? '',\n targetId: fieldIds[field],\n }))}\n />\n\n {serverErrors.form && (\n <AuthFormMessage\n ref={formMessage}\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {serverErrors.form}\n </AuthFormMessage>\n )}\n\n {email ? (\n <FormField\n id={emailFieldId}\n label={t('resetPasswordForm.email')}\n data-field=\"email\"\n >\n {/* Read-only, and not posted: it has no name. `username`\n is what password managers pair with\n `new-password`, so the new password is saved under\n this address. */}\n <EmailInput\n ref={emailField.ref}\n name=\"\"\n readOnly\n autoComplete=\"username\"\n // An address reads left to right in any language.\n dir=\"ltr\"\n disableBuiltInValidation\n onChange={emailField.quiet()}\n />\n </FormField>\n ) : null}\n\n <FormField\n id={passwordFieldId}\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 />\n </FormField>\n\n <FormField\n id={passwordConfirmFieldId}\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) =>\n set('passwordConfirm', event.target.value)\n }\n onBlur={() => {\n leave('passwordConfirm');\n match.confirmProps.onBlur();\n }}\n />\n </FormField>\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('resetPasswordForm.submit')}\n </Button>\n </form>\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nResetPasswordForm.displayName = 'ResetPasswordForm';\n"],"names":["PLATFORM_PASSWORD_POLICY","RESET_PASSWORD_FORM_FIELDS","resetPasswordFormVariants","cva","resultVariants","LTR_ISOLATE","POP_ISOLATE","RESULT_HEADING","hasMessage","errors","focusTargetFor","messages","field","ResetPasswordForm","forwardRef","state","title","description","headingLevel","showLogo","logoMotion","children","email","loginHref","requestHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","className","rest","ref","t","useTranslation","titleId","useId","resultTitleId","resultDescriptionId","emailFieldId","passwordFieldId","passwordConfirmFieldId","formMessageId","native","fieldIds","values","setValues","useState","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","set","value","previous","leave","emptyPasswords","requirements","usePasswordRequirements","match","useFieldMatch","invalid","rule","due","ownErrors","errorFor","controls","useRef","control","useMemo","node","formMessage","result","emailInput","emailField","useStateBackedInput","openedWithFieldMessage","summary","useErrorSummary","formMessageAnnounce","useFormMessageAnnounce","focusRequest","setFocusRequest","target","useEffect","_a","_b","clearOnResult","wasForm","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","extraFields","useExtraFields","name","safe","href","isSafeHref","loginLink","requestLink","showingForm","labels","resultHeading","jsx","Card","AuthCardHeading","jsxs","Fragment","Alert","Button","ErrorSummary","AuthFormMessage","FormField","EmailInput","PasswordInput","event","ExtraFields","AuthFormStatus"],"mappings":";;;;;;;;;;;;;;;;;AAWO,MAAMA,KAA2D;AAAA,EACtE,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AACX,GCyCaC,IAA6B;AAAA,EACxC;AAAA,EACA;AACF,GAyHMC,KAA4BC;AAAA,EAChC;AACF,GAGMC,KAAiBD;AAAA,EACrB;AACF,GASME,KAAc,KACdC,KAAc,KAGdC,KAAiB,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,KAAA,GAExCC,KAAa,CAACC,MAClB,OAAO,OAAOA,CAAM,EAAE,KAAK,OAAO,GAE9BC,KAAiB,CACrBC,MAEAV,EAA2B,KAAK,CAACW,MAAUD,EAASC,CAAK,CAAC,MACzDD,EAAS,OAAO,SAAS,SAUfE,KAAoBC;AAAA,EAI/B,CACE;AAAA,IACE,OAAAC,IAAQ;AAAA,IACR,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,KAAW;AAAA,IACX,YAAAC,KAAa;AAAA,IACb,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAf;AAAA,IACA,aAAAgB;AAAA,IACA,YAAAC,KAAa;AAAA,IACb,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,OACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,IAAI,GAC3BC,IAAUC,EAAA,GACVC,IAAgBD,EAAA,GAChBE,IAAsBF,EAAA,GACtBG,KAAeH,EAAA,GACfI,IAAkBJ,EAAA,GAClBK,IAAyBL,EAAA,GACzBM,IAAgBN,EAAA,GAChBO,IAAShB,MAAe,QACxBiB,KAAmD;AAAA,MACvD,UAAUJ;AAAA,M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GAAK,iBAAiB;AAAA,0BAC5B,cAAa;AAAA,0BACb,OAAOvD,EAAO;AAAA,0BACd,UAAU,CAAC4E,MACTnE,EAAI,mBAAmBmE,EAAM,OAAO,KAAK;AAAA,0BAE3C,QAAQ,MAAM;AACZ,4BAAAhE,EAAM,iBAAiB,GACvBI,EAAM,aAAa,OAAA;AAAA,0BACrB;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,kBAGF,gBAAAgD,EAACa,IAAA,EAAY,QAAQxB,GAAA,CAAa;AAAA,kBAElC,gBAAAW;AAAA,oBAACM;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAASpB;AAAA,sBACT,WAAU;AAAA,sBACV,eAAY;AAAA,sBAEX,UAAAvE,MAAeS,EAAE,0BAA0B;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC9C;AAAA,cAAA;AAAA,YAAA;AAAA,YAIF,gBAAA4E,EAACc,MAAe,MAAA5B,EAAA,CAAY;AAAA,UAAA,EAAA,CAC9B;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAnF,GAAkB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"reset-password-form-BVsL2fOJ.js","sources":["../../src/patterns/_shared/password-policy.ts","../../src/patterns/reset-password-form/reset-password-form.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* The platform's password rule, as the live checklist shows it. */\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. Shipped with the patterns that */\n/* import it; not an export of its own. */\n/* -------------------------------------------------------------------- */\n\nimport type { UsePasswordRequirementsOptions } from '../../components/password-input';\n\nexport const PLATFORM_PASSWORD_POLICY: UsePasswordRequirementsOptions = {\n minLength: 12,\n uppercase: true,\n lowercase: true,\n digit: true,\n charset: 'ascii',\n};\n","/* -------------------------------------------------------------------- */\n/* ResetPasswordForm — the card the reset email opens, where the person */\n/* chooses a new password. */\n/* */\n/* Two password fields with the live rules checklist, then one of two */\n/* results in place of the form: the password has changed, or the link */\n/* has expired. The host checks the link and the code, sets the state */\n/* and owns every server rule; the card checks what a browser can check, */\n/* then hands the values to `onSubmit` or posts a real form. A password */\n/* is never put in an attribute. */\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 { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { Alert } from '../../components/alert';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport {\n PasswordInput,\n usePasswordRequirements,\n} from '../../components/password-input';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { useStateBackedInput } from '../../components/_shared/use-state-backed-input';\nimport { useFieldMatch } from '../../hooks/use-field-match';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport { PLATFORM_PASSWORD_POLICY } from '../_shared/password-policy';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The form's two fields. */\nexport const RESET_PASSWORD_FORM_FIELDS = [\n 'password',\n 'passwordConfirm',\n] as const;\n\nexport type ResetPasswordFormField =\n (typeof RESET_PASSWORD_FORM_FIELDS)[number];\n\n/** What the card shows: the form, the result after a good change, or the\n * result for a link that no longer works. */\nexport type ResetPasswordFormState = 'form' | 'done' | 'expired';\n\n/** What `onSubmit` receives once both passwords have passed their checks. */\nexport interface ResetPasswordFormValues {\n password: string;\n passwordConfirm: string;\n}\n\n/** Messages from the server, already translated: one for each field, plus\n * `form` for a message about the whole form. */\nexport type ResetPasswordFormErrors = Partial<\n Record<ResetPasswordFormField | 'form', string>\n>;\n\n/** The host's own form field names, for a native form post. They are\n * needed: a field without a name is not posted. */\nexport type ResetPasswordFormFieldNames = Record<\n ResetPasswordFormField,\n string\n>;\n\nexport interface ResetPasswordFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /**\n * What the card shows. Default `form`. `done` and `expired` replace the\n * form and take focus when they appear.\n */\n state?: ResetPasswordFormState;\n /** Replaces the form's heading \"Choose a new password\". Pass it\n * translated. The result states have their own heading. */\n title?: string;\n /** Replaces the line under the form's heading (\"Enter a new password\n * for your account.\"). Pass it translated. */\n description?: string;\n /**\n * The heading's level. Default 1: this page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /** Shows the Alfadocs mark above the heading. Default true. */\n showLogo?: boolean;\n /** How the mark arrives when the card opens. Default `assemble`. */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the fields, such as a notice. It\n * sits outside the form, so nothing in it is posted.\n */\n children?: ReactNode;\n /**\n * The address the password is for. In the form it shows read-only, and\n * is the username a password manager saves the new password under. In\n * the `done` state it is named in the line under the result.\n */\n email?: string;\n /**\n * The `done` state's action, \"Sign in\". A path on the same site, or an\n * address written in full. Anything else shows no button.\n */\n loginHref?: string;\n /**\n * The `expired` state's action, \"Ask for a new link\". A path on the\n * same site, or an address written in full. Anything else shows no\n * button.\n */\n requestHref?: string;\n /**\n * Messages from the server, already translated. A field's message shows\n * on the field until the user changes it; `form` shows above the\n * fields. When messages arrive, focus moves to the error summary when a\n * field has one, or to the message above the fields when only that\n * says something. Passwords the server refused are emptied.\n */\n errors?: ResetPasswordFormErrors;\n /** Replaces the button's \"Change password\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the passwords: the button shows a spinner\n * and a second submit is ignored. Set it inside `onSubmit`, before\n * anything is awaited.\n */\n submitting?: boolean;\n /** For React hosts: called with both passwords once they have passed\n * their checks. Not called when `fieldNames` is set. */\n onSubmit?: (values: ResetPasswordFormValues) => void;\n /**\n * For a native form post: the host's own field names, e.g.\n * `{ password: 'lost_password_reset[password1]', passwordConfirm:\n * 'lost_password_reset[password2]' }`. When set, the inputs carry those\n * names and the browser posts the form.\n */\n fieldNames?: ResetPasswordFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed. Does nothing without\n * `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token,\n * e.g. `{ 'lost_password_reset[_token]': token }`. Not used with\n * `onSubmit`. A name that is also in `fieldNames` is left out.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// 400px at most, in px: a host whose root font size is not 16px would\n// stretch or squeeze a width in rem.\nconst resetPasswordFormVariants = cva(\n 'ds:mx-auto ds:w-full ds:max-w-[400px] ds:text-start ds:text-[var(--foreground)]',\n);\n\n// The result takes focus when it appears, so it shows a ring.\nconst resultVariants = cva(\n 'ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\ntype FocusTarget = ResetPasswordFormField | 'form';\n\n/** Unicode isolates: they keep an address's order inside any sentence. */\nconst LTR_ISOLATE = '\\u2066';\nconst POP_ISOLATE = '\\u2069';\n\n/** The result's heading, by the level of the card's own. */\nconst RESULT_HEADING = { 1: 'h2', 2: 'h3', 3: 'h4' } as const;\n\nconst hasMessage = (errors: ResetPasswordFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst focusTargetFor = (\n messages: ResetPasswordFormErrors,\n): FocusTarget | undefined =>\n RESET_PASSWORD_FORM_FIELDS.find((field) => messages[field]) ??\n (messages.form ? 'form' : undefined);\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The card for the page the reset email opens. Mount it on the\n * reset-password page, inside `SignedOutFrame` or the host's own chrome.\n */\nexport const ResetPasswordForm = forwardRef<\n HTMLDivElement,\n ResetPasswordFormProps\n>(\n (\n {\n state = 'form',\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n email,\n loginHref,\n requestHref,\n errors,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const resultTitleId = useId();\n const resultDescriptionId = useId();\n const emailFieldId = useId();\n const passwordFieldId = useId();\n const passwordConfirmFieldId = useId();\n const formMessageId = useId();\n const native = fieldNames !== undefined;\n const fieldIds: Record<ResetPasswordFormField, string> = {\n password: passwordFieldId,\n passwordConfirm: passwordConfirmFieldId,\n };\n\n /* ------------------------------ State ----------------------------- */\n\n // Passwords always start empty and are held in state only: the inputs\n // get them as a DOM property, never as an attribute.\n const [values, setValues] = useState<ResetPasswordFormValues>({\n password: '',\n passwordConfirm: '',\n });\n const [touched, setTouched] = useState<\n Partial<Record<ResetPasswordFormField, boolean>>\n >({});\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<ResetPasswordFormErrors>(\n () => errors ?? {},\n );\n\n const set = (field: ResetPasswordFormField, value: string) => {\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: ResetPasswordFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n const emptyPasswords = () => {\n setValues({ password: '', passwordConfirm: '' });\n setTouched({});\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n const requirements = usePasswordRequirements(PLATFORM_PASSWORD_POLICY);\n const match = 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. */\n const invalid: Record<ResetPasswordFormField, boolean> = {\n password:\n values.password === '' ||\n !requirements.every((rule) => rule.test(values.password)),\n passwordConfirm: values.passwordConfirm === '' || !match.matches,\n };\n // A message shows once the user has left the field or tried to submit.\n const due = (field: ResetPasswordFormField) =>\n submitted || touched[field] === true;\n const ownErrors: Record<ResetPasswordFormField, string | undefined> = {\n password:\n due('password') && invalid.password\n ? values.password === ''\n ? t('resetPasswordForm.passwordRequired')\n : t('resetPasswordForm.passwordInvalid')\n : undefined,\n passwordConfirm:\n values.passwordConfirm === ''\n ? due('passwordConfirm')\n ? t('resetPasswordForm.passwordConfirmRequired')\n : undefined\n : match.error,\n };\n const errorFor = (field: ResetPasswordFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n const controls = useRef<\n Partial<Record<ResetPasswordFormField, HTMLElement | null>>\n >({});\n const control = useMemo(\n () => ({\n password: (node: HTMLElement | null) => {\n controls.current.password = node;\n },\n passwordConfirm: (node: HTMLElement | null) => {\n controls.current.passwordConfirm = node;\n },\n }),\n [],\n );\n const formMessage = useRef<HTMLDivElement>(null);\n const result = useRef<HTMLDivElement>(null);\n\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailInput = useRef<HTMLInputElement>(null);\n const emailField = useStateBackedInput(email ?? '', emailInput);\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.\n const [openedWithFieldMessage] = useState(() =>\n RESET_PASSWORD_FORM_FIELDS.some((field) => Boolean(errors?.[field])),\n );\n const summary = useErrorSummary(\n RESET_PASSWORD_FORM_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n const formMessageAnnounce = useFormMessageAnnounce(\n serverErrors.form,\n summary.listed.length > 0,\n );\n\n // A new object for each request, so asking twice for the same place\n // moves focus twice.\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 // The form, and the button that had focus, are gone once a result\n // shows. Move focus to it. Not on a page that opens on a result: that\n // one is read from the top like any other.\n // A password does not wait in memory behind a result.\n const clearOnResult = state !== 'form';\n useEffect(() => {\n if (clearOnResult) {\n setValues({ password: '', passwordConfirm: '' });\n setTouched({});\n }\n }, [clearOnResult]);\n const wasForm = useRef(state === 'form');\n useEffect(() => {\n if (state !== 'form' && wasForm.current) result.current?.focus();\n wasForm.current = state === 'form';\n }, [state]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<ResetPasswordFormField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () =>\n RESET_PASSWORD_FORM_FIELDS.find((field) => invalid[field]),\n onRefused: (field) => {\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () =>\n onSubmit?.({\n password: values.password,\n passwordConfirm: values.passwordConfirm,\n }),\n onAnswer: (answer) => {\n const next: ResetPasswordFormErrors = 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 summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n // The page came back from the browser's cache as it was left: the\n // passwords must not come back with it.\n onRestore: emptyPasswords,\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('ResetPasswordForm', native, action);\n const extraFields = useExtraFields(\n 'ResetPasswordForm',\n native,\n fieldNames,\n hiddenFields,\n );\n const name = (field: ResetPasswordFormField) =>\n native ? fieldNames[field] : field;\n const safe = (href: string | undefined) =>\n href && isSafeHref(href) ? href : undefined;\n const loginLink = safe(loginHref);\n const requestLink = safe(requestHref);\n const showingForm = state === 'form';\n const labels: Record<ResetPasswordFormField, string> = {\n password: t('resetPasswordForm.password'),\n passwordConfirm: t('resetPasswordForm.passwordConfirm'),\n };\n const resultHeading = RESULT_HEADING[headingLevel];\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"reset-password-form\"\n data-state={state}\n className={resetPasswordFormVariants({ className })}\n >\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={\n showingForm\n ? (title ?? t('resetPasswordForm.title'))\n : t('resetPasswordForm.pageTitle')\n }\n description={\n showingForm\n ? (description ?? t('resetPasswordForm.description'))\n : undefined\n }\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {state === 'done' && (\n <>\n <Alert\n ref={result}\n variant=\"success\"\n tabIndex={-1}\n aria-labelledby={resultTitleId}\n aria-describedby={resultDescriptionId}\n data-slot=\"result\"\n className={resultVariants()}\n >\n <Alert.Title id={resultTitleId} as={resultHeading}>\n {t('resetPasswordForm.doneTitle')}\n </Alert.Title>\n <Alert.Description id={resultDescriptionId}>\n {email\n ? t('resetPasswordForm.doneDescriptionEmail', {\n // Isolated left to right, so the address keeps its\n // order inside a right-to-left sentence.\n email: `${LTR_ISOLATE}${email}${POP_ISOLATE}`,\n })\n : t('resetPasswordForm.doneDescription')}\n </Alert.Description>\n </Alert>\n {loginLink && (\n <Button\n asChild\n intent=\"primary\"\n size=\"lg\"\n className=\"ds:w-full\"\n >\n <a href={loginLink} data-action=\"login\">\n {t('resetPasswordForm.signIn')}\n </a>\n </Button>\n )}\n </>\n )}\n\n {state === 'expired' && (\n <>\n <Alert\n ref={result}\n variant=\"warning\"\n // Focus moves here: an assertive alert as well would read\n // it twice, and over a page that opens on it.\n announce=\"polite\"\n tabIndex={-1}\n aria-labelledby={resultTitleId}\n aria-describedby={resultDescriptionId}\n data-slot=\"result\"\n className={resultVariants()}\n >\n <Alert.Title id={resultTitleId} as={resultHeading}>\n {t('resetPasswordForm.expiredTitle')}\n </Alert.Title>\n <Alert.Description id={resultDescriptionId}>\n {t('resetPasswordForm.expiredDescription')}\n </Alert.Description>\n </Alert>\n {requestLink && (\n <Button\n asChild\n intent=\"primary\"\n size=\"lg\"\n className=\"ds:w-full\"\n >\n <a href={requestLink} data-action=\"request-link\">\n {t('resetPasswordForm.requestLink')}\n </a>\n </Button>\n )}\n </>\n )}\n\n {showingForm && (\n <>\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={\n serverErrors.form ? formMessageId : undefined\n }\n errors={summary.listed.map((field) => ({\n field,\n message: errorFor(field) ?? '',\n targetId: fieldIds[field],\n }))}\n />\n\n {serverErrors.form && (\n <AuthFormMessage\n ref={formMessage}\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {serverErrors.form}\n </AuthFormMessage>\n )}\n\n {email ? (\n <FormField\n id={emailFieldId}\n label={t('resetPasswordForm.email')}\n data-field=\"email\"\n >\n {/* Read-only, and not posted: it has no name. `username`\n is what password managers pair with\n `new-password`, so the new password is saved under\n this address. */}\n <EmailInput\n ref={emailField.ref}\n name=\"\"\n readOnly\n autoComplete=\"username\"\n // An address reads left to right in any language.\n dir=\"ltr\"\n disableBuiltInValidation\n onChange={emailField.quiet()}\n />\n </FormField>\n ) : null}\n\n <FormField\n id={passwordFieldId}\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 />\n </FormField>\n\n <FormField\n id={passwordConfirmFieldId}\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) =>\n set('passwordConfirm', event.target.value)\n }\n onBlur={() => {\n leave('passwordConfirm');\n match.confirmProps.onBlur();\n }}\n />\n </FormField>\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('resetPasswordForm.submit')}\n </Button>\n </form>\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </>\n )}\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nResetPasswordForm.displayName = 'ResetPasswordForm';\n"],"names":["PLATFORM_PASSWORD_POLICY","RESET_PASSWORD_FORM_FIELDS","resetPasswordFormVariants","cva","resultVariants","LTR_ISOLATE","POP_ISOLATE","RESULT_HEADING","hasMessage","errors","focusTargetFor","messages","field","ResetPasswordForm","forwardRef","state","title","description","headingLevel","showLogo","logoMotion","children","email","loginHref","requestHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","className","rest","ref","t","useTranslation","titleId","useId","resultTitleId","resultDescriptionId","emailFieldId","passwordFieldId","passwordConfirmFieldId","formMessageId","native","fieldIds","values","setValues","useState","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","set","value","previous","leave","emptyPasswords","requirements","usePasswordRequirements","match","useFieldMatch","invalid","rule","due","ownErrors","errorFor","controls","useRef","control","useMemo","node","formMessage","result","emailInput","emailField","useStateBackedInput","openedWithFieldMessage","summary","useErrorSummary","formMessageAnnounce","useFormMessageAnnounce","focusRequest","setFocusRequest","target","useEffect","_a","_b","clearOnResult","wasForm","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","extraFields","useExtraFields","name","safe","href","isSafeHref","loginLink","requestLink","showingForm","labels","resultHeading","jsx","Card","AuthCardHeading","jsxs","Fragment","Alert","Button","ErrorSummary","AuthFormMessage","FormField","EmailInput","PasswordInput","event","ExtraFields","AuthFormStatus"],"mappings":";;;;;;;;;;;;;;;;;AAWO,MAAMA,KAA2D;AAAA,EACtE,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AACX,GCyCaC,IAA6B;AAAA,EACxC;AAAA,EACA;AACF,GAyHMC,KAA4BC;AAAA,EAChC;AACF,GAGMC,KAAiBD;AAAA,EACrB;AACF,GASME,KAAc,KACdC,KAAc,KAGdC,KAAiB,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,KAAA,GAExCC,KAAa,CAACC,MAClB,OAAO,OAAOA,CAAM,EAAE,KAAK,OAAO,GAE9BC,KAAiB,CACrBC,MAEAV,EAA2B,KAAK,CAACW,MAAUD,EAASC,CAAK,CAAC,MACzDD,EAAS,OAAO,SAAS,SAUfE,KAAoBC;AAAA,EAI/B,CACE;AAAA,IACE,OAAAC,IAAQ;AAAA,IACR,OAAAC;AAAA,IACA,aAAAC;AA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Ae,MAAA5B,EAAA,CAAY;AAAA,UAAA,EAAA,CAC9B;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAnF,GAAkB,cAAc;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as f, useContext as
|
|
2
|
+
import { forwardRef as f, useContext as he, useId as me, useState as M, useRef as P, useEffect as Ae, useMemo as De, Fragment as Fe, createContext as Le } from "react";
|
|
3
3
|
import { u as Ge } from "./registry-DvAUVLHh.js";
|
|
4
4
|
import * as o from "@radix-ui/react-select";
|
|
5
5
|
import { c as J } from "./index-D2ZczOXr.js";
|
|
@@ -12,7 +12,7 @@ import { b as Xe } from "./menu-row-BAr8bx1I.js";
|
|
|
12
12
|
import { P as Je } from "./popup-region-qz_5_A0V.js";
|
|
13
13
|
import { o as U, b as Qe, d as Ye, c as Ze } from "./option-row-Dc7BrbK8.js";
|
|
14
14
|
import { C as et } from "./chevron-up-umRGgtJA.js";
|
|
15
|
-
import { C as
|
|
15
|
+
import { C as ge } from "./chevron-down-DWE7GSq9.js";
|
|
16
16
|
import { C as tt } from "./check-DrFSN__t.js";
|
|
17
17
|
import { u as st } from "./use-direction-Dp8h70PP.js";
|
|
18
18
|
import { X as at } from "./x-B5YnXwCz.js";
|
|
@@ -136,6 +136,9 @@ const nt = {
|
|
|
136
136
|
// Never wider than the screen allows: a long option wraps or ends in an
|
|
137
137
|
// ellipsis instead of running past the edge, where it would be clipped.
|
|
138
138
|
"ds:max-w-[var(--radix-select-content-available-width)]",
|
|
139
|
+
// Never taller than the room left on screen: a long list scrolls inside
|
|
140
|
+
// the viewport instead of running past the edge, out of reach.
|
|
141
|
+
"ds:max-h-[var(--radix-select-content-available-height)]",
|
|
139
142
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
|
|
140
143
|
"ds:shadow-[var(--shadow-lg)]",
|
|
141
144
|
"ds:animate-in ds:fade-in ds:zoom-in-95",
|
|
@@ -220,8 +223,8 @@ ye.displayName = "Select.Trigger";
|
|
|
220
223
|
const X = { "data-select-value": "" }, fe = [
|
|
221
224
|
"ds:[[data-select-value]_&]:block",
|
|
222
225
|
"ds:[[data-select-value]_&]:truncate"
|
|
223
|
-
].join(" "),
|
|
224
|
-
|
|
226
|
+
].join(" "), xe = f((t, a) => /* @__PURE__ */ e(o.Value, { ref: a, ...X, ...t }));
|
|
227
|
+
xe.displayName = "Select.Value";
|
|
225
228
|
const Y = f(
|
|
226
229
|
({
|
|
227
230
|
className: t,
|
|
@@ -231,11 +234,11 @@ const Y = f(
|
|
|
231
234
|
container: u,
|
|
232
235
|
...l
|
|
233
236
|
}, w) => {
|
|
234
|
-
const T =
|
|
235
|
-
return /* @__PURE__ */ e(o.Portal, { container: u ?? void 0, children: /* @__PURE__ */ e(Je, { popupRef: w, open: T, children: (
|
|
237
|
+
const T = he(Q);
|
|
238
|
+
return /* @__PURE__ */ e(o.Portal, { container: u ?? void 0, children: /* @__PURE__ */ e(Je, { popupRef: w, open: T, children: (g) => /* @__PURE__ */ p(
|
|
236
239
|
o.Content,
|
|
237
240
|
{
|
|
238
|
-
ref:
|
|
241
|
+
ref: g,
|
|
239
242
|
position: n,
|
|
240
243
|
sideOffset: i,
|
|
241
244
|
"data-component": "select-content",
|
|
@@ -244,7 +247,7 @@ const Y = f(
|
|
|
244
247
|
children: [
|
|
245
248
|
/* @__PURE__ */ e(o.ScrollUpButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ e(et, { "aria-hidden": "true", className: "ds:size-4" }) }),
|
|
246
249
|
a,
|
|
247
|
-
/* @__PURE__ */ e(o.ScrollDownButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ e(
|
|
250
|
+
/* @__PURE__ */ e(o.ScrollDownButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ e(ge, { "aria-hidden": "true", className: "ds:size-4" }) })
|
|
248
251
|
]
|
|
249
252
|
}
|
|
250
253
|
) }) });
|
|
@@ -270,14 +273,14 @@ const ee = f(
|
|
|
270
273
|
description: l,
|
|
271
274
|
descriptionTone: w,
|
|
272
275
|
descriptionInName: T = !1,
|
|
273
|
-
wrapLabel:
|
|
276
|
+
wrapLabel: g = !1,
|
|
274
277
|
labelDir: v,
|
|
275
278
|
...y
|
|
276
279
|
}, O) => {
|
|
277
|
-
const A = lt[t ?? "md"], D = dt[t ?? "md"], R = me(),
|
|
280
|
+
const A = lt[t ?? "md"], D = dt[t ?? "md"], R = me(), x = me(), h = l != null && l !== "", z = h && T, k = z ? { id: x } : {}, F = z ? { "aria-labelledby": `${x} ${R}` } : {}, E = g ? U({
|
|
278
281
|
wrap: !0,
|
|
279
282
|
className: fe
|
|
280
|
-
}) : "",
|
|
283
|
+
}) : "", S = h ? "ds:group-data-[disabled]/select-item:opacity-50" : "", _ = u ? (
|
|
281
284
|
// Radix points the item's `aria-labelledby` at `ItemText`, so
|
|
282
285
|
// anything rendered outside it is dropped from the accessible
|
|
283
286
|
// name — a price there would be visible but never announced.
|
|
@@ -305,8 +308,8 @@ const ee = f(
|
|
|
305
308
|
"span",
|
|
306
309
|
{
|
|
307
310
|
className: Ye({
|
|
308
|
-
wrap:
|
|
309
|
-
className:
|
|
311
|
+
wrap: g,
|
|
312
|
+
className: S
|
|
310
313
|
}),
|
|
311
314
|
children: [
|
|
312
315
|
/* @__PURE__ */ e(
|
|
@@ -321,11 +324,11 @@ const ee = f(
|
|
|
321
324
|
]
|
|
322
325
|
}
|
|
323
326
|
) })
|
|
324
|
-
) :
|
|
327
|
+
) : h || g ? /* @__PURE__ */ e(o.ItemText, { asChild: !0, ...k, children: /* @__PURE__ */ e(
|
|
325
328
|
"span",
|
|
326
329
|
{
|
|
327
330
|
dir: v,
|
|
328
|
-
className: [E,
|
|
331
|
+
className: [E, S].filter(Boolean).join(" "),
|
|
329
332
|
children: n
|
|
330
333
|
}
|
|
331
334
|
) }) : v ? (
|
|
@@ -347,10 +350,10 @@ const ee = f(
|
|
|
347
350
|
{
|
|
348
351
|
ref: O,
|
|
349
352
|
...F,
|
|
350
|
-
"aria-describedby":
|
|
353
|
+
"aria-describedby": h && !z ? R : void 0,
|
|
351
354
|
className: rt({
|
|
352
355
|
size: t,
|
|
353
|
-
className:
|
|
356
|
+
className: h ? [
|
|
354
357
|
"ds:group/select-item ds:data-[disabled]:!opacity-100",
|
|
355
358
|
a
|
|
356
359
|
].filter(Boolean).join(" ") : a
|
|
@@ -360,7 +363,7 @@ const ee = f(
|
|
|
360
363
|
/* @__PURE__ */ e(
|
|
361
364
|
"span",
|
|
362
365
|
{
|
|
363
|
-
className: `ds:absolute ${A} ds:inline-flex ds:items-center ds:justify-center ${
|
|
366
|
+
className: `ds:absolute ${A} ds:inline-flex ds:items-center ds:justify-center ${S}`,
|
|
364
367
|
"aria-hidden": "true",
|
|
365
368
|
children: /* @__PURE__ */ e(o.ItemIndicator, { children: /* @__PURE__ */ e(tt, { className: D }) })
|
|
366
369
|
}
|
|
@@ -371,14 +374,14 @@ const ee = f(
|
|
|
371
374
|
"span",
|
|
372
375
|
{
|
|
373
376
|
"aria-hidden": "true",
|
|
374
|
-
className: `ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)] ${
|
|
377
|
+
className: `ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)] ${S}`,
|
|
375
378
|
children: i
|
|
376
379
|
}
|
|
377
380
|
)
|
|
378
381
|
) : null,
|
|
379
|
-
|
|
382
|
+
h || g ? /* @__PURE__ */ p("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:py-[var(--spacing-xs)]", children: [
|
|
380
383
|
_,
|
|
381
|
-
|
|
384
|
+
h ? /* @__PURE__ */ e(
|
|
382
385
|
"span",
|
|
383
386
|
{
|
|
384
387
|
id: R,
|
|
@@ -395,8 +398,8 @@ const ee = f(
|
|
|
395
398
|
}
|
|
396
399
|
);
|
|
397
400
|
ee.displayName = "Select.Item";
|
|
398
|
-
const
|
|
399
|
-
|
|
401
|
+
const Se = f((t, a) => /* @__PURE__ */ e(o.ItemText, { ref: a, ...t }));
|
|
402
|
+
Se.displayName = "Select.ItemText";
|
|
400
403
|
const Ne = f((t, a) => /* @__PURE__ */ e(o.Group, { ref: a, ...t }));
|
|
401
404
|
Ne.displayName = "Select.Group";
|
|
402
405
|
const te = f(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
@@ -440,27 +443,27 @@ const Ie = f(function({
|
|
|
440
443
|
placeholder: l,
|
|
441
444
|
clearable: w = !1,
|
|
442
445
|
disabled: T,
|
|
443
|
-
required:
|
|
446
|
+
required: g,
|
|
444
447
|
name: v,
|
|
445
448
|
id: y,
|
|
446
449
|
size: O = "md",
|
|
447
450
|
tone: A = "default",
|
|
448
451
|
className: D,
|
|
449
452
|
container: R,
|
|
450
|
-
"aria-label":
|
|
451
|
-
"aria-describedby":
|
|
453
|
+
"aria-label": x,
|
|
454
|
+
"aria-describedby": h,
|
|
452
455
|
adornmentInTrigger: z = !1,
|
|
453
456
|
showDescriptions: k = !1,
|
|
454
457
|
descriptionInName: F = !1,
|
|
455
458
|
wrapOptionLabels: E = !1,
|
|
456
|
-
...
|
|
459
|
+
...S
|
|
457
460
|
}, _) {
|
|
458
461
|
var ue;
|
|
459
|
-
const { t: L } = Ke("ui"), N = We(), b =
|
|
462
|
+
const { t: L } = Ke("ui"), N = We(), b = he($e) !== null, [Ce, B] = M(
|
|
460
463
|
n ?? i ?? ""
|
|
461
464
|
), I = n !== void 0, m = I ? n : Ce, [V, G] = M(!1), ae = P(m);
|
|
462
465
|
ae.current = m;
|
|
463
|
-
const we = qe(N, y), Te = y ?? (b ? we : void 0), K = (b ? N.disabled : !1) || !!T, W = (b ? N.required : !1) || !!
|
|
466
|
+
const we = qe(N, y), Te = y ?? (b ? we : void 0), K = (b ? N.disabled : !1) || !!T, W = (b ? N.required : !1) || !!g, ne = b ? N.invalid : !1, Re = ne ? "error" : A, ze = [b ? N.describedBy : void 0, h].filter(Boolean).join(" ") || void 0, oe = z ? (ue = a.find((s) => s.value === m)) == null ? void 0 : ue.startAdornment : void 0, j = P(null), Ve = ct(_, j), je = st(j), [Oe, ke] = M(!0);
|
|
464
467
|
Me(() => {
|
|
465
468
|
var s;
|
|
466
469
|
m === "" && ke(!!((s = j.current) != null && s.closest("form")));
|
|
@@ -482,7 +485,7 @@ const Ie = f(function({
|
|
|
482
485
|
}, Ee = (s) => {
|
|
483
486
|
var r;
|
|
484
487
|
s.preventDefault(), s.stopPropagation(), I || B(""), d == null || d(""), (r = j.current) == null || r.focus();
|
|
485
|
-
}, H = l ?? L("inputs.select.placeholder", "Select…"), _e = w && !!m && !K, de =
|
|
488
|
+
}, H = l ?? L("inputs.select.placeholder", "Select…"), _e = w && !!m && !K, de = x === void 0 && !b, le = de ? H : x, ce = !x && b ? `${N.id}-label` : void 0, Be = He(a), Pe = De(
|
|
486
489
|
() => ({
|
|
487
490
|
getValue: () => ae.current,
|
|
488
491
|
setValue: (s) => {
|
|
@@ -521,7 +524,7 @@ const Ie = f(function({
|
|
|
521
524
|
"data-name-from-placeholder": de || void 0,
|
|
522
525
|
"aria-describedby": ze,
|
|
523
526
|
"aria-invalid": ne || void 0,
|
|
524
|
-
...ft(
|
|
527
|
+
...ft(S),
|
|
525
528
|
"data-component": "select",
|
|
526
529
|
"data-component-id": y,
|
|
527
530
|
className: ve({
|
|
@@ -577,7 +580,7 @@ const Ie = f(function({
|
|
|
577
580
|
}
|
|
578
581
|
) : null,
|
|
579
582
|
/* @__PURE__ */ e(o.Icon, { asChild: !0, children: /* @__PURE__ */ e(
|
|
580
|
-
|
|
583
|
+
ge,
|
|
581
584
|
{
|
|
582
585
|
"aria-hidden": "true",
|
|
583
586
|
className: [
|
|
@@ -656,30 +659,30 @@ const Ie = f(function({
|
|
|
656
659
|
);
|
|
657
660
|
});
|
|
658
661
|
Ie.displayName = "Select";
|
|
659
|
-
const
|
|
662
|
+
const ht = Object.assign(Ie, {
|
|
660
663
|
Root: be,
|
|
661
664
|
Trigger: ye,
|
|
662
|
-
Value:
|
|
665
|
+
Value: xe,
|
|
663
666
|
Content: Y,
|
|
664
667
|
Viewport: Z,
|
|
665
668
|
Item: ee,
|
|
666
|
-
ItemText:
|
|
669
|
+
ItemText: Se,
|
|
667
670
|
Group: Ne,
|
|
668
671
|
Label: te,
|
|
669
672
|
Separator: se
|
|
670
|
-
}), Et =
|
|
673
|
+
}), Et = ht;
|
|
671
674
|
export {
|
|
672
675
|
Et as S,
|
|
673
676
|
Y as a,
|
|
674
677
|
Ne as b,
|
|
675
678
|
ee as c,
|
|
676
|
-
|
|
679
|
+
Se as d,
|
|
677
680
|
te as e,
|
|
678
681
|
be as f,
|
|
679
682
|
se as g,
|
|
680
683
|
ye as h,
|
|
681
|
-
|
|
684
|
+
xe as i,
|
|
682
685
|
Z as j,
|
|
683
686
|
ve as s
|
|
684
687
|
};
|
|
685
|
-
//# sourceMappingURL=select-
|
|
688
|
+
//# sourceMappingURL=select-uESzXTX6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-uESzXTX6.js","sources":["../../src/components/select/select.agent.ts","../../src/components/select/select.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Select. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { SelectHandle } from './select';\n\nexport const selectAgent: AgentAdapter<SelectHandle> = {\n id: 'select',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus open/close of the option list.\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.select.state.value',\n description:\n 'Currently selected option value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.select.state.isOpen',\n description: 'Whether the option list is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the chosen option — reversible by selecting another value.\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: { type: 'string', description: 'Option value to select.' },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.setValue',\n description:\n 'Select the option with the given value. A value that is not among the options, belongs to a disabled option, or is an action option (such as New signatory), is ignored and the selection stays as it was.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.clear',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'select',\n description: 'Marks the Select trigger.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description:\n 'Stable opaque option value emitted on each rendered option.',\n },\n },\n};\n","import {\n createContext,\n forwardRef,\n Fragment,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type AriaAttributes,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { selectAgent } from './select.agent';\n\n/** Agent-readiness curated handle for Select. */\nexport interface SelectHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n}\nimport * as RadixSelect from '@radix-ui/react-select';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { groupOptions } from '../_shared/group-options';\nimport { useDirection } from '../_shared/use-direction';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport { PopupRegion } from '../_shared/popup-region';\nimport {\n OPTION_END_CLASSES,\n optionDescriptionVariants,\n optionLabelRowVariants,\n optionLabelVariants,\n type OptionDescriptionTone,\n} from '../_shared/option-row';\n\nconst selectTriggerVariants = cva(\n [\n 'ds:group ds:inline-flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--control-border)] ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:data-[placeholder]:text-muted-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:focus-visible:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst selectContentVariants = cva(\n [\n 'ds:z-[var(--z-dropdown)] ds:overflow-hidden',\n // Never wider than the screen allows: a long option wraps or ends in an\n // ellipsis instead of running past the edge, where it would be clipped.\n 'ds:max-w-[var(--radix-select-content-available-width)]',\n // Never taller than the room left on screen: a long list scrolls inside\n // the viewport instead of running past the edge, out of reach.\n 'ds:max-h-[var(--radix-select-content-available-height)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst selectItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.highlighted,\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-10 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst selectLabelClasses = [\n 'ds:ps-8 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n 'ds:sticky ds:top-0 ds:bg-background',\n].join(' ');\n\nconst iconSizeByItemSize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst itemIndicatorStartByItemSize = {\n sm: 'ds:start-2',\n md: 'ds:start-2',\n lg: 'ds:start-3',\n} as const;\n\nfunction composeRefs<T>(\n ...refs: Array<Ref<T> | undefined | null>\n): (node: T | null) => void {\n return (node: T | null) => {\n for (const r of refs) {\n if (!r) continue;\n if (typeof r === 'function') {\n r(node);\n } else {\n (r as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Compound sub-components — thin `forwardRef` wrappers over Radix parts.\n// ---------------------------------------------------------------------------\n\ntype SelectRootProps = ComponentPropsWithoutRef<typeof RadixSelect.Root>;\n\n// Whether the list is open, so SelectContent mounts its landmark wrapper only\n// while it is: a closed Select leaves nothing at the end of <body>.\nconst SelectOpenContext = createContext<boolean | undefined>(undefined);\n\nconst SelectRoot = ({\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...props\n}: SelectRootProps) => {\n const [open, setOpen] = useControllableState<boolean>({\n value: openProp,\n defaultValue: defaultOpen ?? false,\n onChange: onOpenChange,\n });\n return (\n <SelectOpenContext.Provider value={open ?? false}>\n <RadixSelect.Root\n open={open ?? false}\n onOpenChange={setOpen}\n {...props}\n />\n </SelectOpenContext.Provider>\n );\n};\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = ElementRef<typeof RadixSelect.Trigger>;\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof RadixSelect.Trigger> &\n VariantProps<typeof selectTriggerVariants>;\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ size, tone, className, children, ...props }, ref) => (\n <RadixSelect.Trigger\n ref={ref}\n className={selectTriggerVariants({ size, tone, className })}\n {...props}\n >\n {children}\n </RadixSelect.Trigger>\n ),\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof RadixSelect.Value>;\n\n/* Marks the trigger's value, where Radix mirrors the chosen item's text, so\n an item can lay its label out differently there (one line, always). */\nconst SELECT_VALUE_MARKER = { 'data-select-value': '' } as const;\n\n/* A wrapping label, mirrored into the trigger, goes back to one line with an\n ellipsis: the trigger keeps its height whatever the option. */\nconst WRAPPED_LABEL_IN_TRIGGER = [\n 'ds:[[data-select-value]_&]:block',\n 'ds:[[data-select-value]_&]:truncate',\n].join(' ');\n\nconst SelectValue = forwardRef<\n ElementRef<typeof RadixSelect.Value>,\n SelectValueProps\n>((props, ref) => (\n <RadixSelect.Value ref={ref} {...SELECT_VALUE_MARKER} {...props} />\n));\nSelectValue.displayName = 'Select.Value';\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Content\n> & {\n container?: HTMLElement | null;\n};\n\nconst SelectContent = forwardRef<\n ElementRef<typeof RadixSelect.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n sideOffset = 4,\n container,\n ...props\n },\n ref,\n ) => {\n const open = useContext(SelectOpenContext);\n return (\n <RadixSelect.Portal container={container ?? undefined}>\n {/* A region named after the field, so axe `region` passes while open. */}\n <PopupRegion popupRef={ref} open={open}>\n {(popupRef) => (\n <RadixSelect.Content\n ref={popupRef}\n position={position}\n sideOffset={sideOffset}\n data-component=\"select-content\"\n className={selectContentVariants({ className })}\n {...props}\n >\n <RadixSelect.ScrollUpButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronUp aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollUpButton>\n {children}\n <RadixSelect.ScrollDownButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollDownButton>\n </RadixSelect.Content>\n )}\n </PopupRegion>\n </RadixSelect.Portal>\n );\n },\n);\nSelectContent.displayName = 'Select.Content';\n\ntype SelectViewportProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Viewport\n>;\n\nconst SelectViewport = forwardRef<\n ElementRef<typeof RadixSelect.Viewport>,\n SelectViewportProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Viewport\n ref={ref}\n className={['ds:p-1', className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectViewport.displayName = 'Select.Viewport';\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof RadixSelect.Item> &\n VariantProps<typeof selectItemVariants> & {\n /** Optional leading visual rendered before the item text (e.g. a Flag). */\n startAdornment?: ReactNode;\n /**\n * Trailing content pinned to the inline-end of the item (e.g. a\n * price Badge). Unlike `startAdornment` this is NOT `aria-hidden`,\n * because it carries meaning rather than decoration.\n *\n * It renders INSIDE `RadixSelect.ItemText`, because Radix builds the\n * item's accessible name from that element alone — content placed\n * outside it is shown but never announced. A consequence worth\n * knowing: Radix mirrors `ItemText` into the closed trigger, so the\n * selected item's trailing content appears there too.\n */\n endContent?: ReactNode;\n /**\n * A second line under the label, e.g. why an option is disabled. It is\n * the option's accessible description, outside `ItemText`, so it is\n * neither part of the name nor mirrored into the trigger. It does not\n * fade with a disabled option, so the reason stays readable.\n */\n description?: ReactNode;\n /** How `description` reads: muted meta text, or the error text colour\n * for a line that warns. */\n descriptionTone?: OptionDescriptionTone;\n /**\n * Read `description` as part of the item's accessible name, after the\n * label and `endContent`, instead of as its description. For a second\n * line that is part of what the option is (a payment the patient\n * commits to), not a side note (why it is disabled).\n */\n descriptionInName?: boolean;\n /** Let the label wrap onto a second line; it is clipped after two. In\n * the trigger it stays on one line. */\n wrapLabel?: boolean;\n /** Writing direction of the label (`OptionShape.dir`). Set on the\n * element that clips, so a long label keeps its start in view. */\n labelDir?: OptionShape['dir'];\n };\n\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(\n (\n {\n size = 'md',\n className,\n children,\n startAdornment,\n endContent,\n description,\n descriptionTone,\n descriptionInName = false,\n wrapLabel = false,\n labelDir,\n ...props\n },\n ref,\n ) => {\n const indicatorStart = itemIndicatorStartByItemSize[size ?? 'md'];\n const iconSize = iconSizeByItemSize[size ?? 'md'];\n const descriptionId = useId();\n const textId = useId();\n const hasDescription =\n description !== undefined && description !== null && description !== '';\n // Radix names an item from its ItemText alone (`aria-labelledby`). To\n // read the description in the name too, the item points at both, by\n // ids of our own: ItemText takes the id given to it over Radix's.\n // Spread, never passed as undefined: Radix spreads our props over its\n // own, so an undefined id or aria-labelledby would erase them.\n const nameWithDescription = hasDescription && descriptionInName;\n const itemTextIdProps = nameWithDescription ? { id: textId } : {};\n const itemNameProps = nameWithDescription\n ? { 'aria-labelledby': `${textId} ${descriptionId}` }\n : {};\n const wrappedLabel = wrapLabel\n ? optionLabelVariants({\n wrap: true,\n className: WRAPPED_LABEL_IN_TRIGGER,\n })\n : '';\n // With a description, a disabled option fades its label, not the whole\n // row, so the reason under it stays at full contrast.\n const fade = hasDescription\n ? 'ds:group-data-[disabled]/select-item:opacity-50'\n : '';\n const itemText = endContent ? (\n // Radix points the item's `aria-labelledby` at `ItemText`, so\n // anything rendered outside it is dropped from the accessible\n // name — a price there would be visible but never announced.\n // It therefore goes INSIDE `ItemText`, wrapped in a flex row so\n // `ms-auto` still pins it to the inline-end (and flips in RTL).\n //\n // The trade-off is deliberate: Radix mirrors `ItemText` into the\n // closed trigger, so the selected item's trailing content shows\n // there too. For the case this exists for — a price — that reads\n // as a feature, not a leak. The wrapper is rendered ONLY when\n // `endContent` is supplied, so every existing item keeps its\n // previous DOM exactly.\n //\n // `asChild` is required, not stylistic. `SelectItemText`\n // destructures `className` and `style` off its props and never\n // applies them, so styling it directly is silently discarded.\n // It must also GROW: as a plain flex item of the row it sizes to\n // its content, leaving `ms-auto` no free space to absorb, and the\n // chip would sit against the label instead of the row's end —\n // the ragged column this change exists to remove. `asChild` makes\n // our own span become the ItemText element, so `flex-1` lands.\n //\n // A wrapping label keeps the end content on its first line.\n <RadixSelect.ItemText asChild {...itemTextIdProps}>\n <span\n className={optionLabelRowVariants({\n wrap: wrapLabel,\n className: fade,\n })}\n >\n <span\n dir={labelDir}\n className={wrappedLabel || optionLabelVariants()}\n >\n {children}\n </span>\n <span className={OPTION_END_CLASSES}>{endContent}</span>\n </span>\n </RadixSelect.ItemText>\n ) : hasDescription || wrapLabel ? (\n <RadixSelect.ItemText asChild {...itemTextIdProps}>\n <span\n dir={labelDir}\n className={[wrappedLabel, fade].filter(Boolean).join(' ')}\n >\n {children}\n </span>\n </RadixSelect.ItemText>\n ) : labelDir ? (\n // Our own element, so the direction sits on the box that clips, in\n // the list and in the trigger (Radix mirrors this span there).\n <RadixSelect.ItemText asChild>\n <span\n dir={labelDir}\n className={optionLabelVariants({\n className: WRAPPED_LABEL_IN_TRIGGER,\n })}\n >\n {children}\n </span>\n </RadixSelect.ItemText>\n ) : (\n <RadixSelect.ItemText>{children}</RadixSelect.ItemText>\n );\n return (\n <RadixSelect.Item\n ref={ref}\n {...itemNameProps}\n aria-describedby={\n hasDescription && !nameWithDescription ? descriptionId : undefined\n }\n className={selectItemVariants({\n size,\n className: hasDescription\n ? [\n 'ds:group/select-item ds:data-[disabled]:!opacity-100',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n : className,\n })}\n {...props}\n >\n <span\n className={`ds:absolute ${indicatorStart} ds:inline-flex ds:items-center ds:justify-center ${fade}`}\n aria-hidden=\"true\"\n >\n <RadixSelect.ItemIndicator>\n <Check className={iconSize} />\n </RadixSelect.ItemIndicator>\n </span>\n {startAdornment ? (\n // Decorative by contract — accessible name comes from the item text.\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)] ${fade}`}\n >\n {startAdornment}\n </span>\n ) : null}\n {/* A wrapping label takes the same padded column as a description,\n so two-line rows keep space between them. */}\n {hasDescription || wrapLabel ? (\n <span className=\"ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:py-[var(--spacing-xs)]\">\n {itemText}\n {hasDescription ? (\n <span\n id={descriptionId}\n className={optionDescriptionVariants({\n tone: descriptionTone,\n })}\n >\n {description}\n </span>\n ) : null}\n </span>\n ) : (\n itemText\n )}\n </RadixSelect.Item>\n );\n },\n);\nSelectItem.displayName = 'Select.Item';\n\ntype SelectItemTextProps = ComponentPropsWithoutRef<\n typeof RadixSelect.ItemText\n>;\n\nconst SelectItemText = forwardRef<\n ElementRef<typeof RadixSelect.ItemText>,\n SelectItemTextProps\n>((props, ref) => <RadixSelect.ItemText ref={ref} {...props} />);\nSelectItemText.displayName = 'Select.ItemText';\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof RadixSelect.Group>;\n\nconst SelectGroup = forwardRef<\n ElementRef<typeof RadixSelect.Group>,\n SelectGroupProps\n>((props, ref) => <RadixSelect.Group ref={ref} {...props} />);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof RadixSelect.Label>;\n\nconst SelectLabel = forwardRef<\n ElementRef<typeof RadixSelect.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Label\n ref={ref}\n className={[selectLabelClasses, className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Separator\n>;\n\nconst SelectSeparator = forwardRef<\n ElementRef<typeof RadixSelect.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Separator\n ref={ref}\n className={['ds:my-1 ds:h-px ds:bg-border', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nSelectSeparator.displayName = 'Select.Separator';\n\n// ---------------------------------------------------------------------------\n// Convenience form — `<Select options={[{value, label, group?}]} />`.\n// ---------------------------------------------------------------------------\n\nexport type SelectOption<T extends string = string> = OptionShape<T> & {\n /**\n * Draws a line above this option, e.g. to set an action at the end of\n * the list apart from the values. Select only.\n */\n separatorBefore?: boolean;\n /**\n * `'action'`: the label in the link colour, for an option that does\n * something (such as opening a page) rather than pick a value. The host\n * handles it in `onValueChange` and keeps its own value. Select only.\n */\n intent?: 'action';\n};\n\n/* An action option's label: the link colour, readable in every theme as\n Link's. A highlighted row's own colours still win. */\nconst ACTION_OPTION_CLASSES =\n 'ds:[--primary:var(--primary-readable)] ds:text-primary';\n\n/* No element has this id, so a field given it as `form` belongs to no form. */\nconst DETACHED_FORM_ID = 'ds-select-detached';\n\n/* The bounding marker, and the state Radix writes on the trigger. */\nconst OWNED_TRIGGER_ATTRIBUTES = new Set([\n 'data-component',\n 'data-component-id',\n 'data-state',\n 'data-placeholder',\n 'data-disabled',\n 'aria-expanded',\n 'aria-controls',\n]);\n\n/* The `data-*` and `aria-*` props a caller set, for the trigger. */\nfunction triggerAttributes(props: object): Record<string, unknown> {\n const picked: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n if (value === undefined || OWNED_TRIGGER_ATTRIBUTES.has(key)) continue;\n if (key.startsWith('data-') || key.startsWith('aria-')) picked[key] = value;\n }\n return picked;\n}\n\n/**\n * `data-*` attributes (test ids, error anchors) and other `aria-*`\n * attributes reach the trigger, and win over the ones the Select sets.\n */\nexport interface SelectProps<T extends string = string> extends Omit<\n AriaAttributes,\n 'aria-label' | 'aria-describedby'\n> {\n options: SelectOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n 'aria-label'?: string;\n /**\n * Extra ids describing the trigger, e.g. a visually hidden reason why an\n * option is disabled (a disabled option cannot take focus, so its own\n * description is never announced). Joined after any FormField ids.\n */\n 'aria-describedby'?: string;\n /**\n * Show the selected option's `startAdornment` in the trigger, before its\n * label, e.g. a channel icon. Off by default. Decorative, like the\n * adornment in the list.\n */\n adornmentInTrigger?: boolean;\n /**\n * Render each option's `description` as a second line under its label,\n * wired as the option's accessible description. Off by default: without\n * it `description` is ignored, as in 1.30.0, so existing lists keep\n * their layout.\n */\n showDescriptions?: boolean;\n /**\n * With `showDescriptions`, read each description as part of its option's\n * accessible name (after the label and `endContent`) rather than as its\n * description, as Combobox and MultiSelect do. For a second line that is\n * part of what the option is, such as a payment the patient commits to.\n * Off by default.\n */\n descriptionInName?: boolean;\n /**\n * Let a long option label wrap onto a second line instead of ending in an\n * ellipsis. Longer still, it is clipped after two lines. The trigger\n * still shows the chosen label on one line. Off by default.\n */\n wrapOptionLabels?: boolean;\n className?: string;\n /**\n * Portal target for the listbox. Defaults to `document.body`, which is\n * almost always correct.\n *\n * You do not need this to fix stacking. `--z-dropdown` and `--z-popover`\n * are one layer, so a Select nested inside a Popover already paints over it\n * by portal order (the listbox mounts last). Only pass a container when the\n * listbox must live inside a specific subtree — e.g. a shadow root, or a\n * scroll container that would otherwise clip it.\n */\n container?: HTMLElement | null;\n}\n\nconst SelectImpl = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n className,\n container,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n adornmentInTrigger = false,\n showDescriptions = false,\n descriptionInName = false,\n wrapOptionLabels = false,\n ...rest\n },\n ref,\n) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [internalValue, setInternalValue] = useState<string>(\n value ?? defaultValue ?? '',\n );\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n\n const [openState, setOpenState] = useState<boolean>(false);\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const controlId = useFormFieldControlId(ctx, id);\n const triggerId = id ?? (inFormField ? controlId : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n [inFormField ? ctx.describedBy : undefined, ariaDescribedBy]\n .filter(Boolean)\n .join(' ') || undefined;\n const triggerAdornment = adornmentInTrigger\n ? options.find((option) => option.value === currentValue)?.startAdornment\n : undefined;\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const composedTriggerRef = composeRefs(ref, triggerRef);\n const dir = useDirection(triggerRef);\n\n /* Radix is always given the value, '' for none, so it never swaps\n between its own state and ours. Its hidden form select has no empty\n option though, and would post the first option for ''. So while the\n value is empty that select is cut from the form and the one rendered\n below stands in: it posts `name=` and holds `required`, as before. */\n const [inForm, setInForm] = useState(true);\n useIsomorphicLayoutEffect(() => {\n if (currentValue !== '') return;\n setInForm(Boolean(triggerRef.current?.closest('form')));\n });\n const standsIn = currentValue === '' && inForm;\n\n /* On a clear the stand-in takes over the name, so form listeners hear\n the change from it. */\n const standInRef = useRef<HTMLSelectElement>(null);\n const hadValueRef = useRef(currentValue !== '');\n useEffect(() => {\n if (currentValue !== '') {\n hadValueRef.current = true;\n return;\n }\n if (!hadValueRef.current) return;\n hadValueRef.current = false;\n standInRef.current?.dispatchEvent(new Event('change', { bubbles: true }));\n }, [currentValue]);\n\n const emitValue = onValueChange as ((value: string) => void) | undefined;\n\n const handleValueChange = (next: string) => {\n // An action option runs its action; it never becomes the value.\n const isAction = options.some(\n (option) => option.value === next && option.intent === 'action',\n );\n // Typeahead on the closed trigger must not run an action (platform\n // navigates away): an action runs only from the open list.\n if (isAction && !openState) return;\n if (!isControlled && !isAction) setInternalValue(next);\n emitValue?.(next);\n };\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n triggerRef.current?.focus();\n };\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.select.placeholder', 'Select…');\n\n const showClear = clearable && !!currentValue && !effectiveDisabled;\n\n const nameFromPlaceholder = ariaLabel === undefined && !inFormField;\n const triggerLabel = nameFromPlaceholder ? resolvedPlaceholder : ariaLabel;\n const triggerLabelledBy =\n !ariaLabel && inFormField ? `${ctx.id}-label` : undefined;\n\n const groups = groupOptions(options);\n\n const agentHandle = useMemo<SelectHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => {\n // Only what a user could pick: a listed option that is not disabled.\n const picked = options.find((option) => option.value === next);\n if (!picked || picked.disabled || picked.intent === 'action') return;\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n },\n clear: () => {\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n },\n open: () => setOpenState(true),\n close: () => setOpenState(false),\n isOpen: () => openState,\n }),\n [emitValue, isControlled, openState, options],\n );\n useAgentRegistration(selectAgent, agentHandle, id);\n\n return (\n <RadixSelect.Root\n value={currentValue}\n onValueChange={handleValueChange}\n open={openState}\n onOpenChange={setOpenState}\n disabled={effectiveDisabled}\n required={effectiveRequired}\n name={standsIn ? undefined : name}\n form={standsIn ? DETACHED_FORM_ID : undefined}\n dir={dir}\n >\n <RadixSelect.Trigger\n ref={composedTriggerRef}\n id={triggerId}\n aria-label={triggerLabel}\n aria-labelledby={triggerLabelledBy}\n // The open list's landmark must not be named \"Select…\".\n data-name-from-placeholder={nameFromPlaceholder || undefined}\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n {...triggerAttributes(rest)}\n data-component=\"select\"\n data-component-id={id}\n className={selectTriggerVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n {/* min-w-0 lets the flex child shrink; truncate clips long values\n to one line with an ellipsis instead of wrapping the trigger. */}\n {triggerAdornment ? (\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Decorative, as in the list: the name is the label. */}\n <span\n aria-hidden=\"true\"\n data-select-trigger-adornment=\"\"\n className=\"ds:inline-flex ds:shrink-0 ds:items-center\"\n >\n {triggerAdornment}\n </span>\n <span className=\"ds:min-w-0 ds:truncate ds:text-start\">\n <RadixSelect.Value\n {...SELECT_VALUE_MARKER}\n placeholder={resolvedPlaceholder}\n />\n </span>\n </span>\n ) : (\n <span className=\"ds:min-w-0 ds:truncate ds:text-start\">\n <RadixSelect.Value\n {...SELECT_VALUE_MARKER}\n placeholder={resolvedPlaceholder}\n />\n </span>\n )}\n <span className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.select.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n }}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4',\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n <RadixSelect.Icon asChild>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:group-data-[state=open]:rotate-180',\n ].join(' ')}\n />\n </RadixSelect.Icon>\n </span>\n </RadixSelect.Trigger>\n {standsIn && (name !== undefined || effectiveRequired) ? (\n <select\n ref={standInRef}\n // Its own marker: it sits beside the trigger, not inside it.\n data-component=\"select-field\"\n aria-hidden\n tabIndex={-1}\n // A failed native submit puts focus here: it then needs a name.\n aria-label={triggerLabel}\n aria-labelledby={triggerLabelledBy}\n name={name}\n required={effectiveRequired}\n disabled={effectiveDisabled}\n value=\"\"\n onChange={(event) => {\n if (event.target.value === '') return;\n /* A pick unmounts this field: focus moves to the trigger first,\n not to the page. */\n if (document.activeElement === event.target) {\n triggerRef.current?.focus();\n }\n handleValueChange(event.target.value);\n }}\n className=\"ds:sr-only\"\n >\n <option value=\"\" />\n {options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n dir={option.dir}\n >\n {option.label}\n </option>\n ))}\n </select>\n ) : null}\n <SelectOpenContext.Provider value={openState}>\n <SelectContent container={container}>\n <SelectViewport>\n {options.length === 0 ? (\n <div className=\"ds:ps-8 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground\">\n {t('inputs.select.noOptions', 'No options')}\n </div>\n ) : (\n groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => (\n <Fragment key={option.value}>\n {option.separatorBefore ? <SelectSeparator /> : null}\n <SelectItem\n value={option.value}\n className={\n option.intent === 'action'\n ? ACTION_OPTION_CLASSES\n : undefined\n }\n disabled={option.disabled}\n size={size}\n data-option-id={option.value}\n startAdornment={option.startAdornment}\n endContent={option.endContent}\n description={\n showDescriptions ? option.description : undefined\n }\n descriptionTone={option.descriptionTone}\n descriptionInName={descriptionInName}\n wrapLabel={wrapOptionLabels}\n labelDir={option.dir}\n >\n {option.label}\n </SelectItem>\n </Fragment>\n ));\n if (!group) {\n return (\n <RadixSelect.Group key={`group-${groupIndex}`}>\n {body}\n </RadixSelect.Group>\n );\n }\n return (\n <RadixSelect.Group key={`group-${group}`}>\n <SelectLabel>{group}</SelectLabel>\n {body}\n </RadixSelect.Group>\n );\n })\n )}\n </SelectViewport>\n </SelectContent>\n </SelectOpenContext.Provider>\n </RadixSelect.Root>\n );\n});\nSelectImpl.displayName = 'Select';\n\ninterface SelectComponent {\n <T extends string = string>(\n props: SelectProps<T> & { ref?: Ref<HTMLButtonElement> },\n ): ReactElement | null;\n displayName?: string;\n Root: typeof SelectRoot;\n Trigger: typeof SelectTrigger;\n Value: typeof SelectValue;\n Content: typeof SelectContent;\n Viewport: typeof SelectViewport;\n Item: typeof SelectItem;\n ItemText: typeof SelectItemText;\n Group: typeof SelectGroup;\n Label: typeof SelectLabel;\n Separator: typeof SelectSeparator;\n}\n\nconst SelectWithStatics = Object.assign(SelectImpl, {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Content: SelectContent,\n Viewport: SelectViewport,\n Item: SelectItem,\n ItemText: SelectItemText,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n}) as unknown as SelectComponent;\n\nexport const Select = SelectWithStatics;\n\nexport {\n SelectRoot,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectViewport,\n SelectItem,\n SelectItemText,\n SelectGroup,\n SelectLabel,\n SelectSeparator,\n};\n\nexport { selectTriggerVariants, selectContentVariants, selectItemVariants };\n\nexport type {\n SelectTriggerProps,\n SelectContentProps,\n SelectItemProps,\n SelectLabelProps,\n SelectRootProps,\n};\n\nexport type { ReactNode };\n"],"names":["selectAgent","handle","args","selectTriggerVariants","cva","selectContentVariants","selectItemVariants","MENU_ROW_HIGHLIGHT","selectLabelClasses","iconSizeByItemSize","itemIndicatorStartByItemSize","composeRefs","refs","node","r","SelectOpenContext","createContext","SelectRoot","openProp","defaultOpen","onOpenChange","props","open","setOpen","useControllableState","jsx","RadixSelect","SelectTrigger","forwardRef","size","tone","className","children","ref","SELECT_VALUE_MARKER","WRAPPED_LABEL_IN_TRIGGER","SelectValue","SelectContent","position","sideOffset","container","useContext","PopupRegion","popupRef","jsxs","ChevronUp","ChevronDown","SelectViewport","SelectItem","startAdornment","endContent","description","descriptionTone","descriptionInName","wrapLabel","labelDir","indicatorStart","iconSize","descriptionId","useId","textId","hasDescription","nameWithDescription","itemTextIdProps","itemNameProps","wrappedLabel","optionLabelVariants","fade","itemText","optionLabelRowVariants","OPTION_END_CLASSES","Check","optionDescriptionVariants","SelectItemText","SelectGroup","SelectLabel","SelectSeparator","ACTION_OPTION_CLASSES","DETACHED_FORM_ID","OWNED_TRIGGER_ATTRIBUTES","triggerAttributes","picked","key","value","SelectImpl","options","defaultValue","onValueChange","placeholder","clearable","disabled","required","name","id","ariaLabel","ariaDescribedBy","adornmentInTrigger","showDescriptions","wrapOptionLabels","rest","t","useTranslation","ctx","useFormField","inFormField","FormFieldContext","internalValue","setInternalValue","useState","isControlled","currentValue","openState","setOpenState","currentValueRef","useRef","controlId","useFormFieldControlId","triggerId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","triggerAdornment","_a","option","triggerRef","composedTriggerRef","dir","useDirection","inForm","setInForm","useIsomorphicLayoutEffect","standsIn","standInRef","hadValueRef","useEffect","emitValue","handleValueChange","next","isAction","handleClear","event","resolvedPlaceholder","showClear","nameFromPlaceholder","triggerLabel","triggerLabelledBy","groups","groupOptions","agentHandle","useMemo","useAgentRegistration","X","group","items","groupIndex","body","Fragment","SelectWithStatics","Select"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,KAA0C;AAAA,EACrD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,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