@betterstart/cli 0.1.28 → 0.1.30

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 (65) hide show
  1. package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
  2. package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
  3. package/dist/cli.js +749 -866
  4. package/dist/cli.js.map +1 -1
  5. package/dist/drizzle-config-EDKOEZ6G.js +7 -0
  6. package/package.json +1 -1
  7. package/templates/ui/accordion.tsx +73 -42
  8. package/templates/ui/alert-dialog.tsx +155 -90
  9. package/templates/ui/alert.tsx +46 -26
  10. package/templates/ui/aspect-ratio.tsx +4 -2
  11. package/templates/ui/avatar.tsx +92 -43
  12. package/templates/ui/badge.tsx +27 -12
  13. package/templates/ui/breadcrumb.tsx +63 -60
  14. package/templates/ui/button-group.tsx +8 -8
  15. package/templates/ui/button.tsx +44 -26
  16. package/templates/ui/calendar.tsx +43 -34
  17. package/templates/ui/card.tsx +71 -34
  18. package/templates/ui/carousel.tsx +111 -115
  19. package/templates/ui/chart.tsx +197 -207
  20. package/templates/ui/checkbox.tsx +21 -20
  21. package/templates/ui/collapsible.tsx +14 -4
  22. package/templates/ui/combobox.tsx +272 -0
  23. package/templates/ui/command.tsx +139 -101
  24. package/templates/ui/context-menu.tsx +214 -156
  25. package/templates/ui/dialog.tsx +118 -77
  26. package/templates/ui/direction.tsx +20 -0
  27. package/templates/ui/drawer.tsx +89 -69
  28. package/templates/ui/dropdown-menu.tsx +228 -164
  29. package/templates/ui/empty.tsx +8 -5
  30. package/templates/ui/field.tsx +25 -32
  31. package/templates/ui/hover-card.tsx +29 -20
  32. package/templates/ui/input-group.tsx +20 -37
  33. package/templates/ui/input-otp.tsx +57 -42
  34. package/templates/ui/input.tsx +14 -17
  35. package/templates/ui/item.tsx +27 -17
  36. package/templates/ui/kbd.tsx +1 -3
  37. package/templates/ui/label.tsx +14 -14
  38. package/templates/ui/markdown-editor.tsx +1 -1
  39. package/templates/ui/menubar.tsx +220 -188
  40. package/templates/ui/native-select.tsx +42 -0
  41. package/templates/ui/navigation-menu.tsx +130 -90
  42. package/templates/ui/pagination.tsx +88 -73
  43. package/templates/ui/popover.tsx +67 -26
  44. package/templates/ui/progress.tsx +24 -18
  45. package/templates/ui/radio-group.tsx +26 -20
  46. package/templates/ui/resizable.tsx +29 -29
  47. package/templates/ui/scroll-area.tsx +47 -38
  48. package/templates/ui/select.tsx +158 -125
  49. package/templates/ui/separator.tsx +21 -19
  50. package/templates/ui/sheet.tsx +104 -95
  51. package/templates/ui/sidebar.tsx +77 -183
  52. package/templates/ui/skeleton.tsx +8 -2
  53. package/templates/ui/slider.tsx +46 -17
  54. package/templates/ui/sonner.tsx +19 -9
  55. package/templates/ui/spinner.tsx +2 -2
  56. package/templates/ui/switch.tsx +24 -20
  57. package/templates/ui/table.tsx +68 -73
  58. package/templates/ui/tabs.tsx +71 -46
  59. package/templates/ui/textarea.tsx +13 -16
  60. package/templates/ui/toggle-group.tsx +57 -28
  61. package/templates/ui/toggle.tsx +21 -20
  62. package/templates/ui/tooltip.tsx +44 -23
  63. package/dist/drizzle-config-KISB26BA.js +0 -7
  64. package/templates/ui/use-mobile.tsx +0 -19
  65. /package/dist/{drizzle-config-KISB26BA.js.map → drizzle-config-EDKOEZ6G.js.map} +0 -0
