@xploreu/components 0.4.42 → 0.4.43

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-A5644ETE.js +2 -0
  2. package/dist/chunk-A5644ETE.js.map +1 -0
  3. package/dist/chunk-DL6MI55G.js +2 -0
  4. package/dist/chunk-DL6MI55G.js.map +1 -0
  5. package/dist/chunk-DNAWFZ7O.js +2 -0
  6. package/dist/chunk-DNAWFZ7O.js.map +1 -0
  7. package/dist/chunk-F56BLRF2.js +2 -0
  8. package/dist/{chunk-UR3YD2QR.js.map → chunk-F56BLRF2.js.map} +1 -1
  9. package/dist/{chunk-YB74L6RO.js → chunk-H6ETV455.js} +2 -2
  10. package/dist/{chunk-YB74L6RO.js.map → chunk-H6ETV455.js.map} +1 -1
  11. package/dist/{chunk-IT4LPPTN.js → chunk-HGLHAEGH.js} +2 -2
  12. package/dist/{chunk-IT4LPPTN.js.map → chunk-HGLHAEGH.js.map} +1 -1
  13. package/dist/chunk-MO7LQLS4.js +2 -0
  14. package/dist/chunk-MO7LQLS4.js.map +1 -0
  15. package/dist/chunk-OHLNKXSV.js +2 -0
  16. package/dist/chunk-OHLNKXSV.js.map +1 -0
  17. package/dist/{chunk-WV5OCKQK.js → chunk-RAVBRPQS.js} +2 -2
  18. package/dist/{chunk-WV5OCKQK.js.map → chunk-RAVBRPQS.js.map} +1 -1
  19. package/dist/{chunk-IZQFTYJD.js → chunk-RHWRIE3E.js} +2 -2
  20. package/dist/{chunk-IZQFTYJD.js.map → chunk-RHWRIE3E.js.map} +1 -1
  21. package/dist/{chunk-VHPUQQ6L.js → chunk-V2PW53KI.js} +2 -2
  22. package/dist/{chunk-VHPUQQ6L.js.map → chunk-V2PW53KI.js.map} +1 -1
  23. package/dist/chunk-VIBM666E.js +2 -0
  24. package/dist/chunk-VIBM666E.js.map +1 -0
  25. package/dist/{chunk-CDHMNEJ5.js → chunk-WN22TTEL.js} +2 -2
  26. package/dist/{chunk-CDHMNEJ5.js.map → chunk-WN22TTEL.js.map} +1 -1
  27. package/dist/chunk-Y6TKCAAJ.js +2 -0
  28. package/dist/chunk-Y6TKCAAJ.js.map +1 -0
  29. package/dist/{chunk-ON7PUZWI.js → chunk-YNJZ2P52.js} +2 -2
  30. package/dist/{chunk-ON7PUZWI.js.map → chunk-YNJZ2P52.js.map} +1 -1
  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.js +1 -1
  35. package/dist/composites/index.js +1 -1
  36. package/dist/composites/phone-input.js +1 -1
  37. package/dist/form/form-input.d.ts +3 -3
  38. package/dist/form/form-input.js +1 -1
  39. package/dist/form/form-textarea.d.ts +5 -3
  40. package/dist/form/form-textarea.js +1 -1
  41. package/dist/form/form.d.ts +1 -1
  42. package/dist/form/form.js +1 -1
  43. package/dist/form/index.js +1 -1
  44. package/dist/ui/button.d.ts +2 -2
  45. package/dist/ui/combobox.js +1 -1
  46. package/dist/ui/index.d.ts +1 -1
  47. package/dist/ui/index.js +1 -1
  48. package/dist/ui/input.d.ts +1 -1
  49. package/dist/ui/input.js +1 -1
  50. package/dist/ui/label.d.ts +2 -2
  51. package/dist/ui/label.js +1 -1
  52. package/dist/ui/pagination.js +1 -1
  53. package/dist/ui/tabs.js +1 -1
  54. package/dist/ui/textarea.d.ts +7 -2
  55. package/dist/ui/textarea.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/chunk-3ASGRRVT.js +0 -2
  58. package/dist/chunk-3ASGRRVT.js.map +0 -1
  59. package/dist/chunk-4PIKXPNO.js +0 -2
  60. package/dist/chunk-4PIKXPNO.js.map +0 -1
  61. package/dist/chunk-G6HDEOYZ.js +0 -2
  62. package/dist/chunk-G6HDEOYZ.js.map +0 -1
  63. package/dist/chunk-JH6RZ3QH.js +0 -2
  64. package/dist/chunk-JH6RZ3QH.js.map +0 -1
  65. package/dist/chunk-K2BMQ2TN.js +0 -2
  66. package/dist/chunk-K2BMQ2TN.js.map +0 -1
  67. package/dist/chunk-K7GGFR7W.js +0 -2
  68. package/dist/chunk-K7GGFR7W.js.map +0 -1
  69. package/dist/chunk-PJYKUR4F.js +0 -2
  70. package/dist/chunk-PJYKUR4F.js.map +0 -1
  71. package/dist/chunk-UR3YD2QR.js +0 -2
