@nuvia/components 1.4.0 → 1.4.2

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 (49) hide show
  1. package/dist/index.cjs +254 -217
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +254 -217
  4. package/dist/index.js.map +1 -1
  5. package/dist/ui/alert.d.cts +1 -1
  6. package/dist/ui/alert.d.ts +1 -1
  7. package/dist/ui/combobox.cjs +100 -77
  8. package/dist/ui/combobox.cjs.map +1 -1
  9. package/dist/ui/combobox.js +100 -77
  10. package/dist/ui/combobox.js.map +1 -1
  11. package/dist/ui/command.cjs +1 -1
  12. package/dist/ui/command.cjs.map +1 -1
  13. package/dist/ui/command.d.cts +7 -7
  14. package/dist/ui/command.d.ts +7 -7
  15. package/dist/ui/command.js +1 -1
  16. package/dist/ui/command.js.map +1 -1
  17. package/dist/ui/context-menu.cjs +1 -1
  18. package/dist/ui/context-menu.cjs.map +1 -1
  19. package/dist/ui/context-menu.js +1 -1
  20. package/dist/ui/context-menu.js.map +1 -1
  21. package/dist/ui/input-otp.d.cts +2 -2
  22. package/dist/ui/input-otp.d.ts +2 -2
  23. package/dist/ui/multi-combobox.cjs +149 -135
  24. package/dist/ui/multi-combobox.cjs.map +1 -1
  25. package/dist/ui/multi-combobox.js +149 -135
  26. package/dist/ui/multi-combobox.js.map +1 -1
  27. package/dist/ui/navigation-menu.cjs +1 -1
  28. package/dist/ui/navigation-menu.cjs.map +1 -1
  29. package/dist/ui/navigation-menu.js +1 -1
  30. package/dist/ui/navigation-menu.js.map +1 -1
  31. package/dist/ui/resizable.cjs +2 -2
  32. package/dist/ui/resizable.cjs.map +1 -1
  33. package/dist/ui/resizable.d.cts +1 -1
  34. package/dist/ui/resizable.d.ts +1 -1
  35. package/dist/ui/resizable.js +2 -2
  36. package/dist/ui/resizable.js.map +1 -1
  37. package/dist/ui/scroll-area.cjs +1 -1
  38. package/dist/ui/scroll-area.cjs.map +1 -1
  39. package/dist/ui/scroll-area.js +1 -1
  40. package/dist/ui/scroll-area.js.map +1 -1
  41. package/dist/ui/separator.cjs.map +1 -1
  42. package/dist/ui/separator.js.map +1 -1
  43. package/dist/ui/sidebar.cjs.map +1 -1
  44. package/dist/ui/sidebar.js.map +1 -1
  45. package/dist/ui/table.cjs +1 -1
  46. package/dist/ui/table.cjs.map +1 -1
  47. package/dist/ui/table.js +1 -1
  48. package/dist/ui/table.js.map +1 -1
  49. package/package.json +2 -2
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "primary" | "destructive" | "warning" | null | undefined;
6
+ variant?: "default" | "destructive" | "primary" | "warning" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "primary" | "destructive" | "warning" | null | undefined;
6
+ variant?: "default" | "destructive" | "primary" | "warning" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -138,7 +138,7 @@ var CommandSeparator = React2__namespace.forwardRef(({ className, ...props }, re
138
138
  cmdk.Command.Separator,
139
139
  {
140
140
  ref,
141
- className: cn("-mx-1 h-px bg-border", className),
141
+ className: cn("-mx-1 h-px bg-card", className),
142
142
  ...props
143
143
  }
144
144
  ));
@@ -169,84 +169,107 @@ var PopoverContent = React2__namespace.forwardRef(({ className, align = "center"
169
169
  }
170
170
  ) }));
171
171
  PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
