@dinachi/cli 0.3.2 → 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 (52) hide show
  1. package/README.md +14 -0
  2. package/dist/index.js +392 -344
  3. package/package.json +5 -5
  4. package/templates/accordion/accordion.tsx +1 -1
  5. package/templates/alert-dialog/alert-dialog.tsx +1 -1
  6. package/templates/autocomplete/autocomplete.tsx +197 -0
  7. package/templates/autocomplete/index.ts +17 -0
  8. package/templates/avatar/avatar.tsx +4 -4
  9. package/templates/checkbox/checkbox.tsx +2 -2
  10. package/templates/checkbox-group/checkbox-group.tsx +2 -2
  11. package/templates/collapsible/collapsible.tsx +4 -4
  12. package/templates/combobox/combobox.tsx +202 -0
  13. package/templates/combobox/index.ts +17 -0
  14. package/templates/context-menu/context-menu.tsx +119 -54
  15. package/templates/dialog/dialog.tsx +1 -1
  16. package/templates/drawer/drawer.tsx +109 -0
  17. package/templates/drawer/index.ts +12 -0
  18. package/templates/field/field.tsx +1 -1
  19. package/templates/fieldset/fieldset.tsx +32 -0
  20. package/templates/fieldset/index.ts +1 -0
  21. package/templates/form/form.tsx +3 -3
  22. package/templates/input/input.tsx +23 -15
  23. package/templates/menu/index.ts +17 -0
  24. package/templates/menu/menu.tsx +282 -0
  25. package/templates/menubar/menubar.tsx +22 -22
  26. package/templates/meter/index.ts +1 -0
  27. package/templates/meter/meter.tsx +64 -0
  28. package/templates/navigation-menu/navigation-menu.tsx +13 -13
  29. package/templates/number-field/index.ts +9 -0
  30. package/templates/number-field/number-field.tsx +114 -0
  31. package/templates/popover/index.ts +12 -0
  32. package/templates/popover/popover.tsx +137 -0
  33. package/templates/preview-card/preview-card.tsx +10 -11
  34. package/templates/progress/index.ts +7 -0
  35. package/templates/progress/progress.tsx +64 -0
  36. package/templates/radio/index.ts +1 -0
  37. package/templates/radio/radio.tsx +39 -0
  38. package/templates/scroll-area/index.ts +8 -0
  39. package/templates/scroll-area/scroll-area.tsx +94 -0
  40. package/templates/select/select.tsx +8 -8
  41. package/templates/separator/index.ts +1 -0
  42. package/templates/separator/separator.tsx +25 -0
  43. package/templates/slider/slider.tsx +10 -10
  44. package/templates/switch/index.ts +1 -0
  45. package/templates/switch/switch.tsx +42 -0
  46. package/templates/tabs/tabs.tsx +6 -6
  47. package/templates/toast/toast.tsx +1 -1
  48. package/templates/toggle/toggle.tsx +2 -2
  49. package/templates/toggle-group/index.ts +1 -0
  50. package/templates/toggle-group/toggle-group.tsx +67 -0
  51. package/templates/toolbar/toolbar.tsx +7 -7
  52. package/templates/tooltip/tooltip.tsx +38 -23
