@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.
- package/README.md +14 -0
- package/dist/index.js +392 -344
- package/package.json +5 -5
- package/templates/accordion/accordion.tsx +1 -1
- package/templates/alert-dialog/alert-dialog.tsx +1 -1
- package/templates/autocomplete/autocomplete.tsx +197 -0
- package/templates/autocomplete/index.ts +17 -0
- package/templates/avatar/avatar.tsx +4 -4
- package/templates/checkbox/checkbox.tsx +2 -2
- package/templates/checkbox-group/checkbox-group.tsx +2 -2
- package/templates/collapsible/collapsible.tsx +4 -4
- package/templates/combobox/combobox.tsx +202 -0
- package/templates/combobox/index.ts +17 -0
- package/templates/context-menu/context-menu.tsx +119 -54
- package/templates/dialog/dialog.tsx +1 -1
- package/templates/drawer/drawer.tsx +109 -0
- package/templates/drawer/index.ts +12 -0
- package/templates/field/field.tsx +1 -1
- package/templates/fieldset/fieldset.tsx +32 -0
- package/templates/fieldset/index.ts +1 -0
- package/templates/form/form.tsx +3 -3
- package/templates/input/input.tsx +23 -15
- package/templates/menu/index.ts +17 -0
- package/templates/menu/menu.tsx +282 -0
- package/templates/menubar/menubar.tsx +22 -22
- package/templates/meter/index.ts +1 -0
- package/templates/meter/meter.tsx +64 -0
- package/templates/navigation-menu/navigation-menu.tsx +13 -13
- package/templates/number-field/index.ts +9 -0
- package/templates/number-field/number-field.tsx +114 -0
- package/templates/popover/index.ts +12 -0
- package/templates/popover/popover.tsx +137 -0
- package/templates/preview-card/preview-card.tsx +10 -11
- package/templates/progress/index.ts +7 -0
- package/templates/progress/progress.tsx +64 -0
- package/templates/radio/index.ts +1 -0
- package/templates/radio/radio.tsx +39 -0
- package/templates/scroll-area/index.ts +8 -0
- package/templates/scroll-area/scroll-area.tsx +94 -0
- package/templates/select/select.tsx +8 -8
- package/templates/separator/index.ts +1 -0
- package/templates/separator/separator.tsx +25 -0
- package/templates/slider/slider.tsx +10 -10
- package/templates/switch/index.ts +1 -0
- package/templates/switch/switch.tsx +42 -0
- package/templates/tabs/tabs.tsx +6 -6
- package/templates/toast/toast.tsx +1 -1
- package/templates/toggle/toggle.tsx +2 -2
- package/templates/toggle-group/index.ts +1 -0
- package/templates/toggle-group/toggle-group.tsx +67 -0
- package/templates/toolbar/toolbar.tsx +7 -7
- package/templates/tooltip/tooltip.tsx +38 -23
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu"
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render"
|
|
7
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
|
|
10
|
+
const Menu = React.forwardRef<
|
|
11
|
+
React.ComponentRef<typeof MenuPrimitive.Root>,
|
|
12
|
+
React.ComponentProps<typeof MenuPrimitive.Root>
|
|
13
|
+
>(({ children, ...props }, ref) => {
|
|
14
|
+
const element = useRender({
|
|
15
|
+
render: <MenuPrimitive.Root>{children}</MenuPrimitive.Root>,
|
|
16
|
+
props,
|
|
17
|
+
ref,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
return element
|
|
21
|
+
})
|
|
22
|
+
Menu.displayName = "Menu"
|
|
23
|
+
|
|
24
|
+
const MenuTrigger = React.forwardRef<
|
|
25
|
+
HTMLButtonElement,
|
|
26
|
+
React.ComponentProps<typeof MenuPrimitive.Trigger>
|
|
27
|
+
>(({ className, ...props }, ref) => (
|
|
28
|
+
<MenuPrimitive.Trigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium",
|
|
32
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
33
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
34
|
+
"data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
|
|
35
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
))
|
|
41
|
+
MenuTrigger.displayName = "MenuTrigger"
|
|
42
|
+
|
|
43
|
+
const MenuPortal = React.forwardRef<
|
|
44
|
+
React.ComponentRef<typeof MenuPrimitive.Portal>,
|
|
45
|
+
React.ComponentProps<typeof MenuPrimitive.Portal>
|
|
46
|
+
>(({ ...props }, ref) => {
|
|
47
|
+
const element = useRender({
|
|
48
|
+
render: <MenuPrimitive.Portal />,
|
|
49
|
+
props,
|
|
50
|
+
ref,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return element
|
|
54
|
+
})
|
|
55
|
+
MenuPortal.displayName = "MenuPortal"
|
|
56
|
+
|
|
57
|
+
const MenuPositioner = React.forwardRef<
|
|
58
|
+
React.ComponentRef<typeof MenuPrimitive.Positioner>,
|
|
59
|
+
React.ComponentProps<typeof MenuPrimitive.Positioner>
|
|
60
|
+
>(({ className, ...props }, ref) => (
|
|
61
|
+
<MenuPrimitive.Positioner
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cn("outline-none", className)}
|
|
64
|
+
sideOffset={6}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
))
|
|
68
|
+
MenuPositioner.displayName = "MenuPositioner"
|
|
69
|
+
|
|
70
|
+
const MenuContent = React.forwardRef<
|
|
71
|
+
React.ComponentRef<typeof MenuPrimitive.Popup>,
|
|
72
|
+
React.ComponentProps<typeof MenuPrimitive.Popup>
|
|
73
|
+
>(({ className, ...props }, ref) => (
|
|
74
|
+
<MenuPortal>
|
|
75
|
+
<MenuPositioner>
|
|
76
|
+
<MenuPrimitive.Popup
|
|
77
|
+
ref={ref}
|
|
78
|
+
className={cn(
|
|
79
|
+
"z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
80
|
+
"origin-[var(--transform-origin)] outline-none",
|
|
81
|
+
"data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
|
|
82
|
+
"data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
|
|
83
|
+
className
|
|
84
|
+
)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
</MenuPositioner>
|
|
88
|
+
</MenuPortal>
|
|
89
|
+
))
|
|
90
|
+
MenuContent.displayName = "MenuContent"
|
|
91
|
+
|
|
92
|
+
const MenuItem = React.forwardRef<
|
|
93
|
+
React.ComponentRef<typeof MenuPrimitive.Item>,
|
|
94
|
+
React.ComponentProps<typeof MenuPrimitive.Item> & {
|
|
95
|
+
inset?: boolean
|
|
96
|
+
}
|
|
97
|
+
>(({ className, inset, ...props }, ref) => (
|
|
98
|
+
<MenuPrimitive.Item
|
|
99
|
+
ref={ref}
|
|
100
|
+
className={cn(
|
|
101
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
102
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
103
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
104
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
105
|
+
inset && "pl-8",
|
|
106
|
+
className
|
|
107
|
+
)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
))
|
|
111
|
+
MenuItem.displayName = "MenuItem"
|
|
112
|
+
|
|
113
|
+
const MenuCheckboxItem = React.forwardRef<
|
|
114
|
+
React.ComponentRef<typeof MenuPrimitive.CheckboxItem>,
|
|
115
|
+
React.ComponentProps<typeof MenuPrimitive.CheckboxItem>
|
|
116
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
117
|
+
<MenuPrimitive.CheckboxItem
|
|
118
|
+
ref={ref}
|
|
119
|
+
className={cn(
|
|
120
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
121
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
122
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
123
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
124
|
+
className
|
|
125
|
+
)}
|
|
126
|
+
checked={checked}
|
|
127
|
+
{...props}
|
|
128
|
+
>
|
|
129
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
130
|
+
{checked && <Check className="h-4 w-4" />}
|
|
131
|
+
</span>
|
|
132
|
+
{children}
|
|
133
|
+
</MenuPrimitive.CheckboxItem>
|
|
134
|
+
))
|
|
135
|
+
MenuCheckboxItem.displayName = "MenuCheckboxItem"
|
|
136
|
+
|
|
137
|
+
const MenuRadioGroup = React.forwardRef<
|
|
138
|
+
React.ComponentRef<typeof MenuPrimitive.RadioGroup>,
|
|
139
|
+
React.ComponentProps<typeof MenuPrimitive.RadioGroup>
|
|
140
|
+
>(({ className, ...props }, ref) => (
|
|
141
|
+
<MenuPrimitive.RadioGroup ref={ref} className={cn(className)} {...props} />
|
|
142
|
+
))
|
|
143
|
+
MenuRadioGroup.displayName = "MenuRadioGroup"
|
|
144
|
+
|
|
145
|
+
const MenuRadioItem = React.forwardRef<
|
|
146
|
+
React.ComponentRef<typeof MenuPrimitive.RadioItem>,
|
|
147
|
+
React.ComponentProps<typeof MenuPrimitive.RadioItem>
|
|
148
|
+
>(({ className, children, ...props }, ref) => (
|
|
149
|
+
<MenuPrimitive.RadioItem
|
|
150
|
+
ref={ref}
|
|
151
|
+
className={cn(
|
|
152
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
153
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
154
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
155
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
156
|
+
className
|
|
157
|
+
)}
|
|
158
|
+
{...props}
|
|
159
|
+
>
|
|
160
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
161
|
+
<Circle className="h-2 w-2 fill-current data-[checked]:block data-[unchecked]:hidden" />
|
|
162
|
+
</span>
|
|
163
|
+
{children}
|
|
164
|
+
</MenuPrimitive.RadioItem>
|
|
165
|
+
))
|
|
166
|
+
MenuRadioItem.displayName = "MenuRadioItem"
|
|
167
|
+
|
|
168
|
+
const MenuLabel = React.forwardRef<
|
|
169
|
+
React.ComponentRef<typeof MenuPrimitive.GroupLabel>,
|
|
170
|
+
React.ComponentProps<typeof MenuPrimitive.GroupLabel> & {
|
|
171
|
+
inset?: boolean
|
|
172
|
+
}
|
|
173
|
+
>(({ className, inset, ...props }, ref) => (
|
|
174
|
+
<MenuPrimitive.GroupLabel
|
|
175
|
+
ref={ref}
|
|
176
|
+
className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
))
|
|
180
|
+
MenuLabel.displayName = "MenuLabel"
|
|
181
|
+
|
|
182
|
+
const MenuSeparator = React.forwardRef<
|
|
183
|
+
React.ComponentRef<typeof MenuPrimitive.Separator>,
|
|
184
|
+
React.ComponentProps<typeof MenuPrimitive.Separator>
|
|
185
|
+
>(({ className, ...props }, ref) => (
|
|
186
|
+
<MenuPrimitive.Separator
|
|
187
|
+
ref={ref}
|
|
188
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
))
|
|
192
|
+
MenuSeparator.displayName = "MenuSeparator"
|
|
193
|
+
|
|
194
|
+
const MenuShortcut = ({
|
|
195
|
+
className,
|
|
196
|
+
...props
|
|
197
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => (
|
|
198
|
+
<span
|
|
199
|
+
className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
|
|
200
|
+
{...props}
|
|
201
|
+
/>
|
|
202
|
+
)
|
|
203
|
+
MenuShortcut.displayName = "MenuShortcut"
|
|
204
|
+
|
|
205
|
+
const MenuSub = React.forwardRef<
|
|
206
|
+
React.ComponentRef<typeof MenuPrimitive.Root>,
|
|
207
|
+
React.ComponentProps<typeof MenuPrimitive.Root>
|
|
208
|
+
>(({ children, ...props }, ref) => {
|
|
209
|
+
const element = useRender({
|
|
210
|
+
render: <MenuPrimitive.Root>{children}</MenuPrimitive.Root>,
|
|
211
|
+
props,
|
|
212
|
+
ref,
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
return element
|
|
216
|
+
})
|
|
217
|
+
MenuSub.displayName = "MenuSub"
|
|
218
|
+
|
|
219
|
+
const MenuSubTrigger = React.forwardRef<
|
|
220
|
+
React.ComponentRef<typeof MenuPrimitive.SubmenuTrigger>,
|
|
221
|
+
React.ComponentProps<typeof MenuPrimitive.SubmenuTrigger> & {
|
|
222
|
+
inset?: boolean
|
|
223
|
+
}
|
|
224
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
225
|
+
<MenuPrimitive.SubmenuTrigger
|
|
226
|
+
ref={ref}
|
|
227
|
+
className={cn(
|
|
228
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
229
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
230
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
231
|
+
"data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
|
|
232
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
233
|
+
inset && "pl-8",
|
|
234
|
+
className
|
|
235
|
+
)}
|
|
236
|
+
{...props}
|
|
237
|
+
>
|
|
238
|
+
{children}
|
|
239
|
+
<ChevronRight className="ml-auto h-4 w-4" />
|
|
240
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
241
|
+
))
|
|
242
|
+
MenuSubTrigger.displayName = "MenuSubTrigger"
|
|
243
|
+
|
|
244
|
+
const MenuSubContent = React.forwardRef<
|
|
245
|
+
React.ComponentRef<typeof MenuPrimitive.Popup>,
|
|
246
|
+
React.ComponentProps<typeof MenuPrimitive.Popup>
|
|
247
|
+
>(({ className, ...props }, ref) => (
|
|
248
|
+
<MenuPrimitive.Portal>
|
|
249
|
+
<MenuPrimitive.Positioner className="outline-none" alignOffset={-4} sideOffset={8}>
|
|
250
|
+
<MenuPrimitive.Popup
|
|
251
|
+
ref={ref}
|
|
252
|
+
className={cn(
|
|
253
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
254
|
+
"origin-[var(--transform-origin)] outline-none",
|
|
255
|
+
"data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
|
|
256
|
+
"data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
|
|
257
|
+
className
|
|
258
|
+
)}
|
|
259
|
+
{...props}
|
|
260
|
+
/>
|
|
261
|
+
</MenuPrimitive.Positioner>
|
|
262
|
+
</MenuPrimitive.Portal>
|
|
263
|
+
))
|
|
264
|
+
MenuSubContent.displayName = "MenuSubContent"
|
|
265
|
+
|
|
266
|
+
export {
|
|
267
|
+
Menu,
|
|
268
|
+
MenuTrigger,
|
|
269
|
+
MenuPortal,
|
|
270
|
+
MenuPositioner,
|
|
271
|
+
MenuContent,
|
|
272
|
+
MenuItem,
|
|
273
|
+
MenuCheckboxItem,
|
|
274
|
+
MenuRadioGroup,
|
|
275
|
+
MenuRadioItem,
|
|
276
|
+
MenuLabel,
|
|
277
|
+
MenuSeparator,
|
|
278
|
+
MenuShortcut,
|
|
279
|
+
MenuSub,
|
|
280
|
+
MenuSubTrigger,
|
|
281
|
+
MenuSubContent,
|
|
282
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
"use client"
|
|
3
|
+
|
|
3
4
|
import * as React from "react"
|
|
4
|
-
import { Menubar as BaseMenubar } from "@base-ui
|
|
5
|
-
import { Menu } from "@base-ui
|
|
5
|
+
import { Menubar as BaseMenubar } from "@base-ui/react/menubar"
|
|
6
|
+
import { Menu } from "@base-ui/react/menu"
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render"
|
|
6
8
|
import { cn } from "@/lib/utils"
|
|
7
9
|
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
8
|
-
import { useRender } from "@base-ui-components/react/use-render"
|
|
9
|
-
|
|
10
10
|
|
|
11
11
|
const Menubar = React.forwardRef<
|
|
12
|
-
React.
|
|
12
|
+
React.ComponentRef<typeof BaseMenubar>,
|
|
13
13
|
React.ComponentProps<typeof BaseMenubar>
|
|
14
14
|
>(({ className, ...props }, ref) => (
|
|
15
15
|
<BaseMenubar
|
|
@@ -24,7 +24,7 @@ const Menubar = React.forwardRef<
|
|
|
24
24
|
Menubar.displayName = "Menubar"
|
|
25
25
|
|
|
26
26
|
const MenubarMenu = React.forwardRef<
|
|
27
|
-
React.
|
|
27
|
+
React.ComponentRef<typeof Menu.Root>,
|
|
28
28
|
React.ComponentProps<typeof Menu.Root>
|
|
29
29
|
>(({ children, ...props }, ref) => {
|
|
30
30
|
const element = useRender({
|
|
@@ -37,7 +37,7 @@ const MenubarMenu = React.forwardRef<
|
|
|
37
37
|
MenubarMenu.displayName = "MenubarMenu"
|
|
38
38
|
|
|
39
39
|
const MenubarTrigger = React.forwardRef<
|
|
40
|
-
|
|
40
|
+
HTMLButtonElement,
|
|
41
41
|
React.ComponentProps<typeof Menu.Trigger>
|
|
42
42
|
>(({ className, ...props }, ref) => (
|
|
43
43
|
<Menu.Trigger
|
|
@@ -56,7 +56,7 @@ const MenubarTrigger = React.forwardRef<
|
|
|
56
56
|
MenubarTrigger.displayName = "MenubarTrigger"
|
|
57
57
|
|
|
58
58
|
const MenubarPortal = React.forwardRef<
|
|
59
|
-
React.
|
|
59
|
+
React.ComponentRef<typeof Menu.Portal>,
|
|
60
60
|
React.ComponentProps<typeof Menu.Portal>
|
|
61
61
|
>(({ ...props }, ref) => {
|
|
62
62
|
const element = useRender({
|
|
@@ -69,7 +69,7 @@ const MenubarPortal = React.forwardRef<
|
|
|
69
69
|
MenubarPortal.displayName = "MenubarPortal"
|
|
70
70
|
|
|
71
71
|
const MenubarPositioner = React.forwardRef<
|
|
72
|
-
React.
|
|
72
|
+
React.ComponentRef<typeof Menu.Positioner>,
|
|
73
73
|
React.ComponentProps<typeof Menu.Positioner>
|
|
74
74
|
>(({ className, ...props }, ref) => (
|
|
75
75
|
<Menu.Positioner
|
|
@@ -82,7 +82,7 @@ const MenubarPositioner = React.forwardRef<
|
|
|
82
82
|
MenubarPositioner.displayName = "MenubarPositioner"
|
|
83
83
|
|
|
84
84
|
const MenubarContent = React.forwardRef<
|
|
85
|
-
React.
|
|
85
|
+
React.ComponentRef<typeof Menu.Popup>,
|
|
86
86
|
React.ComponentProps<typeof Menu.Popup>
|
|
87
87
|
>(({ className, ...props }, ref) => (
|
|
88
88
|
<Menu.Popup
|
|
@@ -101,7 +101,7 @@ const MenubarContent = React.forwardRef<
|
|
|
101
101
|
MenubarContent.displayName = "MenubarContent"
|
|
102
102
|
|
|
103
103
|
const MenubarItem = React.forwardRef<
|
|
104
|
-
React.
|
|
104
|
+
React.ComponentRef<typeof Menu.Item>,
|
|
105
105
|
React.ComponentProps<typeof Menu.Item> & {
|
|
106
106
|
inset?: boolean
|
|
107
107
|
}
|
|
@@ -122,7 +122,7 @@ const MenubarItem = React.forwardRef<
|
|
|
122
122
|
MenubarItem.displayName = "MenubarItem"
|
|
123
123
|
|
|
124
124
|
const MenubarCheckboxItem = React.forwardRef<
|
|
125
|
-
React.
|
|
125
|
+
React.ComponentRef<typeof Menu.CheckboxItem>,
|
|
126
126
|
React.ComponentProps<typeof Menu.CheckboxItem>
|
|
127
127
|
>(({ className, children, checked, ...props }, ref) => (
|
|
128
128
|
<Menu.CheckboxItem
|
|
@@ -146,7 +146,7 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
|
146
146
|
MenubarCheckboxItem.displayName = "MenubarCheckboxItem"
|
|
147
147
|
|
|
148
148
|
const MenubarRadioGroup = React.forwardRef<
|
|
149
|
-
React.
|
|
149
|
+
React.ComponentRef<typeof Menu.RadioGroup>,
|
|
150
150
|
React.ComponentProps<typeof Menu.RadioGroup>
|
|
151
151
|
>(({ className, ...props }, ref) => (
|
|
152
152
|
<Menu.RadioGroup ref={ref} className={cn(className)} {...props} />
|
|
@@ -154,7 +154,7 @@ const MenubarRadioGroup = React.forwardRef<
|
|
|
154
154
|
MenubarRadioGroup.displayName = "MenubarRadioGroup"
|
|
155
155
|
|
|
156
156
|
const MenubarRadioItem = React.forwardRef<
|
|
157
|
-
React.
|
|
157
|
+
React.ComponentRef<typeof Menu.RadioItem>,
|
|
158
158
|
React.ComponentProps<typeof Menu.RadioItem>
|
|
159
159
|
>(({ className, children, ...props }, ref) => (
|
|
160
160
|
<Menu.RadioItem
|
|
@@ -177,7 +177,7 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
177
177
|
MenubarRadioItem.displayName = "MenubarRadioItem"
|
|
178
178
|
|
|
179
179
|
const MenubarLabel = React.forwardRef<
|
|
180
|
-
React.
|
|
180
|
+
React.ComponentRef<typeof Menu.GroupLabel>,
|
|
181
181
|
React.ComponentProps<typeof Menu.GroupLabel> & {
|
|
182
182
|
inset?: boolean
|
|
183
183
|
}
|
|
@@ -195,7 +195,7 @@ const MenubarLabel = React.forwardRef<
|
|
|
195
195
|
MenubarLabel.displayName = "MenubarLabel"
|
|
196
196
|
|
|
197
197
|
const MenubarSeparator = React.forwardRef<
|
|
198
|
-
React.
|
|
198
|
+
React.ComponentRef<typeof Menu.Separator>,
|
|
199
199
|
React.ComponentProps<typeof Menu.Separator>
|
|
200
200
|
>(({ className, ...props }, ref) => (
|
|
201
201
|
<Menu.Separator
|
|
@@ -223,11 +223,11 @@ const MenubarShortcut = ({
|
|
|
223
223
|
MenubarShortcut.displayName = "MenubarShortcut"
|
|
224
224
|
|
|
225
225
|
const MenubarSub = React.forwardRef<
|
|
226
|
-
React.
|
|
227
|
-
React.ComponentProps<typeof Menu.
|
|
226
|
+
React.ComponentRef<typeof Menu.SubmenuRoot>,
|
|
227
|
+
React.ComponentProps<typeof Menu.SubmenuRoot>
|
|
228
228
|
>(({ children, ...props }, ref) => {
|
|
229
229
|
const element = useRender({
|
|
230
|
-
render: <Menu.
|
|
230
|
+
render: <Menu.SubmenuRoot>{children}</Menu.SubmenuRoot>,
|
|
231
231
|
props,
|
|
232
232
|
ref,
|
|
233
233
|
});
|
|
@@ -236,7 +236,7 @@ const MenubarSub = React.forwardRef<
|
|
|
236
236
|
MenubarSub.displayName = "MenubarSub"
|
|
237
237
|
|
|
238
238
|
const MenubarSubTrigger = React.forwardRef<
|
|
239
|
-
React.
|
|
239
|
+
React.ComponentRef<typeof Menu.SubmenuTrigger>,
|
|
240
240
|
React.ComponentProps<typeof Menu.SubmenuTrigger> & {
|
|
241
241
|
inset?: boolean
|
|
242
242
|
}
|
|
@@ -261,7 +261,7 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
261
261
|
MenubarSubTrigger.displayName = "MenubarSubTrigger"
|
|
262
262
|
|
|
263
263
|
const MenubarSubContent = React.forwardRef<
|
|
264
|
-
React.
|
|
264
|
+
React.ComponentRef<typeof Menu.Popup>,
|
|
265
265
|
React.ComponentProps<typeof Menu.Popup>
|
|
266
266
|
>(({ className, ...props }, ref) => (
|
|
267
267
|
<Menu.Portal>
|
|
@@ -300,4 +300,4 @@ export {
|
|
|
300
300
|
MenubarSub,
|
|
301
301
|
MenubarSubTrigger,
|
|
302
302
|
MenubarSubContent,
|
|
303
|
-
}
|
|
303
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Meter, MeterTrack, MeterIndicator, MeterLabel, MeterValue } from "./meter"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { Meter as MeterPrimitive } from "@base-ui/react/meter"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const Meter = React.forwardRef<
|
|
9
|
+
React.ComponentRef<typeof MeterPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof MeterPrimitive.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<MeterPrimitive.Root ref={ref} className={cn("grid gap-2", className)} {...props} />
|
|
13
|
+
))
|
|
14
|
+
Meter.displayName = "Meter"
|
|
15
|
+
|
|
16
|
+
const MeterTrack = React.forwardRef<
|
|
17
|
+
React.ComponentRef<typeof MeterPrimitive.Track>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof MeterPrimitive.Track>
|
|
19
|
+
>(({ className, ...props }, ref) => (
|
|
20
|
+
<MeterPrimitive.Track
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn("relative h-2 w-full overflow-hidden rounded-full bg-secondary", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
MeterTrack.displayName = "MeterTrack"
|
|
27
|
+
|
|
28
|
+
const MeterIndicator = React.forwardRef<
|
|
29
|
+
React.ComponentRef<typeof MeterPrimitive.Indicator>,
|
|
30
|
+
React.ComponentPropsWithoutRef<typeof MeterPrimitive.Indicator>
|
|
31
|
+
>(({ className, ...props }, ref) => (
|
|
32
|
+
<MeterPrimitive.Indicator
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn("h-full rounded-full bg-primary transition-[width] duration-200", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
))
|
|
38
|
+
MeterIndicator.displayName = "MeterIndicator"
|
|
39
|
+
|
|
40
|
+
const MeterLabel = React.forwardRef<
|
|
41
|
+
React.ComponentRef<typeof MeterPrimitive.Label>,
|
|
42
|
+
React.ComponentPropsWithoutRef<typeof MeterPrimitive.Label>
|
|
43
|
+
>(({ className, ...props }, ref) => (
|
|
44
|
+
<MeterPrimitive.Label
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn("text-sm font-medium leading-none", className)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
))
|
|
50
|
+
MeterLabel.displayName = "MeterLabel"
|
|
51
|
+
|
|
52
|
+
const MeterValue = React.forwardRef<
|
|
53
|
+
React.ComponentRef<typeof MeterPrimitive.Value>,
|
|
54
|
+
React.ComponentPropsWithoutRef<typeof MeterPrimitive.Value>
|
|
55
|
+
>(({ className, ...props }, ref) => (
|
|
56
|
+
<MeterPrimitive.Value
|
|
57
|
+
ref={ref}
|
|
58
|
+
className={cn("text-xs text-muted-foreground", className)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
))
|
|
62
|
+
MeterValue.displayName = "MeterValue"
|
|
63
|
+
|
|
64
|
+
export { Meter, MeterTrack, MeterIndicator, MeterLabel, MeterValue }
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"use client"
|
|
3
3
|
|
|
4
4
|
import * as React from "react"
|
|
5
|
-
import { NavigationMenu as BaseNavigationMenu } from "@base-ui
|
|
5
|
+
import { NavigationMenu as BaseNavigationMenu } from "@base-ui/react/navigation-menu"
|
|
6
6
|
import { cn } from "@/lib/utils"
|
|
7
7
|
import { ChevronDown } from "lucide-react"
|
|
8
|
-
import { useRender } from "@base-ui
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
const NavigationMenu = React.forwardRef<
|
|
12
|
-
React.
|
|
12
|
+
React.ComponentRef<typeof BaseNavigationMenu.Root>,
|
|
13
13
|
React.ComponentProps<typeof BaseNavigationMenu.Root>
|
|
14
14
|
>(({ className, children, ...props }, ref) => (
|
|
15
15
|
<BaseNavigationMenu.Root
|
|
@@ -26,7 +26,7 @@ const NavigationMenu = React.forwardRef<
|
|
|
26
26
|
NavigationMenu.displayName = "NavigationMenu"
|
|
27
27
|
|
|
28
28
|
const NavigationMenuList = React.forwardRef<
|
|
29
|
-
React.
|
|
29
|
+
React.ComponentRef<typeof BaseNavigationMenu.List>,
|
|
30
30
|
React.ComponentProps<typeof BaseNavigationMenu.List>
|
|
31
31
|
>(({ className, ...props }, ref) => (
|
|
32
32
|
<BaseNavigationMenu.List
|
|
@@ -41,7 +41,7 @@ const NavigationMenuList = React.forwardRef<
|
|
|
41
41
|
NavigationMenuList.displayName = "NavigationMenuList"
|
|
42
42
|
|
|
43
43
|
const NavigationMenuItem = React.forwardRef<
|
|
44
|
-
React.
|
|
44
|
+
React.ComponentRef<typeof BaseNavigationMenu.Item>,
|
|
45
45
|
React.ComponentProps<typeof BaseNavigationMenu.Item>
|
|
46
46
|
>(({ className, ...props }, ref) => (
|
|
47
47
|
<BaseNavigationMenu.Item
|
|
@@ -53,7 +53,7 @@ const NavigationMenuItem = React.forwardRef<
|
|
|
53
53
|
NavigationMenuItem.displayName = "NavigationMenuItem"
|
|
54
54
|
|
|
55
55
|
const NavigationMenuTrigger = React.forwardRef<
|
|
56
|
-
React.
|
|
56
|
+
React.ComponentRef<typeof BaseNavigationMenu.Trigger>,
|
|
57
57
|
React.ComponentProps<typeof BaseNavigationMenu.Trigger>
|
|
58
58
|
>(({ className, children, ...props }, ref) => (
|
|
59
59
|
<BaseNavigationMenu.Trigger
|
|
@@ -79,7 +79,7 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
79
79
|
NavigationMenuTrigger.displayName = "NavigationMenuTrigger"
|
|
80
80
|
|
|
81
81
|
const NavigationMenuContent = React.forwardRef<
|
|
82
|
-
React.
|
|
82
|
+
React.ComponentRef<typeof BaseNavigationMenu.Content>,
|
|
83
83
|
React.ComponentProps<typeof BaseNavigationMenu.Content>
|
|
84
84
|
>(({ className, ...props }, ref) => (
|
|
85
85
|
<BaseNavigationMenu.Content
|
|
@@ -96,7 +96,7 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
96
96
|
NavigationMenuContent.displayName = "NavigationMenuContent"
|
|
97
97
|
|
|
98
98
|
const NavigationMenuLink = React.forwardRef<
|
|
99
|
-
React.
|
|
99
|
+
React.ComponentRef<typeof BaseNavigationMenu.Link>,
|
|
100
100
|
React.ComponentProps<typeof BaseNavigationMenu.Link>
|
|
101
101
|
>(({ className, ...props }, ref) => (
|
|
102
102
|
<BaseNavigationMenu.Link
|
|
@@ -113,7 +113,7 @@ const NavigationMenuLink = React.forwardRef<
|
|
|
113
113
|
NavigationMenuLink.displayName = "NavigationMenuLink"
|
|
114
114
|
|
|
115
115
|
const NavigationMenuPortal = React.forwardRef<
|
|
116
|
-
React.
|
|
116
|
+
React.ComponentRef<typeof BaseNavigationMenu.Portal>,
|
|
117
117
|
React.ComponentProps<typeof BaseNavigationMenu.Portal>
|
|
118
118
|
>(({ ...props }, ref) => {
|
|
119
119
|
const element = useRender({
|
|
@@ -126,7 +126,7 @@ const NavigationMenuPortal = React.forwardRef<
|
|
|
126
126
|
NavigationMenuPortal.displayName = "NavigationMenuPortal"
|
|
127
127
|
|
|
128
128
|
const NavigationMenuPositioner = React.forwardRef<
|
|
129
|
-
React.
|
|
129
|
+
React.ComponentRef<typeof BaseNavigationMenu.Positioner>,
|
|
130
130
|
React.ComponentProps<typeof BaseNavigationMenu.Positioner>
|
|
131
131
|
>(({ className, ...props }, ref) => (
|
|
132
132
|
<BaseNavigationMenu.Positioner
|
|
@@ -138,7 +138,7 @@ const NavigationMenuPositioner = React.forwardRef<
|
|
|
138
138
|
NavigationMenuPositioner.displayName = "NavigationMenuPositioner"
|
|
139
139
|
|
|
140
140
|
const NavigationMenuPopup = React.forwardRef<
|
|
141
|
-
React.
|
|
141
|
+
React.ComponentRef<typeof BaseNavigationMenu.Popup>,
|
|
142
142
|
React.ComponentProps<typeof BaseNavigationMenu.Popup>
|
|
143
143
|
>(({ className, ...props }, ref) => (
|
|
144
144
|
<BaseNavigationMenu.Popup
|
|
@@ -154,7 +154,7 @@ const NavigationMenuPopup = React.forwardRef<
|
|
|
154
154
|
NavigationMenuPopup.displayName = "NavigationMenuPopup"
|
|
155
155
|
|
|
156
156
|
const NavigationMenuViewport = React.forwardRef<
|
|
157
|
-
React.
|
|
157
|
+
React.ComponentRef<typeof BaseNavigationMenu.Viewport>,
|
|
158
158
|
React.ComponentProps<typeof BaseNavigationMenu.Viewport>
|
|
159
159
|
>(({ className, ...props }, ref) => (
|
|
160
160
|
<BaseNavigationMenu.Viewport
|
|
@@ -174,7 +174,7 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
174
174
|
NavigationMenuViewport.displayName = "NavigationMenuViewport"
|
|
175
175
|
|
|
176
176
|
const NavigationMenuIndicator = React.forwardRef<
|
|
177
|
-
React.
|
|
177
|
+
React.ComponentRef<"div">,
|
|
178
178
|
React.HTMLAttributes<HTMLDivElement>
|
|
179
179
|
>(({ className, ...props }, ref) => (
|
|
180
180
|
<div
|