@@ -1 +1 @@
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","items","useFilteredItems","ScrollArea","index","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"8hBAgFA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAAA,CAACF,CAAAA,CAAA,CAAmB,GAAGC,CAAAA,CAAO,CAElC,CAIA,SAASE,EAAAA,CAAgBF,CAAAA,CAA6B,CACpD,GAAM,CAAE,SAAA,CAAAG,C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,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACqF,CAAAA,CAAA,CACN,SAAA,CAAWjF,EAAAA,CAAG,kBAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAASmF,EAAAA,CAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGzF,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAACyF,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAGzF,CAAAA,CAEH,QAAA,CAAAwF,CAAAA,EACClE,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,IAACoD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,EAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-IZQFTYJD.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 useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } from \"./input\"\r\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\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(\"p-3 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 = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\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 grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\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 data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\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 data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 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\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\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 ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\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
+ {"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","items","useFilteredItems","ScrollArea","index","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"8hBAgFA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAAA,CAACF,CAAAA,CAAA,CAAmB,GAAGC,CAAAA,CAAO,CAElC,CAIA,SAASE,EAAAA,CAAgBF,CAAAA,CAA6B,CACpD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACC,EAAA,CACN,SAAA,CAAWG,EAAAA,CACT,gDAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASE,EAAAA,CAAcN,CAAAA,CAA2B,CAChD,GAAM,CAAE,SAAA,CAAAG,EAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACK,CAAAA,CAAA,CACN,UAAWD,EAAAA,CACT,2CAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASG,EAAAA,CAAmBP,CAAAA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E,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,IAACoD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,EAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-RHWRIE3E.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 useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } from \"./input\"\r\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\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(\"p-3 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 = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\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 grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\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 data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\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 data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 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\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\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 ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\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 +1,2 @@
1
- import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),g=i.createContext({theme:"light",color:"brand",size:"md"});function f({className:a,theme:t="light",color:e="brand",size:r="md",align:o="leading",render:p,children:s,...d}){let c={"data-slot":"badge-group","data-theme":t,"data-color":e,"data-size":r,"data-align":o,className:cn(u({theme:t,color:e,size:r,align:o}),a),children:s};return jsx(g.Provider,{value:{theme:t??"light",color:e??"brand",size:r??"md"},children:useRender({defaultTagName:"div",props:mergeProps(c,d),render:p,state:{slot:"badge-group",theme:t,color:e,size:r,align:o}})})}function P({className:a,children:t,...e}){let{theme:r,color:o,size:p}=i.useContext(g),s={brand:"ring-utility-brand-200 text-utility-brand-700",gray:"ring-utility-gray-200 text-utility-gray-700",error:"ring-utility-error-200 text-utility-error-700",warning:"ring-utility-warning-200 text-utility-warning-700",success:"ring-utility-success-200 text-utility-success-700"},d=cn("inline-flex items-center justify-center font-medium shrink-0",r==="light"&&["rounded-xp-full bg-bg-primary ring-1 ring-inset",s[o]||s.brand,p==="md"?"px-2 py-0.5":"px-2.5 py-0.5"],r==="modern"&&["rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary",p==="md"?"gap-1 px-1.5 py-0.5":"gap-1.5 px-2 py-0.5"],a);return jsx("span",{"data-slot":"badge-group-addon",className:d,...e,children:t})}function h({className:a,children:t=jsx(ArrowRightIcon,{}),...e}){let{color:r}=i.useContext(g),o={brand:"text-utility-brand-500",gray:"text-utility-gray-500",error:"text-utility-error-500",warning:"text-utility-warning-500",success:"text-utility-success-500"};return jsx("span",{"data-slot":"badge-group-icon",className:cn("inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5",o[r]||o.brand,a),...e,children:t})}function B({className:a,...t}){let{color:e}=i.useContext(g),r={brand:"bg-utility-brand-500 outline-utility-brand-100",gray:"bg-utility-gray-500 outline-utility-gray-100",error:"bg-utility-error-500 outline-utility-error-100",warning:"bg-utility-warning-500 outline-utility-warning-100",success:"bg-utility-success-500 outline-utility-success-100"};return jsx("span",{"data-slot":"badge-group-dot",className:cn("inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1",r[e]||r.brand,a),...t})}export{u as a,f as b,P as c,h as d,B as e};//# sourceMappingURL=chunk-VHPUQQ6L.js.map
2
- //# sourceMappingURL=chunk-VHPUQQ6L.js.map
1
+ import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),g=i.createContext({theme:"light",color:"brand",size:"md"});function f({className:a,theme:t="light",color:e="brand",size:r="md",align:o="leading",render:s,children:p,...d}){let c={"data-slot":"badge-group","data-theme":t,"data-color":e,"data-size":r,"data-align":o,className:cn(u({theme:t,color:e,size:r,align:o}),a),children:p};return jsx(g.Provider,{value:{theme:t??"light",color:e??"brand",size:r??"md"},children:useRender({defaultTagName:"div",props:mergeProps(c,d),render:s,state:{slot:"badge-group",theme:t,color:e,size:r,align:o}})})}function P({className:a,children:t,...e}){let{theme:r,color:o,size:s}=i.useContext(g),p={brand:"ring-utility-brand-200 text-utility-brand-700",gray:"ring-utility-gray-200 text-utility-gray-700",error:"ring-utility-error-200 text-utility-error-700",warning:"ring-utility-warning-200 text-utility-warning-700",success:"ring-utility-success-200 text-utility-success-700"},d=cn("inline-flex items-center justify-center font-medium shrink-0",r==="light"&&["rounded-xp-full bg-bg-primary ring-1 ring-inset",p[o]||p.brand,s==="md"?"px-2 py-0.5":"px-2.5 py-0.5"],r==="modern"&&["rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary",s==="md"?"gap-1 px-1.5 py-0.5":"gap-1.5 px-2 py-0.5"],a);return jsx("span",{"data-slot":"badge-group-addon",className:d,...e,children:t})}function h({className:a,children:t=jsx(ArrowRightIcon,{}),...e}){let{color:r}=i.useContext(g),o={brand:"text-utility-brand-500",gray:"text-utility-gray-500",error:"text-utility-error-500",warning:"text-utility-warning-500",success:"text-utility-success-500"};return jsx("span",{"data-slot":"badge-group-icon",className:cn("inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5",o[r]||o.brand,a),...e,children:t})}function B({className:a,...t}){let{color:e}=i.useContext(g),r={brand:"bg-utility-brand-500 outline-utility-brand-100",gray:"bg-utility-gray-500 outline-utility-gray-100",error:"bg-utility-error-500 outline-utility-error-100",warning:"bg-utility-warning-500 outline-utility-warning-100",success:"bg-utility-success-500 outline-utility-success-100"};return jsx("span",{"data-slot":"badge-group-dot",className:cn("inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1",r[e]||r.brand,a),...t})}export{u as a,f as b,P as c,h as d,B as e};//# sourceMappingURL=chunk-V2PW53KI.js.map
2
+ //# sourceMappingURL=chunk-V2PW53KI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EAAA,CACP,QAAS,EAAA,CACT,OAAA,CAAS,EACX,CAAA,CACA,IAAA,CAAM,CACJ,GAAI,oBAAA,CACJ,EAAA,CAAI,oBACN,CAAA,CACA,KAAA,CAAO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AsC,CAC1C,KAAA,CAAO,iDACP,IAAA,CAAM,8CAAA,CACN,KAAA,CAAO,gDAAA,CACP,OAAA,CAAS,oDAAA,CACT,QAAS,oDACX,CAAA,CAEA,OACEV,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBACV,SAAA,CAAWD,EAAAA,CACT,4EAAA,CACAW,CAAAA,CAAYlB,CAAK,CAAA,EAAKkB,CAAAA,CAAY,KAAA,CAClCpB,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ","file":"chunk-VHPUQQ6L.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
1
+ {"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EAAA,CACP,QAAS,EAAA,CACT,OAAA,CAAS,EACX,CAAA,CACA,IAAA,CAAM,CACJ,GAAI,oBAAA,CACJ,EAAA,CAAI,oBACN,CAAA,CACA,KAAA,CAAO,CACL,QAAS,EAAA,CACT,QAAA,CAAU,EACZ,CACF,CAAA,CACA,gBAAA,CAAkB,CAEhB,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,OAAA,CACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,MAAA,CACP,UAAW,0FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,QACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,MAAO,SAAA,CACP,SAAA,CAAW,sGACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,SAAA,CACP,SAAA,CAAW,sGACb,CAAA,CAIA,CACE,KAAA,CAAO,UACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,gBACb,CAAA,CACA,CACE,MAAO,SAAA,CACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,kBACb,CAAA,CAEA,CACE,KAAA,CAAO,UAAA,CACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,gB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9CoB,CAAAA,CAAuC,CAC3C,KAAA,CAAO,wBAAA,CACP,KAAM,uBAAA,CACN,KAAA,CAAO,wBAAA,CACP,OAAA,CAAS,0BAAA,CACT,OAAA,CAAS,0BACX,CAAA,CAEA,OACER,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWD,EAAAA,CACT,uKAAA,CACAS,CAAAA,CAAahB,CAAK,CAAA,EAAKgB,CAAAA,CAAa,KAAA,CACpClB,CACF,CAAA,CACC,GAAGO,CAAAA,CAEH,QAAA,CAAAD,CAAAA,CACH,CAEJ,CAKA,SAASa,CAAAA,CAAc,CACrB,SAAA,CAAAnB,CAAAA,CACA,GAAGO,CACL,CAAA,CAAuB,CACrB,GAAM,CAAE,KAAA,CAAAL,CAAM,EAAU,CAAA,CAAA,UAAA,CAAWJ,CAAiB,CAAA,CAE9CsB,CAAAA,CAAsC,CAC1C,KAAA,CAAO,iDACP,IAAA,CAAM,8CAAA,CACN,KAAA,CAAO,gDAAA,CACP,OAAA,CAAS,oDAAA,CACT,QAAS,oDACX,CAAA,CAEA,OACEV,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBACV,SAAA,CAAWD,EAAAA,CACT,4EAAA,CACAW,CAAAA,CAAYlB,CAAK,CAAA,EAAKkB,CAAAA,CAAY,KAAA,CAClCpB,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ","file":"chunk-V2PW53KI.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a,b,i,m,e,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import {a as a$1}from'./chunk-Y6TKCAAJ.js';import'react';import {ChevronDownIcon}from'lucide-react';import'class-variance-authority';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var y={"3xs":"size-3","2xs":"size-3.5",xs:"size-3.5",sm:"size-4",md:"size-4",lg:"size-4.5",xl:"size-5"},D={"3xs":"gap-1.5 pr-2","2xs":"gap-1.5 pr-2.5",xs:"gap-2 pr-2.5",sm:"gap-2 pr-3",md:"gap-2 pr-3",lg:"gap-2.5 pr-3.5",xl:"gap-2.5 pr-4"};function K({items:t,value:I,defaultValue:h,onValueChange:z,placeholder:m$1="Select",searchPlaceholder:N,icon:n,container:V,isPending:v,className:R,triggerClassName:T,contentClassName:k,disabled:q$1,size:a$2="md",infiniteScroll:w$1,showSearch:p=false,filter:l,...L}){return jsxs(a,{items:t,value:I,defaultValue:h,onValueChange:z,filter:l===null||!p?null:l,isItemEqualToValue:(e,B)=>e.value===B.value,disabled:q$1,...L,children:[jsxs(b,{className:cn(a$1({size:a$2}),"group flex cursor-pointer items-center text-left",D[a$2??"md"]??"gap-2 pr-3",T,R),children:[n&&jsx("span",{className:cn(y[a$2??"md"]??"size-4","shrink-0 text-fg-quaternary [&_svg]:size-full"),children:n}),jsx("span",{className:"flex-1 truncate",children:jsx(i,{children:e=>jsx("span",{className:e?"text-text-primary":"text-text-placeholder",children:e?.label??m$1})})}),jsx(ChevronDownIcon,{className:cn(y[a$2??"md"]??"size-4","shrink-0 text-fg-quaternary transition-transform group-data-[popup-open]:rotate-180")})]}),jsxs(m,{container:V,className:cn("w-72",k),align:"start",sideOffset:8,children:[p&&jsx(e,{placeholder:N??`Search ${m$1.toLowerCase()}...`}),jsx(q,{status:v||t===void 0?"pending":t.length===0?"empty":null}),jsxs(s,{children:[t?.map(e=>jsx(w,{value:e,children:jsx(x,{children:e.label})},e.value)),jsx(H,{...w$1})]})]})]})}export{K as a};//# sourceMappingURL=chunk-VIBM666E.js.map
2
+ //# sourceMappingURL=chunk-VIBM666E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/composites/combobox-simple.tsx"],"names":["comboboxSimpleIconSizes","comboboxSimpleTriggerPaddings","ComboboxSimple","items","value","defaultValue","onValueChange","placeholder","searchPlaceholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","size","infiniteScroll","showSearch","filter","props","jsxs","Combobox","a","b","ComboboxTrigger","cn","inputVariants","jsx","ComboboxValue","item","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qQA8CA,IAAMA,CAAAA,CAAkD,CACtD,KAAA,CAAO,QAAA,CACP,KAAA,CAAO,UAAA,CACP,EAAA,CAAI,UAAA,CACJ,EAAA,CAAI,QAAA,CACJ,EAAA,CAAI,SACJ,EAAA,CAAI,UAAA,CACJ,EAAA,CAAI,QACN,CAAA,CAEMC,CAAAA,CAAwD,CAC5D,KAAA,C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AAA,CAAAhC,CAAAA,EAAO,GAAA,CAAK2B,CAAAA,EACXF,GAAAA,CAACQ,CAAAA,CAAA,CAA8B,KAAA,CAAON,CAAAA,CACpC,QAAA,CAAAF,IAACS,CAAAA,CAAA,CACE,QAAA,CAAAP,CAAAA,CAAK,KAAA,CACR,CAAA,CAAA,CAHiBA,CAAAA,CAAK,KAIxB,CACD,CAAA,CACDF,GAAAA,CAACU,CAAAA,CAAA,CAAwB,GAAGrB,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-VIBM666E.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\nimport { type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { inputVariants } from \"../ui/input\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } from \"../ui/combobox\"\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 ComboboxValue,\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type ComboboxSimpleItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype BaseProps = {\r\n items: ComboboxSimpleItem[] | undefined\r\n placeholder?: string\r\n searchPlaceholder?: 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 size?: VariantProps<typeof inputVariants>[\"size\"]\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showSearch?: boolean\r\n}\r\n\r\nexport type ComboboxSimpleProps = Omit<ComboboxProps<ComboboxSimpleItem, false>, \"multiple\" | \"items\"> & BaseProps\r\n\r\nconst comboboxSimpleIconSizes: Record<string, string> = {\r\n \"3xs\": \"size-3\",\r\n \"2xs\": \"size-3.5\",\r\n xs: \"size-3.5\",\r\n sm: \"size-4\",\r\n md: \"size-4\",\r\n lg: \"size-4.5\",\r\n xl: \"size-5\",\r\n}\r\n\r\nconst comboboxSimpleTriggerPaddings: Record<string, string> = {\r\n \"3xs\": \"gap-1.5 pr-2\",\r\n \"2xs\": \"gap-1.5 pr-2.5\",\r\n xs: \"gap-2 pr-2.5\",\r\n sm: \"gap-2 pr-3\",\r\n md: \"gap-2 pr-3\",\r\n lg: \"gap-2.5 pr-3.5\",\r\n xl: \"gap-2.5 pr-4\",\r\n}\r\n\r\n// ─── Component ───\r\n\r\nfunction ComboboxSimple({\r\n items,\r\n value,\r\n defaultValue,\r\n onValueChange,\r\n placeholder = \"Select\",\r\n searchPlaceholder,\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n size = \"md\",\r\n infiniteScroll,\r\n showSearch = false,\r\n filter,\r\n ...props\r\n}: ComboboxSimpleProps) {\r\n return (\r\n <Combobox\r\n items={items}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onValueChange={onValueChange}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n inputVariants({ size }),\r\n \"group flex cursor-pointer items-center text-left\",\r\n comboboxSimpleTriggerPaddings[size ?? \"md\"] ?? \"gap-2 pr-3\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span className={cn(comboboxSimpleIconSizes[size ?? \"md\"] ?? \"size-4\", \"shrink-0 text-fg-quaternary [&_svg]:size-full\")}>\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"flex-1 truncate\">\r\n <ComboboxValue>\r\n {(item) => (\r\n <span className={item ? \"text-text-primary\" : \"text-text-placeholder\"}>\r\n {item?.label ?? placeholder}\r\n </span>\r\n )}\r\n </ComboboxValue>\r\n </span>\r\n <ChevronDownIcon\r\n className={cn(\r\n comboboxSimpleIconSizes[size ?? \"md\"] ?? \"size-4\",\r\n \"shrink-0 text-fg-quaternary transition-transform group-data-[popup-open]:rotate-180\"\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 {showSearch && (\r\n <ComboboxInput placeholder={searchPlaceholder ?? `Search ${placeholder.toLowerCase()}...`} />\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 </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxSimple }\r\n"]}
@@ -1,2 +1,2 @@
1
- import {a,b,m,e,q,s,w,x,H}from'./chunk-IZQFTYJD.js';import'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function X({multiple:m$1,items:s$1,placeholder:t="Select",icon:d,container:T,isPending:F,className:M,triggerClassName:k,contentClassName:A,disabled:R,infiniteScroll:x$1,filter:c,...o}){let r=m$1===true,L=o.showTitle??r,g=o.showSearch??r,[n,C]=useControlledState({value:o?.value,defaultValue:o?.defaultValue,onChange:o.onValueChange}),[$,q$1]=useControlledState({value:o?.inputValue?.toString(),defaultValue:o?.defaultInputValue?.toString(),onChange:o?.onInputValueChange}),u=Array.isArray(n)?n:n?[n]:[],a$1=u.length>0,z=u.length,B=a$1?r?`${t} (${z})`:u[0]?.label??t:r?`All ${t}`:t,D=()=>{C(null);};return jsxs(a,{items:s$1,multiple:m$1,value:n,onValueChange:C,inputValue:$,onInputValueChange:q$1,filter:c===null||!g?null:c,isItemEqualToValue:(l,p)=>l.value===p.value,disabled:R,...o,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",a$1&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt","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",k,M),children:[d&&jsx("span",{className:cn("size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary"),children:d}),jsx("span",{className:"truncate",children:B}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:T,className:cn("w-72",A),align:"start",sideOffset:8,children:jsxs("div",{className:"flex flex-col",children:[L&&jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:t}),jsx("button",{type:"button",disabled:!a$1,onClick:D,className:cn("text-label-semibold-3 transition-colors",a$1?"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover":"cursor-not-allowed text-text-disabled"),children:"Clear All"})]}),g&&jsx(e,{placeholder:`Search ${t.toLowerCase()}...`}),jsx(q,{status:F||s$1===void 0?"pending":s$1?.length===0?"empty":null}),jsx(s,{children:(l,p,E)=>jsxs(Fragment,{children:[jsx(w,{indicator:r?"checkbox":void 0,value:l,children:jsx(x,{children:l.label})},l.value),p===E-1&&!!x$1&&jsx(H,{...x$1})]})})]})})]})}export{X as a};//# sourceMappingURL=chunk-CDHMNEJ5.js.map
2
- //# sourceMappingURL=chunk-CDHMNEJ5.js.map
1
+ import {a,b,m,e,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function X({multiple:m$1,items:s$1,placeholder:t="Select",icon:d,container:T,isPending:F,className:M,triggerClassName:k,contentClassName:A,disabled:R,infiniteScroll:x$1,filter:c,...o}){let r=m$1===true,L=o.showTitle??r,g=o.showSearch??r,[n,C]=useControlledState({value:o?.value,defaultValue:o?.defaultValue,onChange:o.onValueChange}),[$,q$1]=useControlledState({value:o?.inputValue?.toString(),defaultValue:o?.defaultInputValue?.toString(),onChange:o?.onInputValueChange}),u=Array.isArray(n)?n:n?[n]:[],a$1=u.length>0,z=u.length,B=a$1?r?`${t} (${z})`:u[0]?.label??t:r?`All ${t}`:t,D=()=>{C(null);};return jsxs(a,{items:s$1,multiple:m$1,value:n,onValueChange:C,inputValue:$,onInputValueChange:q$1,filter:c===null||!g?null:c,isItemEqualToValue:(l,p)=>l.value===p.value,disabled:R,...o,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",a$1&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt","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",k,M),children:[d&&jsx("span",{className:cn("size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary"),children:d}),jsx("span",{className:"truncate",children:B}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:T,className:cn("w-72",A),align:"start",sideOffset:8,children:jsxs("div",{className:"flex flex-col",children:[L&&jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:t}),jsx("button",{type:"button",disabled:!a$1,onClick:D,className:cn("text-label-semibold-3 transition-colors",a$1?"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover":"cursor-not-allowed text-text-disabled"),children:"Clear All"})]}),g&&jsx(e,{placeholder:`Search ${t.toLowerCase()}...`}),jsx(q,{status:F||s$1===void 0?"pending":s$1?.length===0?"empty":null}),jsx(s,{children:(l,p,E)=>jsxs(Fragment,{children:[jsx(w,{indicator:r?"checkbox":void 0,value:l,children:jsx(x,{children:l.label})},l.value),p===E-1&&!!x$1&&jsx(H,{...x$1})]})})]})})]})}export{X as a};//# sourceMappingURL=chunk-WN22TTEL.js.map
2
+ //# sourceMappingURL=chunk-WN22TTEL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","filter","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","inputValue","setInputValue","valueArray","hasValue","count","triggerLabel","handleClear","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","index","length","Fragment","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qQA+CA,SAASA,EAA+F,CACtG,QAAA,CAAAC,IACA,KAAA,CAAAC,GAAAA,CACA,YAAAC,CAAAA,CAAc,QAAA,CACd,IAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,SAAA,CAAAC,EAC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,CAAU,CAACV,GAAAA,CACX,OAAA,CAASG,EACT,SAAA,CAAWM,EAAAA,CACT,0CACAT,GAAAA,CACI,4EAAA,CACA,uCACN,CAAA,CACD,qBAED,CAAA,CAAA,CACF,CAAA,CAGDP,GACCiB,GAAAA,CAACG,CAAAA,CAAA,CAAc,WAAA,CAAa,CAAA,OAAA,EAAUjC,CAAAA,CAAY,WAAA,EAAa,CAAA,GAAA,CAAA,CAAO,CAAA,CAGxE8B,IAACI,CAAAA,CAAA,CACC,OACE/B,CAAAA,EAAaJ,GAAAA,GAAU,OACnB,SAAA,CACCA,GAAAA,EAAQ,SAAW,CAAA,CAClB,OAAA,CACA,KAEV,CAAA,CACA+B,GAAAA,CAACK,EAAA,CACE,QAAA,CAAA,CAACC,CAAAA,CAAMC,CAAAA,CAAOC,IACbd,IAAAA,CAAAe,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAT,GAAAA,CAACU,EAAA,CACC,SAAA,CAAW7B,CAAAA,CAAa,UAAA,CAAa,OAErC,KAAA,CAAOyB,CAAAA,CAEP,SAAAN,GAAAA,CAACW,CAAAA,CAAA,CAAmB,QAAA,CAAAL,CAAAA,CAAK,KAAA,CAAM,CAAA,CAAA,CAH1BA,EAAK,KAIZ,CAAA,CACCC,IAAUC,CAAAA,CAAS,CAAA,EAAK,CAAC,CAAC9B,GAAAA,EACzBsB,IAACY,CAAAA,CAAA,CAAwB,GAAGlC,GAAAA,CAAgB,CAAA,CAAA,CAEhD,EAEJ,CAAA,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-CDHMNEJ5.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } from \"../ui/combobox\"\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} 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 FilterComboboxValueType<Value extends FilterComboboxItem, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;\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 showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\nexport type FilterComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxProps<Value, Multiple> & BaseProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox<Value extends FilterComboboxItem, Multiple extends boolean | undefined = false>({\r\n multiple,\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 filter,\r\n ...props\r\n}: FilterComboboxProps<Value, Multiple>) {\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValueType<Value, Multiple> | null>({\r\n value: props?.value,\r\n defaultValue: props?.defaultValue,\r\n onChange: props.onValueChange as (\r\n value: FilterComboboxValueType<Value, Multiple> | null\r\n ) => void\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 // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n }\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n inputValue={inputValue}\r\n onInputValueChange={setInputValue}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\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 hover:bg-bg-brand-primary-hover-alt\",\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 group-data-[popup-open]:text-fg-brand-primary\",\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 group-data-[popup-open]:text-fg-brand-primary\",\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 <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 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-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput placeholder={`Search ${placeholder.toLowerCase()}...`} />\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 {(item, index, length) => (\r\n <>\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n {index === length - 1 && !!infiniteScroll && (\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n )}\r\n </>\r\n )}\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
1
+ {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","filter","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","inputValue","setInputValue","valueArray","hasValue","count","triggerLabel","handleClear","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","index","length","Fragment","ComboboxItem","Combobox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on } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } from \"../ui/combobox\"\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} 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 FilterComboboxValueType<Value extends FilterComboboxItem, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;\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 showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\nexport type FilterComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxProps<Value, Multiple> & BaseProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox<Value extends FilterComboboxItem, Multiple extends boolean | undefined = false>({\r\n multiple,\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 filter,\r\n ...props\r\n}: FilterComboboxProps<Value, Multiple>) {\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValueType<Value, Multiple> | null>({\r\n value: props?.value,\r\n defaultValue: props?.defaultValue,\r\n onChange: props.onValueChange as (\r\n value: FilterComboboxValueType<Value, Multiple> | null\r\n ) => void\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 // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n }\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n inputValue={inputValue}\r\n onInputValueChange={setInputValue}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\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 hover:bg-bg-brand-primary-hover-alt\",\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 group-data-[popup-open]:text-fg-brand-primary\",\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 group-data-[popup-open]:text-fg-brand-primary\",\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 <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 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-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput placeholder={`Search ${placeholder.toLowerCase()}...`} />\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 {(item, index, length) => (\r\n <>\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n {index === length - 1 && !!infiniteScroll && (\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n )}\r\n </>\r\n )}\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-V5WX4TSN.js';import {a as a$1}from'./chunk-EY3W3WZX.js';import*as o from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var g=cva(cn("peer/input text-text-primary placeholder:text-text-placeholder data-[placeholder]:text-text-placeholder border-border-primary flex w-full min-w-0 rounded-xp-card-base border bg-bg-primary transition-[color,box-shadow,border] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-bg-disabled disabled:text-text-disabled","focus-visible:border-border-brand focus-visible:ring-2 focus-visible:ring-border-brand/20","aria-invalid:border-content-on-error-subtle-action aria-invalid:ring-2 aria-invalid:ring-content-on-error-subtle-action/20"),{variants:{size:{"3xs":"h-6 text-label-regular-4 px-2","2xs":"h-7 text-label-regular-4 px-2.5",xs:"h-8 text-body-regular-3 px-2.5",sm:"h-9 text-body-regular-3 px-3",md:"h-10 text-body-regular-2 px-3",lg:"h-11 text-body-regular-2 px-3.5",xl:"h-12 text-body-regular-2 px-4"},variant:{password:void 0},withStartContent:{true:"pl-9.5"},withEndContent:{true:"pr-9.5"}},compoundVariants:[{size:"3xs",withStartContent:true,className:"pl-7"},{size:"3xs",withEndContent:true,className:"pr-7"},{size:"2xs",withStartContent:true,className:"pl-7.5"},{size:"2xs",withEndContent:true,className:"pr-7.5"},{size:"xs",withStartContent:true,className:"pl-8"},{size:"xs",withEndContent:true,className:"pr-8"},{size:"sm",withStartContent:true,className:"pl-9"},{size:"sm",withEndContent:true,className:"pr-9"},{size:"md",withStartContent:true,className:"pl-9.5"},{size:"md",withEndContent:true,className:"pr-9.5"},{size:"lg",withStartContent:true,className:"pl-10"},{size:"lg",withEndContent:true,className:"pr-10"},{size:"xl",withStartContent:true,className:"pl-11"},{size:"xl",withEndContent:true,className:"pr-11"}],defaultVariants:{size:"md"}}),l=cva("absolute top-1/2 -translate-y-1/2 text-fg-quaternary [&_svg]:size-full",{variants:{side:{start:"left-3",end:"right-3"},size:{"3xs":"size-3.5","2xs":"size-3.5",xs:"size-4",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-5"}},compoundVariants:[{side:"start",size:"3xs",className:"left-2"},{side:"end",size:"3xs",className:"right-2"},{side:"start",size:"2xs",className:"left-2"},{side:"end",size:"2xs",className:"right-2"},{side:"start",size:"xs",className:"left-2.5"},{side:"end",size:"xs",className:"right-2.5"},{side:"start",size:"sm",className:"left-3"},{side:"end",size:"sm",className:"right-3"},{side:"start",size:"md",className:"left-3"},{side:"end",size:"md",className:"right-3"},{side:"start",size:"lg",className:"left-3.5"},{side:"end",size:"lg",className:"right-3.5"},{side:"start",size:"xl",className:"left-4"},{side:"end",size:"xl",className:"right-4"}],defaultVariants:{side:"start",size:"md"}});function V({className:x,wrapperClassName:h,type:w,startContent:r,endContent:i,variant:t,size:a$2,...N}){let[n,z]=o.useState(false),p=!!r||!!i||t==="password";return jsxs(p?"div":o.Fragment,{...p?{className:cn("relative",h)}:{},children:[jsx("input",{className:cn(g({withStartContent:!!r,withEndContent:!!i||t==="password",size:a$2}),x),"data-slot":"input",type:t==="password"?n?"text":"password":w,...N}),r&&jsx(Slot,{className:cn(l({side:"start",size:a$2})),children:r}),i&&t!=="password"&&jsx(Slot,{className:cn(l({side:"end",size:a$2})),children:i}),t==="password"&&jsx(Slot,{"aria-label":n?"Hide password":"Show password",className:"cursor-pointer select-none","data-slot":"toggle-password",onClick:()=>z(b=>!b),children:n?jsx(a,{className:cn(l({side:"end",size:a$2}))}):jsx(a$1,{className:cn(l({side:"end",size:a$2}))})})]})}export{g as a,V as b};//# sourceMappingURL=chunk-Y6TKCAAJ.js.map
2
+ //# sourceMappingURL=chunk-Y6TKCAAJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/input.tsx"],"names":["inputVariants","cva","cn","inputIconVariants","Input","className","wrapperClassName","type","startContent","endContent","variant","size","props","showPassword","setShowPassword","isWrapped","jsxs","jsx","Slot","prev","show_passwords_icon_default","hide_passwords_icon_default"],"mappings":"oQASA,IAAMA,CAAAA,CAAgBC,GAAAA,CACpBC,EAAAA,CACE,4VAAA,CACA,2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CAAA,CAAkB,SAAA,CAAWlB,EAAAA,CAAGC,CAAAA,CAAkB,CAAE,IAAA,CAAM,KAAA,CAAO,IAAA,CAAAQ,GAAK,CAAC,CAAC,CAAA,CAAG,CAAA,CAE5EM,GAAAA,CAACI,GAAAA,CAAA,CAAkB,SAAA,CAAWnB,EAAAA,CAAGC,CAAAA,CAAkB,CAAE,IAAA,CAAM,KAAA,CAAO,IAAA,CAAAQ,GAAK,CAAC,CAAC,CAAA,CAAG,CAAA,CAEhF,GAEJ,CAEJ","file":"chunk-Y6TKCAAJ.js","sourcesContent":["\"use client\"\r\nimport * as React from \"react\"\r\n\r\nimport { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { HidePasswordsIcon, ShowPasswordsIcon } from \"../icons\"\r\n\r\nconst inputVariants = cva(\r\n cn(\r\n \"peer/input text-text-primary placeholder:text-text-placeholder data-[placeholder]:text-text-placeholder border-border-primary flex w-full min-w-0 rounded-xp-card-base border bg-bg-primary transition-[color,box-shadow,border] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-bg-disabled disabled:text-text-disabled\",\r\n \"focus-visible:border-border-brand focus-visible:ring-2 focus-visible:ring-border-brand/20\",\r\n \"aria-invalid:border-content-on-error-subtle-action aria-invalid:ring-2 aria-invalid:ring-content-on-error-subtle-action/20\"\r\n ),\r\n {\r\n variants: {\r\n size: {\r\n \"3xs\": \"h-6 text-label-regular-4 px-2\",\r\n \"2xs\": \"h-7 text-label-regular-4 px-2.5\",\r\n xs: \"h-8 text-body-regular-3 px-2.5\",\r\n sm: \"h-9 text-body-regular-3 px-3\",\r\n md: \"h-10 text-body-regular-2 px-3\",\r\n lg: \"h-11 text-body-regular-2 px-3.5\",\r\n xl: \"h-12 text-body-regular-2 px-4\",\r\n },\r\n variant: {\r\n password: undefined,\r\n },\r\n withStartContent: {\r\n true: \"pl-9.5\",\r\n },\r\n withEndContent: {\r\n true: \"pr-9.5\",\r\n },\r\n },\r\n compoundVariants: [\r\n { size: \"3xs\", withStartContent: true, className: \"pl-7\" },\r\n { size: \"3xs\", withEndContent: true, className: \"pr-7\" },\r\n { size: \"2xs\", withStartContent: true, className: \"pl-7.5\" },\r\n { size: \"2xs\", withEndContent: true, className: \"pr-7.5\" },\r\n { size: \"xs\", withStartContent: true, className: \"pl-8\" },\r\n { size: \"xs\", withEndContent: true, className: \"pr-8\" },\r\n { size: \"sm\", withStartContent: true, className: \"pl-9\" },\r\n { size: \"sm\", withEndContent: true, className: \"pr-9\" },\r\n { size: \"md\", withStartContent: true, className: \"pl-9.5\" },\r\n { size: \"md\", withEndContent: true, className: \"pr-9.5\" },\r\n { size: \"lg\", withStartContent: true, className: \"pl-10\" },\r\n { size: \"lg\", withEndContent: true, className: \"pr-10\" },\r\n { size: \"xl\", withStartContent: true, className: \"pl-11\" },\r\n { size: \"xl\", withEndContent: true, className: \"pr-11\" },\r\n ],\r\n defaultVariants: {\r\n size: \"md\",\r\n }\r\n }\r\n)\r\n\r\nconst inputIconVariants = cva(\r\n \"absolute top-1/2 -translate-y-1/2 text-fg-quaternary [&_svg]:size-full\",\r\n {\r\n variants: {\r\n side: {\r\n start: \"left-3\",\r\n end: \"right-3\",\r\n },\r\n size: {\r\n \"3xs\": \"size-3.5\",\r\n \"2xs\": \"size-3.5\",\r\n xs: \"size-4\",\r\n sm: \"size-4\",\r\n md: \"size-4.5\",\r\n lg: \"size-5\",\r\n xl: \"size-5\",\r\n },\r\n },\r\n compoundVariants: [\r\n { side: \"start\", size: \"3xs\", className: \"left-2\" },\r\n { side: \"end\", size: \"3xs\", className: \"right-2\" },\r\n { side: \"start\", size: \"2xs\", className: \"left-2\" },\r\n { side: \"end\", size: \"2xs\", className: \"right-2\" },\r\n { side: \"start\", size: \"xs\", className: \"left-2.5\" },\r\n { side: \"end\", size: \"xs\", className: \"right-2.5\" },\r\n { side: \"start\", size: \"sm\", className: \"left-3\" },\r\n { side: \"end\", size: \"sm\", className: \"right-3\" },\r\n { side: \"start\", size: \"md\", className: \"left-3\" },\r\n { side: \"end\", size: \"md\", className: \"right-3\" },\r\n { side: \"start\", size: \"lg\", className: \"left-3.5\" },\r\n { side: \"end\", size: \"lg\", className: \"right-3.5\" },\r\n { side: \"start\", size: \"xl\", className: \"left-4\" },\r\n { side: \"end\", size: \"xl\", className: \"right-4\" },\r\n ],\r\n defaultVariants: {\r\n side: \"start\",\r\n size: \"md\",\r\n },\r\n }\r\n)\r\n\r\nfunction Input({\r\n className,\r\n wrapperClassName,\r\n type,\r\n startContent,\r\n endContent,\r\n variant,\r\n size,\r\n ...props\r\n}: Omit<React.ComponentProps<\"input\">, \"size\"> &\r\n VariantProps<typeof inputVariants> & {\r\n startContent?: React.ReactNode\r\n endContent?: React.ReactNode\r\n wrapperClassName?: string\r\n }\r\n) {\r\n const [showPassword, setShowPassword] = React.useState(false)\r\n\r\n const isWrapped = !!startContent || !!endContent || variant === \"password\"\r\n\r\n const Comp = isWrapped ? \"div\" : React.Fragment\r\n\r\n return (\r\n <Comp {...(isWrapped ? { className: cn(\"relative\", wrapperClassName) } : {})}>\r\n <input\r\n className={cn(inputVariants({ withStartContent: !!startContent, withEndContent: (!!endContent || variant === \"password\"), size }), className)}\r\n data-slot=\"input\"\r\n type={variant === \"password\" ? (showPassword ? \"text\" : \"password\") : type}\r\n {...props}\r\n />\r\n {startContent && (\r\n <Slot className={cn(inputIconVariants({ side: \"start\", size }))}>\r\n {startContent}\r\n </Slot>\r\n )}\r\n {(endContent && variant !== \"password\") && (\r\n <Slot className={cn(inputIconVariants({ side: \"end\", size }))}>\r\n {endContent}\r\n </Slot>\r\n )}\r\n {variant === \"password\" && (\r\n <Slot\r\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\r\n className=\"cursor-pointer select-none\"\r\n data-slot=\"toggle-password\"\r\n onClick={() => setShowPassword((prev) => !prev)}\r\n >\r\n {showPassword ? (\r\n <ShowPasswordsIcon className={cn(inputIconVariants({ side: \"end\", size }))} />\r\n ) : (\r\n <HidePasswordsIcon className={cn(inputIconVariants({ side: \"end\", size }))} />\r\n )}\r\n </Slot>\r\n )}\r\n </Comp>\r\n )\r\n}\r\n\r\nexport { Input, inputVariants }\r\n\r\n"]}
@@ -1,2 +1,2 @@
1
- import {a,b as b$1,j,i,k,l,m,q,s,w,x,H}from'./chunk-IZQFTYJD.js';import {g}from'./chunk-HHG7BSWN.js';import {b}from'./chunk-JH6RZ3QH.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {SearchIcon,XIcon}from'lucide-react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function ee({multiple:B=true,inputPlaceholder:q$1="Search...",container:A,items:u,infiniteScroll:H$1,isPending:U,taggable:b$2=false,maxVisible:i$1,...m$1}){let[h,x$1]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[c,g$1]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[v,I]=r.useState([]),p=r.useRef(new Set);r.useEffect(()=>{let e=new Set(c.map(t=>t.value));I(t=>{let l=t.filter(a=>e.has(a.value));return l.length===t.length?t:(p.current=new Set(l.map(a=>a.value)),l)});},[c]);let n=h?.toString().trim()??"",X=r.useMemo(()=>n?c.some(e=>e.value.toLowerCase()===n.toLowerCase()):false,[n,c]),C=r.useMemo(()=>!b$2||!n?false:!u?.some(e=>e.label.toLowerCase()===n.toLowerCase()),[b$2,n,u]),D=r.useMemo(()=>{let e=[...u??[],...v];if(C){let t={label:n,value:n,tag:true};return [...e,t]}return e},[u,v,C,n]);return jsxs(a,{...m$1,behavior:"chip-outside",multiple:true,items:b$2?D:u,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{if(b$2){let l=e.filter(a=>a?.tag===true&&!p.current.has(a.value));if(l.length>0){for(let a of l)p.current.add(a.value);I(a=>[...a,...l]);}}g$1(B?e:[e[e.length-1]],t);},onInputValueChange:x$1,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(g,{render:jsx(b,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(b$1,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!h,"data-slot":"combobox-clear-input",onClick:e=>{x$1("",{reason:"none",event:e.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:q$1,startContent:jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),wrapperClassName:"w-full"})}),jsx(j,{className:cn(i$1!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(i,{children:e=>{let t=i$1!==void 0?e.slice(0,i$1):e,l$1=i$1!==void 0?e.length-i$1:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(k,{className:cn(i$1!==void 0&&"min-w-0 shrink"),children:[i$1!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(l,{})]},a?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}})})]}),jsxs(m,{container:A,children:[jsx(q,{status:U||u===void 0?"pending":u?.length===0&&!C?"empty":null}),jsxs(s,{children:[u?.map(e=>jsx(w,{value:{label:e.label,value:e.value},children:jsx(x,{children:e.label})},e.value)),C&&jsx(w,{value:{label:n,value:n,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!X&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:n})]})}),jsx(H,{...H$1})]})]})]})}export{ee as a};//# sourceMappingURL=chunk-ON7PUZWI.js.map
2
- //# sourceMappingURL=chunk-ON7PUZWI.js.map
1
+ import {a,b as b$1,j,i,k,l,m,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import {g}from'./chunk-HHG7BSWN.js';import {b}from'./chunk-Y6TKCAAJ.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {SearchIcon,XIcon}from'lucide-react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function ee({multiple:B=true,inputPlaceholder:q$1="Search...",container:A,items:u,infiniteScroll:H$1,isPending:U,taggable:b$2=false,maxVisible:i$1,...m$1}){let[h,x$1]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[c,g$1]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[v,I]=r.useState([]),p=r.useRef(new Set);r.useEffect(()=>{let e=new Set(c.map(t=>t.value));I(t=>{let l=t.filter(a=>e.has(a.value));return l.length===t.length?t:(p.current=new Set(l.map(a=>a.value)),l)});},[c]);let n=h?.toString().trim()??"",X=r.useMemo(()=>n?c.some(e=>e.value.toLowerCase()===n.toLowerCase()):false,[n,c]),C=r.useMemo(()=>!b$2||!n?false:!u?.some(e=>e.label.toLowerCase()===n.toLowerCase()),[b$2,n,u]),D=r.useMemo(()=>{let e=[...u??[],...v];if(C){let t={label:n,value:n,tag:true};return [...e,t]}return e},[u,v,C,n]);return jsxs(a,{...m$1,behavior:"chip-outside",multiple:true,items:b$2?D:u,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{if(b$2){let l=e.filter(a=>a?.tag===true&&!p.current.has(a.value));if(l.length>0){for(let a of l)p.current.add(a.value);I(a=>[...a,...l]);}}g$1(B?e:[e[e.length-1]],t);},onInputValueChange:x$1,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(g,{render:jsx(b,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(b$1,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!h,"data-slot":"combobox-clear-input",onClick:e=>{x$1("",{reason:"none",event:e.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:q$1,startContent:jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),wrapperClassName:"w-full"})}),jsx(j,{className:cn(i$1!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(i,{children:e=>{let t=i$1!==void 0?e.slice(0,i$1):e,l$1=i$1!==void 0?e.length-i$1:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(k,{className:cn(i$1!==void 0&&"min-w-0 shrink"),children:[i$1!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(l,{})]},a?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}})})]}),jsxs(m,{container:A,children:[jsx(q,{status:U||u===void 0?"pending":u?.length===0&&!C?"empty":null}),jsxs(s,{children:[u?.map(e=>jsx(w,{value:{label:e.label,value:e.value},children:jsx(x,{children:e.label})},e.value)),C&&jsx(w,{value:{label:n,value:n,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!X&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:n})]})}),jsx(H,{...H$1})]})]})]})}export{ee as a};//# sourceMappingURL=chunk-YNJZ2P52.js.map
2
+ //# sourceMappingURL=chunk-YNJZ2P52.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/composites/combobox-chip-outside.tsx"],"names":["ComboboxChipOutside","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","createItem","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInput","Input","ComboboxTrigger","XIcon","event","SearchIcon","ComboboxChips","cn","ComboboxValue","visible","overflow","Fragment","ComboboxChip","ComboboxChipRemove","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qWA6CA,SAASA,EAAAA,CAAgF,CACvF,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,UAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,IAAW,KAAA,CACX,UAAA,CAAAC,GAAAA,CACA,GAAGC,GACL,CAAA,CAAoC,CAClC,GAAM,CAACC,EAAYC,GAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,GAC1B,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,QAAA,GACxC,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,EAEK,CAACI,CAAAA,CAAOC,GAAQ,CAAA,CAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,OAAS,EAAC,CACxB,YAAA,CAAcA,GAAAA,EAAO,cAAgB,EAAC,CACtC,QAAA,CAAUA,GAAAA,EAAO,aACnB,CAAC,CAAA,CAIK,CAACM,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAAkB,EAAE,CAAA,CAC5DC,CAAAA,CAAyB,CAAA,CAAA,MAAA,CAAoB,IAAI,GAAK,CAAA,CAEtD,CAAA,CAAA,SAAA,CAAU,IAAM,CACpB,IAAMC,CAAAA,CAAgB,IAAI,GAAA,CAAIL,CAAAA,CAAM,GAAA,CAAKM,CAAAA,EAAMA,CAAAA,CAAE,KAAK,CAAC,CAAA,CACvDH,CAAAA,CA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AI,SAAA,CAAU,2CACZ,QAAA,CAAA,CAAA,CAACL,CAAAA,EACAY,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,QAAA,CAAA,SAAA,CAAO,CAAA,CAE/CA,GAAAA,CAAC,QAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAb,CAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACoB,CAAAA,CAAA,CAAwB,GAAGnD,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-ON7PUZWI.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { ComboboxInput as ComboboxInputPrimitive } from \"../primitives/combobox\"\r\nimport { Input } from \"../ui\"\r\nimport {\r\n Combobox,\r\n ComboboxChip,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle\r\n} from \"../ui/combobox\"\r\nimport { SearchIcon, XIcon } from \"lucide-react\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\n\r\ntype ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChipOutside<Value extends { label: string; value: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipOutsideProps<Value>) {\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 [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n // Determine if the current input has no exact match in existing items\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n const createItem = {\r\n label: trimmedInput,\r\n value: trimmedInput,\r\n tag: true,\r\n }\r\n return [...base, createItem]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n // Capture newly created taggable items internally\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true\r\n && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n // if multiple is false, we need to replace the value with the new value instead of adding to it\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n <div className=\"flex flex-col gap-2\">\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className=\"h-9 text-body-regular-3 pl-9 pr-7\"\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={inputPlaceholder}\r\n startContent={<SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n wrapperClassName=\"w-full\"\r\n />\r\n }\r\n />\r\n <ComboboxChips\r\n className={cn(maxVisible !== undefined && \"flex-nowrap overflow-hidden\")}\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChip\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChip className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChip>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n <ComboboxPopup container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={{ label: item.label, value: item.value }}\r\n >\r\n <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
1
+ {"version":3,"sources":["../src/composites/combobox-chip-outside.tsx"],"names":["ComboboxChipOutside","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","createItem","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInput","Input","ComboboxTrigger","XIcon","event","SearchIcon","ComboboxChips","cn","ComboboxValue","visible","overflow","Fragment","ComboboxChip","ComboboxChipRemove","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qWA6CA,SAASA,EAAAA,CAAgF,CACvF,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,UAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,IAAW,KAAA,CACX,UAAA,CAAAC,GAAAA,CACA,GAAGC,GACL,CAAA,CAAoC,CAClC,GAAM,CAACC,EAAYC,GAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,GAC1B,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,QAAA,GACxC,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,EAEK,CAACI,CAAAA,CAAOC,GAAQ,CAAA,CAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,OAAS,EAAC,CACxB,YAAA,CAAcA,GAAAA,EAAO,cAAgB,EAAC,CACtC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AAA,CAAO,MAAOA,CAAAA,CAAK,KAAM,CAAA,CAE9C,QAAA,CAAAc,GAAAA,CAACmB,CAAAA,CAAA,CACE,QAAA,CAAAjC,EAAK,KAAA,CACR,CAAA,CAAA,CALKA,CAAAA,CAAK,KAMZ,CACD,CAAA,CACAG,CAAAA,EACCW,GAAAA,CAACkB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO/B,CAAAA,CAAc,KAAA,CAAOA,CAAAA,CAAc,GAAA,CAAK,IAAK,EAE7D,QAAA,CAAAM,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2CACZ,QAAA,CAAA,CAAA,CAACL,CAAAA,EACAY,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,QAAA,CAAA,SAAA,CAAO,CAAA,CAE/CA,GAAAA,CAAC,QAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAb,CAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACoB,CAAAA,CAAA,CAAwB,GAAGnD,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-YNJZ2P52.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { ComboboxInput as ComboboxInputPrimitive } from \"../primitives/combobox\"\r\nimport { Input } from \"../ui\"\r\nimport {\r\n Combobox,\r\n ComboboxChip,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle\r\n} from \"../ui/combobox\"\r\nimport { SearchIcon, XIcon } from \"lucide-react\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\n\r\ntype ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChipOutside<Value extends { label: string; value: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipOutsideProps<Value>) {\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 [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n // Determine if the current input has no exact match in existing items\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n const createItem = {\r\n label: trimmedInput,\r\n value: trimmedInput,\r\n tag: true,\r\n }\r\n return [...base, createItem]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n // Capture newly created taggable items internally\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true\r\n && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n // if multiple is false, we need to replace the value with the new value instead of adding to it\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n <div className=\"flex flex-col gap-2\">\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className=\"h-9 text-body-regular-3 pl-9 pr-7\"\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={inputPlaceholder}\r\n startContent={<SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n wrapperClassName=\"w-full\"\r\n />\r\n }\r\n />\r\n <ComboboxChips\r\n className={cn(maxVisible !== undefined && \"flex-nowrap overflow-hidden\")}\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChip\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChip className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChip>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n <ComboboxPopup container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={{ label: item.label, value: item.value }}\r\n >\r\n <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}