@betterstart/cli 0.1.28 → 0.1.29

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 +742 -869
  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
@@ -0,0 +1,272 @@
1
+ 'use client'
2
+
3
+ import { Combobox as ComboboxPrimitive } from '@base-ui/react'
4
+ import { Button } from '@cms/components/ui/button'
5
+ import {
6
+ InputGroup,
7
+ InputGroupAddon,
8
+ InputGroupButton,
9
+ InputGroupInput
10
+ } from '@cms/components/ui/input-group'
11
+ import { cn } from '@cms/utils/cn'
12
+ import { Check, ChevronDown, X } from 'lucide-react'
13
+ import * as React from 'react'
14
+
15
+ const Combobox = ComboboxPrimitive.Root
16
+
17
+ function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
18
+ return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />
19
+ }
20
+
21
+ function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {
22
+ return (
23
+ <ComboboxPrimitive.Trigger
24
+ data-slot="combobox-trigger"
25
+ className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
26
+ {...props}
27
+ >
28
+ {children}
29
+ <ChevronDown className="text-muted-foreground pointer-events-none size-4" />
30
+ </ComboboxPrimitive.Trigger>
31
+ )
32
+ }
33
+
34
+ function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
35
+ return (
36
+ <ComboboxPrimitive.Clear
37
+ data-slot="combobox-clear"
38
+ render={<InputGroupButton variant="ghost" size="icon-xs" />}
39
+ className={cn(className)}
40
+ {...props}
41
+ >
42
+ <X className="pointer-events-none" />
43
+ </ComboboxPrimitive.Clear>
44
+ )
45
+ }
46
+
47
+ function ComboboxInput({
48
+ className,
49
+ children,
50
+ disabled = false,
51
+ showTrigger = true,
52
+ showClear = false,
53
+ ...props
54
+ }: ComboboxPrimitive.Input.Props & {
55
+ showTrigger?: boolean
56
+ showClear?: boolean
57
+ }) {
58
+ return (
59
+ <InputGroup className={cn('w-auto', className)}>
60
+ <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
61
+ <InputGroupAddon align="inline-end">
62
+ {showTrigger && (
63
+ <InputGroupButton
64
+ size="icon-xs"
65
+ variant="ghost"
66
+ asChild
67
+ data-slot="input-group-button"
68
+ className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
69
+ disabled={disabled}
70
+ >
71
+ <ComboboxTrigger />
72
+ </InputGroupButton>
73
+ )}
74
+ {showClear && <ComboboxClear disabled={disabled} />}
75
+ </InputGroupAddon>
76
+ {children}
77
+ </InputGroup>
78
+ )
79
+ }
80
+
81
+ function ComboboxContent({
82
+ className,
83
+ side = 'bottom',
84
+ sideOffset = 6,
85
+ align = 'start',
86
+ alignOffset = 0,
87
+ anchor,
88
+ ...props
89
+ }: ComboboxPrimitive.Popup.Props &
90
+ Pick<
91
+ ComboboxPrimitive.Positioner.Props,
92
+ 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'
93
+ >) {
94
+ return (
95
+ <ComboboxPrimitive.Portal>
96
+ <ComboboxPrimitive.Positioner
97
+ side={side}
98
+ sideOffset={sideOffset}
99
+ align={align}
100
+ alignOffset={alignOffset}
101
+ anchor={anchor}
102
+ className="isolate z-50"
103
+ >
104
+ <ComboboxPrimitive.Popup
105
+ data-slot="combobox-content"
106
+ data-chips={!!anchor}
107
+ className={cn(
108
+ '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 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none',
109
+ className
110
+ )}
111
+ {...props}
112
+ />
113
+ </ComboboxPrimitive.Positioner>
114
+ </ComboboxPrimitive.Portal>
115
+ )
116
+ }
117
+
118
+ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
119
+ return (
120
+ <ComboboxPrimitive.List
121
+ data-slot="combobox-list"
122
+ className={cn(
123
+ 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',
124
+ className
125
+ )}
126
+ {...props}
127
+ />
128
+ )
129
+ }
130
+
131
+ function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
132
+ return (
133
+ <ComboboxPrimitive.Item
134
+ data-slot="combobox-item"
135
+ className={cn(
136
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 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",
137
+ className
138
+ )}
139
+ {...props}
140
+ >
141
+ {children}
142
+ <ComboboxPrimitive.ItemIndicator
143
+ render={
144
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
145
+ }
146
+ >
147
+ <Check className="pointer-events-none" />
148
+ </ComboboxPrimitive.ItemIndicator>
149
+ </ComboboxPrimitive.Item>
150
+ )
151
+ }
152
+
153
+ function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
154
+ return <ComboboxPrimitive.Group data-slot="combobox-group" className={cn(className)} {...props} />
155
+ }
156
+
157
+ function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {
158
+ return (
159
+ <ComboboxPrimitive.GroupLabel
160
+ data-slot="combobox-label"
161
+ className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
162
+ {...props}
163
+ />
164
+ )
165
+ }
166
+
167
+ function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
168
+ return <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
169
+ }
170
+
171
+ function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
172
+ return (
173
+ <ComboboxPrimitive.Empty
174
+ data-slot="combobox-empty"
175
+ className={cn(
176
+ 'text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex',
177
+ className
178
+ )}
179
+ {...props}
180
+ />
181
+ )
182
+ }
183
+
184
+ function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {
185
+ return (
186
+ <ComboboxPrimitive.Separator
187
+ data-slot="combobox-separator"
188
+ className={cn('bg-border -mx-1 my-1 h-px', className)}
189
+ {...props}
190
+ />
191
+ )
192
+ }
193
+
194
+ function ComboboxChips({
195
+ className,
196
+ ...props
197
+ }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {
198
+ return (
199
+ <ComboboxPrimitive.Chips
200
+ data-slot="combobox-chips"
201
+ className={cn(
202
+ 'dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1',
203
+ className
204
+ )}
205
+ {...props}
206
+ />
207
+ )
208
+ }
209
+
210
+ function ComboboxChip({
211
+ className,
212
+ children,
213
+ showRemove = true,
214
+ ...props
215
+ }: ComboboxPrimitive.Chip.Props & {
216
+ showRemove?: boolean
217
+ }) {
218
+ return (
219
+ <ComboboxPrimitive.Chip
220
+ data-slot="combobox-chip"
221
+ className={cn(
222
+ 'bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',
223
+ className
224
+ )}
225
+ {...props}
226
+ >
227
+ {children}
228
+ {showRemove && (
229
+ <ComboboxPrimitive.ChipRemove
230
+ render={<Button variant="ghost" size="icon-xs" />}
231
+ className="-ml-1 opacity-50 hover:opacity-100"
232
+ data-slot="combobox-chip-remove"
233
+ >
234
+ <X className="pointer-events-none" />
235
+ </ComboboxPrimitive.ChipRemove>
236
+ )}
237
+ </ComboboxPrimitive.Chip>
238
+ )
239
+ }
240
+
241
+ function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
242
+ return (
243
+ <ComboboxPrimitive.Input
244
+ data-slot="combobox-chip-input"
245
+ className={cn('min-w-16 flex-1 outline-none', className)}
246
+ {...props}
247
+ />
248
+ )
249
+ }
250
+
251
+ function useComboboxAnchor() {
252
+ return React.useRef<HTMLDivElement | null>(null)
253
+ }
254
+
255
+ export {
256
+ Combobox,
257
+ ComboboxInput,
258
+ ComboboxContent,
259
+ ComboboxList,
260
+ ComboboxItem,
261
+ ComboboxGroup,
262
+ ComboboxLabel,
263
+ ComboboxCollection,
264
+ ComboboxEmpty,
265
+ ComboboxSeparator,
266
+ ComboboxChips,
267
+ ComboboxChip,
268
+ ComboboxChipsInput,
269
+ ComboboxTrigger,
270
+ ComboboxValue,
271
+ useComboboxAnchor
272
+ }
@@ -1,133 +1,171 @@
1
1
  'use client'
