22
33import * as React from "react"
44import { Check , ChevronsUpDown , X } from "lucide-react"
5- import { cn } from "@wakflo/design-system /lib/utils"
6- import { radiusStyles , sizeStyles } from "@wakflo/design-system /lib/styles"
5+ import { cn } from "@/lib/utils"
6+ import { radiusStyles , sizeStyles } from "@/lib/styles"
77import { cva , type VariantProps } from "class-variance-authority"
8- import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@wakflo/design-system/components/ui/select"
9- import { Badge } from "@wakflo/design-system/components/ui/badge"
10- import { Button } from "@wakflo/design-system/components/ui/button"
11- import { Command , CommandEmpty , CommandGroup , CommandInput , CommandItem , CommandList } from "@wakflo/design-system/components/ui/command"
12- import { Popover , PopoverContent , PopoverTrigger } from "@wakflo/design-system/components/ui/popover"
13- import { Label } from '@wakflo/design-system/components/ui/label'
14- import { inputContainerColorStyles } from '@wakflo/design-system/components/ui/input'
8+ import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@/components/ui/select"
9+ import { Badge } from "@/components/ui/badge"
10+ import { Button } from "@/components/ui/button"
11+ import { Command , CommandEmpty , CommandGroup , CommandInput , CommandItem , CommandList } from "@/components/ui/command"
12+ import { Popover , PopoverContent , PopoverTrigger } from "@/components/ui/popover"
13+ import { Label } from "@/components/ui/label"
1514
1615const selectVariants = cva ( "w-full justify-between" , {
1716 variants : {
@@ -22,7 +21,15 @@ const selectVariants = cva("w-full justify-between", {
2221 underlined : "bg-transparent border-0 border-input border-b-2 shadow-none rounded-none" ,
2322 faded : "border-2 border-input/25 bg-muted" ,
2423 } ,
25- color : inputContainerColorStyles ,
24+ color : {
25+ default : "bg-background border-input" ,
26+ primary : "bg-primary text-primary-foreground border-primary" ,
27+ secondary : "bg-secondary text-secondary-foreground border-secondary" ,
28+ destructive : "bg-destructive text-destructive-foreground border-destructive" ,
29+ info : "bg-info text-info-foreground border-info" ,
30+ success : "bg-success text-success-foreground border-success" ,
31+ warning : "bg-warning text-warning-foreground border-warning" ,
32+ } ,
2633 // size: {
2734 // xs: "h-6 text-xs",
2835 // sm: "h-8 text-sm",
@@ -100,8 +107,7 @@ export type SelectOption<T> = {
100107
101108// Update the EnhancedSelectProps interface to include the label
102109interface EnhancedSelectProps < T extends string = string >
103- extends Omit < React . ComponentPropsWithoutRef < typeof Button > , 'color' | 'variant' | 'onChange' > ,
104- VariantProps < typeof selectVariants > {
110+ extends VariantProps < typeof selectVariants > {
105111 options : SelectOption < T > [ ]
106112 optionValue ?: keyof SelectOption < T >
107113 optionLabel ?: keyof SelectOption < T >
@@ -147,7 +153,6 @@ export const EnhancedSelect = React.forwardRef<HTMLButtonElement, EnhancedSelect
147153 value,
148154 onChange,
149155 disabled = false ,
150- loading = false ,
151156 error,
152157 hint,
153158 multiple = false ,
@@ -158,7 +163,6 @@ export const EnhancedSelect = React.forwardRef<HTMLButtonElement, EnhancedSelect
158163 contentClassName,
159164 itemClassName,
160165 size = "default" ,
161- position = "item-aligned" ,
162166 variant = "default" ,
163167 radius = "md" ,
164168 maxHeight = 300 ,
@@ -172,7 +176,6 @@ export const EnhancedSelect = React.forwardRef<HTMLButtonElement, EnhancedSelect
172176 renderValue,
173177 label,
174178 labelClassName,
175- ...props
176179 } ,
177180 ref ,
178181 ) => {
@@ -315,24 +318,22 @@ export const EnhancedSelect = React.forwardRef<HTMLButtonElement, EnhancedSelect
315318 < div
316319 className = { cn (
317320 'flex flex-1 items-center overflow-hidden' ,
318- selectVariants ( { variant, size, radius } ) ,
321+ selectVariants ( { variant, size : size , radius } ) ,
319322 error && 'border-destructive' ,
320323 triggerClassName
321324 ) }
322325 >
323326 { startContent }
324327 < Button
325328 ref = { ref }
326- { ...props }
327329 id = { id }
328- variant = { 'light' }
329- size = { size }
330+ size = 'sm'
330331 disabled = { disabled }
332+ variant = "default"
331333 role = "combobox"
332- fullWidth
333334 aria-expanded = { open }
334335 aria-haspopup = "listbox"
335- className = { cn ( {
336+ className = { cn ( 'w-full' , {
336337 '!rounded-l-none pl-1' : ! ! startContent ,
337338 } ) }
338339 onClick = { ( ) => {
@@ -455,7 +456,7 @@ export const EnhancedSelect = React.forwardRef<HTMLButtonElement, EnhancedSelect
455456 value = { search }
456457 onValueChange = { setSearch }
457458 className = { cn (
458- commandInputVariants ( { size , variant, radius } )
459+ commandInputVariants ( { variant, radius } )
459460 ) }
460461 />
461462 ) }
0 commit comments