@@ -1,20 +1,20 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as LabelPrimitive from '@radix-ui/react-label'
5
- import { cva, type VariantProps } from 'class-variance-authority'
6
- import * as React from 'react'
4
+ import { Label as LabelPrimitive } from 'radix-ui'
5
+ import type * as React from 'react'
7
6
 
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> & VariantProps<typeof labelVariants>
15
- >(({ className, ...props }, ref) => (
16
- <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
17
- ))
18
- Label.displayName = LabelPrimitive.Root.displayName
7
+ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
8
+ return (
9
+ <LabelPrimitive.Root
10
+ data-slot="label"
11
+ className={cn(
12
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
19
 
20
20
  export { Label }
@@ -225,7 +225,7 @@ export function MarkdownEditor({
225
225
  <ChevronDown className="size-3" />
226
226
  </Button>
227
227
  </DropdownMenuTrigger>
228
- <DropdownMenuContent align="start" className="w-56 max-h-96 overflow-y-auto">
228
+ <DropdownMenuContent align="start" className="w-56 max-h-86 overflow-y-auto">
229
229
  {Object.entries(componentSnippets).map(([category, items]) => (
230
230
  <React.Fragment key={category}>
231
231
  <DropdownMenuLabel>{category}</DropdownMenuLabel>
@@ -1,230 +1,262 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as MenubarPrimitive from '@radix-ui/react-menubar'
5
- import { Check, ChevronRight, Circle } from 'lucide-react'
6
- import * as React from 'react'
4
+ import { Check, ChevronRight } from 'lucide-react'
5
+ import { Menubar as MenubarPrimitive } from 'radix-ui'
6
+ import type * as React from 'react'
7
+
8
+ function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>) {
9
+ return (
10
+ <MenubarPrimitive.Root
11
+ data-slot="menubar"
12
+ className={cn(
13
+ 'bg-background flex h-8 items-center gap-0.5 rounded-lg border p-[3px]',
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
7
20
 
8
21
  function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
9
- return <MenubarPrimitive.Menu {...props} />
22
+ return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
10
23
  }
11
24
 
12
25
  function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
13
- return <MenubarPrimitive.Group {...props} />
26
+ return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
14
27
  }
15
28
 
16
29
  function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
17
- return <MenubarPrimitive.Portal {...props} />
30
+ return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
18
31
  }
19
32
 
20
33
  function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
21
- return <MenubarPrimitive.RadioGroup {...props} />
34
+ return <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
22
35
  }
23
36
 
24
- function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
25
- return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
37
+ function MenubarTrigger({
38
+ className,
39
+ ...props
40
+ }: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
41
+ return (
42
+ <MenubarPrimitive.Trigger
43
+ data-slot="menubar-trigger"
44
+ className={cn(
45
+ 'hover:bg-muted aria-expanded:bg-muted flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none',
46
+ className
47
+ )}
48
+ {...props}
49
+ />
50
+ )
51
+ }
52
+
53
+ function MenubarContent({
54
+ className,
55
+ align = 'start',
56
+ alignOffset = -4,
57
+ sideOffset = 8,
58
+ ...props
59
+ }: React.ComponentProps<typeof MenubarPrimitive.Content>) {
60
+ return (
61
+ <MenubarPortal>
62
+ <MenubarPrimitive.Content
63
+ data-slot="menubar-content"
64
+ align={align}
65
+ alignOffset={alignOffset}
66
+ sideOffset={sideOffset}
67
+ className={cn(
68
+ 'bg-popover text-popover-foreground data-open:animate-in data-open:fade-in-0 data-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 ring-foreground/10 z-50 min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg p-1 shadow-md ring-1 duration-100',
69
+ className
70
+ )}
71
+ {...props}
72
+ />
73
+ </MenubarPortal>
74
+ )
26
75
  }
27
76
 
28
- const Menubar = React.forwardRef<
29
- React.ElementRef<typeof MenubarPrimitive.Root>,
30
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
31
- >(({ className, ...props }, ref) => (
32
- <MenubarPrimitive.Root
33
- ref={ref}
34
- className={cn(
35
- 'flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm',
36
- className
37
- )}
38
- {...props}
39
- />
40
- ))
41
- Menubar.displayName = MenubarPrimitive.Root.displayName
42
-
43
- const MenubarTrigger = React.forwardRef<
44
- React.ElementRef<typeof MenubarPrimitive.Trigger>,
45
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
46
- >(({ className, ...props }, ref) => (
47
- <MenubarPrimitive.Trigger
48
- ref={ref}
49
- className={cn(
50
- 'flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
51
- className
52
- )}
53
- {...props}
54
- />
55
- ))
56
- MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
57
-
58
- const MenubarSubTrigger = React.forwardRef<
59
- React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
60
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
61
- inset?: boolean
62
- }
63
- >(({ className, inset, children, ...props }, ref) => (
64
- <MenubarPrimitive.SubTrigger
65
- ref={ref}
66
- className={cn(
67
- 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
68
- inset && 'pl-8',
69
- className
70
- )}
71
- {...props}
72
- >
73
- {children}
74
- <ChevronRight className="ml-auto size-4" />
75
- </MenubarPrimitive.SubTrigger>
76
- ))
77
- MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
78
-
79
- const MenubarSubContent = React.forwardRef<
80
- React.ElementRef<typeof MenubarPrimitive.SubContent>,
81
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
82
- >(({ className, ...props }, ref) => (
83
- <MenubarPrimitive.SubContent
84
- ref={ref}
85
- className={cn(
86
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-menubar-content-transform-origin]',
87
- className
88
- )}
89
- {...props}
90
- />
91
- ))
92
- MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
93
-
94
- const MenubarContent = React.forwardRef<
95
- React.ElementRef<typeof MenubarPrimitive.Content>,
96
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
97
- >(({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, ref) => (
98
- <MenubarPrimitive.Portal>
99
- <MenubarPrimitive.Content
100
- ref={ref}
101
- align={align}
102
- alignOffset={alignOffset}
103
- sideOffset={sideOffset}
77
+ function MenubarItem({
78
+ className,
79
+ inset,
80
+ variant = 'default',
81
+ ...props
82
+ }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
83
+ inset?: boolean
84
+ variant?: 'default' | 'destructive'
85
+ }) {
86
+ return (
87
+ <MenubarPrimitive.Item
88
+ data-slot="menubar-item"
89
+ data-inset={inset}
90
+ data-variant={variant}
104
91
  className={cn(
105
- 'z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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 origin-[--radix-menubar-content-transform-origin]',
92
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! not-data-[variant=destructive]:focus:**:text-accent-foreground group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
106
93
  className
107
94
  )}
108
95
  {...props}
109
96
  />
110
- </MenubarPrimitive.Portal>
111
- ))
112
- MenubarContent.displayName = MenubarPrimitive.Content.displayName
113
-
114
- const MenubarItem = React.forwardRef<
115
- React.ElementRef<typeof MenubarPrimitive.Item>,
116
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
117
- inset?: boolean
118
- }
119
- >(({ className, inset, ...props }, ref) => (
120
- <MenubarPrimitive.Item
121
- ref={ref}
122
- className={cn(
123
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
124
- inset && 'pl-8',
125
- className
126
- )}
127
- {...props}
128
- />
129
- ))
130
- MenubarItem.displayName = MenubarPrimitive.Item.displayName
131
-
132
- const MenubarCheckboxItem = React.forwardRef<
133
- React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
134
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
135
- >(({ className, children, checked, ...props }, ref) => (
136
- <MenubarPrimitive.CheckboxItem
137
- ref={ref}
138
- className={cn(
139
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
140
- className
141
- )}
142
- checked={checked}
143
- {...props}
144
- >
145
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
146
- <MenubarPrimitive.ItemIndicator>
147
- <Check className="size-4" />
148
- </MenubarPrimitive.ItemIndicator>
149
- </span>
150
- {children}
151
- </MenubarPrimitive.CheckboxItem>
152
- ))
153
- MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
154
-
155
- const MenubarRadioItem = React.forwardRef<
156
- React.ElementRef<typeof MenubarPrimitive.RadioItem>,
157
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
158
- >(({ className, children, ...props }, ref) => (
159
- <MenubarPrimitive.RadioItem
160
- ref={ref}
161
- className={cn(
162
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
163
- className
164
- )}
165
- {...props}
166
- >
167
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
168
- <MenubarPrimitive.ItemIndicator>
169
- <Circle className="size-4 fill-current" />
170
- </MenubarPrimitive.ItemIndicator>
171
- </span>
172
- {children}
173
- </MenubarPrimitive.RadioItem>
174
- ))
175
- MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
176
-
177
- const MenubarLabel = React.forwardRef<
178
- React.ElementRef<typeof MenubarPrimitive.Label>,
179
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
180
- inset?: boolean
181
- }
182
- >(({ className, inset, ...props }, ref) => (
183
- <MenubarPrimitive.Label
184
- ref={ref}
185
- className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
186
- {...props}
187
- />
188
- ))
189
- MenubarLabel.displayName = MenubarPrimitive.Label.displayName
190
-
191
- const MenubarSeparator = React.forwardRef<
192
- React.ElementRef<typeof MenubarPrimitive.Separator>,
193
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
194
- >(({ className, ...props }, ref) => (
195
- <MenubarPrimitive.Separator
196
- ref={ref}
197
- className={cn('-mx-1 my-1 h-px bg-muted', className)}
198
- {...props}
199
- />
200
- ))
201
- MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
202
-
203
- const MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
97
+ )
98
+ }
99
+
100
+ function MenubarCheckboxItem({
101
+ className,
102
+ children,
103
+ checked,
104
+ inset,
105
+ ...props
106
+ }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem> & {
107
+ inset?: boolean
108
+ }) {
109
+ return (
110
+ <MenubarPrimitive.CheckboxItem
111
+ data-slot="menubar-checkbox-item"
112
+ data-inset={inset}
113
+ className={cn(
114
+ 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none data-disabled:pointer-events-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0',
115
+ className
116
+ )}
117
+ checked={checked}
118
+ {...props}
119
+ >
120
+ <span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
121
+ <MenubarPrimitive.ItemIndicator>
122
+ <Check />
123
+ </MenubarPrimitive.ItemIndicator>
124
+ </span>
125
+ {children}
126
+ </MenubarPrimitive.CheckboxItem>
127
+ )
128
+ }
129
+
130
+ function MenubarRadioItem({
131
+ className,
132
+ children,
133
+ inset,
134
+ ...props
135
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioItem> & {
136
+ inset?: boolean
137
+ }) {
138
+ return (
139
+ <MenubarPrimitive.RadioItem
140
+ data-slot="menubar-radio-item"
141
+ data-inset={inset}
142
+ className={cn(
143
+ "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
144
+ className
145
+ )}
146
+ {...props}
147
+ >
148
+ <span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
149
+ <MenubarPrimitive.ItemIndicator>
150
+ <Check />
151
+ </MenubarPrimitive.ItemIndicator>
152
+ </span>
153
+ {children}
154
+ </MenubarPrimitive.RadioItem>
155
+ )
156
+ }
157
+
158
+ function MenubarLabel({
159
+ className,
160
+ inset,
161
+ ...props
162
+ }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
163
+ inset?: boolean
164
+ }) {
165
+ return (
166
+ <MenubarPrimitive.Label
167
+ data-slot="menubar-label"
168
+ data-inset={inset}
169
+ className={cn('px-1.5 py-1 text-sm font-medium data-inset:pl-7', className)}
170
+ {...props}
171
+ />
172
+ )
173
+ }
174
+
175
+ function MenubarSeparator({
176
+ className,
177
+ ...props
178
+ }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
179
+ return (
180
+ <MenubarPrimitive.Separator
181
+ data-slot="menubar-separator"
182
+ className={cn('bg-border -mx-1 my-1 h-px', className)}
183
+ {...props}
184
+ />
185
+ )
186
+ }
187
+
188
+ function MenubarShortcut({ className, ...props }: React.ComponentProps<'span'>) {
204
189
  return (
205
190
  <span
206
- className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
191
+ data-slot="menubar-shortcut"
192
+ className={cn(
193
+ 'text-muted-foreground group-focus/menubar-item:text-accent-foreground ml-auto text-xs tracking-widest',
194
+ className
195
+ )}
196
+ {...props}
197
+ />
198
+ )
199
+ }
200
+
201
+ function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
202
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
203
+ }
204
+
205
+ function MenubarSubTrigger({
206
+ className,
207
+ inset,
208
+ children,
209
+ ...props
210
+ }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
211
+ inset?: boolean
212
+ }) {
213
+ return (
214
+ <MenubarPrimitive.SubTrigger
215
+ data-slot="menubar-sub-trigger"
216
+ data-inset={inset}
217
+ className={cn(
218
+ "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none select-none data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4",
219
+ className
220
+ )}
221
+ {...props}
222
+ >
223
+ {children}
224
+ <ChevronRight className="ml-auto size-4" />
225
+ </MenubarPrimitive.SubTrigger>
226
+ )
227
+ }
228
+
229
+ function MenubarSubContent({
230
+ className,
231
+ ...props
232
+ }: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
233
+ return (
234
+ <MenubarPrimitive.SubContent
235
+ data-slot="menubar-sub-content"
236
+ className={cn(
237
+ 'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg p-1 shadow-lg ring-1 duration-100',
238
+ className
239
+ )}
207
240
  {...props}
208
241
  />
209
242
  )
210
243
  }
211
- MenubarShortcut.displayname = 'MenubarShortcut'
212
244
 
213
245
  export {
214
246
  Menubar,
247
+ MenubarPortal,
215
248
  MenubarMenu,
216
249
  MenubarTrigger,
217
250
  MenubarContent,
218
- MenubarItem,
251
+ MenubarGroup,
219
252
  MenubarSeparator,
220
253
  MenubarLabel,
254
+ MenubarItem,
255
+ MenubarShortcut,
221
256
  MenubarCheckboxItem,
222
257
  MenubarRadioGroup,
223
258
  MenubarRadioItem,
224
- MenubarPortal,
225
- MenubarSubContent,
226
- MenubarSubTrigger,
227
- MenubarGroup,
228
259
  MenubarSub,
229
- MenubarShortcut
260
+ MenubarSubTrigger,
261
+ MenubarSubContent
230
262
  }
@@ -0,0 +1,42 @@
1
+ import { cn } from '@cms/utils/cn'
2
+ import { ChevronsUpDown } from 'lucide-react'
3
+ import type * as React from 'react'
4
+
5
+ type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {
6
+ size?: 'sm' | 'default'
7
+ }
8
+
9
+ function NativeSelect({ className, size = 'default', ...props }: NativeSelectProps) {
10
+ return (
11
+ <div
12
+ className={cn(
13
+ 'group/native-select relative w-fit has-[select:disabled]:opacity-50',
14
+ className
15
+ )}
16
+ data-slot="native-select-wrapper"
17
+ data-size={size}
18
+ >
19
+ <select
20
+ data-slot="native-select"
21
+ data-size={size}
22
+ className="border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors outline-none select-none focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5"
23
+ {...props}
24
+ />
25
+ <ChevronsUpDown
26
+ className="text-muted-foreground pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 select-none"
27
+ aria-hidden="true"
28
+ data-slot="native-select-icon"
29
+ />
30
+ </div>
31
+ )
32
+ }
33
+
34
+ function NativeSelectOption({ ...props }: React.ComponentProps<'option'>) {
35
+ return <option data-slot="native-select-option" {...props} />
36
+ }
37
+
38
+ function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<'optgroup'>) {
39
+ return <optgroup data-slot="native-select-optgroup" className={cn(className)} {...props} />
40
+ }
41
+
42
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }