@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-vF9O-QoG.js","sources":["../../src/components/combobox/combobox.agent.ts","../../src/components/combobox/combobox.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ComboboxHandle } from './combobox';\n\nexport const comboboxAgent: AgentAdapter<ComboboxHandle> = {\n id: 'combobox',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_single', 'set_value', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string | null',\n descriptionKey: 'ui.agent.combobox.state.value',\n description:\n 'Currently-selected option value, or null when nothing is selected.',\n read: (handle) => handle.getValue(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.combobox.state.query',\n description: 'Current filter query in the combobox input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.combobox.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the user's chosen option — reversible via the same UI.\n safety: 'write',\n argsType: '{ value: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['string', 'null'],\n description: 'Option value to select, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.setValue',\n description: 'Set the selected value programmatically.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string | null }) => {\n handle.setValue(args.value);\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.combobox.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 clear_selection: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.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.combobox.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: 'combobox' },\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 useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command, defaultFilter, useCommandState } from 'cmdk';\nimport { cva } 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 type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\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 { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TONE,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { comboboxAgent } from './combobox.agent';\n\nexport type ComboboxOption<T extends string = string> = OptionShape<T>;\n\n// Curated agent-readiness handle — see combobox.agent.ts.\nexport interface ComboboxHandle {\n getValue: () => string | null;\n getQuery: () => string;\n getIsOpen: () => boolean;\n setValue: (value: string | null) => void;\n setQuery: (query: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n /** Custom score. All three arguments are diacritics-stripped and\n * lower-cased. `label` is the option's label ('' for the create row).\n * The filter is not consulted while the query is still the chosen\n * option's own label: then every option shows. */\n filter?: (value: string, search: string, label: string) => number;\n allowCreate?: boolean;\n onCreate?: (value: string) => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Query typed by the user (including IME commits and Clear), or set\n * through the agent handle. Selection and closing do not emit queries.\n * Pair with `filter` for host-provided results and `emptyMessage` for\n * their state. This callback also fires when there are no options. */\n onQueryChange?: (query: string) => void;\n emptyMessage?: ReactNode;\n 'aria-label'?: string;\n /**\n * Invalid-state fallback for use OUTSIDE a `<FormField>` (e.g. an inline\n * editor). Inside a FormField the context wins. Drives the error border and\n * the input's `aria-invalid`.\n */\n 'aria-invalid'?: boolean;\n /**\n * Error-message id fallback for use OUTSIDE a `<FormField>`. Inside a\n * FormField the context's `describedBy` wins.\n */\n 'aria-describedby'?: string;\n /**\n * The input's HTML `autocomplete` token (e.g. `country`,\n * `address-level1`, WCAG 2.1 §1.3.5). With a token, the browser can fill\n * the field from a saved address: text it fills in is matched to an\n * option (see `matchAutofill`) and that option is chosen.\n */\n autoComplete?: string;\n /**\n * Which option the browser's filled-in text means: return its `value`,\n * or `undefined` for none. Used only with `autoComplete`. The default\n * matches an option's value or label, ignoring case and accents.\n */\n matchAutofill?: (text: string) => string | undefined;\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 className?: string;\n}\n\nconst comboboxInputVariants = cva(\n [\n 'ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:outline-none ds:border-0',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full',\n INPUT_SURFACE_CHROME,\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ${INPUT_SURFACE_PADDING_X.sm}`,\n md: `${INPUT_SURFACE_HEIGHT.md} ${INPUT_SURFACE_PADDING_X.md}`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ${INPUT_SURFACE_PADDING_X.lg}`,\n },\n tone: INPUT_SURFACE_TONE,\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst comboboxContentVariants = cva(\n [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]',\n // A guard: the list is as wide as the field, so only a field that is\n // itself wider than the screen could take it past the edge.\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);\n\nconst comboboxItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:pointer-events-none ds:aria-disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst comboboxListClasses =\n 'ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst comboboxEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst iconSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\ninterface CreateRowProps {\n search: string;\n label: string;\n iconClass: string;\n size: 'sm' | 'md' | 'lg';\n onSelect: (value: string) => void;\n}\n\nfunction ComboboxCreateRow({\n search,\n label,\n iconClass,\n size,\n onSelect,\n}: CreateRowProps): ReactElement | null {\n // Only surface the create row when no existing item matches the query.\n const filteredCount = useCommandState((state) => state.filtered.count);\n if (filteredCount > 0) return null;\n return (\n <Command.Item\n value={`__combobox-create__${search}`}\n keywords={[]}\n forceMount\n onSelect={() => onSelect(search)}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n />\n <span className=\"ds:flex-1 ds:truncate\">{label}</span>\n </Command.Item>\n );\n}\n\nconst ComboboxImpl = forwardRef<HTMLInputElement, ComboboxProps>(\n function Combobox(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n readOnly,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n filter: externalFilter,\n allowCreate = false,\n onCreate,\n open: openProp,\n onOpenChange,\n onQueryChange,\n emptyMessage,\n className,\n 'aria-label': ariaLabel,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n autoComplete,\n matchAutofill,\n wrapOptionLabels = false,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setComboboxValue] = useControllableState<string>({\n value,\n defaultValue: defaultValue ?? '',\n onChange: onValueChange as ((next: string) => void) | undefined,\n });\n const currentValue = currentValueRaw ?? '';\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === currentValue),\n [options, currentValue],\n );\n const selectedLabel = selectedOption?.label ?? '';\n\n const [search, setSearch] = useState<string>(selectedLabel);\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpenControlled = openProp !== undefined;\n const open = isOpenControlled ? openProp : internalOpen;\n const composingRef = useRef(false);\n /* The query is still the chosen option's own label: nothing typed yet. */\n const untouched = selectedLabel !== '' && search === selectedLabel;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n /* cmdk writes its own id on the input and focuses it by that id, so\n the field's label follows that id. */\n useFormFieldControlRef(ctx, inputRef);\n\n /* cmdk's relevance sort moves DOM nodes. Remounting the list once the\n query is untouched again puts the options back in source order. */\n const [listEpoch, setListEpoch] = useState(0);\n const listMountedRef = useRef(false);\n useIsomorphicLayoutEffect(() => {\n /* The first render is already in source order. */\n if (!listMountedRef.current) {\n listMountedRef.current = true;\n return;\n }\n if (untouched) setListEpoch((n) => n + 1);\n }, [untouched]);\n\n /* Whether the user has reached a row since the list opened or the\n query changed: arrow keys, Home, End or the pointer. */\n const navigatedRef = useRef(false);\n useEffect(() => {\n navigatedRef.current = false;\n }, [search, open]);\n /* True while the kit itself makes the chosen option the active row. */\n const activatingRef = useRef(false);\n\n /* Opening on an untouched value shows the chosen option mid-list.\n Rect maths rather than scrollIntoView, which would scroll the page. */\n useIsomorphicLayoutEffect(() => {\n if (!open || !untouched || !currentValue) return;\n const list = listRef.current;\n const item = list?.querySelector<HTMLElement>(\n `[data-option-id=\"${CSS.escape(currentValue)}\"]`,\n );\n if (!list || !item) return;\n const listRect = list.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n /* The opening zoom scales both rects; scrollTop is unscaled. */\n const scale =\n list.offsetHeight > 0 ? listRect.height / list.offsetHeight : 1;\n const offset = (itemRect.top - listRect.top) / (scale || 1);\n const itemHeight = itemRect.height / (scale || 1);\n list.scrollTop += offset - (list.clientHeight - itemHeight) / 2;\n /* The chosen option becomes the active row, so the arrow keys move on\n from it. cmdk's pointer path sets the row and the input's\n aria-activedescendant without scrolling. */\n activatingRef.current = true;\n try {\n item.dispatchEvent(new PointerEvent('pointermove', { bubbles: true }));\n } finally {\n activatingRef.current = false;\n }\n /* Only on opening: reading the value later must not scroll. */\n }, [open]);\n\n const autofillToken =\n autoComplete && autoComplete !== 'off' ? autoComplete : undefined;\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (!input) return;\n input.setAttribute('aria-expanded', String(open));\n /* cmdk writes autocomplete=\"off\" over the prop on every render. */\n if (autofillToken) input.setAttribute('autocomplete', autofillToken);\n });\n\n /* Text the browser fills in arrives as an input event that is not\n typing: no input type, or a replacement. The listener sits on the\n input itself, so it runs before React hands the change to cmdk. */\n const autofilledRef = useRef(false);\n useEffect(() => {\n const input = inputRef.current;\n if (!input || !autofillToken) return;\n const onInput = (event: Event) => {\n const inputType = (event as InputEvent).inputType;\n autofilledRef.current =\n !inputType || inputType === 'insertReplacementText';\n };\n input.addEventListener('input', onInput);\n return () => input.removeEventListener('input', onInput);\n }, [autofillToken]);\n\n useEffect(() => {\n if (!open) {\n setSearch(selectedLabel);\n }\n }, [selectedLabel, open]);\n\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveReadOnly = Boolean(readOnly);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : Boolean(ariaInvalid);\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : ariaDescribedBy;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.combobox.placeholder', 'Search…');\n\n const filterFn = useMemo(\n () => (candidate: string, searchStr: string, keywords?: string[]) => {\n if (composingRef.current) return 1;\n /* Untouched query: every option shows, whatever the filter says. */\n if (selectedLabel !== '' && searchStr === selectedLabel) return 1;\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n if (externalFilter) {\n return externalFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords?.[0] ?? '',\n );\n }\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [externalFilter, selectedLabel],\n );\n\n const commit = (next: string) => {\n setComboboxValue(next);\n };\n\n const setOpen = (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const handleSelect = (optValue: string) => {\n const option = options.find((o) => o.value === optValue);\n commit(optValue);\n setSearch(option?.label ?? '');\n setOpen(false);\n };\n\n const handleCreate = (nextValue: string) => {\n onCreate?.(nextValue);\n setOpen(false);\n };\n\n const optionForAutofill = (text: string) => {\n const wanted = normalizeDiacritics(text.trim());\n if (!wanted) return undefined;\n const match = matchAutofill\n ? matchAutofill(text.trim())\n : options.find(\n (o) =>\n normalizeDiacritics(o.value) === wanted ||\n normalizeDiacritics(o.label) === wanted,\n )?.value;\n return options.find((o) => o.value === match && !o.disabled);\n };\n\n const handleSearchChange = (next: string) => {\n if (effectiveReadOnly) return;\n if (autofilledRef.current) {\n autofilledRef.current = false;\n const option = optionForAutofill(next);\n if (option) {\n commit(option.value);\n setSearch(option.label);\n if (open) setOpen(false);\n return;\n }\n /* Filled from another field and no option means it: the list\n must not open over a field the user is not in. */\n if (document.activeElement !== inputRef.current) {\n setSearch(selectedLabel);\n return;\n }\n }\n setSearch(next);\n if (!composingRef.current) onQueryChange?.(next);\n if (!open && next.length > 0 && !composingRef.current) {\n setOpen(true);\n }\n };\n\n const handleFocus = () => {\n if (!effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n /* A pick keeps focus in the input, so no focus event follows. A\n click on the focused input reopens the list instead. */\n const handleClick = () => {\n if (!open && !effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n const handleCompositionStart = () => {\n composingRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n composingRef.current = false;\n if (effectiveReadOnly) return;\n const next = inputRef.current?.value ?? '';\n setSearch(next);\n onQueryChange?.(next);\n if (next.length > 0) setOpen(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) return;\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n !open &&\n !effectiveDisabled &&\n !effectiveReadOnly\n ) {\n /* The arrow that opens the list only opens it. The next arrow\n moves on from the chosen option, or from the top. */\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Home' ||\n event.key === 'End' ||\n /* cmdk's own Ctrl+N, J, P and K move the highlight too. */\n (event.ctrlKey && ['n', 'j', 'p', 'k'].includes(event.key))\n ) {\n navigatedRef.current = true;\n }\n /* Handled before cmdk sees it: Enter commits only a row the user\n reached, never from a closed list. On an untouched open the lit\n row is the chosen option, so keeping the value matches it. */\n if (\n event.key === 'Enter' &&\n (!open || (!navigatedRef.current && (untouched || search === '')))\n ) {\n event.preventDefault();\n if (open) setOpen(false);\n return;\n }\n if (event.key === 'Escape' && open) {\n event.preventDefault();\n setOpen(false);\n setSearch(selectedLabel);\n }\n };\n\n const handleClear = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n commit('');\n setSearch('');\n onQueryChange?.('');\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean) => {\n if (effectiveReadOnly && next) return;\n setOpen(next);\n if (!next) setSearch(selectedLabel);\n };\n\n // Agent handle — refs mirror state for fresh reads.\n const valueRef = useRef<string>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const searchRef = useRef<string>(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const setOpenStable = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const agentHandle = useMemo<ComboboxHandle>(\n () => ({\n getValue: () => valueRef.current || null,\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n setValue: (next) => {\n const v = next ?? '';\n setComboboxValue(v);\n const opt = options.find((o) => o.value === v);\n setSearch(opt?.label ?? '');\n },\n setQuery: (query) => {\n setSearch(query);\n onQueryChange?.(query);\n },\n clear: () => {\n setComboboxValue('');\n setSearch('');\n onQueryChange?.('');\n },\n open: () => setOpenStable(true),\n close: () => setOpenStable(false),\n }),\n [setComboboxValue, options, setOpenStable, onQueryChange],\n );\n useAgentRegistration(comboboxAgent, agentHandle, id);\n\n const showClear =\n clearable &&\n Boolean(currentValue) &&\n !effectiveDisabled &&\n !effectiveReadOnly;\n\n const groups = groupOptions(options);\n const iconClass = iconSizeBySize[size];\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Command\n filter={filterFn}\n shouldFilter\n loop\n // cmdk points the input's `aria-labelledby` at its own hidden\n // `<label cmdk-label>`, whose text is this `label`: it is the\n // input's accessible name. The caller's `aria-label` wins, then\n // the FormField's label. The placeholder is the last resort, so\n // the input is never unnamed.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className=\"ds:w-full\"\n >\n <Popover.Anchor asChild>\n <div\n ref={anchorRef}\n className={comboboxWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n data-component=\"combobox\"\n data-component-id={id}\n >\n <Command.Input\n ref={composeRefs(ref, inputRef)}\n value={search}\n onValueChange={handleSearchChange}\n // The picked label shows in the field: keep its direction.\n dir={selectedOption?.dir}\n name={name}\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={effectiveReadOnly}\n required={effectiveRequired}\n autoComplete={autoComplete}\n // cmdk writes `id` and `aria-labelledby` after the props it\n // is given, so neither can be set here: the name goes through\n // the Command root's `label` above.\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onFocus={handleFocus}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={comboboxInputVariants({ size })}\n />\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.combobox.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4 ds:shrink-0',\n /* A 24px hit area with no visual change. */\n \"ds:relative ds:before:absolute ds:before:inset-[calc(var(--spacing-xs)*-1)] ds:before:content-['']\",\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n </div>\n </Popover.Anchor>\n <Popover.Portal forceMount>\n <Popover.Content\n // `forceMount` keeps the listbox in the DOM while the popover\n // is closed so the input's cmdk-set `aria-controls` always\n // points at a real id (axe's aria-valid-attr-value rule).\n // The CSS visibility / pointer-events is gated by data-state.\n forceMount\n hidden={!open}\n // Radix Popover.Content carries `role=\"dialog\"`; axe's\n // `aria-dialog-name` rule requires a name. Surface the\n // surrounding combobox label so the popover is named after\n // the field it serves (or fall back to the i18n default).\n aria-label={\n ariaLabel ?? t('inputs.combobox.popupLabel', 'Options')\n }\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target as Node | null;\n if (target && anchorRef.current?.contains(target)) {\n event.preventDefault();\n }\n }}\n sideOffset={4}\n align=\"start\"\n className={comboboxContentVariants()}\n >\n <Command.List\n key={listEpoch}\n ref={listRef}\n className={comboboxListClasses}\n onPointerMove={() => {\n if (!activatingRef.current) navigatedRef.current = true;\n }}\n /* The list is focusable: without this a pointer pick\n moves focus into it, then loses it to the page when\n the list hides. */\n onMouseDown={(event) => event.preventDefault()}\n >\n <Command.Empty className={comboboxEmptyClasses}>\n {/* cmdk owns the presentational wrapper. This unavailable\n option gives an empty list valid semantics without\n registering a selectable cmdk item. */}\n <div role=\"option\" aria-selected={false} aria-disabled=\"true\">\n {emptyMessage ??\n t('inputs.combobox.empty', 'No results found')}\n </div>\n </Command.Empty>\n {groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => {\n const isSelected = option.value === currentValue;\n return (\n <Command.Item\n /* The label is in the key because cmdk only reads\n keywords when the value changes. */\n key={`${option.value}\\u0000${option.label}`}\n value={option.value}\n data-option-id={option.value}\n keywords={[option.label]}\n disabled={option.disabled}\n onSelect={handleSelect}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n >\n {isSelected ? <Check className={iconClass} /> : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the option's accessible\n // name comes from its label. Hide so a text-bearing\n // adornment can't leak into the computed name.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked: the label and its end content on one\n // row, the description on a line of its own\n // under them. In this DOM order the option's\n // name reads label, end content, description.\n <span\n className={`${OPTION_BODY_CLASSES} ds:py-[var(--spacing-xs)]`}\n >\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1',\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 })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:truncate\"\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\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n });\n if (!group) {\n return (\n <Command.Group key={`group-${groupIndex}`}>\n {body}\n </Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={\n <span className={comboboxGroupHeadingClasses}>\n {group}\n </span>\n }\n >\n {body}\n </Command.Group>\n );\n })}\n {allowCreate && search.length > 0 ? (\n <ComboboxCreateRow\n search={search}\n label={t('inputs.combobox.create', 'Create \"{{value}}\"', {\n value: search,\n })}\n iconClass={iconClass}\n size={size}\n onSelect={handleCreate}\n />\n ) : null}\n </Command.List>\n </Popover.Content>\n </Popover.Portal>\n </Command>\n </Popover.Root>\n );\n },\n);\nComboboxImpl.displayName = 'Combobox';\n\ninterface ComboboxComponent {\n <T extends string = string>(\n props: ComboboxProps<T> & { ref?: Ref<HTMLInputElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\n// forwardRef erases component-level generics, so we re-widen via a callable\n// interface to preserve the `<T extends string>` signature at the call site.\nexport const Combobox = ComboboxImpl as unknown as ComboboxComponent;\n\nexport {\n comboboxInputVariants,\n comboboxWrapperVariants,\n comboboxContentVariants,\n comboboxItemVariants,\n};\n"],"names":["comboboxAgent","handle","args","comboboxInputVariants","cva","comboboxWrapperVariants","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","INPUT_SURFACE_TONE","comboboxContentVariants","comboboxItemVariants","MENU_ROW_HIGHLIGHT","comboboxGroupHeadingClasses","comboboxListClasses","comboboxEmptyClasses","iconSizeBySize","ComboboxCreateRow","search","label","iconClass","size","onSelect","useCommandState","state","jsxs","Command","jsx","ComboboxImpl","forwardRef","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","readOnly","required","name","id","tone","externalFilter","allowCreate","onCreate","openProp","onOpenChange","onQueryChange","emptyMessage","className","ariaLabel","ariaInvalid","ariaDescribedBy","autoComplete","matchAutofill","wrapOptionLabels","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setComboboxValue","useControllableState","currentValue","selectedOption","useMemo","o","selectedLabel","setSearch","useState","internalOpen","setInternalOpen","isOpenControlled","open","composingRef","useRef","untouched","inputRef","anchorRef","listRef","useFormFieldControlRef","listEpoch","setListEpoch","listMountedRef","useIsomorphicLayoutEffect","n","navigatedRef","useEffect","activatingRef","list","item","listRect","itemRect","scale","offset","itemHeight","autofillToken","input","autofilledRef","onInput","event","inputType","effectiveDisabled","effectiveReadOnly","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","filterFn","candidate","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","commit","next","setOpen","handleSelect","optValue","option","handleCreate","nextValue","optionForAutofill","text","wanted","match","_a","handleSearchChange","handleFocus","handleClick","handleCompositionStart","handleCompositionEnd","handleKeyDown","handleClear","handleOpenChange","valueRef","searchRef","openRef","setOpenStable","useCallback","agentHandle","v","opt","query","useAgentRegistration","showClear","groups","groupOptions","Popover","composeRefs","X","target","group","items","groupIndex","body","isSelected","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,UAAU,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A,wBACC,QAAAC;AAAA,wBACA,OAAOuC,EAAE,0BAA0B,sBAAsB;AAAA,0BACvD,OAAOvC;AAAA,wBAAA,CACR;AAAA,wBACD,WAAAE;AAAA,wBACA,MAAAC;AAAA,wBACA,UAAU2G;AAAA,sBAAA;AAAA,oBAAA,IAEV;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBA5IC3C;AAAA,cAAA;AAAA,YA6IP;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAzD,GAAa,cAAc;AAWpB,MAAMgJ,KAAWhJ;"}
|
|
1
|
+
{"version":3,"file":"combobox-CDPm_n0p.js","sources":["../../src/components/combobox/combobox.agent.ts","../../src/components/combobox/combobox.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ComboboxHandle } from './combobox';\n\nexport const comboboxAgent: AgentAdapter<ComboboxHandle> = {\n id: 'combobox',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_single', 'set_value', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string | null',\n descriptionKey: 'ui.agent.combobox.state.value',\n description:\n 'Currently-selected option value, or null when nothing is selected.',\n read: (handle) => handle.getValue(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.combobox.state.query',\n description: 'Current filter query in the combobox input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.combobox.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the user's chosen option — reversible via the same UI.\n safety: 'write',\n argsType: '{ value: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['string', 'null'],\n description: 'Option value to select, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.setValue',\n description: 'Set the selected value programmatically.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string | null }) => {\n handle.setValue(args.value);\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.combobox.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 clear_selection: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.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.combobox.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: 'combobox' },\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 useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command, defaultFilter, useCommandState } from 'cmdk';\nimport { cva } 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 type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\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 { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TONE,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { comboboxAgent } from './combobox.agent';\n\nexport type ComboboxOption<T extends string = string> = OptionShape<T>;\n\n// Curated agent-readiness handle — see combobox.agent.ts.\nexport interface ComboboxHandle {\n getValue: () => string | null;\n getQuery: () => string;\n getIsOpen: () => boolean;\n setValue: (value: string | null) => void;\n setQuery: (query: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n /** Custom score. All three arguments are diacritics-stripped and\n * lower-cased. `label` is the option's label ('' for the create row).\n * The filter is not consulted while the query is still the chosen\n * option's own label: then every option shows. */\n filter?: (value: string, search: string, label: string) => number;\n allowCreate?: boolean;\n onCreate?: (value: string) => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Query typed by the user (including IME commits and Clear), or set\n * through the agent handle. Selection and closing do not emit queries.\n * Pair with `filter` for host-provided results and `emptyMessage` for\n * their state. This callback also fires when there are no options. */\n onQueryChange?: (query: string) => void;\n emptyMessage?: ReactNode;\n 'aria-label'?: string;\n /**\n * Invalid-state fallback for use OUTSIDE a `<FormField>` (e.g. an inline\n * editor). Inside a FormField the context wins. Drives the error border and\n * the input's `aria-invalid`.\n */\n 'aria-invalid'?: boolean;\n /**\n * Error-message id fallback for use OUTSIDE a `<FormField>`. Inside a\n * FormField the context's `describedBy` wins.\n */\n 'aria-describedby'?: string;\n /**\n * The input's HTML `autocomplete` token (e.g. `country`,\n * `address-level1`, WCAG 2.1 §1.3.5). With a token, the browser can fill\n * the field from a saved address: text it fills in is matched to an\n * option (see `matchAutofill`) and that option is chosen.\n */\n autoComplete?: string;\n /**\n * Which option the browser's filled-in text means: return its `value`,\n * or `undefined` for none. Used only with `autoComplete`. The default\n * matches an option's value or label, ignoring case and accents.\n */\n matchAutofill?: (text: string) => string | undefined;\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 className?: string;\n}\n\nconst comboboxInputVariants = cva(\n [\n 'ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:outline-none ds:border-0',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full',\n INPUT_SURFACE_CHROME,\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ${INPUT_SURFACE_PADDING_X.sm}`,\n md: `${INPUT_SURFACE_HEIGHT.md} ${INPUT_SURFACE_PADDING_X.md}`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ${INPUT_SURFACE_PADDING_X.lg}`,\n },\n tone: INPUT_SURFACE_TONE,\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst comboboxContentVariants = cva(\n [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]',\n // A guard: the list is as wide as the field, so only a field that is\n // itself wider than the screen could take it past the edge.\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);\n\nconst comboboxItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:pointer-events-none ds:aria-disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst comboboxListClasses =\n 'ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst comboboxEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst iconSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\ninterface CreateRowProps {\n search: string;\n label: string;\n iconClass: string;\n size: 'sm' | 'md' | 'lg';\n onSelect: (value: string) => void;\n}\n\nfunction ComboboxCreateRow({\n search,\n label,\n iconClass,\n size,\n onSelect,\n}: CreateRowProps): ReactElement | null {\n // Only surface the create row when no existing item matches the query.\n const filteredCount = useCommandState((state) => state.filtered.count);\n if (filteredCount > 0) return null;\n return (\n <Command.Item\n value={`__combobox-create__${search}`}\n keywords={[]}\n forceMount\n onSelect={() => onSelect(search)}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n />\n <span className=\"ds:flex-1 ds:truncate\">{label}</span>\n </Command.Item>\n );\n}\n\nconst ComboboxImpl = forwardRef<HTMLInputElement, ComboboxProps>(\n function Combobox(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n readOnly,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n filter: externalFilter,\n allowCreate = false,\n onCreate,\n open: openProp,\n onOpenChange,\n onQueryChange,\n emptyMessage,\n className,\n 'aria-label': ariaLabel,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n autoComplete,\n matchAutofill,\n wrapOptionLabels = false,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setComboboxValue] = useControllableState<string>({\n value,\n defaultValue: defaultValue ?? '',\n onChange: onValueChange as ((next: string) => void) | undefined,\n });\n const currentValue = currentValueRaw ?? '';\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === currentValue),\n [options, currentValue],\n );\n const selectedLabel = selectedOption?.label ?? '';\n\n const [search, setSearch] = useState<string>(selectedLabel);\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpenControlled = openProp !== undefined;\n const open = isOpenControlled ? openProp : internalOpen;\n const composingRef = useRef(false);\n /* The query is still the chosen option's own label: nothing typed yet. */\n const untouched = selectedLabel !== '' && search === selectedLabel;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n /* cmdk writes its own id on the input and focuses it by that id, so\n the field's label follows that id. */\n useFormFieldControlRef(ctx, inputRef);\n\n /* cmdk's relevance sort moves DOM nodes. Remounting the list once the\n query is untouched again puts the options back in source order. */\n const [listEpoch, setListEpoch] = useState(0);\n const listMountedRef = useRef(false);\n useIsomorphicLayoutEffect(() => {\n /* The first render is already in source order. */\n if (!listMountedRef.current) {\n listMountedRef.current = true;\n return;\n }\n if (untouched) setListEpoch((n) => n + 1);\n }, [untouched]);\n\n /* Whether the user has reached a row since the list opened or the\n query changed: arrow keys, Home, End or the pointer. */\n const navigatedRef = useRef(false);\n useEffect(() => {\n navigatedRef.current = false;\n }, [search, open]);\n /* True while the kit itself makes the chosen option the active row. */\n const activatingRef = useRef(false);\n\n /* Opening on an untouched value shows the chosen option mid-list.\n Rect maths rather than scrollIntoView, which would scroll the page. */\n useIsomorphicLayoutEffect(() => {\n if (!open || !untouched || !currentValue) return;\n const list = listRef.current;\n const item = list?.querySelector<HTMLElement>(\n `[data-option-id=\"${CSS.escape(currentValue)}\"]`,\n );\n if (!list || !item) return;\n const listRect = list.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n /* The opening zoom scales both rects; scrollTop is unscaled. */\n const scale =\n list.offsetHeight > 0 ? listRect.height / list.offsetHeight : 1;\n const offset = (itemRect.top - listRect.top) / (scale || 1);\n const itemHeight = itemRect.height / (scale || 1);\n list.scrollTop += offset - (list.clientHeight - itemHeight) / 2;\n /* The chosen option becomes the active row, so the arrow keys move on\n from it. cmdk's pointer path sets the row and the input's\n aria-activedescendant without scrolling. */\n activatingRef.current = true;\n try {\n item.dispatchEvent(new PointerEvent('pointermove', { bubbles: true }));\n } finally {\n activatingRef.current = false;\n }\n /* Only on opening: reading the value later must not scroll. */\n }, [open]);\n\n const autofillToken =\n autoComplete && autoComplete !== 'off' ? autoComplete : undefined;\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (!input) return;\n input.setAttribute('aria-expanded', String(open));\n /* cmdk writes autocomplete=\"off\" over the prop on every render. */\n if (autofillToken) input.setAttribute('autocomplete', autofillToken);\n });\n\n /* Text the browser fills in arrives as an input event that is not\n typing: no input type, or a replacement. The listener sits on the\n input itself, so it runs before React hands the change to cmdk. */\n const autofilledRef = useRef(false);\n useEffect(() => {\n const input = inputRef.current;\n if (!input || !autofillToken) return;\n const onInput = (event: Event) => {\n const inputType = (event as InputEvent).inputType;\n autofilledRef.current =\n !inputType || inputType === 'insertReplacementText';\n };\n input.addEventListener('input', onInput);\n return () => input.removeEventListener('input', onInput);\n }, [autofillToken]);\n\n useEffect(() => {\n if (!open) {\n setSearch(selectedLabel);\n }\n }, [selectedLabel, open]);\n\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveReadOnly = Boolean(readOnly);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : Boolean(ariaInvalid);\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : ariaDescribedBy;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.combobox.placeholder', 'Search…');\n\n const filterFn = useMemo(\n () => (candidate: string, searchStr: string, keywords?: string[]) => {\n if (composingRef.current) return 1;\n /* Untouched query: every option shows, whatever the filter says. */\n if (selectedLabel !== '' && searchStr === selectedLabel) return 1;\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n if (externalFilter) {\n return externalFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords?.[0] ?? '',\n );\n }\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [externalFilter, selectedLabel],\n );\n\n const commit = (next: string) => {\n setComboboxValue(next);\n };\n\n const setOpen = (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const handleSelect = (optValue: string) => {\n const option = options.find((o) => o.value === optValue);\n commit(optValue);\n setSearch(option?.label ?? '');\n setOpen(false);\n };\n\n const handleCreate = (nextValue: string) => {\n onCreate?.(nextValue);\n setOpen(false);\n };\n\n const optionForAutofill = (text: string) => {\n const wanted = normalizeDiacritics(text.trim());\n if (!wanted) return undefined;\n const match = matchAutofill\n ? matchAutofill(text.trim())\n : options.find(\n (o) =>\n normalizeDiacritics(o.value) === wanted ||\n normalizeDiacritics(o.label) === wanted,\n )?.value;\n return options.find((o) => o.value === match && !o.disabled);\n };\n\n const handleSearchChange = (next: string) => {\n if (effectiveReadOnly) return;\n if (autofilledRef.current) {\n autofilledRef.current = false;\n const option = optionForAutofill(next);\n if (option) {\n commit(option.value);\n setSearch(option.label);\n if (open) setOpen(false);\n return;\n }\n /* Filled from another field and no option means it: the list\n must not open over a field the user is not in. */\n if (document.activeElement !== inputRef.current) {\n setSearch(selectedLabel);\n return;\n }\n }\n setSearch(next);\n if (!composingRef.current) onQueryChange?.(next);\n if (!open && next.length > 0 && !composingRef.current) {\n setOpen(true);\n }\n };\n\n const handleFocus = () => {\n if (!effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n /* A pick keeps focus in the input, so no focus event follows. A\n click on the focused input reopens the list instead. */\n const handleClick = () => {\n if (!open && !effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n const handleCompositionStart = () => {\n composingRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n composingRef.current = false;\n if (effectiveReadOnly) return;\n const next = inputRef.current?.value ?? '';\n setSearch(next);\n onQueryChange?.(next);\n if (next.length > 0) setOpen(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) return;\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n !open &&\n !effectiveDisabled &&\n !effectiveReadOnly\n ) {\n /* The arrow that opens the list only opens it. The next arrow\n moves on from the chosen option, or from the top. */\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Home' ||\n event.key === 'End' ||\n /* cmdk's own Ctrl+N, J, P and K move the highlight too. */\n (event.ctrlKey && ['n', 'j', 'p', 'k'].includes(event.key))\n ) {\n navigatedRef.current = true;\n }\n /* Handled before cmdk sees it: Enter commits only a row the user\n reached, never from a closed list. On an untouched open the lit\n row is the chosen option, so keeping the value matches it. */\n if (\n event.key === 'Enter' &&\n (!open || (!navigatedRef.current && (untouched || search === '')))\n ) {\n event.preventDefault();\n if (open) setOpen(false);\n return;\n }\n if (event.key === 'Escape' && open) {\n event.preventDefault();\n setOpen(false);\n setSearch(selectedLabel);\n }\n };\n\n const handleClear = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n commit('');\n setSearch('');\n onQueryChange?.('');\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean) => {\n if (effectiveReadOnly && next) return;\n setOpen(next);\n if (!next) setSearch(selectedLabel);\n };\n\n // Agent handle — refs mirror state for fresh reads.\n const valueRef = useRef<string>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const searchRef = useRef<string>(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const setOpenStable = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const agentHandle = useMemo<ComboboxHandle>(\n () => ({\n getValue: () => valueRef.current || null,\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n setValue: (next) => {\n const v = next ?? '';\n setComboboxValue(v);\n const opt = options.find((o) => o.value === v);\n setSearch(opt?.label ?? '');\n },\n setQuery: (query) => {\n setSearch(query);\n onQueryChange?.(query);\n },\n clear: () => {\n setComboboxValue('');\n setSearch('');\n onQueryChange?.('');\n },\n open: () => setOpenStable(true),\n close: () => setOpenStable(false),\n }),\n [setComboboxValue, options, setOpenStable, onQueryChange],\n );\n useAgentRegistration(comboboxAgent, agentHandle, id);\n\n const showClear =\n clearable &&\n Boolean(currentValue) &&\n !effectiveDisabled &&\n !effectiveReadOnly;\n\n const groups = groupOptions(options);\n const iconClass = iconSizeBySize[size];\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Command\n filter={filterFn}\n shouldFilter\n loop\n // cmdk points the input's `aria-labelledby` at its own hidden\n // `<label cmdk-label>`, whose text is this `label`: it is the\n // input's accessible name. The caller's `aria-label` wins, then\n // the FormField's label. The placeholder is the last resort, so\n // the input is never unnamed.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className=\"ds:w-full\"\n >\n <Popover.Anchor asChild>\n <div\n ref={anchorRef}\n className={comboboxWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n data-component=\"combobox\"\n data-component-id={id}\n >\n <Command.Input\n ref={composeRefs(ref, inputRef)}\n value={search}\n onValueChange={handleSearchChange}\n // The picked label shows in the field: keep its direction.\n dir={selectedOption?.dir}\n name={name}\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={effectiveReadOnly}\n required={effectiveRequired}\n autoComplete={autoComplete}\n // cmdk writes `id` and `aria-labelledby` after the props it\n // is given, so neither can be set here: the name goes through\n // the Command root's `label` above.\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onFocus={handleFocus}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={comboboxInputVariants({ size })}\n />\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.combobox.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4 ds:shrink-0',\n /* A 24px hit area with no visual change. */\n \"ds:relative ds:before:absolute ds:before:inset-[calc(var(--spacing-xs)*-1)] ds:before:content-['']\",\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n </div>\n </Popover.Anchor>\n <Popover.Portal forceMount>\n <Popover.Content\n // `forceMount` keeps the listbox in the DOM while the popover\n // is closed so the input's cmdk-set `aria-controls` always\n // points at a real id (axe's aria-valid-attr-value rule).\n // The CSS visibility / pointer-events is gated by data-state.\n forceMount\n hidden={!open}\n // Radix Popover.Content carries `role=\"dialog\"`; axe's\n // `aria-dialog-name` rule requires a name. Surface the\n // surrounding combobox label so the popover is named after\n // the field it serves (or fall back to the i18n default).\n aria-label={\n ariaLabel ?? t('inputs.combobox.popupLabel', 'Options')\n }\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target as Node | null;\n if (target && anchorRef.current?.contains(target)) {\n event.preventDefault();\n }\n }}\n sideOffset={4}\n align=\"start\"\n className={comboboxContentVariants()}\n >\n <Command.List\n key={listEpoch}\n ref={listRef}\n // cmdk names the listbox \"Suggestions\" in English otherwise.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className={comboboxListClasses}\n onPointerMove={() => {\n if (!activatingRef.current) navigatedRef.current = true;\n }}\n /* The list is focusable: without this a pointer pick\n moves focus into it, then loses it to the page when\n the list hides. */\n onMouseDown={(event) => event.preventDefault()}\n >\n <Command.Empty className={comboboxEmptyClasses}>\n {/* cmdk owns the presentational wrapper. This unavailable\n option gives an empty list valid semantics without\n registering a selectable cmdk item. */}\n <div role=\"option\" aria-selected={false} aria-disabled=\"true\">\n {emptyMessage ??\n t('inputs.combobox.empty', 'No results found')}\n </div>\n </Command.Empty>\n {groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => {\n const isSelected = option.value === currentValue;\n return (\n <Command.Item\n /* The label is in the key because cmdk only reads\n keywords when the value changes. */\n key={`${option.value}\\u0000${option.label}`}\n value={option.value}\n data-option-id={option.value}\n keywords={[option.label]}\n disabled={option.disabled}\n onSelect={handleSelect}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n >\n {isSelected ? <Check className={iconClass} /> : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the option's accessible\n // name comes from its label. Hide so a text-bearing\n // adornment can't leak into the computed name.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked: the label and its end content on one\n // row, the description on a line of its own\n // under them. In this DOM order the option's\n // name reads label, end content, description.\n <span\n className={`${OPTION_BODY_CLASSES} ds:py-[var(--spacing-xs)]`}\n >\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1',\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 })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:truncate\"\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\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n });\n if (!group) {\n return (\n <Command.Group key={`group-${groupIndex}`}>\n {body}\n </Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={\n <span className={comboboxGroupHeadingClasses}>\n {group}\n </span>\n }\n >\n {body}\n </Command.Group>\n );\n })}\n {allowCreate && search.length > 0 ? (\n <ComboboxCreateRow\n search={search}\n label={t('inputs.combobox.create', 'Create \"{{value}}\"', {\n value: search,\n })}\n iconClass={iconClass}\n size={size}\n onSelect={handleCreate}\n />\n ) : null}\n </Command.List>\n </Popover.Content>\n </Popover.Portal>\n </Command>\n </Popover.Root>\n );\n },\n);\nComboboxImpl.displayName = 'Combobox';\n\ninterface ComboboxComponent {\n <T extends string = string>(\n props: ComboboxProps<T> & { ref?: Ref<HTMLInputElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\n// forwardRef erases component-level generics, so we re-widen via a callable\n// interface to preserve the `<T extends string>` signature at the call site.\nexport const Combobox = ComboboxImpl as unknown as ComboboxComponent;\n\nexport {\n comboboxInputVariants,\n comboboxWrapperVariants,\n comboboxContentVariants,\n comboboxItemVariants,\n};\n"],"names":["comboboxAgent","handle","args","comboboxInputVariants","cva","comboboxWrapperVariants","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","INPUT_SURFACE_TONE","comboboxContentVariants","comboboxItemVariants","MENU_ROW_HIGHLIGHT","comboboxGroupHeadingClasses","comboboxListClasses","comboboxEmptyClasses","iconSizeBySize","ComboboxCreateRow","search","label","iconClass","size","onSelect","useCommandState","state","jsxs","Command","jsx","ComboboxImpl","forwardRef","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","readOnly","required","name","id","tone","externalFilter","allowCreate","onCreate","openProp","onOpenChange","onQueryChange","emptyMessage","className","ariaLabel","ariaInvalid","ariaDescribedBy","autoComplete","matchAutofill","wrapOptionLabels","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setComboboxValue","useControllableState","currentValue","selectedOption","useMemo","o","selectedLabel","setSearch","useState","internalOpen","setInternalOpen","isOpenControlled","open","composingRef","useRef","untouched","inputRef","anchorRef","listRef","useFormFieldControlRef","listEpoch","setListEpoch","listMountedRef","useIsomorphicLayoutEffect","n","navigatedRef","useEffect","activatingRef","list","item","listRect","itemRect","scale","offset","itemHeight","autofillToken","input","autofilledRef","onInput","event","inputType","effectiveDisabled","effectiveReadOnly","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","filterFn","candidate","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","commit","next","setOpen","handleSelect","optValue","option","handleCreate","nextValue","optionForAutofill","text","wanted","match","_a","handleSearchChange","handleFocus","handleClick","handleCompositionStart","handleCompositionEnd","handleKeyDown","handleClear","handleOpenChange","valueRef","searchRef","openRef","setOpenStable","useCallback","agentHandle","v","opt","query","useAgentRegistration","showClear","groups","groupOptions","Popover","composeRefs","X","target","group","items","groupIndex","body","isSelected","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAA8C;AAAA,EACz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AU,EAEvC;AAAA,oBAeN,CAAC;AAAA,oBACAvH,MAAezB,EAAO,SAAS,IAC9B,gBAAAS;AAAA,sBAACV;AAAA,sBAAA;AAAA,wBACC,QAAAC;AAAA,wBACA,OAAOuC,EAAE,0BAA0B,sBAAsB;AAAA,0BACvD,OAAOvC;AAAA,wBAAA,CACR;AAAA,wBACD,WAAAE;AAAA,wBACA,MAAAC;AAAA,wBACA,UAAU2G;AAAA,sBAAA;AAAA,oBAAA,IAEV;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBA9IC3C;AAAA,cAAA;AAAA,YA+IP;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAzD,GAAa,cAAc;AAWpB,MAAMgJ,KAAWhJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as K } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as u, useState as k, useEffect as v, useRef as C, useMemo as w, useCallback as B } from "react";
|
|
3
3
|
import { _ as p, R as J } from "./index-4xgbg-sn.js";
|
|
4
4
|
import * as h from "@radix-ui/react-dialog";
|
|
@@ -112,8 +112,8 @@ function pe() {
|
|
|
112
112
|
r.preventDefault(), t((f) => !f);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
(l === "input" || l === "textarea" ||
|
|
115
|
+
const o = r.target, l = o == null ? void 0 : o.tagName.toLowerCase();
|
|
116
|
+
(l === "input" || l === "textarea" || o != null && o.isContentEditable) && (e && r.key);
|
|
117
117
|
}
|
|
118
118
|
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
119
119
|
}, [e]), { open: e, setOpen: t };
|
|
@@ -122,10 +122,10 @@ const Z = [
|
|
|
122
122
|
"ds:flex ds:h-full ds:w-full ds:flex-col ds:overflow-hidden",
|
|
123
123
|
"ds:rounded-[var(--radius-md)]",
|
|
124
124
|
"ds:bg-[var(--background)] ds:text-[var(--foreground)]"
|
|
125
|
-
].join(" "), M = u(({ className: e, filter: t = X, id: a, ...r },
|
|
125
|
+
].join(" "), M = u(({ className: e, filter: t = X, id: a, ...r }, d) => /* @__PURE__ */ n(
|
|
126
126
|
p,
|
|
127
127
|
{
|
|
128
|
-
ref:
|
|
128
|
+
ref: d,
|
|
129
129
|
filter: t,
|
|
130
130
|
className: [Z, e].filter(Boolean).join(" "),
|
|
131
131
|
"data-component": "command-palette",
|
|
@@ -147,20 +147,20 @@ const ee = [
|
|
|
147
147
|
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
|
|
148
148
|
"ds:border-0"
|
|
149
149
|
].join(" "), O = u(({ className: e, placeholder: t, ...a }, r) => {
|
|
150
|
-
const { t:
|
|
150
|
+
const { t: d } = R("ui");
|
|
151
151
|
return /* @__PURE__ */ m("div", { className: ee, children: [
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ n(
|
|
153
153
|
$,
|
|
154
154
|
{
|
|
155
155
|
"aria-hidden": "true",
|
|
156
156
|
className: "ds:size-4 ds:me-2 ds:text-[var(--muted-foreground)]"
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ n(
|
|
160
160
|
p.Input,
|
|
161
161
|
{
|
|
162
162
|
ref: r,
|
|
163
|
-
placeholder: t ??
|
|
163
|
+
placeholder: t ?? d("navigation.cmdk.placeholder", "Type a command or search…"),
|
|
164
164
|
className: [te, e].filter(Boolean).join(" "),
|
|
165
165
|
...a
|
|
166
166
|
}
|
|
@@ -168,7 +168,7 @@ const ee = [
|
|
|
168
168
|
] });
|
|
169
169
|
});
|
|
170
170
|
O.displayName = "CommandInput";
|
|
171
|
-
const A = u(({ className: e, ...t }, a) => /* @__PURE__ */
|
|
171
|
+
const A = u(({ className: e, ...t }, a) => /* @__PURE__ */ n(
|
|
172
172
|
p.List,
|
|
173
173
|
{
|
|
174
174
|
ref: a,
|
|
@@ -183,8 +183,8 @@ const A = u(({ className: e, ...t }, a) => /* @__PURE__ */ s(
|
|
|
183
183
|
));
|
|
184
184
|
A.displayName = "CommandList";
|
|
185
185
|
const D = u(({ className: e, children: t, ...a }, r) => {
|
|
186
|
-
const { t:
|
|
187
|
-
return /* @__PURE__ */
|
|
186
|
+
const { t: d } = R("ui");
|
|
187
|
+
return /* @__PURE__ */ n(
|
|
188
188
|
p.Empty,
|
|
189
189
|
{
|
|
190
190
|
ref: r,
|
|
@@ -194,12 +194,12 @@ const D = u(({ className: e, children: t, ...a }, r) => {
|
|
|
194
194
|
e ?? ""
|
|
195
195
|
].filter(Boolean).join(" "),
|
|
196
196
|
...a,
|
|
197
|
-
children: t ??
|
|
197
|
+
children: t ?? d("navigation.cmdk.empty", "No results found")
|
|
198
198
|
}
|
|
199
199
|
);
|
|
200
200
|
});
|
|
201
201
|
D.displayName = "CommandEmpty";
|
|
202
|
-
const N = u(({ className: e, heading: t, ...a }, r) => /* @__PURE__ */
|
|
202
|
+
const N = u(({ className: e, heading: t, ...a }, r) => /* @__PURE__ */ n(
|
|
203
203
|
p.Group,
|
|
204
204
|
{
|
|
205
205
|
ref: r,
|
|
@@ -229,7 +229,7 @@ const ae = [
|
|
|
229
229
|
V.selected,
|
|
230
230
|
"ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50",
|
|
231
231
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
232
|
-
].join(" "), x = u(({ className: e, ...t }, a) => /* @__PURE__ */
|
|
232
|
+
].join(" "), x = u(({ className: e, ...t }, a) => /* @__PURE__ */ n(
|
|
233
233
|
p.Item,
|
|
234
234
|
{
|
|
235
235
|
ref: a,
|
|
@@ -238,7 +238,7 @@ const ae = [
|
|
|
238
238
|
}
|
|
239
239
|
));
|
|
240
240
|
x.displayName = "CommandItem";
|
|
241
|
-
const G = u(({ className: e, ...t }, a) => /* @__PURE__ */
|
|
241
|
+
const G = u(({ className: e, ...t }, a) => /* @__PURE__ */ n(
|
|
242
242
|
p.Separator,
|
|
243
243
|
{
|
|
244
244
|
ref: a,
|
|
@@ -253,7 +253,7 @@ const G = u(({ className: e, ...t }, a) => /* @__PURE__ */ s(
|
|
|
253
253
|
));
|
|
254
254
|
G.displayName = "CommandSeparator";
|
|
255
255
|
const S = u(
|
|
256
|
-
({ className: e, children: t, ...a }, r) => /* @__PURE__ */
|
|
256
|
+
({ className: e, children: t, ...a }, r) => /* @__PURE__ */ n(
|
|
257
257
|
"kbd",
|
|
258
258
|
{
|
|
259
259
|
ref: r,
|
|
@@ -276,18 +276,18 @@ const S = u(
|
|
|
276
276
|
)
|
|
277
277
|
);
|
|
278
278
|
S.displayName = "CommandShortcut";
|
|
279
|
-
function
|
|
279
|
+
function ne(e, t) {
|
|
280
280
|
if (!t) return e;
|
|
281
|
-
const a = y(e), r = y(t),
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
281
|
+
const a = y(e), r = y(t), d = a.indexOf(r);
|
|
282
|
+
if (d === -1) return e;
|
|
283
|
+
const o = e.slice(0, d), l = e.slice(d, d + r.length), g = e.slice(d + r.length);
|
|
284
284
|
return /* @__PURE__ */ m(K, { children: [
|
|
285
|
-
|
|
286
|
-
/* @__PURE__ */
|
|
285
|
+
o,
|
|
286
|
+
/* @__PURE__ */ n("mark", { className: "ds:bg-[var(--accent)]/20 ds:text-inherit ds:rounded-[var(--radius-sm)] ds:px-[0.125em] ds:group-data-[selected=true]/menu-row:bg-transparent ds:group-data-[selected=true]/menu-row:underline", children: l }),
|
|
287
287
|
g
|
|
288
288
|
] });
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const se = [
|
|
291
291
|
"ds:fixed ds:inset-0 ds:z-[var(--z-modal-backdrop)]",
|
|
292
292
|
"ds:bg-[var(--background)]/70 ds:backdrop-blur-sm",
|
|
293
293
|
"ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out",
|
|
@@ -309,15 +309,15 @@ const ne = [
|
|
|
309
309
|
"ds:data-[state=open]:zoom-in-95 ds:data-[state=closed]:zoom-out-95",
|
|
310
310
|
"ds:motion-reduce:animate-none",
|
|
311
311
|
"ds:focus:outline-none"
|
|
312
|
-
].join(" "), q = ({ children: e }) => /* @__PURE__ */
|
|
312
|
+
].join(" "), q = ({ children: e }) => /* @__PURE__ */ n("span", { className: "ds:sr-only", children: e });
|
|
313
313
|
function ge({
|
|
314
314
|
open: e,
|
|
315
315
|
onOpenChange: t,
|
|
316
316
|
commands: a,
|
|
317
317
|
header: r,
|
|
318
|
-
id:
|
|
318
|
+
id: d
|
|
319
319
|
}) {
|
|
320
|
-
const { t:
|
|
320
|
+
const { t: o } = R("ui"), [l, g] = k(""), [f, E] = k(Y);
|
|
321
321
|
v(() => {
|
|
322
322
|
e || g("");
|
|
323
323
|
}, [e]);
|
|
@@ -339,40 +339,40 @@ function ge({
|
|
|
339
339
|
getIsOpen: () => I.current,
|
|
340
340
|
open: () => b.current(!0),
|
|
341
341
|
close: () => b.current(!1),
|
|
342
|
-
setQuery: (
|
|
342
|
+
setQuery: (s) => g(s)
|
|
343
343
|
}),
|
|
344
344
|
[]
|
|
345
345
|
);
|
|
346
|
-
W(U, H,
|
|
346
|
+
W(U, H, d);
|
|
347
347
|
const F = w(() => {
|
|
348
|
-
const
|
|
348
|
+
const s = /* @__PURE__ */ new Map();
|
|
349
349
|
return a.forEach((c) => {
|
|
350
|
-
const i =
|
|
351
|
-
i.push(c),
|
|
352
|
-
}),
|
|
350
|
+
const i = s.get(c.group) ?? [];
|
|
351
|
+
i.push(c), s.set(c.group, i);
|
|
352
|
+
}), s;
|
|
353
353
|
}, [a]), z = w(() => {
|
|
354
354
|
if (l) return [];
|
|
355
|
-
const
|
|
356
|
-
return f.map((c) =>
|
|
355
|
+
const s = new Map(a.map((c) => [c.id, c]));
|
|
356
|
+
return f.map((c) => s.get(c)).filter(Boolean);
|
|
357
357
|
}, [a, f, l]), P = B(
|
|
358
|
-
(
|
|
358
|
+
(s) => {
|
|
359
359
|
t(!1);
|
|
360
|
-
const c = [
|
|
360
|
+
const c = [s.id, ...f.filter((i) => i !== s.id)].slice(
|
|
361
361
|
0,
|
|
362
362
|
j
|
|
363
363
|
);
|
|
364
|
-
E(c), T(c), setTimeout(() =>
|
|
364
|
+
E(c), T(c), setTimeout(() => s.onSelect(), 0);
|
|
365
365
|
},
|
|
366
366
|
[f, t]
|
|
367
367
|
), Q = B(() => {
|
|
368
368
|
E([]), T([]);
|
|
369
369
|
}, []);
|
|
370
|
-
return /* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ n(h.Root, { open: e, onOpenChange: t, children: /* @__PURE__ */ m(h.Portal, { children: [
|
|
371
|
+
/* @__PURE__ */ n(
|
|
372
372
|
h.Overlay,
|
|
373
373
|
{
|
|
374
374
|
"data-component": "command-palette-overlay",
|
|
375
|
-
className:
|
|
375
|
+
className: se
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
378
|
/* @__PURE__ */ m(
|
|
@@ -380,49 +380,49 @@ function ge({
|
|
|
380
380
|
{
|
|
381
381
|
"data-component": "command-palette-dialog",
|
|
382
382
|
className: re,
|
|
383
|
-
"aria-label":
|
|
383
|
+
"aria-label": o("navigation.cmdk.title", "Command palette"),
|
|
384
384
|
children: [
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ n(h.Title, { asChild: !0, children: /* @__PURE__ */ n(q, { children: o("navigation.cmdk.title", "Command palette") }) }),
|
|
386
|
+
/* @__PURE__ */ n(h.Description, { asChild: !0, children: /* @__PURE__ */ n(q, { children: o(
|
|
387
387
|
"navigation.cmdk.description",
|
|
388
388
|
"Search for commands, pages, and actions"
|
|
389
389
|
) }) }),
|
|
390
390
|
/* @__PURE__ */ m(
|
|
391
391
|
M,
|
|
392
392
|
{
|
|
393
|
-
id:
|
|
394
|
-
label:
|
|
393
|
+
id: d,
|
|
394
|
+
label: o("navigation.cmdk.title", "Command palette"),
|
|
395
395
|
children: [
|
|
396
396
|
r,
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */ m(A, { children: [
|
|
399
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ n(O, { value: l, onValueChange: g }),
|
|
398
|
+
/* @__PURE__ */ m(A, { label: o("navigation.cmdk.title", "Command palette"), children: [
|
|
399
|
+
/* @__PURE__ */ n(D, {}),
|
|
400
400
|
z.length > 0 ? /* @__PURE__ */ m(K, { children: [
|
|
401
401
|
/* @__PURE__ */ m(
|
|
402
402
|
N,
|
|
403
403
|
{
|
|
404
|
-
heading:
|
|
404
|
+
heading: o("navigation.cmdk.recents", "Recent"),
|
|
405
405
|
children: [
|
|
406
|
-
z.map((
|
|
406
|
+
z.map((s) => /* @__PURE__ */ m(
|
|
407
407
|
x,
|
|
408
408
|
{
|
|
409
|
-
value: `recent-${
|
|
410
|
-
"data-command-id":
|
|
411
|
-
onSelect: () => P(
|
|
409
|
+
value: `recent-${s.label}`,
|
|
410
|
+
"data-command-id": s.id,
|
|
411
|
+
onSelect: () => P(s),
|
|
412
412
|
children: [
|
|
413
|
-
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
|
|
413
|
+
s.icon ? /* @__PURE__ */ n("span", { "aria-hidden": "true", children: s.icon }) : null,
|
|
414
|
+
/* @__PURE__ */ n("span", { children: s.label }),
|
|
415
|
+
s.shortcut ? /* @__PURE__ */ n(S, { children: s.shortcut }) : null
|
|
416
416
|
]
|
|
417
417
|
},
|
|
418
|
-
`recent-${
|
|
418
|
+
`recent-${s.id}`
|
|
419
419
|
)),
|
|
420
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ n(
|
|
421
421
|
x,
|
|
422
422
|
{
|
|
423
423
|
value: "__clear-recents",
|
|
424
424
|
onSelect: Q,
|
|
425
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ n("span", { children: o(
|
|
426
426
|
"navigation.cmdk.clearRecents",
|
|
427
427
|
"Clear recent commands"
|
|
428
428
|
) })
|
|
@@ -431,9 +431,9 @@ function ge({
|
|
|
431
431
|
]
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ n(G, {})
|
|
435
435
|
] }) : null,
|
|
436
|
-
Array.from(F.entries()).map(([
|
|
436
|
+
Array.from(F.entries()).map(([s, c]) => /* @__PURE__ */ n(N, { heading: s, children: c.map((i) => /* @__PURE__ */ m(
|
|
437
437
|
x,
|
|
438
438
|
{
|
|
439
439
|
value: i.label,
|
|
@@ -441,13 +441,13 @@ function ge({
|
|
|
441
441
|
keywords: i.keywords,
|
|
442
442
|
onSelect: () => P(i),
|
|
443
443
|
children: [
|
|
444
|
-
i.icon ? /* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
i.shortcut ? /* @__PURE__ */
|
|
444
|
+
i.icon ? /* @__PURE__ */ n("span", { "aria-hidden": "true", children: i.icon }) : null,
|
|
445
|
+
/* @__PURE__ */ n("span", { children: ne(i.label, l) }),
|
|
446
|
+
i.shortcut ? /* @__PURE__ */ n(S, { children: i.shortcut }) : null
|
|
447
447
|
]
|
|
448
448
|
},
|
|
449
449
|
i.id
|
|
450
|
-
)) },
|
|
450
|
+
)) }, s))
|
|
451
451
|
] })
|
|
452
452
|
]
|
|
453
453
|
}
|
|
@@ -469,7 +469,7 @@ export {
|
|
|
469
469
|
S as h,
|
|
470
470
|
U as i,
|
|
471
471
|
X as j,
|
|
472
|
-
|
|
472
|
+
ne as k,
|
|
473
473
|
pe as u
|
|
474
474
|
};
|
|
475
|
-
//# sourceMappingURL=command-palette-
|
|
475
|
+
//# sourceMappingURL=command-palette-B3dVqm9D.js.map
|