@next-degree/pickle-shared-js 0.3.8 → 0.3.9
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 +1 -1
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +1 -1
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +1 -1
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +1 -1
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +1 -1
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +1 -1
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +1 -1
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/primitives/command.d.cts +3 -3
- package/dist/components/primitives/command.d.ts +3 -3
- package/dist/components/ui/Combobox.cjs +1 -1
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.d.cts +7 -2
- package/dist/components/ui/Combobox.d.ts +7 -2
- package/dist/components/ui/Combobox.js +1 -1
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +1 -1
- package/dist/styles/globals.css.map +1 -1
- package/package.json +6 -6
|
@@ -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 } 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 Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: number; 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 MultiSelectProps = TriggerVariants & SelectProps & Children & Shared & MultiSelect\ntype SingleSelectProps = TriggerVariants & SelectProps & Children & Shared & 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 className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<string[]>([])\n const [open, setOpen] = useState(false)\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(valueArray)\n }, [value])\n\n const handleSelect = (option: string) => {\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.includes(option)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected)\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option)\n close()\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = selected.length > 0 ? selected.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 <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild disabled={options.length === 0}>\n <div\n ref={ref}\n className={cn(triggerVariants({ variant, size }), classNames?.trigger)}\n aria-expanded={open}\n >\n {isChip && selected.length > 0 && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'truncate leading-normal',\n isDefault && selected.length == 0 && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n <ChevronDownIcon className=\"transform group-data-[state=open]:rotate-180\" size=\"16\" />\n </div>\n </PopoverTrigger>\n\n <Command>\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 {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem key={id} value={option.value} onSelect={handleSelect}>\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected?.includes(option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </PopoverContent>\n </Command>\n </Popover>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer 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', 'max-w-80', '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', 'p-1', 'pl-2', 'text-xs'],\n normal: ['h-9', 'p-2', 'pl-3', 'text-sm'],\n large: ['h-10', 'p-3', 'pl-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":"mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,cAAAE,KAAA,eAAAC,GAAAH,IAEA,IAAAI,EAAg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A,cACA,6BACA,8BACF,CACF,EACA,KAAM,CACJ,MAAO,CAAC,MAAO,MAAO,OAAQ,SAAS,EACvC,OAAQ,CAAC,MAAO,MAAO,OAAQ,SAAS,EACxC,MAAO,CAAC,OAAQ,MAAO,OAAQ,WAAW,CAC5C,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,QACR,CACF,CACF","names":["Combobox_exports","__export","Combobox","__toCommonJS","import_react","import_lucide_react","import_cva","import_clsx","import_tailwind_merge","cn","inputs","import_cmdk","import_lucide_react","React","DialogPrimitive","import_lucide_react","React","import_jsx_runtime","DialogPortal","DialogOverlay","className","props","ref","cn","DialogContent","children","DialogPortal","DialogHeader","DialogFooter","DialogTitle","DialogDescription","import_jsx_runtime","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","PopoverPrimitive","import_jsx_runtime","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cn","SeparatorPrimitive","React","import_jsx_runtime","Separator","className","orientation","decorative","props","ref","cn","import_lucide_react","CheckboxPrimitive","import_lucide_react","import_react","import_jsx_runtime","CheckboxToggle","className","props","ref","cn","Checkbox","classNames","children","disabled","id","labelClassName","Checkbox_default","import_lucide_react","import_jsx_runtime","ListItem","icon","hasCheckbox","isSelected","className","title","value","description","props","optionIcon","IconComponent","cn","Checkbox_default","e","ListItem_default","import_cva","import_jsx_runtime","badgeVariants","Badge","className","variant","props","cn","import_jsx_runtime","Label","text","className","props","cn","Label_default","import_jsx_runtime","Combobox","props","ref","value","label","options","classNames","multiselect","placeholder","variant","size","className","handleChange","footer","selected","setSelected","open","setOpen","hideSearchBox","isDefault","isChip","close","handleSelect","option","prev","newSelected","v","handleDisplayValue","defaultLabel","cn","Label_default","Popover","PopoverTrigger","triggerVariants","Badge","Command","PopoverContent","CommandInput","CommandList","CommandEmpty","CommandGroup","id","CommandItem","ListItem_default","Separator"]}
|
|
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: number; 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<string[]>([])\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 close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(valueArray)\n }, [value])\n\n const handleSelect = (option: string) => {\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.includes(option)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected)\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = selected.length > 0 ? selected.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 <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild disabled={options.length === 0}>\n <div\n ref={ref}\n className={cn(triggerVariants({ variant, size }), classNames?.trigger)}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && selected.length > 0 && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'truncate leading-normal',\n isDefault && selected.length == 0 && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {selected.length == 0 && (\n <ChevronDownIcon className=\"transform group-data-[state=open]:rotate-180\" size=\"16\" />\n )}\n\n {isDefault && selected.length > 0 && (\n <button\n type=\"button\"\n className=\"flex h-8 w-8 shrink-0 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 </PopoverTrigger>\n\n <Command>\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 {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem key={id} value={option.value} onSelect={handleSelect}>\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected?.includes(option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </PopoverContent>\n </Command>\n </Popover>\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', 'max-w-80', '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', 'p-1', 'pl-2', 'text-xs'],\n normal: ['h-9', 'p-2', 'pl-3', 'text-sm'],\n large: ['h-10', 'p-3', 'pl-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":"slBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,cAAAE,KAAA,eAAAC,GAAAH,IAEA,IAAAI,EAAgE,iBAChEC,EAAgD,wBAChDC,GAAuC,eCJvC,IAAAC,GAAsC,gBACtCC,GAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,eAAQ,SAAKA,CAAM,CAAC,CAC7B,CCFA,IAAAC,EAA4C,gBAC5CC,GAAuB,wBACvBC,EAAuB,sBCFvB,IAAAC,EAAiC,uCACjCC,GAAkB,wBAClBC,EAAuB,sBAcrBC,EAAA,6BARF,IAAMC,GAA+B,SAIrC,IAAMC,GAAsB,aAG1B,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,OAC1B,OAAiB,UAAhB,CACC,IAAKA,EACL,UAAWC,EACT,yJACAH,CACF,EACC,GAAGC,EACN,CACD,EACDF,GAAc,YAA8B,UAAQ,YAEpD,IAAMK,GAAsB,aAG1B,CAAC,CAAE,UAAAJ,EAAW,SAAAK,EAAU,GAAGJ,CAAM,EAAGC,OACpC,QAACI,GAAA,CACC,o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JS","import_react","import_lucide_react","import_cva","import_clsx","import_tailwind_merge","cn","inputs","import_cmdk","import_lucide_react","React","DialogPrimitive","import_lucide_react","React","import_jsx_runtime","DialogPortal","DialogOverlay","className","props","ref","cn","DialogContent","children","DialogPortal","DialogHeader","DialogFooter","DialogTitle","DialogDescription","import_jsx_runtime","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","PopoverPrimitive","import_jsx_runtime","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cn","SeparatorPrimitive","React","import_jsx_runtime","Separator","className","orientation","decorative","props","ref","cn","import_lucide_react","CheckboxPrimitive","import_lucide_react","import_react","import_jsx_runtime","CheckboxToggle","className","props","ref","cn","Checkbox","classNames","children","disabled","id","labelClassName","Checkbox_default","import_lucide_react","import_jsx_runtime","ListItem","icon","hasCheckbox","isSelected","className","title","value","description","props","optionIcon","IconComponent","cn","Checkbox_default","e","ListItem_default","import_cva","import_jsx_runtime","badgeVariants","Badge","className","variant","props","cn","import_jsx_runtime","Label","text","className","props","cn","Label_default","import_jsx_runtime","Combobox","props","ref","value","label","options","classNames","multiselect","placeholder","variant","size","icon","className","handleChange","footer","selected","setSelected","open","setOpen","IconComponent","hideSearchBox","isDefault","isChip","close","handleSelect","option","prev","newSelected","v","handleClear","handleDisplayValue","defaultLabel","cn","Label_default","Popover","PopoverTrigger","triggerVariants","Badge","Command","PopoverContent","CommandInput","CommandList","CommandEmpty","CommandGroup","id","CommandItem","ListItem_default","Separator"]}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as cva_types from 'cva/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
|
+
import { icons } from 'lucide-react';
|
|
4
5
|
import { VariantProps } from 'cva';
|
|
5
6
|
|
|
7
|
+
type Icon = {
|
|
8
|
+
icon?: keyof typeof icons;
|
|
9
|
+
};
|
|
6
10
|
type Children = {
|
|
7
11
|
children?: (props: {
|
|
8
12
|
close: () => void;
|
|
@@ -39,8 +43,9 @@ type SingleSelect = {
|
|
|
39
43
|
};
|
|
40
44
|
type TriggerVariants = VariantProps<typeof triggerVariants>;
|
|
41
45
|
type SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>;
|
|
42
|
-
type
|
|
43
|
-
type
|
|
46
|
+
type Props = TriggerVariants & SelectProps & Children & Shared & Icon;
|
|
47
|
+
type MultiSelectProps = Props & MultiSelect;
|
|
48
|
+
type SingleSelectProps = Props & SingleSelect;
|
|
44
49
|
declare const Combobox: React.ForwardRefExoticComponent<(Omit<MultiSelectProps, "ref"> | Omit<SingleSelectProps, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
45
50
|
declare const triggerVariants: (props?: ({
|
|
46
51
|
variant?: "default" | "chip" | null | undefined;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as cva_types from 'cva/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
|
+
import { icons } from 'lucide-react';
|
|
4
5
|
import { VariantProps } from 'cva';
|
|
5
6
|
|
|
7
|
+
type Icon = {
|
|
8
|
+
icon?: keyof typeof icons;
|
|
9
|
+
};
|
|
6
10
|
type Children = {
|
|
7
11
|
children?: (props: {
|
|
8
12
|
close: () => void;
|
|
@@ -39,8 +43,9 @@ type SingleSelect = {
|
|
|
39
43
|
};
|
|
40
44
|
type TriggerVariants = VariantProps<typeof triggerVariants>;
|
|
41
45
|
type SelectProps = Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size' | 'children'>;
|
|
42
|
-
type
|
|
43
|
-
type
|
|
46
|
+
type Props = TriggerVariants & SelectProps & Children & Shared & Icon;
|
|
47
|
+
type MultiSelectProps = Props & MultiSelect;
|
|
48
|
+
type SingleSelectProps = Props & SingleSelect;
|
|
44
49
|
declare const Combobox: React.ForwardRefExoticComponent<(Omit<MultiSelectProps, "ref"> | Omit<SingleSelectProps, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
45
50
|
declare const triggerVariants: (props?: ({
|
|
46
51
|
variant?: "default" | "chip" | null | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{forwardRef as Oe,useEffect as He,useState as pe}from"react";import{ChevronDownIcon as Ge}from"lucide-react";import{cva as Ae}from"cva";import{clsx as he}from"clsx";import{twMerge as ve}from"tailwind-merge";function a(...e){return ve(he(e))}import{Command as r}from"cmdk";import{Search as Ne}from"lucide-react";import*as h from"react";import*as i from"@radix-ui/react-dialog";import{X as ye}from"lucide-react";import*as R from"react";import{jsx as u,jsxs as _}from"react/jsx-runtime";var Pe=i.Portal;var $=R.forwardRef(({className:e,...t},o)=>u(i.Overlay,{ref:o,className:a("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",e),...t}));$.displayName=i.Overlay.displayName;var q=R.forwardRef(({className:e,children:t,...o},n)=>_(Pe,{children:[u($,{}),_(i.Content,{ref:n,className:a("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",e),...o,children:[t,_(i.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",children:[u(ye,{className:"h-4 w-4"}),u("span",{className:"sr-only",children:"Close"})]})]})]}));q.displayName=i.Content.displayName;var xe=({className:e,...t})=>u("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xe.displayName="DialogHeader";var Ce=({className:e,...t})=>u("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ce.displayName="DialogFooter";var Re=R.forwardRef(({className:e,...t},o)=>u(i.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));Re.displayName=i.Title.displayName;var be=R.forwardRef(({className:e,...t},o)=>u(i.Description,{ref:o,className:a("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));be.displayName=i.Description.displayName;import{jsx as f,jsxs as De}from"react/jsx-runtime";var W=h.forwardRef(({className:e,...t},o)=>f(r,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",e),...t}));W.displayName=r.displayName;var V=h.forwardRef(({className:e,...t},o)=>De("div",{className:"m-1 flex items-center rounded-xl border px-3","cmdk-input-wrapper":"",children:[f(Ne,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f(r.Input,{ref:o,className:a("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",e),...t})]}));V.displayName=r.Input.displayName;var z=h.forwardRef(({className:e,...t},o)=>f(r.List,{ref:o,className:a("overflow-y-auto overflow-x-hidden",e),...t}));z.displayName=r.List.displayName;var M=h.forwardRef((e,t)=>f(r.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));M.displayName=r.Empty.displayName;var O=h.forwardRef(({className:e,...t},o)=>f(r.Group,{ref:o,className:a("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",e),...t}));O.displayName=r.Group.displayName;var ke=h.forwardRef(({className:e,...t},o)=>f(r.Separator,{ref:o,className:a("-mx-1 h-px bg-neutral-200",e),...t}));ke.displayName=r.Separator.displayName;var H=h.forwardRef(({className:e,...t},o)=>f(r.Item,{ref:o,className:a("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",e),...t}));H.displayName=r.Item.displayName;var we=({className:e,...t})=>f("span",{className:a("ml-auto text-xs tracking-widest text-neutral-500",e),...t});we.displayName="CommandShortcut";import*as U from"react";import*as g from"@radix-ui/react-popover";import{jsx as Q}from"react/jsx-runtime";var Y=g.Root,Z=g.Trigger,G=U.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},s)=>Q(g.Portal,{children:Q(g.Content,{ref:s,align:t,sideOffset:o,className:a("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",e),...n})}));G.displayName=g.Content.displayName;import*as A from"@radix-ui/react-separator";import*as j from"react";import{jsx as Se}from"react/jsx-runtime";var B=j.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},s)=>Se(A.Root,{ref:s,decorative:o,orientation:t,className:a("shrink-0 bg-grey-10",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));B.displayName=A.Root.displayName;import{CheckIcon as Te}from"lucide-react";import*as N from"@radix-ui/react-checkbox";import{Check as Ee,Minus as Ie}from"lucide-react";import{forwardRef as ee}from"react";import{jsx as b,jsxs as ie}from"react/jsx-runtime";var te=ee(({className:e,...t},o)=>b(N.Root,{ref:o,className:a("group","peer","h-5","w-5","shrink-0","rounded-md","border","border-grey-10","outline","outline-1","outline-offset-2","outline-transparent","hover:border-grey-20","focus:outline-purple-100","active:border-green-80","disabled:cursor-not-allowed","disabled:opacity-50","data-[state=checked]:bg-green-80","data-[state=indeterminate]:bg-green-80","data-[state=checked]:text-white","data-[state=indeterminate]:text-primary-foreground",t.disabled&&"data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",e),...t,children:ie(N.Indicator,{className:"flex items-center justify-center text-current",children:[b(Ee,{className:"hidden h-4 w-4 group-data-[state=checked]:block"}),b(Ie,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"})]})}));te.displayName=N.Root.displayName;var oe=ee(({classNames:e,children:t,...o},n)=>{let{disabled:s}=o,p=o.id??`${o.name??o.value?.toString()}-checkbox`,v=s?"text-grey-40 pointer-events-none":"";return ie("div",{className:a("flex space-x-2",e?.wrapper),children:[b(te,{id:p,disabled:s,ref:n,...o}),b("label",{htmlFor:p,className:a(v,e?.label),children:t})]})});oe.displayName="Checkbox";var ae=oe;import{icons as re}from"lucide-react";import{jsx as C,jsxs as ne}from"react/jsx-runtime";function Le({icon:e,hasCheckbox:t,isSelected:o,className:n,title:s,value:p,description:v,...E}){let D=e?(P=>{if(P in re){let S=re[P];return C(S,{size:14})}return null})(e):void 0;return ne("li",{className:a("group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",n),...E,"data-state":o?"checked":"unchecked",children:[D&&C("span",{className:"mr-2",children:D}),t&&C(ae,{id:p,checked:o,onClick:P=>P.preventDefault()}),ne("div",{children:[C("p",{children:s}),C("p",{className:"text-xs text-grey-80",children:v})]}),C(Te,{className:"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",size:16})]})}var se=Le;import{cva as _e}from"cva";import{jsx as Ve}from"react/jsx-runtime";var We=_e("rounded-full px-2 py-0.5 text-xs font-semibold",{variants:{variant:{green:"bg-green-90 text-white",pickle:"bg-pickle-100 text-black",purple:"bg-purple-100 text-white"}},defaultVariants:{variant:"green"}});function le({className:e,variant:t,...o}){return Ve("div",{className:a(We({variant:t}),e),...o})}import{jsx as Me}from"react/jsx-runtime";function ze({text:e,className:t,...o}){return e?Me("label",{className:a("text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...o,children:e}):null}var me=ze;import{jsx as l,jsxs as k}from"react/jsx-runtime";var Be=Oe((e,t)=>{let{value:o,label:n,options:s,classNames:p,multiselect:v,placeholder:E,variant:w="default",size:D,className:P,onChange:S,children:I}=e,[x,T]=pe([]),[F,K]=pe(!1),de=s?.length<=5,L=w==="default",ce=w==="chip",X=()=>K(!1);He(()=>{T(v?o??[]:o?[o]:[])},[o]);let fe=m=>{if(v)return T(y=>{let J=y.includes(m)?y.filter(ue=>ue!==m):[...y,m];return S?.(J),J});T([m]),S?.(m),X()},ge=()=>{let m=x.length>0?x.join(", "):E;return L?m:n};return k("div",{className:a("flex flex-col gap-2",P),children:[L&&n&&l(me,{text:n,className:p?.label}),k(Y,{open:F,onOpenChange:K,children:[l(Z,{asChild:!0,disabled:s.length===0,children:k("div",{ref:t,className:a(Fe({variant:w,size:D}),p?.trigger),"aria-expanded":F,children:[ce&&x.length>0&&l(le,{variant:"purple",children:x.length}),l("span",{className:a("truncate leading-normal",L&&x.length==0&&"text-grey-40"),children:ge()}),l(Ge,{className:"transform group-data-[state=open]:rotate-180",size:"16"})]})}),l(W,{children:k(G,{className:a("flex w-full max-w-xs flex-col overflow-hidden p-0","max-h-[--radix-popover-content-available-height]",p?.content),collisionPadding:8,sideOffset:4,align:"start",children:[!de&&l(V,{placeholder:"Search..."}),k(z,{children:[l(M,{children:"No results"}),l(O,{children:s.map(({id:m,...y})=>l(H,{value:y.value,onSelect:fe,children:l(se,{className:a(p?.items,"truncate py-1"),isSelected:x?.includes(y.value),hasCheckbox:v,...y})},m))})]}),!!I&&l(B,{}),I&&I({close:X})]})})]})]})});Be.displayName="Combobox";var Fe=Ae("group relative cursor-pointer flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",{variants:{variant:{default:["w-full","max-w-80","rounded-lg"],chip:["font-bold","rounded-3xl","data-[state=open]:bg-black","data-[state=open]:text-white"]},size:{small:["h-8","p-1","pl-2","text-xs"],normal:["h-9","p-2","pl-3","text-sm"],large:["h-10","p-3","pl-4","text-base"]}},defaultVariants:{variant:"default",size:"normal"}});export{Be as Combobox};
|
|
1
|
+
"use client";import{forwardRef as Ae,useEffect as Be,useState as ce}from"react";import{ChevronDownIcon as Fe,CircleX as Xe,icons as Ke}from"lucide-react";import{cva as Je}from"cva";import{clsx as Pe}from"clsx";import{twMerge as xe}from"tailwind-merge";function a(...e){return xe(Pe(e))}import{Command as n}from"cmdk";import{Search as De}from"lucide-react";import*as y from"react";import*as i from"@radix-ui/react-dialog";import{X as Ce}from"lucide-react";import*as R from"react";import{jsx as v,jsxs as W}from"react/jsx-runtime";var be=i.Portal;var Q=R.forwardRef(({className:e,...t},o)=>v(i.Overlay,{ref:o,className:a("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",e),...t}));Q.displayName=i.Overlay.displayName;var U=R.forwardRef(({className:e,children:t,...o},s)=>W(be,{children:[v(Q,{}),W(i.Content,{ref:s,className:a("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",e),...o,children:[t,W(i.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",children:[v(Ce,{className:"h-4 w-4"}),v("span",{className:"sr-only",children:"Close"})]})]})]}));U.displayName=i.Content.displayName;var Re=({className:e,...t})=>v("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Re.displayName="DialogHeader";var Ne=({className:e,...t})=>v("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ne.displayName="DialogFooter";var ke=R.forwardRef(({className:e,...t},o)=>v(i.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));ke.displayName=i.Title.displayName;var we=R.forwardRef(({className:e,...t},o)=>v(i.Description,{ref:o,className:a("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));we.displayName=i.Description.displayName;import{jsx as f,jsxs as Ee}from"react/jsx-runtime";var V=y.forwardRef(({className:e,...t},o)=>f(n,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",e),...t}));V.displayName=n.displayName;var z=y.forwardRef(({className:e,...t},o)=>Ee("div",{className:"m-1 flex items-center rounded-xl border px-3","cmdk-input-wrapper":"",children:[f(De,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f(n.Input,{ref:o,className:a("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",e),...t})]}));z.displayName=n.Input.displayName;var M=y.forwardRef(({className:e,...t},o)=>f(n.List,{ref:o,className:a("overflow-y-auto overflow-x-hidden",e),...t}));M.displayName=n.List.displayName;var O=y.forwardRef((e,t)=>f(n.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));O.displayName=n.Empty.displayName;var H=y.forwardRef(({className:e,...t},o)=>f(n.Group,{ref:o,className:a("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",e),...t}));H.displayName=n.Group.displayName;var Se=y.forwardRef(({className:e,...t},o)=>f(n.Separator,{ref:o,className:a("-mx-1 h-px bg-neutral-200",e),...t}));Se.displayName=n.Separator.displayName;var G=y.forwardRef(({className:e,...t},o)=>f(n.Item,{ref:o,className:a("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",e),...t}));G.displayName=n.Item.displayName;var Ie=({className:e,...t})=>f("span",{className:a("ml-auto text-xs tracking-widest text-neutral-500",e),...t});Ie.displayName="CommandShortcut";import*as Z from"react";import*as g from"@radix-ui/react-popover";import{jsx as Y}from"react/jsx-runtime";var j=g.Root,ee=g.Trigger,A=Z.forwardRef(({className:e,align:t="center",sideOffset:o=4,...s},l)=>Y(g.Portal,{children:Y(g.Content,{ref:l,align:t,sideOffset:o,className:a("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",e),...s})}));A.displayName=g.Content.displayName;import*as B from"@radix-ui/react-separator";import*as te from"react";import{jsx as Le}from"react/jsx-runtime";var F=te.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...s},l)=>Le(B.Root,{ref:l,decorative:o,orientation:t,className:a("shrink-0 bg-grey-10",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));F.displayName=B.Root.displayName;import{CheckIcon as We}from"lucide-react";import*as k from"@radix-ui/react-checkbox";import{Check as Te,Minus as _e}from"lucide-react";import{forwardRef as oe}from"react";import{jsx as N,jsxs as ne}from"react/jsx-runtime";var ae=oe(({className:e,...t},o)=>N(k.Root,{ref:o,className:a("group","peer","h-5","w-5","shrink-0","rounded-md","border","border-grey-10","outline","outline-1","outline-offset-2","outline-transparent","hover:border-grey-20","focus:outline-purple-100","active:border-green-80","disabled:cursor-not-allowed","disabled:opacity-50","data-[state=checked]:bg-green-80","data-[state=indeterminate]:bg-green-80","data-[state=checked]:text-white","data-[state=indeterminate]:text-primary-foreground",t.disabled&&"data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",e),...t,children:ne(k.Indicator,{className:"flex items-center justify-center text-current",children:[N(Te,{className:"hidden h-4 w-4 group-data-[state=checked]:block"}),N(_e,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"})]})}));ae.displayName=k.Root.displayName;var ie=oe(({classNames:e,children:t,...o},s)=>{let{disabled:l}=o,p=o.id??`${o.name??o.value?.toString()}-checkbox`,u=l?"text-grey-40 pointer-events-none":"";return ne("div",{className:a("flex space-x-2",e?.wrapper),children:[N(ae,{id:p,disabled:l,ref:s,...o}),N("label",{htmlFor:p,className:a(u,e?.label),children:t})]})});ie.displayName="Checkbox";var re=ie;import{icons as se}from"lucide-react";import{jsx as C,jsxs as le}from"react/jsx-runtime";function Ve({icon:e,hasCheckbox:t,isSelected:o,className:s,title:l,value:p,description:u,...L}){let S=e?(P=>{if(P in se){let T=se[P];return C(T,{size:14})}return null})(e):void 0;return le("li",{className:a("group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",s),...L,"data-state":o?"checked":"unchecked",children:[S&&C("span",{className:"mr-2",children:S}),t&&C(re,{id:p,checked:o,onClick:P=>P.preventDefault()}),le("div",{children:[C("p",{children:l}),C("p",{className:"text-xs text-grey-80",children:u})]}),C(We,{className:"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",size:16})]})}var me=Ve;import{cva as ze}from"cva";import{jsx as Oe}from"react/jsx-runtime";var Me=ze("rounded-full px-2 py-0.5 text-xs font-semibold",{variants:{variant:{green:"bg-green-90 text-white",pickle:"bg-pickle-100 text-black",purple:"bg-purple-100 text-white"}},defaultVariants:{variant:"green"}});function pe({className:e,variant:t,...o}){return Oe("div",{className:a(Me({variant:t}),e),...o})}import{jsx as Ge}from"react/jsx-runtime";function He({text:e,className:t,...o}){return e?Ge("label",{className:a("text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...o,children:e}):null}var de=He;import{jsx as r,jsxs as w}from"react/jsx-runtime";var $e=Ae((e,t)=>{let{value:o,label:s,options:l,classNames:p,multiselect:u,placeholder:L,variant:D="default",size:S,icon:P,className:T,onChange:I,children:_}=e,[h,E]=ce([]),[X,K]=ce(!1),J=P&&Ke[P],fe=l?.length<=5,b=D==="default",ge=D==="chip",$=()=>K(!1);Be(()=>{E(u?o??[]:o?[o]:[])},[o]);let ue=m=>{if(u)return E(x=>{let q=x.includes(m)?x.filter(ye=>ye!==m):[...x,m];return I?.(q),q});E([m]),I?.(m),$()},he=()=>{E([]),I?.(u?[]:"")},ve=()=>{let m=h.length>0?h.join(", "):L;return b?m:s};return w("div",{className:a("flex flex-col gap-2",T),children:[b&&s&&r(de,{text:s,className:p?.label}),w(j,{open:X,onOpenChange:K,children:[r(ee,{asChild:!0,disabled:l.length===0,children:w("div",{ref:t,className:a(qe({variant:D,size:S}),p?.trigger),"aria-expanded":X,children:[b&&J&&r(J,{className:"h-4 w-4 shrink-0"}),ge&&h.length>0&&r(pe,{variant:"purple",children:h.length}),r("span",{className:a("truncate leading-normal",b&&h.length==0&&"text-grey-40"),children:ve()}),h.length==0&&r(Fe,{className:"transform group-data-[state=open]:rotate-180",size:"16"}),b&&h.length>0&&r("button",{type:"button",className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",onClick:he,children:r(Xe,{className:"h-4 w-4 text-green-100"})})]})}),r(V,{children:w(A,{className:a("flex w-full max-w-xs flex-col overflow-hidden p-0","max-h-[--radix-popover-content-available-height]",p?.content),collisionPadding:8,sideOffset:4,align:"start",children:[!fe&&r(z,{placeholder:"Search..."}),w(M,{children:[r(O,{children:"No results"}),r(H,{children:l.map(({id:m,...x})=>r(G,{value:x.value,onSelect:ue,children:r(me,{className:a(p?.items,"truncate py-1"),isSelected:h?.includes(x.value),hasCheckbox:u,...x})},m))})]}),!!_&&r(F,{}),_&&_({close:$})]})})]})]})});$e.displayName="Combobox";var qe=Je("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",{variants:{variant:{default:["w-full","max-w-80","rounded-lg"],chip:["font-bold","rounded-3xl","data-[state=open]:bg-black","data-[state=open]:text-white"]},size:{small:["h-8","p-1","pl-2","text-xs"],normal:["h-9","p-2","pl-3","text-sm"],large:["h-10","p-3","pl-4","text-base"]}},defaultVariants:{variant:"default",size:"normal"}});export{$e as Combobox};
|
|
2
2
|
//# sourceMappingURL=Combobox.js.map
|
|
@@ -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 } 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 Children = { children?: (props: { close: () => void }) => JSX.Element }\ntype Option = { id: number; 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 MultiSelectProps = TriggerVariants & SelectProps & Children & Shared & MultiSelect\ntype SingleSelectProps = TriggerVariants & SelectProps & Children & Shared & 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 className,\n onChange: handleChange,\n children: footer,\n } = props\n const [selected, setSelected] = useState<string[]>([])\n const [open, setOpen] = useState(false)\n const hideSearchBox = options?.length <= 5\n const isDefault = variant === 'default'\n const isChip = variant === 'chip'\n const close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(valueArray)\n }, [value])\n\n const handleSelect = (option: string) => {\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.includes(option)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected)\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option)\n close()\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = selected.length > 0 ? selected.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 <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild disabled={options.length === 0}>\n <div\n ref={ref}\n className={cn(triggerVariants({ variant, size }), classNames?.trigger)}\n aria-expanded={open}\n >\n {isChip && selected.length > 0 && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'truncate leading-normal',\n isDefault && selected.length == 0 && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n <ChevronDownIcon className=\"transform group-data-[state=open]:rotate-180\" size=\"16\" />\n </div>\n </PopoverTrigger>\n\n <Command>\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 {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem key={id} value={option.value} onSelect={handleSelect}>\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected?.includes(option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </PopoverContent>\n </Command>\n </Popover>\n </div>\n )\n})\nCombobox.displayName = 'Combobox'\n\nconst triggerVariants = cva(\n 'group relative cursor-pointer 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', 'max-w-80', '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', 'p-1', 'pl-2', 'text-xs'],\n normal: ['h-9', 'p-2', 'pl-3', 'text-sm'],\n large: ['h-10', 'p-3', 'pl-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,OAAyB,cAAAA,GAAY,aAAAC,GAAW,YAAAC,OAAgB,QAChE,OAAS,mBAAAC,OAAuB,eAChC,OAAS,OAAAC,OAA8B,MCJvC,OAA0B,QAAAC,OAAY,OACtC,OAAS,WAAAC,OAAe,i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EACH,GACF,EAEC,CAAC,CAAC/B,GAAUhB,EAACkD,EAAA,EAAU,EACvBlC,GAAUA,EAAO,CAAE,MAAAS,CAAM,CAAC,GAC7B,EACF,GACF,GACF,CAEJ,CAAC,EACDvB,GAAS,YAAc,WAEvB,IAAMoC,GAAkBa,GACtB,iJACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,CAAC,SAAU,WAAY,YAAY,EAC5C,KAAM,CACJ,YACA,cACA,6BACA,8BACF,CACF,EACA,KAAM,CACJ,MAAO,CAAC,MAAO,MAAO,OAAQ,SAAS,EACvC,OAAQ,CAAC,MAAO,MAAO,OAAQ,SAAS,EACxC,MAAO,CAAC,OAAQ,MAAO,OAAQ,WAAW,CAC5C,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,QACR,CACF,CACF","names":["forwardRef","useEffect","useState","ChevronDownIcon","cva","clsx","twMerge","cn","inputs","CommandPrimitive","Search","React","DialogPrimitive","X","React","jsx","jsxs","DialogPortal","DialogOverlay","className","props","ref","jsx","cn","DialogContent","children","jsxs","DialogPortal","X","DialogHeader","DialogFooter","DialogTitle","DialogDescription","jsx","jsxs","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","jsxs","jsx","Search","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","PopoverPrimitive","jsx","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cn","SeparatorPrimitive","React","jsx","Separator","className","orientation","decorative","props","ref","cn","CheckIcon","CheckboxPrimitive","Check","Minus","forwardRef","jsx","jsxs","CheckboxToggle","forwardRef","className","props","ref","cn","Check","Minus","Checkbox","classNames","children","disabled","id","labelClassName","Checkbox_default","icons","jsx","jsxs","ListItem","icon","hasCheckbox","isSelected","className","title","value","description","props","optionIcon","IconComponent","cn","Checkbox_default","e","CheckIcon","ListItem_default","cva","jsx","badgeVariants","cva","Badge","className","variant","props","cn","jsx","Label","text","className","props","cn","Label_default","jsx","jsxs","Combobox","forwardRef","props","ref","value","label","options","classNames","multiselect","placeholder","variant","size","className","handleChange","footer","selected","setSelected","useState","open","setOpen","hideSearchBox","isDefault","isChip","close","useEffect","handleSelect","option","prev","newSelected","v","handleDisplayValue","defaultLabel","cn","Label_default","Popover","PopoverTrigger","triggerVariants","Badge","ChevronDownIcon","Command","PopoverContent","CommandInput","CommandList","CommandEmpty","CommandGroup","id","CommandItem","ListItem_default","Separator","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: number; 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<string[]>([])\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 close = () => setOpen(false)\n\n useEffect(() => {\n const valueArray = multiselect ? (value ?? []) : value ? [value] : []\n setSelected(valueArray)\n }, [value])\n\n const handleSelect = (option: string) => {\n if (multiselect) {\n return setSelected((prev) => {\n const newSelected = prev.includes(option)\n ? prev.filter((v) => v !== option)\n : [...prev, option]\n handleChange?.(newSelected)\n return newSelected\n })\n }\n setSelected([option])\n handleChange?.(option)\n close()\n }\n\n const handleClear = () => {\n setSelected([])\n multiselect ? handleChange?.([]) : handleChange?.('')\n }\n\n const handleDisplayValue = () => {\n const defaultLabel = selected.length > 0 ? selected.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 <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild disabled={options.length === 0}>\n <div\n ref={ref}\n className={cn(triggerVariants({ variant, size }), classNames?.trigger)}\n aria-expanded={open}\n >\n {isDefault && IconComponent && <IconComponent className=\"h-4 w-4 shrink-0\" />}\n {isChip && selected.length > 0 && <Badge variant=\"purple\">{selected.length}</Badge>}\n\n <span\n className={cn(\n 'truncate leading-normal',\n isDefault && selected.length == 0 && 'text-grey-40'\n )}\n >\n {handleDisplayValue()}\n </span>\n\n {selected.length == 0 && (\n <ChevronDownIcon className=\"transform group-data-[state=open]:rotate-180\" size=\"16\" />\n )}\n\n {isDefault && selected.length > 0 && (\n <button\n type=\"button\"\n className=\"flex h-8 w-8 shrink-0 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 </PopoverTrigger>\n\n <Command>\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 {!hideSearchBox && <CommandInput placeholder=\"Search...\" />}\n\n <CommandList>\n <CommandEmpty>No results</CommandEmpty>\n <CommandGroup>\n {options.map(({ id, ...option }) => (\n <CommandItem key={id} value={option.value} onSelect={handleSelect}>\n <ListItem\n className={cn(classNames?.items, 'truncate py-1')}\n isSelected={selected?.includes(option.value)}\n hasCheckbox={multiselect}\n {...option}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n\n {!!footer && <Separator />}\n {footer && footer({ close })}\n </PopoverContent>\n </Command>\n </Popover>\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', 'max-w-80', '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', 'p-1', 'pl-2', 'text-xs'],\n normal: ['h-9', 'p-2', 'pl-3', 'text-sm'],\n large: ['h-10', 'p-3', 'pl-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,OAAyB,cAAAA,GAAY,aAAAC,GAAW,YAAAC,OAAgB,QAChE,OAAS,mBAAAC,GAAiB,WAAAC,GAAS,SAAAC,OAAa,eAChD,OAAS,OAAAC,OAA8B,MCJvC,OAA0B,QAAAC,OAAY,OACtC,OAAS,WAAAC,OAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,GAAQD,GAAKG,CAAM,CAAC,CAC7B,CCFA,OAAS,WAAWC,MAAwB,OAC5C,OAAS,UAAAC,OAAc,eACvB,UAAYC,MAAW,QCFvB,UAAYC,MAAqB,yBACjC,OAAS,KAAAC,OAAS,eAClB,UAA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nD,SAAA9B,EAACsD,GAAA,CACC,UAAWhB,EAAG7B,GAAY,MAAO,eAAe,EAChD,WAAYS,GAAU,SAASa,EAAO,KAAK,EAC3C,YAAarB,EACZ,GAAGqB,EACN,GANgBqB,CAOlB,CACD,EACH,GACF,EAEC,CAAC,CAACnC,GAAUjB,EAACuD,EAAA,EAAU,EACvBtC,GAAUA,EAAO,CAAE,MAAAW,CAAM,CAAC,GAC7B,EACF,GACF,GACF,CAEJ,CAAC,EACD1B,GAAS,YAAc,WAEvB,IAAMwC,GAAkBc,GACtB,gKACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,CAAC,SAAU,WAAY,YAAY,EAC5C,KAAM,CACJ,YACA,cACA,6BACA,8BACF,CACF,EACA,KAAM,CACJ,MAAO,CAAC,MAAO,MAAO,OAAQ,SAAS,EACvC,OAAQ,CAAC,MAAO,MAAO,OAAQ,SAAS,EACxC,MAAO,CAAC,OAAQ,MAAO,OAAQ,WAAW,CAC5C,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,QACR,CACF,CACF","names":["forwardRef","useEffect","useState","ChevronDownIcon","CircleX","icons","cva","clsx","twMerge","cn","inputs","CommandPrimitive","Search","React","DialogPrimitive","X","React","jsx","jsxs","DialogPortal","DialogOverlay","className","props","ref","jsx","cn","DialogContent","children","jsxs","DialogPortal","X","DialogHeader","DialogFooter","DialogTitle","DialogDescription","jsx","jsxs","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","jsxs","jsx","Search","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","PopoverPrimitive","jsx","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cn","SeparatorPrimitive","React","jsx","Separator","className","orientation","decorative","props","ref","cn","CheckIcon","CheckboxPrimitive","Check","Minus","forwardRef","jsx","jsxs","CheckboxToggle","forwardRef","className","props","ref","cn","Check","Minus","Checkbox","classNames","children","disabled","id","labelClassName","Checkbox_default","icons","jsx","jsxs","ListItem","icon","hasCheckbox","isSelected","className","title","value","description","props","optionIcon","IconComponent","cn","Checkbox_default","e","CheckIcon","ListItem_default","cva","jsx","badgeVariants","cva","Badge","className","variant","props","cn","jsx","Label","text","className","props","cn","Label_default","jsx","jsxs","Combobox","forwardRef","props","ref","value","label","options","classNames","multiselect","placeholder","variant","size","icon","className","handleChange","footer","selected","setSelected","useState","open","setOpen","IconComponent","icons","hideSearchBox","isDefault","isChip","close","useEffect","handleSelect","option","prev","newSelected","v","handleClear","handleDisplayValue","defaultLabel","cn","Label_default","Popover","PopoverTrigger","triggerVariants","Badge","ChevronDownIcon","CircleX","Command","PopoverContent","CommandInput","CommandList","CommandEmpty","CommandGroup","id","CommandItem","ListItem_default","Separator","cva"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Fe=Object.create;var q=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Qe=(e,t)=>{for(var o in t)q(e,o,{get:t[o],enumerable:!0})},ge=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $e(t))!qe.call(e,n)&&n!==o&&q(e,n,{get:()=>t[n],enumerable:!(i=Xe(t,n))||i.enumerable});return e};var R=(e,t,o)=>(o=e!=null?Fe(Je(e)):{},ge(t||!e||!e.__esModule?q(o,"default",{value:e,enumerable:!0}):o,e)),Ue=e=>ge(q({},"__esModule",{value:!0}),e);var dt={};Qe(dt,{Badge:()=>j,Button:()=>ie,Checkbox:()=>Y,Chip:()=>Q,Combobox:()=>ue,Label:()=>M,ListItem:()=>Z,Select:()=>Ne,cn:()=>a});module.exports=Ue(dt);var m=R(require("@radix-ui/react-select"),1),_=require("lucide-react"),k=require("react");var ve=require("clsx"),he=require("tailwind-merge");function a(...e){return(0,he.twMerge)((0,ve.clsx)(e))}var xe=require("react/jsx-runtime");function Ye({text:e,className:t,...o}){return e?(0,xe.jsx)("label",{className:a("text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...o,children:e}):null}var M=Ye;var ye=require("cva"),be=require("tailwind-merge"),Pe=require("react/jsx-runtime"),Ze=({className:e,variant:t,size:o,...i})=>(0,Pe.jsx)("div",{className:(0,be.twMerge)(je({variant:t,size:o,className:e})),...i}),je=(0,ye.cva)(["flex","items-center","rounded-3xl","border","w-fit"],{variants:{variant:{neutral:["text-grey-80","border-grey-10"],primary:["text-purple-100","border-purple-20"],danger:["text-pumpkin-100","border-pumpkin-20"],onboarding:["text-green-100","bg-green-10","cursor-pointer"],onboardingSelected:["text-white","bg-green-90","cursor-pointer"]},size:{small:["text-sm","leading-5","px-2","py-1","gap-1.5"],medium:["text-base","leading-6","px-3","py-2","gap-2"]}},defaultVariants:{variant:"neutral",size:"medium"}}),Q=Ze;var oe=R(require("@radix-ui/react-separator"),1),Ce=R(require("react"),1);var Re=require("react/jsx-runtime"),B=Ce.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...i},n)=>(0,Re.jsx)(oe.Root,{ref:n,decorative:o,orientation:t,className:a("shrink-0 bg-grey-10",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));B.displayName=oe.Root.displayName;var l=require("react/jsx-runtime"),ke=(0,k.forwardRef)(({label:e,options:t,placeholder:o,multiselect:i,classNames:n,...c},b)=>{let{value:C,defaultValue:I,dir:V,className:S,onChange:z,...O}=c,[v,L]=(0,k.useState)([]),[K,W]=(0,k.useState)(!1),F=(0,k.useRef)(null);(0,k.useEffect)(()=>{if(!C)return L([]);L(Array.isArray(C)?C:[C])},[C]);let H=()=>W(r=>!r),ee=r=>r.key==="Escape"&&W(!1),X=(r,f)=>r.key==="Enter"&&x(f),$=v?.map(r=>t?.find(({value:f})=>f===r)).filter(Boolean);function J(){return i?v.map(r=>t?.find(f=>f.value===r)?.title).join(", "):t?.find(r=>r.value===v.join())?.title}function h(r){(!i||r)&&W(r)}function x(r){let f=[];L(D=>(f=D.includes(r)?D.filter(te=>te!==r):[...D,r],i?f:[r])),z?.(i?f:r)}return(0,l.jsxs)("div",{className:a("flex flex-col space-y-2",S),ref:F,children:[(0,l.jsx)(M,{text:e,className:n?.label}),(0,l.jsxs)(m.Root,{open:K,value:v.join(","),onOpenChange:h,onValueChange:i?void 0:x,defaultValue:typeof I=="string"?I:void 0,dir:V==="rtl"?"rtl":"ltr",...O,children:[(0,l.jsxs)(m.Trigger,{ref:b,"data-testid":`${e.toLowerCase()}-select-element`,className:"group flex min-w-80 flex-row items-center justify-between gap-3 rounded-lg border border-grey-20 px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",children:[(0,l.jsx)("span",{className:"truncate",children:(0,l.jsx)(m.Value,{placeholder:o??"Select an option","aria-label":J(),children:J()})}),(0,l.jsx)(_.ChevronDownIcon,{className:"transform text-black group-data-[state=open]:rotate-180",size:"16"})]}),(0,l.jsx)(m.Portal,{container:F.current,children:(0,l.jsx)(m.Content,{hideWhenDetached:!0,className:"z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",position:"popper",sideOffset:4,onPointerDownOutside:H,onKeyDown:ee,children:(0,l.jsxs)(m.Viewport,{children:[i&&!!$?.length&&(0,l.jsx)(m.Group,{className:"mb-2 flex flex-row flex-wrap gap-1 px-2","data-testid":"selected-labels",children:$?.map(r=>r&&(0,l.jsxs)(Q,{size:"small",variant:"primary",children:[(0,l.jsx)("span",{children:r.title}),(0,l.jsx)(_.X,{size:18,"data-testid":`chip-remove-${r.value}`,className:"cursor-pointer",onClick:()=>x(r.value)})]},r.title))}),(0,l.jsx)(B,{}),t?.map(({id:r,title:f,value:D})=>(0,l.jsxs)(m.Item,{value:D,className:"group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100","data-state":v.includes(D)?"checked":"unchecked",onKeyDown:te=>X(te,D),onClick:()=>x(D),children:[(0,l.jsx)(m.ItemText,{children:f}),(0,l.jsx)(_.CheckIcon,{className:"absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",size:16})]},r))]})})})]})]})});ke.displayName="Select";var Ne=ke;var A=R(require("@radix-ui/react-checkbox"),1),U=require("lucide-react"),ae=require("react");var N=require("react/jsx-runtime"),we=(0,ae.forwardRef)(({className:e,...t},o)=>(0,N.jsx)(A.Root,{ref:o,className:a("group","peer","h-5","w-5","shrink-0","rounded-md","border","border-grey-10","outline","outline-1","outline-offset-2","outline-transparent","hover:border-grey-20","focus:outline-purple-100","active:border-green-80","disabled:cursor-not-allowed","disabled:opacity-50","data-[state=checked]:bg-green-80","data-[state=indeterminate]:bg-green-80","data-[state=checked]:text-white","data-[state=indeterminate]:text-primary-foreground",t.disabled&&"data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",e),...t,children:(0,N.jsxs)(A.Indicator,{className:"flex items-center justify-center text-current",children:[(0,N.jsx)(U.Check,{className:"hidden h-4 w-4 group-data-[state=checked]:block"}),(0,N.jsx)(U.Minus,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"})]})}));we.displayName=A.Root.displayName;var Se=(0,ae.forwardRef)(({classNames:e,children:t,...o},i)=>{let{disabled:n}=o,c=o.id??`${o.name??o.value?.toString()}-checkbox`,b=n?"text-grey-40 pointer-events-none":"";return(0,N.jsxs)("div",{className:a("flex space-x-2",e?.wrapper),children:[(0,N.jsx)(we,{id:c,disabled:n,ref:i,...o}),(0,N.jsx)("label",{htmlFor:c,className:a(b,e?.label),children:t})]})});Se.displayName="Checkbox";var Y=Se;var De=require("lucide-react");var re=require("lucide-react"),P=require("react/jsx-runtime");function et({icon:e,hasCheckbox:t,isSelected:o,className:i,title:n,value:c,description:b,...C}){let V=e?(S=>{if(S in re.icons){let z=re.icons[S];return(0,P.jsx)(z,{size:14})}return null})(e):void 0;return(0,P.jsxs)("li",{className:a("group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",i),...C,"data-state":o?"checked":"unchecked",children:[V&&(0,P.jsx)("span",{className:"mr-2",children:V}),t&&(0,P.jsx)(Y,{id:c,checked:o,onClick:S=>S.preventDefault()}),(0,P.jsxs)("div",{children:[(0,P.jsx)("p",{children:n}),(0,P.jsx)("p",{className:"text-xs text-grey-80",children:b})]}),(0,P.jsx)(De.CheckIcon,{className:"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",size:16})]})}var Z=et;var Ee=require("@radix-ui/react-slot"),Ie=require("cva"),Le=require("react"),Te=require("react/jsx-runtime"),ie=(0,Le.forwardRef)(({className:e,variant:t,size:o,asChild:i=!1,...n},c)=>(0,Te.jsx)(i?Ee.Slot:"button",{className:a(tt({variant:t,size:o,className:e})),ref:c,...n}));ie.displayName="Button";var tt=(0,Ie.cva)(["flex","items-center","justify-center","gap-2","rounded-full","font-bold","outline-2","outline-offset-2","outline-dashed","outline-transparent"],{variants:{variant:{neutral:["bg-black","text-white","hover:bg-grey-90","active:bg-grey-80","focus:outline-purple-100","disabled:text-grey-40","disabled:bg-grey-10"],primary:["bg-pickle-100","text-black","hover:bg-pickle-80","active:bg-pickle-60","focus:outline-purple-100","disabled:text-grey-40","disabled:bg-grey-10"],secondary:["bg-green-80","text-white","hover:bg-green-90","active:bg-green-100","focus:outline-pickle-100","disabled:text-grey-40","disabled:bg-grey-10"],transparent:["text-white","hover:bg-green-80","active:bg-green-100","focus:outline-pickle-100","disabled:text-grey-40"],link:["leading-tight","text-black","underline","hover:text-purple-100","focus:text-black","focus:outline-purple-100","active:text-purple-80"]},size:{small:["h-10","text-sm","px-4","py-2"],medium:["h-12","text-base","px-6","py-3"],large:["h-14","text-lg","px-8","py-4"]}},defaultVariants:{variant:"neutral",size:"medium"},compoundVariants:[{variant:"link",size:"small",class:["h-3","text-xs","p-0"]},{variant:"link",size:"medium",class:["h-4","text-sm","p-0"]},{variant:"link",size:"large",class:["h-6","text-base","p-0"]}]});var T=require("react"),Ge=require("lucide-react"),Ke=require("cva");var d=require("cmdk"),Me=require("lucide-react"),E=R(require("react"),1);var p=R(require("@radix-ui/react-dialog"),1),Ve=require("lucide-react"),G=R(require("react"),1),g=require("react/jsx-runtime");var ot=p.Portal;var ze=G.forwardRef(({className:e,...t},o)=>(0,g.jsx)(p.Overlay,{ref:o,className:a("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",e),...t}));ze.displayName=p.Overlay.displayName;var We=G.forwardRef(({className:e,children:t,...o},i)=>(0,g.jsxs)(ot,{children:[(0,g.jsx)(ze,{}),(0,g.jsxs)(p.Content,{ref:i,className:a("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",e),...o,children:[t,(0,g.jsxs)(p.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",children:[(0,g.jsx)(Ve.X,{className:"h-4 w-4"}),(0,g.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));We.displayName=p.Content.displayName;var at=({className:e,...t})=>(0,g.jsx)("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});at.displayName="DialogHeader";var rt=({className:e,...t})=>(0,g.jsx)("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});rt.displayName="DialogFooter";var it=G.forwardRef(({className:e,...t},o)=>(0,g.jsx)(p.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));it.displayName=p.Title.displayName;var nt=G.forwardRef(({className:e,...t},o)=>(0,g.jsx)(p.Description,{ref:o,className:a("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));nt.displayName=p.Description.displayName;var y=require("react/jsx-runtime"),ne=E.forwardRef(({className:e,...t},o)=>(0,y.jsx)(d.Command,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",e),...t}));ne.displayName=d.Command.displayName;var le=E.forwardRef(({className:e,...t},o)=>(0,y.jsxs)("div",{className:"m-1 flex items-center rounded-xl border px-3","cmdk-input-wrapper":"",children:[(0,y.jsx)(Me.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,y.jsx)(d.Command.Input,{ref:o,className:a("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",e),...t})]}));le.displayName=d.Command.Input.displayName;var se=E.forwardRef(({className:e,...t},o)=>(0,y.jsx)(d.Command.List,{ref:o,className:a("overflow-y-auto overflow-x-hidden",e),...t}));se.displayName=d.Command.List.displayName;var me=E.forwardRef((e,t)=>(0,y.jsx)(d.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));me.displayName=d.Command.Empty.displayName;var pe=E.forwardRef(({className:e,...t},o)=>(0,y.jsx)(d.Command.Group,{ref:o,className:a("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",e),...t}));pe.displayName=d.Command.Group.displayName;var lt=E.forwardRef(({className:e,...t},o)=>(0,y.jsx)(d.Command.Separator,{ref:o,className:a("-mx-1 h-px bg-neutral-200",e),...t}));lt.displayName=d.Command.Separator.displayName;var de=E.forwardRef(({className:e,...t},o)=>(0,y.jsx)(d.Command.Item,{ref:o,className:a("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",e),...t}));de.displayName=d.Command.Item.displayName;var st=({className:e,...t})=>(0,y.jsx)("span",{className:a("ml-auto text-xs tracking-widest text-neutral-500",e),...t});st.displayName="CommandShortcut";var _e=R(require("react"),1),w=R(require("@radix-ui/react-popover"),1);var ce=require("react/jsx-runtime"),Oe=w.Root,He=w.Trigger,fe=_e.forwardRef(({className:e,align:t="center",sideOffset:o=4,...i},n)=>(0,ce.jsx)(w.Portal,{children:(0,ce.jsx)(w.Content,{ref:n,align:t,sideOffset:o,className:a("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",e),...i})}));fe.displayName=w.Content.displayName;var Be=require("cva");var Ae=require("react/jsx-runtime"),mt=(0,Be.cva)("rounded-full px-2 py-0.5 text-xs font-semibold",{variants:{variant:{green:"bg-green-90 text-white",pickle:"bg-pickle-100 text-black",purple:"bg-purple-100 text-white"}},defaultVariants:{variant:"green"}});function j({className:e,variant:t,...o}){return(0,Ae.jsx)("div",{className:a(mt({variant:t}),e),...o})}var s=require("react/jsx-runtime"),ue=(0,T.forwardRef)((e,t)=>{let{value:o,label:i,options:n,classNames:c,multiselect:b,placeholder:C,variant:I="default",size:V,className:S,onChange:z,children:O}=e,[v,L]=(0,T.useState)([]),[K,W]=(0,T.useState)(!1),F=n?.length<=5,H=I==="default",ee=I==="chip",X=()=>W(!1);(0,T.useEffect)(()=>{L(b?o??[]:o?[o]:[])},[o]);let $=h=>{if(b)return L(x=>{let r=x.includes(h)?x.filter(f=>f!==h):[...x,h];return z?.(r),r});L([h]),z?.(h),X()},J=()=>{let h=v.length>0?v.join(", "):C;return H?h:i};return(0,s.jsxs)("div",{className:a("flex flex-col gap-2",S),children:[H&&i&&(0,s.jsx)(M,{text:i,className:c?.label}),(0,s.jsxs)(Oe,{open:K,onOpenChange:W,children:[(0,s.jsx)(He,{asChild:!0,disabled:n.length===0,children:(0,s.jsxs)("div",{ref:t,className:a(pt({variant:I,size:V}),c?.trigger),"aria-expanded":K,children:[ee&&v.length>0&&(0,s.jsx)(j,{variant:"purple",children:v.length}),(0,s.jsx)("span",{className:a("truncate leading-normal",H&&v.length==0&&"text-grey-40"),children:J()}),(0,s.jsx)(Ge.ChevronDownIcon,{className:"transform group-data-[state=open]:rotate-180",size:"16"})]})}),(0,s.jsx)(ne,{children:(0,s.jsxs)(fe,{className:a("flex w-full max-w-xs flex-col overflow-hidden p-0","max-h-[--radix-popover-content-available-height]",c?.content),collisionPadding:8,sideOffset:4,align:"start",children:[!F&&(0,s.jsx)(le,{placeholder:"Search..."}),(0,s.jsxs)(se,{children:[(0,s.jsx)(me,{children:"No results"}),(0,s.jsx)(pe,{children:n.map(({id:h,...x})=>(0,s.jsx)(de,{value:x.value,onSelect:$,children:(0,s.jsx)(Z,{className:a(c?.items,"truncate py-1"),isSelected:v?.includes(x.value),hasCheckbox:b,...x})},h))})]}),!!O&&(0,s.jsx)(B,{}),O&&O({close:X})]})})]})]})});ue.displayName="Combobox";var pt=(0,Ke.cva)("group relative cursor-pointer flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",{variants:{variant:{default:["w-full","max-w-80","rounded-lg"],chip:["font-bold","rounded-3xl","data-[state=open]:bg-black","data-[state=open]:text-white"]},size:{small:["h-8","p-1","pl-2","text-xs"],normal:["h-9","p-2","pl-3","text-sm"],large:["h-10","p-3","pl-4","text-base"]}},defaultVariants:{variant:"default",size:"normal"}});0&&(module.exports={Badge,Button,Checkbox,Chip,Combobox,Label,ListItem,Select,cn});
|
|
1
|
+
"use strict";var Fe=Object.create;var Q=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var o in t)Q(e,o,{get:t[o],enumerable:!0})},he=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Je(t))!Qe.call(e,n)&&n!==o&&Q(e,n,{get:()=>t[n],enumerable:!(i=$e(t,n))||i.enumerable});return e};var k=(e,t,o)=>(o=e!=null?Fe(qe(e)):{},he(t||!e||!e.__esModule?Q(o,"default",{value:e,enumerable:!0}):o,e)),Ye=e=>he(Q({},"__esModule",{value:!0}),e);var ct={};Ue(ct,{Badge:()=>ee,Button:()=>ne,Checkbox:()=>Z,Chip:()=>U,Combobox:()=>ge,Label:()=>O,ListItem:()=>j,Select:()=>we,cn:()=>a});module.exports=Ye(ct);var p=k(require("@radix-ui/react-select"),1),H=require("lucide-react"),N=require("react");var ve=require("clsx"),xe=require("tailwind-merge");function a(...e){return(0,xe.twMerge)((0,ve.clsx)(e))}var ye=require("react/jsx-runtime");function Ze({text:e,className:t,...o}){return e?(0,ye.jsx)("label",{className:a("text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...o,children:e}):null}var O=Ze;var be=require("cva"),Pe=require("tailwind-merge"),Ce=require("react/jsx-runtime"),je=({className:e,variant:t,size:o,...i})=>(0,Ce.jsx)("div",{className:(0,Pe.twMerge)(et({variant:t,size:o,className:e})),...i}),et=(0,be.cva)(["flex","items-center","rounded-3xl","border","w-fit"],{variants:{variant:{neutral:["text-grey-80","border-grey-10"],primary:["text-purple-100","border-purple-20"],danger:["text-pumpkin-100","border-pumpkin-20"],onboarding:["text-green-100","bg-green-10","cursor-pointer"],onboardingSelected:["text-white","bg-green-90","cursor-pointer"]},size:{small:["text-sm","leading-5","px-2","py-1","gap-1.5"],medium:["text-base","leading-6","px-3","py-2","gap-2"]}},defaultVariants:{variant:"neutral",size:"medium"}}),U=je;var ae=k(require("@radix-ui/react-separator"),1),Re=k(require("react"),1);var ke=require("react/jsx-runtime"),X=Re.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...i},n)=>(0,ke.jsx)(ae.Root,{ref:n,decorative:o,orientation:t,className:a("shrink-0 bg-grey-10",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));X.displayName=ae.Root.displayName;var m=require("react/jsx-runtime"),Ne=(0,N.forwardRef)(({label:e,options:t,placeholder:o,multiselect:i,classNames:n,...u},y)=>{let{value:P,defaultValue:E,dir:T,className:C,onChange:A,...V}=u,[R,v]=(0,N.useState)([]),[z,W]=(0,N.useState)(!1),G=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!P)return v([]);v(Array.isArray(P)?P:[P])},[P]);let J=()=>W(r=>!r),te=r=>r.key==="Escape"&&W(!1),I=(r,l)=>r.key==="Enter"&&M(l),q=R?.map(r=>t?.find(({value:l})=>l===r)).filter(Boolean);function K(){return i?R.map(r=>t?.find(l=>l.value===r)?.title).join(", "):t?.find(r=>r.value===R.join())?.title}function oe(r){(!i||r)&&W(r)}function M(r){let l=[];v(c=>(l=c.includes(r)?c.filter(_=>_!==r):[...c,r],i?l:[r])),A?.(i?l:r)}return(0,m.jsxs)("div",{className:a("flex flex-col space-y-2",C),ref:G,children:[(0,m.jsx)(O,{text:e,className:n?.label}),(0,m.jsxs)(p.Root,{open:z,value:R.join(","),onOpenChange:oe,onValueChange:i?void 0:M,defaultValue:typeof E=="string"?E:void 0,dir:T==="rtl"?"rtl":"ltr",...V,children:[(0,m.jsxs)(p.Trigger,{ref:y,"data-testid":`${e.toLowerCase()}-select-element`,className:"group flex min-w-80 flex-row items-center justify-between gap-3 rounded-lg border border-grey-20 px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",children:[(0,m.jsx)("span",{className:"truncate",children:(0,m.jsx)(p.Value,{placeholder:o??"Select an option","aria-label":K(),children:K()})}),(0,m.jsx)(H.ChevronDownIcon,{className:"transform text-black group-data-[state=open]:rotate-180",size:"16"})]}),(0,m.jsx)(p.Portal,{container:G.current,children:(0,m.jsx)(p.Content,{hideWhenDetached:!0,className:"z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",position:"popper",sideOffset:4,onPointerDownOutside:J,onKeyDown:te,children:(0,m.jsxs)(p.Viewport,{children:[i&&!!q?.length&&(0,m.jsx)(p.Group,{className:"mb-2 flex flex-row flex-wrap gap-1 px-2","data-testid":"selected-labels",children:q?.map(r=>r&&(0,m.jsxs)(U,{size:"small",variant:"primary",children:[(0,m.jsx)("span",{children:r.title}),(0,m.jsx)(H.X,{size:18,"data-testid":`chip-remove-${r.value}`,className:"cursor-pointer",onClick:()=>M(r.value)})]},r.title))}),(0,m.jsx)(X,{}),t?.map(({id:r,title:l,value:c})=>(0,m.jsxs)(p.Item,{value:c,className:"group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100","data-state":R.includes(c)?"checked":"unchecked",onKeyDown:_=>I(_,c),onClick:()=>M(c),children:[(0,m.jsx)(p.ItemText,{children:l}),(0,m.jsx)(H.CheckIcon,{className:"absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",size:16})]},r))]})})})]})]})});Ne.displayName="Select";var we=Ne;var F=k(require("@radix-ui/react-checkbox"),1),Y=require("lucide-react"),re=require("react");var w=require("react/jsx-runtime"),Se=(0,re.forwardRef)(({className:e,...t},o)=>(0,w.jsx)(F.Root,{ref:o,className:a("group","peer","h-5","w-5","shrink-0","rounded-md","border","border-grey-10","outline","outline-1","outline-offset-2","outline-transparent","hover:border-grey-20","focus:outline-purple-100","active:border-green-80","disabled:cursor-not-allowed","disabled:opacity-50","data-[state=checked]:bg-green-80","data-[state=indeterminate]:bg-green-80","data-[state=checked]:text-white","data-[state=indeterminate]:text-primary-foreground",t.disabled&&"data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",e),...t,children:(0,w.jsxs)(F.Indicator,{className:"flex items-center justify-center text-current",children:[(0,w.jsx)(Y.Check,{className:"hidden h-4 w-4 group-data-[state=checked]:block"}),(0,w.jsx)(Y.Minus,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"})]})}));Se.displayName=F.Root.displayName;var De=(0,re.forwardRef)(({classNames:e,children:t,...o},i)=>{let{disabled:n}=o,u=o.id??`${o.name??o.value?.toString()}-checkbox`,y=n?"text-grey-40 pointer-events-none":"";return(0,w.jsxs)("div",{className:a("flex space-x-2",e?.wrapper),children:[(0,w.jsx)(Se,{id:u,disabled:n,ref:i,...o}),(0,w.jsx)("label",{htmlFor:u,className:a(y,e?.label),children:t})]})});De.displayName="Checkbox";var Z=De;var Ee=require("lucide-react");var ie=require("lucide-react"),b=require("react/jsx-runtime");function tt({icon:e,hasCheckbox:t,isSelected:o,className:i,title:n,value:u,description:y,...P}){let T=e?(C=>{if(C in ie.icons){let A=ie.icons[C];return(0,b.jsx)(A,{size:14})}return null})(e):void 0;return(0,b.jsxs)("li",{className:a("group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",i),...P,"data-state":o?"checked":"unchecked",children:[T&&(0,b.jsx)("span",{className:"mr-2",children:T}),t&&(0,b.jsx)(Z,{id:u,checked:o,onClick:C=>C.preventDefault()}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{children:n}),(0,b.jsx)("p",{className:"text-xs text-grey-80",children:y})]}),(0,b.jsx)(Ee.CheckIcon,{className:"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",size:16})]})}var j=tt;var Ie=require("@radix-ui/react-slot"),Le=require("cva"),Te=require("react"),Ve=require("react/jsx-runtime"),ne=(0,Te.forwardRef)(({className:e,variant:t,size:o,asChild:i=!1,...n},u)=>(0,Ve.jsx)(i?Ie.Slot:"button",{className:a(ot({variant:t,size:o,className:e})),ref:u,...n}));ne.displayName="Button";var ot=(0,Le.cva)(["flex","items-center","justify-center","gap-2","rounded-full","font-bold","outline-2","outline-offset-2","outline-dashed","outline-transparent"],{variants:{variant:{neutral:["bg-black","text-white","hover:bg-grey-90","active:bg-grey-80","focus:outline-purple-100","disabled:text-grey-40","disabled:bg-grey-10"],primary:["bg-pickle-100","text-black","hover:bg-pickle-80","active:bg-pickle-60","focus:outline-purple-100","disabled:text-grey-40","disabled:bg-grey-10"],secondary:["bg-green-80","text-white","hover:bg-green-90","active:bg-green-100","focus:outline-pickle-100","disabled:text-grey-40","disabled:bg-grey-10"],transparent:["text-white","hover:bg-green-80","active:bg-green-100","focus:outline-pickle-100","disabled:text-grey-40"],link:["leading-tight","text-black","underline","hover:text-purple-100","focus:text-black","focus:outline-purple-100","active:text-purple-80"]},size:{small:["h-10","text-sm","px-4","py-2"],medium:["h-12","text-base","px-6","py-3"],large:["h-14","text-lg","px-8","py-4"]}},defaultVariants:{variant:"neutral",size:"medium"},compoundVariants:[{variant:"link",size:"small",class:["h-3","text-xs","p-0"]},{variant:"link",size:"medium",class:["h-4","text-sm","p-0"]},{variant:"link",size:"large",class:["h-6","text-base","p-0"]}]});var L=require("react"),B=require("lucide-react"),Ke=require("cva");var f=require("cmdk"),_e=require("lucide-react"),D=k(require("react"),1);var d=k(require("@radix-ui/react-dialog"),1),ze=require("lucide-react"),$=k(require("react"),1),h=require("react/jsx-runtime");var at=d.Portal;var We=$.forwardRef(({className:e,...t},o)=>(0,h.jsx)(d.Overlay,{ref:o,className:a("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",e),...t}));We.displayName=d.Overlay.displayName;var Me=$.forwardRef(({className:e,children:t,...o},i)=>(0,h.jsxs)(at,{children:[(0,h.jsx)(We,{}),(0,h.jsxs)(d.Content,{ref:i,className:a("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",e),...o,children:[t,(0,h.jsxs)(d.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",children:[(0,h.jsx)(ze.X,{className:"h-4 w-4"}),(0,h.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Me.displayName=d.Content.displayName;var rt=({className:e,...t})=>(0,h.jsx)("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rt.displayName="DialogHeader";var it=({className:e,...t})=>(0,h.jsx)("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});it.displayName="DialogFooter";var nt=$.forwardRef(({className:e,...t},o)=>(0,h.jsx)(d.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));nt.displayName=d.Title.displayName;var lt=$.forwardRef(({className:e,...t},o)=>(0,h.jsx)(d.Description,{ref:o,className:a("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));lt.displayName=d.Description.displayName;var x=require("react/jsx-runtime"),le=D.forwardRef(({className:e,...t},o)=>(0,x.jsx)(f.Command,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",e),...t}));le.displayName=f.Command.displayName;var se=D.forwardRef(({className:e,...t},o)=>(0,x.jsxs)("div",{className:"m-1 flex items-center rounded-xl border px-3","cmdk-input-wrapper":"",children:[(0,x.jsx)(_e.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,x.jsx)(f.Command.Input,{ref:o,className:a("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",e),...t})]}));se.displayName=f.Command.Input.displayName;var me=D.forwardRef(({className:e,...t},o)=>(0,x.jsx)(f.Command.List,{ref:o,className:a("overflow-y-auto overflow-x-hidden",e),...t}));me.displayName=f.Command.List.displayName;var pe=D.forwardRef((e,t)=>(0,x.jsx)(f.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));pe.displayName=f.Command.Empty.displayName;var de=D.forwardRef(({className:e,...t},o)=>(0,x.jsx)(f.Command.Group,{ref:o,className:a("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",e),...t}));de.displayName=f.Command.Group.displayName;var st=D.forwardRef(({className:e,...t},o)=>(0,x.jsx)(f.Command.Separator,{ref:o,className:a("-mx-1 h-px bg-neutral-200",e),...t}));st.displayName=f.Command.Separator.displayName;var ce=D.forwardRef(({className:e,...t},o)=>(0,x.jsx)(f.Command.Item,{ref:o,className:a("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",e),...t}));ce.displayName=f.Command.Item.displayName;var mt=({className:e,...t})=>(0,x.jsx)("span",{className:a("ml-auto text-xs tracking-widest text-neutral-500",e),...t});mt.displayName="CommandShortcut";var Oe=k(require("react"),1),S=k(require("@radix-ui/react-popover"),1);var fe=require("react/jsx-runtime"),He=S.Root,Be=S.Trigger,ue=Oe.forwardRef(({className:e,align:t="center",sideOffset:o=4,...i},n)=>(0,fe.jsx)(S.Portal,{children:(0,fe.jsx)(S.Content,{ref:n,align:t,sideOffset:o,className:a("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",e),...i})}));ue.displayName=S.Content.displayName;var Ae=require("cva");var Ge=require("react/jsx-runtime"),pt=(0,Ae.cva)("rounded-full px-2 py-0.5 text-xs font-semibold",{variants:{variant:{green:"bg-green-90 text-white",pickle:"bg-pickle-100 text-black",purple:"bg-purple-100 text-white"}},defaultVariants:{variant:"green"}});function ee({className:e,variant:t,...o}){return(0,Ge.jsx)("div",{className:a(pt({variant:t}),e),...o})}var s=require("react/jsx-runtime"),ge=(0,L.forwardRef)((e,t)=>{let{value:o,label:i,options:n,classNames:u,multiselect:y,placeholder:P,variant:E="default",size:T,icon:C,className:A,onChange:V,children:R}=e,[v,z]=(0,L.useState)([]),[W,G]=(0,L.useState)(!1),J=C&&B.icons[C],te=n?.length<=5,I=E==="default",q=E==="chip",K=()=>G(!1);(0,L.useEffect)(()=>{z(y?o??[]:o?[o]:[])},[o]);let oe=l=>{if(y)return z(c=>{let _=c.includes(l)?c.filter(Xe=>Xe!==l):[...c,l];return V?.(_),_});z([l]),V?.(l),K()},M=()=>{z([]),V?.(y?[]:"")},r=()=>{let l=v.length>0?v.join(", "):P;return I?l:i};return(0,s.jsxs)("div",{className:a("flex flex-col gap-2",A),children:[I&&i&&(0,s.jsx)(O,{text:i,className:u?.label}),(0,s.jsxs)(He,{open:W,onOpenChange:G,children:[(0,s.jsx)(Be,{asChild:!0,disabled:n.length===0,children:(0,s.jsxs)("div",{ref:t,className:a(dt({variant:E,size:T}),u?.trigger),"aria-expanded":W,children:[I&&J&&(0,s.jsx)(J,{className:"h-4 w-4 shrink-0"}),q&&v.length>0&&(0,s.jsx)(ee,{variant:"purple",children:v.length}),(0,s.jsx)("span",{className:a("truncate leading-normal",I&&v.length==0&&"text-grey-40"),children:r()}),v.length==0&&(0,s.jsx)(B.ChevronDownIcon,{className:"transform group-data-[state=open]:rotate-180",size:"16"}),I&&v.length>0&&(0,s.jsx)("button",{type:"button",className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",onClick:M,children:(0,s.jsx)(B.CircleX,{className:"h-4 w-4 text-green-100"})})]})}),(0,s.jsx)(le,{children:(0,s.jsxs)(ue,{className:a("flex w-full max-w-xs flex-col overflow-hidden p-0","max-h-[--radix-popover-content-available-height]",u?.content),collisionPadding:8,sideOffset:4,align:"start",children:[!te&&(0,s.jsx)(se,{placeholder:"Search..."}),(0,s.jsxs)(me,{children:[(0,s.jsx)(pe,{children:"No results"}),(0,s.jsx)(de,{children:n.map(({id:l,...c})=>(0,s.jsx)(ce,{value:c.value,onSelect:oe,children:(0,s.jsx)(j,{className:a(u?.items,"truncate py-1"),isSelected:v?.includes(c.value),hasCheckbox:y,...c})},l))})]}),!!R&&(0,s.jsx)(X,{}),R&&R({close:K})]})})]})]})});ge.displayName="Combobox";var dt=(0,Ke.cva)("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",{variants:{variant:{default:["w-full","max-w-80","rounded-lg"],chip:["font-bold","rounded-3xl","data-[state=open]:bg-black","data-[state=open]:text-white"]},size:{small:["h-8","p-1","pl-2","text-xs"],normal:["h-9","p-2","pl-3","text-sm"],large:["h-10","p-3","pl-4","text-base"]}},defaultVariants:{variant:"default",size:"normal"}});0&&(module.exports={Badge,Button,Checkbox,Chip,Combobox,Label,ListItem,Select,cn});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|