172
- var Combobox = React2__namespace.forwardRef(({
173
- options,
174
- placeholder = "Select option...",
175
- searchPlaceholder = "Search...",
176
- emptyMessage = "No option found.",
177
- className,
178
- value: controlledValue,
179
- onValueChange,
180
- onSelect,
181
- asChild,
182
- children
183
- }, ref) => {
184
- const [open, setOpen] = React2__namespace.useState(false);
185
- const [value, setValue] = React2__namespace.useState(controlledValue || (Array.isArray(controlledValue) ? [] : ""));
186
- const [search, setSearch] = React2__namespace.useState("");
187
- React2__namespace.useEffect(() => {
188
- if (controlledValue !== void 0) {
189
- setValue(controlledValue);
190
- }
191
- }, [controlledValue]);
192
- const handleSelect = React2__namespace.useCallback((currentValue) => {
193
- let newValue;
194
- if (Array.isArray(value)) {
195
- newValue = value.includes(currentValue) ? value.filter((v) => v !== currentValue) : [...value, currentValue];
196
- } else {
197
- newValue = currentValue === value ? "" : currentValue;
198
- }
199
- setValue(newValue);
200
- onValueChange?.(newValue);
201
- onSelect?.(newValue);
202
- setOpen(false);
203
- }, [value, onValueChange, onSelect]);
204
- return /* @__PURE__ */ jsxRuntime.jsxs(PopoverPrimitive.Popover, { open, onOpenChange: setOpen, children: [
205
- /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsxs(
206
- Button,
207
- {
208
- variant: "outline",
209
- role: "combobox",
210
- "aria-expanded": open,
211
- className: cn("w-full justify-between", className),
212
- children: [
213
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground font-normal", children: Array.isArray(value) ? value.map((val) => options.find((option) => option.value === val)?.label).join(", ") : options.find((option) => option.value === value)?.label || placeholder }),
214
- /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronDownIcon, { className: "opacity-50" })
215
- ]
172
+ var Combobox = React2__namespace.forwardRef(
173
+ ({
174
+ options,
175
+ placeholder = "Select option...",
176
+ searchPlaceholder = "Search...",
177
+ emptyMessage = "No option found.",
178
+ className,
179
+ value: controlledValue,
180
+ onValueChange,
181
+ onSelect,
182
+ asChild,
183
+ children
184
+ }, ref) => {
185
+ const [open, setOpen] = React2__namespace.useState(false);
186
+ const [value, setValue] = React2__namespace.useState(
187
+ controlledValue || (Array.isArray(controlledValue) ? [] : "")
188
+ );
189
+ const [search, setSearch] = React2__namespace.useState("");
190
+ React2__namespace.useEffect(() => {
191
+ if (controlledValue !== void 0) {
192
+ setValue(controlledValue);
216
193
  }
217
- ) }),
218
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: cn("w-full p-0 !rounded-xl border-none", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "rounded-xl border", children: [
219
- /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: searchPlaceholder, className: "h-9 w-full" }),
220
- /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
221
- /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: emptyMessage }),
222
- /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
223
- CommandItem,
224
- {
225
- keywords: [option.label],
226
- className: "rounded-lg",
227
- value: option.value,
228
- onSelect: () => handleSelect(option.value),
229
- onKeyUp: (e) => e.key === "Enter" && handleSelect(option.value),
230
- onKeyDown: (e) => e.key === "Enter" && handleSelect(option.value),
231
- children: [
232
- option.label,
233
- /* @__PURE__ */ jsxRuntime.jsx(
234
- reactIcons.CheckIcon,
194
+ }, [controlledValue]);
195
+ const handleSelect = React2__namespace.useCallback(
196
+ (currentValue) => {
197
+ let newValue;
198
+ if (Array.isArray(value)) {
199
+ newValue = value.includes(currentValue) ? value.filter((v) => v !== currentValue) : [...value, currentValue];
200
+ } else {
201
+ newValue = currentValue === value ? "" : currentValue;
202
+ }
203
+ setValue(newValue);
204
+ onValueChange?.(newValue);
205
+ onSelect?.(newValue);
206
+ setOpen(false);
207
+ },
208
+ [value, onValueChange, onSelect]
209
+ );
210
+ return /* @__PURE__ */ jsxRuntime.jsxs(PopoverPrimitive.Popover, { open, onOpenChange: setOpen, children: [
211
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsxs(
212
+ Button,
213
+ {
214
+ variant: "outline",
215
+ role: "combobox",
216
+ "aria-expanded": open,
217
+ className: cn("w-full justify-between", className),
218
+ children: [
219
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground font-normal", children: Array.isArray(value) ? value.map(
220
+ (val) => options.find((option) => option.value === val)?.label
221
+ ).join(", ") : options.find((option) => option.value === value)?.label || placeholder }),
222
+ /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronDownIcon, { className: "opacity-50" })
223
+ ]
224
+ }
225
+ ) }),
226
+ /* @__PURE__ */ jsxRuntime.jsx(
227
+ PopoverContent,
228
+ {
229
+ className: cn("w-full p-0 !rounded-xl border-none", className),
230
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "rounded-xl border", children: [
231
+ /* @__PURE__ */ jsxRuntime.jsx(
232
+ CommandInput,
233
+ {
234
+ value: search,
235
+ onValueChange: setSearch,
236
+ placeholder: searchPlaceholder,
237
+ className: "h-9 w-full"
238
+ }
239
+ ),
240
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
241
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: emptyMessage }),
242
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
243
+ CommandItem,
235
244
  {
236
- className: cn(
237
- "ml-auto",
238
- Array.isArray(value) ? value.includes(option.value) ? "opacity-100" : "opacity-0" : value === option.value ? "opacity-100" : "opacity-0"
239
- )
240
- }
241
- )
242
- ]
243
- },
244
- option.value
245
- )) })
246
- ] })
247
- ] }) })
248
- ] });
249
- });
245
+ keywords: [option.label],
246
+ className: "rounded-lg",
247
+ value: option.value,
248
+ onSelect: () => handleSelect(option.value),
249
+ onKeyUp: (e) => e.key === "Enter" && handleSelect(option.value),
250
+ onKeyDown: (e) => e.key === "Enter" && handleSelect(option.value),
251
+ children: [
252
+ option.label,
253
+ /* @__PURE__ */ jsxRuntime.jsx(
254
+ reactIcons.CheckIcon,
255
+ {
256
+ className: cn(
257
+ "ml-auto",
258
+ Array.isArray(value) ? value.includes(option.value) ? "opacity-100" : "opacity-0" : value === option.value ? "opacity-100" : "opacity-0"
259
+ )
260
+ }
261
+ )
262
+ ]
263
+ },
264
+ `${option.value}-${option.label}`
265
+ )) })
266
+ ] })
267
+ ] })
268
+ }
269
+ )
270
+ ] });
271
+ }
272
+ );
250
273
  Combobox.displayName = "Combobox";
