@alfadocs/ui-kit-debug 1.80.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-fields-GnoSkvh6.js → address-fields-CfnXK8RT.js} +4 -4
- package/dist/_chunks/{address-fields-GnoSkvh6.js.map → address-fields-CfnXK8RT.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js → ai-prompt-input-DH_rnV-F.js} +33 -26
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js.map → ai-prompt-input-DH_rnV-F.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js → anamnesis-summary-rows-6gMuu0ZK.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js.map → anamnesis-summary-rows-6gMuu0ZK.js.map} +1 -1
- package/dist/_chunks/{autocomplete-DosDnGie.js → autocomplete-CnB1mHGc.js} +65 -64
- package/dist/_chunks/{autocomplete-DosDnGie.js.map → autocomplete-CnB1mHGc.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js → balance-badge-cell-BHXJS8Ga.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js.map → balance-badge-cell-BHXJS8Ga.js.map} +1 -1
- package/dist/_chunks/{benefit-card-BWBClvdF.js → benefit-card-BcPtRHgM.js} +37 -36
- package/dist/_chunks/{benefit-card-BWBClvdF.js.map → benefit-card-BcPtRHgM.js.map} +1 -1
- package/dist/_chunks/booking-dsgiuhKg.js +4304 -0
- package/dist/_chunks/booking-dsgiuhKg.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js → calendar-appointment-editor-dialog-BuumJbcv.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js.map → calendar-appointment-editor-dialog-BuumJbcv.js.map} +1 -1
- package/dist/_chunks/{city-input-3J3bz9EO.js → city-input-CJVGswxp.js} +2 -2
- package/dist/_chunks/{city-input-3J3bz9EO.js.map → city-input-CJVGswxp.js.map} +1 -1
- package/dist/_chunks/{combobox-vF9O-QoG.js → combobox-CDPm_n0p.js} +93 -92
- package/dist/_chunks/{combobox-vF9O-QoG.js.map → combobox-CDPm_n0p.js.map} +1 -1
- package/dist/_chunks/{command-palette-D9TBzmOG.js → command-palette-B3dVqm9D.js} +68 -68
- package/dist/_chunks/{command-palette-D9TBzmOG.js.map → command-palette-B3dVqm9D.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-DKk94l-d.js → contact-profile-card-Da1vmJQI.js} +115 -102
- package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +1 -0
- package/dist/_chunks/{country-select-CSE2Zm_s.js → country-select-DQ8q7ypA.js} +2 -2
- package/dist/_chunks/{country-select-CSE2Zm_s.js.map → country-select-DQ8q7ypA.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BIPJqw9f.js → face-scheme-BgJGFDTa.js} +2 -2
- package/dist/_chunks/{face-scheme-BIPJqw9f.js.map → face-scheme-BgJGFDTa.js.map} +1 -1
- package/dist/_chunks/{header-settings-BYpVmLip.js → header-settings-CifwJEKB.js} +2 -2
- package/dist/_chunks/{header-settings-BYpVmLip.js.map → header-settings-CifwJEKB.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js → link-cell-renderer-C0ynDik7.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js.map → link-cell-renderer-C0ynDik7.js.map} +1 -1
- package/dist/_chunks/{locale-picker-DzdGDSBI.js → locale-picker-QbT1p60X.js} +39 -38
- package/dist/_chunks/{locale-picker-DzdGDSBI.js.map → locale-picker-QbT1p60X.js.map} +1 -1
- package/dist/_chunks/{map-view-C6MIVaqn.js → map-view-Bvi06RVh.js} +2 -2
- package/dist/_chunks/{map-view-C6MIVaqn.js.map → map-view-Bvi06RVh.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js → marketplace-app-shell-vON3WhD0.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js.map → marketplace-app-shell-vON3WhD0.js.map} +1 -1
- package/dist/_chunks/{multi-select-BOad3za9.js → multi-select-i5MFRpXg.js} +194 -187
- package/dist/_chunks/multi-select-i5MFRpXg.js.map +1 -0
- package/dist/_chunks/{otp-input-BgEZi0py.js → otp-input-gV1446Dw.js} +70 -70
- package/dist/_chunks/otp-input-gV1446Dw.js.map +1 -0
- package/dist/_chunks/{patient-details-B-I9Xkh9.js → patient-details-D0P5eog5.js} +2 -2
- package/dist/_chunks/{patient-details-B-I9Xkh9.js.map → patient-details-D0P5eog5.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js → patient-field-row-R73dZJY6.js} +5 -5
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js.map → patient-field-row-R73dZJY6.js.map} +1 -1
- package/dist/_chunks/{patient-search-CxqNcth4.js → patient-search-Dy0sxcwv.js} +2 -2
- package/dist/_chunks/{patient-search-CxqNcth4.js.map → patient-search-Dy0sxcwv.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js → patient-summary-card-6U74-ivO.js} +2 -2
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js.map → patient-summary-card-6U74-ivO.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js → payment-automation-upsell-D1YdO1xY.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js.map → payment-automation-upsell-D1YdO1xY.js.map} +1 -1
- package/dist/_chunks/{phone-input-C3NrD-nl.js → phone-input-DJ4BN8tG.js} +70 -63
- package/dist/_chunks/{phone-input-C3NrD-nl.js.map → phone-input-DJ4BN8tG.js.map} +1 -1
- package/dist/_chunks/{practice-results-CtOanuzZ.js → practice-results-B61krlwu.js} +2 -2
- package/dist/_chunks/{practice-results-CtOanuzZ.js.map → practice-results-B61krlwu.js.map} +1 -1
- package/dist/_chunks/{province-select-CDjs5obD.js → province-select-CPdTwEob.js} +2 -2
- package/dist/_chunks/{province-select-CDjs5obD.js.map → province-select-CPdTwEob.js.map} +1 -1
- package/dist/_chunks/{registration-form-CNBfUduG.js → registration-form-DmP3YUfp.js} +3 -3
- package/dist/_chunks/{registration-form-CNBfUduG.js.map → registration-form-DmP3YUfp.js.map} +1 -1
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js → send-registration-link-form-CZYOO7NO.js} +2 -2
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js.map → send-registration-link-form-CZYOO7NO.js.map} +1 -1
- package/dist/_chunks/{task-editor-Cpw-NmND.js → task-editor-BOETWbjU.js} +2 -2
- package/dist/_chunks/{task-editor-Cpw-NmND.js.map → task-editor-BOETWbjU.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js → use-appointment-details-read-CWN-nJCZ.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js.map → use-appointment-details-read-CWN-nJCZ.js.map} +1 -1
- package/dist/agent-catalog.json +4 -4
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/benefit-card/benefit-card.d.ts +7 -1
- package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +35 -2
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/code-step.d.ts +4 -2
- package/dist/components/booking/code-step.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +2 -0
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/handover.d.ts +12 -0
- package/dist/components/booking/handover.d.ts.map +1 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/reserved.d.ts +24 -0
- package/dist/components/booking/reserved.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +3 -1
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +4 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/locale-picker/locale-picker.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +8 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +8 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +8 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +8 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +8 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +8 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +8 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +8 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +8 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +8 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +8 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +8 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +8 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +8 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +8 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +8 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +8 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +8 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +8 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +8 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +8 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +8 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +8 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +8 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +8 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +8 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +8 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +8 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +8 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +8 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +8 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +30 -30
- package/dist/locales/ar.json +8 -0
- package/dist/locales/de.json +8 -0
- package/dist/locales/el.json +8 -0
- package/dist/locales/en.json +8 -0
- package/dist/locales/es.json +8 -0
- package/dist/locales/fr.json +8 -0
- package/dist/locales/hi.json +8 -0
- package/dist/locales/it.json +8 -0
- package/dist/locales/ja.json +8 -0
- package/dist/locales/nl.json +8 -0
- package/dist/locales/pl.json +8 -0
- package/dist/locales/pt.json +8 -0
- package/dist/locales/ro.json +8 -0
- package/dist/locales/ru.json +8 -0
- package/dist/locales/sq.json +8 -0
- package/dist/locales/sv.json +8 -0
- package/dist/locales/tr.json +8 -0
- package/dist/locales/zh.json +8 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-By4I_1A-.js +0 -4068
- package/dist/_chunks/booking-By4I_1A-.js.map +0 -1
- package/dist/_chunks/contact-profile-card-DKk94l-d.js.map +0 -1
- package/dist/_chunks/multi-select-BOad3za9.js.map +0 -1
- package/dist/_chunks/otp-input-BgEZi0py.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-profile-card-DKk94l-d.js","sources":["../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { formatPriceOrFree } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /** Practice website (already an absolute URL with protocol). */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`; `0` renders the translated word\n * \"Free\". Omit when the consumer doesn't want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n // 0 is a free first visit: the chip reads \"Free\", not \"€0.00\".\n return formatPriceOrFree(\n firstVisitPriceCents,\n currencyCode,\n locale,\n t('common.freeOfCharge'),\n );\n }, [firstVisitPriceCents, currencyCode, locale, t]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span dir=\"auto\">{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n <bdi dir=\"ltr\">{phone}</bdi>\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n <bdi dir=\"ltr\">{whatsappNumber}</bdi>\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n <bdi dir=\"ltr\">{email}</bdi>\n </Link>\n ),\n });\n }\n\n if (website) {\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: (\n <Link href={website} external intent=\"default\">\n <bdi dir=\"ltr\">{website}</bdi>\n </Link>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip. The chip starts in the value\n // column with every other row's value (the subgrid aligns them),\n // not pinned to the row's end, where it read as out of line.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n if (profession) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n { getProfession: () => profession },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p dir=\"auto\" className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n ) : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","website","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","surface","ariaLabel","id","className","rest","ref","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPriceOrFree","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Banknote","Heart","Stethoscope","useAgentRegistration","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAMA,KAAkE;AAAA,EAC7E,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,cAAA;AAAA,IAAc;AAAA,EACzC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCqBMC,KAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,MAKR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB,EAAE,SAAS,WAAA;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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIaC,KAGT;AAAA,EACF,SAAS5B;AAAA,EACT,OAAOG;AAAA,EACP,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,WAAWI;AAAAA,EACX,YAAYE;AAAA,EACZ,iBAAiBE;AAAA,EACjB,0BAA0BC;AAAA,EAC1B,YAAYC;AACd;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select-BOad3za9.js","sources":["../../src/components/multi-select/multi-select.agent.ts","../../src/components/multi-select/multi-select.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { MultiSelectHandle } from './multi-select';\n\nexport const multiSelectAgent: AgentAdapter<MultiSelectHandle> = {\n id: 'multi-select',\n // Persisted multi-choice (selection state + set_selection) → select_multiple,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_multiple', 'filter', 'open', 'close'],\n state: {\n selection: {\n type: 'string[]',\n descriptionKey: 'ui.agent.multiSelect.state.selection',\n description: 'Values of currently-selected options.',\n read: (handle) => handle.getSelection(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.multiSelect.state.query',\n description: 'Current filter query.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.multiSelect.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_selection: {\n // Persists the user's chosen options — reversible via the same UI.\n safety: 'write',\n argsType: '{ values: string[] }',\n argsSchema: {\n type: 'object',\n properties: {\n values: {\n type: 'array',\n items: { type: 'string' },\n description:\n 'Option values to select (replaces the current selection).',\n },\n },\n required: ['values'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.multiSelect.actions.setSelection',\n description:\n 'Replace the current selection with the given list of values.',\n examples: [\n {\n args: { values: ['a', 'b'] },\n note: 'Select exactly options \"a\" and \"b\".',\n },\n ],\n invoke: (handle, args: { values: string[] }) => {\n handle.setSelection(args.values);\n },\n },\n clear_selection: {\n // Discards the persisted selection — destructive (loses the choices).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.multiSelect.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clearSelection();\n },\n },\n apply_filter: {\n // Pure ephemeral filter of the visible options — no persisted change.\n safety: 'read',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Filter text for the list.' },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.multiSelect.actions.applyFilter',\n description: 'Set the filter query for the option list.',\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.multiSelect.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.multiSelect.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'multi-select' },\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: 'Each option emits its value as data-option-id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command } from 'cmdk';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlRef,\n} from '../form-field/form-field-context';\nimport { Tooltip } from '../tooltip';\nimport type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { groupOptions } from '../_shared/group-options';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport {\n OPTION_BODY_CLASSES,\n OPTION_END_CLASSES,\n OPTION_LABEL_ROW_CLASSES,\n optionDescriptionVariants,\n optionLabelVariants,\n} from '../_shared/option-row';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_TEXT,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { multiSelectAgent } from './multi-select.agent';\n\n// MultiSelect uses `min-h-*` (not `h-*`) because the wrapper grows vertically\n// as chips wrap to additional lines. The height floor per size mirrors the\n// other inputs' fixed heights in _shared/input-surface.ts.\nconst multiSelectVariants = cva(\n [\n 'ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full',\n INPUT_SURFACE_CHROME,\n 'ds:aria-[invalid=true]:border-destructive',\n 'ds:aria-disabled:cursor-not-allowed ds:aria-disabled:opacity-50',\n ],\n {\n variants: {\n size: {\n sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${INPUT_SURFACE_TEXT.sm}`,\n md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${INPUT_SURFACE_TEXT.md}`,\n lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${INPUT_SURFACE_TEXT.lg}`,\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst chipVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-1',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted',\n 'ds:text-foreground ds:select-none',\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:forced-colors:focus-visible:outline-[CanvasText]',\n ],\n {\n variants: {\n size: {\n sm: 'ds:ps-2 ds:pe-1 ds:py-0.5 ds:text-[length:var(--font-size-xs)]',\n md: 'ds:ps-2 ds:pe-1 ds:py-0.5 ds:text-[length:var(--font-size-sm)]',\n lg: 'ds:ps-3 ds:pe-1.5 ds:py-1 ds:text-[length:var(--font-size-base)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst chipDismissClasses = [\n 'ds:inline-flex ds:items-center ds:justify-center ds:shrink-0',\n '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 'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"]',\n].join(' ');\n\nconst popoverContentClasses = [\n 'ds:z-[var(--z-dropdown)] ds:overflow-hidden',\n // At least as wide as the field, at most as wide as the screen allows: a\n // long option wraps or ends in an ellipsis instead of running off the\n // edge. The floor gives way to the cap on a field wider than that.\n 'ds:min-w-[min(var(--radix-popover-trigger-width),var(--radix-popover-content-available-width))]',\n 'ds:max-w-[var(--radix-popover-content-available-width)]',\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\nconst commandItemClasses = [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5',\n 'ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50',\n 'ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50',\n].join(' ');\n\nconst actionItemClasses = [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5',\n 'ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n].join(' ');\n\nconst SELECT_ALL_VALUE = '__ui-multiselect-select-all__';\nconst CLEAR_ALL_VALUE = '__ui-multiselect-clear-all__';\n\ntype HTMLDivAttributes = HTMLAttributes<HTMLDivElement>;\n\n// Curated agent-readiness handle — see multi-select.agent.ts.\nexport interface MultiSelectHandle {\n getSelection: () => string[];\n getQuery: () => string;\n getIsOpen: () => boolean;\n setSelection: (values: string[]) => void;\n clearSelection: () => void;\n setQuery: (query: string) => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface MultiSelectProps<T extends string = string>\n extends\n Omit<HTMLDivAttributes, 'onChange'>,\n VariantProps<typeof multiSelectVariants> {\n options: OptionShape<T>[];\n value?: T[];\n defaultValue?: T[];\n onChange?: (next: T[]) => void;\n onComplete?: (values: T[]) => void;\n placeholder?: string;\n maxSelections?: number;\n allowSelectAll?: boolean;\n allowClear?: boolean;\n filter?: (query: string, option: OptionShape<T>) => boolean;\n size?: 'sm' | 'md' | 'lg';\n disabled?: 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. Off by default.\n * An option's `description` always sits on its own line under the label.\n */\n wrapOptionLabels?: boolean;\n}\n\nconst MultiSelectImpl = forwardRef<HTMLDivElement, MultiSelectProps>(\n function MultiSelect(\n {\n options,\n value,\n defaultValue,\n onChange,\n onComplete,\n placeholder,\n maxSelections,\n allowSelectAll = false,\n allowClear = false,\n filter,\n size = 'md',\n disabled,\n wrapOptionLabels = false,\n className,\n id,\n // Pull `aria-label` out of the div spread so it names the combobox\n // INPUT (the interactive control) rather than the wrapper div. Lets a\n // consumer give the trigger a meaningful name when there's no visible\n // label or FormField (e.g. a data-table floating filter naming itself\n // after its column). Untouched callers fall back to the placeholder.\n // Inside a FormField the field's label names the input and this is\n // ignored, so it can never override the visible text (WCAG 2.5.3).\n 'aria-label': ariaLabel,\n ...divProps\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setMultiSelectValue] = useControllableState<\n string[]\n >({\n value,\n defaultValue: defaultValue ?? [],\n onChange,\n });\n const currentValue = currentValueRaw ?? [];\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n const inputRef = useRef<HTMLInputElement>(null);\n const counterId = `${useId()}-count`;\n const chipRefs = useRef<Array<HTMLSpanElement | null>>([]);\n const triggerRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs<HTMLDivElement>(ref, triggerRef);\n\n const effectiveDisabled =\n (inFormField && ctx.disabled) || Boolean(disabled);\n const effectiveRequired = inFormField && ctx.required;\n const effectiveInvalid = inFormField && ctx.invalid;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n const triggerId = id ?? (inFormField ? ctx.id : undefined);\n /* cmdk writes its own id on the input, so the field's label follows\n that one. */\n useFormFieldControlRef(ctx, inputRef);\n\n const labelByValue = useMemo(() => {\n const map = new Map<string, string>();\n for (const option of options) map.set(option.value, option.label);\n return map;\n }, [options]);\n const dirByValue = useMemo(() => {\n const map = new Map<string, OptionShape['dir']>();\n for (const option of options) map.set(option.value, option.dir);\n return map;\n }, [options]);\n\n const atCap =\n typeof maxSelections === 'number' && currentValue.length >= maxSelections;\n\n const commit = (next: string[]): void => {\n setMultiSelectValue(next);\n };\n\n const toggle = (val: string): void => {\n if (currentValue.includes(val)) {\n commit(currentValue.filter((v) => v !== val));\n return;\n }\n if (atCap) return;\n commit([...currentValue, val]);\n };\n\n const removeAt = (index: number): string[] => {\n const next = currentValue.filter((_, i) => i !== index);\n commit(next);\n return next;\n };\n\n const handleSelectAll = (): void => {\n const selectable = options.filter((o) => !o.disabled).map((o) => o.value);\n const cap =\n typeof maxSelections === 'number' ? maxSelections : selectable.length;\n commit(selectable.slice(0, cap));\n };\n\n const handleClearAll = (): void => {\n commit([]);\n };\n\n // Agent handle — refs for fresh reads from the memoized handle.\n const valueRef = useRef<string[]>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const queryRef = useRef<string>(query);\n useEffect(() => {\n queryRef.current = query;\n }, [query]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const commitStable = useCallback(\n (next: string[]) => {\n setMultiSelectValue(next);\n },\n [setMultiSelectValue],\n );\n\n const agentHandle = useMemo<MultiSelectHandle>(\n () => ({\n getSelection: () => [...valueRef.current],\n getQuery: () => queryRef.current,\n getIsOpen: () => openRef.current,\n setSelection: (values) => commitStable(values),\n clearSelection: () => commitStable([]),\n setQuery: (next) => setQuery(next),\n open: () => setOpen(true),\n close: () => setOpen(false),\n }),\n [commitStable],\n );\n useAgentRegistration(multiSelectAgent, agentHandle, id);\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.multiSelect.placeholder', 'Select…');\n\n const filteredOptions = useMemo(() => {\n if (!query) return options;\n const needle = query.toLowerCase();\n return options.filter((option) => {\n if (filter) return filter(query, option);\n return option.label.toLowerCase().includes(needle);\n });\n }, [options, query, filter]);\n\n const groups = useMemo(\n () => groupOptions(filteredOptions),\n [filteredOptions],\n );\n\n const handleInputKeyDown = (e: KeyboardEvent<HTMLInputElement>): void => {\n const target = e.currentTarget;\n if (e.key === 'Backspace' && query === '' && currentValue.length > 0) {\n e.preventDefault();\n const removedIndex = currentValue.length - 1;\n const next = removeAt(removedIndex);\n const newLast = next.length - 1;\n if (newLast >= 0) {\n requestAnimationFrame(() => {\n chipRefs.current[newLast]?.focus();\n });\n }\n return;\n }\n const caretAtStart =\n target.selectionStart === 0 && target.selectionEnd === 0;\n if (\n (e.key === 'ArrowLeft' || e.key === 'ArrowRight') &&\n caretAtStart &&\n currentValue.length > 0\n ) {\n const isRTL = document.dir === 'rtl' || target.dir === 'rtl';\n const shouldNavigate =\n (isRTL && e.key === 'ArrowRight') ||\n (!isRTL && e.key === 'ArrowLeft');\n if (shouldNavigate) {\n e.preventDefault();\n const lastIdx = currentValue.length - 1;\n chipRefs.current[lastIdx]?.focus();\n }\n return;\n }\n if (e.key === 'Escape') {\n setOpen(false);\n return;\n }\n if (!open && (e.key === 'ArrowDown' || e.key === 'Enter')) {\n setOpen(true);\n }\n };\n\n const handleChipKeyDown =\n (index: number) =>\n (e: KeyboardEvent<HTMLSpanElement>): void => {\n if (\n e.key === 'Backspace' ||\n e.key === 'Delete' ||\n e.key === 'Enter' ||\n e.key === ' '\n ) {\n e.preventDefault();\n e.stopPropagation();\n const next = removeAt(index);\n if (next.length === 0) {\n requestAnimationFrame(() => inputRef.current?.focus());\n return;\n }\n const focusIdx = Math.min(index, next.length - 1);\n requestAnimationFrame(() => {\n chipRefs.current[focusIdx]?.focus();\n });\n return;\n }\n const isRTL = document.dir === 'rtl';\n const prevKey = isRTL ? 'ArrowRight' : 'ArrowLeft';\n const nextKey = isRTL ? 'ArrowLeft' : 'ArrowRight';\n if (e.key === prevKey) {\n e.preventDefault();\n const newIdx = Math.max(0, index - 1);\n chipRefs.current[newIdx]?.focus();\n return;\n }\n if (e.key === nextKey) {\n e.preventDefault();\n if (index < currentValue.length - 1) {\n chipRefs.current[index + 1]?.focus();\n } else {\n inputRef.current?.focus();\n }\n return;\n }\n if (e.key === 'Escape') {\n setOpen(false);\n inputRef.current?.focus();\n }\n };\n\n // ----- Chip overflow measurement -----\n // The measurement must read the FULL chip row, never the collapsed one.\n // Counting only the rendered (collapsed) chips is self-referential: hiding\n // the overflow behind \"+N more\" leaves a subset that trivially fits row 1,\n // the next measure concludes \"everything fits\", it expands, re-wraps, and\n // the ResizeObserver oscillates every frame (the visible flicker).\n //\n // Instead we run a two-pass cycle driven by `measureNonce`: a request first\n // renders every chip (visibleCount → ∞), then the layout effect measures\n // that complete row and sets the collapsed count. Both passes are layout\n // effects, so React flushes them before paint — the browser only ever shows\n // the settled, single-line result, with no full-row flash.\n const [visibleCount, setVisibleCount] = useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [measureNonce, setMeasureNonce] = useState<number>(0);\n const lastWidthRef = useRef<number>(-1);\n\n const requestMeasure = useCallback((): void => {\n setVisibleCount(Number.POSITIVE_INFINITY);\n setMeasureNonce((n) => n + 1);\n }, []);\n\n // Pass two: the \"show all\" render has committed — measure the true wrap\n // point off the complete chip row and collapse to it. Runs once per request\n // (keyed on measureNonce); collapsing does not bump the nonce, so it settles.\n useIsomorphicLayoutEffect(() => {\n const el = triggerRef.current;\n if (!el) return;\n const chipEls = Array.from(\n el.querySelectorAll<HTMLElement>('[data-ui-chip=\"true\"]'),\n );\n if (chipEls.length === 0) {\n setVisibleCount(Number.POSITIVE_INFINITY);\n return;\n }\n const firstTop = chipEls[0].offsetTop;\n let firstRowCount = 0;\n for (const chip of chipEls) {\n if (chip.offsetTop === firstTop) firstRowCount++;\n else break;\n }\n setVisibleCount(\n firstRowCount === chipEls.length\n ? Number.POSITIVE_INFINITY\n : Math.max(1, firstRowCount - 1),\n );\n }, [measureNonce]);\n\n // Re-measure whenever the selected set or the size variant changes.\n useIsomorphicLayoutEffect(() => {\n requestMeasure();\n }, [currentValue.length, size, requestMeasure]);\n\n // Re-measure on a real width change only. Collapsing shrinks the trigger's\n // height, not its width, so a width guard keeps that from re-triggering the\n // cycle — the ResizeObserver never chases its own output.\n useIsomorphicLayoutEffect(() => {\n const el = triggerRef.current;\n if (!el) return;\n const ro = new ResizeObserver((entries) => {\n const width = Math.round(\n entries[0]?.contentRect.width ?? el.clientWidth,\n );\n if (width === lastWidthRef.current) return;\n lastWidthRef.current = width;\n requestMeasure();\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [requestMeasure]);\n\n const chips = currentValue.map((val) => ({\n value: val,\n label: labelByValue.get(val) ?? val,\n }));\n\n const showAllChips =\n visibleCount === Number.POSITIVE_INFINITY || visibleCount >= chips.length;\n const visibleChips = showAllChips ? chips : chips.slice(0, visibleCount);\n const overflowChips = showAllChips ? [] : chips.slice(visibleCount);\n const overflowCount = overflowChips.length;\n\n const handleTriggerClick = (event: MouseEvent<HTMLDivElement>): void => {\n if (effectiveDisabled) return;\n // Ignore clicks on chips/buttons so they can manage their own focus.\n const target = event.target as HTMLElement;\n if (target.closest('[data-ui-chip=\"true\"]')) return;\n if (target.closest('[data-ui-chip-dismiss=\"true\"]')) return;\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean): void => {\n if (effectiveDisabled) {\n setOpen(false);\n return;\n }\n setOpen(next);\n if (!next) {\n setQuery('');\n onComplete?.(currentValue);\n }\n };\n\n const hasActionRow = allowSelectAll || allowClear;\n\n const counterMessage = t('inputs.multiSelect.selected', {\n count: currentValue.length,\n defaultValue: `${currentValue.length} selected`,\n });\n\n /* cmdk writes `aria-labelledby` on the input after the props it is\n given, pointing at its own hidden `<label cmdk-label>` whose text is\n the Command root's `label`. So that label is the input's name: the\n host's `aria-label`, else the placeholder, so the input is never\n unnamed. The count of chosen options describes the input rather than\n naming it. */\n const accessibleName =\n (inFormField ? ctx.label || ariaLabel : ariaLabel) || resolvedPlaceholder;\n const inputDescribedBy = [counterId, describedBy].filter(Boolean).join(' ');\n\n /* Inside a FormField the name is the field's own `<label>`, read whole,\n as for every other control: its labelStart and labelEnd marks and\n \"(optional)\" join it, and the host's `aria-label` never overrides\n that visible text. cmdk's hidden label holds the label string only,\n so the input is pointed at the field's label instead. React leaves\n the attribute alone afterwards: cmdk's prop for it never changes. */\n const fieldLabelId = inFormField ? `${ctx.id}-label` : undefined;\n const cmdkLabelledBy = useRef<string | null>(null);\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (!input) return;\n const current = input.getAttribute('aria-labelledby');\n if (fieldLabelId) {\n if (current === fieldLabelId) return;\n cmdkLabelledBy.current = current;\n input.setAttribute('aria-labelledby', fieldLabelId);\n } else if (cmdkLabelledBy.current !== null) {\n // Out of the field again: back to cmdk's own label.\n input.setAttribute('aria-labelledby', cmdkLabelledBy.current);\n cmdkLabelledBy.current = null;\n }\n });\n\n const { onClick: onClickProp, ...restDivProps } = divProps;\n\n return (\n <Command shouldFilter={false} label={accessibleName}>\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Popover.Anchor asChild>\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- compound input shell; keyboard handling lives on the inner searchable input which is always rendered */}\n <div\n ref={composedRef}\n className={multiSelectVariants({ size, className })}\n aria-disabled={effectiveDisabled || undefined}\n aria-invalid={effectiveInvalid || undefined}\n data-component=\"multi-select\"\n data-component-id={id}\n onClick={(event) => {\n onClickProp?.(event);\n handleTriggerClick(event);\n }}\n {...restDivProps}\n >\n {visibleChips.map((chip, idx) => (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button\n <span\n key={chip.value}\n ref={(el) => {\n chipRefs.current[idx] = el;\n }}\n tabIndex={effectiveDisabled ? -1 : 0}\n data-ui-chip=\"true\"\n className={chipVariants({ size })}\n onKeyDown={handleChipKeyDown(idx)}\n aria-label={chip.label}\n >\n <span dir={dirByValue.get(chip.value)}>{chip.label}</span>\n <button\n type=\"button\"\n tabIndex={-1}\n data-ui-chip-dismiss=\"true\"\n aria-label={t('inputs.multiSelect.remove', {\n label: chip.label,\n defaultValue: `Remove ${chip.label}`,\n })}\n disabled={effectiveDisabled}\n onClick={(event) => {\n event.stopPropagation();\n removeAt(idx);\n requestAnimationFrame(() => inputRef.current?.focus());\n }}\n className={chipDismissClasses}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n </span>\n ))}\n {overflowCount > 0 ? (\n <Tooltip\n label={overflowChips.map((c) => c.label).join(', ')}\n delayDuration={200}\n >\n <span\n className={chipVariants({ size })}\n tabIndex={0}\n role=\"button\"\n aria-label={t('inputs.multiSelect.overflow', {\n count: overflowCount,\n defaultValue: `+${overflowCount} more`,\n })}\n >\n <span>\n {t('inputs.multiSelect.overflow', {\n count: overflowCount,\n defaultValue: `+${overflowCount} more`,\n })}\n </span>\n </span>\n </Tooltip>\n ) : null}\n <Command.Input\n ref={inputRef}\n value={query}\n onValueChange={setQuery}\n onKeyDown={handleInputKeyDown}\n onFocus={() => {\n if (!effectiveDisabled) setOpen(true);\n }}\n placeholder={\n currentValue.length === 0 ? resolvedPlaceholder : ''\n }\n id={triggerId}\n // The name comes from the Command root's `label` above, or\n // from the FormField's label: cmdk writes `aria-labelledby`\n // after these props, and a layout effect above re-points it.\n aria-describedby={inputDescribedBy}\n aria-invalid={effectiveInvalid || undefined}\n aria-required={effectiveRequired || undefined}\n disabled={effectiveDisabled}\n className={[\n 'ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none',\n 'ds:placeholder:text-muted-foreground ds:text-start',\n 'ds:disabled:cursor-not-allowed',\n ].join(' ')}\n />\n {/* Hidden: read only as the input's description, not as stray\n text on the page. */}\n <span id={counterId} hidden>\n {counterMessage}\n </span>\n </div>\n </Popover.Anchor>\n <Popover.Portal>\n {/* Portalled to <body>, so the list carries its own bounding\n marker: the kit's cascade reset — and a host's shield against\n its own bare-element CSS — scope to [data-component]. */}\n <Popover.Content\n data-component=\"multi-select-list\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n className={popoverContentClasses}\n >\n <Command.List\n role=\"listbox\"\n aria-multiselectable=\"true\"\n aria-label={resolvedPlaceholder}\n className=\"ds:max-h-[20rem] ds:overflow-y-auto ds:p-1\"\n >\n {hasActionRow ? (\n <Command.Group>\n {allowSelectAll ? (\n <Command.Item\n value={SELECT_ALL_VALUE}\n onSelect={handleSelectAll}\n className={actionItemClasses}\n >\n {t('inputs.multiSelect.selectAll', 'Select all')}\n </Command.Item>\n ) : null}\n {allowClear ? (\n <Command.Item\n value={CLEAR_ALL_VALUE}\n onSelect={handleClearAll}\n className={actionItemClasses}\n >\n {t('inputs.multiSelect.clearAll', 'Clear all')}\n </Command.Item>\n ) : null}\n </Command.Group>\n ) : null}\n <Command.Empty className=\"ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground\">\n {t('inputs.multiSelect.noOptions', 'No options found')}\n </Command.Empty>\n {groups.map(({ group, items }, gi) => {\n const body = items.map((option) => {\n const isSelected = currentValue.includes(option.value);\n const isCapped = !isSelected && atCap;\n const isDisabled = Boolean(option.disabled) || isCapped;\n const item = (\n <Command.Item\n key={option.value}\n value={option.value}\n // Agent DOM hook — see multi-select.agent.ts item.\n data-option-id={option.value}\n disabled={isDisabled}\n onSelect={() => {\n if (isDisabled) return;\n toggle(option.value);\n }}\n aria-selected={isSelected}\n aria-disabled={isDisabled || undefined}\n className={commandItemClasses}\n >\n <span\n // Off, the box is a state indicator, so its edge is\n // the 3:1 --control-border (WCAG 1.4.11), as on\n // Checkbox.\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:me-[var(--spacing-xs)] ds:shrink-0',\n 'ds:size-4 ds:rounded-[var(--radius-sm)] ds:border',\n isSelected\n ? 'ds:bg-primary ds:border-primary ds:text-primary-foreground'\n : 'ds:bg-background ds:border-[color:var(--control-border)]',\n ].join(' ')}\n aria-hidden=\"true\"\n >\n {isSelected ? (\n <Check className=\"ds:size-3.5\" />\n ) : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the accessible name comes\n // from the option label.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)]\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked, as in Combobox: the label and its end\n // content on one row, the description under them.\n // The option's name reads in that order.\n <span className={OPTION_BODY_CLASSES}>\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1 ds:text-start',\n })}\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Announced, as below.\n <span className={OPTION_END_CLASSES}>\n {option.endContent}\n </span>\n ) : null}\n </span>\n {option.description ? (\n <span\n className={optionDescriptionVariants({\n tone: option.descriptionTone,\n className: 'ds:text-start',\n })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n {/* `min-w-0 truncate` matches Combobox and Select.\n Without it a long service name cannot be\n clipped, so it pushes the trailing content and\n overflows the row instead of the name\n ellipsing — the CJK and long-label case. */}\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:min-w-0 ds:truncate ds:text-start\"\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Deliberately NOT aria-hidden — unlike\n // `startAdornment`, this slot carries meaning\n // (a price, a count) and must reach the\n // option's accessible name. `ms-auto` pins it\n // to the inline-end and flips under RTL.\n <span className=\"ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0 ds:ps-[var(--spacing-xs)]\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n if (isCapped) {\n return (\n <Tooltip\n key={option.value}\n label={t('inputs.multiSelect.maxReached', {\n count: maxSelections,\n defaultValue: `Maximum ${maxSelections} selections`,\n })}\n delayDuration={200}\n >\n {item}\n </Tooltip>\n );\n }\n return item;\n });\n if (!group) {\n return (\n <Command.Group key={`group-${gi}`}>{body}</Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={group}\n className=\"ds:[&_[cmdk-group-heading]]:ps-2 ds:[&_[cmdk-group-heading]]:pe-2 ds:[&_[cmdk-group-heading]]:py-1 ds:[&_[cmdk-group-heading]]:type-eyebrow ds:[&_[cmdk-group-heading]]:text-muted-foreground\"\n >\n {body}\n </Command.Group>\n );\n })}\n </Command.List>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n </Command>\n );\n },\n);\nMultiSelectImpl.displayName = 'MultiSelect';\n\ninterface MultiSelectComponent {\n <T extends string = string>(\n props: MultiSelectProps<T> & { ref?: Ref<HTMLDivElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\nexport const MultiSelect = MultiSelectImpl as unknown as MultiSelectComponent;\n\nexport { multiSelectVariants };\n"],"names":["multiSelectAgent","handle","args","multiSelectVariants","cva","INPUT_SURFACE_CHROME","INPUT_SURFACE_TEXT","chipVariants","chipDismissClasses","popoverContentClasses","commandItemClasses","MENU_ROW_HIGHLIGHT","actionItemClasses","SELECT_ALL_VALUE","CLEAR_ALL_VALUE","MultiSelectImpl","forwardRef","options","value","defaultValue","onChange","onComplete","placeholder","maxSelections","allowSelectAll","allowClear","filter","size","disabled","wrapOptionLabels","className","id","ariaLabel","divProps","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setMultiSelectValue","useControllableState","currentValue","open","setOpen","useState","query","setQuery","inputRef","useRef","counterId","useId","chipRefs","triggerRef","composedRef","composeRefs","effectiveDisabled","effectiveRequired","effectiveInvalid","describedBy","triggerId","useFormFieldControlRef","labelByValue","useMemo","map","option","dirByValue","atCap","commit","next","toggle","val","v","removeAt","index","_","i","handleSelectAll","selectable","o","cap","handleClearAll","valueRef","useEffect","queryRef","openRef","commitStable","useCallback","agentHandle","values","useAgentRegistration","resolvedPlaceholder","filteredOptions","needle","groups","groupOptions","handleInputKeyDown","target","removedIndex","newLast","_a","caretAtStart","isRTL","lastIdx","handleChipKeyDown","e","focusIdx","prevKey","nextKey","newIdx","_b","_c","_d","visibleCount","setVisibleCount","measureNonce","setMeasureNonce","lastWidthRef","requestMeasure","n","useIsomorphicLayoutEffect","el","chipEls","firstTop","firstRowCount","chip","ro","entries","width","chips","showAllChips","visibleChips","overflowChips","overflowCount","handleTriggerClick","event","handleOpenChange","hasActionRow","counterMessage","accessibleName","inputDescribedBy","fieldLabelId","cmdkLabelledBy","input","current","onClickProp","restDivProps","jsx","Command","jsxs","Popover","idx","X","Tooltip","c","group","items","gi","body","isSelected","isCapped","isDisabled","item","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","MultiSelect"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,mBAAmB,UAAU,QAAQ,OAAO;AAAA,EAC3D,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,IAExC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,eAAe;AAAA;AAAA,MAEb,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAA;AAAA,YACf,aACE;AAAA,UAAA;AAAA,QACJ;A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AE,iCAAiC;AAAA,0BACxC,OAAOZ;AAAA,0BACP,cAAc,WAAWA,CAAa;AAAA,wBAAA,CACvC;AAAA,wBACD,eAAe;AAAA,wBAEd,UAAA8I;AAAA,sBAAA;AAAA,sBAPIjG,EAAO;AAAA,oBAAA,IAWXiG;AAAA,kBACT,CAAC;AACD,yBAAKP,IAMH,gBAAAR;AAAA,oBAACC,EAAQ;AAAA,oBAAR;AAAA,sBAEC,SAASO;AAAA,sBACT,WAAU;AAAA,sBAET,UAAAG;AAAA,oBAAA;AAAA,oBAJI,SAASH,CAAK;AAAA,kBAAA,sBALlBP,EAAQ,OAAR,EAAmC,UAAAU,EAAA,GAAhB,SAASD,CAAE,EAAU;AAAA,gBAY/C,CAAC;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA,EACF,CACF;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAEJ;AACF;AACAjJ,GAAgB,cAAc;AASvB,MAAM8J,KAAc9J;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otp-input-BgEZi0py.js","sources":["../../src/components/otp-input/otp-input.agent.ts","../../src/components/otp-input/otp-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — OTPInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { OTPInputHandle } from './otp-input';\n\nexport const otpInputAgent: AgentAdapter<OTPInputHandle> = {\n id: 'otp-input',\n // Value input — `set_value` replaces the digits. There is no `submit`\n // action: completion is host-driven (the consumer's `onComplete` fires\n // automatically once every digit is filled) and is observable via the\n // `isComplete` state slot, so the old unbacked `submit` capability is\n // removed.\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.otpInput.state.value',\n description: 'Current digits entered, packed into a single string.',\n read: (handle) => handle.getValue(),\n },\n isComplete: {\n type: 'boolean',\n descriptionKey: 'ui.agent.otpInput.state.isComplete',\n description: 'Whether all required digits have been entered.',\n read: (handle) => handle.isComplete(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'The digits to fill, packed into a single string (one char per cell).',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n examples: [{ args: { value: '123456' } }],\n descriptionKey: 'ui.agent.otpInput.actions.setValue',\n description: 'Replace the entered digits.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.otpInput.actions.clear',\n description: 'Empty all digit cells. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.otpInput.actions.focus',\n description: 'Move keyboard focus to the active digit cell.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'otp-input',\n description:\n 'Marks the OTPInput wrapper. Completion is observable via state.isComplete; the host onComplete callback fires once when all digits are filled.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ClipboardEvent,\n type FocusEvent,\n type KeyboardEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useWebOtp } from '../../hooks/use-web-otp';\nimport {\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport { useAgentRegistration } from '../../agent';\nimport { otpInputAgent } from './otp-input.agent';\n\nexport type OTPMode = 'numeric' | 'alphanumeric';\n\n/** Agent-readiness curated handle for OTPInput. */\nexport interface OTPInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n isComplete: () => boolean;\n}\n\nconst wrapperVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]');\n\nconst boxVariants = cva(\n [\n 'ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:border ds:bg-input ds:text-foreground ds:text-center ds:font-medium ds:text-[length:var(--font-size-lg)]',\n 'ds:shadow-[var(--shadow-input)]',\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:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n tone: {\n default: 'ds:border-[color:var(--control-border)]',\n error: 'ds:border-destructive',\n },\n },\n defaultVariants: { tone: 'default' },\n },\n);\n\nexport interface OTPInputProps {\n /**\n * Number of boxes. Default 6. Any integer in [3, 10] is honoured;\n * out-of-range values are clamped (with a DEV warning).\n */\n length?: number;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n onComplete?: (code: string) => void;\n disabled?: boolean;\n error?: boolean;\n label?: string;\n 'aria-describedby'?: string;\n /** Stable id, used to address this instance from the agent runtime. */\n id?: string;\n className?: string;\n /**\n * Opt into Chrome-Android's WebOTP API for one-tap SMS autofill. When\n * the browser surfaces a matching SMS-bound credential, the kit spreads\n * the code across every digit box and fires `onComplete` automatically.\n *\n * Falls back silently to manual entry on Firefox / desktop / iOS — those\n * platforms either don't ship the API at all or rely on the\n * `autocomplete=\"one-time-code\"` QuickType heuristic the kit already\n * applies to the first input.\n *\n * Prerequisites the prop can't enforce: page must be HTTPS, and the SMS\n * body must end with `@<origin> #<code>` on its last line (Chrome's\n * spec — without it the browser refuses to surface the message).\n * Default `false` so the listener stays opt-in.\n */\n webOtp?: boolean;\n /**\n * When set, renders a hidden `<input name={name}>` kept in sync with the\n * packed code so consumers can POST the OTP declaratively, e.g.\n * `sms_code_form[code]`. Default off — no behaviour change.\n */\n name?: string;\n /**\n * Character set. `numeric` (default) accepts digits only (with Arabic-Indic\n * digit folding) — byte-identical to prior behaviour. `alphanumeric` accepts\n * `[A-Za-z0-9]`, uppercases the value, and switches the boxes to text input\n * (for SMS codes that mix letters and digits).\n */\n mode?: OTPMode;\n}\n\nfunction normaliseDigits(str: string): string {\n return str\n .replace(/[\\u0660-\\u0669]/g, (c) => String(c.charCodeAt(0) - 0x0660))\n .replace(/[\\u06F0-\\u06F9]/g, (c) => String(c.charCodeAt(0) - 0x06f0));\n}\n\nconst MIN_LENGTH = 3;\nconst MAX_LENGTH = 10;\n\n/** Clamp an arbitrary length into a sane range; DEV-warn if it had to. */\nfunction resolveLength(length: number): number {\n // Fall back to the default for non-finite input (e.g. `length={parseInt(x)}`\n // yielding NaN) so the component never reaches `new Array(NaN)`.\n const n = Number.isFinite(length) ? Math.floor(length) : 6;\n const clamped = Math.max(MIN_LENGTH, Math.min(MAX_LENGTH, n));\n if (import.meta.env.DEV && clamped !== length) {\n console.warn(\n `[OTPInput] length ${length} is out of range [${MIN_LENGTH}, ${MAX_LENGTH}] \\u2014 clamped to ${clamped}.`,\n );\n }\n return clamped;\n}\n\n/**\n * Filter + normalise a string to the mode's charset, then clamp to length.\n * - `numeric`: Arabic-Indic digits folded to ASCII, then digits only.\n * - `alphanumeric`: `[A-Za-z0-9]` only, uppercased (codes are uppercase and the\n * server compares case-insensitively \\u2014 uppercasing keeps the display and the\n * posted value consistent).\n */\nfunction packValue(value: string, length: number, mode: OTPMode): string {\n const filtered =\n mode === 'alphanumeric'\n ? value.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(value).replace(/\\D/g, '');\n return filtered.slice(0, length);\n}\n\nfunction valueToArray(value: string, length: number, mode: OTPMode): string[] {\n const packed = packValue(value, length, mode);\n const arr = new Array<string>(length).fill('');\n for (let i = 0; i < packed.length; i += 1) {\n arr[i] = packed[i];\n }\n return arr;\n}\n\nexport const OTPInput = forwardRef<OTPInputHandle, OTPInputProps>(\n (\n {\n length: lengthProp = 6,\n value,\n defaultValue,\n onChange,\n onComplete,\n disabled,\n error,\n label,\n 'aria-describedby': describedBy,\n id,\n className,\n webOtp = false,\n name,\n mode = 'numeric',\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const length = resolveLength(lengthProp);\n const ctx = useFormField();\n const generatedLabelId = useId();\n const labelId = label ? generatedLabelId : undefined;\n\n const [internalValueRaw, setInternalValue] = useControllableState<string>({\n value,\n defaultValue: packValue(defaultValue ?? '', length, mode),\n });\n const currentValue = packValue(internalValueRaw ?? '', length, mode);\n const digits = valueToArray(currentValue, length, mode);\n\n const effectiveDisabled = ctx.disabled || Boolean(disabled);\n const effectiveError = ctx.invalid || Boolean(error);\n const effectiveTone = effectiveError ? 'error' : 'default';\n\n const inputsRef = useRef<Array<HTMLInputElement | null>>([]);\n const completedRef = useRef(currentValue.length === length);\n const valueRef = useRef(currentValue);\n valueRef.current = currentValue;\n\n const computeInitialIndex = () => {\n const firstEmpty = currentValue.length;\n if (firstEmpty >= length) return length - 1;\n return firstEmpty;\n };\n const [activeIndex, setActiveIndex] = useState<number>(computeInitialIndex);\n\n useEffect(() => {\n if (activeIndex >= length) setActiveIndex(length - 1);\n }, [activeIndex, length]);\n\n const focusBox = useCallback(\n (index: number) => {\n const clamped = Math.max(0, Math.min(length - 1, index));\n setActiveIndex(clamped);\n const node = inputsRef.current[clamped];\n if (node) {\n node.focus();\n node.select();\n }\n },\n [length],\n );\n\n const commit = useCallback(\n (next: string) => {\n const packed = packValue(next, length, mode);\n setInternalValue(packed);\n valueRef.current = packed;\n onChange?.(packed);\n if (packed.length === length) {\n if (!completedRef.current) {\n completedRef.current = true;\n onComplete?.(packed);\n }\n } else {\n completedRef.current = false;\n }\n },\n [setInternalValue, length, mode, onChange, onComplete],\n );\n\n // WebOTP one-tap autofill. The hook silently no-ops when the API is\n // unavailable (Firefox / Safari / desktop Chromium) — `commit()` is\n // the same path manual entry takes, so `onChange` + `onComplete` fire\n // identically whether the digits arrived via SMS, paste, or typing.\n useWebOtp({\n enabled: webOtp && !effectiveDisabled,\n onCode: commit,\n });\n\n const handleChange =\n (index: number) => (event: ChangeEvent<HTMLInputElement>) => {\n const raw = event.target.value;\n const norm =\n mode === 'alphanumeric'\n ? raw.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(raw).replace(/\\D/g, '');\n const current = valueRef.current;\n\n if (norm.length === 0) {\n if (raw === '' && index < current.length) {\n const newValue = current.slice(0, index) + current.slice(index + 1);\n commit(newValue);\n }\n return;\n }\n\n const before = current.slice(0, index);\n const after = current.slice(index + norm.length);\n const newValue = (before + norm + after).slice(0, length);\n commit(newValue);\n\n const focusTarget = Math.min(index + norm.length, length - 1);\n focusBox(focusTarget);\n };\n\n const handleKeyDown =\n (index: number) => (event: KeyboardEvent<HTMLInputElement>) => {\n const current = valueRef.current;\n if (event.key === 'Backspace') {\n if (current[index]) {\n event.preventDefault();\n const newValue = current.slice(0, index) + current.slice(index + 1);\n commit(newValue);\n return;\n }\n if (index > 0) {\n event.preventDefault();\n const newValue = current.slice(0, index - 1) + current.slice(index);\n commit(newValue);\n focusBox(index - 1);\n }\n return;\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (index > 0) focusBox(index - 1);\n return;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (index < length - 1) focusBox(index + 1);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n focusBox(0);\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n focusBox(length - 1);\n }\n };\n\n const handlePaste =\n (index: number) => (event: ClipboardEvent<HTMLInputElement>) => {\n const text = event.clipboardData.getData('text');\n const stripped = text.replace(/\\s+/g, '');\n const norm =\n mode === 'alphanumeric'\n ? stripped.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(stripped);\n // numeric: reject the whole paste unless it is all digits (byte-identical\n // to prior behaviour); alphanumeric: accept the stripped [A-Za-z0-9].\n if (\n mode === 'alphanumeric' ? norm.length === 0 : !/^[0-9]+$/.test(norm)\n ) {\n return;\n }\n event.preventDefault();\n const current = valueRef.current;\n const before = current.slice(0, index);\n const after = current.slice(index + norm.length);\n const newValue = (before + norm + after).slice(0, length);\n commit(newValue);\n const focusTarget = Math.min(index + norm.length, length - 1);\n focusBox(focusTarget);\n };\n\n const handleFocus =\n (index: number) => (event: FocusEvent<HTMLInputElement>) => {\n setActiveIndex(index);\n event.currentTarget.select();\n };\n\n const baseId = ctx.id;\n /* No element carries the field's own id: its label points at the\n first box. */\n useFormFieldControlId(ctx, `${baseId}-0`);\n\n const agentHandle = useMemo<OTPInputHandle>(\n () => ({\n getValue: () => valueRef.current,\n setValue: (next) => commit(next),\n clear: () => commit(''),\n focus: () => focusBox(activeIndex),\n isComplete: () => valueRef.current.length === length,\n }),\n [commit, focusBox, activeIndex, length],\n );\n useAgentRegistration(otpInputAgent, agentHandle, id);\n // Expose the same imperative handle to React refs so consumers can\n // focus / read / clear the field (e.g. focus the boxes on a step change).\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n\n return (\n <div className={wrapperVariants({ className })}>\n {label ? (\n <label\n id={labelId}\n htmlFor={`${baseId}-0`}\n className=\"type-label ds:text-foreground\"\n >\n {label}\n </label>\n ) : null}\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- aria-invalid is a global ARIA state; conveys group-level validation */}\n <div\n role=\"group\"\n dir=\"ltr\"\n aria-labelledby={labelId}\n aria-invalid={effectiveError || undefined}\n aria-describedby={\n [describedBy, ctx.describedBy].filter(Boolean).join(' ') ||\n undefined\n }\n aria-disabled={effectiveDisabled || undefined}\n data-component=\"otp-input\"\n data-component-id={id}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n {digits.map((digit, index) => {\n const isTabbable = !effectiveDisabled && index === activeIndex;\n return (\n <input\n key={index}\n ref={(node) => {\n inputsRef.current[index] = node;\n }}\n id={`${baseId}-${index}`}\n type=\"text\"\n inputMode={mode === 'alphanumeric' ? 'text' : 'numeric'}\n pattern={mode === 'alphanumeric' ? '[A-Za-z0-9]*' : '[0-9]*'}\n autoCapitalize={\n mode === 'alphanumeric' ? 'characters' : undefined\n }\n autoComplete={index === 0 ? 'one-time-code' : 'off'}\n maxLength={1}\n value={digit}\n disabled={effectiveDisabled}\n tabIndex={isTabbable ? 0 : -1}\n aria-label={t(\n mode === 'alphanumeric'\n ? 'inputs.otp.charLabel'\n : 'inputs.otp.digitLabel',\n {\n current: index + 1,\n total: length,\n },\n )}\n onChange={handleChange(index)}\n onKeyDown={handleKeyDown(index)}\n onPaste={handlePaste(index)}\n onFocus={handleFocus(index)}\n className={boxVariants({ tone: effectiveTone })}\n />\n );\n })}\n </div>\n {name ? (\n <input type=\"hidden\" name={name} value={currentValue} readOnly />\n ) : null}\n </div>\n );\n },\n);\n\nOTPInput.displayName = 'OTPInput';\n"],"names":["otpInputAgent","handle","args","wrapperVariants","cva","boxVariants","normaliseDigits","str","c","MIN_LENGTH","MAX_LENGTH","resolveLength","length","packValue","value","mode","valueToArray","packed","arr","i","OTPInput","forwardRef","lengthProp","defaultValue","onChange","onComplete","disabled","error","label","describedBy","id","className","webOtp","name","ref","t","useTranslation","ctx","useFormField","generatedLabelId","useId","labelId","internalValueRaw","setInternalValue","useControllableState","currentValue","digits","effectiveDisabled","effectiveError","effectiveTone","inputsRef","useRef","completedRef","valueRef","computeInitialIndex","firstEmpty","activeIndex","setActiveIndex","useState","useEffect","focusBox","useCallback","index","clamped","node","commit","next","useWebOtp","handleChange","event","raw","norm","current","newValue","before","after","focusTarget","handleKeyDown","handlePaste","stripped","handleFocus","baseId","useFormFieldControlId","agentHandle","useMemo","useAgentRegistration","useImperativeHandle","jsx","digit","isTabbable"],"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