@hivemindhq/core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +16 -16
  2. package/dist/{chunk-2RGM3KJL.js → chunk-K2544PJ5.js} +42 -20
  3. package/dist/chunk-K2544PJ5.js.map +1 -0
  4. package/dist/{chunk-P5E2XNDI.js → chunk-K4XDMY2V.js} +3 -3
  5. package/dist/{chunk-P5E2XNDI.js.map → chunk-K4XDMY2V.js.map} +1 -1
  6. package/dist/{chunk-ERZSVDIB.js → chunk-RW4JXOAM.js} +11 -3
  7. package/dist/chunk-RW4JXOAM.js.map +1 -0
  8. package/dist/chunk-VU3OPG32.js +907 -0
  9. package/dist/chunk-VU3OPG32.js.map +1 -0
  10. package/dist/components/index.d.ts +28 -3
  11. package/dist/components/index.js +2 -2
  12. package/dist/components/ui/index.js +2 -2
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +6 -6
  15. package/dist/utils/index.d.ts +312 -6
  16. package/dist/utils/index.js +2 -2
  17. package/package.json +15 -11
  18. package/src/components/AtomIcon.tsx +21 -0
  19. package/src/components/CryptoAmount.tsx +447 -0
  20. package/src/components/ErrorBanner.tsx +35 -0
  21. package/src/components/IpfsImage.tsx +21 -0
  22. package/src/components/LoadingDots.tsx +55 -0
  23. package/src/components/TripleAreaChart.tsx +108 -0
  24. package/src/components/TriplePositionsTornadoMinGraph.tsx +71 -0
  25. package/src/components/UnknownImage.tsx +55 -0
  26. package/src/components/index.ts +24 -0
  27. package/src/components/ui/alert.tsx +59 -0
  28. package/src/components/ui/avatar.tsx +47 -0
  29. package/src/components/ui/badge.tsx +35 -0
  30. package/src/components/ui/breadcrumb.tsx +108 -0
  31. package/src/components/ui/button.tsx +56 -0
  32. package/src/components/ui/card.tsx +75 -0
  33. package/src/components/ui/carousel.tsx +239 -0
  34. package/src/components/ui/chart.tsx +350 -0
  35. package/src/components/ui/checkbox.tsx +28 -0
  36. package/src/components/ui/collapsible.tsx +10 -0
  37. package/src/components/ui/command.tsx +177 -0
  38. package/src/components/ui/dialog.tsx +119 -0
  39. package/src/components/ui/dropdown-menu.tsx +202 -0
  40. package/src/components/ui/form.tsx +175 -0
  41. package/src/components/ui/index.ts +183 -0
  42. package/src/components/ui/input.tsx +21 -0
  43. package/src/components/ui/label.tsx +25 -0
  44. package/src/components/ui/loader.tsx +20 -0
  45. package/src/components/ui/pagination.tsx +104 -0
  46. package/src/components/ui/popover.tsx +45 -0
  47. package/src/components/ui/progress.tsx +25 -0
  48. package/src/components/ui/radio-group.tsx +42 -0
  49. package/src/components/ui/scroll-area.tsx +45 -0
  50. package/src/components/ui/select.tsx +178 -0
  51. package/src/components/ui/separator.tsx +28 -0
  52. package/src/components/ui/sheet.tsx +139 -0
  53. package/src/components/ui/sidebar.tsx +723 -0
  54. package/src/components/ui/skeleton.tsx +15 -0
  55. package/src/components/ui/sonner.tsx +27 -0
  56. package/src/components/ui/spinner.tsx +67 -0
  57. package/src/components/ui/switch.tsx +26 -0
  58. package/src/components/ui/table.tsx +113 -0
  59. package/src/components/ui/tabs.tsx +63 -0
  60. package/src/components/ui/textarea.tsx +21 -0
  61. package/src/components/ui/toast.tsx +146 -0
  62. package/src/components/ui/toaster.tsx +33 -0
  63. package/src/components/ui/toggle-group.tsx +58 -0
  64. package/src/components/ui/toggle.tsx +44 -0
  65. package/src/components/ui/tooltip.tsx +61 -0
  66. package/src/hooks/index.ts +7 -0
  67. package/src/hooks/use-mobile.ts +20 -0
  68. package/src/hooks/use-toast.ts +190 -0
  69. package/src/index.ts +25 -0
  70. package/src/types/index.ts +17 -0
  71. package/src/utils/atom-label-detection.ts +689 -0
  72. package/src/utils/atom.ts +279 -0
  73. package/src/utils/cn.ts +18 -0
  74. package/src/utils/formatting.ts +624 -0
  75. package/src/utils/index.ts +11 -0
  76. package/src/utils/multivault-errors.ts +581 -0
  77. package/src/utils/search/formatting.tsx +95 -0
  78. package/src/utils/search/index.ts +28 -0
  79. package/src/utils/search/ranking.ts +203 -0
  80. package/src/utils/search/types.ts +114 -0
  81. package/tailwind.config.js +3 -3
  82. package/dist/chunk-2RGM3KJL.js.map +0 -1
  83. package/dist/chunk-ERZSVDIB.js.map +0 -1
  84. package/dist/chunk-H4RMZQ2Z.js +0 -213
  85. package/dist/chunk-H4RMZQ2Z.js.map +0 -1