251
274
 
252
275
  exports.Combobox = Combobox;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx","../../src/ui/command.tsx","../../src/ui/popover.tsx","../../src/ui/combobox.tsx"],"names":["twMerge","clsx","cva","React","Slot","jsx","React2","CommandPrimitive","jsxs","MagnifyingGlassIcon","React3","PopoverPrimitive","React4","Popover","PopoverTrigger","ChevronDownIcon","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiCA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;ACE3E,IAAM,cAAA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,CAAO,KAAA;AAAA,8BACRH,cAAAA;AAAA,gBAACW,oBAAA;AAAA,gBAAA;AAAA,kBACC,SAAA,EAAW,EAAA;AAAA,oBACT,SAAA;AAAA,oBACA,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,MAAM,QAAA,CAAS,MAAA,CAAO,KAAK,CAAA,GAAI,aAAA,GAAgB,WAAA,GAAgB,KAAA,KAAU,MAAA,CAAO,QAAQ,aAAA,GAAgB;AAAA;AAClI;AAAA;AACF;AAAA,WAAA;AAAA,UAZK,MAAA,CAAO;AAAA,SAcf,CAAA,EACH;AAAA,OAAA,EACF;AAAA,KAAA,EACF,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ,CAAC;AAED,QAAA,CAAS,WAAA,GAAc,UAAA","file":"combobox.cjs","sourcesContent":["import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { toast } from \"sonner\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\nexport const capitalize = (str: string) =>\n str?.charAt(0)?.toUpperCase() + str?.slice(1);\n\nexport const handleError = (error: { message: string }): void => {\n toast.error(error.message);\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#5A6FC0] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-foreground-primary-medium text-white shadow hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-secondary hover:text-accent-foreground text-foreground-secondary-heavy\",\n secondary:\n \"bg-background-secondary-light hover:background-secondary-light/40 text-foreground-secondary-heavy\",\n ghost:\n \"text-foreground-secondary-heavy hover:bg-background-secondary-light\",\n link: \"text-text-links hover:bg-background-secondary-light\",\n accent: \"bg-accent nuvia-gradient-1 text-white\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n xs: \"h-[30px] px-3 rounded-xl text-xs\",\n sm: \"h-9 rounded-xl px-3 text-xs\",\n lg: \"h-12 rounded-xl px-8\",\n icon: \"h-10 w-10 min-w-10\",\n \"icon-xs\": \"h-[30px] w-[30px] min-w-[30px]\",\n \"icon-sm\": \"h-9 w-9 min-w-9\",\n bullet: \"h-8 w-8 min-w-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandDialog = ({ children, ...props }: DialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary/25 data-[selected=true]:bg-secondary/50 data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-xl border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n","\"use client\"\n\nimport { Popover, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport * as React from \"react\"\nimport { Button } from \"./button\"\nimport { cn } from \"../lib/utils\"\nimport { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from \"./command\"\nimport { PopoverContent } from \"./popover\"\nimport { CheckIcon, ChevronDownIcon } from \"@radix-ui/react-icons\"\n\ninterface ComboboxOption {\n value: string\n label: string\n}\n\ninterface ComboboxProps {\n children?: React.ReactNode\n options: ComboboxOption[]\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n className?: string\n\n asChild?: boolean\n \n value?: string | string[] // Allow single or multiple selection\n onValueChange?: (value: string | string[]) => void // Update type for value change\n onSelect?: (value: string | string[]) => void // Update type for select\n}\n\nconst Combobox = React.forwardRef<HTMLDivElement, ComboboxProps>(({\n options,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No option found.\",\n className,\n value: controlledValue,\n onValueChange, \n onSelect,\n asChild,\n children,\n}, ref) => {\n const [open, setOpen] = React.useState(false)\n const [value, setValue] = React.useState<string | string[]>(controlledValue || (Array.isArray(controlledValue) ? [] : \"\"))\n const [search, setSearch] = React.useState(\"\")\n\n React.useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue)\n }\n }, [controlledValue])\n\n const handleSelect = React.useCallback((currentValue: string) => {\n let newValue: string | string[];\n if (Array.isArray(value)) {\n newValue = value.includes(currentValue) ? value.filter(v => v !== currentValue) : [...value, currentValue];\n } else {\n newValue = currentValue === value ? \"\" : currentValue;\n }\n setValue(newValue);\n onValueChange?.(newValue);\n onSelect?.(newValue);\n setOpen(false);\n }, [value, onValueChange, onSelect])\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {\n asChild ? children : (\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n className={cn(\"w-full justify-between\", className)}\n >\n <span className=\"text-sm text-muted-foreground font-normal\">{Array.isArray(value) \n ? value.map(val => options.find(option => option.value === val)?.label).join(\", \") \n : options.find(option => option.value === value)?.label || placeholder}</span>\n <ChevronDownIcon className=\"opacity-50\" />\n </Button>\n )\n }\n </PopoverTrigger>\n <PopoverContent className={cn(\"w-full p-0 !rounded-xl border-none\", className)}>\n <Command className=\"rounded-xl border\">\n <CommandInput value={search} onValueChange={setSearch} placeholder={searchPlaceholder} className=\"h-9 w-full\" />\n <CommandList>\n <CommandEmpty>{emptyMessage}</CommandEmpty>\n <CommandGroup>\n {options.map((option) => (\n <CommandItem\n keywords={[option.label]}\n className=\"rounded-lg\"\n key={option.value}\n value={option.value}\n onSelect={() => handleSelect(option.value)}\n onKeyUp={(e) => e.key === 'Enter' && handleSelect(option.value)}\n onKeyDown={(e) => e.key === 'Enter' && handleSelect(option.value)}\n >\n {option.label}\n <CheckIcon\n className={cn(\n \"ml-auto\",\n Array.isArray(value) ? (value.includes(option.value) ? \"opacity-100\" : \"opacity-0\") : (value === option.value ? \"opacity-100\" : \"opacity-0\")\n )}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n})\n\nCombobox.displayName = \"Combobox\"\n\nexport { Combobox }"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx","../../src/ui/command.tsx","../../src/ui/popover.tsx","../../src/ui/combobox.tsx"],"names":["twMerge","clsx","cva","React","Slot","jsx","React2","CommandPrimitive","jsxs","MagnifyingGlassIcon","React3","PopoverPrimitive","React4","Popover","PopoverTrigger","ChevronDownIcon","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiCA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;ACE3E,IAAM,cAAA,GAAiBC,0BAAA;AAAA,EACrB,ySAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EACE,uEAAA;AAAA,QACF,WAAA,EACE,uEAAA;AAAA,QACF,OAAA,EACE,mHAAA;AAAA,QACF,SAAA,EACE,mGAAA;AAAA,QACF,KAAA,EACE,qEAAA;AAAA,QACF,IAAA,EAAM,qDAAA;AAAA,QACN,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,gBAAA;AAAA,QACT,EAAA,EAAI,kCAAA;AAAA,QACJ,EAAA,EAAI,6BAAA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AAA,CAAA,EAAI,OAAO,KAAK,CAAA;AAAA,eAwBvC,CAAA,EACH;AAAA,aAAA,EACF;AAAA,WAAA,EACF;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"combobox.cjs","sourcesContent":["import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { toast } from \"sonner\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\nexport const capitalize = (str: string) =>\n str?.charAt(0)?.toUpperCase() + str?.slice(1);\n\nexport const handleError = (error: { message: string }): void => {\n toast.error(error.message);\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#5A6FC0] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-foreground-primary-medium text-white shadow hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-secondary hover:text-accent-foreground text-foreground-secondary-heavy\",\n secondary:\n \"bg-background-secondary-light hover:background-secondary-light/40 text-foreground-secondary-heavy\",\n ghost:\n \"text-foreground-secondary-heavy hover:bg-background-secondary-light\",\n link: \"text-text-links hover:bg-background-secondary-light\",\n accent: \"bg-accent nuvia-gradient-1 text-white\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n xs: \"h-[30px] px-3 rounded-xl text-xs\",\n sm: \"h-9 rounded-xl px-3 text-xs\",\n lg: \"h-12 rounded-xl px-8\",\n icon: \"h-10 w-10 min-w-10\",\n \"icon-xs\": \"h-[30px] w-[30px] min-w-[30px]\",\n \"icon-sm\": \"h-9 w-9 min-w-9\",\n bullet: \"h-8 w-8 min-w-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandDialog = ({ children, ...props }: DialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-card\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary/25 data-[selected=true]:bg-secondary/50 data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-xl border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n","\"use client\";\n\nimport { Popover, PopoverTrigger } from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { Button } from \"./button\";\nimport { cn } from \"../lib/utils\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"./command\";\nimport { PopoverContent } from \"./popover\";\nimport { CheckIcon, ChevronDownIcon } from \"@radix-ui/react-icons\";\n\ninterface ComboboxOption {\n value: string;\n label: string;\n}\n\ninterface ComboboxProps {\n children?: React.ReactNode;\n options: ComboboxOption[];\n placeholder?: string;\n searchPlaceholder?: string;\n emptyMessage?: string;\n className?: string;\n\n asChild?: boolean;\n\n value?: string | string[]; // Allow single or multiple selection\n onValueChange?: (value: string | string[]) => void; // Update type for value change\n onSelect?: (value: string | string[]) => void; // Update type for select\n}\n\nconst Combobox = React.forwardRef<HTMLDivElement, ComboboxProps>(\n (\n {\n options,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No option found.\",\n className,\n value: controlledValue,\n onValueChange,\n onSelect,\n asChild,\n children,\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const [value, setValue] = React.useState<string | string[]>(\n controlledValue || (Array.isArray(controlledValue) ? [] : \"\"),\n );\n const [search, setSearch] = React.useState(\"\");\n\n React.useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue);\n }\n }, [controlledValue]);\n\n const handleSelect = React.useCallback(\n (currentValue: string) => {\n let newValue: string | string[];\n if (Array.isArray(value)) {\n newValue = value.includes(currentValue)\n ? value.filter((v) => v !== currentValue)\n : [...value, currentValue];\n } else {\n newValue = currentValue === value ? \"\" : currentValue;\n }\n setValue(newValue);\n onValueChange?.(newValue);\n onSelect?.(newValue);\n setOpen(false);\n },\n [value, onValueChange, onSelect],\n );\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n {asChild ? (\n children\n ) : (\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n className={cn(\"w-full justify-between\", className)}\n >\n <span className=\"text-sm text-muted-foreground font-normal\">\n {Array.isArray(value)\n ? value\n .map(\n (val) =>\n options.find((option) => option.value === val)?.label,\n )\n .join(\", \")\n : options.find((option) => option.value === value)?.label ||\n placeholder}\n </span>\n <ChevronDownIcon className=\"opacity-50\" />\n </Button>\n )}\n </PopoverTrigger>\n <PopoverContent\n className={cn(\"w-full p-0 !rounded-xl border-none\", className)}\n >\n <Command className=\"rounded-xl border\">\n <CommandInput\n value={search}\n onValueChange={setSearch}\n placeholder={searchPlaceholder}\n className=\"h-9 w-full\"\n />\n <CommandList>\n <CommandEmpty>{emptyMessage}</CommandEmpty>\n <CommandGroup>\n {options.map((option) => (\n <CommandItem\n keywords={[option.label]}\n className=\"rounded-lg\"\n key={`${option.value}-${option.label}`}\n value={option.value}\n onSelect={() => handleSelect(option.value)}\n onKeyUp={(e) =>\n e.key === \"Enter\" && handleSelect(option.value)\n }\n onKeyDown={(e) =>\n e.key === \"Enter\" && handleSelect(option.value)\n }\n >\n {option.label}\n <CheckIcon\n className={cn(\n \"ml-auto\",\n Array.isArray(value)\n ? value.includes(option.value)\n ? \"opacity-100\"\n : \"opacity-0\"\n : value === option.value\n ? \"opacity-100\"\n : \"opacity-0\",\n )}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nCombobox.displayName = \"Combobox\";\n\nexport { Combobox };\n"]}
