@xploreu/components 0.4.23 → 0.4.25

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.
Files changed (65) hide show
  1. package/dist/chunk-3733D5Y7.js +2 -0
  2. package/dist/chunk-3733D5Y7.js.map +1 -0
  3. package/dist/chunk-7P4PFMCM.js +2 -0
  4. package/dist/chunk-7P4PFMCM.js.map +1 -0
  5. package/dist/chunk-BES6JPWQ.js +2 -0
  6. package/dist/chunk-BES6JPWQ.js.map +1 -0
  7. package/dist/{chunk-GI2M7Q4F.js → chunk-DFAATW5A.js} +2 -2
  8. package/dist/{chunk-GI2M7Q4F.js.map → chunk-DFAATW5A.js.map} +1 -1
  9. package/dist/chunk-EO656DPM.js +2 -0
  10. package/dist/chunk-EO656DPM.js.map +1 -0
  11. package/dist/{chunk-3Q6I6MHN.js → chunk-H2BHLGW2.js} +2 -2
  12. package/dist/{chunk-3Q6I6MHN.js.map → chunk-H2BHLGW2.js.map} +1 -1
  13. package/dist/chunk-O2V2JJ2V.js +2 -0
  14. package/dist/chunk-O2V2JJ2V.js.map +1 -0
  15. package/dist/chunk-PHP3T7ZS.js +2 -0
  16. package/dist/chunk-PHP3T7ZS.js.map +1 -0
  17. package/dist/{chunk-22HCPCIZ.js → chunk-QUSWZDB5.js} +2 -2
  18. package/dist/{chunk-22HCPCIZ.js.map → chunk-QUSWZDB5.js.map} +1 -1
  19. package/dist/chunk-RH7BQGTL.js +2 -0
  20. package/dist/chunk-RH7BQGTL.js.map +1 -0
  21. package/dist/{chunk-U3IMR5VI.js → chunk-TZ44HGOL.js} +2 -2
  22. package/dist/{chunk-U3IMR5VI.js.map → chunk-TZ44HGOL.js.map} +1 -1
  23. package/dist/chunk-VNLYQL75.js +2 -0
  24. package/dist/chunk-VNLYQL75.js.map +1 -0
  25. package/dist/{chunk-IF2CKGBN.js → chunk-W6CEQOB6.js} +2 -2
  26. package/dist/{chunk-IF2CKGBN.js.map → chunk-W6CEQOB6.js.map} +1 -1
  27. package/dist/{chunk-GUQAFHTY.js → chunk-W7BBHGMN.js} +2 -2
  28. package/dist/{chunk-GUQAFHTY.js.map → chunk-W7BBHGMN.js.map} +1 -1
  29. package/dist/chunk-W7E2VPJN.js +2 -0
  30. package/dist/chunk-W7E2VPJN.js.map +1 -0
  31. package/dist/composites/combobox-chip-outside.js +1 -1
  32. package/dist/composites/combobox-chip.d.ts +7 -6
  33. package/dist/composites/combobox-chip.js +1 -1
  34. package/dist/composites/combobox-simple.js +1 -1
  35. package/dist/composites/filter-combobox.js +1 -1
  36. package/dist/composites/index.js +1 -1
  37. package/dist/composites/phone-input.js +1 -1
  38. package/dist/composites/profile-avatar.js +1 -1
  39. package/dist/primitives/combobox.js +1 -1
  40. package/dist/primitives/index.d.ts +17 -1
  41. package/dist/primitives/index.js +1 -1
  42. package/dist/ui/avatar.js +1 -1
  43. package/dist/ui/combobox.js +1 -1
  44. package/dist/ui/dialog.d.ts +1 -1
  45. package/dist/ui/dialog.js +1 -1
  46. package/dist/ui/index.d.ts +15 -1
  47. package/dist/ui/index.js +1 -1
  48. package/dist/ui/pagination.js +1 -1
  49. package/dist/ui/table.d.ts +6 -3
  50. package/dist/ui/table.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/chunk-2AOIAHWJ.js +0 -2
  53. package/dist/chunk-2AOIAHWJ.js.map +0 -1
  54. package/dist/chunk-6RI2ROVI.js +0 -2
  55. package/dist/chunk-6RI2ROVI.js.map +0 -1
  56. package/dist/chunk-AA2XSKFM.js +0 -2
  57. package/dist/chunk-AA2XSKFM.js.map +0 -1
  58. package/dist/chunk-CQEBQK7U.js +0 -2
  59. package/dist/chunk-CQEBQK7U.js.map +0 -1
  60. package/dist/chunk-DUSAF7E7.js +0 -2
  61. package/dist/chunk-DUSAF7E7.js.map +0 -1
  62. package/dist/chunk-JONVMB6C.js +0 -2
  63. package/dist/chunk-JONVMB6C.js.map +0 -1
  64. package/dist/chunk-ZNZVX4PT.js +0 -2
  65. package/dist/chunk-ZNZVX4PT.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/combobox.tsx"],"names":["ComboboxProvider","useCombobox","getStrictContext","ComboboxActiveValueProvider","useComboboxActiveValue","Combobox","behavior","props","open","setOpen","useControlledState","inputValue","setInputValue","highlightedValue","setHighlightedValue","handleInputValueChange","eventDetails","handleOpenChange","dataSet","jsx","ComboboxPrimitive","ComboboxTrigger","ComboboxLabel","ComboboxInputGroup","ComboboxInput","ComboboxIcon","ComboboxClear","ComboboxValue","ComboboxChips","ComboboxChip","ComboboxChipRemove","ComboboxPortal","AnimatePresence","ComboboxPositioner","ComboboxPopup","initialFocus","finalFocus","transition","motion","ComboboxBackdrop","ComboboxStatus","ComboboxEmpty","ComboboxList","ComboboxHighlight","Highlight","ComboboxHighlightItem","HighlightItem","ComboboxRow","ComboboxItem","hasInteractedRef","highlightedRef","useDataState","value","el","v","handlePointerEnter","e","handlePointerMove","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow"],"mappings":"gYAiCA,IAAM,CAACA,EAAkBC,CAAW,CAAA,CAClCC,gBAAAA,CAAsC,iBAAiB,CAAA,CAEnD,CAACC,EAA6BC,CAAsB,CAAA,CACxDF,iBAAiD,4BAA4B,EAM/E,SAASG,CAAAA,CAA8D,CACrE,QAAA,CAAAC,CAAAA,CAAW,SAAA,CACX,GAAGC,CACL,CAAA,CAAmC,CACjC,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,aAAcA,CAAAA,EAAO,WAAA,CACrB,SAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAEK,CAACI,CAAAA,CAAYC,CAAa,CAAA,CAAIF,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,CAAAA,EAAO,YAAY,QAAA,EAAS,CACnC,aAAcA,CAAAA,EAAO,iBAA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A/C,CAAAA,CAAM,gBAAgBiD,CAAC,EACzB,CAAA,CAEA,OAAOrC,GAAAA,CAACC,QAAAA,CAAkB,KAAlB,CACN,GAAA,CAAK8B,EACL,WAAA,CAAU,eAAA,CACT,GAAG3C,CAAAA,CACJ,cAAA,CAAgBgD,CAAAA,CAChB,aAAA,CAAeE,CAAAA,CACjB,CACF,CAIA,SAASC,EAAAA,CAAsBnD,EAAmC,CAChE,OAAOY,IAACC,QAAAA,CAAkB,aAAA,CAAlB,CACN,WAAA,CAAU,yBAAA,CACT,GAAGb,EACN,CACF,CAIA,SAASoD,EAAAA,CAAkBpD,CAAAA,CAA+B,CACxD,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,SAAA,CAAlB,CACN,WAAA,CAAU,qBACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASqD,GAAcrD,CAAAA,CAA2B,CAChD,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,KAAA,CAAlB,CACN,WAAA,CAAU,gBAAA,CACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASsD,EAAAA,CAAmBtD,CAAAA,CAAgC,CAC1D,OAAOY,GAAAA,CAACC,SAAkB,UAAA,CAAlB,CACN,YAAU,sBAAA,CACT,GAAGb,EACN,CACF,CAIA,SAASuD,EAAAA,CAAmBvD,CAAAA,CAAgC,CAC1D,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,WAAlB,CACN,WAAA,CAAU,sBACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASwD,EAAAA,CAAcxD,EAA2B,CAChD,OAAOY,IAACC,QAAAA,CAAkB,KAAA,CAAlB,CACN,WAAA,CAAU,gBAAA,CACT,GAAGb,CAAAA,CACN,CACF","file":"chunk-ZNZVX4PT.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n AnimatePresence,\r\n type HTMLMotionProps,\r\n motion\r\n} from \"motion/react\"\r\n\r\nimport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n} from \"../effects/highlight\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { useDataState } from \"@xploreu/hooks/use-data-state\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype ComboboxContextType = {\r\n open: boolean;\r\n setOpen: (open: boolean, eventDetails: ComboboxPrimitive.Root.ChangeEventDetails) => void;\r\n inputValue: string;\r\n setInputValue: (inputValue: string, eventDetails: ComboboxPrimitive.Root.ChangeEventDetails) => void;\r\n}\r\n\r\ntype ComboboxActiveValueContextType = {\r\n highlightedValue: string | null;\r\n setHighlightedValue: (value: string | null) => void;\r\n}\r\n\r\nconst [ComboboxProvider, useCombobox] =\r\n getStrictContext<ComboboxContextType>(\"ComboboxContext\")\r\n\r\nconst [ComboboxActiveValueProvider, useComboboxActiveValue] =\r\n getStrictContext<ComboboxActiveValueContextType>(\"ComboboxActiveValueContext\")\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<Value, Multiple> & {\r\n behavior?: \"default\" | \"chip-outside\";\r\n}\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>({\r\n behavior = \"default\",\r\n ...props\r\n}: ComboboxProps<Value, Multiple>) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n })\r\n\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [highlightedValue, setHighlightedValue] = React.useState<string | null>(null)\r\n\r\n React.useEffect(() => {\r\n if (open) {\r\n setHighlightedValue(null)\r\n }\r\n }, [open])\r\n\r\n const handleInputValueChange: ComboboxProps<Value, Multiple>[\"onInputValueChange\"] = (inputValue, eventDetails) => {\r\n // if the input is cleared, we want to cancel the event to prevent resetting the input value.\r\n if (eventDetails.reason === \"input-clear\") return eventDetails.cancel()\r\n\r\n setInputValue(inputValue, eventDetails)\r\n }\r\n\r\n const handleOpenChange: ComboboxProps<Value, Multiple>[\"onOpenChange\"] = (open, eventDetails) => {\r\n const dataSet = (eventDetails.trigger as HTMLElement)?.dataset\r\n\r\n if (behavior === \"chip-outside\") {\r\n if (\r\n eventDetails.reason === \"trigger-press\" &&\r\n dataSet?.slot === \"combobox-clear-input\" &&\r\n !open\r\n ) {\r\n return eventDetails.cancel()\r\n }\r\n\r\n if (eventDetails.reason === \"item-press\") {\r\n return eventDetails.cancel()\r\n }\r\n }\r\n\r\n setOpen(open, eventDetails)\r\n }\r\n\r\n return (\r\n <ComboboxActiveValueProvider value={{ highlightedValue, setHighlightedValue }}>\r\n <ComboboxProvider value={{ open, setOpen, inputValue, setInputValue }}>\r\n <ComboboxPrimitive.Root\r\n data-slot=\"combobox\"\r\n {...props}\r\n onInputValueChange={handleInputValueChange}\r\n onOpenChange={handleOpenChange}\r\n />\r\n </ComboboxProvider>\r\n </ComboboxActiveValueProvider>\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n return <ComboboxPrimitive.Trigger\r\n data-slot=\"combobox-trigger\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxPrimitive.Label.Props\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n return <ComboboxPrimitive.Label\r\n data-slot=\"combobox-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n return <ComboboxPrimitive.InputGroup\r\n data-slot=\"combobox-input-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxPrimitive.Input.Props\r\n\r\nfunction ComboboxInput(props: ComboboxInputProps) {\r\n return <ComboboxPrimitive.Input\r\n data-slot=\"combobox-input\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxPrimitive.Icon.Props\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n return <ComboboxPrimitive.Icon\r\n data-slot=\"combobox-icon\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxPrimitive.Clear.Props\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n return <ComboboxPrimitive.Clear\r\n data-slot=\"combobox-clear\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxPrimitive.Value.Props\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxPrimitive.Value\r\n data-slot=\"combobox-value\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxPrimitive.Chips.Props\r\n\r\nfunction ComboboxChips(props: ComboboxChipsProps) {\r\n return <ComboboxPrimitive.Chips\r\n data-slot=\"combobox-chips\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxPrimitive.Chip.Props\r\n\r\nfunction ComboboxChip(props: ComboboxChipProps) {\r\n return <ComboboxPrimitive.Chip\r\n data-slot=\"combobox-chip\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxPrimitive.ChipRemove.Props\r\n\r\nfunction ComboboxChipRemove(props: ComboboxChipRemoveProps) {\r\n return <ComboboxPrimitive.ChipRemove\r\n data-slot=\"combobox-chip-remove\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxPortalProps = Omit<\r\n ComboboxPrimitive.Portal.Props,\r\n \"keepMounted\"\r\n>\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n const { open } = useCombobox()\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <ComboboxPrimitive.Portal\r\n data-slot=\"combobox-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return (\r\n <ComboboxPrimitive.Positioner\r\n data-slot=\"combobox-positioner\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = Omit<\r\n ComboboxPrimitive.Popup.Props,\r\n \"render\"\r\n> &\r\n HTMLMotionProps<\"div\">\r\n\r\nfunction ComboboxPopup({\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: \"spring\", stiffness: 300, damping: 25 },\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPrimitive.Popup\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n render={\r\n <motion.div\r\n key=\"combobox-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n data-slot=\"combobox-popup\"\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxPrimitive.Backdrop.Props\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n return <ComboboxPrimitive.Backdrop\r\n data-slot=\"combobox-backdrop\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxPrimitive.Status.Props\r\n\r\nfunction ComboboxStatus(props: ComboboxStatusProps) {\r\n return <ComboboxPrimitive.Status\r\n data-slot=\"combobox-status\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\r\n\r\nfunction ComboboxEmpty(props: ComboboxEmptyProps) {\r\n return <ComboboxPrimitive.Empty\r\n data-slot=\"combobox-empty\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxPrimitive.List.Props\r\n\r\nfunction ComboboxList(props: ComboboxListProps) {\r\n return <ComboboxPrimitive.List\r\n data-slot=\"combobox-list\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxHighlightProps = Omit<\r\n HighlightProps,\r\n \"controlledItems\" | \"enabled\" | \"hover\"\r\n>\r\n\r\nfunction ComboboxHighlight({\r\n transition = { type: 'spring', stiffness: 350, damping: 35 },\r\n ...props\r\n}: ComboboxHighlightProps) {\r\n const { highlightedValue } = useComboboxActiveValue();\r\n\r\n return (\r\n <Highlight\r\n data-slot=\"combobox-highlight\"\r\n click={false}\r\n controlledItems\r\n transition={transition}\r\n value={highlightedValue}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype ComboboxHighlightItemProps = HighlightItemProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return (\r\n <HighlightItem\r\n data-slot=\"combobox-highlight-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxPrimitive.Row.Props\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n return <ComboboxPrimitive.Row\r\n data-slot=\"combobox-row\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxPrimitive.Item.Props\r\n\r\nfunction ComboboxItem(props: ComboboxItemProps) {\r\n const { open } = useCombobox()\r\n const { setHighlightedValue } = useComboboxActiveValue()\r\n const hasInteractedRef = React.useRef(false)\r\n\r\n React.useEffect(() => {\r\n if (!open) {\r\n hasInteractedRef.current = false\r\n }\r\n }, [open])\r\n\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value) => {\r\n if (value === true && hasInteractedRef.current) {\r\n const el = highlightedRef.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n },\r\n )\r\n\r\n const handlePointerEnter: ComboboxItemProps[\"onPointerEnter\"] = (e) => {\r\n hasInteractedRef.current = true\r\n const el = highlightedRef.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n props.onPointerEnter?.(e)\r\n }\r\n\r\n const handlePointerMove: ComboboxItemProps[\"onPointerMove\"] = (e) => {\r\n if (!hasInteractedRef.current) {\r\n hasInteractedRef.current = true\r\n const el = highlightedRef.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n props.onPointerMove?.(e)\r\n }\r\n\r\n return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\r\n onPointerEnter={handlePointerEnter}\r\n onPointerMove={handlePointerMove}\r\n />\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return <ComboboxPrimitive.ItemIndicator\r\n data-slot=\"combobox-item-indicator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n return <ComboboxPrimitive.Separator\r\n data-slot=\"combobox-separator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxPrimitive.Group.Props\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n return <ComboboxPrimitive.Group\r\n data-slot=\"combobox-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n return <ComboboxPrimitive.GroupLabel\r\n data-slot=\"combobox-group-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxPrimitive.Collection\r\n data-slot=\"combobox-collection\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxPrimitive.Arrow.Props\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n return <ComboboxPrimitive.Arrow\r\n data-slot=\"combobox-arrow\"\r\n {...props}\r\n />\r\n}\r\n\r\nexport {\r\n Combobox,\r\n type ComboboxActiveValueContextType,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n type ComboboxContextType,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInput,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps,\r\n useCombobox,\r\n useComboboxActiveValue,\r\n}"]}