@next-degree/pickle-shared-js 0.3.24 → 0.3.27
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.
- package/dist/app/layout.css +0 -11
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +40 -16
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +66 -42
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +15 -8
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +25 -18
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/InputDemo.cjs +18 -7
- package/dist/components/demos/InputDemo.cjs.map +1 -1
- package/dist/components/demos/InputDemo.js +24 -13
- package/dist/components/demos/InputDemo.js.map +1 -1
- package/dist/components/demos/SelectDemo.cjs +19 -7
- package/dist/components/demos/SelectDemo.cjs.map +1 -1
- package/dist/components/demos/SelectDemo.js +29 -17
- package/dist/components/demos/SelectDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +40 -16
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +66 -42
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +14 -8
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +21 -15
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Input.cjs +17 -6
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.js +20 -9
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/Label.cjs +6 -3
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.d.cts +2 -1
- package/dist/components/ui/Label.d.ts +2 -1
- package/dist/components/ui/Label.js +7 -4
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/Select.cjs +17 -6
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +25 -14
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +36 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +64 -42
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +0 -11
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Combobox.tsx","../../../src/lib/utils.ts","../../../src/components/primitives/command.tsx","../../../src/components/primitives/dialog.tsx","../../../src/components/primitives/popover.tsx","../../../src/components/primitives/separator.tsx","../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/components/ui/Badge.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { ComponentProps, forwardRef, useEffect, useState } from 'react'\nimport { ChevronDownIcon, CircleX, icons } from 'lucide-react'\nimport { cva, type VariantProps } from 'cva'\nimport { cn } from '@/lib/utils'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/primitives/command'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'\nimport { Separator } from '@/components/primitives/separator'\n\nimport ListItem from '@/components/ui/ListItem'\nimport { Badge } from '@/components/ui/Badge'\nimport Label from '@/components/ui/Label'\n\ntype Icon = { icon?: keyof typeof icons }\ntype Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: string; value: string; title: string; description?: string; icon?: string }\ntype ClassNames = { label?: string; trigger?: string; items?: string; content?: string }\ntype Shared = { label?: string; options: Option[]; classNames?: ClassNames; placeholder?: string }\ntype MultiSelect = { multiselect: true; value?: string[]; onChange?: (v: string[]) => void }\ntype SingleSelect = { multiselect?: false; value?: string; onChange?: (v: string) => void }\ntype TriggerVariants = VariantProps<typeof triggerVariants>\ntype SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>\ntype Props = TriggerVariants & SelectProps & Children & Shared & Icon\ntype MultiSelectProps = Props & MultiSelect\ntype SingleSelectProps = Props & SingleSelect\ntype ComboboxProps = MultiSelectProps | SingleSelectProps\n\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>((props, ref) => {\n const {\n value,\n label,\n options,\n classNames,\n multiselect,\n placeholder,\n variant = 'default',\n size,\n icon,\n className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<Option[]>([])\n const [open, setOpen] = useState(false)\n const IconComponent = icon && icons[icon]\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const isEmpty = selected.length == 0\n const showChevron = isDefault ? isEmpty : true\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(\n valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== undefined)\n )\n }, [value])\n\n const handleSelect = (value: string) => {\n const option = options.find((o) => o.value === value)\n if (!option) return\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.some((o) => o.value === value)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected.map((o) => o.value))\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option.value)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(', ') : placeholder\n return isDefault ? defaultLabel : label\n }\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {isDefault && label && <Label text={label} className={classNames?.label} />}\n\n <div className=\"relative flex\">\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n asChild\n disabled={options.length === 0}\n data-testid={`${props.id ?? props.name}-combobox-trigger`}\n >\n <div\n ref={ref}\n className={cn(\n triggerVariants({ variant, size }),\n isDefault && !isEmpty && 'pr-10',\n classNames?.trigger\n )}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && !isEmpty && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'w-full truncate leading-normal',\n isDefault && isEmpty && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {showChevron && (\n <ChevronDownIcon\n className=\"shrink-0 transform group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n )}\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className={cn(\n 'flex w-full max-w-xs flex-col overflow-hidden p-0',\n 'max-h-[--radix-popover-content-available-height]',\n classNames?.content\n )}\n collisionPadding={8}\n sideOffset={4}\n align=\"start\"\n >\n <Command>\n {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem\n key={id}\n value={option.title}\n onSelect={() => handleSelect(option.value)}\n >\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected.some((s) => s.value === option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </Command>\n </PopoverContent>\n </Popover>\n\n {isDefault && !isEmpty && (\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={handleClear}\n >\n <CircleX className=\"h-4 w-4 text-green-100\" />\n </button>\n )}\n </div>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5',\n {\n variants: {\n variant: {\n default: ['w-full', 'rounded-lg'],\n chip: [\n 'font-bold',\n 'rounded-3xl',\n 'data-[state=open]:bg-black',\n 'data-[state=open]:text-white',\n ],\n },\n size: {\n small: ['h-8', 'py-1', 'px-2', 'text-xs'],\n normal: ['h-9', 'py-2', 'px-3', 'text-sm'],\n large: ['h-10', 'py-3', 'px-4', 'text-base'],\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'normal',\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client'\n\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport { Search } from 'lucide-react'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '@/components/primitives/dialog'\n\nimport { cn } from '@/lib/utils'\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-xl bg-white text-neutral-950',\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\ntype CommandDialogProps = DialogProps\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 [&_[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=\"m-1 flex items-center rounded-xl border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 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('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 ref={ref} className=\"py-6 text-center text-sm\" {...props} />\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-neutral-950 [&_[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-neutral-500',\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-neutral-200', 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-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50\",\n className\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-neutral-500', className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = 'CommandShortcut'\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n}\n","'use client'\n\nimport { cn } from '@/lib/utils'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\nimport * as React from 'react'\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-neutral-500 dark:text-neutral-400', className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\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 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 rounded-2xl border bg-white p-4 text-black 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 }\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\n","import { cn } from '@/lib/utils'\nimport { CheckIcon } from 'lucide-react'\nimport { ComponentPropsWithoutRef, ReactNode } from 'react'\nimport Checkbox from '@/components/ui/Checkbox'\nimport { icons } from 'lucide-react'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { cva, type VariantProps } from 'cva'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst badgeVariants = cva('rounded-full px-2 py-0.5 text-xs font-semibold', {\n variants: {\n variant: {\n green: 'bg-green-90 text-white',\n pickle: 'bg-pickle-100 text-black',\n purple: 'bg-purple-100 text-white',\n },\n },\n defaultVariants: {\n variant: 'green',\n },\n})\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport { Badge, badgeVariants }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n}\n\nfunction Label({ text, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n </label>\n )\n}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAgE;AAChE,IAAAC,uBAAgD;AAChD,IAAAC,cAAuC;;;ACJvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO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AAU,MAAM,aAAa,OAAO,KAAK;AAAA,oBAEzC;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAW,GAAG,YAAY,OAAO,eAAe;AAAA,wBAChD,YAAY,SAAS,KAAK,CAAC,MAAM,EAAE,UAAU,OAAO,KAAK;AAAA,wBACzD,aAAa;AAAA,wBACZ,GAAG;AAAA;AAAA,oBACN;AAAA;AAAA,kBATK;AAAA,gBAUP,CACD,GACH;AAAA,iBACF;AAAA,cAEC,CAAC,CAAC,UAAU,6CAAC,aAAU;AAAA,cACvB,UAAU,OAAO,EAAE,MAAM,CAAC;AAAA,eAC7B;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAEC,aAAa,CAAC,WACb;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UAET,uDAAC,gCAAQ,WAAU,0BAAyB;AAAA;AAAA,MAC9C;AAAA,OAEJ;AAAA,KACF;AAEJ,CAAC;AACD,SAAS,cAAc;AAEvB,IAAM,sBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS,CAAC,UAAU,YAAY;AAAA,QAChC,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACxC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACzC,OAAO,CAAC,QAAQ,QAAQ,QAAQ,WAAW;AAAA,MAC7C;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["import_react","import_lucide_react","import_cva","import_lucide_react","React","import_jsx_runtime","CommandPrimitive","CommandPrimitive","React","import_jsx_runtime","React","import_jsx_runtime","import_lucide_react","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","icon","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","value"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Combobox.tsx","../../../src/lib/utils.ts","../../../src/components/primitives/command.tsx","../../../src/components/primitives/dialog.tsx","../../../src/components/primitives/popover.tsx","../../../src/components/primitives/separator.tsx","../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/components/ui/Badge.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { ComponentProps, forwardRef, useEffect, useState } from 'react'\nimport { ChevronDownIcon, CircleX, icons } from 'lucide-react'\nimport { cva, type VariantProps } from 'cva'\nimport { cn } from '@/lib/utils'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/primitives/command'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'\nimport { Separator } from '@/components/primitives/separator'\n\nimport ListItem from '@/components/ui/ListItem'\nimport { Badge } from '@/components/ui/Badge'\nimport Label from '@/components/ui/Label'\n\ntype Icon = { icon?: keyof typeof icons }\ntype Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: string; value: string; title: string; description?: string; icon?: string }\ntype ClassNames = { label?: string; trigger?: string; items?: string; content?: string }\ntype Shared = { label?: string; options: Option[]; classNames?: ClassNames; placeholder?: string }\ntype MultiSelect = { multiselect: true; value?: string[]; onChange?: (v: string[]) => void }\ntype SingleSelect = { multiselect?: false; value?: string; onChange?: (v: string) => void }\ntype TriggerVariants = VariantProps<typeof triggerVariants>\ntype SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>\ntype Props = TriggerVariants & SelectProps & Children & Shared & Icon\ntype MultiSelectProps = Props & MultiSelect\ntype SingleSelectProps = Props & SingleSelect\ntype ComboboxProps = MultiSelectProps | SingleSelectProps\n\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>((props, ref) => {\n const {\n id,\n name,\n value,\n label,\n options,\n required,\n classNames,\n multiselect,\n placeholder,\n variant = 'default',\n size,\n icon,\n className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<Option[]>([])\n const [open, setOpen] = useState(false)\n const IconComponent = icon && icons[icon]\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const isEmpty = selected.length == 0\n const showChevron = isDefault ? isEmpty : true\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(\n valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== undefined)\n )\n }, [value])\n\n const handleSelect = (value: string) => {\n const option = options.find((o) => o.value === value)\n if (!option) return\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.some((o) => o.value === value)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected.map((o) => o.value))\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option.value)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(', ') : placeholder\n return isDefault ? defaultLabel : label\n }\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n {isDefault && (\n <Label text={label} htmlFor={name} required={required} className={classNames?.label} />\n )}\n\n <div className=\"relative flex\">\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n asChild\n disabled={options.length === 0}\n data-testid={`${id ?? name}-combobox-trigger`}\n >\n <div\n ref={ref}\n className={cn(\n triggerVariants({ variant, size }),\n isDefault && !isEmpty && 'pr-10',\n classNames?.trigger\n )}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && !isEmpty && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'w-full truncate leading-normal',\n isDefault && isEmpty && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {showChevron && (\n <ChevronDownIcon\n className=\"shrink-0 transform group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n )}\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className={cn(\n 'flex w-full max-w-xs flex-col overflow-hidden p-0',\n 'max-h-[--radix-popover-content-available-height]',\n classNames?.content\n )}\n collisionPadding={8}\n sideOffset={4}\n align=\"start\"\n >\n <Command>\n {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem\n key={id}\n value={option.title}\n onSelect={() => handleSelect(option.value)}\n >\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected.some((s) => s.value === option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </Command>\n </PopoverContent>\n </Popover>\n\n {isDefault && !isEmpty && (\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={handleClear}\n >\n <CircleX className=\"h-4 w-4 text-green-100\" />\n </button>\n )}\n </div>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5',\n {\n variants: {\n variant: {\n default: ['w-full', 'rounded-lg'],\n chip: [\n 'font-bold',\n 'rounded-3xl',\n 'data-[state=open]:bg-black',\n 'data-[state=open]:text-white',\n ],\n },\n size: {\n small: ['h-8', 'py-1', 'px-2', 'text-xs'],\n normal: ['h-9', 'py-2', 'px-3', 'text-sm'],\n large: ['h-10', 'py-3', 'px-4', 'text-base'],\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'normal',\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client'\n\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport { Search } from 'lucide-react'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '@/components/primitives/dialog'\n\nimport { cn } from '@/lib/utils'\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-xl bg-white text-neutral-950',\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\ntype CommandDialogProps = DialogProps\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 [&_[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=\"m-1 flex items-center rounded-xl border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 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('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 ref={ref} className=\"py-6 text-center text-sm\" {...props} />\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-neutral-950 [&_[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-neutral-500',\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-neutral-200', 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-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50\",\n className\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-neutral-500', className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = 'CommandShortcut'\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n}\n","'use client'\n\nimport { cn } from '@/lib/utils'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\nimport * as React from 'react'\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-neutral-500 dark:text-neutral-400', className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\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 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 rounded-2xl border bg-white p-4 text-black 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 }\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\n","import { cn } from '@/lib/utils'\nimport { CheckIcon } from 'lucide-react'\nimport { ComponentPropsWithoutRef, ReactNode } from 'react'\nimport Checkbox from '@/components/ui/Checkbox'\nimport { icons } from 'lucide-react'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { cva, type VariantProps } from 'cva'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst badgeVariants = cva('rounded-full px-2 py-0.5 text-xs font-semibold', {\n variants: {\n variant: {\n green: 'bg-green-90 text-white',\n pickle: 'bg-pickle-100 text-black',\n purple: 'bg-purple-100 text-white',\n },\n },\n defaultVariants: {\n variant: 'green',\n },\n})\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport { Badge, badgeVariants }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n}\n\nfunction Label({ text, required, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n )\n}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAgE;AAChE,IAAAC,uBAAgD;AAChD,IAAAC,cAAuC;;;ACJvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACFA,kBAA4C;AAC5C,IAAAC,uB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AA,oBAEC,OAAO,OAAO;AAAA,oBACd,UAAU,MAAM,aAAa,OAAO,KAAK;AAAA,oBAEzC;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAW,GAAG,YAAY,OAAO,eAAe;AAAA,wBAChD,YAAY,SAAS,KAAK,CAAC,MAAM,EAAE,UAAU,OAAO,KAAK;AAAA,wBACzD,aAAa;AAAA,wBACZ,GAAG;AAAA;AAAA,oBACN;AAAA;AAAA,kBATKA;AAAA,gBAUP,CACD,GACH;AAAA,iBACF;AAAA,cAEC,CAAC,CAAC,UAAU,6CAAC,aAAU;AAAA,cACvB,UAAU,OAAO,EAAE,MAAM,CAAC;AAAA,eAC7B;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAEC,aAAa,CAAC,WACb;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UAET,uDAAC,gCAAQ,WAAU,0BAAyB;AAAA;AAAA,MAC9C;AAAA,OAEJ;AAAA,KACF;AAEJ,CAAC;AACD,SAAS,cAAc;AAEvB,IAAM,sBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS,CAAC,UAAU,YAAY;AAAA,QAChC,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACxC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACzC,OAAO,CAAC,QAAQ,QAAQ,QAAQ,WAAW;AAAA,MAC7C;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["import_react","import_lucide_react","import_cva","import_lucide_react","React","import_jsx_runtime","CommandPrimitive","CommandPrimitive","React","import_jsx_runtime","React","import_jsx_runtime","import_lucide_react","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","icon","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","value","id"]}
|
|
@@ -342,10 +342,10 @@ function Badge({ className, variant, ...props }) {
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
// src/components/ui/Label.tsx
|
|
345
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
346
|
-
function Label({ text, className, ...props }) {
|
|
345
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
346
|
+
function Label({ text, required, className, ...props }) {
|
|
347
347
|
if (!text) return null;
|
|
348
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ jsxs5(
|
|
349
349
|
"label",
|
|
350
350
|
{
|
|
351
351
|
className: cn(
|
|
@@ -353,19 +353,25 @@ function Label({ text, className, ...props }) {
|
|
|
353
353
|
className
|
|
354
354
|
),
|
|
355
355
|
...props,
|
|
356
|
-
children:
|
|
356
|
+
children: [
|
|
357
|
+
text,
|
|
358
|
+
required && /* @__PURE__ */ jsx8("span", { className: "text-red-600", children: "\xA0*" })
|
|
359
|
+
]
|
|
357
360
|
}
|
|
358
361
|
);
|
|
359
362
|
}
|
|
360
363
|
var Label_default = Label;
|
|
361
364
|
|
|
362
365
|
// src/components/ui/Combobox.tsx
|
|
363
|
-
import { jsx as jsx9, jsxs as
|
|
366
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
364
367
|
var Combobox = forwardRef6((props, ref) => {
|
|
365
368
|
const {
|
|
369
|
+
id,
|
|
370
|
+
name,
|
|
366
371
|
value,
|
|
367
372
|
label,
|
|
368
373
|
options,
|
|
374
|
+
required,
|
|
369
375
|
classNames,
|
|
370
376
|
multiselect,
|
|
371
377
|
placeholder,
|
|
@@ -413,17 +419,17 @@ var Combobox = forwardRef6((props, ref) => {
|
|
|
413
419
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
414
420
|
return isDefault ? defaultLabel : label;
|
|
415
421
|
};
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
-
isDefault &&
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
423
|
+
isDefault && /* @__PURE__ */ jsx9(Label_default, { text: label, htmlFor: name, required, className: classNames?.label }),
|
|
424
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative flex", children: [
|
|
425
|
+
/* @__PURE__ */ jsxs6(Popover, { open, onOpenChange: setOpen, children: [
|
|
420
426
|
/* @__PURE__ */ jsx9(
|
|
421
427
|
PopoverTrigger,
|
|
422
428
|
{
|
|
423
429
|
asChild: true,
|
|
424
430
|
disabled: options.length === 0,
|
|
425
|
-
"data-testid": `${
|
|
426
|
-
children: /* @__PURE__ */
|
|
431
|
+
"data-testid": `${id ?? name}-combobox-trigger`,
|
|
432
|
+
children: /* @__PURE__ */ jsxs6(
|
|
427
433
|
"div",
|
|
428
434
|
{
|
|
429
435
|
ref,
|
|
@@ -469,11 +475,11 @@ var Combobox = forwardRef6((props, ref) => {
|
|
|
469
475
|
collisionPadding: 8,
|
|
470
476
|
sideOffset: 4,
|
|
471
477
|
align: "start",
|
|
472
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ jsxs6(Command, { children: [
|
|
473
479
|
!hideSearchBox && /* @__PURE__ */ jsx9(CommandInput, { placeholder: "Search..." }),
|
|
474
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ jsxs6(CommandList, { children: [
|
|
475
481
|
/* @__PURE__ */ jsx9(CommandEmpty, { children: "No results" }),
|
|
476
|
-
/* @__PURE__ */ jsx9(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ jsx9(
|
|
482
|
+
/* @__PURE__ */ jsx9(CommandGroup, { children: options.map(({ id: id2, ...option }) => /* @__PURE__ */ jsx9(
|
|
477
483
|
CommandItem,
|
|
478
484
|
{
|
|
479
485
|
value: option.title,
|
|
@@ -488,7 +494,7 @@ var Combobox = forwardRef6((props, ref) => {
|
|
|
488
494
|
}
|
|
489
495
|
)
|
|
490
496
|
},
|
|
491
|
-
|
|
497
|
+
id2
|
|
492
498
|
)) })
|
|
493
499
|
] }),
|
|
494
500
|
!!footer && /* @__PURE__ */ jsx9(Separator, {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Combobox.tsx","../../../src/lib/utils.ts","../../../src/components/primitives/command.tsx","../../../src/components/primitives/dialog.tsx","../../../src/components/primitives/popover.tsx","../../../src/components/primitives/separator.tsx","../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/components/ui/Badge.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { ComponentProps, forwardRef, useEffect, useState } from 'react'\nimport { ChevronDownIcon, CircleX, icons } from 'lucide-react'\nimport { cva, type VariantProps } from 'cva'\nimport { cn } from '@/lib/utils'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/primitives/command'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'\nimport { Separator } from '@/components/primitives/separator'\n\nimport ListItem from '@/components/ui/ListItem'\nimport { Badge } from '@/components/ui/Badge'\nimport Label from '@/components/ui/Label'\n\ntype Icon = { icon?: keyof typeof icons }\ntype Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: string; value: string; title: string; description?: string; icon?: string }\ntype ClassNames = { label?: string; trigger?: string; items?: string; content?: string }\ntype Shared = { label?: string; options: Option[]; classNames?: ClassNames; placeholder?: string }\ntype MultiSelect = { multiselect: true; value?: string[]; onChange?: (v: string[]) => void }\ntype SingleSelect = { multiselect?: false; value?: string; onChange?: (v: string) => void }\ntype TriggerVariants = VariantProps<typeof triggerVariants>\ntype SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>\ntype Props = TriggerVariants & SelectProps & Children & Shared & Icon\ntype MultiSelectProps = Props & MultiSelect\ntype SingleSelectProps = Props & SingleSelect\ntype ComboboxProps = MultiSelectProps | SingleSelectProps\n\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>((props, ref) => {\n const {\n value,\n label,\n options,\n classNames,\n multiselect,\n placeholder,\n variant = 'default',\n size,\n icon,\n className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<Option[]>([])\n const [open, setOpen] = useState(false)\n const IconComponent = icon && icons[icon]\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const isEmpty = selected.length == 0\n const showChevron = isDefault ? isEmpty : true\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(\n valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== undefined)\n )\n }, [value])\n\n const handleSelect = (value: string) => {\n const option = options.find((o) => o.value === value)\n if (!option) return\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.some((o) => o.value === value)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected.map((o) => o.value))\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option.value)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(', ') : placeholder\n return isDefault ? defaultLabel : label\n }\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {isDefault && label && <Label text={label} className={classNames?.label} />}\n\n <div className=\"relative flex\">\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n asChild\n disabled={options.length === 0}\n data-testid={`${props.id ?? props.name}-combobox-trigger`}\n >\n <div\n ref={ref}\n className={cn(\n triggerVariants({ variant, size }),\n isDefault && !isEmpty && 'pr-10',\n classNames?.trigger\n )}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && !isEmpty && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'w-full truncate leading-normal',\n isDefault && isEmpty && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {showChevron && (\n <ChevronDownIcon\n className=\"shrink-0 transform group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n )}\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className={cn(\n 'flex w-full max-w-xs flex-col overflow-hidden p-0',\n 'max-h-[--radix-popover-content-available-height]',\n classNames?.content\n )}\n collisionPadding={8}\n sideOffset={4}\n align=\"start\"\n >\n <Command>\n {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem\n key={id}\n value={option.title}\n onSelect={() => handleSelect(option.value)}\n >\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected.some((s) => s.value === option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </Command>\n </PopoverContent>\n </Popover>\n\n {isDefault && !isEmpty && (\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={handleClear}\n >\n <CircleX className=\"h-4 w-4 text-green-100\" />\n </button>\n )}\n </div>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5',\n {\n variants: {\n variant: {\n default: ['w-full', 'rounded-lg'],\n chip: [\n 'font-bold',\n 'rounded-3xl',\n 'data-[state=open]:bg-black',\n 'data-[state=open]:text-white',\n ],\n },\n size: {\n small: ['h-8', 'py-1', 'px-2', 'text-xs'],\n normal: ['h-9', 'py-2', 'px-3', 'text-sm'],\n large: ['h-10', 'py-3', 'px-4', 'text-base'],\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'normal',\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client'\n\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport { Search } from 'lucide-react'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '@/components/primitives/dialog'\n\nimport { cn } from '@/lib/utils'\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-xl bg-white text-neutral-950',\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\ntype CommandDialogProps = DialogProps\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 [&_[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=\"m-1 flex items-center rounded-xl border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 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('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 ref={ref} className=\"py-6 text-center text-sm\" {...props} />\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-neutral-950 [&_[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-neutral-500',\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-neutral-200', 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-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50\",\n className\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-neutral-500', className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = 'CommandShortcut'\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n}\n","'use client'\n\nimport { cn } from '@/lib/utils'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\nimport * as React from 'react'\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-neutral-500 dark:text-neutral-400', className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\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 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 rounded-2xl border bg-white p-4 text-black 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 }\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\n","import { cn } from '@/lib/utils'\nimport { CheckIcon } from 'lucide-react'\nimport { ComponentPropsWithoutRef, ReactNode } from 'react'\nimport Checkbox from '@/components/ui/Checkbox'\nimport { icons } from 'lucide-react'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { cva, type VariantProps } from 'cva'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst badgeVariants = cva('rounded-full px-2 py-0.5 text-xs font-semibold', {\n variants: {\n variant: {\n green: 'bg-green-90 text-white',\n pickle: 'bg-pickle-100 text-black',\n purple: 'bg-purple-100 text-white',\n },\n },\n defaultVariants: {\n variant: 'green',\n },\n})\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport { Badge, badgeVariants }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n}\n\nfunction Label({ text, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n </label>\n )\n}\n\nexport default Label\n"],"mappings":";;;AAEA,SAAyB,cAAAA,aAAY,WAAW,gBAAgB;AAChE,SAAS,iBAAiB,SAAS,SAAAC,cAAa;AAChD,SAAS,OAAAC,YAA8B;;;ACJvC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AA,QAChC,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACxC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACzC,OAAO,CAAC,QAAQ,QAAQ,QAAQ,WAAW;AAAA,MAC7C;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["forwardRef","icons","cva","React","jsx","jsxs","jsxs","jsx","React","jsx","React","jsx","forwardRef","jsx","jsxs","forwardRef","jsx","jsxs","icon","jsx","jsx","jsx","jsxs","forwardRef","icons","value","cva"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Combobox.tsx","../../../src/lib/utils.ts","../../../src/components/primitives/command.tsx","../../../src/components/primitives/dialog.tsx","../../../src/components/primitives/popover.tsx","../../../src/components/primitives/separator.tsx","../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/components/ui/Badge.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { ComponentProps, forwardRef, useEffect, useState } from 'react'\nimport { ChevronDownIcon, CircleX, icons } from 'lucide-react'\nimport { cva, type VariantProps } from 'cva'\nimport { cn } from '@/lib/utils'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/components/primitives/command'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'\nimport { Separator } from '@/components/primitives/separator'\n\nimport ListItem from '@/components/ui/ListItem'\nimport { Badge } from '@/components/ui/Badge'\nimport Label from '@/components/ui/Label'\n\ntype Icon = { icon?: keyof typeof icons }\ntype Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: string; value: string; title: string; description?: string; icon?: string }\ntype ClassNames = { label?: string; trigger?: string; items?: string; content?: string }\ntype Shared = { label?: string; options: Option[]; classNames?: ClassNames; placeholder?: string }\ntype MultiSelect = { multiselect: true; value?: string[]; onChange?: (v: string[]) => void }\ntype SingleSelect = { multiselect?: false; value?: string; onChange?: (v: string) => void }\ntype TriggerVariants = VariantProps<typeof triggerVariants>\ntype SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>\ntype Props = TriggerVariants & SelectProps & Children & Shared & Icon\ntype MultiSelectProps = Props & MultiSelect\ntype SingleSelectProps = Props & SingleSelect\ntype ComboboxProps = MultiSelectProps | SingleSelectProps\n\nexport const Combobox = forwardRef<HTMLDivElement, ComboboxProps>((props, ref) => {\n const {\n id,\n name,\n value,\n label,\n options,\n required,\n classNames,\n multiselect,\n placeholder,\n variant = 'default',\n size,\n icon,\n className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<Option[]>([])\n const [open, setOpen] = useState(false)\n const IconComponent = icon && icons[icon]\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const isEmpty = selected.length == 0\n const showChevron = isDefault ? isEmpty : true\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(\n valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== undefined)\n )\n }, [value])\n\n const handleSelect = (value: string) => {\n const option = options.find((o) => o.value === value)\n if (!option) return\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.some((o) => o.value === value)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected.map((o) => o.value))\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option.value)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(', ') : placeholder\n return isDefault ? defaultLabel : label\n }\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n {isDefault && (\n <Label text={label} htmlFor={name} required={required} className={classNames?.label} />\n )}\n\n <div className=\"relative flex\">\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n asChild\n disabled={options.length === 0}\n data-testid={`${id ?? name}-combobox-trigger`}\n >\n <div\n ref={ref}\n className={cn(\n triggerVariants({ variant, size }),\n isDefault && !isEmpty && 'pr-10',\n classNames?.trigger\n )}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && !isEmpty && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'w-full truncate leading-normal',\n isDefault && isEmpty && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {showChevron && (\n <ChevronDownIcon\n className=\"shrink-0 transform group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n )}\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className={cn(\n 'flex w-full max-w-xs flex-col overflow-hidden p-0',\n 'max-h-[--radix-popover-content-available-height]',\n classNames?.content\n )}\n collisionPadding={8}\n sideOffset={4}\n align=\"start\"\n >\n <Command>\n {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem\n key={id}\n value={option.title}\n onSelect={() => handleSelect(option.value)}\n >\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected.some((s) => s.value === option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </Command>\n </PopoverContent>\n </Popover>\n\n {isDefault && !isEmpty && (\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={handleClear}\n >\n <CircleX className=\"h-4 w-4 text-green-100\" />\n </button>\n )}\n </div>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5',\n {\n variants: {\n variant: {\n default: ['w-full', 'rounded-lg'],\n chip: [\n 'font-bold',\n 'rounded-3xl',\n 'data-[state=open]:bg-black',\n 'data-[state=open]:text-white',\n ],\n },\n size: {\n small: ['h-8', 'py-1', 'px-2', 'text-xs'],\n normal: ['h-9', 'py-2', 'px-3', 'text-sm'],\n large: ['h-10', 'py-3', 'px-4', 'text-base'],\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'normal',\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","'use client'\n\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport { Search } from 'lucide-react'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '@/components/primitives/dialog'\n\nimport { cn } from '@/lib/utils'\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-xl bg-white text-neutral-950',\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\ntype CommandDialogProps = DialogProps\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 [&_[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=\"m-1 flex items-center rounded-xl border px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 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('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 ref={ref} className=\"py-6 text-center text-sm\" {...props} />\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-neutral-950 [&_[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-neutral-500',\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-neutral-200', 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-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50\",\n className\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest text-neutral-500', className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = 'CommandShortcut'\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n}\n","'use client'\n\nimport { cn } from '@/lib/utils'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { X } from 'lucide-react'\nimport * as React from 'react'\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-neutral-500 dark:text-neutral-400', className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\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 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 rounded-2xl border bg-white p-4 text-black 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 }\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\n","import { cn } from '@/lib/utils'\nimport { CheckIcon } from 'lucide-react'\nimport { ComponentPropsWithoutRef, ReactNode } from 'react'\nimport Checkbox from '@/components/ui/Checkbox'\nimport { icons } from 'lucide-react'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { cva, type VariantProps } from 'cva'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst badgeVariants = cva('rounded-full px-2 py-0.5 text-xs font-semibold', {\n variants: {\n variant: {\n green: 'bg-green-90 text-white',\n pickle: 'bg-pickle-100 text-black',\n purple: 'bg-purple-100 text-white',\n },\n },\n defaultVariants: {\n variant: 'green',\n },\n})\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport { Badge, badgeVariants }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n}\n\nfunction Label({ text, required, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n )\n}\n\nexport default Label\n"],"mappings":";;;AAEA,SAAyB,cAAAA,aAAY,WAAW,gBAAgB;AAChE,SAAS,iBAAiB,SAAS,SAAAC,cAAa;AAChD,SAAS,OAAAC,YAA8B;;;ACJvC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACFA,SAAS,WAAW,wBAAwB;AAC5C,SAAS,cAAc;AACvB,YAAYC,YAAW;;;ACFvB,YAAY,qBAAqB;AACjC,SAAS,SAAS;AAClB,YAAY,WAAW;AAcrB,cA0BI,YA1BJ;AARF,IAAM,eAA+B;AAIrC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAC,gBACC;AAAA,sBAAC,iBAAc;AAAA,EACf;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,qBAAiB,uBAAhB,EAAsB,WAAU,0ZAC/B;AAAA,8BAAC,KAAE,WAAU,WAAU;AAAA,UACvB,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA,WACjC;AAAA;AAAA;AAAA,EACF;AAAA,GACF,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,I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B,UAAU,OAAO,EAAE,MAAM,CAAC;AAAA,eAC7B;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAEC,aAAa,CAAC,WACb,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UAET,0BAAAA,KAAC,WAAQ,WAAU,0BAAyB;AAAA;AAAA,MAC9C;AAAA,OAEJ;AAAA,KACF;AAEJ,CAAC;AACD,SAAS,cAAc;AAEvB,IAAM,kBAAkBM;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS,CAAC,UAAU,YAAY;AAAA,QAChC,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACxC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,QACzC,OAAO,CAAC,QAAQ,QAAQ,QAAQ,WAAW;AAAA,MAC7C;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["forwardRef","icons","cva","React","jsx","jsxs","jsxs","jsx","React","jsx","React","jsx","forwardRef","jsx","jsxs","forwardRef","jsx","jsxs","icon","jsx","jsx","jsxs","jsx","jsxs","forwardRef","icons","value","id","cva"]}
|
|
@@ -44,9 +44,9 @@ var ErrorMessage_default = ErrorMessage;
|
|
|
44
44
|
|
|
45
45
|
// src/components/ui/Label.tsx
|
|
46
46
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
47
|
-
function Label({ text, className, ...props }) {
|
|
47
|
+
function Label({ text, required, className, ...props }) {
|
|
48
48
|
if (!text) return null;
|
|
49
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
50
50
|
"label",
|
|
51
51
|
{
|
|
52
52
|
className: cn(
|
|
@@ -54,7 +54,10 @@ function Label({ text, className, ...props }) {
|
|
|
54
54
|
className
|
|
55
55
|
),
|
|
56
56
|
...props,
|
|
57
|
-
children:
|
|
57
|
+
children: [
|
|
58
|
+
text,
|
|
59
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
60
|
+
]
|
|
58
61
|
}
|
|
59
62
|
);
|
|
60
63
|
}
|
|
@@ -72,8 +75,16 @@ var Input = (0, import_react.forwardRef)(
|
|
|
72
75
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
73
76
|
const hasIcon = !!icon;
|
|
74
77
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
75
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "group flex w-full flex-col", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
76
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
79
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
80
|
+
Label_default,
|
|
81
|
+
{
|
|
82
|
+
text: label,
|
|
83
|
+
htmlFor: props.name,
|
|
84
|
+
required: props.required,
|
|
85
|
+
className: classNames?.label
|
|
86
|
+
}
|
|
87
|
+
),
|
|
77
88
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative flex flex-row items-center", children: [
|
|
78
89
|
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
79
90
|
IconComponent,
|
|
@@ -102,7 +113,7 @@ var Input = (0, import_react.forwardRef)(
|
|
|
102
113
|
}
|
|
103
114
|
)
|
|
104
115
|
] }),
|
|
105
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ErrorMessage_default, { message: error
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ErrorMessage_default, { message: error })
|
|
106
117
|
] });
|
|
107
118
|
}
|
|
108
119
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n onClear?: () => void\n classNames?: { label?: string }\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n ({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n onClear?: () => void\n classNames?: { label?: string }\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n ({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n}\n\nfunction Label({ text, required, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n )\n}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuC;AACvC,0BAAyB;AACzB,mBAAuE;;;ACFvE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE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,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,cAAc,EAAE,OAAO,QAAQ,CAAC,CAAC;AAAA,YAC/C;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAa,iBAAiB,MAAM,EAAE;AAAA,YACrC,GAAG;AAAA;AAAA,QACN;AAAA,QACC,WAAW,SACV;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,2CAA2C,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,eAAY;AAAA;AAAA,QACd;AAAA,SAEJ;AAAA,MAEA,6CAAC,wBAAa,SAAS,OAAO;AAAA,OAChC;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAEpB,IAAM,oBAAgB;AAAA,EACpB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":["import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -19,10 +19,10 @@ function ErrorMessage({ message, className, ...props }) {
|
|
|
19
19
|
var ErrorMessage_default = ErrorMessage;
|
|
20
20
|
|
|
21
21
|
// src/components/ui/Label.tsx
|
|
22
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
23
|
-
function Label({ text, className, ...props }) {
|
|
22
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
23
|
+
function Label({ text, required, className, ...props }) {
|
|
24
24
|
if (!text) return null;
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
26
|
"label",
|
|
27
27
|
{
|
|
28
28
|
className: cn(
|
|
@@ -30,14 +30,17 @@ function Label({ text, className, ...props }) {
|
|
|
30
30
|
className
|
|
31
31
|
),
|
|
32
32
|
...props,
|
|
33
|
-
children:
|
|
33
|
+
children: [
|
|
34
|
+
text,
|
|
35
|
+
required && /* @__PURE__ */ jsx2("span", { className: "text-red-600", children: "\xA0*" })
|
|
36
|
+
]
|
|
34
37
|
}
|
|
35
38
|
);
|
|
36
39
|
}
|
|
37
40
|
var Label_default = Label;
|
|
38
41
|
|
|
39
42
|
// src/components/ui/Input.tsx
|
|
40
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
43
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
41
44
|
var Input = forwardRef(
|
|
42
45
|
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
43
46
|
const handleClear = () => {
|
|
@@ -48,9 +51,17 @@ var Input = forwardRef(
|
|
|
48
51
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
49
52
|
const hasIcon = !!icon;
|
|
50
53
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
label && /* @__PURE__ */ jsx3(
|
|
53
|
-
|
|
54
|
+
return /* @__PURE__ */ jsxs2("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
55
|
+
label && /* @__PURE__ */ jsx3(
|
|
56
|
+
Label_default,
|
|
57
|
+
{
|
|
58
|
+
text: label,
|
|
59
|
+
htmlFor: props.name,
|
|
60
|
+
required: props.required,
|
|
61
|
+
className: classNames?.label
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative flex flex-row items-center", children: [
|
|
54
65
|
IconComponent && /* @__PURE__ */ jsx3(
|
|
55
66
|
IconComponent,
|
|
56
67
|
{
|
|
@@ -78,7 +89,7 @@ var Input = forwardRef(
|
|
|
78
89
|
}
|
|
79
90
|
)
|
|
80
91
|
] }),
|
|
81
|
-
/* @__PURE__ */ jsx3(ErrorMessage_default, { message: error
|
|
92
|
+
/* @__PURE__ */ jsx3(ErrorMessage_default, { message: error })
|
|
82
93
|
] });
|
|
83
94
|
}
|
|
84
95
|
);
|