@xploreu/components 0.4.16 → 0.4.18

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 (71) hide show
  1. package/dist/chunk-2RHSXF3X.js +2 -0
  2. package/dist/chunk-2RHSXF3X.js.map +1 -0
  3. package/dist/chunk-3C5RPQNM.js +2 -0
  4. package/dist/chunk-3C5RPQNM.js.map +1 -0
  5. package/dist/{chunk-RVQZK2AK.js → chunk-BSWTMWP5.js} +2 -2
  6. package/dist/{chunk-RVQZK2AK.js.map → chunk-BSWTMWP5.js.map} +1 -1
  7. package/dist/{chunk-FE2732UW.js → chunk-C7KUNTTO.js} +2 -2
  8. package/dist/{chunk-FE2732UW.js.map → chunk-C7KUNTTO.js.map} +1 -1
  9. package/dist/chunk-DX767LBV.js +2 -0
  10. package/dist/chunk-DX767LBV.js.map +1 -0
  11. package/dist/{chunk-R4WEEB5H.js → chunk-F2QUDOBO.js} +2 -2
  12. package/dist/{chunk-R4WEEB5H.js.map → chunk-F2QUDOBO.js.map} +1 -1
  13. package/dist/chunk-GNQKITNA.js +2 -0
  14. package/dist/chunk-GNQKITNA.js.map +1 -0
  15. package/dist/{chunk-ZWZMXZGN.js → chunk-IIFWJ2BW.js} +2 -2
  16. package/dist/{chunk-ZWZMXZGN.js.map → chunk-IIFWJ2BW.js.map} +1 -1
  17. package/dist/{chunk-YZNI5HEX.js → chunk-J6CW2XBL.js} +2 -2
  18. package/dist/{chunk-YZNI5HEX.js.map → chunk-J6CW2XBL.js.map} +1 -1
  19. package/dist/chunk-L2QE2YOM.js +2 -0
  20. package/dist/{chunk-5YDJTHDG.js.map → chunk-L2QE2YOM.js.map} +1 -1
  21. package/dist/{chunk-KYVYO45Y.js → chunk-LTSUNU7E.js} +2 -2
  22. package/dist/{chunk-KYVYO45Y.js.map → chunk-LTSUNU7E.js.map} +1 -1
  23. package/dist/{chunk-CPRMLK2G.js → chunk-NWX5WD7D.js} +2 -2
  24. package/dist/{chunk-CPRMLK2G.js.map → chunk-NWX5WD7D.js.map} +1 -1
  25. package/dist/chunk-OK4K7DSW.js +2 -0
  26. package/dist/chunk-OK4K7DSW.js.map +1 -0
  27. package/dist/{chunk-Z67QQMOX.js → chunk-VY735IE2.js} +2 -2
  28. package/dist/{chunk-Z67QQMOX.js.map → chunk-VY735IE2.js.map} +1 -1
  29. package/dist/chunk-ZNZVX4PT.js +2 -0
  30. package/dist/chunk-ZNZVX4PT.js.map +1 -0
  31. package/dist/composites/combobox-chip-outside.js +1 -1
  32. package/dist/composites/combobox-chip.js +1 -1
  33. package/dist/composites/combobox-simple.js +1 -1
  34. package/dist/composites/filter-combobox.d.ts +3 -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.d.ts +1 -1
  39. package/dist/primitives/combobox.js +1 -1
  40. package/dist/primitives/dialog.js +1 -1
  41. package/dist/primitives/index.d.ts +1 -1
  42. package/dist/primitives/index.js +1 -1
  43. package/dist/primitives/sheet.js +1 -1
  44. package/dist/primitives/tooltip.d.ts +20 -6
  45. package/dist/primitives/tooltip.js +1 -1
  46. package/dist/ui/badge.d.ts +3 -3
  47. package/dist/ui/button.d.ts +1 -1
  48. package/dist/ui/combobox.js +1 -1
  49. package/dist/ui/dialog.js +1 -1
  50. package/dist/ui/index.d.ts +2 -2
  51. package/dist/ui/index.js +1 -1
  52. package/dist/ui/input.d.ts +1 -1
  53. package/dist/ui/pagination.js +1 -1
  54. package/dist/ui/sheet.js +1 -1
  55. package/dist/ui/table.js +1 -1
  56. package/dist/ui/tooltip.d.ts +8 -10
  57. package/dist/ui/tooltip.js +1 -1
  58. package/package.json +108 -108
  59. package/dist/chunk-5YDJTHDG.js +0 -2
  60. package/dist/chunk-COJ4DWGS.js +0 -2
  61. package/dist/chunk-COJ4DWGS.js.map +0 -1
  62. package/dist/chunk-EL7P7FN5.js +0 -2
  63. package/dist/chunk-EL7P7FN5.js.map +0 -1
  64. package/dist/chunk-JILBFCPY.js +0 -2
  65. package/dist/chunk-JILBFCPY.js.map +0 -1
  66. package/dist/chunk-NBRMYO6B.js +0 -2
  67. package/dist/chunk-NBRMYO6B.js.map +0 -1
  68. package/dist/chunk-P6Y4P5QT.js +0 -2
  69. package/dist/chunk-P6Y4P5QT.js.map +0 -1
  70. package/dist/chunk-VHXY2BUM.js +0 -2
  71. package/dist/chunk-VHXY2BUM.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/combobox.tsx"],"names":["Combobox","props","jsx","ComboboxTrigger","className","rest","cn","ComboboxLabel","ComboboxInputGroup","ComboboxInput","wrapperClassName","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputValue","setInputValue","useCombobox","inputClassName","startContent","restInputProps","jsxs","ComboboxChips","e","XIcon","event","ComboboxValue","value","item","ComboboxChip","ComboboxChipRemove","ComboboxIcon","ComboboxClear","Badge","BadgeButton","ComboboxPopup","align","sideOffset","container","initialFocus","finalFocus","style","children","ComboboxPortal","ComboboxPositioner","ComboboxHighlight","ComboboxBackdrop","ComboboxStatus","status","trimmedInputValue","text","Fragment","Loader2Icon","ComboboxEmpty","ComboboxList","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"2bA6EA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAAA,CAACF,CAAAA,CAAA,CAAmB,GAAGC,CAAAA,CAAO,CAElC,CAIA,SAASE,CAAAA,CAAgBF,CAAAA,CAA6B,CACpD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,O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CAAmBtE,CAAAA,CAAgC,CAC1D,OAAOC,GAAAA,CAACqE,CAAAA,CAAA,CAA6B,GAAGtE,CAAAA,CAAO,CACjD,CAIA,SAASuE,EAAAA,CAAcvE,CAAAA,CAA2B,CAChD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACsE,CAAAA,CAAA,CACN,SAAA,CAAWlE,EAAAA,CAAG,iBAAA,CAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAASoE,EAAAA,CAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,EAAY,EAAA,CACZ,GAAG1E,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAAC0E,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAG1E,CAAAA,CAEH,QAAA,CAAAyE,CAAAA,EACCnD,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,GAAAA,CAACoD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-EL7P7FN5.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input, inputVariants } from \"./input\"\r\nimport { Checkbox } from \"./checkbox\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxInputPrimitiveProps & {\r\n wrapperClassName?: string\r\n}\r\n\r\nfunction ComboboxInput({\r\n className,\r\n wrapperClassName,\r\n ...props\r\n}: ComboboxInputProps) {\r\n\r\n return (\r\n <div className={cn(\"px-3 py-2.5 border-b border-border-primary\", wrapperClassName)}>\r\n <ComboboxInputPrimitive\r\n className={className}\r\n render={<Input size=\"sm\" startContent={<SearchIcon />} />}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxChips\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n className=\"flex-col\"\r\n >\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-1 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxPopup({\r\n className,\r\n align = \"start\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxListPrimitiveProps\r\n\r\nfunction ComboboxList({\r\n className,\r\n ...props\r\n}: ComboboxListProps) {\r\n return (\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col p-1 focus-visible:outline-none\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps & {\r\n indicator?: \"check-circle\" | \"checkbox\"\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n indicator = \"check-circle\",\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover rounded-md\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n data-indicator={indicator}\r\n className={cn(\r\n \"group/combobox-item relative flex w-full cursor-default items-center gap-xp-md my-px p-xp-md [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8 outline-none\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator\r\n className=\"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2\"\r\n keepMounted={indicator === \"checkbox\"}\r\n render={(props, state) => (\r\n <span {...props}>\r\n {indicator === \"check-circle\" && (\r\n <CheckCircle2Icon className=\"size-4 text-fg-brand-primary shrink-0\" />\r\n )}\r\n\r\n {indicator === \"checkbox\" && (\r\n <Checkbox checked={state.selected} />\r\n )}\r\n </span>\r\n )}\r\n />\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemTitleProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemTitle({\r\n className,\r\n ...props\r\n}: ComboboxItemTitleProps) {\r\n return (\r\n <span\r\n className={cn(\r\n \"text-body-medium-3 text-text-primary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemDescriptionProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemDescription({\r\n className,\r\n ...props\r\n}: ComboboxItemDescriptionProps) {\r\n return (\r\n <span\r\n className={cn(\r\n \"text-body-regular-3 text-text-secondary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\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 ComboboxPopup,\r\n type ComboboxPopupProps,\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 ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemTitle,\r\n type ComboboxItemTitleProps,\r\n ComboboxItemDescription,\r\n type ComboboxItemDescriptionProps,\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 type ComboboxLoadingProps,\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}"]}