@@ -0,0 +1,114 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { NumberField as NumberFieldPrimitive } from "@base-ui/react/number-field"
6
+ import { Minus, Plus } from "lucide-react"
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const NumberField = NumberFieldPrimitive.Root
10
+
11
+ const NumberFieldGroup = React.forwardRef<
12
+ React.ComponentRef<typeof NumberFieldPrimitive.Group>,
13
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Group>
14
+ >(({ className, ...props }, ref) => (
15
+ <NumberFieldPrimitive.Group
16
+ ref={ref}
17
+ className={cn(
18
+ "inline-flex h-10 w-full items-stretch overflow-hidden rounded-md border border-input bg-background",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ ))
24
+ NumberFieldGroup.displayName = "NumberFieldGroup"
25
+
26
+ const NumberFieldInput = React.forwardRef<
27
+ React.ComponentRef<typeof NumberFieldPrimitive.Input>,
28
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Input>
29
+ >(({ className, ...props }, ref) => (
30
+ <NumberFieldPrimitive.Input
31
+ ref={ref}
32
+ className={cn(
33
+ "w-full bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground",
34
+ "disabled:cursor-not-allowed disabled:opacity-50",
35
+ className
36
+ )}
37
+ {...props}
38
+ />
39
+ ))
40
+ NumberFieldInput.displayName = "NumberFieldInput"
41
+
42
+ const NumberFieldIncrement = React.forwardRef<
43
+ React.ComponentRef<typeof NumberFieldPrimitive.Increment>,
44
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Increment>
45
+ >(({ className, children, ...props }, ref) => (
46
+ <NumberFieldPrimitive.Increment
47
+ ref={ref}
48
+ className={cn(
49
+ "inline-flex h-full items-center justify-center border-l border-input px-3 text-muted-foreground transition-colors",
50
+ "hover:bg-accent hover:text-accent-foreground",
51
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
52
+ "disabled:pointer-events-none disabled:opacity-50",
53
+ className
54
+ )}
55
+ {...props}
56
+ >
57
+ {children ?? <Plus className="h-4 w-4" />}
58
+ </NumberFieldPrimitive.Increment>
59
+ ))
60
+ NumberFieldIncrement.displayName = "NumberFieldIncrement"
61
+
62
+ const NumberFieldDecrement = React.forwardRef<
63
+ React.ComponentRef<typeof NumberFieldPrimitive.Decrement>,
64
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Decrement>
65
+ >(({ className, children, ...props }, ref) => (
66
+ <NumberFieldPrimitive.Decrement
67
+ ref={ref}
68
+ className={cn(
69
+ "inline-flex h-full items-center justify-center border-r border-input px-3 text-muted-foreground transition-colors",
70
+ "hover:bg-accent hover:text-accent-foreground",
71
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
72
+ "disabled:pointer-events-none disabled:opacity-50",
73
+ className
74
+ )}
75
+ {...props}
76
+ >
77
+ {children ?? <Minus className="h-4 w-4" />}
78
+ </NumberFieldPrimitive.Decrement>
79
+ ))
80
+ NumberFieldDecrement.displayName = "NumberFieldDecrement"
81
+
82
+ const NumberFieldScrubArea = React.forwardRef<
83
+ React.ComponentRef<typeof NumberFieldPrimitive.ScrubArea>,
84
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.ScrubArea>
85
+ >(({ className, ...props }, ref) => (
86
+ <NumberFieldPrimitive.ScrubArea
87
+ ref={ref}
88
+ className={cn("cursor-ew-resize", className)}
89
+ {...props}
90
+ />
91
+ ))
92
+ NumberFieldScrubArea.displayName = "NumberFieldScrubArea"
93
+
94
+ const NumberFieldScrubAreaCursor = React.forwardRef<
95
+ React.ComponentRef<typeof NumberFieldPrimitive.ScrubAreaCursor>,
96
+ React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.ScrubAreaCursor>
97
+ >(({ className, ...props }, ref) => (
98
+ <NumberFieldPrimitive.ScrubAreaCursor
99
+ ref={ref}
100
+ className={cn("text-muted-foreground", className)}
101
+ {...props}
102
+ />
103
+ ))
104
+ NumberFieldScrubAreaCursor.displayName = "NumberFieldScrubAreaCursor"
105
+
106
+ export {
107
+ NumberField,
108
+ NumberFieldGroup,
109
+ NumberFieldInput,
110
+ NumberFieldIncrement,
111
+ NumberFieldDecrement,
112
+ NumberFieldScrubArea,
113
+ NumberFieldScrubAreaCursor,
114
+ }
@@ -0,0 +1,12 @@
1
+ export {
2
+ Popover,
3
+ PopoverTrigger,
4
+ PopoverContent,
5
+ PopoverArrow,
6
+ PopoverTitle,
7
+ PopoverDescription,
8
+ PopoverClose,
9
+ PopoverPortal,
10
+ PopoverBackdrop,
11
+ } from "./popover"
12
+
@@ -0,0 +1,137 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
6
+ import { cn } from "@/lib/utils"
7
+
8
+ // Re-export root components for better tree-shaking
9
+ const Popover = PopoverPrimitive.Root
10
+ const PopoverTrigger = PopoverPrimitive.Trigger
11
+ const PopoverPortal = PopoverPrimitive.Portal
12
+ const PopoverClose = PopoverPrimitive.Close
13
+
14
+ // Optimized PopoverContent with better positioning and animations
15
+ const PopoverContent = React.forwardRef<
16
+ React.ComponentRef<typeof PopoverPrimitive.Popup>,
17
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Popup> & {
18
+ readonly sideOffset?: number
19
+ readonly align?: "start" | "center" | "end"
20
+ readonly side?: "top" | "bottom" | "left" | "right"
21
+ }
22
+ >(({ className, align = "center", side = "bottom", sideOffset = 8, ...props }, ref) => (
23
+ <PopoverPrimitive.Portal>
24
+ <PopoverPrimitive.Positioner
25
+ align={align}
26
+ side={side}
27
+ sideOffset={sideOffset}
28
+ >
29
+ <PopoverPrimitive.Popup
30
+ ref={ref}
31
+ className={cn(
32
+ "z-50 rounded-lg border bg-popover px-6 py-4 text-popover-foreground shadow-lg outline-none",
33
+ "origin-[var(--transform-origin)]",
34
+ "data-[starting-style]:scale-90 data-[starting-style]:opacity-0",
35
+ "data-[ending-style]:scale-90 data-[ending-style]:opacity-0",
36
+ "transition-[transform,opacity] duration-150",
37
+ className
38
+ )}
39
+ {...props}
40
+ />
41
+ </PopoverPrimitive.Positioner>
42
+ </PopoverPrimitive.Portal>
43
+ ))
44
+ PopoverContent.displayName = "PopoverContent"
45
+
46
+ // Optimized PopoverArrow
47
+ const PopoverArrow = React.forwardRef<
48
+ React.ComponentRef<typeof PopoverPrimitive.Arrow>,
49
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Arrow>
50
+ >(({ className, children, ...props }, ref) => (
51
+ <PopoverPrimitive.Arrow
52
+ ref={ref}
53
+ className={cn(
54
+ "data-[side=bottom]:top-[-8px]",
55
+ "data-[side=left]:right-[-13px] data-[side=left]:rotate-90",
56
+ "data-[side=right]:left-[-13px] data-[side=right]:-rotate-90",
57
+ "data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",
58
+ className
59
+ )}
60
+ {...props}
61
+ >
62
+ {children || (
63
+ <svg width="20" height="10" viewBox="0 0 20 10" fill="none">
64
+ <path
65
+ d="M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z"
66
+ className="fill-popover"
67
+ />
68
+ <path
69
+ d="M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z"
70
+ className="fill-border"
71
+ />
72
+ <path
73
+ d="M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z"
74
+ className="fill-border"
75
+ />
76
+ </svg>
77
+ )}
78
+ </PopoverPrimitive.Arrow>
79
+ ))
80
+ PopoverArrow.displayName = "PopoverArrow"
81
+
82
+ // Optimized PopoverTitle
83
+ const PopoverTitle = React.forwardRef<
84
+ React.ComponentRef<typeof PopoverPrimitive.Title>,
85
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Title>
86
+ >(({ className, ...props }, ref) => (
87
+ <PopoverPrimitive.Title
88
+ ref={ref}
89
+ className={cn("mb-2 text-base font-medium leading-none", className)}
90
+ {...props}
91
+ />
92
+ ))
93
+ PopoverTitle.displayName = "PopoverTitle"
94
+
95
+ // Optimized PopoverDescription
96
+ const PopoverDescription = React.forwardRef<
97
+ React.ComponentRef<typeof PopoverPrimitive.Description>,
98
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Description>
99
+ >(({ className, ...props }, ref) => (
100
+ <PopoverPrimitive.Description
101
+ ref={ref}
102
+ className={cn("text-base text-muted-foreground", className)}
103
+ {...props}
104
+ />
105
+ ))
106
+ PopoverDescription.displayName = "PopoverDescription"
107
+
108
+ // Optimized PopoverBackdrop
109
+ const PopoverBackdrop = React.forwardRef<
110
+ React.ComponentRef<typeof PopoverPrimitive.Backdrop>,
111
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Backdrop>
112
+ >(({ className, ...props }, ref) => (
113
+ <PopoverPrimitive.Backdrop
114
+ ref={ref}
115
+ className={cn(
116
+ "fixed inset-0 z-40 bg-black/50",
117
+ "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
118
+ "transition-opacity duration-150",
119
+ className
120
+ )}
121
+ {...props}
122
+ />
123
+ ))
124
+ PopoverBackdrop.displayName = "PopoverBackdrop"
125
+
126
+ export {
127
+ Popover,
128
+ PopoverTrigger,
129
+ PopoverContent,
130
+ PopoverArrow,
131
+ PopoverTitle,
132
+ PopoverDescription,
133
+ PopoverClose,
134
+ PopoverPortal,
135
+ PopoverBackdrop,
136
+ }
137
+
@@ -1,15 +1,14 @@
1
1
  // @ts-nocheck
2
-
3
2
  "use client"
4
3
 
5
4
  import * as React from "react"
6
- import { PreviewCard as BasePreviewCard } from "@base-ui-components/react/preview-card"
5
+ import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card"
7
6
  import { cn } from "@/lib/utils"
8
7
 
9
8
  const PreviewCard = BasePreviewCard.Root
10
9
 
11
10
  const PreviewCardTrigger = React.forwardRef<
12
- React.ElementRef<typeof BasePreviewCard.Trigger>,
11
+ HTMLAnchorElement,
13
12
  React.ComponentProps<typeof BasePreviewCard.Trigger>
14
13
  >(({ className, ...props }, ref) => (
15
14
  <BasePreviewCard.Trigger
@@ -29,7 +28,7 @@ PreviewCardTrigger.displayName = "PreviewCardTrigger"
29
28
  const PreviewCardPortal = BasePreviewCard.Portal
30
29
 
31
30
  const PreviewCardBackdrop = React.forwardRef<
32
- React.ElementRef<typeof BasePreviewCard.Backdrop>,
31
+ React.ComponentRef<typeof BasePreviewCard.Backdrop>,
33
32
  React.ComponentProps<typeof BasePreviewCard.Backdrop>
34
33
  >(({ className, ...props }, ref) => (
35
34
  <BasePreviewCard.Backdrop
@@ -45,7 +44,7 @@ const PreviewCardBackdrop = React.forwardRef<
45
44
  PreviewCardBackdrop.displayName = "PreviewCardBackdrop"
46
45
 
47
46
  const PreviewCardPositioner = React.forwardRef<
48
- React.ElementRef<typeof BasePreviewCard.Positioner>,
47
+ React.ComponentRef<typeof BasePreviewCard.Positioner>,
49
48
  React.ComponentProps<typeof BasePreviewCard.Positioner>
50
49
  >(({ className, sideOffset = 8, ...props }, ref) => (
51
50
  <BasePreviewCard.Positioner
@@ -58,18 +57,18 @@ const PreviewCardPositioner = React.forwardRef<
58
57
  PreviewCardPositioner.displayName = "PreviewCardPositioner"
59
58
 
60
59
  const PreviewCardPopup = React.forwardRef<
61
- React.ElementRef<typeof BasePreviewCard.Popup>,
60
+ React.ComponentRef<typeof BasePreviewCard.Popup>,
62
61
  React.ComponentProps<typeof BasePreviewCard.Popup>
63
62
  >(({ className, ...props }, ref) => (
64
63
  <BasePreviewCard.Popup
65
64
  ref={ref}
66
65
  className={cn(
67
- "flex w-[280px] origin-[var(--transform-origin)] flex-col gap-3 rounded-lg bg-secondary/70 p-4 shadow-lg shadow-secondary/20",
66
+ "flex w-[280px] origin-[var(--transform-origin)] flex-col gap-3 rounded-lg bg-secondary/80 p-4 shadow-lg shadow-secondary/20",
68
67
  "outline outline-1 outline-border",
69
68
  "transition-[transform,scale,opacity] duration-200",
70
69
  "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
71
70
  "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
72
- "bg-secondary/70 backdrop-blur-sm dark:shadow-none dark:-outline-offset-1",
71
+ "bg-secondary/80 backdrop-blur-sm dark:shadow-none dark:-outline-offset-1",
73
72
  className
74
73
  )}
75
74
  {...props}
@@ -78,7 +77,7 @@ const PreviewCardPopup = React.forwardRef<
78
77
  PreviewCardPopup.displayName = "PreviewCardPopup"
79
78
 
80
79
  const PreviewCardArrow = React.forwardRef<
81
- React.ElementRef<typeof BasePreviewCard.Arrow>,
80
+ React.ComponentRef<typeof BasePreviewCard.Arrow>,
82
81
  React.ComponentProps<typeof BasePreviewCard.Arrow> & {
83
82
  children?: React.ReactNode
84
83
  }
@@ -99,7 +98,7 @@ const PreviewCardArrow = React.forwardRef<
99
98
  PreviewCardArrow.displayName = "PreviewCardArrow"
100
99
 
101
100
  const PreviewCardContent = React.forwardRef<
102
- React.ElementRef<typeof BasePreviewCard.Popup>,
101
+ React.ComponentRef<typeof BasePreviewCard.Popup>,
103
102
  React.ComponentProps<typeof BasePreviewCard.Popup>
104
103
  >(({ className, children, ...props }, ref) => (
105
104
  <PreviewCardPortal>
@@ -139,4 +138,4 @@ export {
139
138
  PreviewCardArrow,
140
139
  PreviewCardContent,
141
140
  PreviewCardArrowSvg,
142
- }
141
+ }
@@ -0,0 +1,7 @@
1
+ export {
2
+ Progress,
3
+ ProgressTrack,
4
+ ProgressIndicator,
5
+ ProgressLabel,
6
+ ProgressValue,
7
+ } from "./progress"
@@ -0,0 +1,64 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const Progress = React.forwardRef<
9
+ React.ComponentRef<typeof ProgressPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <ProgressPrimitive.Root ref={ref} className={cn("grid gap-2", className)} {...props} />
13
+ ))
14
+ Progress.displayName = "Progress"
15
+
16
+ const ProgressTrack = React.forwardRef<
17
+ React.ComponentRef<typeof ProgressPrimitive.Track>,
18
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Track>
19
+ >(({ className, ...props }, ref) => (
20
+ <ProgressPrimitive.Track
21
+ ref={ref}
22
+ className={cn("relative h-2 w-full overflow-hidden rounded-full bg-secondary", className)}
23
+ {...props}
24
+ />
25
+ ))
26
+ ProgressTrack.displayName = "ProgressTrack"
27
+
28
+ const ProgressIndicator = React.forwardRef<
29
+ React.ComponentRef<typeof ProgressPrimitive.Indicator>,
30
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Indicator>
31
+ >(({ className, ...props }, ref) => (
32
+ <ProgressPrimitive.Indicator
33
+ ref={ref}
34
+ className={cn("h-full rounded-full bg-primary transition-[width] duration-200", className)}
35
+ {...props}
36
+ />
37
+ ))
38
+ ProgressIndicator.displayName = "ProgressIndicator"
39
+
40
+ const ProgressLabel = React.forwardRef<
41
+ React.ComponentRef<typeof ProgressPrimitive.Label>,
42
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Label>
43
+ >(({ className, ...props }, ref) => (
44
+ <ProgressPrimitive.Label
45
+ ref={ref}
46
+ className={cn("text-sm font-medium leading-none", className)}
47
+ {...props}
48
+ />
49
+ ))
50
+ ProgressLabel.displayName = "ProgressLabel"
51
+
52
+ const ProgressValue = React.forwardRef<
53
+ React.ComponentRef<typeof ProgressPrimitive.Value>,
54
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Value>
55
+ >(({ className, ...props }, ref) => (
56
+ <ProgressPrimitive.Value
57
+ ref={ref}
58
+ className={cn("text-xs text-muted-foreground", className)}
59
+ {...props}
60
+ />
61
+ ))
62
+ ProgressValue.displayName = "ProgressValue"
63
+
64
+ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue }
@@ -0,0 +1 @@
1
+ export { Radio, RadioGroup } from "./radio"
@@ -0,0 +1,39 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio"
6
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
7
+ import { Circle } from "lucide-react"
8
+ import { cn } from "@/lib/utils"
9
+
10
+ const RadioGroup = React.forwardRef<
11
+ React.ComponentRef<typeof RadioGroupPrimitive>,
12
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive>
13
+ >(({ className, ...props }, ref) => (
14
+ <RadioGroupPrimitive ref={ref} className={cn("grid gap-2", className)} {...props} />
15
+ ))
16
+ RadioGroup.displayName = "RadioGroup"
17
+
18
+ const Radio = React.forwardRef<
19
+ React.ComponentRef<typeof RadioPrimitive.Root>,
20
+ React.ComponentPropsWithoutRef<typeof RadioPrimitive.Root>
21
+ >(({ className, ...props }, ref) => (
22
+ <RadioPrimitive.Root
23
+ ref={ref}
24
+ className={cn(
25
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background",
26
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
27
+ "disabled:cursor-not-allowed disabled:opacity-50",
28
+ className
29
+ )}
30
+ {...props}
31
+ >
32
+ <RadioPrimitive.Indicator className="flex items-center justify-center">
33
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
34
+ </RadioPrimitive.Indicator>
35
+ </RadioPrimitive.Root>
36
+ ))
37
+ Radio.displayName = "Radio"
38
+
39
+ export { Radio, RadioGroup }
@@ -0,0 +1,8 @@
1
+ export {
2
+ ScrollArea,
3
+ ScrollAreaViewport,
4
+ ScrollAreaContent,
5
+ ScrollAreaScrollbar,
6
+ ScrollAreaThumb,
7
+ ScrollAreaCorner,
8
+ } from "./scroll-area"
@@ -0,0 +1,94 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const ScrollArea = React.forwardRef<
9
+ React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <ScrollAreaPrimitive.Root
13
+ ref={ref}
14
+ className={cn("relative overflow-hidden", className)}
15
+ {...props}
16
+ />
17
+ ))
18
+ ScrollArea.displayName = "ScrollArea"
19
+
20
+ const ScrollAreaViewport = React.forwardRef<
21
+ React.ComponentRef<typeof ScrollAreaPrimitive.Viewport>,
22
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Viewport>
23
+ >(({ className, ...props }, ref) => (
24
+ <ScrollAreaPrimitive.Viewport
25
+ ref={ref}
26
+ className={cn("size-full rounded-[inherit]", className)}
27
+ {...props}
28
+ />
29
+ ))
30
+ ScrollAreaViewport.displayName = "ScrollAreaViewport"
31
+
32
+ const ScrollAreaContent = React.forwardRef<
33
+ React.ComponentRef<typeof ScrollAreaPrimitive.Content>,
34
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Content>
35
+ >(({ className, ...props }, ref) => (
36
+ <ScrollAreaPrimitive.Content
37
+ ref={ref}
38
+ className={cn("min-w-full", className)}
39
+ {...props}
40
+ />
41
+ ))
42
+ ScrollAreaContent.displayName = "ScrollAreaContent"
43
+
44
+ const ScrollAreaScrollbar = React.forwardRef<
45
+ React.ComponentRef<typeof ScrollAreaPrimitive.Scrollbar>,
46
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Scrollbar>
47
+ >(({ className, orientation = "vertical", ...props }, ref) => (
48
+ <ScrollAreaPrimitive.Scrollbar
49
+ ref={ref}
50
+ orientation={orientation}
51
+ className={cn(
52
+ "flex touch-none select-none p-0.5 transition-colors",
53
+ orientation === "vertical"
54
+ ? "h-full w-2.5 border-l border-l-transparent"
55
+ : "h-2.5 w-full flex-col border-t border-t-transparent",
56
+ className
57
+ )}
58
+ {...props}
59
+ />
60
+ ))
61
+ ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar"
62
+
63
+ const ScrollAreaThumb = React.forwardRef<
64
+ React.ComponentRef<typeof ScrollAreaPrimitive.Thumb>,
65
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Thumb>
66
+ >(({ className, ...props }, ref) => (
67
+ <ScrollAreaPrimitive.Thumb
68
+ ref={ref}
69
+ className={cn("relative flex-1 rounded-full bg-border", className)}
70
+ {...props}
71
+ />
72
+ ))
73
+ ScrollAreaThumb.displayName = "ScrollAreaThumb"
74
+
75
+ const ScrollAreaCorner = React.forwardRef<
76
+ React.ComponentRef<typeof ScrollAreaPrimitive.Corner>,
77
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Corner>
78
+ >(({ className, ...props }, ref) => (
79
+ <ScrollAreaPrimitive.Corner
80
+ ref={ref}
81
+ className={cn("bg-background", className)}
82
+ {...props}
83
+ />
84
+ ))
85
+ ScrollAreaCorner.displayName = "ScrollAreaCorner"
86
+
87
+ export {
88
+ ScrollArea,
89
+ ScrollAreaViewport,
90
+ ScrollAreaContent,
91
+ ScrollAreaScrollbar,
92
+ ScrollAreaThumb,
93
+ ScrollAreaCorner,
94
+ }
@@ -2,7 +2,7 @@
2
2
  "use client"
3
3
 
4
4
  import * as React from "react"
5
- import { Select as SelectPrimitive } from "@base-ui-components/react/select"
5
+ import { Select as SelectPrimitive } from "@base-ui/react/select"
6
6
  import { cn } from "@/lib/utils"
7
7
  import { Check, ChevronDown } from "lucide-react"
8
8
 
@@ -15,7 +15,7 @@ const SelectValue = SelectPrimitive.Value
15
15
 
16
16
  // Optimized SelectTrigger with better type safety and performance
17
17
  const SelectTrigger = React.forwardRef<
18
- React.ElementRef<typeof SelectPrimitive.Trigger>,
18
+ React.ComponentRef<typeof SelectPrimitive.Trigger>,
19
19
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {
20
20
  readonly children?: React.ReactNode
21
21
  }
@@ -38,7 +38,7 @@ SelectTrigger.displayName = "SelectTrigger"
38
38
 
39
39
  // Optimized SelectContent with better positioning and performance
40
40
  const SelectContent = React.forwardRef<
41
- React.ElementRef<typeof SelectPrimitive.Popup>,
41
+ React.ComponentRef<typeof SelectPrimitive.Popup>,
42
42
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {
43
43
  readonly position?: "item-aligned" | "popper"
44
44
  readonly sideOffset?: number
@@ -74,7 +74,7 @@ SelectContent.displayName = "SelectContent"
74
74
 
75
75
  // Add scroll arrows for better UX with large lists
76
76
  const SelectScrollUpArrow = React.forwardRef<
77
- React.ElementRef<typeof SelectPrimitive.ScrollUpArrow>,
77
+ React.ComponentRef<typeof SelectPrimitive.ScrollUpArrow>,
78
78
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpArrow>
79
79
  >(({ className, ...props }, ref) => (
80
80
  <SelectPrimitive.ScrollUpArrow
@@ -91,7 +91,7 @@ const SelectScrollUpArrow = React.forwardRef<
91
91
  SelectScrollUpArrow.displayName = "SelectScrollUpArrow"
92
92
 
93
93
  const SelectScrollDownArrow = React.forwardRef<
94
- React.ElementRef<typeof SelectPrimitive.ScrollDownArrow>,
94
+ React.ComponentRef<typeof SelectPrimitive.ScrollDownArrow>,
95
95
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownArrow>
96
96
  >(({ className, ...props }, ref) => (
97
97
  <SelectPrimitive.ScrollDownArrow
@@ -109,7 +109,7 @@ SelectScrollDownArrow.displayName = "SelectScrollDownArrow"
109
109
 
110
110
  // Optimized SelectLabel with better accessibility
111
111
  const SelectLabel = React.forwardRef<
112
- React.ElementRef<typeof SelectPrimitive.GroupLabel>,
112
+ React.ComponentRef<typeof SelectPrimitive.GroupLabel>,
113
113
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.GroupLabel>
114
114
  >(({ className, ...props }, ref) => (
115
115
  <SelectPrimitive.GroupLabel
@@ -122,7 +122,7 @@ SelectLabel.displayName = "SelectLabel"
122
122
 
123
123
  // Optimized SelectItem with conditional indicator and better type safety
124
124
  const SelectItem = React.forwardRef<
125
- React.ElementRef<typeof SelectPrimitive.Item>,
125
+ React.ComponentRef<typeof SelectPrimitive.Item>,
126
126
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
127
127
  readonly inset?: boolean
128
128
  readonly showIndicator?: boolean
@@ -186,7 +186,7 @@ SelectItem.displayName = "SelectItem"
186
186
 
187
187
  // Optimized SelectSeparator
188
188
  const SelectSeparator = React.forwardRef<
189
- React.ElementRef<typeof SelectPrimitive.Separator>,
189
+ React.ComponentRef<typeof SelectPrimitive.Separator>,
190
190
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
191
191
  >(({ className, ...props }, ref) => (
192
192
  <SelectPrimitive.Separator
@@ -0,0 +1 @@
1
+ export { Separator } from "./separator"
@@ -0,0 +1,25 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const Separator = React.forwardRef<
9
+ React.ComponentRef<typeof SeparatorPrimitive>,
10
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive>
11
+ >(({ className, orientation = "horizontal", ...props }, ref) => (
12
+ <SeparatorPrimitive
13
+ ref={ref}
14
+ orientation={orientation}
15
+ className={cn(
16
+ "shrink-0 bg-border",
17
+ orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
18
+ className
19
+ )}
20
+ {...props}
21
+ />
22
+ ))
23
+ Separator.displayName = "Separator"
24
+
25
+ export { Separator }