@@ -0,0 +1,183 @@
1
+ /**
2
+ * UI Primitives - shadcn/ui components
3
+ *
4
+ * These are the base UI components built on Radix UI primitives.
5
+ * Re-exported from shadcn/ui with minor customizations.
6
+ */
7
+
8
+ export { Alert, AlertTitle, AlertDescription } from './alert'
9
+ export { Avatar, AvatarImage, AvatarFallback } from './avatar'
10
+ export { Badge, badgeVariants } from './badge'
11
+ export {
12
+ Breadcrumb,
13
+ BreadcrumbList,
14
+ BreadcrumbItem,
15
+ BreadcrumbLink,
16
+ BreadcrumbPage,
17
+ BreadcrumbSeparator,
18
+ BreadcrumbEllipsis,
19
+ } from './breadcrumb'
20
+ export { Button, buttonVariants } from './button'
21
+ export {
22
+ Card,
23
+ CardHeader,
24
+ CardFooter,
25
+ CardTitle,
26
+ CardDescription,
27
+ CardContent,
28
+ } from './card'
29
+ export {
30
+ Carousel,
31
+ CarouselContent,
32
+ CarouselItem,
33
+ CarouselPrevious,
34
+ CarouselNext,
35
+ } from './carousel'
36
+ export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle } from './chart'
37
+ export { Checkbox } from './checkbox'
38
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './collapsible'
39
+ export {
40
+ Command,
41
+ CommandDialog,
42
+ CommandInput,
43
+ CommandList,
44
+ CommandEmpty,
45
+ CommandGroup,
46
+ CommandItem,
47
+ CommandShortcut,
48
+ CommandSeparator,
49
+ } from './command'
50
+ export {
51
+ Dialog,
52
+ DialogPortal,
53
+ DialogOverlay,
54
+ DialogClose,
55
+ DialogTrigger,
56
+ DialogContent,
57
+ DialogHeader,
58
+ DialogFooter,
59
+ DialogTitle,
60
+ DialogDescription,
61
+ } from './dialog'
62
+ export {
63
+ DropdownMenu,
64
+ DropdownMenuTrigger,
65
+ DropdownMenuContent,
66
+ DropdownMenuItem,
67
+ DropdownMenuCheckboxItem,
68
+ DropdownMenuRadioItem,
69
+ DropdownMenuLabel,
70
+ DropdownMenuSeparator,
71
+ DropdownMenuShortcut,
72
+ DropdownMenuGroup,
73
+ DropdownMenuPortal,
74
+ DropdownMenuSub,
75
+ DropdownMenuSubContent,
76
+ DropdownMenuSubTrigger,
77
+ DropdownMenuRadioGroup,
78
+ } from './dropdown-menu'
79
+ export {
80
+ useFormField,
81
+ Form,
82
+ FormItem,
83
+ FormLabel,
84
+ FormControl,
85
+ FormDescription,
86
+ FormMessage,
87
+ FormField,
88
+ } from './form'
89
+ export { Input } from './input'
90
+ export { Label } from './label'
91
+ export { Loader } from './loader'
92
+ export { Pagination, type PaginationProps } from './pagination'
93
+ export { Popover, PopoverTrigger, PopoverContent } from './popover'
94
+ export { Progress } from './progress'
95
+ export { RadioGroup, RadioGroupItem } from './radio-group'
96
+ export { ScrollArea, ScrollBar } from './scroll-area'
97
+ export {
98
+ Select,
99
+ SelectGroup,
100
+ SelectValue,
101
+ SelectTrigger,
102
+ SelectContent,
103
+ SelectLabel,
104
+ SelectItem,
105
+ SelectSeparator,
106
+ SelectScrollUpButton,
107
+ SelectScrollDownButton,
108
+ } from './select'
109
+ export { Separator } from './separator'
110
+ export {
111
+ Sheet,
112
+ SheetPortal,
113
+ SheetOverlay,
114
+ SheetTrigger,
115
+ SheetClose,
116
+ SheetContent,
117
+ SheetHeader,
118
+ SheetFooter,
119
+ SheetTitle,
120
+ SheetDescription,
121
+ } from './sheet'
122
+ export {
123
+ Sidebar,
124
+ SidebarContent,
125
+ SidebarFooter,
126
+ SidebarGroup,
127
+ SidebarGroupAction,
128
+ SidebarGroupContent,
129
+ SidebarGroupLabel,
130
+ SidebarHeader,
131
+ SidebarInput,
132
+ SidebarInset,
133
+ SidebarMenu,
134
+ SidebarMenuAction,
135
+ SidebarMenuBadge,
136
+ SidebarMenuButton,
137
+ SidebarMenuItem,
138
+ SidebarMenuSkeleton,
139
+ SidebarMenuSub,
140
+ SidebarMenuSubButton,
141
+ SidebarMenuSubItem,
142
+ SidebarProvider,
143
+ SidebarRail,
144
+ SidebarSeparator,
145
+ SidebarTrigger,
146
+ useSidebar,
147
+ } from './sidebar'
148
+ export { Skeleton } from './skeleton'
149
+ export { Toaster as SonnerToaster } from './sonner'
150
+ export { Spinner } from './spinner'
151
+ export { Switch } from './switch'
152
+ export {
153
+ Table,
154
+ TableHeader,
155
+ TableBody,
156
+ TableFooter,
157
+ TableHead,
158
+ TableRow,
159
+ TableCell,
160
+ TableCaption,
161
+ } from './table'
162
+ export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs'
163
+ export { Textarea } from './textarea'
164
+ export {
165
+ type ToastProps,
166
+ type ToastActionElement,
167
+ ToastProvider,
168
+ ToastViewport,
169
+ Toast,
170
+ ToastTitle,
171
+ ToastDescription,
172
+ ToastClose,
173
+ ToastAction,
174
+ } from './toast'
175
+ export { Toaster } from './toaster'
176
+ export { Toggle, toggleVariants } from './toggle'
177
+ export { ToggleGroup, ToggleGroupItem } from './toggle-group'
178
+ export {
179
+ Tooltip,
180
+ TooltipTrigger,
181
+ TooltipContent,
182
+ TooltipProvider,
183
+ } from './tooltip'
@@ -0,0 +1,21 @@
1
+ import * as React from 'react'
2
+ import { cn } from '../../utils/cn'
3
+
4
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
5
+ ({ className, type, ...props }, ref) => {
6
+ return (
7
+ <input
8
+ type={type}
9
+ className={cn(
10
+ 'flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
11
+ className
12
+ )}
13
+ ref={ref}
14
+ {...props}
15
+ />
16
+ )
17
+ }
18
+ )
19
+ Input.displayName = 'Input'
20
+
21
+ export { Input }
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+
3
+ import * as LabelPrimitive from '@radix-ui/react-label'
4
+ import { cva, type VariantProps } from 'class-variance-authority'
5
+ import * as React from 'react'
6
+ import { cn } from '../../utils/cn'
7
+
8
+ const labelVariants = cva(
9
+ 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
10
+ )
11
+
12
+ const Label = React.forwardRef<
13
+ React.ElementRef<typeof LabelPrimitive.Root>,
14
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
15
+ VariantProps<typeof labelVariants>
16
+ >(({ className, ...props }, ref) => (
17
+ <LabelPrimitive.Root
18
+ ref={ref}
19
+ className={cn(labelVariants(), className)}
20
+ {...props}
21
+ />
22
+ ))
23
+ Label.displayName = LabelPrimitive.Root.displayName
24
+
25
+ export { Label }
@@ -0,0 +1,20 @@
1
+ import { cn } from '../../utils/cn'
2
+
3
+ export const Loader = ({ className }: { className?: string }) => {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ strokeWidth="2"
13
+ strokeLinecap="round"
14
+ strokeLinejoin="round"
15
+ className={cn('animate-spin', className)}
16
+ >
17
+ <path d="M21 12a9 9 0 1 1-6.219-8.56" />
18
+ </svg>
19
+ )
20
+ }
@@ -0,0 +1,104 @@
1
+ import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react'
2
+ import { cn } from '../../utils/cn'
3
+ import { Button } from './button'
4
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select'
5
+
6
+ export interface PaginationProps {
7
+ currentPage: number
8
+ totalPages: number
9
+ pageSize: number
10
+ totalItems: number
11
+ onPageChange: (page: number) => void
12
+ onPageSizeChange: (pageSize: number) => void
13
+ pageSizeOptions?: number[]
14
+ className?: string
15
+ }
16
+
17
+ export function Pagination({
18
+ currentPage,
19
+ totalPages,
20
+ pageSize,
21
+ totalItems,
22
+ onPageChange,
23
+ onPageSizeChange,
24
+ pageSizeOptions = [10, 25, 50, 100],
25
+ className,
26
+ }: PaginationProps) {
27
+ const startItem = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1
28
+ const endItem = Math.min(currentPage * pageSize, totalItems)
29
+
30
+ return (
31
+ <div className={cn("flex items-center justify-between py-4", className)}>
32
+ <div className="text-sm text-muted-foreground">
33
+ Showing {startItem} to {endItem} of {totalItems} results
34
+ </div>
35
+
36
+ <div className="flex items-center gap-4">
37
+ <div className="flex items-center gap-2">
38
+ <span className="text-sm">Rows per page:</span>
39
+ <Select value={pageSize.toString()} onValueChange={(v) => onPageSizeChange(Number(v))}>
40
+ <SelectTrigger className="w-[100px]">
41
+ <SelectValue />
42
+ </SelectTrigger>
43
+ <SelectContent>
44
+ {pageSizeOptions.map((option) => (
45
+ <SelectItem key={option} value={option.toString()}>
46
+ {option}
47
+ </SelectItem>
48
+ ))}
49
+ </SelectContent>
50
+ </Select>
51
+ </div>
52
+
53
+ <div className="flex items-center gap-1">
54
+ <Button
55
+ variant="outline"
56
+ size="sm"
57
+ onClick={() => onPageChange(1)}
58
+ disabled={currentPage === 1}
59
+ className="h-8 w-8 p-0"
60
+ >
61
+ <span className="sr-only">Go to first page</span>
62
+ <ChevronsLeft className="h-4 w-4" />
63
+ </Button>
64
+ <Button
65
+ variant="outline"
66
+ size="sm"
67
+ onClick={() => onPageChange(currentPage - 1)}
68
+ disabled={currentPage === 1}
69
+ className="h-8 w-8 p-0"
70
+ >
71
+ <span className="sr-only">Go to previous page</span>
72
+ <ChevronLeft className="h-4 w-4" />
73
+ </Button>
74
+
75
+ <span className="px-2 text-sm">
76
+ Page {currentPage} of {totalPages}
77
+ </span>
78
+
79
+ <Button
80
+ variant="outline"
81
+ size="sm"
82
+ onClick={() => onPageChange(currentPage + 1)}
83
+ disabled={currentPage === totalPages}
84
+ className="h-8 w-8 p-0"
85
+ >
86
+ <span className="sr-only">Go to next page</span>
87
+ <ChevronRight className="h-4 w-4" />
88
+ </Button>
89
+ <Button
90
+ variant="outline"
91
+ size="sm"
92
+ onClick={() => onPageChange(totalPages)}
93
+ disabled={currentPage === totalPages}
94
+ className="h-8 w-8 p-0"
95
+ >
96
+ <span className="sr-only">Go to last page</span>
97
+ <ChevronsRight className="h-4 w-4" />
98
+ </Button>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ )
103
+ }
104
+
@@ -0,0 +1,45 @@
1
+ import * as PopoverPrimitive from '@radix-ui/react-popover'
2
+ import * as React from 'react'
3
+ import { cn } from '../../utils/cn'
4
+
5
+ function Popover({
6
+ ...props
7
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
8
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
9
+ }
10
+
11
+ function PopoverTrigger({
12
+ ...props
13
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
14
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
15
+ }
16
+
17
+ function PopoverContent({
18
+ className,
19
+ align = 'center',
20
+ sideOffset = 4,
21
+ ...props
22
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
23
+ return (
24
+ <PopoverPrimitive.Portal>
25
+ <PopoverPrimitive.Content
26
+ data-slot="popover-content"
27
+ align={align}
28
+ sideOffset={sideOffset}
29
+ className={cn(
30
+ 'bg-popover text-popover-foreground 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 z-50 w-72 rounded-md border p-4 shadow-md outline-hidden',
31
+ className
32
+ )}
33
+ {...props}
34
+ />
35
+ </PopoverPrimitive.Portal>
36
+ )
37
+ }
38
+
39
+ function PopoverAnchor({
40
+ ...props
41
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
42
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
43
+ }
44
+
45
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -0,0 +1,25 @@
1
+ import * as ProgressPrimitive from '@radix-ui/react-progress'
2
+ import * as React from 'react'
3
+ import { cn } from '../../utils/cn'
4
+
5
+ const Progress = React.forwardRef<
6
+ React.ElementRef<typeof ProgressPrimitive.Root>,
7
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
8
+ >(({ className, value, ...props }, ref) => (
9
+ <ProgressPrimitive.Root
10
+ ref={ref}
11
+ className={cn(
12
+ 'relative h-2 w-full overflow-hidden rounded-full bg-primary/20',
13
+ className
14
+ )}
15
+ {...props}
16
+ >
17
+ <ProgressPrimitive.Indicator
18
+ className="h-full w-full flex-1 bg-primary transition-all"
19
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
20
+ />
21
+ </ProgressPrimitive.Root>
22
+ ))
23
+ Progress.displayName = ProgressPrimitive.Root.displayName
24
+
25
+ export { Progress }
@@ -0,0 +1,42 @@
1
+ import * as React from "react"
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
3
+ import { Circle } from "lucide-react"
4
+
5
+ import { cn } from '../../utils/cn'
6
+
7
+ const RadioGroup = React.forwardRef<
8
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
+ >(({ className, ...props }, ref) => {
11
+ return (
12
+ <RadioGroupPrimitive.Root
13
+ className={cn("grid gap-2", className)}
14
+ {...props}
15
+ ref={ref}
16
+ />
17
+ )
18
+ })
19
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
20
+
21
+ const RadioGroupItem = React.forwardRef<
22
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
23
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
24
+ >(({ className, ...props }, ref) => {
25
+ return (
26
+ <RadioGroupPrimitive.Item
27
+ ref={ref}
28
+ className={cn(
29
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
30
+ className
31
+ )}
32
+ {...props}
33
+ >
34
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
35
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
36
+ </RadioGroupPrimitive.Indicator>
37
+ </RadioGroupPrimitive.Item>
38
+ )
39
+ })
40
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
41
+
42
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,45 @@
1
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'
2
+ import * as React from 'react'
3
+ import { cn } from '../../utils/cn'
4
+
5
+ const ScrollArea = React.forwardRef<
6
+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,
7
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
8
+ >(({ className, children, ...props }, ref) => (
9
+ <ScrollAreaPrimitive.Root
10
+ ref={ref}
11
+ className={cn('relative overflow-hidden', className)}
12
+ {...props}
13
+ >
14
+ <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
15
+ {children}
16
+ </ScrollAreaPrimitive.Viewport>
17
+ <ScrollBar />
18
+ <ScrollAreaPrimitive.Corner />
19
+ </ScrollAreaPrimitive.Root>
20
+ ))
21
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
22
+
23
+ const ScrollBar = React.forwardRef<
24
+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
25
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
26
+ >(({ className, orientation = 'vertical', ...props }, ref) => (
27
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
28
+ ref={ref}
29
+ orientation={orientation}
30
+ className={cn(
31
+ 'flex touch-none select-none transition-colors',
32
+ orientation === 'vertical' &&
33
+ 'h-full w-2.5 border-l border-l-transparent p-[1px]',
34
+ orientation === 'horizontal' &&
35
+ 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
36
+ className
37
+ )}
38
+ {...props}
39
+ >
40
+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
41
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
42
+ ))
43
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
44
+
45
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,178 @@
1
+ import * as SelectPrimitive from '@radix-ui/react-select'
2
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
3
+ import * as React from 'react'
4
+ import { cn } from '../../utils/cn'
5
+
6
+ function Select({
7
+ ...props
8
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
9
+ return <SelectPrimitive.Root data-slot="select" {...props} />
10
+ }
11
+
12
+ function SelectGroup({
13
+ ...props
14
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
15
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />
16
+ }
17
+
18
+ function SelectValue({
19
+ ...props
20
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
21
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
22
+ }
23
+
24
+ function SelectTrigger({
25
+ className,
26
+ children,
27
+ ...props
28
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger>) {
29
+ return (
30
+ <SelectPrimitive.Trigger
31
+ data-slot="select-trigger"
32
+ className={cn(
33
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
34
+ className
35
+ )}
36
+ {...props}
37
+ >
38
+ {children}
39
+ <SelectPrimitive.Icon asChild>
40
+ <ChevronDownIcon className="size-4 opacity-50" />
41
+ </SelectPrimitive.Icon>
42
+ </SelectPrimitive.Trigger>
43
+ )
44
+ }
45
+
46
+ function SelectContent({
47
+ className,
48
+ children,
49
+ position = 'popper',
50
+ ...props
51
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
52
+ return (
53
+ <SelectPrimitive.Portal>
54
+ <SelectPrimitive.Content
55
+ data-slot="select-content"
56
+ className={cn(
57
+ 'bg-popover text-popover-foreground 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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md',
58
+ position === 'popper' &&
59
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
60
+ className
61
+ )}
62
+ position={position}
63
+ {...props}
64
+ >
65
+ <SelectScrollUpButton />
66
+ <SelectPrimitive.Viewport
67
+ className={cn(
68
+ 'p-1',
69
+ position === 'popper' &&
70
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1'
71
+ )}
72
+ >
73
+ {children}
74
+ </SelectPrimitive.Viewport>
75
+ <SelectScrollDownButton />
76
+ </SelectPrimitive.Content>
77
+ </SelectPrimitive.Portal>
78
+ )
79
+ }
80
+
81
+ function SelectLabel({
82
+ className,
83
+ ...props
84
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
85
+ return (
86
+ <SelectPrimitive.Label
87
+ data-slot="select-label"
88
+ className={cn('px-2 py-1.5 text-sm font-medium', className)}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function SelectItem({
95
+ className,
96
+ children,
97
+ ...props
98
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
99
+ return (
100
+ <SelectPrimitive.Item
101
+ data-slot="select-item"
102
+ className={cn(
103
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
104
+ className
105
+ )}
106
+ {...props}
107
+ >
108
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
109
+ <SelectPrimitive.ItemIndicator>
110
+ <CheckIcon className="size-4" />
111
+ </SelectPrimitive.ItemIndicator>
112
+ </span>
113
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
114
+ </SelectPrimitive.Item>
115
+ )
116
+ }
117
+
118
+ function SelectSeparator({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
122
+ return (
123
+ <SelectPrimitive.Separator
124
+ data-slot="select-separator"
125
+ className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
126
+ {...props}
127
+ />
128
+ )
129
+ }
130
+
131
+ function SelectScrollUpButton({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
135
+ return (
136
+ <SelectPrimitive.ScrollUpButton
137
+ data-slot="select-scroll-up-button"
138
+ className={cn(
139
+ 'flex cursor-default items-center justify-center py-1',
140
+ className
141
+ )}
142
+ {...props}
143
+ >
144
+ <ChevronUpIcon className="size-4" />
145
+ </SelectPrimitive.ScrollUpButton>
146
+ )
147
+ }
148
+
149
+ function SelectScrollDownButton({
150
+ className,
151
+ ...props
152
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
153
+ return (
154
+ <SelectPrimitive.ScrollDownButton
155
+ data-slot="select-scroll-down-button"
156
+ className={cn(
157
+ 'flex cursor-default items-center justify-center py-1',
158
+ className
159
+ )}
160
+ {...props}
161
+ >
162
+ <ChevronDownIcon className="size-4" />
163
+ </SelectPrimitive.ScrollDownButton>
164
+ )
165
+ }
166
+
167
+ export {
168
+ Select,
169
+ SelectContent,
170
+ SelectGroup,
171
+ SelectItem,
172
+ SelectLabel,
173
+ SelectScrollDownButton,
174
+ SelectScrollUpButton,
175
+ SelectSeparator,
176
+ SelectTrigger,
177
+ SelectValue,
178
+ }