@@ -1,2 +0,0 @@
1
- import {b,c as c$1}from'./chunk-2XZRLJCN.js';import*as x from'react';import {Combobox}from'@base-ui/react/combobox';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {useDataState}from'@xploreu/hooks/use-data-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var [V,L]=getStrictContext("ComboboxContext"),[H,c]=getStrictContext("ComboboxActiveValueContext");function M({behavior:o="default",...b}){let[p,i]=useControlledState({value:b?.open,defaultValue:b?.defaultOpen,onChange:b?.onOpenChange}),[a,m]=useControlledState({value:b?.inputValue?.toString(),defaultValue:b?.defaultInputValue?.toString(),onChange:b?.onInputValueChange}),[n,h]=x.useState(null),g=(s,r)=>{if(r.reason==="input-clear")return r.cancel();m(s,r);},d=(s,r)=>{let y=r.trigger?.dataset;if(o==="chip-outside"&&(r.reason==="trigger-press"&&y?.slot==="combobox-clear-input"&&!s||r.reason==="item-press"))return r.cancel();i(s,r);};return jsx(H,{value:{highlightedValue:n,setHighlightedValue:h},children:jsx(V,{value:{open:p,setOpen:i,inputValue:a,setInputValue:m},children:jsx(Combobox.Root,{"data-slot":"combobox",...b,onInputValueChange:g,onOpenChange:d})})})}function k(o){return jsx(Combobox.Trigger,{"data-slot":"combobox-trigger",...o})}function E(o){return jsx(Combobox.Label,{"data-slot":"combobox-label",...o})}function O(o){return jsx(Combobox.InputGroup,{"data-slot":"combobox-input-group",...o})}function B(o){return jsx(Combobox.Input,{"data-slot":"combobox-input",...o})}function F(o){return jsx(Combobox.Icon,{"data-slot":"combobox-icon",...o})}function q(o){return jsx(Combobox.Clear,{"data-slot":"combobox-clear",...o})}function z(o){return jsx(Combobox.Value,{"data-slot":"combobox-value",...o})}function J(o){return jsx(Combobox.Chips,{"data-slot":"combobox-chips",...o})}function K(o){return jsx(Combobox.Chip,{"data-slot":"combobox-chip",...o})}function N(o){return jsx(Combobox.ChipRemove,{"data-slot":"combobox-chip-remove",...o})}function Q(o){let{open:b}=L();return jsx(AnimatePresence,{children:b&&jsx(Combobox.Portal,{"data-slot":"combobox-portal",keepMounted:true,...o})})}function U(o){return jsx(Combobox.Positioner,{"data-slot":"combobox-positioner",...o})}function W({initialFocus:o,finalFocus:b,transition:p={type:"spring",stiffness:300,damping:25},...i}){return jsx(Combobox.Popup,{finalFocus:b,initialFocus:o,render:jsx(motion.div,{animate:{opacity:1,scale:1},"data-slot":"combobox-popup",exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:p,...i},"combobox-popup")})}function X(o){return jsx(Combobox.Backdrop,{"data-slot":"combobox-backdrop",...o})}function Y(o){return jsx(Combobox.Status,{"data-slot":"combobox-status",...o})}function Z(o){return jsx(Combobox.Empty,{"data-slot":"combobox-empty",...o})}function _(o){return jsx(Combobox.List,{"data-slot":"combobox-list",...o})}function $({transition:o={type:"spring",stiffness:350,damping:35},...b$1}){let{highlightedValue:p}=c();return jsx(b,{click:false,controlledItems:true,"data-slot":"combobox-highlight",transition:o,value:p,...b$1})}function j(o){return jsx(c$1,{"data-slot":"combobox-highlight-item",...o})}function D(o){return jsx(Combobox.Row,{"data-slot":"combobox-row",...o})}function oo(o){let{setHighlightedValue:b}=c(),[,p]=useDataState("highlighted",void 0,(i,a)=>{if(i===true){let m=a.current,n=m?.dataset.value||m?.id||null;n&&b(n);}});return jsx(Combobox.Item,{ref:p,"data-slot":"combobox-item",...o})}function to(o){return jsx(Combobox.ItemIndicator,{"data-slot":"combobox-item-indicator",...o})}function eo(o){return jsx(Combobox.Separator,{"data-slot":"combobox-separator",...o})}function bo(o){return jsx(Combobox.Group,{"data-slot":"combobox-group",...o})}function ro(o){return jsx(Combobox.GroupLabel,{"data-slot":"combobox-group-label",...o})}function po(o){return jsx(Combobox.Collection,{"data-slot":"combobox-collection",...o})}function io(o){return jsx(Combobox.Arrow,{"data-slot":"combobox-arrow",...o})}export{bo as A,ro as B,po as C,io as D,L as a,c as b,M as c,k as d,E as e,O as f,B as g,F as h,q as i,z as j,J as k,K as l,N as m,Q as n,U as o,W as p,X as q,Y as r,Z as s,_ as t,$ as u,j as v,D as w,oo as x,to as y,eo as z};//# sourceMappingURL=chunk-JILBFCPY.js.map
2
- //# sourceMappingURL=chunk-JILBFCPY.js.map
@@ -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","highlightedRef","useDataState","value","ref","el","v","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow"],"mappings":"uYAiCA,IAAM,CAACA,CAAAA,CAAkBC,CAAW,EAClCC,gBAAAA,CAAsC,iBAAiB,EAEnD,CAACC,CAAAA,CAA6BC,CAAsB,CAAA,CACxDF,gBAAAA,CAAiD,4BAA4B,EAM/E,SAASG,CAAAA,CAA8D,CACrE,SAAAC,CAAAA,CAAW,SAAA,CACX,GAAGC,CACL,CAAA,CAAmC,CACjC,GAAM,CAACC,EAAMC,CAAO,CAAA,CAAIC,mBAAmB,CACzC,KAAA,CAAOH,GAAO,IAAA,CACd,YAAA,CAAcA,GAAO,WAAA,CACrB,QAAA,CAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAEK,CAACI,EAAYC,CAAa,CAAA,CAAIF,mBAAmB,CACrD,KAAA,CAAOH,GAAO,UAAA,EAAY,QAAA,GAC1B,YAAA,CAAcA,CAAAA,EAAO,mBAAmB,QAAA,EAAS,CACjD,SAAUA,CAAAA,EAAO,k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,EAAM,IAAA,CACrCC,GAAGxC,CAAAA,CAAoBwC,CAAC,EAC9B,CACF,CACF,EAEA,OAAOnC,GAAAA,CAACC,SAAkB,IAAA,CAAlB,CACN,IAAK6B,CAAAA,CACL,WAAA,CAAU,gBACT,GAAG1C,CAAAA,CACN,CACF,CAIA,SAASgD,EAAAA,CAAsBhD,CAAAA,CAAmC,CAChE,OAAOY,GAAAA,CAACC,SAAkB,aAAA,CAAlB,CACN,YAAU,yBAAA,CACT,GAAGb,EACN,CACF,CAIA,SAASiD,EAAAA,CAAkBjD,CAAAA,CAA+B,CACxD,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,SAAA,CAAlB,CACN,WAAA,CAAU,oBAAA,CACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASkD,EAAAA,CAAclD,EAA2B,CAChD,OAAOY,IAACC,QAAAA,CAAkB,KAAA,CAAlB,CACN,WAAA,CAAU,gBAAA,CACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASmD,GAAmBnD,CAAAA,CAAgC,CAC1D,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,WAAlB,CACN,WAAA,CAAU,uBACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASoD,GAAmBpD,CAAAA,CAAgC,CAC1D,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,UAAA,CAAlB,CACN,YAAU,qBAAA,CACT,GAAGb,EACN,CACF,CAIA,SAASqD,EAAAA,CAAcrD,CAAAA,CAA2B,CAChD,OAAOY,GAAAA,CAACC,SAAkB,KAAA,CAAlB,CACN,YAAU,gBAAA,CACT,GAAGb,EACN,CACF","file":"chunk-JILBFCPY.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 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\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 click={false}\r\n controlledItems\r\n data-slot=\"combobox-highlight\"\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 { setHighlightedValue } = useComboboxActiveValue()\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value, ref) => {\r\n if (value === true) {\r\n const el = ref.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 return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\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}"]}
@@ -1,2 +0,0 @@
1
- import {a,b,c,d,e}from'./chunk-COJ4DWGS.js';import {a as a$3}from'./chunk-5ETIHFSE.js';import {a as a$2}from'./chunk-XJTOYNCA.js';import {a as a$1}from'./chunk-UCCQUPMT.js';import'react';import {InfoIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function A({className:t,...o}){return jsx("div",{className:"relative w-full overflow-x-auto rounded-xl border border-border-primary bg-bg-primary","data-slot":"table-container",children:jsx("table",{className:cn("w-full caption-bottom text-body-regular-2",t),"data-slot":"table",...o})})}function j({className:t,...o}){return jsx("thead",{className:cn("bg-bg-secondary [&_tr]:border-border-tertiary",t),"data-slot":"table-header",...o})}function q({className:t,...o}){return jsx("tbody",{className:cn("[&_tr:last-child]:border-0",t),"data-slot":"table-body",...o})}function B({className:t,...o}){return jsx("tfoot",{className:cn("border-t border-border-primary bg-bg-secondary font-medium [&>tr]:last:border-b-0",t),"data-slot":"table-footer",...o})}function D({className:t,...o}){return jsx("tr",{className:cn("border-b border-border-secondary transition-colors hover:bg-bg-secondary data-[state=selected]:bg-bg-brand-primary/40",t),"data-slot":"table-row",...o})}function O({className:t,align:o,variant:c$1="string",tooltip:n,sortable:a$4,sortDirection:p,onSort:b$1,children:C,...R}){let s=o||(c$1==="number"?"end":"start"),i=!!(n||a$4),w=s==="end",m=n?jsxs(a,{children:[jsx(b,{render:jsx("button",{type:"button",className:"inline-flex items-center justify-center text-fg-quaternary hover:text-text-primary"}),children:jsx(InfoIcon,{className:"size-3.5"})}),jsx(c,{children:jsx(d,{side:"top",children:jsx(e,{children:n})})})]}):null,u=a$4?jsx("button",{type:"button",onClick:b$1,className:"inline-flex items-center text-fg-quaternary hover:text-text-primary focus:outline-none","aria-label":"Sort column",children:p==="asc"?jsx(a$1,{size:12}):p==="desc"?jsx(a$2,{size:12}):jsx(a$3,{size:12})}):null,d$1=jsx("span",{className:cn("truncate",a$4&&"cursor-pointer select-none"),onClick:a$4?b$1:void 0,children:C});return jsx("th",{className:cn("text-label-bold-3 text-text-tertiary h-10 px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",!i&&s==="end"&&"text-right",!i&&s==="start"&&"text-left",!i&&s==="center"&&"text-center",t),"data-slot":"table-head",...R,children:i?jsx("div",{className:"flex w-full items-center justify-between gap-2",children:w?jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m,u]}),jsx("div",{className:"flex items-center shrink-0 justify-end",children:d$1})]}):jsxs(Fragment,{children:[d$1,jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m,u]})]})}):d$1})}function _({className:t,align:o,variant:c="string",...n}){let a=o||(c==="number"?"end":"start");return jsx("td",{className:cn("text-text-primary px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a==="end"&&"text-right",a==="start"&&"text-left",a==="center"&&"text-center",t),"data-slot":"table-cell",...n})}function F({className:t,...o}){return jsx("caption",{className:cn("text-text-secondary mt-4 text-body-regular-2",t),"data-slot":"table-caption",...o})}export{A as a,j as b,q as c,B as d,D as e,O as f,_ as g,F as h};//# sourceMappingURL=chunk-NBRMYO6B.js.map
2
- //# sourceMappingURL=chunk-NBRMYO6B.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/table.tsx"],"names":["Table","className","props","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","align","variant","tooltip","sortable","sortDirection","onSort","children","effectiveAlign","hasControls","isEnd","tooltipElement","jsxs","Tooltip","TooltipTrigger","InfoIcon","TooltipPortal","TooltipPositioner","TooltipPopup","sortElement","sort_ascending_icon_default","sort_descending_icon_default","sort_default_icon_default","titleElement","Fragment","TableCell","TableCaption"],"mappings":"kTAaA,SAASA,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,EAAkC,CACrE,OACEC,IAAC,KAAA,CAAA,CACC,SAAA,CAAU,wFACV,WAAA,CAAU,iBAAA,CAEV,QAAA,CAAAA,GAAAA,CAAC,OAAA,CAAA,CACC,SAAA,CAAWC,GAAG,2CAAA,CAA6CH,CAAS,EACpE,WAAA,CAAU,OAAA,CACT,GAAGC,CAAAA,CACN,CAAA,CACF,CAEJ,CAEA,SAASG,CAAAA,CAAY,CAAE,SAAA,CAAAJ,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAkC,CAC3E,OACEC,GAAAA,CAAC,OAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CACT,+CAAA,CACAH,CACF,CAAA,CACA,WAAA,CAAU,eACT,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASI,CAAAA,CAAU,CAAE,SAAA,CAAAL,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAkC,CACzE,OACEC,GAAAA,CAAC,SACC,SAAA,CAAWC,EAAAA,CAAG,4BAAA,CAA8BH,CAAS,CAAA,CACrD,WAAA,CAAU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AAA,CAAC,OAAI,SAAA,CAAU,wCAAA,CACZ,SAAA6B,GAAAA,CACH,CAAA,CAAA,CACF,EAEAX,IAAAA,CAAAY,QAAAA,CAAA,CACG,QAAA,CAAA,CAAAD,GAAAA,CACDX,IAAAA,CAAC,OAAI,SAAA,CAAU,oCAAA,CACZ,UAAAD,CAAAA,CACAQ,CAAAA,CAAAA,CACH,GACF,CAAA,CAEJ,CAAA,CAEAI,GAAAA,CAEJ,CAEJ,CAOA,SAASE,EAAU,CACjB,SAAA,CAAAjC,EACA,KAAA,CAAAS,CAAAA,CACA,QAAAC,CAAAA,CAAU,QAAA,CACV,GAAGT,CACL,CAAA,CAAmB,CACjB,IAAMe,CAAAA,CAAiBP,CAAAA,GAAUC,IAAY,QAAA,CAAW,KAAA,CAAQ,SAEhE,OACER,GAAAA,CAAC,IAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CACT,0FAAA,CACAa,IAAmB,KAAA,EAAS,YAAA,CAC5BA,IAAmB,OAAA,EAAW,WAAA,CAC9BA,IAAmB,QAAA,EAAY,aAAA,CAC/BhB,CACF,CAAA,CACA,WAAA,CAAU,YAAA,CACT,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASiC,CAAAA,CAAa,CACpB,SAAA,CAAAlC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAoC,CAClC,OACEC,GAAAA,CAAC,SAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CAAG,8CAAA,CAAgDH,CAAS,EACvE,WAAA,CAAU,eAAA,CACT,GAAGC,CAAAA,CACN,CAEJ","file":"chunk-NBRMYO6B.js","sourcesContent":["import * as React from \"react\"\r\nimport { InfoIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { SortAscendingIcon, SortDefaultIcon, SortDescendingIcon } from \"../icons\"\r\nimport {\r\n Tooltip,\r\n TooltipPopup,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipTrigger,\r\n} from \"./tooltip\"\r\n\r\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\r\n return (\r\n <div\r\n className=\"relative w-full overflow-x-auto rounded-xl border border-border-primary bg-bg-primary\"\r\n data-slot=\"table-container\"\r\n >\r\n <table\r\n className={cn(\"w-full caption-bottom text-body-regular-2\", className)}\r\n data-slot=\"table\"\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\r\n return (\r\n <thead\r\n className={cn(\r\n \"bg-bg-secondary [&_tr]:border-border-tertiary\",\r\n className\r\n )}\r\n data-slot=\"table-header\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\r\n return (\r\n <tbody\r\n className={cn(\"[&_tr:last-child]:border-0\", className)}\r\n data-slot=\"table-body\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\r\n return (\r\n <tfoot\r\n className={cn(\r\n \"border-t border-border-primary bg-bg-secondary font-medium [&>tr]:last:border-b-0\",\r\n className\r\n )}\r\n data-slot=\"table-footer\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\r\n return (\r\n <tr\r\n className={cn(\r\n \"border-b border-border-secondary transition-colors hover:bg-bg-secondary data-[state=selected]:bg-bg-brand-primary/40\",\r\n className\r\n )}\r\n data-slot=\"table-row\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ninterface TableHeadProps extends Omit<React.ComponentProps<\"th\">, \"align\"> {\r\n align?: \"start\" | \"end\" | \"center\"\r\n variant?: \"string\" | \"number\"\r\n tooltip?: React.ReactNode\r\n sortable?: boolean\r\n sortDirection?: \"asc\" | \"desc\" | false | null\r\n onSort?: () => void\r\n}\r\n\r\nfunction TableHead({\r\n className,\r\n align,\r\n variant = \"string\",\r\n tooltip,\r\n sortable,\r\n sortDirection,\r\n onSort,\r\n children,\r\n ...props\r\n}: TableHeadProps) {\r\n const effectiveAlign = align || (variant === \"number\" ? \"end\" : \"start\")\r\n const hasControls = Boolean(tooltip || sortable)\r\n const isEnd = effectiveAlign === \"end\"\r\n\r\n const tooltipElement = tooltip ? (\r\n <Tooltip>\r\n <TooltipTrigger\r\n render={\r\n <button\r\n type=\"button\"\r\n className=\"inline-flex items-center justify-center text-fg-quaternary hover:text-text-primary\"\r\n />\r\n }\r\n >\r\n <InfoIcon className=\"size-3.5\" />\r\n </TooltipTrigger>\r\n <TooltipPortal>\r\n <TooltipPositioner side=\"top\">\r\n <TooltipPopup>{tooltip}</TooltipPopup>\r\n </TooltipPositioner>\r\n </TooltipPortal>\r\n </Tooltip>\r\n ) : null\r\n\r\n const sortElement = sortable ? (\r\n <button\r\n type=\"button\"\r\n onClick={onSort}\r\n className=\"inline-flex items-center text-fg-quaternary hover:text-text-primary focus:outline-none\"\r\n aria-label=\"Sort column\"\r\n >\r\n {sortDirection === \"asc\" ? (\r\n <SortAscendingIcon size={12} />\r\n ) : sortDirection === \"desc\" ? (\r\n <SortDescendingIcon size={12} />\r\n ) : (\r\n <SortDefaultIcon size={12} />\r\n )}\r\n </button>\r\n ) : null\r\n\r\n const titleElement = (\r\n <span\r\n className={cn(\"truncate\", sortable && \"cursor-pointer select-none\")}\r\n onClick={sortable ? onSort : undefined}\r\n >\r\n {children}\r\n </span>\r\n )\r\n\r\n return (\r\n <th\r\n className={cn(\r\n \"text-label-bold-3 text-text-tertiary h-10 px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\r\n !hasControls && effectiveAlign === \"end\" && \"text-right\",\r\n !hasControls && effectiveAlign === \"start\" && \"text-left\",\r\n !hasControls && effectiveAlign === \"center\" && \"text-center\",\r\n className\r\n )}\r\n data-slot=\"table-head\"\r\n {...props}\r\n >\r\n {hasControls ? (\r\n <div className=\"flex w-full items-center justify-between gap-2\">\r\n {isEnd ? (\r\n <>\r\n <div className=\"flex items-center gap-1.5 shrink-0\">\r\n {tooltipElement}\r\n {sortElement}\r\n </div>\r\n <div className=\"flex items-center shrink-0 justify-end\">\r\n {titleElement}\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n {titleElement}\r\n <div className=\"flex items-center gap-1.5 shrink-0\">\r\n {tooltipElement}\r\n {sortElement}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n ) : (\r\n titleElement\r\n )}\r\n </th>\r\n )\r\n}\r\n\r\ninterface TableCellProps extends Omit<React.ComponentProps<\"td\">, \"align\"> {\r\n align?: \"start\" | \"end\" | \"center\"\r\n variant?: \"string\" | \"number\"\r\n}\r\n\r\nfunction TableCell({\r\n className,\r\n align,\r\n variant = \"string\",\r\n ...props\r\n}: TableCellProps) {\r\n const effectiveAlign = align || (variant === \"number\" ? \"end\" : \"start\")\r\n\r\n return (\r\n <td\r\n className={cn(\r\n \"text-text-primary px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\r\n effectiveAlign === \"end\" && \"text-right\",\r\n effectiveAlign === \"start\" && \"text-left\",\r\n effectiveAlign === \"center\" && \"text-center\",\r\n className\r\n )}\r\n data-slot=\"table-cell\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableCaption({\r\n className,\r\n ...props\r\n}: React.ComponentProps<\"caption\">) {\r\n return (\r\n <caption\r\n className={cn(\"text-text-secondary mt-4 text-body-regular-2\", className)}\r\n data-slot=\"table-caption\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n Table,\r\n TableBody,\r\n TableCaption,\r\n TableCell,\r\n TableFooter,\r\n TableHead,\r\n TableHeader,\r\n TableRow,\r\n type TableCellProps,\r\n type TableHeadProps,\r\n}"]}
@@ -1,2 +0,0 @@
1
- import'react';import {Tooltip}from'@base-ui/react/tooltip';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var[P,a]=getStrictContext("TooltipContext");function f(o){let[i,e]=useControlledState({value:o?.open,defaultValue:o?.defaultOpen,onChange:o?.onOpenChange});return jsx(P,{value:{open:i,setOpen:e},children:jsx(Tooltip.Root,{"data-slot":"tooltip",...o,onOpenChange:e})})}function g(o){return jsx(Tooltip.Trigger,{"data-slot":"tooltip-trigger",...o})}function d(o){let{open:i}=a();return jsx(AnimatePresence,{children:i&&jsx(Tooltip.Portal,{"data-slot":"tooltip-portal",keepMounted:true,...o})})}function C(o){return jsx(Tooltip.Positioner,{"data-slot":"tooltip-positioner",...o})}function v({transition:o={type:"spring",stiffness:300,damping:25},...i}){return jsx(Tooltip.Popup,{"data-slot":"tooltip-popup",render:jsx(motion.div,{animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:o,...i},"tooltip-popup")})}function R(o){return jsx(Tooltip.Arrow,{"data-slot":"tooltip-arrow",...o})}export{f as a,g as b,d as c,C as d,v as e,R as f};//# sourceMappingURL=chunk-P6Y4P5QT.js.map
2
- //# sourceMappingURL=chunk-P6Y4P5QT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/tooltip.tsx"],"names":["TooltipProvider","useTooltip","getStrictContext","Tooltip","props","open","setOpen","useControlledState","jsx","TooltipPrimitive","TooltipTrigger","TooltipPortal","AnimatePresence","TooltipPositioner","TooltipPopup","transition","motion","TooltipArrow"],"mappings":"qRAcA,GAAM,CAACA,EAAiBC,CAAU,CAAA,CAChCC,iBAAqC,gBAAgB,CAAA,CAIvD,SAASC,CAAAA,CAAQC,CAAAA,CAAqB,CACpC,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,aAAcA,CAAAA,EAAO,WAAA,CACrB,QAAA,CAAUA,CAAAA,EAAO,YACnB,CAAC,EAED,OACEI,GAAAA,CAACR,EAAA,CAAg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,OAAA,CAAS,EAAG,KAAA,CAAO,EAAI,EAClC,UAAA,CAAYD,CAAAA,CACX,GAAGX,CAAAA,CAAAA,CALA,eAMN,CAAA,CAEJ,CAEJ,CAIA,SAASa,EAAab,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAACC,OAAAA,CAAiB,KAAA,CAAjB,CAAuB,WAAA,CAAU,eAAA,CAAiB,GAAGL,CAAAA,CAAO,CACtE","file":"chunk-P6Y4P5QT.js","sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\r\nimport { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';\r\n\r\nimport { useControlledState } from '@xploreu/hooks/use-controlled-state';\r\nimport { getStrictContext } from '@xploreu/lib/get-strict-context';\r\n\r\ntype TooltipContextType = {\r\n open: boolean;\r\n setOpen: TooltipProps['onOpenChange'];\r\n};\r\n\r\nconst [TooltipProvider, useTooltip] =\r\n getStrictContext<TooltipContextType>('TooltipContext');\r\n\r\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>;\r\n\r\nfunction Tooltip(props: TooltipProps) {\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 return (\r\n <TooltipProvider value={{ open, setOpen }}>\r\n <TooltipPrimitive.Root\r\n data-slot=\"tooltip\"\r\n {...props}\r\n onOpenChange={setOpen}\r\n />\r\n </TooltipProvider>\r\n );\r\n}\r\n\r\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;\r\n\r\nfunction TooltipTrigger(props: TooltipTriggerProps) {\r\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\r\n}\r\n\r\ntype TooltipPortalProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Portal>,\r\n 'keepMounted'\r\n>;\r\n\r\nfunction TooltipPortal(props: TooltipPortalProps) {\r\n const { open } = useTooltip();\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <TooltipPrimitive.Portal\r\n data-slot=\"tooltip-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n );\r\n}\r\n\r\ntype TooltipPositionerProps = React.ComponentProps<typeof TooltipPrimitive.Positioner>;\r\n\r\nfunction TooltipPositioner(props: TooltipPositionerProps) {\r\n return <TooltipPrimitive.Positioner data-slot=\"tooltip-positioner\" {...props} />;\r\n}\r\n\r\ntype TooltipPopupProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Popup>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'>;\r\n\r\nfunction TooltipPopup({\r\n transition = { type: 'spring', stiffness: 300, damping: 25 },\r\n ...props\r\n}: TooltipPopupProps) {\r\n return (\r\n <TooltipPrimitive.Popup\r\n data-slot=\"tooltip-popup\"\r\n render={\r\n <motion.div\r\n key=\"tooltip-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\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 TooltipArrowProps = React.ComponentProps<typeof TooltipPrimitive.Arrow>;\r\n\r\nfunction TooltipArrow(props: TooltipArrowProps) {\r\n return <TooltipPrimitive.Arrow data-slot=\"tooltip-arrow\" {...props} />;\r\n}\r\n\r\nexport {\r\n Tooltip,\r\n TooltipTrigger,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipPopup,\r\n TooltipArrow,\r\n type TooltipProps,\r\n type TooltipTriggerProps,\r\n type TooltipPortalProps,\r\n type TooltipPositionerProps,\r\n type TooltipPopupProps,\r\n type TooltipArrowProps,\r\n};\r\n"]}
@@ -1,2 +0,0 @@
1
- import {a,b,m,e,q,s,w,x,F}from'./chunk-EL7P7FN5.js';import*as r from'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function Y(o){let{items:n,placeholder:b$1="Select",icon:I,container:R,isPending:v,className:w$1,triggerClassName:L,contentClassName:k,disabled:T,infiniteScroll:P}=o,a$1=o.multiple===true,u=r.useMemo(()=>{if(a$1)return o.value;let e=o.value;return e?[e]:[]},[a$1,o.value,o.value]),$=r.useMemo(()=>{if(a$1)return o.defaultValue??[];let e=o.defaultValue;return e?[e]:[]},[a$1,o.defaultValue,o.defaultValue]),[q$1,c]=r.useState(()=>(u!==void 0?u:$)??[]);r.useEffect(()=>{u!==void 0&&c(u);},[u]);let m$1=q$1??[],s$1=m$1.length>0,[p,z]=r.useState(""),S=r.useMemo(()=>{if(!p.trim())return n;let e=p.toLowerCase();return n?.filter(l=>l.label.toLowerCase().includes(e)||l.value.toLowerCase().includes(e))},[n,p]),A=e=>{let l=e;if(a$1)c(l),o.onValueChange?.(l);else {let x=l.length>0?l[l.length-1]:null;c(x?[x]:[]),o.onValueChange?.(x);}},B=()=>{c([]),a$1?o.onValueChange?.([]):o.onValueChange?.(null);},E=r.useMemo(()=>s$1?a$1?`${b$1} (${m$1.length})`:m$1[0]?.label??b$1:a$1?`All ${b$1}`:b$1,[s$1,a$1,b$1,m$1]);return jsxs(a,{multiple:true,items:n,value:m$1,onValueChange:A,isItemEqualToValue:(e,l)=>e.value===l.value,disabled:T,children:[jsxs(b,{className:cn("group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors","border-border-primary text-text-secondary hover:bg-bg-primary-hover",s$1&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary","disabled:pointer-events-none disabled:opacity-50","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary",L,w$1),children:[I&&jsx("span",{className:cn("size-4 shrink-0",s$1?"text-fg-brand-primary":"text-fg-quaternary"),children:I}),jsx("span",{className:"truncate",children:E}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180",s$1?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:R,className:cn("w-72",k),align:"start",sideOffset:8,children:a$1?jsxs("div",{className:"flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:b$1}),jsxs("button",{type:"button",disabled:!s$1,onClick:B,className:cn("text-body-medium-3 transition-colors",s$1?"cursor-pointer text-text-brand-secondary hover:text-text-brand-secondary-hover":"cursor-not-allowed text-text-disabled"),children:["Clear",s$1?` (${m$1.length})`:""]})]}),jsx(e,{value:p,onChange:e=>z(e.target.value),placeholder:`Search ${b$1.toLowerCase()}...`}),jsx(q,{status:v||n===void 0?"pending":S?.length===0?"empty":null}),jsxs(s,{children:[S?.map(e=>jsx(w,{indicator:"checkbox",value:e,children:jsx(x,{children:e.label})},e.value)),jsx(F,{...P})]})]}):jsxs(Fragment,{children:[jsx(q,{status:v||n===void 0?"pending":n?.length===0?"empty":null}),jsxs(s,{children:[n?.map(e=>jsx(w,{value:e,children:jsx(x,{children:e.label})},e.value)),jsx(F,{...P})]})]})})]})}export{Y as a};//# sourceMappingURL=chunk-VHXY2BUM.js.map
2
- //# sourceMappingURL=chunk-VHXY2BUM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","props","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","isMultiple","controlledArray","single","defaultArray","internalValue","setInternalValue","valueArray","hasValue","search","setSearch","filteredItems","q","it","handleValueChange","next","arr","handleClear","triggerLabel","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll","Fragment"],"mappings":"0MA6DA,SAASA,CAAA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EAAe,GAAA,CAAKoB,CAAAA,EACnBN,GAAAA,CAACO,CAAAA,CAAA,CAAa,SAAA,CAAU,UAAA,CAA4B,KAAA,CAAOD,CAAAA,CACzD,QAAA,CAAAN,GAAAA,CAACQ,CAAAA,CAAA,CACE,QAAA,CAAAF,CAAAA,CAAK,KAAA,CACR,CAAA,CAAA,CAHsCA,CAAAA,CAAK,KAI7C,CAEF,CAAA,CACAN,GAAAA,CAACS,CAAAA,CAAA,CAAwB,GAAGlC,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,CAAA,CAEAmB,IAAAA,CAAAgB,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAV,GAAAA,CAACI,CAAAA,CAAA,CACC,MAAA,CACElC,CAAAA,EAAaJ,CAAAA,GAAU,MAAA,CACnB,SAAA,CACAA,CAAAA,EAAO,MAAA,GAAW,CAAA,CAChB,OAAA,CACA,KAEV,CAAA,CACA4B,IAAAA,CAACW,CAAAA,CAAA,CACE,QAAA,CAAA,CAAAvC,CAAAA,EAAO,GAAA,CAAKwC,CAAAA,EACXN,GAAAA,CAACO,CAAAA,CAAA,CAA8B,KAAA,CAAOD,CAAAA,CACpC,QAAA,CAAAN,GAAAA,CAACQ,CAAAA,CAAA,CACE,QAAA,CAAAF,CAAAA,CAAK,KAAA,CACR,CAAA,CAAA,CAHiBA,CAAAA,CAAK,KAIxB,CACD,CAAA,CACDN,GAAAA,CAACS,CAAAA,CAAA,CAAwB,GAAGlC,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,CAAA,CAEJ,GACF,CAEJ","file":"chunk-VHXY2BUM.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { CheckCircle2Icon, ChevronDownIcon, SearchIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive\r\n} from \"../primitives/combobox\"\r\nimport { ComboboxHighlightItem, ComboboxItem, ComboboxItemTitle } from \"../ui/combobox\"\r\nimport { Input } from \"../ui/input\"\r\nimport {\r\n Combobox,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n type ComboboxProps,\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n}\r\n\r\ntype SingleProps = BaseProps & {\r\n multiple?: false\r\n value?: FilterComboboxItem | null\r\n defaultValue?: FilterComboboxItem | null\r\n onValueChange?: (value: FilterComboboxItem | null) => void\r\n}\r\n\r\ntype MultipleProps = BaseProps & {\r\n multiple: true\r\n value?: FilterComboboxItem[]\r\n defaultValue?: FilterComboboxItem[]\r\n onValueChange?: (value: FilterComboboxItem[]) => void\r\n}\r\n\r\nexport type FilterComboboxProps = SingleProps | MultipleProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox(props: FilterComboboxProps) {\r\n const {\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n } = props\r\n\r\n const isMultiple = props.multiple === true\r\n\r\n // Normalize controlled value to array for internal combobox (always multiple=true internally)\r\n const controlledArray = React.useMemo(() => {\r\n if (isMultiple) {\r\n return (props as MultipleProps).value\r\n }\r\n const single = (props as SingleProps).value\r\n return single ? [single] : []\r\n }, [isMultiple, (props as SingleProps).value, (props as MultipleProps).value])\r\n\r\n const defaultArray = React.useMemo(() => {\r\n if (isMultiple) {\r\n return (props as MultipleProps).defaultValue ?? []\r\n }\r\n const single = (props as SingleProps).defaultValue\r\n return single ? [single] : []\r\n }, [isMultiple, (props as SingleProps).defaultValue, (props as MultipleProps).defaultValue])\r\n\r\n const [internalValue, setInternalValue] = React.useState<FilterComboboxItem[]>(\r\n () =>\r\n (controlledArray !== undefined\r\n ? (controlledArray as FilterComboboxItem[])\r\n : (defaultArray as FilterComboboxItem[])) ?? []\r\n )\r\n\r\n // Sync when controlled value changes externally\r\n React.useEffect(() => {\r\n if (controlledArray !== undefined) {\r\n setInternalValue(controlledArray as FilterComboboxItem[])\r\n }\r\n }, [controlledArray])\r\n\r\n const valueArray = internalValue ?? []\r\n const hasValue = valueArray.length > 0\r\n\r\n // Search for multiple variant\r\n const [search, setSearch] = React.useState(\"\")\r\n\r\n const filteredItems = React.useMemo(() => {\r\n if (!search.trim()) return items\r\n const q = search.toLowerCase()\r\n return items?.filter(\r\n (it) => it.label.toLowerCase().includes(q) || it.value.toLowerCase().includes(q)\r\n )\r\n }, [items, search])\r\n\r\n const handleValueChange: ComboboxProps<FilterComboboxItem, boolean>[\"onValueChange\"] = (\r\n next\r\n ) => {\r\n const arr = next as FilterComboboxItem[]\r\n if (isMultiple) {\r\n setInternalValue(arr)\r\n ; (props as MultipleProps).onValueChange?.(arr)\r\n } else {\r\n // single: take last selected (base-ui gives array)\r\n const single = arr.length > 0 ? arr[arr.length - 1] : null\r\n const normalized = single ? [single] : []\r\n setInternalValue(normalized)\r\n ; (props as SingleProps).onValueChange?.(single)\r\n }\r\n }\r\n\r\n const handleClear = () => {\r\n setInternalValue([])\r\n if (isMultiple) {\r\n ; (props as MultipleProps).onValueChange?.([])\r\n } else {\r\n ; (props as SingleProps).onValueChange?.(null)\r\n }\r\n }\r\n\r\n // Trigger label\r\n const triggerLabel = React.useMemo(() => {\r\n if (!hasValue) {\r\n return isMultiple ? `All ${placeholder}` : placeholder\r\n }\r\n if (isMultiple) {\r\n return `${placeholder} (${valueArray.length})`\r\n }\r\n return valueArray[0]?.label ?? placeholder\r\n }, [hasValue, isMultiple, placeholder, valueArray])\r\n\r\n return (\r\n <Combobox\r\n multiple\r\n items={items}\r\n value={valueArray}\r\n onValueChange={handleValueChange}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n {isMultiple ? (\r\n <div className=\"flex flex-col\">\r\n {/* Header: title + Clear (n) */}\r\n <div className=\"flex items-center justify-between px-3 py-2 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-body-medium-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-brand-secondary hover:text-text-brand-secondary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear{hasValue ? ` (${valueArray.length})` : \"\"}\r\n </button>\r\n </div>\r\n\r\n {/* Search */}\r\n <ComboboxInput\r\n value={search}\r\n onChange={(e) => setSearch(e.target.value)}\r\n placeholder={`Search ${placeholder.toLowerCase()}...`}\r\n />\r\n\r\n {/* List */}\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : filteredItems?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {filteredItems?.map((item) => (\r\n <ComboboxItem indicator=\"checkbox\" key={item.value} value={item}>\r\n <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\r\n </ComboboxItem>\r\n )\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </div>\r\n ) : (\r\n <>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem key={item.value} value={item}>\r\n <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </>\r\n )}\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}