2
2
 
3
+ import {
4
+ Dialog,
5
+ DialogContent,
6
+ DialogDescription,
7
+ DialogHeader,
8
+ DialogTitle
9
+ } from '@cms/components/ui/dialog'
10
+ import { InputGroup, InputGroupAddon } from '@cms/components/ui/input-group'
11
+
3
12
  import { cn } from '@cms/utils/cn'
4
- import type { DialogProps } from '@radix-ui/react-dialog'
5
13
  import { Command as CommandPrimitive } from 'cmdk'
6
- import { Search } from 'lucide-react'
7
- import * as React from 'react'
8
- import { Dialog, DialogContent } from './dialog'
14
+ import { Check, Search } from 'lucide-react'
15
+ import type * as React from 'react'
9
16
 
10
- const Command = React.forwardRef<
11
- React.ElementRef<typeof CommandPrimitive>,
12
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
13
- >(({ className, ...props }, ref) => (
14
- <CommandPrimitive
15
- ref={ref}
16
- className={cn(
17
- 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
18
- className
19
- )}
20
- {...props}
21
- />
22
- ))
23
- Command.displayName = CommandPrimitive.displayName
17
+ function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
18
+ return (
19
+ <CommandPrimitive
20
+ data-slot="command"
21
+ className={cn(
22
+ 'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1',
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
24
29
 
25
- const CommandDialog = ({ children, ...props }: DialogProps) => {
30
+ function CommandDialog({
31
+ title = 'Command Palette',
32
+ description = 'Search for a command to run...',
33
+ children,
34
+ className,
35
+ showCloseButton = false,
36
+ ...props
37
+ }: React.ComponentProps<typeof Dialog> & {
38
+ title?: string
39
+ description?: string
40
+ className?: string
41
+ showCloseButton?: boolean
42
+ }) {
26
43
  return (
27
44
  <Dialog {...props}>
28
- <DialogContent className="overflow-hidden p-0">
29
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[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">
30
- {children}
31
- </Command>
45
+ <DialogHeader className="sr-only">
46
+ <DialogTitle>{title}</DialogTitle>
47
+ <DialogDescription>{description}</DialogDescription>
48
+ </DialogHeader>
49
+ <DialogContent
50
+ className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}
51
+ showCloseButton={showCloseButton}
52
+ >
53
+ {children}
32
54
  </DialogContent>
33
55
  </Dialog>
34
56
  )
35
57
  }
36
58
 
37
- const CommandInput = React.forwardRef<
38
- React.ElementRef<typeof CommandPrimitive.Input>,
39
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
40
- >(({ className, ...props }, ref) => (
41
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
42
- <Search className="mr-2 size-4 shrink-0 opacity-50" />
43
- <CommandPrimitive.Input
44
- ref={ref}
59
+ function CommandInput({
60
+ className,
61
+ ...props
62
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
63
+ return (
64
+ <div data-slot="command-input-wrapper" className="p-1 pb-0">
65
+ <InputGroup className="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!">
66
+ <CommandPrimitive.Input
67
+ data-slot="command-input"
68
+ className={cn(
69
+ 'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
70
+ className
71
+ )}
72
+ {...props}
73
+ />
74
+ <InputGroupAddon>
75
+ <Search className="size-4 shrink-0 opacity-50" />
76
+ </InputGroupAddon>
77
+ </InputGroup>
78
+ </div>
79
+ )
80
+ }
81
+
82
+ function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
83
+ return (
84
+ <CommandPrimitive.List
85
+ data-slot="command-list"
45
86
  className={cn(
46
- 'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
87
+ 'no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none',
47
88
  className
48
89
  )}
49
90
  {...props}
50
91
  />
51
- </div>
52
- ))
53
-
54
- CommandInput.displayName = CommandPrimitive.Input.displayName
55
-
56
- const CommandList = React.forwardRef<
57
- React.ElementRef<typeof CommandPrimitive.List>,
58
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
59
- >(({ className, ...props }, ref) => (
60
- <CommandPrimitive.List
61
- ref={ref}
62
- className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
63
- {...props}
64
- />
65
- ))
66
-
67
- CommandList.displayName = CommandPrimitive.List.displayName
68
-
69
- const CommandEmpty = React.forwardRef<
70
- React.ElementRef<typeof CommandPrimitive.Empty>,
71
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
72
- >((props, ref) => (
73
- <CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />
74
- ))
75
-
76
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName
77
-
78
- const CommandGroup = React.forwardRef<
79
- React.ElementRef<typeof CommandPrimitive.Group>,
80
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
81
- >(({ className, ...props }, ref) => (
82
- <CommandPrimitive.Group
83
- ref={ref}
84
- className={cn(
85
- 'overflow-hidden p-1 text-foreground [&_[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-muted-foreground',
86
- className
87
- )}
88
- {...props}
89
- />
90
- ))
92
+ )
93
+ }
91
94
 
92
- CommandGroup.displayName = CommandPrimitive.Group.displayName
95
+ function CommandEmpty({
96
+ className,
97
+ ...props
98
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
99
+ return (
100
+ <CommandPrimitive.Empty
101
+ data-slot="command-empty"
102
+ className={cn('py-6 text-center text-sm', className)}
103
+ {...props}
104
+ />
105
+ )
106
+ }
93
107
 
94
- const CommandSeparator = React.forwardRef<
95
- React.ElementRef<typeof CommandPrimitive.Separator>,
96
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
97
- >(({ className, ...props }, ref) => (
98
- <CommandPrimitive.Separator
99
- ref={ref}
100
- className={cn('-mx-1 h-px bg-border', className)}
101
- {...props}
102
- />
103
- ))
104
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName
108
+ function CommandGroup({
109
+ className,
110
+ ...props
111
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
112
+ return (
113
+ <CommandPrimitive.Group
114
+ data-slot="command-group"
115
+ className={cn(
116
+ 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',
117
+ className
118
+ )}
119
+ {...props}
120
+ />
121
+ )
122
+ }
105
123
 
106
- const CommandItem = React.forwardRef<
107
- React.ElementRef<typeof CommandPrimitive.Item>,
108
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
109
- >(({ className, ...props }, ref) => (
110
- <CommandPrimitive.Item
111
- ref={ref}
112
- className={cn(
113
- 'relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
114
- className
115
- )}
116
- {...props}
117
- />
118
- ))
124
+ function CommandSeparator({
125
+ className,
126
+ ...props
127
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
128
+ return (
129
+ <CommandPrimitive.Separator
130
+ data-slot="command-separator"
131
+ className={cn('bg-border -mx-1 h-px', className)}
132
+ {...props}
133
+ />
134
+ )
135
+ }
119
136
 
120
- CommandItem.displayName = CommandPrimitive.Item.displayName
137
+ function CommandItem({
138
+ className,
139
+ children,
140
+ ...props
141
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
142
+ return (
143
+ <CommandPrimitive.Item
144
+ data-slot="command-item"
145
+ className={cn(
146
+ "data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
147
+ className
148
+ )}
149
+ {...props}
150
+ >
151
+ {children}
152
+ <Check className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
153
+ </CommandPrimitive.Item>
154
+ )
155
+ }
121
156
 
122
- const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
157
+ function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {
123
158
  return (
124
159
  <span
125
- className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
160
+ data-slot="command-shortcut"
161
+ className={cn(
162
+ 'text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest',
163
+ className
164
+ )}
126
165
  {...props}
127
166
  />
128
167
  )
129
168
  }
130
- CommandShortcut.displayName = 'CommandShortcut'
131
169
 
132
170
  export {
133
171
  Command,