@@ -116,7 +116,7 @@ var CommandSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @_
116
116
  Command$1.Separator,
117
117
  {
118
118
  ref,
119
- className: cn("-mx-1 h-px bg-border", className),
119
+ className: cn("-mx-1 h-px bg-card", className),
120
120
  ...props
121
121
  }
122
122
  ));
@@ -147,84 +147,107 @@ var PopoverContent = React2.forwardRef(({ className, align = "center", sideOffse
147
147
  }
148
148
  ) }));
149
149
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
150
- var Combobox = React2.forwardRef(({
151
- options,
152
- placeholder = "Select option...",
153
- searchPlaceholder = "Search...",
154
- emptyMessage = "No option found.",
155
- className,
156
- value: controlledValue,
157
- onValueChange,
158
- onSelect,
159
- asChild,
160
- children
161
- }, ref) => {
162
- const [open, setOpen] = React2.useState(false);
163
- const [value, setValue] = React2.useState(controlledValue || (Array.isArray(controlledValue) ? [] : ""));
164
- const [search, setSearch] = React2.useState("");
165
- React2.useEffect(() => {
166
- if (controlledValue !== void 0) {
167
- setValue(controlledValue);
168
- }
169
- }, [controlledValue]);
170
- const handleSelect = React2.useCallback((currentValue) => {
171
- let newValue;
172
- if (Array.isArray(value)) {
173
- newValue = value.includes(currentValue) ? value.filter((v) => v !== currentValue) : [...value, currentValue];
174
- } else {
175
- newValue = currentValue === value ? "" : currentValue;
176
- }
177
- setValue(newValue);
178
- onValueChange?.(newValue);
179
- onSelect?.(newValue);
180
- setOpen(false);
181
- }, [value, onValueChange, onSelect]);
182
- return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
183
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: asChild ? children : /* @__PURE__ */ jsxs(
184
- Button,
185
- {
186
- variant: "outline",
187
- role: "combobox",
188
- "aria-expanded": open,
189
- className: cn("w-full justify-between", className),
190
- children: [
191
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground font-normal", children: Array.isArray(value) ? value.map((val) => options.find((option) => option.value === val)?.label).join(", ") : options.find((option) => option.value === value)?.label || placeholder }),
192
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "opacity-50" })
193
- ]
150
+ var Combobox = React2.forwardRef(
151
+ ({
152
+ options,
153
+ placeholder = "Select option...",
154
+ searchPlaceholder = "Search...",
155
+ emptyMessage = "No option found.",
156
+ className,
157
+ value: controlledValue,
158
+ onValueChange,
159
+ onSelect,
160
+ asChild,
161
+ children
162
+ }, ref) => {
163
+ const [open, setOpen] = React2.useState(false);
164
+ const [value, setValue] = React2.useState(
165
+ controlledValue || (Array.isArray(controlledValue) ? [] : "")
166
+ );
167
+ const [search, setSearch] = React2.useState("");
168
+ React2.useEffect(() => {
169
+ if (controlledValue !== void 0) {
170
+ setValue(controlledValue);
194
171
  }
195
- ) }),
196
- /* @__PURE__ */ jsx(PopoverContent, { className: cn("w-full p-0 !rounded-xl border-none", className), children: /* @__PURE__ */ jsxs(Command, { className: "rounded-xl border", children: [
197
- /* @__PURE__ */ jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: searchPlaceholder, className: "h-9 w-full" }),
198
- /* @__PURE__ */ jsxs(CommandList, { children: [
199
- /* @__PURE__ */ jsx(CommandEmpty, { children: emptyMessage }),
200
- /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
201
- CommandItem,
202
- {
203
- keywords: [option.label],
204
- className: "rounded-lg",
205
- value: option.value,
206
- onSelect: () => handleSelect(option.value),
207
- onKeyUp: (e) => e.key === "Enter" && handleSelect(option.value),
208
- onKeyDown: (e) => e.key === "Enter" && handleSelect(option.value),
209
- children: [
210
- option.label,
211
- /* @__PURE__ */ jsx(
212
- CheckIcon,
172
+ }, [controlledValue]);
173
+ const handleSelect = React2.useCallback(
174
+ (currentValue) => {
175
+ let newValue;
176
+ if (Array.isArray(value)) {
177
+ newValue = value.includes(currentValue) ? value.filter((v) => v !== currentValue) : [...value, currentValue];
178
+ } else {
179
+ newValue = currentValue === value ? "" : currentValue;
180
+ }
181
+ setValue(newValue);
182
+ onValueChange?.(newValue);
183
+ onSelect?.(newValue);
184
+ setOpen(false);
185
+ },
186
+ [value, onValueChange, onSelect]
187
+ );
188
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
189
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: asChild ? children : /* @__PURE__ */ jsxs(
190
+ Button,
191
+ {
192
+ variant: "outline",
193
+ role: "combobox",
194
+ "aria-expanded": open,
195
+ className: cn("w-full justify-between", className),
196
+ children: [
197
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground font-normal", children: Array.isArray(value) ? value.map(
198
+ (val) => options.find((option) => option.value === val)?.label
199
+ ).join(", ") : options.find((option) => option.value === value)?.label || placeholder }),
200
+ /* @__PURE__ */ jsx(ChevronDownIcon, { className: "opacity-50" })
201
+ ]
202
+ }
203
+ ) }),
204
+ /* @__PURE__ */ jsx(
205
+ PopoverContent,
206
+ {
207
+ className: cn("w-full p-0 !rounded-xl border-none", className),
208
+ children: /* @__PURE__ */ jsxs(Command, { className: "rounded-xl border", children: [
209
+ /* @__PURE__ */ jsx(
210
+ CommandInput,
211
+ {
212
+ value: search,
213
+ onValueChange: setSearch,
214
+ placeholder: searchPlaceholder,
215
+ className: "h-9 w-full"
216
+ }
217
+ ),
218
+ /* @__PURE__ */ jsxs(CommandList, { children: [
219
+ /* @__PURE__ */ jsx(CommandEmpty, { children: emptyMessage }),
220
+ /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
221
+ CommandItem,
213
222
  {
214
- className: cn(
215
- "ml-auto",
216
- Array.isArray(value) ? value.includes(option.value) ? "opacity-100" : "opacity-0" : value === option.value ? "opacity-100" : "opacity-0"
217
- )
218
- }
219
- )
220
- ]
221
- },
222
- option.value
223
- )) })
224
- ] })
225
- ] }) })
226
- ] });
227
- });
223
+ keywords: [option.label],
224
+ className: "rounded-lg",
225
+ value: option.value,
226
+ onSelect: () => handleSelect(option.value),
227
+ onKeyUp: (e) => e.key === "Enter" && handleSelect(option.value),
228
+ onKeyDown: (e) => e.key === "Enter" && handleSelect(option.value),
229
+ children: [
230
+ option.label,
231
+ /* @__PURE__ */ jsx(
232
+ CheckIcon,
233
+ {
234
+ className: cn(
235
+ "ml-auto",
236
+ Array.isArray(value) ? value.includes(option.value) ? "opacity-100" : "opacity-0" : value === option.value ? "opacity-100" : "opacity-0"
237
+ )
238
+ }
239
+ )
240
+ ]
241
+ },
242
+ `${option.value}-${option.label}`
243
+ )) })
244
+ ] })
245
+ ] })
246
+ }
247
+ )
248
+ ] });
249
+ }
250
+ );
228
251
  Combobox.displayName = "Combobox";
229
252
 
230
253
  export { Combobox };