@dinachi/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +131 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +643 -0
  4. package/package.json +56 -0
  5. package/templates/accordion/accordion.tsx +85 -0
  6. package/templates/accordion/index.ts +1 -0
  7. package/templates/alert-dialog/alert-dialog.tsx +162 -0
  8. package/templates/alert-dialog/index.ts +13 -0
  9. package/templates/avatar/avatar.tsx +64 -0
  10. package/templates/avatar/index.ts +1 -0
  11. package/templates/button/button.tsx +54 -0
  12. package/templates/button/index.ts +2 -0
  13. package/templates/checkbox/checkbox.tsx +29 -0
  14. package/templates/checkbox/index.ts +1 -0
  15. package/templates/checkbox-group/checkbox-group.tsx +19 -0
  16. package/templates/checkbox-group/index.ts +1 -0
  17. package/templates/collapsible/collapsible.tsx +65 -0
  18. package/templates/collapsible/index.ts +1 -0
  19. package/templates/context-menu/context-menu.tsx +278 -0
  20. package/templates/context-menu/index.ts +17 -0
  21. package/templates/dialog/dialog.tsx +158 -0
  22. package/templates/dialog/index.ts +1 -0
  23. package/templates/field/field.tsx +119 -0
  24. package/templates/field/index.ts +1 -0
  25. package/templates/form/form.tsx +71 -0
  26. package/templates/form/index.ts +1 -0
  27. package/templates/input/index.ts +2 -0
  28. package/templates/input/input.tsx +17 -0
  29. package/templates/menubar/index.ts +18 -0
  30. package/templates/menubar/menubar.tsx +303 -0
  31. package/templates/navigation-menu/index.ts +13 -0
  32. package/templates/navigation-menu/navigation-menu.tsx +205 -0
  33. package/templates/preview-card/index.ts +1 -0
  34. package/templates/preview-card/preview-card.tsx +142 -0
  35. package/templates/select/index.ts +1 -0
  36. package/templates/select/select.tsx +208 -0
  37. package/templates/slider/index.ts +9 -0
  38. package/templates/slider/slider.tsx +121 -0
  39. package/templates/tabs/index.ts +7 -0
  40. package/templates/tabs/tabs.tsx +89 -0
  41. package/templates/toast/index.ts +1 -0
  42. package/templates/toast/toast.tsx +276 -0
  43. package/templates/toggle/index.ts +1 -0
  44. package/templates/toggle/toggle.tsx +83 -0
  45. package/templates/toolbar/index.ts +1 -0
  46. package/templates/toolbar/toolbar.tsx +124 -0
  47. package/templates/tooltip/index.ts +1 -0
  48. package/templates/tooltip/tooltip.tsx +217 -0
  49. package/templates/utils/utils.ts +7 -0
  50. package/templates/utils/variants.ts +7 -0
