@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.
- package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
- package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
- package/dist/cli.js +742 -869
- package/dist/cli.js.map +1 -1
- package/dist/drizzle-config-EDKOEZ6G.js +7 -0
- package/package.json +1 -1
- package/templates/ui/accordion.tsx +73 -42
- package/templates/ui/alert-dialog.tsx +155 -90
- package/templates/ui/alert.tsx +46 -26
- package/templates/ui/aspect-ratio.tsx +4 -2
- package/templates/ui/avatar.tsx +92 -43
- package/templates/ui/badge.tsx +27 -12
- package/templates/ui/breadcrumb.tsx +63 -60
- package/templates/ui/button-group.tsx +8 -8
- package/templates/ui/button.tsx +44 -26
- package/templates/ui/calendar.tsx +43 -34
- package/templates/ui/card.tsx +71 -34
- package/templates/ui/carousel.tsx +111 -115
- package/templates/ui/chart.tsx +197 -207
- package/templates/ui/checkbox.tsx +21 -20
- package/templates/ui/collapsible.tsx +14 -4
- package/templates/ui/combobox.tsx +272 -0
- package/templates/ui/command.tsx +139 -101
- package/templates/ui/context-menu.tsx +214 -156
- package/templates/ui/dialog.tsx +118 -77
- package/templates/ui/direction.tsx +20 -0
- package/templates/ui/drawer.tsx +89 -69
- package/templates/ui/dropdown-menu.tsx +228 -164
- package/templates/ui/empty.tsx +8 -5
- package/templates/ui/field.tsx +25 -32
- package/templates/ui/hover-card.tsx +29 -20
- package/templates/ui/input-group.tsx +20 -37
- package/templates/ui/input-otp.tsx +57 -42
- package/templates/ui/input.tsx +14 -17
- package/templates/ui/item.tsx +27 -17
- package/templates/ui/kbd.tsx +1 -3
- package/templates/ui/label.tsx +14 -14
- package/templates/ui/markdown-editor.tsx +1 -1
- package/templates/ui/menubar.tsx +220 -188
- package/templates/ui/native-select.tsx +42 -0
- package/templates/ui/navigation-menu.tsx +130 -90
- package/templates/ui/pagination.tsx +88 -73
- package/templates/ui/popover.tsx +67 -26
- package/templates/ui/progress.tsx +24 -18
- package/templates/ui/radio-group.tsx +26 -20
- package/templates/ui/resizable.tsx +29 -29
- package/templates/ui/scroll-area.tsx +47 -38
- package/templates/ui/select.tsx +158 -125
- package/templates/ui/separator.tsx +21 -19
- package/templates/ui/sheet.tsx +104 -95
- package/templates/ui/sidebar.tsx +77 -183
- package/templates/ui/skeleton.tsx +8 -2
- package/templates/ui/slider.tsx +46 -17
- package/templates/ui/sonner.tsx +19 -9
- package/templates/ui/spinner.tsx +2 -2
- package/templates/ui/switch.tsx +24 -20
- package/templates/ui/table.tsx +68 -73
- package/templates/ui/tabs.tsx +71 -46
- package/templates/ui/textarea.tsx +13 -16
- package/templates/ui/toggle-group.tsx +57 -28
- package/templates/ui/toggle.tsx +21 -20
- package/templates/ui/tooltip.tsx +44 -23
- package/dist/drizzle-config-KISB26BA.js +0 -7
- package/templates/ui/use-mobile.tsx +0 -19
- /package/dist/{drizzle-config-KISB26BA.js.map → drizzle-config-EDKOEZ6G.js.map} +0 -0
package/templates/ui/label.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { cn } from '@cms/utils/cn'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as React from 'react'
|
|
4
|
+
import { Label as LabelPrimitive } from 'radix-ui'
|
|
5
|
+
import type * as React from 'react'
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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-
|
|
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>
|
package/templates/ui/menubar.tsx
CHANGED
|
@@ -1,230 +1,262 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { cn } from '@cms/utils/cn'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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
|
|
25
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 }
|