{"version":3,"file":"combobox-input.cjs","sources":["../../../components/combobox/combobox-input.tsx"],"sourcesContent":["'use client';\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react';\nimport { type ComponentProps } from 'react';\nimport { ChevronDownIcon } from '~/icons';\nimport { Input } from '../input';\nimport { useComboboxContext } from './combobox-root';\n\nexport interface ComboboxInputProps\n  extends Omit<\n    ComponentProps<typeof Input>,\n    'trailingIcon' | 'suffix' | 'chips' | 'maxChipsVisible'\n  > {}\n\nexport const ComboboxInput = ({ ref, ...props }: ComboboxInputProps) => {\n  const { multiple, inputContainerRef, value, onValueChange } =\n    useComboboxContext();\n  return (\n    <ComboboxPrimitive.Input\n      ref={ref}\n      render={\n        <Input\n          containerRef={inputContainerRef}\n          chips={\n            multiple && Array.isArray(value)\n              ? value.map(val => ({\n                  label: val,\n                  onRemove: () =>\n                    onValueChange?.((value as string[])?.filter(v => v !== val))\n                }))\n              : undefined\n          }\n          trailingIcon={<ChevronDownIcon />}\n          data-slot='combobox-input'\n          {...props}\n        />\n      }\n    />\n  );\n};\nComboboxInput.displayName = 'Combobox.Input';\n"],"names":[],"mappings":";;;;;;;;;;AAcO;AACL;AAEA;;AASgB;AACA;AAED;AACH;AASd;AACA;;"}