@@ -0,0 +1,303 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+ import * as React from "react"
4
+ import { Menubar as BaseMenubar } from "@base-ui-components/react/menubar"
5
+ import { Menu } from "@base-ui-components/react/menu"
6
+ import { cn } from "@/lib/utils"
7
+ import { Check, ChevronRight, Circle } from "lucide-react"
8
+ import { useRender } from "@base-ui-components/react/use-render"
9
+
10
+
11
+ const Menubar = React.forwardRef<
12
+ React.ElementRef<typeof BaseMenubar>,
13
+ React.ComponentProps<typeof BaseMenubar>
14
+ >(({ className, ...props }, ref) => (
15
+ <BaseMenubar
16
+ ref={ref}
17
+ className={cn(
18
+ "flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ ))
24
+ Menubar.displayName = "Menubar"
25
+
26
+ const MenubarMenu = React.forwardRef<
27
+ React.ElementRef<typeof Menu.Root>,
28
+ React.ComponentProps<typeof Menu.Root>
29
+ >(({ children, ...props }, ref) => {
30
+ const element = useRender({
31
+ render: <Menu.Root>{children}</Menu.Root>,
32
+ props,
33
+ ref,
34
+ });
35
+ return element;
36
+ });
37
+ MenubarMenu.displayName = "MenubarMenu"
38
+
39
+ const MenubarTrigger = React.forwardRef<
40
+ React.ElementRef<typeof Menu.Trigger>,
41
+ React.ComponentProps<typeof Menu.Trigger>
42
+ >(({ className, ...props }, ref) => (
43
+ <Menu.Trigger
44
+ ref={ref}
45
+ className={cn(
46
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none",
47
+ "focus:bg-accent focus:text-accent-foreground",
48
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
49
+ "data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
50
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
51
+ className
52
+ )}
53
+ {...props}
54
+ />
55
+ ))
56
+ MenubarTrigger.displayName = "MenubarTrigger"
57
+
58
+ const MenubarPortal = React.forwardRef<
59
+ React.ElementRef<typeof Menu.Portal>,
60
+ React.ComponentProps<typeof Menu.Portal>
61
+ >(({ ...props }, ref) => {
62
+ const element = useRender({
63
+ render: <Menu.Portal />,
64
+ props,
65
+ ref,
66
+ });
67
+ return element;
68
+ });
69
+ MenubarPortal.displayName = "MenubarPortal"
70
+
71
+ const MenubarPositioner = React.forwardRef<
72
+ React.ElementRef<typeof Menu.Positioner>,
73
+ React.ComponentProps<typeof Menu.Positioner>
74
+ >(({ className, ...props }, ref) => (
75
+ <Menu.Positioner
76
+ ref={ref}
77
+ className={cn("outline-none", className)}
78
+ sideOffset={4}
79
+ {...props}
80
+ />
81
+ ))
82
+ MenubarPositioner.displayName = "MenubarPositioner"
83
+
84
+ const MenubarContent = React.forwardRef<
85
+ React.ElementRef<typeof Menu.Popup>,
86
+ React.ComponentProps<typeof Menu.Popup>
87
+ >(({ className, ...props }, ref) => (
88
+ <Menu.Popup
89
+ ref={ref}
90
+ className={cn(
91
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
92
+ "origin-[var(--transform-origin)]",
93
+ "outline-none focus:outline-none focus-visible:outline-none",
94
+ "data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
95
+ "data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
96
+ className
97
+ )}
98
+ {...props}
99
+ />
100
+ ))
101
+ MenubarContent.displayName = "MenubarContent"
102
+
103
+ const MenubarItem = React.forwardRef<
104
+ React.ElementRef<typeof Menu.Item>,
105
+ React.ComponentProps<typeof Menu.Item> & {
106
+ inset?: boolean
107
+ }
108
+ >(({ className, inset, ...props }, ref) => (
109
+ <Menu.Item
110
+ ref={ref}
111
+ className={cn(
112
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
113
+ "focus:bg-accent focus:text-accent-foreground",
114
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
115
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
116
+ inset && "pl-8",
117
+ className
118
+ )}
119
+ {...props}
120
+ />
121
+ ))
122
+ MenubarItem.displayName = "MenubarItem"
123
+
124
+ const MenubarCheckboxItem = React.forwardRef<
125
+ React.ElementRef<typeof Menu.CheckboxItem>,
126
+ React.ComponentProps<typeof Menu.CheckboxItem>
127
+ >(({ className, children, checked, ...props }, ref) => (
128
+ <Menu.CheckboxItem
129
+ ref={ref}
130
+ className={cn(
131
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
132
+ "focus:bg-accent focus:text-accent-foreground",
133
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
134
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
135
+ className
136
+ )}
137
+ checked={checked}
138
+ {...props}
139
+ >
140
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
141
+ {checked && <Check className="h-4 w-4" />}
142
+ </span>
143
+ {children}
144
+ </Menu.CheckboxItem>
145
+ ))
146
+ MenubarCheckboxItem.displayName = "MenubarCheckboxItem"
147
+
148
+ const MenubarRadioGroup = React.forwardRef<
149
+ React.ElementRef<typeof Menu.RadioGroup>,
150
+ React.ComponentProps<typeof Menu.RadioGroup>
151
+ >(({ className, ...props }, ref) => (
152
+ <Menu.RadioGroup ref={ref} className={cn(className)} {...props} />
153
+ ))
154
+ MenubarRadioGroup.displayName = "MenubarRadioGroup"
155
+
156
+ const MenubarRadioItem = React.forwardRef<
157
+ React.ElementRef<typeof Menu.RadioItem>,
158
+ React.ComponentProps<typeof Menu.RadioItem>
159
+ >(({ className, children, ...props }, ref) => (
160
+ <Menu.RadioItem
161
+ ref={ref}
162
+ className={cn(
163
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
164
+ "focus:bg-accent focus:text-accent-foreground",
165
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
166
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
167
+ className
168
+ )}
169
+ {...props}
170
+ >
171
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
172
+ <Circle className="h-2 w-2 fill-current data-[checked]:block data-[unchecked]:hidden" />
173
+ </span>
174
+ {children}
175
+ </Menu.RadioItem>
176
+ ))
177
+ MenubarRadioItem.displayName = "MenubarRadioItem"
178
+
179
+ const MenubarLabel = React.forwardRef<
180
+ React.ElementRef<typeof Menu.GroupLabel>,
181
+ React.ComponentProps<typeof Menu.GroupLabel> & {
182
+ inset?: boolean
183
+ }
184
+ >(({ className, inset, ...props }, ref) => (
185
+ <Menu.GroupLabel
186
+ ref={ref}
187
+ className={cn(
188
+ "px-2 py-1.5 text-sm font-semibold text-foreground",
189
+ inset && "pl-8",
190
+ className
191
+ )}
192
+ {...props}
193
+ />
194
+ ))
195
+ MenubarLabel.displayName = "MenubarLabel"
196
+
197
+ const MenubarSeparator = React.forwardRef<
198
+ React.ElementRef<typeof Menu.Separator>,
199
+ React.ComponentProps<typeof Menu.Separator>
200
+ >(({ className, ...props }, ref) => (
201
+ <Menu.Separator
202
+ ref={ref}
203
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
204
+ {...props}
205
+ />
206
+ ))
207
+ MenubarSeparator.displayName = "MenubarSeparator"
208
+
209
+ const MenubarShortcut = ({
210
+ className,
211
+ ...props
212
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
213
+ return (
214
+ <span
215
+ className={cn(
216
+ "ml-auto text-xs tracking-widest text-muted-foreground",
217
+ className
218
+ )}
219
+ {...props}
220
+ />
221
+ )
222
+ }
223
+ MenubarShortcut.displayName = "MenubarShortcut"
224
+
225
+ const MenubarSub = React.forwardRef<
226
+ React.ElementRef<typeof Menu.Root>,
227
+ React.ComponentProps<typeof Menu.Root>
228
+ >(({ children, ...props }, ref) => {
229
+ const element = useRender({
230
+ render: <Menu.Root>{children}</Menu.Root>,
231
+ props,
232
+ ref,
233
+ });
234
+ return element;
235
+ });
236
+ MenubarSub.displayName = "MenubarSub"
237
+
238
+ const MenubarSubTrigger = React.forwardRef<
239
+ React.ElementRef<typeof Menu.SubmenuTrigger>,
240
+ React.ComponentProps<typeof Menu.SubmenuTrigger> & {
241
+ inset?: boolean
242
+ }
243
+ >(({ className, inset, children, ...props }, ref) => (
244
+ <Menu.SubmenuTrigger
245
+ ref={ref}
246
+ className={cn(
247
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
248
+ "focus:bg-accent focus:text-accent-foreground",
249
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
250
+ "data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
251
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
252
+ inset && "pl-8",
253
+ className
254
+ )}
255
+ {...props}
256
+ >
257
+ {children}
258
+ <ChevronRight className="ml-auto h-4 w-4" />
259
+ </Menu.SubmenuTrigger>
260
+ ))
261
+ MenubarSubTrigger.displayName = "MenubarSubTrigger"
262
+
263
+ const MenubarSubContent = React.forwardRef<
264
+ React.ElementRef<typeof Menu.Popup>,
265
+ React.ComponentProps<typeof Menu.Popup>
266
+ >(({ className, ...props }, ref) => (
267
+ <Menu.Portal>
268
+ <Menu.Positioner className="outline-none" alignOffset={-4} sideOffset={8}>
269
+ <Menu.Popup
270
+ ref={ref}
271
+ className={cn(
272
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg",
273
+ "origin-[var(--transform-origin)]",
274
+ "outline-none focus:outline-none focus-visible:outline-none",
275
+ "data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
276
+ "data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
277
+ className
278
+ )}
279
+ {...props}
280
+ />
281
+ </Menu.Positioner>
282
+ </Menu.Portal>
283
+ ))
284
+ MenubarSubContent.displayName = "MenubarSubContent"
285
+
286
+ export {
287
+ Menubar,
288
+ MenubarMenu,
289
+ MenubarTrigger,
290
+ MenubarPortal,
291
+ MenubarPositioner,
292
+ MenubarContent,
293
+ MenubarItem,
294
+ MenubarCheckboxItem,
295
+ MenubarRadioGroup,
296
+ MenubarRadioItem,
297
+ MenubarLabel,
298
+ MenubarSeparator,
299
+ MenubarShortcut,
300
+ MenubarSub,
301
+ MenubarSubTrigger,
302
+ MenubarSubContent,
303
+ }
@@ -0,0 +1,13 @@
1
+ export {
2
+ NavigationMenu,
3
+ NavigationMenuList,
4
+ NavigationMenuItem,
5
+ NavigationMenuContent,
6
+ NavigationMenuTrigger,
7
+ NavigationMenuLink,
8
+ NavigationMenuIndicator,
9
+ NavigationMenuPortal,
10
+ NavigationMenuPositioner,
11
+ NavigationMenuPopup,
12
+ NavigationMenuViewport,
13
+ } from "./navigation-menu"
@@ -0,0 +1,205 @@
1
+ // @ts-nocheck
2
+ "use client"
3
+
4
+ import * as React from "react"
5
+ import { NavigationMenu as BaseNavigationMenu } from "@base-ui-components/react/navigation-menu"
6
+ import { cn } from "@/lib/utils"
7
+ import { ChevronDown } from "lucide-react"
8
+ import { useRender } from "@base-ui-components/react/use-render"
9
+
10
+
11
+ const NavigationMenu = React.forwardRef<
12
+ React.ElementRef<typeof BaseNavigationMenu.Root>,
13
+ React.ComponentProps<typeof BaseNavigationMenu.Root>
14
+ >(({ className, children, ...props }, ref) => (
15
+ <BaseNavigationMenu.Root
16
+ ref={ref}
17
+ className={cn(
18
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
19
+ className
20
+ )}
21
+ {...props}
22
+ >
23
+ {children}
24
+ </BaseNavigationMenu.Root>
25
+ ))
26
+ NavigationMenu.displayName = "NavigationMenu"
27
+
28
+ const NavigationMenuList = React.forwardRef<
29
+ React.ElementRef<typeof BaseNavigationMenu.List>,
30
+ React.ComponentProps<typeof BaseNavigationMenu.List>
31
+ >(({ className, ...props }, ref) => (
32
+ <BaseNavigationMenu.List
33
+ ref={ref}
34
+ className={cn(
35
+ "group flex flex-1 list-none items-center justify-center space-x-1",
36
+ className
37
+ )}
38
+ {...props}
39
+ />
40
+ ))
41
+ NavigationMenuList.displayName = "NavigationMenuList"
42
+
43
+ const NavigationMenuItem = React.forwardRef<
44
+ React.ElementRef<typeof BaseNavigationMenu.Item>,
45
+ React.ComponentProps<typeof BaseNavigationMenu.Item>
46
+ >(({ className, ...props }, ref) => (
47
+ <BaseNavigationMenu.Item
48
+ ref={ref}
49
+ className={cn("", className)}
50
+ {...props}
51
+ />
52
+ ))
53
+ NavigationMenuItem.displayName = "NavigationMenuItem"
54
+
55
+ const NavigationMenuTrigger = React.forwardRef<
56
+ React.ElementRef<typeof BaseNavigationMenu.Trigger>,
57
+ React.ComponentProps<typeof BaseNavigationMenu.Trigger>
58
+ >(({ className, children, ...props }, ref) => (
59
+ <BaseNavigationMenu.Trigger
60
+ ref={ref}
61
+ className={cn(
62
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors",
63
+ "hover:bg-accent hover:text-accent-foreground",
64
+ "focus:bg-accent focus:text-accent-foreground focus:outline-none",
65
+ "disabled:pointer-events-none disabled:opacity-50",
66
+ "data-[popup-open]:bg-accent/50",
67
+ className
68
+ )}
69
+ {...props}
70
+ >
71
+ {children}{" "}
72
+ <BaseNavigationMenu.Icon
73
+ render={
74
+ <ChevronDown className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[popup-open]:rotate-180" />
75
+ }
76
+ />
77
+ </BaseNavigationMenu.Trigger>
78
+ ))
79
+ NavigationMenuTrigger.displayName = "NavigationMenuTrigger"
80
+
81
+ const NavigationMenuContent = React.forwardRef<
82
+ React.ElementRef<typeof BaseNavigationMenu.Content>,
83
+ React.ComponentProps<typeof BaseNavigationMenu.Content>
84
+ >(({ className, ...props }, ref) => (
85
+ <BaseNavigationMenu.Content
86
+ ref={ref}
87
+ className={cn(
88
+ "left-0 top-0 w-full",
89
+ "data-[starting-style]:animate-in data-[starting-style]:fade-in",
90
+ "data-[ending-style]:animate-out data-[ending-style]:fade-out",
91
+ className
92
+ )}
93
+ {...props}
94
+ />
95
+ ))
96
+ NavigationMenuContent.displayName = "NavigationMenuContent"
97
+
98
+ const NavigationMenuLink = React.forwardRef<
99
+ React.ElementRef<typeof BaseNavigationMenu.Link>,
100
+ React.ComponentProps<typeof BaseNavigationMenu.Link>
101
+ >(({ className, ...props }, ref) => (
102
+ <BaseNavigationMenu.Link
103
+ ref={ref}
104
+ className={cn(
105
+ "block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors",
106
+ "hover:bg-accent hover:text-accent-foreground",
107
+ "focus:bg-accent focus:text-accent-foreground",
108
+ className
109
+ )}
110
+ {...props}
111
+ />
112
+ ))
113
+ NavigationMenuLink.displayName = "NavigationMenuLink"
114
+
115
+ const NavigationMenuPortal = React.forwardRef<
116
+ React.ElementRef<typeof BaseNavigationMenu.Portal>,
117
+ React.ComponentProps<typeof BaseNavigationMenu.Portal>
118
+ >(({ ...props }, ref) => {
119
+ const element = useRender({
120
+ render: <BaseNavigationMenu.Portal />,
121
+ props,
122
+ ref,
123
+ });
124
+ return element;
125
+ });
126
+ NavigationMenuPortal.displayName = "NavigationMenuPortal"
127
+
128
+ const NavigationMenuPositioner = React.forwardRef<
129
+ React.ElementRef<typeof BaseNavigationMenu.Positioner>,
130
+ React.ComponentProps<typeof BaseNavigationMenu.Positioner>
131
+ >(({ className, ...props }, ref) => (
132
+ <BaseNavigationMenu.Positioner
133
+ ref={ref}
134
+ className={cn("absolute left-0 top-full flex justify-center", className)}
135
+ {...props}
136
+ />
137
+ ))
138
+ NavigationMenuPositioner.displayName = "NavigationMenuPositioner"
139
+
140
+ const NavigationMenuPopup = React.forwardRef<
141
+ React.ElementRef<typeof BaseNavigationMenu.Popup>,
142
+ React.ComponentProps<typeof BaseNavigationMenu.Popup>
143
+ >(({ className, ...props }, ref) => (
144
+ <BaseNavigationMenu.Popup
145
+ ref={ref}
146
+ className={cn(
147
+ "data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-90",
148
+ "data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-90",
149
+ className
150
+ )}
151
+ {...props}
152
+ />
153
+ ))
154
+ NavigationMenuPopup.displayName = "NavigationMenuPopup"
155
+
156
+ const NavigationMenuViewport = React.forwardRef<
157
+ React.ElementRef<typeof BaseNavigationMenu.Viewport>,
158
+ React.ComponentProps<typeof BaseNavigationMenu.Viewport>
159
+ >(({ className, ...props }, ref) => (
160
+ <BaseNavigationMenu.Viewport
161
+ ref={ref}
162
+ className={cn(
163
+ "origin-top-center relative mt-1.5 h-auto w-auto overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg",
164
+ "data-[state=open]:animate-in data-[state=open]:zoom-in-90 data-[state=open]:fade-in",
165
+ "data-[state=closed]:animate-out data-[state=closed]:zoom-out-90 data-[state=closed]:fade-out",
166
+ className
167
+ )}
168
+ style={{
169
+ perspective: "2000px",
170
+ }}
171
+ {...props}
172
+ />
173
+ ))
174
+ NavigationMenuViewport.displayName = "NavigationMenuViewport"
175
+
176
+ const NavigationMenuIndicator = React.forwardRef<
177
+ React.ElementRef<"div">,
178
+ React.HTMLAttributes<HTMLDivElement>
179
+ >(({ className, ...props }, ref) => (
180
+ <div
181
+ ref={ref}
182
+ className={cn(
183
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=visible]:fade-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out",
184
+ className
185
+ )}
186
+ {...props}
187
+ >
188
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
189
+ </div>
190
+ ))
191
+ NavigationMenuIndicator.displayName = "NavigationMenuIndicator"
192
+
193
+ export {
194
+ NavigationMenu,
195
+ NavigationMenuList,
196
+ NavigationMenuItem,
197
+ NavigationMenuContent,
198
+ NavigationMenuTrigger,
199
+ NavigationMenuLink,
200
+ NavigationMenuIndicator,
201
+ NavigationMenuPortal,
202
+ NavigationMenuPositioner,
203
+ NavigationMenuPopup,
204
+ NavigationMenuViewport,
205
+ }
@@ -0,0 +1 @@
1
+ export * from "./preview-card"
@@ -0,0 +1,142 @@
1
+ // @ts-nocheck
2
+
3
+ "use client"
4
+
5
+ import * as React from "react"
6
+ import { PreviewCard as BasePreviewCard } from "@base-ui-components/react/preview-card"
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const PreviewCard = BasePreviewCard.Root
10
+
11
+ const PreviewCardTrigger = React.forwardRef<
12
+ React.ElementRef<typeof BasePreviewCard.Trigger>,
13
+ React.ComponentProps<typeof BasePreviewCard.Trigger>
14
+ >(({ className, ...props }, ref) => (
15
+ <BasePreviewCard.Trigger
16
+ ref={ref}
17
+ className={cn(
18
+ "text-blue-600 no-underline decoration-blue-600/60 decoration-1 underline-offset-2 outline-none",
19
+ "hover:underline focus-visible:rounded-sm focus-visible:no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",
20
+ "data-[popup-open]:underline data-[popup-open]:focus-visible:no-underline",
21
+ "dark:text-blue-400 dark:decoration-blue-400/60 dark:focus-visible:outline-blue-400",
22
+ className
23
+ )}
24
+ {...props}
25
+ />
26
+ ))
27
+ PreviewCardTrigger.displayName = "PreviewCardTrigger"
28
+
29
+ const PreviewCardPortal = BasePreviewCard.Portal
30
+
31
+ const PreviewCardBackdrop = React.forwardRef<
32
+ React.ElementRef<typeof BasePreviewCard.Backdrop>,
33
+ React.ComponentProps<typeof BasePreviewCard.Backdrop>
34
+ >(({ className, ...props }, ref) => (
35
+ <BasePreviewCard.Backdrop
36
+ ref={ref}
37
+ className={cn(
38
+ "fixed inset-0 z-40",
39
+ "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ ))
45
+ PreviewCardBackdrop.displayName = "PreviewCardBackdrop"
46
+
47
+ const PreviewCardPositioner = React.forwardRef<
48
+ React.ElementRef<typeof BasePreviewCard.Positioner>,
49
+ React.ComponentProps<typeof BasePreviewCard.Positioner>
50
+ >(({ className, sideOffset = 8, ...props }, ref) => (
51
+ <BasePreviewCard.Positioner
52
+ ref={ref}
53
+ sideOffset={sideOffset}
54
+ className={cn("z-50", className)}
55
+ {...props}
56
+ />
57
+ ))
58
+ PreviewCardPositioner.displayName = "PreviewCardPositioner"
59
+
60
+ const PreviewCardPopup = React.forwardRef<
61
+ React.ElementRef<typeof BasePreviewCard.Popup>,
62
+ React.ComponentProps<typeof BasePreviewCard.Popup>
63
+ >(({ className, ...props }, ref) => (
64
+ <BasePreviewCard.Popup
65
+ ref={ref}
66
+ className={cn(
67
+ "flex w-[280px] origin-[var(--transform-origin)] flex-col gap-3 rounded-lg bg-secondary/70 p-4 shadow-lg shadow-secondary/20",
68
+ "outline outline-1 outline-border",
69
+ "transition-[transform,scale,opacity] duration-200",
70
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
71
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
72
+ "bg-secondary/70 backdrop-blur-sm dark:shadow-none dark:-outline-offset-1",
73
+ className
74
+ )}
75
+ {...props}
76
+ />
77
+ ))
78
+ PreviewCardPopup.displayName = "PreviewCardPopup"
79
+
80
+ const PreviewCardArrow = React.forwardRef<
81
+ React.ElementRef<typeof BasePreviewCard.Arrow>,
82
+ React.ComponentProps<typeof BasePreviewCard.Arrow> & {
83
+ children?: React.ReactNode
84
+ }
85
+ >(({ className, children, ...props }, ref) => (
86
+ <BasePreviewCard.Arrow
87
+ ref={ref}
88
+ className={cn(
89
+ "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90",
90
+ "data-[side=right]:left-[-13px] data-[side=right]:-rotate-90",
91
+ "data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",
92
+ className
93
+ )}
94
+ {...props}
95
+ >
96
+ {children || <PreviewCardArrowSvg />}
97
+ </BasePreviewCard.Arrow>
98
+ ))
99
+ PreviewCardArrow.displayName = "PreviewCardArrow"
100
+
101
+ const PreviewCardContent = React.forwardRef<
102
+ React.ElementRef<typeof BasePreviewCard.Popup>,
103
+ React.ComponentProps<typeof BasePreviewCard.Popup>
104
+ >(({ className, children, ...props }, ref) => (
105
+ <PreviewCardPortal>
106
+ <PreviewCardPositioner>
107
+ <PreviewCardPopup ref={ref} className={className} {...props}>
108
+ <PreviewCardArrow />
109
+ {children}
110
+ </PreviewCardPopup>
111
+ </PreviewCardPositioner>
112
+ </PreviewCardPortal>
113
+ ))
114
+ PreviewCardContent.displayName = "PreviewCardContent"
115
+
116
+ function PreviewCardArrowSvg(props: React.ComponentProps<'svg'>) {
117
+ return (
118
+ <svg width="20" height="10" viewBox="0 0 20 10" fill="none" {...props}>
119
+ <path
120
+ d="M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z"
121
+ className="fill-secondary"
122
+ />
123
+
124
+ <path
125
+ d="M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z"
126
+ className="fill-border"
127
+ />
128
+ </svg>
129
+ )
130
+ }
131
+
132
+ export {
133
+ PreviewCard,
134
+ PreviewCardTrigger,
135
+ PreviewCardPortal,
136
+ PreviewCardBackdrop,
137
+ PreviewCardPositioner,
138
+ PreviewCardPopup,
139
+ PreviewCardArrow,
140
+ PreviewCardContent,
141
+ PreviewCardArrowSvg,
142
+ }
@@ -0,0 +1 @@
1
+ export * from "./select"